Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into renovate/google-cloud-common-0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Oct 3, 2018
2 parents 4c7cdee + 8ce2ae2 commit 3275960
Show file tree
Hide file tree
Showing 38 changed files with 256 additions and 231 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@
"system-test": "mocha system-test/*.js --timeout 600000",
"test-no-cover": "mocha test/*.js",
"test": "npm run cover",
"fix": "eslint --fix '**/*.js' && npm run prettier"
"fix": "eslint --fix '**/*.js'"
},
"dependencies": {
"@google-cloud/common": "^0.25.0",
"@google-cloud/paginator": "^0.1.1",
"@google-cloud/projectify": "^0.3.0",
"@google-cloud/promisify": "^0.3.1",
"arrify": "^1.0.1",
"async": "^2.6.1",
"create-error-class": "^3.0.2",
Expand Down
3 changes: 2 additions & 1 deletion src/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'use strict';

const common = require('@google-cloud/common');
const {promisifyAll} = require('@google-cloud/promisify');
const util = require('util');

/**
Expand Down Expand Up @@ -242,6 +243,6 @@ Address.prototype.delete = function(callback) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Address);
promisifyAll(Address);

module.exports = Address;
3 changes: 2 additions & 1 deletion src/autoscaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'use strict';

const common = require('@google-cloud/common');
const {promisifyAll} = require('@google-cloud/promisify');
const util = require('util');

/*! Developer Documentation
Expand Down Expand Up @@ -319,6 +320,6 @@ Autoscaler.prototype.setMetadata = function(metadata, callback) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Autoscaler);
promisifyAll(Autoscaler);

module.exports = Autoscaler;
3 changes: 2 additions & 1 deletion src/disk.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const extend = require('extend');
const format = require('string-format-obj');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

const Snapshot = require('./snapshot.js');

Expand Down Expand Up @@ -365,7 +366,7 @@ Disk.prototype.snapshot = function(name) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Disk, {
promisifyAll(Disk, {
exclude: ['snapshot'],
});

Expand Down
3 changes: 2 additions & 1 deletion src/firewall.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

const common = require('@google-cloud/common');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

/**
* A Firewall object allows you to interact with a Google Compute Engine
Expand Down Expand Up @@ -308,7 +309,7 @@ Firewall.prototype.setMetadata = function(metadata, callback) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Firewall);
promisifyAll(Firewall);

/**
* Reference to the {@link Firewall} class.
Expand Down
3 changes: 2 additions & 1 deletion src/health-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const common = require('@google-cloud/common');
const extend = require('extend');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

/**
* Health checks ensure that Compute Engine forwards new connections only to
Expand Down Expand Up @@ -310,7 +311,7 @@ HealthCheck.prototype.setMetadata = function(metadata, callback) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(HealthCheck);
promisifyAll(HealthCheck);

/**
* Reference to the {@link HealthCheck} class.
Expand Down
3 changes: 2 additions & 1 deletion src/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

const common = require('@google-cloud/common');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

/**
* An Image object allows you to interact with a Google Compute Engine image.
Expand Down Expand Up @@ -216,7 +217,7 @@ Image.prototype.delete = function(callback) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Image);
promisifyAll(Image);

/**
* Reference to the {@link Image} class.
Expand Down
52 changes: 21 additions & 31 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const extend = require('extend');
const format = require('string-format-obj');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');
const {paginator} = require('@google-cloud/paginator');

const Firewall = require('./firewall.js');
const HealthCheck = require('./health-check.js');
Expand Down Expand Up @@ -808,9 +810,7 @@ Compute.prototype.getAddresses = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getAddressesStream = common.paginator.streamify(
'getAddresses'
);
Compute.prototype.getAddressesStream = paginator.streamify('getAddresses');

/**
* Get a list of autoscalers. For a detailed description of this method's
Expand Down Expand Up @@ -947,9 +947,7 @@ Compute.prototype.getAutoscalers = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getAutoscalersStream = common.paginator.streamify(
'getAutoscalers'
);
Compute.prototype.getAutoscalersStream = paginator.streamify('getAutoscalers');

/**
* Get a list of disks.
Expand Down Expand Up @@ -1081,7 +1079,7 @@ Compute.prototype.getDisks = function(options, callback) {
* });
*/

Compute.prototype.getDisksStream = common.paginator.streamify('getDisks');
Compute.prototype.getDisksStream = paginator.streamify('getDisks');

/**
* Get a list of instance groups.
Expand Down Expand Up @@ -1215,7 +1213,7 @@ Compute.prototype.getInstanceGroups = function(options, callback) {
* });
*/

Compute.prototype.getInstanceGroupsStream = common.paginator.streamify(
Compute.prototype.getInstanceGroupsStream = paginator.streamify(
'getInstanceGroups'
);

Expand Down Expand Up @@ -1336,9 +1334,7 @@ Compute.prototype.getFirewalls = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getFirewallsStream = common.paginator.streamify(
'getFirewalls'
);
Compute.prototype.getFirewallsStream = paginator.streamify('getFirewalls');

/**
* Get a list of health checks.
Expand Down Expand Up @@ -1466,7 +1462,7 @@ Compute.prototype.getHealthChecks = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getHealthChecksStream = common.paginator.streamify(
Compute.prototype.getHealthChecksStream = paginator.streamify(
'getHealthChecks'
);

Expand Down Expand Up @@ -1586,7 +1582,7 @@ Compute.prototype.getImages = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getImagesStream = common.paginator.streamify('getImages');
Compute.prototype.getImagesStream = paginator.streamify('getImages');

/**
* Get a list of machine types in this project.
Expand Down Expand Up @@ -1720,7 +1716,7 @@ Compute.prototype.getMachineTypes = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getMachineTypesStream = common.paginator.streamify(
Compute.prototype.getMachineTypesStream = paginator.streamify(
'getMachineTypes'
);

Expand Down Expand Up @@ -1844,7 +1840,7 @@ Compute.prototype.getNetworks = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getNetworksStream = common.paginator.streamify('getNetworks');
Compute.prototype.getNetworksStream = paginator.streamify('getNetworks');

/**
* Get a list of global operations.
Expand Down Expand Up @@ -1967,9 +1963,7 @@ Compute.prototype.getOperations = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getOperationsStream = common.paginator.streamify(
'getOperations'
);
Compute.prototype.getOperationsStream = paginator.streamify('getOperations');

/**
* Return the regions available to your project.
Expand Down Expand Up @@ -2090,7 +2084,7 @@ Compute.prototype.getRegions = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getRegionsStream = common.paginator.streamify('getRegions');
Compute.prototype.getRegionsStream = paginator.streamify('getRegions');

/**
* Get a list of forwarding rules.
Expand Down Expand Up @@ -2211,7 +2205,7 @@ Compute.prototype.getRules = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getRulesStream = common.paginator.streamify('getRules');
Compute.prototype.getRulesStream = paginator.streamify('getRules');

/**
* Get a list of backend services.
Expand Down Expand Up @@ -2333,7 +2327,7 @@ Compute.prototype.getServices = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getServicesStream = common.paginator.streamify('getServices');
Compute.prototype.getServicesStream = paginator.streamify('getServices');

/**
* Get a list of snapshots.
Expand Down Expand Up @@ -2455,9 +2449,7 @@ Compute.prototype.getSnapshots = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getSnapshotsStream = common.paginator.streamify(
'getSnapshots'
);
Compute.prototype.getSnapshotsStream = paginator.streamify('getSnapshots');

/**
* Get a list of subnetworks in this project.
Expand Down Expand Up @@ -2593,9 +2585,7 @@ Compute.prototype.getSubnetworks = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getSubnetworksStream = common.paginator.streamify(
'getSubnetworks'
);
Compute.prototype.getSubnetworksStream = paginator.streamify('getSubnetworks');

/**
* Get a list of virtual machine instances.
Expand Down Expand Up @@ -2725,7 +2715,7 @@ Compute.prototype.getVMs = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getVMsStream = common.paginator.streamify('getVMs');
Compute.prototype.getVMsStream = paginator.streamify('getVMs');

/**
* Return the zones available to your project.
Expand Down Expand Up @@ -2846,7 +2836,7 @@ Compute.prototype.getZones = function(options, callback) {
* this.end();
* });
*/
Compute.prototype.getZonesStream = common.paginator.streamify('getZones');
Compute.prototype.getZonesStream = paginator.streamify('getZones');

/**
* Get a reference to a Google Compute Engine health check.
Expand Down Expand Up @@ -3034,7 +3024,7 @@ Compute.prototype.execAfterOperation_ = function(callback) {
*
* These methods can be auto-paginated.
*/
common.paginator.extend(Compute, [
paginator.extend(Compute, [
'getAddresses',
'getAutoscalers',
'getDisks',
Expand All @@ -3059,7 +3049,7 @@ common.paginator.extend(Compute, [
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Compute, {
promisifyAll(Compute, {
exclude: [
'address',
'autoscaler',
Expand Down
8 changes: 5 additions & 3 deletions src/instance-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const common = require('@google-cloud/common');
const extend = require('extend');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');
const {paginator} = require('@google-cloud/paginator');

/**
* You can create and manage groups of virtual machine instances so that you
Expand Down Expand Up @@ -465,7 +467,7 @@ InstanceGroup.prototype.getVMs = function(options, callback) {
* this.end();
* });
*/
InstanceGroup.prototype.getVMsStream = common.paginator.streamify('getVMs');
InstanceGroup.prototype.getVMsStream = paginator.streamify('getVMs');

/**
* Remove one or more VMs from this instance group.
Expand Down Expand Up @@ -601,13 +603,13 @@ InstanceGroup.prototype.setPorts = function(ports, callback) {
*
* These methods can be auto-paginated.
*/
common.paginator.extend(InstanceGroup, ['getVMs']);
paginator.extend(InstanceGroup, ['getVMs']);

/*! Developer Documentation
*
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(InstanceGroup);
promisifyAll(InstanceGroup);

module.exports = InstanceGroup;
3 changes: 2 additions & 1 deletion src/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const extend = require('extend');
const format = require('string-format-obj');
const is = require('is');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

/**
* A Network object allows you to interact with a Google Compute Engine network.
Expand Down Expand Up @@ -628,7 +629,7 @@ Network.prototype.getFirewallsStream = function(options) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Network, {
promisifyAll(Network, {
exclude: ['firewall'],
});

Expand Down
3 changes: 2 additions & 1 deletion src/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

const common = require('@google-cloud/common');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

/**
* An Operation object allows you to interact with a Google Compute Engine
Expand Down Expand Up @@ -288,7 +289,7 @@ Operation.prototype.poll_ = function(callback) {
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Operation);
promisifyAll(Operation);

/**
* Reference to the {@link Operation} class.
Expand Down
3 changes: 2 additions & 1 deletion src/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

const common = require('@google-cloud/common');
const util = require('util');
const {promisifyAll} = require('@google-cloud/promisify');

/**
* A Project object allows you to interact with your Google Compute Engine
Expand Down Expand Up @@ -112,7 +113,7 @@ util.inherits(Project, common.ServiceObject);
* All async methods (except for streams) will return a Promise in the event
* that a callback is omitted.
*/
common.util.promisifyAll(Project);
promisifyAll(Project);

/**
* Reference to the {@link Project} class.
Expand Down
Loading

0 comments on commit 3275960

Please sign in to comment.