@google-cloud/resource-settings
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -599,2 +599,6 @@ { | ||
"id": 12 | ||
}, | ||
"edition": { | ||
"type": "string", | ||
"id": 13 | ||
} | ||
@@ -1427,3 +1431,16 @@ } | ||
"id": 4 | ||
}, | ||
"semantic": { | ||
"type": "Semantic", | ||
"id": 5 | ||
} | ||
}, | ||
"nested": { | ||
"Semantic": { | ||
"values": { | ||
"NONE": 0, | ||
"SET": 1, | ||
"ALIAS": 2 | ||
} | ||
} | ||
} | ||
@@ -1430,0 +1447,0 @@ } |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import type * as gax from 'google-gax'; | ||
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -74,4 +74,11 @@ import * as protos from '../../protos/protos'; | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new ResourceSettingsServiceClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts?: ClientOptions); | ||
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); | ||
/** | ||
@@ -78,0 +85,0 @@ * Initialize the client. |
@@ -21,4 +21,2 @@ "use strict"; | ||
exports.ResourceSettingsServiceClient = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
@@ -81,4 +79,11 @@ /** | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new ResourceSettingsServiceClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts) { | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
@@ -105,4 +110,8 @@ this._terminated = false; | ||
} | ||
// Load google-gax module synchronously if needed | ||
if (!gaxInstance) { | ||
gaxInstance = require('google-gax'); | ||
} | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
@@ -162,3 +171,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
// Add a warn function to the client constructor so it can be easily tested. | ||
this.warn = gax.warn; | ||
this.warn = this._gaxModule.warn; | ||
} | ||
@@ -206,3 +215,3 @@ /** | ||
const descriptor = this.descriptors.page[methodName] || undefined; | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor); | ||
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback); | ||
this.innerApiCalls[methodName] = apiCall; | ||
@@ -267,3 +276,3 @@ } | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: request.name || '', | ||
@@ -288,3 +297,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'setting.name': request.setting.name || '', | ||
@@ -309,3 +318,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
@@ -352,3 +361,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
@@ -400,3 +409,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
@@ -403,0 +412,0 @@ }); |
# Changelog | ||
## [2.0.2](https://github.com/googleapis/nodejs-resource-settings/compare/v2.0.1...v2.0.2) (2022-09-01) | ||
### Bug Fixes | ||
* Allow passing gax instance to client constructor ([#90](https://github.com/googleapis/nodejs-resource-settings/issues/90)) ([c33ba53](https://github.com/googleapis/nodejs-resource-settings/commit/c33ba53db10813d91cf84947ce7ffafef26fd14c)) | ||
* Better support for fallback mode ([#85](https://github.com/googleapis/nodejs-resource-settings/issues/85)) ([a695e3d](https://github.com/googleapis/nodejs-resource-settings/commit/a695e3d8d2deef27c1c2371e05aa1a875977a144)) | ||
* Change import long to require ([#86](https://github.com/googleapis/nodejs-resource-settings/issues/86)) ([ccac637](https://github.com/googleapis/nodejs-resource-settings/commit/ccac6374f448d4fde213e947d1a0f03b4a732e37)) | ||
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-resource-settings/issues/1553)) ([#89](https://github.com/googleapis/nodejs-resource-settings/issues/89)) ([2a81aae](https://github.com/googleapis/nodejs-resource-settings/commit/2a81aaefa64e2df66b63ec9ca98c5b6a61c73ca9)) | ||
* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-resource-settings/issues/1546)) ([#88](https://github.com/googleapis/nodejs-resource-settings/issues/88)) ([14d3ced](https://github.com/googleapis/nodejs-resource-settings/commit/14d3cedea382de602d00a80c7fa8a50c1cb520b7)) | ||
## [2.0.1](https://github.com/googleapis/nodejs-resource-settings/compare/v2.0.0...v2.0.1) (2022-06-30) | ||
@@ -4,0 +15,0 @@ |
{ | ||
"name": "@google-cloud/resource-settings", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "resourcesettings client for Node.js", | ||
@@ -42,3 +42,3 @@ "repository": "googleapis/nodejs-resource-settings", | ||
"dependencies": { | ||
"google-gax": "^3.0.1" | ||
"google-gax": "^3.3.0" | ||
}, | ||
@@ -54,3 +54,3 @@ "devDependencies": { | ||
"jsdoc-region-tag": "^2.0.0", | ||
"linkinator": "^2.13.6", | ||
"linkinator": "^4.0.0", | ||
"mocha": "^9.2.2", | ||
@@ -57,0 +57,0 @@ "null-loader": "^4.0.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
1150181
19530
+ Added@types/node@22.10.0(transitive)
- Removed@types/node@22.10.1(transitive)
Updatedgoogle-gax@^3.3.0