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.1.1 to 3.2.0

4

build/src/service.d.ts

@@ -66,2 +66,6 @@ import { GoogleAuth, GoogleAuthOptions } from 'google-auth-library';

/**
* Return the user's custom request interceptors.
*/
getRequestInterceptors(): Function[];
/**
* Get and update the Service's project ID.

@@ -68,0 +72,0 @@ *

32

build/src/service.js

@@ -70,2 +70,13 @@ "use strict";

}
/**
* Return the user's custom request interceptors.
*/
getRequestInterceptors() {
// Interceptors should be returned in the order they were assigned.
return [].slice
.call(this.globalInterceptors)
.concat(this.interceptors)
.filter(interceptor => typeof interceptor.request === 'function')
.map(interceptor => interceptor.request);
}
getProjectId(callback) {

@@ -106,14 +117,11 @@ if (!callback) {

.replace(/\/:/g, ':');
// Interceptors should be called in the order they were assigned.
const combinedInterceptors = [].slice
.call(this.globalInterceptors)
.concat(this.interceptors)
.concat(arrify(reqOpts.interceptors_));
let interceptor;
while (
// tslint:disable-next-line:no-conditional-assignment
(interceptor = combinedInterceptors.shift()) &&
interceptor.request) {
reqOpts = interceptor.request(reqOpts);
}
const requestInterceptors = this.getRequestInterceptors();
arrify(reqOpts.interceptors_).forEach(interceptor => {
if (typeof interceptor.request === 'function') {
requestInterceptors.push(interceptor.request);
}
});
requestInterceptors.forEach(requestInterceptor => {
reqOpts = requestInterceptor(reqOpts);
});
delete reqOpts.interceptors_;

@@ -120,0 +128,0 @@ const pkg = this.packageJson;

@@ -7,2 +7,14 @@ # Changelog

## [3.2.0](https://www.github.com/googleapis/nodejs-common/compare/v3.1.1...v3.2.0) (2020-06-23)
### Features
* expose method to get request interceptors ([#589](https://www.github.com/googleapis/nodejs-common/issues/589)) ([d01507f](https://www.github.com/googleapis/nodejs-common/commit/d01507f3fae41ffdffa2056bfb1aa40d97ffb653))
### Bug Fixes
* **deps:** update dependency teeny-request to v7 ([#581](https://www.github.com/googleapis/nodejs-common/issues/581)) ([8d12007](https://www.github.com/googleapis/nodejs-common/commit/8d12007c5b43b8b6a679b0a925c05cb665d850b7))
### [3.1.1](https://www.github.com/googleapis/nodejs-common/compare/v3.1.0...v3.1.1) (2020-05-29)

@@ -9,0 +21,0 @@

{
"name": "@google-cloud/common",
"description": "Common components for Cloud APIs Node.js Client Libraries",
"version": "3.1.1",
"version": "3.2.0",
"license": "Apache-2.0",

@@ -43,3 +43,3 @@ "author": "Google Inc.",

"retry-request": "^4.1.1",
"teeny-request": "^6.0.3"
"teeny-request": "^7.0.0"
},

@@ -62,3 +62,3 @@ "devDependencies": {

"linkinator": "^2.0.4",
"mocha": "^7.1.1",
"mocha": "^8.0.0",
"mv": "^2.1.1",

@@ -65,0 +65,0 @@ "ncp": "^2.0.0",

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