@google-cloud/phishing-protection
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -369,2 +369,6 @@ { | ||
"id": 12 | ||
}, | ||
"edition": { | ||
"type": "string", | ||
"id": 13 | ||
} | ||
@@ -898,2 +902,9 @@ } | ||
}, | ||
"unverifiedLazy": { | ||
"type": "bool", | ||
"id": 15, | ||
"options": { | ||
"default": false | ||
} | ||
}, | ||
"deprecated": { | ||
@@ -1191,3 +1202,16 @@ "type": "bool", | ||
"id": 4 | ||
}, | ||
"semantic": { | ||
"type": "Semantic", | ||
"id": 5 | ||
} | ||
}, | ||
"nested": { | ||
"Semantic": { | ||
"values": { | ||
"NONE": 0, | ||
"SET": 1, | ||
"ALIAS": 2 | ||
} | ||
} | ||
} | ||
@@ -1194,0 +1218,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import * as gax from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import type * as gax from 'google-gax'; | ||
import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
@@ -61,4 +61,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 PhishingProtectionServiceV1Beta1Client({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts?: ClientOptions); | ||
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); | ||
/** | ||
@@ -65,0 +72,0 @@ * Initialize the client. |
@@ -21,4 +21,2 @@ "use strict"; | ||
exports.PhishingProtectionServiceV1Beta1Client = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
@@ -70,4 +68,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 PhishingProtectionServiceV1Beta1Client({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts) { | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
@@ -94,4 +99,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. | ||
@@ -143,3 +152,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; | ||
} | ||
@@ -183,3 +192,3 @@ /** | ||
const descriptor = 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; | ||
@@ -244,3 +253,3 @@ } | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
@@ -247,0 +256,0 @@ }); |
@@ -7,2 +7,13 @@ # Changelog | ||
## [3.0.2](https://github.com/googleapis/nodejs-phishing-protection/compare/v3.0.1...v3.0.2) (2022-09-01) | ||
### Bug Fixes | ||
* Allow passing gax instance to client constructor ([#407](https://github.com/googleapis/nodejs-phishing-protection/issues/407)) ([33e1faa](https://github.com/googleapis/nodejs-phishing-protection/commit/33e1faa0ca2408612796e491f20ab15e25c96bc6)) | ||
* Better support for fallback mode ([#402](https://github.com/googleapis/nodejs-phishing-protection/issues/402)) ([9490c72](https://github.com/googleapis/nodejs-phishing-protection/commit/9490c7233ab25fd4cae6379cf283be6b955f424b)) | ||
* Change import long to require ([#403](https://github.com/googleapis/nodejs-phishing-protection/issues/403)) ([5ff8e2f](https://github.com/googleapis/nodejs-phishing-protection/commit/5ff8e2f645a224a5aac6319bd4347ab6af8494b4)) | ||
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-phishing-protection/issues/1553)) ([#406](https://github.com/googleapis/nodejs-phishing-protection/issues/406)) ([54ef38f](https://github.com/googleapis/nodejs-phishing-protection/commit/54ef38f0c9ce81bdaf4ac22faf579de80917bc82)) | ||
* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-phishing-protection/issues/1546)) ([#405](https://github.com/googleapis/nodejs-phishing-protection/issues/405)) ([5347c0e](https://github.com/googleapis/nodejs-phishing-protection/commit/5347c0e94fa416c201c424a719d2cf607d31a3e5)) | ||
## [3.0.1](https://github.com/googleapis/nodejs-phishing-protection/compare/v3.0.0...v3.0.1) (2022-06-30) | ||
@@ -9,0 +20,0 @@ |
{ | ||
"repository": "googleapis/nodejs-phishing-protection", | ||
"name": "@google-cloud/phishing-protection", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"author": "Google LLC", | ||
@@ -26,3 +26,3 @@ "description": "Phishing Protection API client for Node.js", | ||
"dependencies": { | ||
"google-gax": "^3.0.1" | ||
"google-gax": "^3.3.0" | ||
}, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
"jsdoc-region-tag": "^2.0.0", | ||
"linkinator": "^2.0.0", | ||
"linkinator": "^4.0.0", | ||
"mocha": "^9.2.2", | ||
@@ -42,0 +42,0 @@ "null-loader": "^4.0.0", |
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
939531
16111
Updatedgoogle-gax@^3.3.0