🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@google-cloud/text-to-speech

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/text-to-speech - npm Package Compare versions

Comparing version

to
3.1.2

1

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

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

@@ -27,4 +27,6 @@ import * as gax from 'google-gax';

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -49,2 +51,9 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
* TODO(@alexander-fenster): link to gax documentation.
* @param {boolean} fallback - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/

@@ -68,2 +77,3 @@ constructor(opts?: ClientOptions);

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

@@ -74,2 +84,3 @@ static get servicePath(): string;

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

@@ -79,2 +90,3 @@ static get apiEndpoint(): string;

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

@@ -85,2 +97,3 @@ static get port(): number;

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

@@ -97,7 +110,8 @@ static get scopes(): string[];

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/
close(): Promise<void>;
}

76

build/src/v1/text_to_speech_client.js

@@ -34,4 +34,6 @@ "use strict";

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -56,4 +58,12 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
* TODO(@alexander-fenster): link to gax documentation.
* @param {boolean} fallback - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/
constructor(opts) {
var _a, _b;
this._terminated = false;

@@ -66,30 +76,16 @@ this.descriptors = {

};
// Ensure that options include the service address and port.
// Ensure that options include all the required fields.
const staticMembers = this.constructor;
const servicePath = opts && opts.servicePath
? opts.servicePath
: opts && opts.apiEndpoint
? opts.apiEndpoint
: staticMembers.servicePath;
const port = opts && opts.port ? opts.port : staticMembers.port;
if (!opts) {
opts = { servicePath, port };
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : typeof window !== 'undefined';
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}
opts.servicePath = opts.servicePath || servicePath;
opts.port = opts.port || port;
// users can override the config from client side, like retry codes name.
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
// The way to override client config for Showcase API:
//
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the TextToSpeechClient constructor.
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gax.fallback : gax;
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

@@ -100,2 +96,6 @@ // Save options to use in initialize() method.

this.auth = this._gaxGrpc.auth;
// Set the default scopes in auth client if needed.
if (servicePath === staticMembers.servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
// Determine the client header string.

@@ -173,2 +173,3 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];

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

@@ -181,2 +182,3 @@ static get servicePath() {

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

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

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

@@ -196,2 +199,3 @@ static get port() {

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

@@ -203,4 +207,3 @@ static get scopes() {

* Return the project ID used by this class.
* @param {function(Error, string)} callback - the callback to
* be called with the current project Id.
* @returns {Promise} A promise that resolves to string containing the project ID.
*/

@@ -232,3 +235,7 @@ getProjectId(callback) {

* The first element of the array is an object representing [ListVoicesResponse]{@link google.cloud.texttospeech.v1.ListVoicesResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.listVoices(request);
*/

@@ -265,3 +272,7 @@ listVoices(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [SynthesizeSpeechResponse]{@link google.cloud.texttospeech.v1.SynthesizeSpeechResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.synthesizeSpeech(request);
*/

@@ -283,5 +294,6 @@ synthesizeSpeech(request, optionsOrCallback, callback) {

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/

@@ -288,0 +300,0 @@ close() {

@@ -27,4 +27,6 @@ import * as gax from 'google-gax';

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -49,2 +51,9 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
* TODO(@alexander-fenster): link to gax documentation.
* @param {boolean} fallback - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/

@@ -68,2 +77,3 @@ constructor(opts?: ClientOptions);

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

@@ -74,2 +84,3 @@ static get servicePath(): string;

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

@@ -79,2 +90,3 @@ static get apiEndpoint(): string;

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

@@ -85,2 +97,3 @@ static get port(): number;

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

@@ -97,7 +110,8 @@ static get scopes(): string[];

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/
close(): Promise<void>;
}

@@ -34,4 +34,6 @@ "use strict";

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -56,4 +58,12 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - client configuration override.
* TODO(@alexander-fenster): link to gax documentation.
* @param {boolean} fallback - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/
constructor(opts) {
var _a, _b;
this._terminated = false;

@@ -66,30 +76,16 @@ this.descriptors = {

};
// Ensure that options include the service address and port.
// Ensure that options include all the required fields.
const staticMembers = this.constructor;
const servicePath = opts && opts.servicePath
? opts.servicePath
: opts && opts.apiEndpoint
? opts.apiEndpoint
: staticMembers.servicePath;
const port = opts && opts.port ? opts.port : staticMembers.port;
if (!opts) {
opts = { servicePath, port };
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : typeof window !== 'undefined';
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}
opts.servicePath = opts.servicePath || servicePath;
opts.port = opts.port || port;
// users can override the config from client side, like retry codes name.
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
// The way to override client config for Showcase API:
//
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the TextToSpeechClient constructor.
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gax.fallback : gax;
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

@@ -100,2 +96,6 @@ // Save options to use in initialize() method.

this.auth = this._gaxGrpc.auth;
// Set the default scopes in auth client if needed.
if (servicePath === staticMembers.servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
// Determine the client header string.

@@ -173,2 +173,3 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];

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

@@ -181,2 +182,3 @@ static get servicePath() {

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

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

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

@@ -196,2 +199,3 @@ static get port() {

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

@@ -203,4 +207,3 @@ static get scopes() {

* Return the project ID used by this class.
* @param {function(Error, string)} callback - the callback to
* be called with the current project Id.
* @returns {Promise} A promise that resolves to string containing the project ID.
*/

@@ -232,3 +235,7 @@ getProjectId(callback) {

* The first element of the array is an object representing [ListVoicesResponse]{@link google.cloud.texttospeech.v1beta1.ListVoicesResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.listVoices(request);
*/

@@ -267,3 +274,7 @@ listVoices(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [SynthesizeSpeechResponse]{@link google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.synthesizeSpeech(request);
*/

@@ -285,5 +296,6 @@ synthesizeSpeech(request, optionsOrCallback, callback) {

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/

@@ -290,0 +302,0 @@ close() {

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

### [3.1.2](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v3.1.1...v3.1.2) (2020-11-06)
### Bug Fixes
* do not modify options object, use defaultScopes ([#463](https://www.github.com/googleapis/nodejs-text-to-speech/issues/463)) ([c3558d8](https://www.github.com/googleapis/nodejs-text-to-speech/commit/c3558d84568ed53f794f8e8136ddaf96e84630d6))
### [3.1.1](https://www.github.com/googleapis/nodejs-text-to-speech/compare/v3.1.0...v3.1.1) (2020-09-12)

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

{
"name": "@google-cloud/text-to-speech",
"description": "Cloud Text-to-Speech API client for Node.js",
"version": "3.1.1",
"version": "3.1.2",
"license": "Apache-2.0",

@@ -48,3 +48,3 @@ "author": "Google LLC",

"dependencies": {
"google-gax": "^2.1.0"
"google-gax": "^2.9.2"
},

@@ -68,4 +68,4 @@ "devDependencies": {

"typescript": "^3.8.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack": "^5.0.0",
"webpack-cli": "^4.0.0",
"@microsoft/api-documenter": "^7.8.10",

@@ -72,0 +72,0 @@ "@microsoft/api-extractor": "^7.8.10"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet