@google-cloud/common
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -34,2 +34,3 @@ import { GoogleAuth, GoogleAuthOptions } from 'google-auth-library'; | ||
timeout?: number; | ||
userAgent?: string; | ||
} | ||
@@ -43,2 +44,3 @@ export declare class Service { | ||
private projectIdRequired; | ||
providedUserAgent?: string; | ||
makeAuthenticatedRequest: MakeAuthenticatedRequest; | ||
@@ -45,0 +47,0 @@ authClient: GoogleAuth; |
@@ -48,2 +48,3 @@ "use strict"; | ||
this.projectIdRequired = config.projectIdRequired !== false; | ||
this.providedUserAgent = options.userAgent; | ||
const reqCfg = extend({}, config, { | ||
@@ -119,4 +120,8 @@ projectIdRequired: this.projectIdRequired, | ||
const pkg = this.packageJson; | ||
let userAgent = util_1.util.getUserAgentFromPackageJson(pkg); | ||
if (this.providedUserAgent) { | ||
userAgent = `${this.providedUserAgent} ${userAgent}`; | ||
} | ||
reqOpts.headers = extend({}, reqOpts.headers, { | ||
'User-Agent': util_1.util.getUserAgentFromPackageJson(pkg), | ||
'User-Agent': userAgent, | ||
'x-goog-api-client': `gl-node/${process.versions.node} gccl/${pkg.version}`, | ||
@@ -123,0 +128,0 @@ }); |
@@ -268,3 +268,3 @@ "use strict"; | ||
if (err) { | ||
if ([429, 500, 502, 503].indexOf(err.code) !== -1) { | ||
if ([408, 429, 500, 502, 503].indexOf(err.code) !== -1) { | ||
return true; | ||
@@ -271,0 +271,0 @@ } |
@@ -7,2 +7,16 @@ # Changelog | ||
## [3.1.0](https://www.github.com/googleapis/nodejs-common/compare/v3.0.0...v3.1.0) (2020-05-08) | ||
### Features | ||
* **service:** add optional provided user agent ([#566](https://www.github.com/googleapis/nodejs-common/issues/566)) ([a0b814e](https://www.github.com/googleapis/nodejs-common/commit/a0b814ead58c8b255de2da8044c81d1be7b3825d)) | ||
### Bug Fixes | ||
* **deps:** update dependency google-auth-library to v6 ([#556](https://www.github.com/googleapis/nodejs-common/issues/556)) ([03a8a54](https://www.github.com/googleapis/nodejs-common/commit/03a8a542ac329f63776388346d1f74732b0ab984)) | ||
* apache license URL ([#468](https://www.github.com/googleapis/nodejs-common/issues/468)) ([#564](https://www.github.com/googleapis/nodejs-common/issues/564)) ([1adc855](https://www.github.com/googleapis/nodejs-common/commit/1adc855c17091b67e7f8821e0286ce7256023040)) | ||
* retry error code 408 ([#578](https://www.github.com/googleapis/nodejs-common/issues/578)) ([0d3239d](https://www.github.com/googleapis/nodejs-common/commit/0d3239d9eeb03bb9cb49e1107d3d6d4864ffe341)) | ||
## [3.0.0](https://www.github.com/googleapis/nodejs-common/compare/v2.4.0...v3.0.0) (2020-03-26) | ||
@@ -9,0 +23,0 @@ |
{ | ||
"name": "@google-cloud/common", | ||
"description": "Common components for Cloud APIs Node.js Client Libraries", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"license": "Apache-2.0", | ||
@@ -29,3 +29,6 @@ "author": "Google Inc.", | ||
"docs-test": "linkinator docs", | ||
"predocs-test": "npm run docs" | ||
"predocs-test": "npm run docs", | ||
"prelint": "cd samples; npm link ../; npm install", | ||
"clean": "gts clean", | ||
"precompile": "gts clean" | ||
}, | ||
@@ -39,3 +42,3 @@ "dependencies": { | ||
"extend": "^3.0.2", | ||
"google-auth-library": "^5.10.1", | ||
"google-auth-library": "^6.0.0", | ||
"retry-request": "^4.1.1", | ||
@@ -54,7 +57,7 @@ "teeny-request": "^6.0.3" | ||
"@types/request": "^2.48.4", | ||
"@types/sinon": "^7.5.2", | ||
"@types/tmp": "0.1.0", | ||
"@types/sinon": "^9.0.0", | ||
"@types/tmp": "0.2.0", | ||
"c8": "^7.1.0", | ||
"codecov": "^3.6.5", | ||
"gts": "^2.0.0-alpha.6", | ||
"gts": "^2.0.0", | ||
"linkinator": "^2.0.4", | ||
@@ -67,5 +70,5 @@ "mocha": "^7.1.1", | ||
"sinon": "^9.0.1", | ||
"tmp": "0.1.0", | ||
"tmp": "0.2.1", | ||
"typescript": "~3.8.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114404
1806
+ Addedgaxios@4.3.3(transitive)
+ Addedgcp-metadata@4.3.1(transitive)
+ Addedgoogle-auth-library@6.1.6(transitive)
+ Addedgoogle-p12-pem@3.1.4(transitive)
+ Addedgtoken@5.3.2(transitive)
+ Addedjson-bigint@1.0.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addednode-forge@1.3.1(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedgaxios@2.3.4(transitive)
- Removedgcp-metadata@3.5.0(transitive)
- Removedgoogle-auth-library@5.10.1(transitive)
- Removedgoogle-p12-pem@2.0.5(transitive)
- Removedgtoken@4.1.4(transitive)
- Removedjson-bigint@0.3.1(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedmime@2.6.0(transitive)
- Removednode-forge@0.10.0(transitive)
- Removedyallist@3.1.1(transitive)
Updatedgoogle-auth-library@^6.0.0