@maxim_mazurok/gapi.client.translate-v3beta1 0.0.20250507 → 0.0.20260108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +91 -9
- package/package.json +1 -1
- package/readme.md +2 -0
package/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
10
|
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
11
|
// Generated from: https://translation.googleapis.com/$discovery/rest?version=v3beta1
|
|
12
|
-
// Revision:
|
|
12
|
+
// Revision: 20260108
|
|
13
13
|
|
|
14
14
|
/// <reference types="gapi.client" />
|
|
15
15
|
|
|
@@ -53,9 +53,11 @@ declare namespace gapi.client {
|
|
|
53
53
|
models?: {[P in string]: string};
|
|
54
54
|
/** Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. */
|
|
55
55
|
outputConfig?: BatchDocumentOutputConfig;
|
|
56
|
+
/** Optional. If true, only native pdf pages will be translated. */
|
|
57
|
+
pdfNativeOnly?: boolean;
|
|
56
58
|
/** Required. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
|
|
57
59
|
sourceLanguageCode?: string;
|
|
58
|
-
/** Required. The BCP-47 language code to use for translation of the input document. Specify up to 10 language codes here. */
|
|
60
|
+
/** Required. The BCP-47 language code to use for translation of the input document. Specify up to 10 language codes here. Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
|
|
59
61
|
targetLanguageCodes?: string[];
|
|
60
62
|
}
|
|
61
63
|
interface BatchTranslateTextRequest {
|
|
@@ -69,9 +71,9 @@ declare namespace gapi.client {
|
|
|
69
71
|
models?: {[P in string]: string};
|
|
70
72
|
/** Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. */
|
|
71
73
|
outputConfig?: OutputConfig;
|
|
72
|
-
/** Required. Source language code. */
|
|
74
|
+
/** Required. Source language code. Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
|
|
73
75
|
sourceLanguageCode?: string;
|
|
74
|
-
/** Required. Specify up to 10 language codes here. */
|
|
76
|
+
/** Required. Specify up to 10 language codes here. Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
|
|
75
77
|
targetLanguageCodes?: string[];
|
|
76
78
|
}
|
|
77
79
|
interface CancelOperationRequest {}
|
|
@@ -179,6 +181,8 @@ declare namespace gapi.client {
|
|
|
179
181
|
nextPageToken?: string;
|
|
180
182
|
/** A list of operations that matches the specified filter in the request. */
|
|
181
183
|
operations?: Operation[];
|
|
184
|
+
/** Unordered list. Unreachable resources. Populated when the request sets `ListOperationsRequest.return_partial_success` and reads across collections. For example, when attempting to list all resources across all supported locations. */
|
|
185
|
+
unreachable?: string[];
|
|
182
186
|
}
|
|
183
187
|
interface Location {
|
|
184
188
|
/** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
|
|
@@ -208,6 +212,24 @@ declare namespace gapi.client {
|
|
|
208
212
|
/** Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\n' instead of '\r\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` The format of errors file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_errors.[extension]` If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` */
|
|
209
213
|
gcsDestination?: GcsDestination;
|
|
210
214
|
}
|
|
215
|
+
interface RefinementEntry {
|
|
216
|
+
/** Required. The original translation of the source text. */
|
|
217
|
+
originalTranslation?: string;
|
|
218
|
+
/** Required. The source text to be refined. */
|
|
219
|
+
sourceText?: string;
|
|
220
|
+
}
|
|
221
|
+
interface RefineTextRequest {
|
|
222
|
+
/** Required. The source texts and original translations in the source and target languages. */
|
|
223
|
+
refinementEntries?: RefinementEntry[];
|
|
224
|
+
/** Required. The BCP-47 language code of the source text in the request, for example, "en-US". */
|
|
225
|
+
sourceLanguageCode?: string;
|
|
226
|
+
/** Required. The BCP-47 language code for translation output, for example, "zh-CN". */
|
|
227
|
+
targetLanguageCode?: string;
|
|
228
|
+
}
|
|
229
|
+
interface RefineTextResponse {
|
|
230
|
+
/** The refined translations obtained from the original translations. */
|
|
231
|
+
refinedTranslations?: string[];
|
|
232
|
+
}
|
|
211
233
|
interface Status {
|
|
212
234
|
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
213
235
|
code?: number;
|
|
@@ -249,9 +271,9 @@ declare namespace gapi.client {
|
|
|
249
271
|
labels?: {[P in string]: string};
|
|
250
272
|
/** Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If not provided, the default Google model (NMT) will be used for translation. */
|
|
251
273
|
model?: string;
|
|
252
|
-
/** Optional. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. Source language must be specified if the request contains a glossary or a custom model. */
|
|
274
|
+
/** Optional. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. Source language must be specified if the request contains a glossary or a custom model. */
|
|
253
275
|
sourceLanguageCode?: string;
|
|
254
|
-
/** Required. The BCP-47 language code to use for translation of the input document, set to one of the language codes listed in Language Support. */
|
|
276
|
+
/** Required. The BCP-47 language code to use for translation of the input document, set to one of the language codes listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
|
|
255
277
|
targetLanguageCode?: string;
|
|
256
278
|
}
|
|
257
279
|
interface TranslateDocumentResponse {
|
|
@@ -283,9 +305,9 @@ declare namespace gapi.client {
|
|
|
283
305
|
mimeType?: string;
|
|
284
306
|
/** Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, For global (non-regionalized) requests, use `location-id` `global`. For example, `projects/{project-number-or-id}/locations/global/models/general/nmt`. If not provided, the default Google model (NMT) will be used */
|
|
285
307
|
model?: string;
|
|
286
|
-
/** Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. */
|
|
308
|
+
/** Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. */
|
|
287
309
|
sourceLanguageCode?: string;
|
|
288
|
-
/** Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support. */
|
|
310
|
+
/** Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
|
|
289
311
|
targetLanguageCode?: string;
|
|
290
312
|
}
|
|
291
313
|
interface TranslateTextResponse {
|
|
@@ -596,6 +618,8 @@ declare namespace gapi.client {
|
|
|
596
618
|
prettyPrint?: boolean;
|
|
597
619
|
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
598
620
|
quotaUser?: string;
|
|
621
|
+
/** When set to `true`, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be `true` when reading across collections. For example, when `parent` is set to `"projects/example/locations/-"`. This field is not supported by default and will result in an `UNIMPLEMENTED` error if set unless explicitly documented otherwise in service or product specific documentation. */
|
|
622
|
+
returnPartialSuccess?: boolean;
|
|
599
623
|
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
600
624
|
upload_protocol?: string;
|
|
601
625
|
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
@@ -903,7 +927,7 @@ declare namespace gapi.client {
|
|
|
903
927
|
alt?: string;
|
|
904
928
|
/** JSONP */
|
|
905
929
|
callback?: string;
|
|
906
|
-
/** Optional.
|
|
930
|
+
/** Optional. Do not use this field. It is unsupported and is ignored unless explicitly documented otherwise. This is primarily for internal usage. */
|
|
907
931
|
extraLocationTypes?: string | string[];
|
|
908
932
|
/** Selector specifying which fields to include in a partial response. */
|
|
909
933
|
fields?: string;
|
|
@@ -928,6 +952,64 @@ declare namespace gapi.client {
|
|
|
928
952
|
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
929
953
|
uploadType?: string;
|
|
930
954
|
}): Request<ListLocationsResponse>;
|
|
955
|
+
/** Refines the input translated text to improve the quality. */
|
|
956
|
+
refineText(request: {
|
|
957
|
+
/** V1 error format. */
|
|
958
|
+
'$.xgafv'?: string;
|
|
959
|
+
/** OAuth access token. */
|
|
960
|
+
access_token?: string;
|
|
961
|
+
/** Data format for response. */
|
|
962
|
+
alt?: string;
|
|
963
|
+
/** JSONP */
|
|
964
|
+
callback?: string;
|
|
965
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
966
|
+
fields?: string;
|
|
967
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
968
|
+
key?: string;
|
|
969
|
+
/** OAuth 2.0 token for the current user. */
|
|
970
|
+
oauth_token?: string;
|
|
971
|
+
/** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. */
|
|
972
|
+
parent: string;
|
|
973
|
+
/** Returns response with indentations and line breaks. */
|
|
974
|
+
prettyPrint?: boolean;
|
|
975
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
976
|
+
quotaUser?: string;
|
|
977
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
978
|
+
upload_protocol?: string;
|
|
979
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
980
|
+
uploadType?: string;
|
|
981
|
+
/** Request body */
|
|
982
|
+
resource: RefineTextRequest;
|
|
983
|
+
}): Request<RefineTextResponse>;
|
|
984
|
+
refineText(
|
|
985
|
+
request: {
|
|
986
|
+
/** V1 error format. */
|
|
987
|
+
'$.xgafv'?: string;
|
|
988
|
+
/** OAuth access token. */
|
|
989
|
+
access_token?: string;
|
|
990
|
+
/** Data format for response. */
|
|
991
|
+
alt?: string;
|
|
992
|
+
/** JSONP */
|
|
993
|
+
callback?: string;
|
|
994
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
995
|
+
fields?: string;
|
|
996
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
997
|
+
key?: string;
|
|
998
|
+
/** OAuth 2.0 token for the current user. */
|
|
999
|
+
oauth_token?: string;
|
|
1000
|
+
/** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. */
|
|
1001
|
+
parent: string;
|
|
1002
|
+
/** Returns response with indentations and line breaks. */
|
|
1003
|
+
prettyPrint?: boolean;
|
|
1004
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
1005
|
+
quotaUser?: string;
|
|
1006
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
1007
|
+
upload_protocol?: string;
|
|
1008
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
1009
|
+
uploadType?: string;
|
|
1010
|
+
},
|
|
1011
|
+
body: RefineTextRequest,
|
|
1012
|
+
): Request<RefineTextResponse>;
|
|
931
1013
|
/** Translates documents in synchronous mode. */
|
|
932
1014
|
translateDocument(request: {
|
|
933
1015
|
/** V1 error format. */
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -87,3 +87,5 @@ Translates input text and returns translated text.
|
|
|
87
87
|
*/
|
|
88
88
|
await gapi.client.translate.projects.translateText({parent: 'parent'});
|
|
89
89
|
```
|
|
90
|
+
|
|
91
|
+
For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.translate-v3beta1#Provenance:~:text=none-,Provenance,-Built%20and%20signed)
|