How to use the @google-cloud/promisify.promisifyAll function in @google-cloud/promisify

To help you get started, we’ve selected a few @google-cloud/promisify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-compute / src / snapshot.js View on Github external
callback(err, null, resp);
        return;
      }
      const operation = compute.operation(resp.name);
      operation.metadata = resp;
      callback(null, operation, resp);
    });
  }
}

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

/**
 * Reference to the {@link Snapshot} class.
 * @name module:@google-cloud/compute.Snapshot
 * @see Snapshot
 */
module.exports = Snapshot;
github googleapis / nodejs-logging / src / sink.js View on Github external
if (arguments[1]) {
            self.metadata = arguments[1];
          }
          callback.apply(null, arguments);
        }
      );
    });
  }
}

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

/**
 * Reference to the {@link Sink} class.
 * @name module:@google-cloud/logging.Sink
 * @see Sink
 */
module.exports.Sink = Sink;
github googleapis / nodejs-bigtable / src / cluster.ts View on Github external
{
          client: 'BigtableInstanceAdminClient',
          method: 'updateCluster',
          reqOpts,
          gaxOpts: gaxOptions,
        },
        callback);
  }
}

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

/**
 * Reference to the {@link Cluster} class.
 * @name module:@google-cloud/bigtable.Cluster
 * @see Cluster
 */
github googleapis / nodejs-storage / src / iam.ts View on Github external
const permissionsHash = permissions.reduce((acc, permission) => {
            acc[permission] = availablePermissions.indexOf(permission) > -1;
            return acc;
          }, {});

          callback(null, permissionsHash, resp);
        });
  }
}

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

export {Iam};
github googleapis / nodejs-datastore / src / transaction.ts View on Github external
entity: {
          key: ent.key,
        },
        method: 'save',
        args: [ent],
      });
    });
  }
}

/*! Developer Documentation
 *
 * All async methods (except for streams) will return a Promise in the event
 * that a callback is omitted.
 */
promisifyAll(Transaction, {
  exclude: ['createQuery', 'delete', 'save'],
});

/**
 * Reference to the {@link Transaction} class.
 * @name module:@google-cloud/datastore.Transaction
 * @see Transaction
 */
export {Transaction};
github googleapis / nodejs-bigtable / src / index.ts View on Github external
return;
      }

      this.projectId = projectId;

      callback(null, this.projectId);
    });
  }
}

/*! Developer Documentation
 *
 * All async methods (except for streams) will return a Promise in the event
 * that a callback is omitted.
 */
promisifyAll(Bigtable, {
  exclude: ['instance', 'operation', 'request'],
});

/**
 * {@link AppProfile} class.
 *
 * @name Bigtable.AppProfile
 * @see AppProfile
 * @type {Constructor}
 */

/**
 * {@link Cluster} class.
 *
 * @name Bigtable.Cluster
 * @see Cluster
github googleapis / nodejs-dns / src / zone.ts View on Github external
*   });
   */
  Zone.prototype.getRecordsStream = paginator.streamify('getRecords');

  /*! Developer Documentation
   *
   * These methods can be auto-paginated.
   */
  paginator.extend(Zone, ['getChanges', 'getRecords']);

  /*! Developer Documentation
   *
   * All async methods (except for streams) will return a Promise in the event
   * that a callback is omitted.
   */
  promisifyAll(Zone, {
    exclude: ['change', 'record'],
  });

  /**
   * Reference to the {@link Zone} class.
   * @name module:@google-cloud/dns.Zone
   * @see Zone
   */
  export {Zone};
github googleapis / nodejs-compute / src / instance-group.js View on Github external
*   });
 */
InstanceGroup.prototype.getVMsStream = paginator.streamify('getVMs');

/*! Developer Documentation
 *
 * These methods can be auto-paginated.
 */
paginator.extend(InstanceGroup, ['getVMs']);

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

module.exports = InstanceGroup;
github googleapis / nodejs-datastore / src / request.ts View on Github external
const gaxOpts = extend(true, {}, config.gaxOpts, {
        headers: {
          'google-cloud-resource-prefix': `projects/${projectId}`,
        },
      });
      gaxClient[method](reqOpts, gaxOpts, callback);
    });
  }
}

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

/**
 * Reference to the {@link DatastoreRequest} class.
 * @name module:@google-cloud/datastore.DatastoreRequest
 * @see DatastoreRequest
 */
export {DatastoreRequest};
github googleapis / nodejs-bigquery / src / index.ts View on Github external
BigQuery.prototype.queryAsStream_ = function(query, callback) {
  this.query(query, {autoPaginate: false}, callback);
};

/*! Developer Documentation
 *
 * These methods can be auto-paginated.
 */
paginator.extend(BigQuery, ['getDatasets', 'getJobs']);

/*! Developer Documentation
 *
 * All async methods (except for streams) will return a Promise in the event
 * that a callback is omitted.
 */
promisifyAll(BigQuery, {
  exclude: ['dataset', 'date', 'datetime', 'job', 'time', 'timestamp'],
});

/**
 * {@link Dataset} class.
 *
 * @name BigQuery.Dataset
 * @see Dataset
 * @type {constructor}
 */
(BigQuery as any).Dataset = Dataset;

/**
 * {@link Job} class.
 *
 * @name BigQuery.Job

@google-cloud/promisify

A simple utility for promisifying functions and classes.

Apache-2.0
Latest version published 9 months ago

Package Health Score

78 / 100
Full package analysis

Similar packages