Socket
Socket
Sign inDemoInstall

@google-cloud/common

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/common - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

2

build/src/service.d.ts

@@ -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 @@ });

2

build/src/util.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc