Socket
Socket
Sign inDemoInstall

@google-cloud/vision

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/vision - npm Package Compare versions

Comparing version 2.4.2 to 3.0.0

4

build/src/helpers.d.ts
/// <reference types="node" />
import * as protoTypes from '../protos/protos';
interface FeatureFunction {
(request: string | ImprovedRequest | Buffer): Promise<[protoTypes.google.cloud.vision.v1.IAnnotateImageResponse]>;
(request: string | ImprovedRequest | Buffer): Promise<[
protoTypes.google.cloud.vision.v1.IAnnotateImageResponse
]>;
}

@@ -6,0 +8,0 @@ export interface FeaturesMethod {

@@ -174,3 +174,3 @@ "use strict";

*/
methods.annotateImage = promisify_1.promisify(function (request, callOptionsOrCallback, callback) {
methods.annotateImage = (0, promisify_1.promisify)(function (request, callOptionsOrCallback, callback) {
// If a callback was provided and options were skipped, normalize

@@ -264,3 +264,3 @@ // the argument names.

*/
methods.faceDetection = promisify_1.promisify(_createSingleFeatureMethod(features.FACE_DETECTION));
methods.faceDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.FACE_DETECTION));
/**

@@ -319,3 +319,3 @@ * Annotate a single image with landmark detection.

*/
methods.landmarkDetection = promisify_1.promisify(_createSingleFeatureMethod(features.LANDMARK_DETECTION));
methods.landmarkDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.LANDMARK_DETECTION));
/**

@@ -374,3 +374,3 @@ * Annotate a single image with logo detection.

*/
methods.logoDetection = promisify_1.promisify(_createSingleFeatureMethod(features.LOGO_DETECTION));
methods.logoDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.LOGO_DETECTION));
/**

@@ -429,3 +429,3 @@ * Annotate a single image with label detection.

*/
methods.labelDetection = promisify_1.promisify(_createSingleFeatureMethod(features.LABEL_DETECTION));
methods.labelDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.LABEL_DETECTION));
/**

@@ -484,3 +484,3 @@ * Annotate a single image with text detection.

*/
methods.textDetection = promisify_1.promisify(_createSingleFeatureMethod(features.TEXT_DETECTION));
methods.textDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.TEXT_DETECTION));
/**

@@ -539,3 +539,3 @@ * Annotate a single image with document text detection.

*/
methods.documentTextDetection = promisify_1.promisify(_createSingleFeatureMethod(features.DOCUMENT_TEXT_DETECTION));
methods.documentTextDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.DOCUMENT_TEXT_DETECTION));
/**

@@ -594,3 +594,3 @@ * Annotate a single image with safe search detection.

*/
methods.safeSearchDetection = promisify_1.promisify(_createSingleFeatureMethod(features.SAFE_SEARCH_DETECTION));
methods.safeSearchDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.SAFE_SEARCH_DETECTION));
/**

@@ -649,3 +649,3 @@ * Annotate a single image with image properties.

*/
methods.imageProperties = promisify_1.promisify(_createSingleFeatureMethod(features.IMAGE_PROPERTIES));
methods.imageProperties = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.IMAGE_PROPERTIES));
/**

@@ -704,3 +704,3 @@ * Annotate a single image with crop hints.

*/
methods.cropHints = promisify_1.promisify(_createSingleFeatureMethod(features.CROP_HINTS));
methods.cropHints = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.CROP_HINTS));
/**

@@ -759,3 +759,3 @@ * Annotate a single image with web detection.

*/
methods.webDetection = promisify_1.promisify(_createSingleFeatureMethod(features.WEB_DETECTION));
methods.webDetection = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.WEB_DETECTION));
/**

@@ -813,3 +813,3 @@ * Annotate a single image with the result from Product Search.

if (features.PRODUCT_SEARCH !== undefined) {
methods.productSearch = promisify_1.promisify(_createSingleFeatureMethod(features.PRODUCT_SEARCH));
methods.productSearch = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.PRODUCT_SEARCH));
}

@@ -871,3 +871,3 @@ /**

if (features.OBJECT_LOCALIZATION !== undefined) {
methods.objectLocalization = promisify_1.promisify(_createSingleFeatureMethod(features.OBJECT_LOCALIZATION));
methods.objectLocalization = (0, promisify_1.promisify)(_createSingleFeatureMethod(features.OBJECT_LOCALIZATION));
}

@@ -874,0 +874,0 @@ return methods;

@@ -1,3 +0,3 @@

import * as gax from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import * as protos from '../../protos/protos';

@@ -37,3 +37,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -61,9 +61,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -137,3 +143,7 @@ * Initialize the client.

*/
batchAnnotateImages(request?: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | undefined, {} | undefined]>;
batchAnnotateImages(request?: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse,
protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | undefined,
{} | undefined
]>;
batchAnnotateImages(request: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

@@ -153,4 +163,4 @@ batchAnnotateImages(request: protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

* @param {number[]} request.requests
* Required. The list of file annotation requests. Right now we support only
* one AnnotateFileRequest in BatchAnnotateFilesRequest.
* Required. The list of file annotation requests. Right now we support only one
* AnnotateFileRequest in BatchAnnotateFilesRequest.
* @param {string} request.parent

@@ -179,3 +189,7 @@ * Optional. Target project and location to make a call.

*/
batchAnnotateFiles(request?: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | undefined, {} | undefined]>;
batchAnnotateFiles(request?: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse,
protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | undefined,
{} | undefined
]>;
batchAnnotateFiles(request: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void;

@@ -225,3 +239,7 @@ batchAnnotateFiles(request: protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest, callback: Callback<protos.google.cloud.vision.v1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void;

*/
asyncBatchAnnotateImages(request?: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
asyncBatchAnnotateImages(request?: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -279,3 +297,7 @@ asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

*/
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -282,0 +304,0 @@ asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ImageAnnotatorClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./image_annotator_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -47,3 +44,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -71,9 +68,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -99,4 +102,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.

@@ -147,7 +154,22 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=projects/*/operations/*}',
additional_bindings: [
{ get: '/v1/{name=projects/*/locations/*/operations/*}' },
{ get: '/v1/{name=operations/*}' },
{ get: '/v1/{name=locations/*/operations/*}' },
],
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -169,3 +191,3 @@ const asyncBatchAnnotateImagesResponse = protoFilesRoot.lookup('.google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -213,3 +235,3 @@ /**

const descriptor = this.descriptors.longrunning[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;

@@ -277,3 +299,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -298,3 +320,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -319,3 +341,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -339,5 +361,5 @@ });

async checkAsyncBatchAnnotateImagesProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateImages, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateImages, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -359,3 +381,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -379,5 +401,5 @@ });

async checkAsyncBatchAnnotateFilesProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -545,4 +567,3 @@ }

close() {
this.initialize();
if (!this._terminated) {
if (this.imageAnnotatorStub && !this._terminated) {
return this.imageAnnotatorStub.then(stub => {

@@ -549,0 +570,0 @@ this._terminated = true;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,2 +20,3 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductSearchClient = exports.ImageAnnotatorClient = void 0;
var image_annotator_client_1 = require("./image_annotator_client");

@@ -22,0 +23,0 @@ Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } });

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ProductSearchClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./product_search_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -58,3 +55,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -82,9 +79,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ProductSearchClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -110,4 +113,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.

@@ -168,7 +175,22 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=projects/*/operations/*}',
additional_bindings: [
{ get: '/v1/{name=projects/*/locations/*/operations/*}' },
{ get: '/v1/{name=operations/*}' },
{ get: '/v1/{name=locations/*/operations/*}' },
],
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -190,3 +212,3 @@ const importProductSetsResponse = protoFilesRoot.lookup('.google.cloud.vision.v1.ImportProductSetsResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -251,3 +273,3 @@ /**

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;

@@ -315,3 +337,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -336,3 +358,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -357,3 +379,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
'product_set.name': request.productSet.name || '',

@@ -378,3 +400,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -399,3 +421,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -420,3 +442,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -441,3 +463,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
'product.name': request.product.name || '',

@@ -462,3 +484,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -483,3 +505,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -504,3 +526,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -525,3 +547,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -546,3 +568,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -567,3 +589,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -588,3 +610,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -608,5 +630,5 @@ });

async checkImportProductSetsProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importProductSets, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importProductSets, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -628,3 +650,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -648,5 +670,5 @@ });

async checkPurgeProductsProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeProducts, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeProducts, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -668,3 +690,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -705,3 +727,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -747,3 +769,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -770,3 +792,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -808,3 +830,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -851,3 +873,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -874,3 +896,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -915,3 +937,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -961,3 +983,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -984,3 +1006,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1022,3 +1044,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1065,3 +1087,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1267,4 +1289,3 @@ });

close() {
this.initialize();
if (!this._terminated) {
if (this.productSearchStub && !this._terminated) {
return this.productSearchStub.then(stub => {

@@ -1271,0 +1292,0 @@ this._terminated = true;

@@ -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';

@@ -33,3 +33,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -57,9 +57,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -120,3 +126,7 @@ * Initialize the client.

*/
batchAnnotateImages(request?: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>;
batchAnnotateImages(request?: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse,
(protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | undefined),
{} | undefined
]>;
batchAnnotateImages(request: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

@@ -123,0 +133,0 @@ batchAnnotateImages(request: protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ImageAnnotatorClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -45,3 +43,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -69,9 +67,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -97,4 +101,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.

@@ -140,3 +148,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;
}

@@ -179,3 +187,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;

@@ -252,4 +260,3 @@ }

close() {
this.initialize();
if (!this._terminated) {
if (this.imageAnnotatorStub && !this._terminated) {
return this.imageAnnotatorStub.then(stub => {

@@ -256,0 +263,0 @@ this._terminated = true;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,4 +20,5 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageAnnotatorClient = void 0;
var image_annotator_client_1 = require("./image_annotator_client");
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } });
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import * as gax from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import * as protos from '../../protos/protos';

@@ -34,3 +34,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -58,9 +58,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -121,3 +127,7 @@ * Initialize the client.

*/
batchAnnotateImages(request?: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>;
batchAnnotateImages(request?: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse,
(protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | undefined),
{} | undefined
]>;
batchAnnotateImages(request: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

@@ -149,3 +159,7 @@ batchAnnotateImages(request: protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

*/
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -152,0 +166,0 @@ asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p2beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ImageAnnotatorClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./image_annotator_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -47,3 +44,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -71,9 +68,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -99,4 +102,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.

@@ -139,7 +146,12 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -158,3 +170,3 @@ const asyncBatchAnnotateFilesResponse = protoFilesRoot.lookup('.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -200,3 +212,3 @@ /**

const descriptor = this.descriptors.longrunning[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;

@@ -295,5 +307,5 @@ }

async checkAsyncBatchAnnotateFilesProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -308,4 +320,3 @@ }

close() {
this.initialize();
if (!this._terminated) {
if (this.imageAnnotatorStub && !this._terminated) {
return this.imageAnnotatorStub.then(stub => {

@@ -312,0 +323,0 @@ this._terminated = true;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,4 +20,5 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageAnnotatorClient = void 0;
var image_annotator_client_1 = require("./image_annotator_client");
Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } });
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import * as gax from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import * as protos from '../../protos/protos';

@@ -37,3 +37,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -61,9 +61,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -124,3 +130,7 @@ * Initialize the client.

*/
batchAnnotateImages(request?: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>;
batchAnnotateImages(request?: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse,
(protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | undefined),
{} | undefined
]>;
batchAnnotateImages(request: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

@@ -152,3 +162,7 @@ batchAnnotateImages(request: protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

*/
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -155,0 +169,0 @@ asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p3beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ImageAnnotatorClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./image_annotator_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -47,3 +44,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -71,9 +68,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -99,4 +102,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.

@@ -147,7 +154,18 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=operations/*}',
additional_bindings: [{ get: '/v1/{name=locations/*/operations/*}' }],
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -166,3 +184,3 @@ const asyncBatchAnnotateFilesResponse = protoFilesRoot.lookup('.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -208,3 +226,3 @@ /**

const descriptor = this.descriptors.longrunning[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;

@@ -303,5 +321,5 @@ }

async checkAsyncBatchAnnotateFilesProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -469,4 +487,3 @@ }

close() {
this.initialize();
if (!this._terminated) {
if (this.imageAnnotatorStub && !this._terminated) {
return this.imageAnnotatorStub.then(stub => {

@@ -473,0 +490,0 @@ this._terminated = true;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,2 +20,3 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductSearchClient = exports.ImageAnnotatorClient = void 0;
var image_annotator_client_1 = require("./image_annotator_client");

@@ -22,0 +23,0 @@ Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } });

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ProductSearchClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./product_search_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -58,3 +55,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -82,9 +79,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ProductSearchClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -110,4 +113,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.

@@ -168,7 +175,18 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=operations/*}',
additional_bindings: [{ get: '/v1/{name=locations/*/operations/*}' }],
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -187,3 +205,3 @@ const importProductSetsResponse = protoFilesRoot.lookup('.google.cloud.vision.v1p3beta1.ImportProductSetsResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -247,3 +265,3 @@ /**

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;

@@ -311,3 +329,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -332,3 +350,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -353,3 +371,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
'product_set.name': request.productSet.name || '',

@@ -374,3 +392,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -395,3 +413,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -416,3 +434,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -437,3 +455,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
'product.name': request.product.name || '',

@@ -458,3 +476,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -479,3 +497,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -500,3 +518,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -521,3 +539,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -542,3 +560,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -563,3 +581,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -584,3 +602,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -604,5 +622,5 @@ });

async checkImportProductSetsProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importProductSets, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importProductSets, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -624,3 +642,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -661,3 +679,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -703,3 +721,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -726,3 +744,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -764,3 +782,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -807,3 +825,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -830,3 +848,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -871,3 +889,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -917,3 +935,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -940,3 +958,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -978,3 +996,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1021,3 +1039,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1223,4 +1241,3 @@ });

close() {
this.initialize();
if (!this._terminated) {
if (this.productSearchStub && !this._terminated) {
return this.productSearchStub.then(stub => {

@@ -1227,0 +1244,0 @@ this._terminated = true;

@@ -1,3 +0,3 @@

import * as gax from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
import * as protos from '../../protos/protos';

@@ -37,3 +37,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -61,9 +61,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -124,3 +130,7 @@ * Initialize the client.

*/
batchAnnotateImages(request?: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, (protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | undefined), {} | undefined]>;
batchAnnotateImages(request?: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse,
(protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | undefined),
{} | undefined
]>;
batchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

@@ -152,3 +162,7 @@ batchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest | null | undefined, {} | null | undefined>): void;

*/
batchAnnotateFiles(request?: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options?: CallOptions): Promise<[protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, (protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | undefined), {} | undefined]>;
batchAnnotateFiles(request?: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options?: CallOptions): Promise<[
protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse,
(protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | undefined),
{} | undefined
]>;
batchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, options: CallOptions, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void;

@@ -185,3 +199,7 @@ batchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, callback: Callback<protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest | null | undefined, {} | null | undefined>): void;

*/
asyncBatchAnnotateImages(request?: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
asyncBatchAnnotateImages(request?: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -226,3 +244,7 @@ asyncBatchAnnotateImages(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

*/
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
asyncBatchAnnotateFiles(request?: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

@@ -229,0 +251,0 @@ asyncBatchAnnotateFiles(request: protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, callback: Callback<LROperation<protos.google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, protos.google.cloud.vision.v1p4beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ImageAnnotatorClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./image_annotator_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -47,3 +44,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -71,9 +68,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ImageAnnotatorClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -99,4 +102,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.

@@ -147,7 +154,18 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=operations/*}',
additional_bindings: [{ get: '/v1/{name=locations/*/operations/*}' }],
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -169,3 +187,3 @@ const asyncBatchAnnotateImagesResponse = protoFilesRoot.lookup('.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -213,3 +231,3 @@ /**

const descriptor = this.descriptors.longrunning[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;

@@ -324,5 +342,5 @@ }

async checkAsyncBatchAnnotateImagesProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateImages, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateImages, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -359,5 +377,5 @@ }

async checkAsyncBatchAnnotateFilesProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.asyncBatchAnnotateFiles, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -525,4 +543,3 @@ }

close() {
this.initialize();
if (!this._terminated) {
if (this.imageAnnotatorStub && !this._terminated) {
return this.imageAnnotatorStub.then(stub => {

@@ -529,0 +546,0 @@ this._terminated = true;

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -20,2 +20,3 @@ // Licensed under the Apache License, Version 2.0 (the "License");

Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductSearchClient = exports.ImageAnnotatorClient = void 0;
var image_annotator_client_1 = require("./image_annotator_client");

@@ -22,0 +23,0 @@ Object.defineProperty(exports, "ImageAnnotatorClient", { enumerable: true, get: function () { return image_annotator_client_1.ImageAnnotatorClient; } });

"use strict";
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//

@@ -21,4 +21,2 @@ // Licensed under the Apache License, Version 2.0 (the "License");

exports.ProductSearchClient = void 0;
/* global window */
const gax = require("google-gax");
const jsonProtos = require("../../protos/protos.json");

@@ -31,3 +29,2 @@ /**

const gapicConfig = require("./product_search_client_config.json");
const google_gax_1 = require("google-gax");
const version = require('../../../package.json').version;

@@ -62,3 +59,3 @@ /**

* 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).
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:

@@ -86,9 +83,15 @@ * @param {object} [options.credentials] - Credentials object.

* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.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.
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
* For more information, please check the
* {@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 ProductSearchClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -114,4 +117,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.

@@ -172,7 +179,18 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

// rather than holding a request open.
this.operationsClient = this._gaxModule
.lro({
const lroOptions = {
auth: this.auth,
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
})
};
if (opts.fallback === 'rest') {
lroOptions.protoJson = protoFilesRoot;
lroOptions.httpRules = [
{
selector: 'google.longrunning.Operations.GetOperation',
get: '/v1/{name=operations/*}',
additional_bindings: [{ get: '/v1/{name=locations/*/operations/*}' }],
},
];
}
this.operationsClient = this._gaxModule
.lro(lroOptions)
.operationsClient(opts);

@@ -194,3 +212,3 @@ const importProductSetsResponse = protoFilesRoot.lookup('.google.cloud.vision.v1p4beta1.ImportProductSetsResponse');

// Add a warn function to the client constructor so it can be easily tested.
this.warn = gax.warn;
this.warn = this._gaxModule.warn;
}

@@ -255,3 +273,3 @@ /**

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;

@@ -319,3 +337,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -340,3 +358,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -361,3 +379,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
'product_set.name': request.productSet.name || '',

@@ -382,3 +400,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -403,3 +421,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -424,3 +442,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -445,3 +463,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
'product.name': request.product.name || '',

@@ -466,3 +484,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -487,3 +505,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -508,3 +526,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -529,3 +547,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -550,3 +568,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -571,3 +589,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -592,3 +610,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -612,5 +630,5 @@ });

async checkImportProductSetsProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.importProductSets, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importProductSets, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -632,3 +650,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -652,5 +670,5 @@ });

async checkPurgeProductsProgress(name) {
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.purgeProducts, gax.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeProducts, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -672,3 +690,3 @@ }

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -709,3 +727,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -751,3 +769,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -774,3 +792,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -812,3 +830,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -855,3 +873,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -878,3 +896,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -919,3 +937,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -965,3 +983,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
parent: request.parent || '',

@@ -988,3 +1006,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1026,3 +1044,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1069,3 +1087,3 @@ });

options.otherArgs.headers['x-goog-request-params'] =
gax.routingHeader.fromParams({
this._gaxModule.routingHeader.fromParams({
name: request.name || '',

@@ -1271,4 +1289,3 @@ });

close() {
this.initialize();
if (!this._terminated) {
if (this.productSearchStub && !this._terminated) {
return this.productSearchStub.then(stub => {

@@ -1275,0 +1292,0 @@ this._terminated = true;

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

## [3.0.0](https://github.com/googleapis/nodejs-vision/compare/v2.4.2...v3.0.0) (2022-09-01)
### ⚠ BREAKING CHANGES
* Update library to use Node 12 (#1016)
* BatchAnnotateImagesRequest.requests is required (#1011)
### Features
* Add TextDetectionParams.advanced_ocr_options ([#1034](https://github.com/googleapis/nodejs-vision/issues/1034)) ([828f045](https://github.com/googleapis/nodejs-vision/commit/828f045563eff5668dc95f628745716978759788))
* Support regapic LRO ([a5f8f72](https://github.com/googleapis/nodejs-vision/commit/a5f8f72328655c7959475d0258df164b576af570))
### Bug Fixes
* Allow passing gax instance to client constructor ([#1042](https://github.com/googleapis/nodejs-vision/issues/1042)) ([4cc32dc](https://github.com/googleapis/nodejs-vision/commit/4cc32dc2068cd9490b28a8869a1d6de6c7a7b0c3))
* BatchAnnotateImagesRequest.requests is required ([#1011](https://github.com/googleapis/nodejs-vision/issues/1011)) ([574f43e](https://github.com/googleapis/nodejs-vision/commit/574f43ecfadab77aa992aae2a24e36a3bb9f7b22))
* Better support for fallback mode ([#1037](https://github.com/googleapis/nodejs-vision/issues/1037)) ([ea578e7](https://github.com/googleapis/nodejs-vision/commit/ea578e784271fd2f68c330850f64d1d9e406625d))
* Change import long to require ([#1038](https://github.com/googleapis/nodejs-vision/issues/1038)) ([b57b334](https://github.com/googleapis/nodejs-vision/commit/b57b334c35591e73f875ef61f375f452e78ce094))
* **deps:** Update dependency redis to ~4.3.0 ([#1039](https://github.com/googleapis/nodejs-vision/issues/1039)) ([ea26d33](https://github.com/googleapis/nodejs-vision/commit/ea26d3349b1e2db8eb021924b1ee2406f135b712))
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-vision/issues/1553)) ([#1041](https://github.com/googleapis/nodejs-vision/issues/1041)) ([4de6e42](https://github.com/googleapis/nodejs-vision/commit/4de6e42aada9228574bc2f50d6b6e10f7f244b4d))
* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-vision/issues/1546)) ([#1040](https://github.com/googleapis/nodejs-vision/issues/1040)) ([85f115f](https://github.com/googleapis/nodejs-vision/commit/85f115f31f9b26c64e7b2704e6f908b88673db86))
### Build System
* Update library to use Node 12 ([#1016](https://github.com/googleapis/nodejs-vision/issues/1016)) ([12bd0f6](https://github.com/googleapis/nodejs-vision/commit/12bd0f66db6c497eb8e2d8a8236dca95432043b8))
### [2.4.2](https://www.github.com/googleapis/nodejs-vision/compare/v2.4.1...v2.4.2) (2022-01-06)

@@ -9,0 +38,0 @@

{
"name": "@google-cloud/vision",
"description": "Google Cloud Vision API client for Node.js",
"version": "2.4.2",
"version": "3.0.0",
"license": "Apache-2.0",
"author": "Google Inc",
"engines": {
"node": ">=10"
"node": ">=12.0.0"
},

@@ -48,10 +48,10 @@ "repository": "googleapis/nodejs-vision",

"dependencies": {
"@google-cloud/promisify": "^2.0.0",
"google-gax": "^2.24.1",
"@google-cloud/promisify": "^3.0.0",
"google-gax": "^3.3.0",
"is": "^3.3.0"
},
"devDependencies": {
"@google-cloud/storage": "^5.0.0",
"@google-cloud/storage": "^6.0.0",
"@types/is": "0.0.21",
"@types/mocha": "^8.0.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.0.0",

@@ -62,13 +62,13 @@ "@types/sinon": "^10.0.0",

"codecov": "^3.6.5",
"gts": "^2.0.0",
"gts": "^4.0.0",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^1.0.2",
"jsdoc-region-tag": "^1.0.4",
"linkinator": "^2.0.3",
"mocha": "^8.0.0",
"jsdoc-fresh": "^2.0.0",
"jsdoc-region-tag": "^2.0.0",
"linkinator": "^4.0.0",
"mocha": "^10.0.0",
"null-loader": "^4.0.0",
"pack-n-play": "^1.0.0-2",
"sinon": "^12.0.0",
"sinon": "^14.0.0",
"ts-loader": "^9.0.0",
"typescript": "^3.8.3",
"typescript": "^4.6.4",
"uuid": "^8.0.0",

@@ -75,0 +75,0 @@ "webpack": "^5.0.0",

@@ -7,3 +7,3 @@ [//]: # "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/vision.svg)](https://www.npmjs.org/package/@google-cloud/vision)

@@ -108,18 +108,18 @@

Node.js.
If you are using an end-of-life version of Node.js, we recommend that you update
as soon as possible to an actively supported LTS version.
Google's client libraries support legacy versions of Node.js runtimes on a
best-efforts basis with the following warnings:
* Legacy versions are not tested in continuous integration.
* Some security patches and features cannot be backported.
* Dependencies cannot be kept up-to-date.
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
The dist-tags follow the naming convention `legacy-(version)`.
For example, `npm install @google-cloud/vision@legacy-8` installs client libraries
for versions compatible with Node.js 8.
_Legacy Node.js versions are supported as a best effort:_
* Legacy versions will not be tested in continuous integration.
* Some security patches may not be able to be backported.
* Dependencies will not be kept up-to-date, and features will not be backported.
#### Legacy tags available
* `legacy-8`: install client libraries from this dist-tag for versions
compatible with Node.js 8.
## Versioning

@@ -130,6 +130,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.

@@ -142,3 +142,2 @@

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

@@ -145,0 +144,0 @@

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

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

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

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

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

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

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

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 too big to display

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

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

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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