Socket
Socket
Sign inDemoInstall

@google-cloud/speech

Package Overview
Dependencies
6
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.1 to 5.0.2

13

build/src/v1/adaptation_client.d.ts
/// <reference types="node" />
import * as gax from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import { Transform } from 'stream';

@@ -63,4 +63,11 @@ import * as protos from '../../protos/protos';

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new AdaptationClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -67,0 +74,0 @@ * Initialize the client.

@@ -21,4 +21,2 @@ "use strict";

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

@@ -70,4 +68,11 @@ /**

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new AdaptationClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -93,4 +98,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.

@@ -152,3 +161,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;
}

@@ -262,3 +271,3 @@ /**

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

@@ -283,3 +292,3 @@ });

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

@@ -304,3 +313,3 @@ });

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

@@ -325,3 +334,3 @@ });

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

@@ -346,3 +355,3 @@ });

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

@@ -367,3 +376,3 @@ });

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

@@ -388,3 +397,3 @@ });

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

@@ -409,3 +418,3 @@ });

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

@@ -430,3 +439,3 @@ });

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

@@ -480,3 +489,3 @@ });

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

@@ -535,3 +544,3 @@ });

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

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

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

@@ -608,3 +617,3 @@ });

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

@@ -663,3 +672,3 @@ });

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

@@ -666,0 +675,0 @@ });

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

@@ -62,4 +62,11 @@ /**

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new SpeechClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -66,0 +73,0 @@ * Initialize the client.

@@ -21,5 +21,2 @@ "use strict";

exports.SpeechClient = void 0;
/* global window */
const gax = require("google-gax");
const google_gax_1 = require("google-gax");
const stream_1 = require("stream");

@@ -33,3 +30,2 @@ const jsonProtos = require("../../protos/protos.json");

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

@@ -74,4 +70,11 @@ /**

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new SpeechClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -97,4 +100,8 @@ this._terminated = false;

}
// Load google-gax module synchronously if needed
if (!gaxInstance) {
gaxInstance = require('google-gax');
}
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gax.fallback : gax;
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.

@@ -143,3 +150,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

this.descriptors.stream = {
streamingRecognize: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING, opts.fallback === 'rest'),
streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, opts.fallback === 'rest'),
};

@@ -182,3 +189,3 @@ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);

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

@@ -220,3 +227,3 @@ /**

setImmediate(() => {
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.'));
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.'));
});

@@ -346,5 +353,5 @@ return stream;

async checkLongRunningRecognizeProgress(name) {
const request = new google_gax_2.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.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -351,0 +358,0 @@ }

/// <reference types="node" />
import * as gax from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import type * as gax from 'google-gax';
import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import { Transform } from 'stream';

@@ -63,4 +63,11 @@ import * as protos from '../../protos/protos';

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new AdaptationClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -67,0 +74,0 @@ * Initialize the client.

@@ -21,4 +21,2 @@ "use strict";

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

@@ -70,4 +68,11 @@ /**

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new AdaptationClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -93,4 +98,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.

@@ -152,3 +161,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;
}

@@ -262,3 +271,3 @@ /**

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

@@ -283,3 +292,3 @@ });

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

@@ -304,3 +313,3 @@ });

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

@@ -325,3 +334,3 @@ });

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

@@ -346,3 +355,3 @@ });

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

@@ -367,3 +376,3 @@ });

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

@@ -388,3 +397,3 @@ });

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

@@ -409,3 +418,3 @@ });

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

@@ -430,3 +439,3 @@ });

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

@@ -480,3 +489,3 @@ });

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

@@ -535,3 +544,3 @@ });

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

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

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

@@ -608,3 +617,3 @@ });

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

@@ -663,3 +672,3 @@ });

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

@@ -666,0 +675,0 @@ });

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

@@ -62,4 +62,11 @@ /**

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new SpeechClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts?: ClientOptions);
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
/**

@@ -66,0 +73,0 @@ * Initialize the client.

@@ -21,5 +21,2 @@ "use strict";

exports.SpeechClient = void 0;
/* global window */
const gax = require("google-gax");
const google_gax_1 = require("google-gax");
const stream_1 = require("stream");

@@ -33,3 +30,2 @@ const jsonProtos = require("../../protos/protos.json");

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

@@ -74,4 +70,11 @@ /**

* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new SpeechClient({fallback: 'rest'}, gax);
* ```
*/
constructor(opts) {
constructor(opts, gaxInstance) {
var _a, _b;

@@ -97,4 +100,8 @@ this._terminated = false;

}
// Load google-gax module synchronously if needed
if (!gaxInstance) {
gaxInstance = require('google-gax');
}
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gax.fallback : gax;
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.

@@ -143,3 +150,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

this.descriptors.stream = {
streamingRecognize: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING, opts.fallback === 'rest'),
streamingRecognize: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, opts.fallback === 'rest'),
};

@@ -182,3 +189,3 @@ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);

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

@@ -220,3 +227,3 @@ /**

setImmediate(() => {
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.'));
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.'));
});

@@ -346,5 +353,5 @@ return stream;

async checkLongRunningRecognizeProgress(name) {
const request = new google_gax_2.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.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings());
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.longRunningRecognize, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation;

@@ -351,0 +358,0 @@ }

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

## [5.0.2](https://github.com/googleapis/nodejs-speech/compare/v5.0.1...v5.0.2) (2022-09-01)
### Bug Fixes
* Allow passing gax instance to client constructor ([#924](https://github.com/googleapis/nodejs-speech/issues/924)) ([758a28a](https://github.com/googleapis/nodejs-speech/commit/758a28aa977713c35d089e1f89783221dc03e33f))
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-speech/issues/1553)) ([#923](https://github.com/googleapis/nodejs-speech/issues/923)) ([c300569](https://github.com/googleapis/nodejs-speech/commit/c3005691b0721dfbd29d2793ceffba98aef20a83))
## [5.0.1](https://github.com/googleapis/nodejs-speech/compare/v5.0.0...v5.0.1) (2022-08-23)

@@ -9,0 +17,0 @@

{
"name": "@google-cloud/speech",
"description": "Cloud Speech Client Library for Node.js",
"version": "5.0.1",
"version": "5.0.2",
"license": "Apache-2.0",

@@ -51,3 +51,3 @@ "author": "Google Inc.",

"@types/pumpify": "^1.4.1",
"google-gax": "^3.1.2",
"google-gax": "^3.3.0",
"pumpify": "^2.0.0",

@@ -54,0 +54,0 @@ "stream-events": "^1.0.4",

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc