@google-cloud/phishing-protection
Advanced tools
Comparing version 2.3.1 to 2.3.2
import * as v1beta1 from './v1beta1'; | ||
declare const PhishingProtectionServiceV1Beta1Client: typeof v1beta1.PhishingProtectionServiceV1Beta1Client; | ||
declare type PhishingProtectionServiceV1Beta1Client = v1beta1.PhishingProtectionServiceV1Beta1Client; | ||
export { v1beta1, PhishingProtectionServiceV1Beta1Client }; | ||
@@ -4,0 +5,0 @@ declare const _default: { |
@@ -30,4 +30,6 @@ import * as gax from 'google-gax'; | ||
* | ||
* @param {object} [options] - The configuration object. See the subsequent | ||
* parameters for more details. | ||
* @param {object} [options] - The configuration object. | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
* @param {object} [options.credentials] - Credentials object. | ||
@@ -52,2 +54,9 @@ * @param {string} [options.credentials.client_email] | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
*/ | ||
@@ -71,2 +80,3 @@ constructor(opts?: ClientOptions); | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -77,2 +87,3 @@ static get servicePath(): string; | ||
* exists for compatibility reasons. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -82,2 +93,3 @@ static get apiEndpoint(): string; | ||
* The port for this API service. | ||
* @returns {number} The default port for this service. | ||
*/ | ||
@@ -88,2 +100,3 @@ static get port(): number; | ||
* in this service. | ||
* @returns {string[]} List of default scopes. | ||
*/ | ||
@@ -112,7 +125,8 @@ static get scopes(): string[]; | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
* Terminate the gRPC channel and close the client. | ||
* | ||
* The client will no longer be usable and all future behavior is undefined. | ||
* @returns {Promise} A promise that resolves when the client is closed. | ||
*/ | ||
close(): Promise<void>; | ||
} |
@@ -34,4 +34,6 @@ "use strict"; | ||
* | ||
* @param {object} [options] - The configuration object. See the subsequent | ||
* parameters for more details. | ||
* @param {object} [options] - The configuration object. | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
* @param {object} [options.credentials] - Credentials object. | ||
@@ -56,4 +58,12 @@ * @param {string} [options.credentials.client_email] | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override. | ||
* TODO(@alexander-fenster): link to gax documentation. | ||
* @param {boolean} fallback - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
*/ | ||
constructor(opts) { | ||
var _a, _b; | ||
this._terminated = false; | ||
@@ -66,32 +76,17 @@ this.descriptors = { | ||
}; | ||
// Ensure that options include the service address and port. | ||
// Ensure that options include all the required fields. | ||
const staticMembers = this | ||
.constructor; | ||
const servicePath = opts && opts.servicePath | ||
? opts.servicePath | ||
: opts && opts.apiEndpoint | ||
? opts.apiEndpoint | ||
: staticMembers.servicePath; | ||
const port = opts && opts.port ? opts.port : staticMembers.port; | ||
if (!opts) { | ||
opts = { servicePath, port }; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : typeof window !== 'undefined'; | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
} | ||
opts.servicePath = opts.servicePath || servicePath; | ||
opts.port = opts.port || port; | ||
// users can override the config from client side, like retry codes name. | ||
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 | ||
// The way to override client config for Showcase API: | ||
// | ||
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} | ||
// const showcaseClient = new showcaseClient({ projectId, customConfig }); | ||
opts.clientConfig = opts.clientConfig || {}; | ||
// If we're running in browser, it's OK to omit `fallback` since | ||
// google-gax has `browser` field in its `package.json`. | ||
// For Electron (which does not respect `browser` field), | ||
// pass `{fallback: true}` to the PhishingProtectionServiceV1Beta1Client constructor. | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
// Create a `gaxGrpc` object, with any grpc-specific options | ||
// sent to the client. | ||
opts.scopes = this | ||
.constructor.scopes; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
@@ -102,2 +97,6 @@ // Save options to use in initialize() method. | ||
this.auth = this._gaxGrpc.auth; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
} | ||
// Determine the client header string. | ||
@@ -182,2 +181,3 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -190,2 +190,3 @@ static get servicePath() { | ||
* exists for compatibility reasons. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -197,2 +198,3 @@ static get apiEndpoint() { | ||
* The port for this API service. | ||
* @returns {number} The default port for this service. | ||
*/ | ||
@@ -205,2 +207,3 @@ static get port() { | ||
* in this service. | ||
* @returns {string[]} List of default scopes. | ||
*/ | ||
@@ -212,4 +215,3 @@ static get scopes() { | ||
* Return the project ID used by this class. | ||
* @param {function(Error, string)} callback - the callback to | ||
* be called with the current project Id. | ||
* @returns {Promise} A promise that resolves to string containing the project ID. | ||
*/ | ||
@@ -243,3 +245,7 @@ getProjectId(callback) { | ||
* The first element of the array is an object representing [ReportPhishingResponse]{@link google.cloud.phishingprotection.v1beta1.ReportPhishingResponse}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.reportPhishing(request); | ||
*/ | ||
@@ -290,5 +296,6 @@ reportPhishing(request, optionsOrCallback, callback) { | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
* Terminate the gRPC channel and close the client. | ||
* | ||
* The client will no longer be usable and all future behavior is undefined. | ||
* @returns {Promise} A promise that resolves when the client is closed. | ||
*/ | ||
@@ -295,0 +302,0 @@ close() { |
@@ -7,2 +7,9 @@ # Changelog | ||
### [2.3.2](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.3.1...v2.3.2) (2020-11-12) | ||
### Bug Fixes | ||
* do not modify options object, use defaultScopes ([#220](https://www.github.com/googleapis/nodejs-phishing-protection/issues/220)) ([951b9ef](https://www.github.com/googleapis/nodejs-phishing-protection/commit/951b9ef0b357e57e54246ed54fa7fdae1e2198c4)) | ||
### [2.3.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.3.0...v2.3.1) (2020-10-02) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"repository": "googleapis/nodejs-phishing-protection", | ||
"name": "@google-cloud/phishing-protection", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"author": "Google LLC", | ||
@@ -26,3 +26,3 @@ "description": "Phishing Protection API client for Node.js", | ||
"dependencies": { | ||
"google-gax": "^2.1.0" | ||
"google-gax": "^2.9.2" | ||
}, | ||
@@ -46,4 +46,4 @@ "devDependencies": { | ||
"typescript": "^3.8.3", | ||
"webpack": "^4.41.2", | ||
"webpack-cli": "^3.3.10", | ||
"webpack": "^5.0.0", | ||
"webpack-cli": "^4.0.0", | ||
"@microsoft/api-documenter": "^7.8.10", | ||
@@ -50,0 +50,0 @@ "@microsoft/api-extractor": "^7.8.10" |
Sorry, the diff of this file is not supported yet
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
874463
14965
Updatedgoogle-gax@^2.9.2