@google-cloud/common
Advanced tools
@@ -24,2 +24,4 @@ "use strict"; | ||
| class Operation extends service_object_1.ServiceObject { | ||
| completeListeners; | ||
| hasActiveListeners; | ||
| /** | ||
@@ -92,3 +94,3 @@ * An Operation object allows you to interact with APIs that take longer to | ||
| this.hasActiveListeners = true; | ||
| this.startPolling_(); | ||
| void this.startPolling_(); | ||
| } | ||
@@ -110,3 +112,3 @@ } | ||
| poll_(callback) { | ||
| this.getMetadata((err, body) => { | ||
| void this.getMetadata((err, body) => { | ||
| if (err || body.error) { | ||
@@ -113,0 +115,0 @@ callback(err || body.error); |
@@ -1,2 +0,1 @@ | ||
| /// <reference types="node" /> | ||
| import { EventEmitter } from 'events'; | ||
@@ -3,0 +2,0 @@ import * as r from 'teeny-request'; |
@@ -21,3 +21,3 @@ "use strict"; | ||
| const promisify_1 = require("@google-cloud/promisify"); | ||
| const arrify = require("arrify"); | ||
| const arrify = require('arrify'); | ||
| const events_1 = require("events"); | ||
@@ -39,2 +39,11 @@ const extend = require("extend"); | ||
| class ServiceObject extends events_1.EventEmitter { | ||
| metadata; | ||
| baseUrl; | ||
| parent; | ||
| id; | ||
| pollIntervalMs; | ||
| createMethod; | ||
| methods; | ||
| interceptors; | ||
| projectId; | ||
| /* | ||
@@ -183,3 +192,3 @@ * @constructor | ||
| args.push(onCreate); | ||
| self.create(...args); | ||
| void self.create(...args); | ||
| return; | ||
@@ -186,0 +195,0 @@ } |
+13
-1
@@ -20,3 +20,3 @@ "use strict"; | ||
| */ | ||
| const arrify = require("arrify"); | ||
| const arrify = require('arrify'); | ||
| const extend = require("extend"); | ||
@@ -26,2 +26,14 @@ const util_1 = require("./util"); | ||
| class Service { | ||
| baseUrl; | ||
| globalInterceptors; | ||
| interceptors; | ||
| packageJson; | ||
| projectId; | ||
| projectIdRequired; | ||
| providedUserAgent; | ||
| makeAuthenticatedRequest; | ||
| authClient; | ||
| getCredentials; | ||
| apiEndpoint; | ||
| timeout; | ||
| /** | ||
@@ -28,0 +40,0 @@ * Service is a base class, meant to be inherited from by a "service," like |
@@ -1,2 +0,1 @@ | ||
| /// <reference types="node" /> | ||
| import { AuthClient, GoogleAuth, GoogleAuthOptions } from 'google-auth-library'; | ||
@@ -3,0 +2,0 @@ import { CredentialBody } from 'google-auth-library'; |
+18
-20
@@ -58,2 +58,5 @@ "use strict"; | ||
| class ApiError extends Error { | ||
| code; | ||
| errors; | ||
| response; | ||
| constructor(errorBodyOrMessage) { | ||
@@ -118,2 +121,4 @@ super(); | ||
| class PartialFailureError extends Error { | ||
| errors; | ||
| response; | ||
| constructor(b) { | ||
@@ -130,6 +135,4 @@ super(); | ||
| class Util { | ||
| constructor() { | ||
| this.ApiError = ApiError; | ||
| this.PartialFailureError = PartialFailureError; | ||
| } | ||
| ApiError = ApiError; | ||
| PartialFailureError = PartialFailureError; | ||
| /** | ||
@@ -458,3 +461,3 @@ * No op. | ||
| }; | ||
| prepareRequest(); | ||
| void prepareRequest(); | ||
| if (stream) { | ||
@@ -495,6 +498,5 @@ return stream; | ||
| makeRequest(reqOpts, config, callback) { | ||
| var _a, _b, _c, _d, _e, _f, _g; | ||
| let autoRetryValue = AUTO_RETRY_DEFAULT; | ||
| if (config.autoRetry !== undefined && | ||
| ((_a = config.retryOptions) === null || _a === void 0 ? void 0 : _a.autoRetry) !== undefined) { | ||
| config.retryOptions?.autoRetry !== undefined) { | ||
| throw new ApiError('autoRetry is deprecated. Use retryOptions.autoRetry instead.'); | ||
@@ -505,7 +507,7 @@ } | ||
| } | ||
| else if (((_b = config.retryOptions) === null || _b === void 0 ? void 0 : _b.autoRetry) !== undefined) { | ||
| else if (config.retryOptions?.autoRetry !== undefined) { | ||
| autoRetryValue = config.retryOptions.autoRetry; | ||
| } | ||
| let maxRetryValue = MAX_RETRY_DEFAULT; | ||
| if (config.maxRetries && ((_c = config.retryOptions) === null || _c === void 0 ? void 0 : _c.maxRetries)) { | ||
| if (config.maxRetries && config.retryOptions?.maxRetries) { | ||
| throw new ApiError('maxRetries is deprecated. Use retryOptions.maxRetries instead.'); | ||
@@ -516,3 +518,3 @@ } | ||
| } | ||
| else if ((_d = config.retryOptions) === null || _d === void 0 ? void 0 : _d.maxRetries) { | ||
| else if (config.retryOptions?.maxRetries) { | ||
| maxRetryValue = config.retryOptions.maxRetries; | ||
@@ -525,12 +527,11 @@ } | ||
| shouldRetryFn(httpRespMessage) { | ||
| var _a, _b; | ||
| const err = util.parseHttpRespMessage(httpRespMessage).err; | ||
| if ((_a = config.retryOptions) === null || _a === void 0 ? void 0 : _a.retryableErrorFn) { | ||
| return err && ((_b = config.retryOptions) === null || _b === void 0 ? void 0 : _b.retryableErrorFn(err)); | ||
| if (config.retryOptions?.retryableErrorFn) { | ||
| return err && config.retryOptions?.retryableErrorFn(err); | ||
| } | ||
| return err && util.shouldRetryRequest(err); | ||
| }, | ||
| maxRetryDelay: (_e = config.retryOptions) === null || _e === void 0 ? void 0 : _e.maxRetryDelay, | ||
| retryDelayMultiplier: (_f = config.retryOptions) === null || _f === void 0 ? void 0 : _f.retryDelayMultiplier, | ||
| totalTimeout: (_g = config.retryOptions) === null || _g === void 0 ? void 0 : _g.totalTimeout, | ||
| maxRetryDelay: config.retryOptions?.maxRetryDelay, | ||
| retryDelayMultiplier: config.retryOptions?.retryDelayMultiplier, | ||
| totalTimeout: config.retryOptions?.totalTimeout, | ||
| }; | ||
@@ -649,6 +650,3 @@ if (typeof reqOpts.maxRetries === 'number') { | ||
| class ProgressStream extends stream_1.Transform { | ||
| constructor() { | ||
| super(...arguments); | ||
| this.bytesRead = 0; | ||
| } | ||
| bytesRead = 0; | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@@ -655,0 +653,0 @@ _transform(chunk, encoding, callback) { |
+11
-0
@@ -7,2 +7,13 @@ # Changelog | ||
| ## [6.0.0](https://github.com/googleapis/nodejs-common/compare/v5.0.2...v6.0.0) (2025-03-03) | ||
| ### ⚠ BREAKING CHANGES | ||
| * Upgrade to Node version 18 ([#834](https://github.com/googleapis/nodejs-common/issues/834)) | ||
| ### Miscellaneous Chores | ||
| * Upgrade to Node version 18 ([#834](https://github.com/googleapis/nodejs-common/issues/834)) ([e831600](https://github.com/googleapis/nodejs-common/commit/e831600a89bc20f20293749bc0788d643d8baffd)) | ||
| ## [5.0.2](https://github.com/googleapis/nodejs-common/compare/v5.0.1...v5.0.2) (2024-04-30) | ||
@@ -9,0 +20,0 @@ |
+30
-28
| { | ||
| "name": "@google-cloud/common", | ||
| "description": "Common components for Cloud APIs Node.js Client Libraries", | ||
| "version": "5.0.2", | ||
| "version": "6.0.0", | ||
| "license": "Apache-2.0", | ||
| "author": "Google Inc.", | ||
| "engines": { | ||
| "node": ">=14.0.0" | ||
| "node": ">=18" | ||
| }, | ||
@@ -18,3 +18,3 @@ "repository": "googleapis/nodejs-common", | ||
| "scripts": { | ||
| "docs": "compodoc src/", | ||
| "docs": "jsdoc -c .jsdoc.js", | ||
| "test": "c8 mocha build/test", | ||
@@ -38,35 +38,37 @@ "prepare": "npm run compile", | ||
| "@google-cloud/promisify": "^4.0.0", | ||
| "arrify": "^2.0.1", | ||
| "duplexify": "^4.1.1", | ||
| "arrify": "^2.0.0", | ||
| "duplexify": "^4.1.3", | ||
| "extend": "^3.0.2", | ||
| "google-auth-library": "^9.0.0", | ||
| "google-auth-library": "^10.0.0-rc.1", | ||
| "html-entities": "^2.5.2", | ||
| "retry-request": "^7.0.0", | ||
| "teeny-request": "^9.0.0" | ||
| "retry-request": "^8.0.0", | ||
| "teeny-request": "^10.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@compodoc/compodoc": "1.1.23", | ||
| "@types/ent": "^2.2.1", | ||
| "@types/extend": "^3.0.1", | ||
| "@types/mocha": "^9.0.0", | ||
| "@types/mv": "^2.1.0", | ||
| "@types/ncp": "^2.0.3", | ||
| "@types/node": "^20.4.9", | ||
| "@types/proxyquire": "^1.3.28", | ||
| "@types/request": "^2.48.4", | ||
| "@types/sinon": "^17.0.0", | ||
| "@types/tmp": "0.2.6", | ||
| "c8": "^8.0.1", | ||
| "codecov": "^3.6.5", | ||
| "gts": "^5.0.0", | ||
| "linkinator": "^4.0.0", | ||
| "mocha": "^9.2.2", | ||
| "@types/ent": "^2.2.8", | ||
| "@types/extend": "^3.0.4", | ||
| "@types/mocha": "^10.0.10", | ||
| "@types/mv": "^2.1.4", | ||
| "@types/ncp": "^2.0.8", | ||
| "@types/node": "^22.13.5", | ||
| "@types/proxyquire": "^1.3.31", | ||
| "@types/request": "^2.48.12", | ||
| "@types/sinon": "^17.0.4", | ||
| "@types/tmp": "^0.2.6", | ||
| "c8": "^10.1.3", | ||
| "codecov": "^3.8.3", | ||
| "gts": "^6.0.2", | ||
| "jsdoc": "^4.0.4", | ||
| "jsdoc-fresh": "^3.0.0", | ||
| "jsdoc-region-tag": "^3.0.0", | ||
| "linkinator": "^6.1.2", | ||
| "mocha": "^11.1.0", | ||
| "mv": "^2.1.1", | ||
| "ncp": "^2.0.0", | ||
| "nock": "^13.0.0", | ||
| "nock": "^14.0.1", | ||
| "proxyquire": "^2.1.3", | ||
| "sinon": "^17.0.0", | ||
| "tmp": "0.2.3", | ||
| "typescript": "^5.1.6" | ||
| "sinon": "^19.0.2", | ||
| "tmp": "^0.2.3", | ||
| "typescript": "^5.8.2" | ||
| } | ||
| } |
+1
-1
@@ -119,2 +119,2 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
| [auth]: https://cloud.google.com/docs/authentication/getting-started | ||
| [auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local |
133870
0.26%2013
0.95%25
8.7%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated