@maxim_mazurok/gapi.client.translate-v3beta1 0.0.20250729 → 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 +82 -2
- 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
|
|
|
@@ -181,6 +181,8 @@ declare namespace gapi.client {
|
|
|
181
181
|
nextPageToken?: string;
|
|
182
182
|
/** A list of operations that matches the specified filter in the request. */
|
|
183
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[];
|
|
184
186
|
}
|
|
185
187
|
interface Location {
|
|
186
188
|
/** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
|
|
@@ -210,6 +212,24 @@ declare namespace gapi.client {
|
|
|
210
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]` */
|
|
211
213
|
gcsDestination?: GcsDestination;
|
|
212
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
|
+
}
|
|
213
233
|
interface Status {
|
|
214
234
|
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
215
235
|
code?: number;
|
|
@@ -598,6 +618,8 @@ declare namespace gapi.client {
|
|
|
598
618
|
prettyPrint?: boolean;
|
|
599
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. */
|
|
600
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;
|
|
601
623
|
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
602
624
|
upload_protocol?: string;
|
|
603
625
|
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
@@ -905,7 +927,7 @@ declare namespace gapi.client {
|
|
|
905
927
|
alt?: string;
|
|
906
928
|
/** JSONP */
|
|
907
929
|
callback?: string;
|
|
908
|
-
/** Optional.
|
|
930
|
+
/** Optional. Do not use this field. It is unsupported and is ignored unless explicitly documented otherwise. This is primarily for internal usage. */
|
|
909
931
|
extraLocationTypes?: string | string[];
|
|
910
932
|
/** Selector specifying which fields to include in a partial response. */
|
|
911
933
|
fields?: string;
|
|
@@ -930,6 +952,64 @@ declare namespace gapi.client {
|
|
|
930
952
|
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
931
953
|
uploadType?: string;
|
|
932
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>;
|
|
933
1013
|
/** Translates documents in synchronous mode. */
|
|
934
1014
|
translateDocument(request: {
|
|
935
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)
|