Socket
Socket
Sign inDemoInstall

@google-cloud/recaptcha-enterprise

Package Overview
Dependencies
127
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

1

build/src/index.d.ts
import * as v1beta1 from './v1beta1';
import * as v1 from './v1';
declare const RecaptchaEnterpriseServiceClient: typeof v1.RecaptchaEnterpriseServiceClient;
declare type RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient;
export { v1beta1, v1, RecaptchaEnterpriseServiceClient };

@@ -5,0 +6,0 @@ declare const _default: {

58

build/src/v1/recaptcha_enterprise_service_client.d.ts

@@ -32,4 +32,6 @@ /// <reference types="node" />

*
* @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.

@@ -54,2 +56,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.
*/

@@ -73,2 +82,3 @@ constructor(opts?: ClientOptions);

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -79,2 +89,3 @@ static get servicePath(): string;

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -84,2 +95,3 @@ static get apiEndpoint(): string;

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -90,2 +102,3 @@ static get port(): number;

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -117,14 +130,3 @@ static get scopes(): string[];

/**
* Equivalent to {@link listKeys}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listKeys} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -145,9 +147,15 @@ * The request object that will be sent.

* An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event.
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed. Note that it can affect your quota.
* We recommend using `listKeysAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/
listKeysStream(request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: gax.CallOptions): Transform;
/**
* Equivalent to {@link listKeys}, but returns an iterable object.
* Equivalent to `listKeys`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -167,3 +175,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
* When you iterate the returned iterable, each element will be an object representing
* [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. The API will be called under the hood as needed, once per the page,
* so you can stop the iteration when you don't need more results.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
* @example
* const iterable = client.listKeysAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -235,7 +254,8 @@ listKeysAsync(request?: protos.google.cloud.recaptchaenterprise.v1.IListKeysRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1.IKey>;

/**
* 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 RecaptchaEnterpriseServiceClient 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.

@@ -190,5 +189,4 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];

});
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] ||
this.descriptors.stream[methodName] ||
this.descriptors.longrunning[methodName]);
const descriptor = this.descriptors.page[methodName] || undefined;
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
this.innerApiCalls[methodName] = apiCall;

@@ -200,2 +198,3 @@ }

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -208,2 +207,3 @@ static get servicePath() {

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -215,2 +215,3 @@ static get apiEndpoint() {

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -223,2 +224,3 @@ static get port() {

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -230,4 +232,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.
*/

@@ -255,3 +256,7 @@ getProjectId(callback) {

* The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1.Assessment}.
* 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.createAssessment(request);
*/

@@ -292,3 +297,7 @@ createAssessment(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse}.
* 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.annotateAssessment(request);
*/

@@ -328,3 +337,7 @@ annotateAssessment(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}.
* 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.createKey(request);
*/

@@ -362,3 +375,7 @@ createKey(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}.
* 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.getKey(request);
*/

@@ -398,3 +415,7 @@ getKey(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key}.
* 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.updateKey(request);
*/

@@ -432,3 +453,7 @@ updateKey(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
* 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.deleteKey(request);
*/

@@ -472,15 +497,10 @@ deleteKey(request, optionsOrCallback, callback) {

* The first element of the array is Array of [Key]{@link google.cloud.recaptchaenterprise.v1.Key}.
* The client library support auto-pagination by default: it will call the API as many
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
*
* When autoPaginate: false is specified through options, the array has three elements.
* The first element is Array of [Key]{@link google.cloud.recaptchaenterprise.v1.Key} that corresponds to
* the one page received from the API server.
* If the second element is not null it contains the request object of type [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1.ListKeysRequest}
* that can be used to obtain the next page of the results.
* If it is null, the next page does not exist.
* The third element contains the raw response received from the API server. Its type is
* [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1.ListKeysResponse}.
*
* The promise has a method named "cancel" which cancels the ongoing API call.
* Note that it can affect your quota.
* We recommend using `listKeysAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/

@@ -507,14 +527,3 @@ listKeys(request, optionsOrCallback, callback) {

/**
* Equivalent to {@link listKeys}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listKeys} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -535,2 +544,9 @@ * The request object that will be sent.

* An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1.Key} on 'data' event.
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed. Note that it can affect your quota.
* We recommend using `listKeysAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/

@@ -550,6 +566,5 @@ listKeysStream(request, options) {

/**
* Equivalent to {@link listKeys}, but returns an iterable object.
* Equivalent to `listKeys`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -569,3 +584,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
* When you iterate the returned iterable, each element will be an object representing
* [Key]{@link google.cloud.recaptchaenterprise.v1.Key}. The API will be called under the hood as needed, once per the page,
* so you can stop the iteration when you don't need more results.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
* @example
* const iterable = client.listKeysAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -678,5 +704,6 @@ listKeysAsync(request, options) {

/**
* 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.
*/

@@ -683,0 +710,0 @@ close() {

@@ -32,4 +32,6 @@ /// <reference types="node" />

*
* @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.

@@ -54,2 +56,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.
*/

@@ -73,2 +82,3 @@ constructor(opts?: ClientOptions);

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -79,2 +89,3 @@ static get servicePath(): string;

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -84,2 +95,3 @@ static get apiEndpoint(): string;

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -90,2 +102,3 @@ static get port(): number;

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -117,14 +130,3 @@ static get scopes(): string[];

/**
* Equivalent to {@link listKeys}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listKeys} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -145,9 +147,15 @@ * The request object that will be sent.

* An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event.
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed. Note that it can affect your quota.
* We recommend using `listKeysAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/
listKeysStream(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: gax.CallOptions): Transform;
/**
* Equivalent to {@link listKeys}, but returns an iterable object.
* Equivalent to `listKeys`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -167,3 +175,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
* When you iterate the returned iterable, each element will be an object representing
* [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. The API will be called under the hood as needed, once per the page,
* so you can stop the iteration when you don't need more results.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
* @example
* const iterable = client.listKeysAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -235,7 +254,8 @@ listKeysAsync(request?: protos.google.cloud.recaptchaenterprise.v1beta1.IListKeysRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.recaptchaenterprise.v1beta1.IKey>;

/**
* 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 RecaptchaEnterpriseServiceV1Beta1Client 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.

@@ -190,5 +189,4 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];

});
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] ||
this.descriptors.stream[methodName] ||
this.descriptors.longrunning[methodName]);
const descriptor = this.descriptors.page[methodName] || undefined;
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
this.innerApiCalls[methodName] = apiCall;

@@ -200,2 +198,3 @@ }

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -208,2 +207,3 @@ static get servicePath() {

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -215,2 +215,3 @@ static get apiEndpoint() {

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -223,2 +224,3 @@ static get port() {

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -230,4 +232,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.
*/

@@ -255,3 +256,7 @@ getProjectId(callback) {

* The first element of the array is an object representing [Assessment]{@link google.cloud.recaptchaenterprise.v1beta1.Assessment}.
* 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.createAssessment(request);
*/

@@ -292,3 +297,7 @@ createAssessment(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [AnnotateAssessmentResponse]{@link google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse}.
* 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.annotateAssessment(request);
*/

@@ -328,3 +337,7 @@ annotateAssessment(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}.
* 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.createKey(request);
*/

@@ -362,3 +375,7 @@ createKey(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}.
* 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.getKey(request);
*/

@@ -398,3 +415,7 @@ getKey(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}.
* 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.updateKey(request);
*/

@@ -432,3 +453,7 @@ updateKey(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
* 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.deleteKey(request);
*/

@@ -472,15 +497,10 @@ deleteKey(request, optionsOrCallback, callback) {

* The first element of the array is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}.
* The client library support auto-pagination by default: it will call the API as many
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
*
* When autoPaginate: false is specified through options, the array has three elements.
* The first element is Array of [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} that corresponds to
* the one page received from the API server.
* If the second element is not null it contains the request object of type [ListKeysRequest]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest}
* that can be used to obtain the next page of the results.
* If it is null, the next page does not exist.
* The third element contains the raw response received from the API server. Its type is
* [ListKeysResponse]{@link google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse}.
*
* The promise has a method named "cancel" which cancels the ongoing API call.
* Note that it can affect your quota.
* We recommend using `listKeysAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/

@@ -507,14 +527,3 @@ listKeys(request, optionsOrCallback, callback) {

/**
* Equivalent to {@link listKeys}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listKeys} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -535,2 +544,9 @@ * The request object that will be sent.

* An object stream which emits an object representing [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key} on 'data' event.
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed. Note that it can affect your quota.
* We recommend using `listKeysAsync()`
* method described below for async iteration which you can stop as needed.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
*/

@@ -550,6 +566,5 @@ listKeysStream(request, options) {

/**
* Equivalent to {@link listKeys}, but returns an iterable object.
* Equivalent to `listKeys`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -569,3 +584,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
* When you iterate the returned iterable, each element will be an object representing
* [Key]{@link google.cloud.recaptchaenterprise.v1beta1.Key}. The API will be called under the hood as needed, once per the page,
* so you can stop the iteration when you don't need more results.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
* for more details and examples.
* @example
* const iterable = client.listKeysAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -678,5 +704,6 @@ listKeysAsync(request, options) {

/**
* 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.
*/

@@ -683,0 +710,0 @@ close() {

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

### [2.0.2](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.1...v2.0.2) (2020-11-06)
### Bug Fixes
* do not modify options object, use defaultScopes ([#222](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/issues/222)) ([807b692](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/commit/807b6925ce52d14b3e7b2afa75fc54da805ce604))
### [2.0.1](https://www.github.com/googleapis/nodejs-recaptcha-enterprise/compare/v2.0.0...v2.0.1) (2020-07-06)

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

{
"repository": "googleapis/nodejs-recaptcha-enterprise",
"name": "@google-cloud/recaptcha-enterprise",
"version": "2.0.1",
"version": "2.0.2",
"author": "Google LLC",

@@ -28,6 +28,6 @@ "description": "reCAPTCHA Enterprise API client for Node.js",

"dependencies": {
"google-gax": "^2.1.0"
"google-gax": "^2.9.2"
},
"devDependencies": {
"@types/mocha": "^7.0.0",
"@types/mocha": "^8.0.0",
"@types/node": "^12.0.0",

@@ -45,6 +45,8 @@ "@types/sinon": "^9.0.0",

"sinon": "^9.0.1",
"ts-loader": "^7.0.0",
"ts-loader": "^8.0.0",
"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",
"@microsoft/api-extractor": "^7.8.10"
},

@@ -65,3 +67,5 @@ "scripts": {

"prelint": "cd samples; npm link ../; npm install",
"precompile": "gts clean"
"precompile": "gts clean",
"api-extractor": "api-extractor run --local",
"api-documenter": "api-documenter yaml --input-folder=temp"
},

@@ -68,0 +72,0 @@ "license": "Apache-2.0",

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

A comprehensive list of changes in each version may be found in
[the CHANGELOG](https://github.com/googleapis/nodejs-recaptcha-enterprise/blob/master/CHANGELOG.md).
* [Google Cloud reCAPTCHA Enterprise Node.js Client API Reference][client-docs]

@@ -19,0 +22,0 @@ * [Google Cloud reCAPTCHA Enterprise Documentation][product-docs]

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc