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.8.1 to 3.9.0

7

build/src/service-object.d.ts

@@ -51,2 +51,8 @@ /// <reference types="node" />

pollIntervalMs?: number;
/**
* Override of projectId, used to allow access to resources in another project.
* For example, a BigQuery dataset in another project to which the user has been
* granted permission.
*/
projectId?: string;
}

@@ -106,2 +112,3 @@ export interface Methods {

interceptors: Interceptor[];
projectId?: string;
constructor(config: ServiceObjectConfig);

@@ -108,0 +115,0 @@ /**

4

build/src/service-object.js

@@ -65,2 +65,3 @@ "use strict";

this.pollIntervalMs = config.pollIntervalMs;
this.projectId = config.projectId;
if (config.methods) {

@@ -237,2 +238,5 @@ // This filters the ServiceObject instance (e.g. a "File") to only have

reqOpts = extend(true, {}, reqOpts);
if (this.projectId) {
reqOpts.projectId = this.projectId;
}
const isAbsoluteUrl = reqOpts.uri.indexOf('http') === 0;

@@ -239,0 +243,0 @@ const uriComponents = [this.baseUrl, this.id || '', reqOpts.uri];

10

build/src/service.js

@@ -101,4 +101,10 @@ "use strict";

if (this.projectIdRequired) {
uriComponents.push('projects');
uriComponents.push(this.projectId);
if (reqOpts.projectId) {
uriComponents.push('projects');
uriComponents.push(reqOpts.projectId);
}
else {
uriComponents.push('projects');
uriComponents.push(this.projectId);
}
}

@@ -105,0 +111,0 @@ uriComponents.push(reqOpts.uri);

@@ -117,2 +117,3 @@ /// <reference types="node" />

shouldReturnStream?: boolean;
projectId?: string;
}

@@ -119,0 +120,0 @@ export interface ParsedHttpResponseBody {

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

## [3.9.0](https://github.com/googleapis/nodejs-common/compare/v3.8.1...v3.9.0) (2022-01-19)
### Features
* add optional projectId override in service object ([#722](https://github.com/googleapis/nodejs-common/issues/722)) ([4908d85](https://github.com/googleapis/nodejs-common/commit/4908d859c55a3ed40dd82849c7f2658840c920c1))
### [3.8.1](https://www.github.com/googleapis/nodejs-common/compare/v3.8.0...v3.8.1) (2021-11-03)

@@ -9,0 +16,0 @@

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

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

"@types/sinon": "^10.0.0",
"@types/tmp": "0.2.2",
"@types/tmp": "0.2.3",
"c8": "^7.1.0",

@@ -67,3 +67,3 @@ "codecov": "^3.6.5",

"proxyquire": "^2.1.3",
"sinon": "^11.0.0",
"sinon": "^12.0.0",
"tmp": "0.2.1",

@@ -70,0 +70,0 @@ "typescript": "~3.8.3"

@@ -7,5 +7,4 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/common.svg)](https://www.npmjs.org/package/@google-cloud/common)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-common/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-common)

@@ -84,6 +83,6 @@

This library is considered to be **General Availability (GA)**. This means it
is stable; the code surface will not change in backwards-incompatible ways
This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways
unless absolutely necessary (e.g. because of critical security issues) or with
an extensive deprecation period. Issues and requests against **GA** libraries
an extensive deprecation period. Issues and requests against **stable** libraries
are addressed with the highest priority.

@@ -95,2 +94,3 @@

More Information: [Google Cloud Platform Launch Stages][launch_stages]

@@ -97,0 +97,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