@google-cloud/translate
Advanced tools
Comparing version 6.2.0 to 6.2.1
@@ -23,3 +23,3 @@ "use strict"; | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
/** | ||
@@ -120,9 +120,3 @@ * Client JSON configuration object, loaded from | ||
// Load the applicable protos. | ||
// For Node.js, pass the path to JSON proto file. | ||
// For browsers, pass the JSON content. | ||
const nodejsProtoPath = path.join(__dirname, '..', '..', 'protos', 'protos.json'); | ||
this._protos = this._gaxGrpc.loadProto(opts.fallback | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json') | ||
: nodejsProtoPath); | ||
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); | ||
// This API contains "path templates"; forward-slash-separated | ||
@@ -141,10 +135,6 @@ // identifiers to uniquely identify resources within the API. | ||
}; | ||
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); | ||
// This API contains "long-running operations", which return a | ||
// an Operation object that allows for tracking of the operation, | ||
// rather than holding a request open. | ||
const protoFilesRoot = opts.fallback | ||
? this._gaxModule.protobuf.Root.fromJSON( | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('../../protos/protos.json')) | ||
: this._gaxModule.protobuf.loadSync(nodejsProtoPath); | ||
this.operationsClient = this._gaxModule | ||
@@ -360,5 +350,6 @@ .lro({ | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
this.initialize(); | ||
@@ -431,5 +422,6 @@ return this.innerApiCalls.translateText(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
this.initialize(); | ||
@@ -499,5 +491,6 @@ return this.innerApiCalls.detectLanguage(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
this.initialize(); | ||
@@ -537,5 +530,6 @@ return this.innerApiCalls.getSupportedLanguages(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
}); | ||
this.initialize(); | ||
@@ -633,5 +627,6 @@ return this.innerApiCalls.getGlossary(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
this.initialize(); | ||
@@ -697,5 +692,6 @@ return this.innerApiCalls.batchTranslateText(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
this.initialize(); | ||
@@ -760,5 +756,6 @@ return this.innerApiCalls.createGlossary(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
name: request.name || '', | ||
}); | ||
this.initialize(); | ||
@@ -834,5 +831,6 @@ return this.innerApiCalls.deleteGlossary(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
this.initialize(); | ||
@@ -876,5 +874,6 @@ return this.innerApiCalls.listGlossaries(request, options, callback); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
const callSettings = new gax.CallSettings(options); | ||
@@ -925,5 +924,6 @@ this.initialize(); | ||
options.otherArgs.headers = options.otherArgs.headers || {}; | ||
options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
}); | ||
options = options || {}; | ||
@@ -930,0 +930,0 @@ const callSettings = new gax.CallSettings(options); |
@@ -7,2 +7,10 @@ # Changelog | ||
### [6.2.1](https://www.github.com/googleapis/nodejs-translate/compare/v6.2.0...v6.2.1) (2021-05-11) | ||
### Bug Fixes | ||
* **deps:** require google-gax v2.12.0 ([#657](https://www.github.com/googleapis/nodejs-translate/issues/657)) ([71d695d](https://www.github.com/googleapis/nodejs-translate/commit/71d695d5e217b96e688b4bb71887b19ebedae1ff)) | ||
* use require() to load JSON protos ([#661](https://www.github.com/googleapis/nodejs-translate/issues/661)) ([5294080](https://www.github.com/googleapis/nodejs-translate/commit/529408087d68461651f1ce80b5fba460bde0f5bc)) | ||
## [6.2.0](https://www.github.com/googleapis/nodejs-translate/compare/v6.1.0...v6.2.0) (2021-04-07) | ||
@@ -9,0 +17,0 @@ |
{ | ||
"name": "@google-cloud/translate", | ||
"description": "Cloud Translation API Client Library for Node.js", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"license": "Apache-2.0", | ||
@@ -56,3 +56,3 @@ "author": "Google Inc.", | ||
"extend": "^3.0.2", | ||
"google-gax": "^2.9.2", | ||
"google-gax": "^2.12.0", | ||
"is-html": "^2.0.0", | ||
@@ -67,3 +67,3 @@ "protobufjs": "^6.8.8" | ||
"@types/request": "^2.47.1", | ||
"@types/sinon": "^9.0.0", | ||
"@types/sinon": "^10.0.0", | ||
"c8": "^7.0.0", | ||
@@ -70,0 +70,0 @@ "codecov": "^3.0.2", |
@@ -5,9 +5,4 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
The [Cloud Translation API](https://cloud.google.com/translate/docs/), | ||
can dynamically translate text between thousands | ||
of language pairs. The Cloud Translation API lets websites and programs | ||
integrate with the translation service programmatically. The Cloud Translation | ||
API is part of the larger Cloud Machine Learning API family. | ||
# [Cloud Translation: Node.js Client](https://github.com/googleapis/nodejs-translate) | ||
[![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) | ||
@@ -20,3 +15,7 @@ [![npm version](https://img.shields.io/npm/v/@google-cloud/translate.svg)](https://www.npmjs.org/package/@google-cloud/translate) | ||
Cloud Translation API Client Library for Node.js | ||
The [Cloud Translation API](https://cloud.google.com/translate/docs/), | ||
can dynamically translate text between thousands | ||
of language pairs. The Cloud Translation API lets websites and programs | ||
integrate with the translation service programmatically. The Cloud Translation | ||
API is part of the larger Cloud Machine Learning API family. | ||
@@ -23,0 +22,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3105520
48326
173
Updatedgoogle-gax@^2.12.0