@azure-rest/ai-document-translator 1.0.0-beta.1 → 1.0.0-beta.2
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/LICENSE +3 -3
- package/README.md +52 -71
- package/dist/browser/clientDefinitions.d.ts +125 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/documentTranslator.d.ts +14 -0
- package/dist/browser/documentTranslator.d.ts.map +1 -0
- package/dist/browser/documentTranslator.js +33 -0
- package/dist/browser/documentTranslator.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +11 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/dist/browser/isUnexpected.js +78 -0
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models.d.ts +69 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +144 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/dist/browser/paginateHelper.js +167 -0
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +98 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/pollingHelper.d.ts +76 -0
- package/dist/browser/pollingHelper.d.ts.map +1 -0
- package/dist/browser/pollingHelper.js +104 -0
- package/dist/browser/pollingHelper.js.map +1 -0
- package/{types/ai-document-translator.d.ts → dist/browser/responses.d.ts} +725 -1242
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +125 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/documentTranslator.d.ts +14 -0
- package/dist/commonjs/documentTranslator.d.ts.map +1 -0
- package/dist/commonjs/documentTranslator.js +36 -0
- package/dist/commonjs/documentTranslator.js.map +1 -0
- package/dist/commonjs/index.d.ts +12 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +17 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +11 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +81 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +69 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +144 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +170 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +98 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/pollingHelper.d.ts +76 -0
- package/dist/commonjs/pollingHelper.d.ts.map +1 -0
- package/dist/commonjs/pollingHelper.js +107 -0
- package/dist/commonjs/pollingHelper.js.map +1 -0
- package/dist/commonjs/responses.d.ts +725 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/clientDefinitions.d.ts +125 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/documentTranslator.d.ts +14 -0
- package/dist/esm/documentTranslator.d.ts.map +1 -0
- package/dist/esm/documentTranslator.js +33 -0
- package/dist/esm/documentTranslator.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +11 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +78 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +69 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +144 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +167 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +98 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/pollingHelper.d.ts +76 -0
- package/dist/esm/pollingHelper.d.ts.map +1 -0
- package/dist/esm/pollingHelper.js +104 -0
- package/dist/esm/pollingHelper.js.map +1 -0
- package/dist/esm/responses.d.ts +725 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +125 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/documentTranslator.d.ts +14 -0
- package/dist/react-native/documentTranslator.d.ts.map +1 -0
- package/dist/react-native/documentTranslator.js +33 -0
- package/dist/react-native/documentTranslator.js.map +1 -0
- package/dist/react-native/index.d.ts +12 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +14 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +11 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +78 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +69 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +144 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +167 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +98 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/pollingHelper.d.ts +76 -0
- package/dist/react-native/pollingHelper.d.ts.map +1 -0
- package/dist/react-native/pollingHelper.js +104 -0
- package/dist/react-native/pollingHelper.js.map +1 -0
- package/dist/react-native/responses.d.ts +725 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +86 -71
- package/CHANGELOG.md +0 -5
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist-esm/src/constants.js +0 -7
- package/dist-esm/src/constants.js.map +0 -1
- package/dist-esm/src/documentTranslator.js +0 -13
- package/dist-esm/src/documentTranslator.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MIT License
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
# Azure Document Translator Rest-Level client library for JavaScript
|
|
2
2
|
|
|
3
|
-
[Azure Document Translator](https://
|
|
3
|
+
[Azure Document Translator](https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview) is a cloud-based feature of the Azure Translator service and is part of the Azure Cognitive Service family of REST APIs. The Document Translation API translates documents to and from 90 languages and dialects while preserving document structure and data format.
|
|
4
4
|
|
|
5
5
|
**Note:** This Rest Level Library targets Azure Document Translator service API version v1.0-preview.1.
|
|
6
6
|
|
|
7
7
|
Use the client library to:
|
|
8
8
|
|
|
9
|
-
| Feature | Description
|
|
10
|
-
| --------------------------------- |
|
|
11
|
-
| Translate large files | Translate whole documents asynchronously.
|
|
12
|
-
| Translate numerous files | Translate multiple files to and from 90 languages and dialects.
|
|
13
|
-
| Preserve source file presentation | Translate files while preserving the original layout and format.
|
|
14
|
-
| Apply custom translation | Translate documents using general and [custom translation](https://
|
|
15
|
-
| Apply custom glossaries | Translate documents using custom glossaries.
|
|
9
|
+
| Feature | Description |
|
|
10
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| Translate large files | Translate whole documents asynchronously. |
|
|
12
|
+
| Translate numerous files | Translate multiple files to and from 90 languages and dialects. |
|
|
13
|
+
| Preserve source file presentation | Translate files while preserving the original layout and format. |
|
|
14
|
+
| Apply custom translation | Translate documents using general and [custom translation](https://learn.microsoft.com/azure/cognitive-services/translator/customization#custom-translator) models. |
|
|
15
|
+
| Apply custom glossaries | Translate documents using custom glossaries. |
|
|
16
16
|
|
|
17
|
-
[Source code](https://github.com/Azure/azure-sdk-for-js/blob/
|
|
17
|
+
[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documenttranslator/ai-document-translator-rest/) |
|
|
18
18
|
[Package (NPM)](https://www.npmjs.com/package/@azure-rest/ai-document-translator) |
|
|
19
|
-
[API reference documentation](https://
|
|
20
|
-
[Product documentation](https://
|
|
21
|
-
[Samples](https://github.com/Azure/azure-sdk-for-js/tree/
|
|
19
|
+
[API reference documentation](https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview) |
|
|
20
|
+
[Product documentation](https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview) |
|
|
21
|
+
[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documenttranslator/ai-document-translator-rest/samples)
|
|
22
22
|
|
|
23
23
|
## Getting started
|
|
24
24
|
|
|
25
25
|
### Currently supported environments
|
|
26
26
|
|
|
27
|
-
- Node.js
|
|
27
|
+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
28
28
|
|
|
29
29
|
### Prerequisites
|
|
30
30
|
|
|
@@ -89,32 +89,12 @@ az cognitiveservices account keys list --name "resource-name" --resource-group "
|
|
|
89
89
|
|
|
90
90
|
Once you have an API key and endpoint, you can use the `AzureKeyCredential` class to authenticate the client as follows:
|
|
91
91
|
|
|
92
|
-
```
|
|
93
|
-
|
|
92
|
+
```ts snippet:ReadmeSampleCreateClient_APIKey
|
|
93
|
+
import DocumentTranslator from "@azure-rest/ai-document-translator";
|
|
94
94
|
|
|
95
95
|
const client = DocumentTranslator("<endpoint>", { key: "<API key>" });
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
#### Using an Azure Active Directory Credential
|
|
99
|
-
|
|
100
|
-
Client API key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below,
|
|
101
|
-
or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
npm install @azure/identity
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
You will also need to [register a new AAD application][register_aad_app] and grant access to Document Translator by assigning the `"Managed Application Contributor Role"` role to your service principal (note: other roles such as `"Owner"` will not grant the necessary permissions, only `"Managed Application Contributor Role"` will suffice to run the examples and the sample code).
|
|
108
|
-
|
|
109
|
-
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
|
|
110
|
-
|
|
111
|
-
```javascript
|
|
112
|
-
const DocumentTranslator = require("@azure-rest/ai-document-translator");
|
|
113
|
-
const { DefaultAzureCredential } = require("@azure/identity");
|
|
114
|
-
|
|
115
|
-
const client = DocumentTranslator("<endpoint>", new DefaultAzureCredential());
|
|
116
|
-
```
|
|
117
|
-
|
|
118
98
|
## Key concepts
|
|
119
99
|
|
|
120
100
|
The Document Translation service requires that you upload your files to an Azure Blob Storage source container and provide
|
|
@@ -124,7 +104,7 @@ the service documentation:
|
|
|
124
104
|
|
|
125
105
|
- [Set up Azure Blob Storage containers][source_containers] with your documents
|
|
126
106
|
- Optionally apply [glossaries][glossary] or a [custom model for translation][custom_model]
|
|
127
|
-
- Generate [SAS tokens][sas_token] to your containers (or files)
|
|
107
|
+
- Generate [SAS tokens][sas_token] to your containers (or files)
|
|
128
108
|
|
|
129
109
|
### DocumentTranslator
|
|
130
110
|
|
|
@@ -144,39 +124,41 @@ and the target language(s) for translation.
|
|
|
144
124
|
|
|
145
125
|
A single source container with documents can be translated to many different languages:
|
|
146
126
|
|
|
147
|
-
```
|
|
148
|
-
import {
|
|
149
|
-
|
|
127
|
+
```ts snippet:ReadmeSampleBatchSubmissionRequest
|
|
128
|
+
import { StartTranslationDetails } from "@azure-rest/ai-document-translator";
|
|
129
|
+
|
|
130
|
+
const batchSubmissionRequest: StartTranslationDetails = {
|
|
150
131
|
inputs: [
|
|
151
132
|
{
|
|
152
133
|
source: { sourceUrl: "<sas_url_to_source>" },
|
|
153
|
-
targets: [{ language: "fr", targetUrl: "<sas_url_to_target_fr>" }]
|
|
154
|
-
}
|
|
155
|
-
]
|
|
134
|
+
targets: [{ language: "fr", targetUrl: "<sas_url_to_target_fr>" }],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
156
137
|
};
|
|
157
138
|
```
|
|
158
139
|
|
|
159
140
|
Or multiple different sources can be provided each with their own targets.
|
|
160
141
|
|
|
161
|
-
```
|
|
162
|
-
import {
|
|
163
|
-
|
|
142
|
+
```ts snippet:ReadmeSampleBatchSubmissionRequestMultiple
|
|
143
|
+
import { StartTranslationDetails } from "@azure-rest/ai-document-translator";
|
|
144
|
+
|
|
145
|
+
const batchSubmissionRequest: StartTranslationDetails = {
|
|
164
146
|
inputs: [
|
|
165
147
|
{
|
|
166
148
|
source: { sourceUrl: "<sas_url_to_source_A>" },
|
|
167
149
|
targets: [
|
|
168
150
|
{ language: "fr", targetUrl: "<sas_url_to_target_A_fr>" },
|
|
169
|
-
{ language: "de", targetUrl: "<sas_url_to_target_A_de>" }
|
|
170
|
-
]
|
|
151
|
+
{ language: "de", targetUrl: "<sas_url_to_target_A_de>" },
|
|
152
|
+
],
|
|
171
153
|
},
|
|
172
154
|
{
|
|
173
155
|
source: { sourceUrl: "<sas_url_to_source_B>" },
|
|
174
156
|
targets: [
|
|
175
157
|
{ language: "fr", targetUrl: "<sas_url_to_target_B_fr>" },
|
|
176
|
-
{ language: "de", targetUrl: "<sas_url_to_target_B_de>" }
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
]
|
|
158
|
+
{ language: "de", targetUrl: "<sas_url_to_target_B_de>" },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
],
|
|
180
162
|
};
|
|
181
163
|
```
|
|
182
164
|
|
|
@@ -188,8 +170,8 @@ See the service documentation for all [supported languages][supported_languages]
|
|
|
188
170
|
|
|
189
171
|
Please refer to the samples folder to see code samples, including:
|
|
190
172
|
|
|
191
|
-
- [List Supported Formats]
|
|
192
|
-
- [Translate documents]
|
|
173
|
+
- [List Supported Formats](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documenttranslator/ai-document-translator-rest/samples/v1/typescript/src/listFormats.ts)
|
|
174
|
+
- [Translate documents](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documenttranslator/ai-document-translator-rest/samples/v1/typescript/src/translateFromBlob.ts)
|
|
193
175
|
|
|
194
176
|
## Troubleshooting
|
|
195
177
|
|
|
@@ -197,41 +179,40 @@ Please refer to the samples folder to see code samples, including:
|
|
|
197
179
|
|
|
198
180
|
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
199
181
|
|
|
200
|
-
```
|
|
182
|
+
```ts snippet:SetLogLevel
|
|
201
183
|
import { setLogLevel } from "@azure/logger";
|
|
202
184
|
|
|
203
185
|
setLogLevel("info");
|
|
204
186
|
```
|
|
205
187
|
|
|
206
|
-
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/
|
|
188
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
207
189
|
|
|
208
190
|
## Next steps
|
|
209
191
|
|
|
210
|
-
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/
|
|
192
|
+
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documenttranslator/ai-document-translator-rest/samples) directory for detailed examples on how to use this library.
|
|
211
193
|
|
|
212
194
|
## Contributing
|
|
213
195
|
|
|
214
|
-
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/
|
|
196
|
+
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
|
|
215
197
|
|
|
216
198
|
## Related projects
|
|
217
199
|
|
|
218
200
|
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
|
|
219
201
|
|
|
220
|
-

|
|
221
202
|
|
|
222
|
-
|
|
203
|
+
|
|
204
|
+
[azure_cli]: https://learn.microsoft.com/cli/azure
|
|
223
205
|
[azure_sub]: https://azure.microsoft.com/free/
|
|
224
206
|
[translator_resource]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation
|
|
225
207
|
[azure_portal]: https://portal.azure.com
|
|
226
|
-
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/
|
|
227
|
-
[cognitive_auth]: https://
|
|
228
|
-
[register_aad_app]: https://
|
|
229
|
-
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/
|
|
230
|
-
[azure_cli_create_dt_resource]: https://
|
|
231
|
-
[azure_portal_get_endpoint]: https://
|
|
232
|
-
[source_containers]: https://
|
|
233
|
-
[glossary]: https://
|
|
234
|
-
[custom_model]: https://
|
|
235
|
-
[sas_token]: https://
|
|
236
|
-
[
|
|
237
|
-
[supported_languages]: https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate
|
|
208
|
+
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
|
|
209
|
+
[cognitive_auth]: https://learn.microsoft.com/azure/cognitive-services/authentication
|
|
210
|
+
[register_aad_app]: https://learn.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
|
|
211
|
+
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential
|
|
212
|
+
[azure_cli_create_dt_resource]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli?tabs=windows
|
|
213
|
+
[azure_portal_get_endpoint]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-rest-api?pivots=programming-language-javascript#retrieve-your-key-and-document-translation-endpoint
|
|
214
|
+
[source_containers]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/quickstarts/document-translation-rest-api?pivots=programming-language-javascript#create-azure-blob-storage-containers
|
|
215
|
+
[glossary]: https://learn.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats
|
|
216
|
+
[custom_model]: https://learn.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model
|
|
217
|
+
[sas_token]: https://learn.microsoft.com/azure/ai-services/translator/document-translation/how-to-guides/create-sas-tokens?tabs=Containers
|
|
218
|
+
[supported_languages]: https://learn.microsoft.com/azure/cognitive-services/translator/language-support#translate
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { DocumentTranslationStartTranslationParameters, DocumentTranslationGetTranslationsStatusParameters, DocumentTranslationGetDocumentStatusParameters, DocumentTranslationGetTranslationStatusParameters, DocumentTranslationCancelTranslationParameters, DocumentTranslationGetDocumentsStatusParameters, DocumentTranslationGetSupportedDocumentFormatsParameters, DocumentTranslationGetSupportedGlossaryFormatsParameters, DocumentTranslationGetSupportedStorageSourcesParameters } from "./parameters.js";
|
|
2
|
+
import type { DocumentTranslationStartTranslation202Response, DocumentTranslationStartTranslation400Response, DocumentTranslationStartTranslation401Response, DocumentTranslationStartTranslation429Response, DocumentTranslationStartTranslation500Response, DocumentTranslationStartTranslation503Response, DocumentTranslationGetTranslationsStatus200Response, DocumentTranslationGetTranslationsStatus400Response, DocumentTranslationGetTranslationsStatus401Response, DocumentTranslationGetTranslationsStatus429Response, DocumentTranslationGetTranslationsStatus500Response, DocumentTranslationGetTranslationsStatus503Response, DocumentTranslationGetDocumentStatus200Response, DocumentTranslationGetDocumentStatus401Response, DocumentTranslationGetDocumentStatus404Response, DocumentTranslationGetDocumentStatus429Response, DocumentTranslationGetDocumentStatus500Response, DocumentTranslationGetDocumentStatus503Response, DocumentTranslationGetTranslationStatus200Response, DocumentTranslationGetTranslationStatus401Response, DocumentTranslationGetTranslationStatus404Response, DocumentTranslationGetTranslationStatus429Response, DocumentTranslationGetTranslationStatus500Response, DocumentTranslationGetTranslationStatus503Response, DocumentTranslationCancelTranslation200Response, DocumentTranslationCancelTranslation401Response, DocumentTranslationCancelTranslation404Response, DocumentTranslationCancelTranslation429Response, DocumentTranslationCancelTranslation500Response, DocumentTranslationCancelTranslation503Response, DocumentTranslationGetDocumentsStatus200Response, DocumentTranslationGetDocumentsStatus400Response, DocumentTranslationGetDocumentsStatus401Response, DocumentTranslationGetDocumentsStatus404Response, DocumentTranslationGetDocumentsStatus429Response, DocumentTranslationGetDocumentsStatus500Response, DocumentTranslationGetDocumentsStatus503Response, DocumentTranslationGetSupportedDocumentFormats200Response, DocumentTranslationGetSupportedDocumentFormats429Response, DocumentTranslationGetSupportedDocumentFormats500Response, DocumentTranslationGetSupportedDocumentFormats503Response, DocumentTranslationGetSupportedGlossaryFormats200Response, DocumentTranslationGetSupportedGlossaryFormats429Response, DocumentTranslationGetSupportedGlossaryFormats500Response, DocumentTranslationGetSupportedGlossaryFormats503Response, DocumentTranslationGetSupportedStorageSources200Response, DocumentTranslationGetSupportedStorageSources429Response, DocumentTranslationGetSupportedStorageSources500Response, DocumentTranslationGetSupportedStorageSources503Response } from "./responses.js";
|
|
3
|
+
import type { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
4
|
+
export interface StartTranslation {
|
|
5
|
+
/**
|
|
6
|
+
* Use this API to submit a bulk (batch) translation request to the Document Translation service.
|
|
7
|
+
* Each request can contain multiple documents and must contain a source and destination container for each document.
|
|
8
|
+
*
|
|
9
|
+
* The prefix and suffix filter (if supplied) are used to filter folders. The prefix is applied to the subpath after the container name.
|
|
10
|
+
*
|
|
11
|
+
* Glossaries / Translation memory can be included in the request and are applied by the service when the document is translated.
|
|
12
|
+
*
|
|
13
|
+
* If the glossary is invalid or unreachable during translation, an error is indicated in the document status.
|
|
14
|
+
* If a file with the same name already exists at the destination, it will be overwritten. The targetUrl for each target language must be unique.
|
|
15
|
+
*/
|
|
16
|
+
post(options: DocumentTranslationStartTranslationParameters): StreamableMethod<DocumentTranslationStartTranslation202Response | DocumentTranslationStartTranslation400Response | DocumentTranslationStartTranslation401Response | DocumentTranslationStartTranslation429Response | DocumentTranslationStartTranslation500Response | DocumentTranslationStartTranslation503Response>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a list of batch requests submitted and the status for each request.
|
|
19
|
+
* This list only contains batch requests submitted by the user (based on the resource).
|
|
20
|
+
*
|
|
21
|
+
* If the number of requests exceeds our paging limit, server-side paging is used. Paginated responses indicate a partial result and include a continuation token in the response.
|
|
22
|
+
* The absence of a continuation token means that no additional pages are available.
|
|
23
|
+
*
|
|
24
|
+
* $top, $skip and $maxpagesize query parameters can be used to specify a number of results to return and an offset for the collection.
|
|
25
|
+
*
|
|
26
|
+
* $top indicates the total number of records the user wants to be returned across all pages.
|
|
27
|
+
* $skip indicates the number of records to skip from the list of batches based on the sorting method specified. By default, we sort by descending start time.
|
|
28
|
+
* $maxpagesize is the maximum items returned in a page. If more items are requested via $top (or $top is not specified and there are more items to be returned), '\@nextLink' will contain the link to the next page.
|
|
29
|
+
*
|
|
30
|
+
* $orderBy query parameter can be used to sort the returned list (ex "$orderBy=createdDateTimeUtc asc" or "$orderBy=createdDateTimeUtc desc").
|
|
31
|
+
* The default sorting is descending by createdDateTimeUtc.
|
|
32
|
+
* Some query parameters can be used to filter the returned list (ex: "status=Succeeded,Cancelled") will only return succeeded and cancelled operations.
|
|
33
|
+
* createdDateTimeUtcStart and createdDateTimeUtcEnd can be used combined or separately to specify a range of datetime to filter the returned list by.
|
|
34
|
+
* The supported filtering query parameters are (status, ids, createdDateTimeUtcStart, createdDateTimeUtcEnd).
|
|
35
|
+
*
|
|
36
|
+
* The server honors the values specified by the client. However, clients must be prepared to handle responses that contain a different page size or contain a continuation token.
|
|
37
|
+
*
|
|
38
|
+
* When both $top and $skip are included, the server should first apply $skip and then $top on the collection.
|
|
39
|
+
* Note: If the server can't honor $top and/or $skip, the server must return an error to the client informing about it instead of just ignoring the query options.
|
|
40
|
+
* This reduces the risk of the client making assumptions about the data returned.
|
|
41
|
+
*/
|
|
42
|
+
get(options?: DocumentTranslationGetTranslationsStatusParameters): StreamableMethod<DocumentTranslationGetTranslationsStatus200Response | DocumentTranslationGetTranslationsStatus400Response | DocumentTranslationGetTranslationsStatus401Response | DocumentTranslationGetTranslationsStatus429Response | DocumentTranslationGetTranslationsStatus500Response | DocumentTranslationGetTranslationsStatus503Response>;
|
|
43
|
+
}
|
|
44
|
+
export interface GetDocumentStatus {
|
|
45
|
+
/** Returns the translation status for a specific document based on the request Id and document Id. */
|
|
46
|
+
get(options?: DocumentTranslationGetDocumentStatusParameters): StreamableMethod<DocumentTranslationGetDocumentStatus200Response | DocumentTranslationGetDocumentStatus401Response | DocumentTranslationGetDocumentStatus404Response | DocumentTranslationGetDocumentStatus429Response | DocumentTranslationGetDocumentStatus500Response | DocumentTranslationGetDocumentStatus503Response>;
|
|
47
|
+
}
|
|
48
|
+
export interface GetTranslationStatus {
|
|
49
|
+
/**
|
|
50
|
+
* Returns the status for a document translation request.
|
|
51
|
+
* The status includes the overall request status, as well as the status for documents that are being translated as part of that request.
|
|
52
|
+
*/
|
|
53
|
+
get(options?: DocumentTranslationGetTranslationStatusParameters): StreamableMethod<DocumentTranslationGetTranslationStatus200Response | DocumentTranslationGetTranslationStatus401Response | DocumentTranslationGetTranslationStatus404Response | DocumentTranslationGetTranslationStatus429Response | DocumentTranslationGetTranslationStatus500Response | DocumentTranslationGetTranslationStatus503Response>;
|
|
54
|
+
/**
|
|
55
|
+
* Cancel a currently processing or queued translation.
|
|
56
|
+
* Cancel a currently processing or queued translation.
|
|
57
|
+
* A translation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned.
|
|
58
|
+
* All documents that have completed translation will not be cancelled and will be charged.
|
|
59
|
+
* All pending documents will be cancelled if possible.
|
|
60
|
+
*/
|
|
61
|
+
delete(options?: DocumentTranslationCancelTranslationParameters): StreamableMethod<DocumentTranslationCancelTranslation200Response | DocumentTranslationCancelTranslation401Response | DocumentTranslationCancelTranslation404Response | DocumentTranslationCancelTranslation429Response | DocumentTranslationCancelTranslation500Response | DocumentTranslationCancelTranslation503Response>;
|
|
62
|
+
}
|
|
63
|
+
export interface GetDocumentsStatus {
|
|
64
|
+
/**
|
|
65
|
+
* Returns the status for all documents in a batch document translation request.
|
|
66
|
+
*
|
|
67
|
+
* If the number of documents in the response exceeds our paging limit, server-side paging is used.
|
|
68
|
+
* Paginated responses indicate a partial result and include a continuation token in the response. The absence of a continuation token means that no additional pages are available.
|
|
69
|
+
*
|
|
70
|
+
* $top, $skip and $maxpagesize query parameters can be used to specify a number of results to return and an offset for the collection.
|
|
71
|
+
*
|
|
72
|
+
* $top indicates the total number of records the user wants to be returned across all pages.
|
|
73
|
+
* $skip indicates the number of records to skip from the list of document status held by the server based on the sorting method specified. By default, we sort by descending start time.
|
|
74
|
+
* $maxpagesize is the maximum items returned in a page. If more items are requested via $top (or $top is not specified and there are more items to be returned), '\@nextLink' will contain the link to the next page.
|
|
75
|
+
*
|
|
76
|
+
* $orderBy query parameter can be used to sort the returned list (ex "$orderBy=createdDateTimeUtc asc" or "$orderBy=createdDateTimeUtc desc").
|
|
77
|
+
* The default sorting is descending by createdDateTimeUtc.
|
|
78
|
+
* Some query parameters can be used to filter the returned list (ex: "status=Succeeded,Cancelled") will only return succeeded and cancelled documents.
|
|
79
|
+
* createdDateTimeUtcStart and createdDateTimeUtcEnd can be used combined or separately to specify a range of datetime to filter the returned list by.
|
|
80
|
+
* The supported filtering query parameters are (status, ids, createdDateTimeUtcStart, createdDateTimeUtcEnd).
|
|
81
|
+
*
|
|
82
|
+
* When both $top and $skip are included, the server should first apply $skip and then $top on the collection.
|
|
83
|
+
* Note: If the server can't honor $top and/or $skip, the server must return an error to the client informing about it instead of just ignoring the query options.
|
|
84
|
+
* This reduces the risk of the client making assumptions about the data returned.
|
|
85
|
+
*/
|
|
86
|
+
get(options?: DocumentTranslationGetDocumentsStatusParameters): StreamableMethod<DocumentTranslationGetDocumentsStatus200Response | DocumentTranslationGetDocumentsStatus400Response | DocumentTranslationGetDocumentsStatus401Response | DocumentTranslationGetDocumentsStatus404Response | DocumentTranslationGetDocumentsStatus429Response | DocumentTranslationGetDocumentsStatus500Response | DocumentTranslationGetDocumentsStatus503Response>;
|
|
87
|
+
}
|
|
88
|
+
export interface GetSupportedDocumentFormats {
|
|
89
|
+
/**
|
|
90
|
+
* The list of supported document formats supported by the Document Translation service.
|
|
91
|
+
* The list includes the common file extension, as well as the content-type if using the upload API.
|
|
92
|
+
*/
|
|
93
|
+
get(options?: DocumentTranslationGetSupportedDocumentFormatsParameters): StreamableMethod<DocumentTranslationGetSupportedDocumentFormats200Response | DocumentTranslationGetSupportedDocumentFormats429Response | DocumentTranslationGetSupportedDocumentFormats500Response | DocumentTranslationGetSupportedDocumentFormats503Response>;
|
|
94
|
+
}
|
|
95
|
+
export interface GetSupportedGlossaryFormats {
|
|
96
|
+
/**
|
|
97
|
+
* The list of supported glossary formats supported by the Document Translation service.
|
|
98
|
+
* The list includes the common file extension used.
|
|
99
|
+
*/
|
|
100
|
+
get(options?: DocumentTranslationGetSupportedGlossaryFormatsParameters): StreamableMethod<DocumentTranslationGetSupportedGlossaryFormats200Response | DocumentTranslationGetSupportedGlossaryFormats429Response | DocumentTranslationGetSupportedGlossaryFormats500Response | DocumentTranslationGetSupportedGlossaryFormats503Response>;
|
|
101
|
+
}
|
|
102
|
+
export interface GetSupportedStorageSources {
|
|
103
|
+
/** Returns a list of storage sources/options supported by the Document Translation service. */
|
|
104
|
+
get(options?: DocumentTranslationGetSupportedStorageSourcesParameters): StreamableMethod<DocumentTranslationGetSupportedStorageSources200Response | DocumentTranslationGetSupportedStorageSources429Response | DocumentTranslationGetSupportedStorageSources500Response | DocumentTranslationGetSupportedStorageSources503Response>;
|
|
105
|
+
}
|
|
106
|
+
export interface Routes {
|
|
107
|
+
/** Resource for '/batches' has methods for the following verbs: post, get */
|
|
108
|
+
(path: "/batches"): StartTranslation;
|
|
109
|
+
/** Resource for '/batches/\{id\}/documents/\{documentId\}' has methods for the following verbs: get */
|
|
110
|
+
(path: "/batches/{id}/documents/{documentId}", id: string, documentId: string): GetDocumentStatus;
|
|
111
|
+
/** Resource for '/batches/\{id\}' has methods for the following verbs: get, delete */
|
|
112
|
+
(path: "/batches/{id}", id: string): GetTranslationStatus;
|
|
113
|
+
/** Resource for '/batches/\{id\}/documents' has methods for the following verbs: get */
|
|
114
|
+
(path: "/batches/{id}/documents", id: string): GetDocumentsStatus;
|
|
115
|
+
/** Resource for '/documents/formats' has methods for the following verbs: get */
|
|
116
|
+
(path: "/documents/formats"): GetSupportedDocumentFormats;
|
|
117
|
+
/** Resource for '/glossaries/formats' has methods for the following verbs: get */
|
|
118
|
+
(path: "/glossaries/formats"): GetSupportedGlossaryFormats;
|
|
119
|
+
/** Resource for '/storagesources' has methods for the following verbs: get */
|
|
120
|
+
(path: "/storagesources"): GetSupportedStorageSources;
|
|
121
|
+
}
|
|
122
|
+
export type DocumentTranslatorClient = Client & {
|
|
123
|
+
path: Routes;
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=clientDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,6CAA6C,EAC7C,kDAAkD,EAClD,8CAA8C,EAC9C,iDAAiD,EACjD,8CAA8C,EAC9C,+CAA+C,EAC/C,wDAAwD,EACxD,wDAAwD,EACxD,uDAAuD,EACxD,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,wDAAwD,EACxD,wDAAwD,EACxD,wDAAwD,EACxD,wDAAwD,EACzD,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;OAUG;IACH,IAAI,CACF,OAAO,EAAE,6CAA6C,GACrD,gBAAgB,CACf,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,CACjD,CAAC;IACF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,kDAAkD,GAC3D,gBAAgB,CACf,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,CACtD,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,sGAAsG;IACtG,GAAG,CACD,OAAO,CAAC,EAAE,8CAA8C,GACvD,gBAAgB,CACf,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,CAClD,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,iDAAiD,GAC1D,gBAAgB,CACf,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,CACrD,CAAC;IACF;;;;;;OAMG;IACH,MAAM,CACJ,OAAO,CAAC,EAAE,8CAA8C,GACvD,gBAAgB,CACf,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,CAClD,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,+CAA+C,GACxD,gBAAgB,CACf,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,CACnD,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,wDAAwD,GACjE,gBAAgB,CACf,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,CAC5D,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,wDAAwD,GACjE,gBAAgB,CACf,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,CAC5D,CAAC;CACH;AAED,MAAM,WAAW,0BAA0B;IACzC,+FAA+F;IAC/F,GAAG,CACD,OAAO,CAAC,EAAE,uDAAuD,GAChE,gBAAgB,CACf,wDAAwD,GACxD,wDAAwD,GACxD,wDAAwD,GACxD,wDAAwD,CAC3D,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,6EAA6E;IAC7E,CAAC,IAAI,EAAE,UAAU,GAAG,gBAAgB,CAAC;IACrC,uGAAuG;IACvG,CAAC,IAAI,EAAE,sCAAsC,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAAC;IAClG,sFAAsF;IACtF,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,GAAG,oBAAoB,CAAC;IAC1D,wFAAwF;IACxF,CAAC,IAAI,EAAE,yBAAyB,EAAE,EAAE,EAAE,MAAM,GAAG,kBAAkB,CAAC;IAClE,iFAAiF;IACjF,CAAC,IAAI,EAAE,oBAAoB,GAAG,2BAA2B,CAAC;IAC1D,kFAAkF;IAClF,CAAC,IAAI,EAAE,qBAAqB,GAAG,2BAA2B,CAAC;IAC3D,8EAA8E;IAC9E,CAAC,IAAI,EAAE,iBAAiB,GAAG,0BAA0B,CAAC;CACvD;AAED,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n DocumentTranslationStartTranslationParameters,\n DocumentTranslationGetTranslationsStatusParameters,\n DocumentTranslationGetDocumentStatusParameters,\n DocumentTranslationGetTranslationStatusParameters,\n DocumentTranslationCancelTranslationParameters,\n DocumentTranslationGetDocumentsStatusParameters,\n DocumentTranslationGetSupportedDocumentFormatsParameters,\n DocumentTranslationGetSupportedGlossaryFormatsParameters,\n DocumentTranslationGetSupportedStorageSourcesParameters,\n} from \"./parameters.js\";\nimport type {\n DocumentTranslationStartTranslation202Response,\n DocumentTranslationStartTranslation400Response,\n DocumentTranslationStartTranslation401Response,\n DocumentTranslationStartTranslation429Response,\n DocumentTranslationStartTranslation500Response,\n DocumentTranslationStartTranslation503Response,\n DocumentTranslationGetTranslationsStatus200Response,\n DocumentTranslationGetTranslationsStatus400Response,\n DocumentTranslationGetTranslationsStatus401Response,\n DocumentTranslationGetTranslationsStatus429Response,\n DocumentTranslationGetTranslationsStatus500Response,\n DocumentTranslationGetTranslationsStatus503Response,\n DocumentTranslationGetDocumentStatus200Response,\n DocumentTranslationGetDocumentStatus401Response,\n DocumentTranslationGetDocumentStatus404Response,\n DocumentTranslationGetDocumentStatus429Response,\n DocumentTranslationGetDocumentStatus500Response,\n DocumentTranslationGetDocumentStatus503Response,\n DocumentTranslationGetTranslationStatus200Response,\n DocumentTranslationGetTranslationStatus401Response,\n DocumentTranslationGetTranslationStatus404Response,\n DocumentTranslationGetTranslationStatus429Response,\n DocumentTranslationGetTranslationStatus500Response,\n DocumentTranslationGetTranslationStatus503Response,\n DocumentTranslationCancelTranslation200Response,\n DocumentTranslationCancelTranslation401Response,\n DocumentTranslationCancelTranslation404Response,\n DocumentTranslationCancelTranslation429Response,\n DocumentTranslationCancelTranslation500Response,\n DocumentTranslationCancelTranslation503Response,\n DocumentTranslationGetDocumentsStatus200Response,\n DocumentTranslationGetDocumentsStatus400Response,\n DocumentTranslationGetDocumentsStatus401Response,\n DocumentTranslationGetDocumentsStatus404Response,\n DocumentTranslationGetDocumentsStatus429Response,\n DocumentTranslationGetDocumentsStatus500Response,\n DocumentTranslationGetDocumentsStatus503Response,\n DocumentTranslationGetSupportedDocumentFormats200Response,\n DocumentTranslationGetSupportedDocumentFormats429Response,\n DocumentTranslationGetSupportedDocumentFormats500Response,\n DocumentTranslationGetSupportedDocumentFormats503Response,\n DocumentTranslationGetSupportedGlossaryFormats200Response,\n DocumentTranslationGetSupportedGlossaryFormats429Response,\n DocumentTranslationGetSupportedGlossaryFormats500Response,\n DocumentTranslationGetSupportedGlossaryFormats503Response,\n DocumentTranslationGetSupportedStorageSources200Response,\n DocumentTranslationGetSupportedStorageSources429Response,\n DocumentTranslationGetSupportedStorageSources500Response,\n DocumentTranslationGetSupportedStorageSources503Response,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface StartTranslation {\n /**\n * Use this API to submit a bulk (batch) translation request to the Document Translation service.\n * Each request can contain multiple documents and must contain a source and destination container for each document.\n *\n * The prefix and suffix filter (if supplied) are used to filter folders. The prefix is applied to the subpath after the container name.\n *\n * Glossaries / Translation memory can be included in the request and are applied by the service when the document is translated.\n *\n * If the glossary is invalid or unreachable during translation, an error is indicated in the document status.\n * If a file with the same name already exists at the destination, it will be overwritten. The targetUrl for each target language must be unique.\n */\n post(\n options: DocumentTranslationStartTranslationParameters,\n ): StreamableMethod<\n | DocumentTranslationStartTranslation202Response\n | DocumentTranslationStartTranslation400Response\n | DocumentTranslationStartTranslation401Response\n | DocumentTranslationStartTranslation429Response\n | DocumentTranslationStartTranslation500Response\n | DocumentTranslationStartTranslation503Response\n >;\n /**\n * Returns a list of batch requests submitted and the status for each request.\n * This list only contains batch requests submitted by the user (based on the resource).\n *\n * If the number of requests exceeds our paging limit, server-side paging is used. Paginated responses indicate a partial result and include a continuation token in the response.\n * The absence of a continuation token means that no additional pages are available.\n *\n * $top, $skip and $maxpagesize query parameters can be used to specify a number of results to return and an offset for the collection.\n *\n * $top indicates the total number of records the user wants to be returned across all pages.\n * $skip indicates the number of records to skip from the list of batches based on the sorting method specified. By default, we sort by descending start time.\n * $maxpagesize is the maximum items returned in a page. If more items are requested via $top (or $top is not specified and there are more items to be returned), '\\@nextLink' will contain the link to the next page.\n *\n * $orderBy query parameter can be used to sort the returned list (ex \"$orderBy=createdDateTimeUtc asc\" or \"$orderBy=createdDateTimeUtc desc\").\n * The default sorting is descending by createdDateTimeUtc.\n * Some query parameters can be used to filter the returned list (ex: \"status=Succeeded,Cancelled\") will only return succeeded and cancelled operations.\n * createdDateTimeUtcStart and createdDateTimeUtcEnd can be used combined or separately to specify a range of datetime to filter the returned list by.\n * The supported filtering query parameters are (status, ids, createdDateTimeUtcStart, createdDateTimeUtcEnd).\n *\n * The server honors the values specified by the client. However, clients must be prepared to handle responses that contain a different page size or contain a continuation token.\n *\n * When both $top and $skip are included, the server should first apply $skip and then $top on the collection.\n * Note: If the server can't honor $top and/or $skip, the server must return an error to the client informing about it instead of just ignoring the query options.\n * This reduces the risk of the client making assumptions about the data returned.\n */\n get(\n options?: DocumentTranslationGetTranslationsStatusParameters,\n ): StreamableMethod<\n | DocumentTranslationGetTranslationsStatus200Response\n | DocumentTranslationGetTranslationsStatus400Response\n | DocumentTranslationGetTranslationsStatus401Response\n | DocumentTranslationGetTranslationsStatus429Response\n | DocumentTranslationGetTranslationsStatus500Response\n | DocumentTranslationGetTranslationsStatus503Response\n >;\n}\n\nexport interface GetDocumentStatus {\n /** Returns the translation status for a specific document based on the request Id and document Id. */\n get(\n options?: DocumentTranslationGetDocumentStatusParameters,\n ): StreamableMethod<\n | DocumentTranslationGetDocumentStatus200Response\n | DocumentTranslationGetDocumentStatus401Response\n | DocumentTranslationGetDocumentStatus404Response\n | DocumentTranslationGetDocumentStatus429Response\n | DocumentTranslationGetDocumentStatus500Response\n | DocumentTranslationGetDocumentStatus503Response\n >;\n}\n\nexport interface GetTranslationStatus {\n /**\n * Returns the status for a document translation request.\n * The status includes the overall request status, as well as the status for documents that are being translated as part of that request.\n */\n get(\n options?: DocumentTranslationGetTranslationStatusParameters,\n ): StreamableMethod<\n | DocumentTranslationGetTranslationStatus200Response\n | DocumentTranslationGetTranslationStatus401Response\n | DocumentTranslationGetTranslationStatus404Response\n | DocumentTranslationGetTranslationStatus429Response\n | DocumentTranslationGetTranslationStatus500Response\n | DocumentTranslationGetTranslationStatus503Response\n >;\n /**\n * Cancel a currently processing or queued translation.\n * Cancel a currently processing or queued translation.\n * A translation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned.\n * All documents that have completed translation will not be cancelled and will be charged.\n * All pending documents will be cancelled if possible.\n */\n delete(\n options?: DocumentTranslationCancelTranslationParameters,\n ): StreamableMethod<\n | DocumentTranslationCancelTranslation200Response\n | DocumentTranslationCancelTranslation401Response\n | DocumentTranslationCancelTranslation404Response\n | DocumentTranslationCancelTranslation429Response\n | DocumentTranslationCancelTranslation500Response\n | DocumentTranslationCancelTranslation503Response\n >;\n}\n\nexport interface GetDocumentsStatus {\n /**\n * Returns the status for all documents in a batch document translation request.\n *\n * If the number of documents in the response exceeds our paging limit, server-side paging is used.\n * Paginated responses indicate a partial result and include a continuation token in the response. The absence of a continuation token means that no additional pages are available.\n *\n * $top, $skip and $maxpagesize query parameters can be used to specify a number of results to return and an offset for the collection.\n *\n * $top indicates the total number of records the user wants to be returned across all pages.\n * $skip indicates the number of records to skip from the list of document status held by the server based on the sorting method specified. By default, we sort by descending start time.\n * $maxpagesize is the maximum items returned in a page. If more items are requested via $top (or $top is not specified and there are more items to be returned), '\\@nextLink' will contain the link to the next page.\n *\n * $orderBy query parameter can be used to sort the returned list (ex \"$orderBy=createdDateTimeUtc asc\" or \"$orderBy=createdDateTimeUtc desc\").\n * The default sorting is descending by createdDateTimeUtc.\n * Some query parameters can be used to filter the returned list (ex: \"status=Succeeded,Cancelled\") will only return succeeded and cancelled documents.\n * createdDateTimeUtcStart and createdDateTimeUtcEnd can be used combined or separately to specify a range of datetime to filter the returned list by.\n * The supported filtering query parameters are (status, ids, createdDateTimeUtcStart, createdDateTimeUtcEnd).\n *\n * When both $top and $skip are included, the server should first apply $skip and then $top on the collection.\n * Note: If the server can't honor $top and/or $skip, the server must return an error to the client informing about it instead of just ignoring the query options.\n * This reduces the risk of the client making assumptions about the data returned.\n */\n get(\n options?: DocumentTranslationGetDocumentsStatusParameters,\n ): StreamableMethod<\n | DocumentTranslationGetDocumentsStatus200Response\n | DocumentTranslationGetDocumentsStatus400Response\n | DocumentTranslationGetDocumentsStatus401Response\n | DocumentTranslationGetDocumentsStatus404Response\n | DocumentTranslationGetDocumentsStatus429Response\n | DocumentTranslationGetDocumentsStatus500Response\n | DocumentTranslationGetDocumentsStatus503Response\n >;\n}\n\nexport interface GetSupportedDocumentFormats {\n /**\n * The list of supported document formats supported by the Document Translation service.\n * The list includes the common file extension, as well as the content-type if using the upload API.\n */\n get(\n options?: DocumentTranslationGetSupportedDocumentFormatsParameters,\n ): StreamableMethod<\n | DocumentTranslationGetSupportedDocumentFormats200Response\n | DocumentTranslationGetSupportedDocumentFormats429Response\n | DocumentTranslationGetSupportedDocumentFormats500Response\n | DocumentTranslationGetSupportedDocumentFormats503Response\n >;\n}\n\nexport interface GetSupportedGlossaryFormats {\n /**\n * The list of supported glossary formats supported by the Document Translation service.\n * The list includes the common file extension used.\n */\n get(\n options?: DocumentTranslationGetSupportedGlossaryFormatsParameters,\n ): StreamableMethod<\n | DocumentTranslationGetSupportedGlossaryFormats200Response\n | DocumentTranslationGetSupportedGlossaryFormats429Response\n | DocumentTranslationGetSupportedGlossaryFormats500Response\n | DocumentTranslationGetSupportedGlossaryFormats503Response\n >;\n}\n\nexport interface GetSupportedStorageSources {\n /** Returns a list of storage sources/options supported by the Document Translation service. */\n get(\n options?: DocumentTranslationGetSupportedStorageSourcesParameters,\n ): StreamableMethod<\n | DocumentTranslationGetSupportedStorageSources200Response\n | DocumentTranslationGetSupportedStorageSources429Response\n | DocumentTranslationGetSupportedStorageSources500Response\n | DocumentTranslationGetSupportedStorageSources503Response\n >;\n}\n\nexport interface Routes {\n /** Resource for '/batches' has methods for the following verbs: post, get */\n (path: \"/batches\"): StartTranslation;\n /** Resource for '/batches/\\{id\\}/documents/\\{documentId\\}' has methods for the following verbs: get */\n (path: \"/batches/{id}/documents/{documentId}\", id: string, documentId: string): GetDocumentStatus;\n /** Resource for '/batches/\\{id\\}' has methods for the following verbs: get, delete */\n (path: \"/batches/{id}\", id: string): GetTranslationStatus;\n /** Resource for '/batches/\\{id\\}/documents' has methods for the following verbs: get */\n (path: \"/batches/{id}/documents\", id: string): GetDocumentsStatus;\n /** Resource for '/documents/formats' has methods for the following verbs: get */\n (path: \"/documents/formats\"): GetSupportedDocumentFormats;\n /** Resource for '/glossaries/formats' has methods for the following verbs: get */\n (path: \"/glossaries/formats\"): GetSupportedGlossaryFormats;\n /** Resource for '/storagesources' has methods for the following verbs: get */\n (path: \"/storagesources\"): GetSupportedStorageSources;\n}\n\nexport type DocumentTranslatorClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import type { KeyCredential } from "@azure/core-auth";
|
|
3
|
+
import type { DocumentTranslatorClient } from "./clientDefinitions.js";
|
|
4
|
+
/** The optional parameters for the client */
|
|
5
|
+
export interface DocumentTranslatorClientOptions extends ClientOptions {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a new instance of `DocumentTranslatorClient`
|
|
9
|
+
* @param endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
|
|
10
|
+
* @param credentials - uniquely identify client credential
|
|
11
|
+
* @param options - the parameter for all optional parameters
|
|
12
|
+
*/
|
|
13
|
+
export default function createClient(endpoint: string, credentials: KeyCredential, options?: DocumentTranslatorClientOptions): DocumentTranslatorClient;
|
|
14
|
+
//# sourceMappingURL=documentTranslator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentTranslator.d.ts","sourceRoot":"","sources":["../../src/documentTranslator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,6CAA6C;AAC7C,MAAM,WAAW,+BAAgC,SAAQ,aAAa;CAAG;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,aAAa,EAC1B,OAAO,GAAE,+BAAoC,GAC5C,wBAAwB,CA+B1B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { getClient } from "@azure-rest/core-client";
|
|
4
|
+
import { logger } from "./logger.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialize a new instance of `DocumentTranslatorClient`
|
|
7
|
+
* @param endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
|
|
8
|
+
* @param credentials - uniquely identify client credential
|
|
9
|
+
* @param options - the parameter for all optional parameters
|
|
10
|
+
*/
|
|
11
|
+
export default function createClient(endpoint, credentials, options = {}) {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
|
+
const endpointUrl = (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUrl) !== null && _b !== void 0 ? _b : `${endpoint}/translator/text/batch/v1.0`;
|
|
14
|
+
const userAgentInfo = `azsdk-js-ai-document-translator-rest/1.0.0-beta.2`;
|
|
15
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
16
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
17
|
+
: `${userAgentInfo}`;
|
|
18
|
+
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
|
|
19
|
+
userAgentPrefix,
|
|
20
|
+
}, loggingOptions: {
|
|
21
|
+
logger: (_d = (_c = options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger.info,
|
|
22
|
+
}, credentials: {
|
|
23
|
+
scopes: ["https://cognitiveservices.azure.com/.default"],
|
|
24
|
+
apiKeyHeaderName: (_f = (_e = options.credentials) === null || _e === void 0 ? void 0 : _e.apiKeyHeaderName) !== null && _f !== void 0 ? _f : "Ocp-Apim-Subscription-Key",
|
|
25
|
+
} });
|
|
26
|
+
const client = getClient(endpointUrl, credentials, options);
|
|
27
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
28
|
+
if (options.apiVersion) {
|
|
29
|
+
logger.warning("This client does not support client api-version, please change it at the operation level");
|
|
30
|
+
}
|
|
31
|
+
return client;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=documentTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentTranslator.js","sourceRoot":"","sources":["../../src/documentTranslator.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA0B,EAC1B,UAA2C,EAAE;;IAE7C,MAAM,WAAW,GACf,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,6BAA6B,CAAC;IAClF,MAAM,aAAa,GAAG,mDAAmD,CAAC;IAC1E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,8CAA8C,CAAC;YACxD,gBAAgB,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,gBAAgB,mCAAI,2BAA2B;SACvF,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAA6B,CAAC;IAExF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,CAAC,OAAO,CACZ,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport type { DocumentTranslatorClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface DocumentTranslatorClientOptions extends ClientOptions {}\n\n/**\n * Initialize a new instance of `DocumentTranslatorClient`\n * @param endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: KeyCredential,\n options: DocumentTranslatorClientOptions = {},\n): DocumentTranslatorClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `${endpoint}/translator/text/batch/v1.0`;\n const userAgentInfo = `azsdk-js-ai-document-translator-rest/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as DocumentTranslatorClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n if (options.apiVersion) {\n logger.warning(\n \"This client does not support client api-version, please change it at the operation level\",\n );\n }\n\n return client;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import DocumentTranslator from "./documentTranslator.js";
|
|
2
|
+
export * from "./documentTranslator.js";
|
|
3
|
+
export * from "./parameters.js";
|
|
4
|
+
export * from "./responses.js";
|
|
5
|
+
export * from "./clientDefinitions.js";
|
|
6
|
+
export * from "./isUnexpected.js";
|
|
7
|
+
export * from "./models.js";
|
|
8
|
+
export * from "./outputModels.js";
|
|
9
|
+
export * from "./paginateHelper.js";
|
|
10
|
+
export * from "./pollingHelper.js";
|
|
11
|
+
export default DocumentTranslator;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AAEnC,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import DocumentTranslator from "./documentTranslator.js";
|
|
4
|
+
export * from "./documentTranslator.js";
|
|
5
|
+
export * from "./parameters.js";
|
|
6
|
+
export * from "./responses.js";
|
|
7
|
+
export * from "./clientDefinitions.js";
|
|
8
|
+
export * from "./isUnexpected.js";
|
|
9
|
+
export * from "./models.js";
|
|
10
|
+
export * from "./outputModels.js";
|
|
11
|
+
export * from "./paginateHelper.js";
|
|
12
|
+
export * from "./pollingHelper.js";
|
|
13
|
+
export default DocumentTranslator;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AAEnC,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport DocumentTranslator from \"./documentTranslator.js\";\n\nexport * from \"./documentTranslator.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./models.js\";\nexport * from \"./outputModels.js\";\nexport * from \"./paginateHelper.js\";\nexport * from \"./pollingHelper.js\";\n\nexport default DocumentTranslator;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DocumentTranslationStartTranslation202Response, DocumentTranslationStartTranslation400Response, DocumentTranslationStartTranslation401Response, DocumentTranslationStartTranslation429Response, DocumentTranslationStartTranslation500Response, DocumentTranslationStartTranslation503Response, DocumentTranslationGetTranslationsStatus200Response, DocumentTranslationGetTranslationsStatus400Response, DocumentTranslationGetTranslationsStatus401Response, DocumentTranslationGetTranslationsStatus429Response, DocumentTranslationGetTranslationsStatus500Response, DocumentTranslationGetTranslationsStatus503Response, DocumentTranslationGetDocumentStatus200Response, DocumentTranslationGetDocumentStatus401Response, DocumentTranslationGetDocumentStatus404Response, DocumentTranslationGetDocumentStatus429Response, DocumentTranslationGetDocumentStatus500Response, DocumentTranslationGetDocumentStatus503Response, DocumentTranslationGetTranslationStatus200Response, DocumentTranslationGetTranslationStatus401Response, DocumentTranslationGetTranslationStatus404Response, DocumentTranslationGetTranslationStatus429Response, DocumentTranslationGetTranslationStatus500Response, DocumentTranslationGetTranslationStatus503Response, DocumentTranslationCancelTranslation200Response, DocumentTranslationCancelTranslation401Response, DocumentTranslationCancelTranslation404Response, DocumentTranslationCancelTranslation429Response, DocumentTranslationCancelTranslation500Response, DocumentTranslationCancelTranslation503Response, DocumentTranslationGetDocumentsStatus200Response, DocumentTranslationGetDocumentsStatus400Response, DocumentTranslationGetDocumentsStatus401Response, DocumentTranslationGetDocumentsStatus404Response, DocumentTranslationGetDocumentsStatus429Response, DocumentTranslationGetDocumentsStatus500Response, DocumentTranslationGetDocumentsStatus503Response, DocumentTranslationGetSupportedDocumentFormats200Response, DocumentTranslationGetSupportedDocumentFormats429Response, DocumentTranslationGetSupportedDocumentFormats500Response, DocumentTranslationGetSupportedDocumentFormats503Response, DocumentTranslationGetSupportedGlossaryFormats200Response, DocumentTranslationGetSupportedGlossaryFormats429Response, DocumentTranslationGetSupportedGlossaryFormats500Response, DocumentTranslationGetSupportedGlossaryFormats503Response, DocumentTranslationGetSupportedStorageSources200Response, DocumentTranslationGetSupportedStorageSources429Response, DocumentTranslationGetSupportedStorageSources500Response, DocumentTranslationGetSupportedStorageSources503Response } from "./responses.js";
|
|
2
|
+
export declare function isUnexpected(response: DocumentTranslationStartTranslation202Response | DocumentTranslationStartTranslation400Response | DocumentTranslationStartTranslation401Response | DocumentTranslationStartTranslation429Response | DocumentTranslationStartTranslation500Response | DocumentTranslationStartTranslation503Response): response is DocumentTranslationStartTranslation400Response;
|
|
3
|
+
export declare function isUnexpected(response: DocumentTranslationGetTranslationsStatus200Response | DocumentTranslationGetTranslationsStatus400Response | DocumentTranslationGetTranslationsStatus401Response | DocumentTranslationGetTranslationsStatus429Response | DocumentTranslationGetTranslationsStatus500Response | DocumentTranslationGetTranslationsStatus503Response): response is DocumentTranslationGetTranslationsStatus400Response;
|
|
4
|
+
export declare function isUnexpected(response: DocumentTranslationGetDocumentStatus200Response | DocumentTranslationGetDocumentStatus401Response | DocumentTranslationGetDocumentStatus404Response | DocumentTranslationGetDocumentStatus429Response | DocumentTranslationGetDocumentStatus500Response | DocumentTranslationGetDocumentStatus503Response): response is DocumentTranslationGetDocumentStatus401Response;
|
|
5
|
+
export declare function isUnexpected(response: DocumentTranslationGetTranslationStatus200Response | DocumentTranslationGetTranslationStatus401Response | DocumentTranslationGetTranslationStatus404Response | DocumentTranslationGetTranslationStatus429Response | DocumentTranslationGetTranslationStatus500Response | DocumentTranslationGetTranslationStatus503Response): response is DocumentTranslationGetTranslationStatus401Response;
|
|
6
|
+
export declare function isUnexpected(response: DocumentTranslationCancelTranslation200Response | DocumentTranslationCancelTranslation401Response | DocumentTranslationCancelTranslation404Response | DocumentTranslationCancelTranslation429Response | DocumentTranslationCancelTranslation500Response | DocumentTranslationCancelTranslation503Response): response is DocumentTranslationCancelTranslation401Response;
|
|
7
|
+
export declare function isUnexpected(response: DocumentTranslationGetDocumentsStatus200Response | DocumentTranslationGetDocumentsStatus400Response | DocumentTranslationGetDocumentsStatus401Response | DocumentTranslationGetDocumentsStatus404Response | DocumentTranslationGetDocumentsStatus429Response | DocumentTranslationGetDocumentsStatus500Response | DocumentTranslationGetDocumentsStatus503Response): response is DocumentTranslationGetDocumentsStatus400Response;
|
|
8
|
+
export declare function isUnexpected(response: DocumentTranslationGetSupportedDocumentFormats200Response | DocumentTranslationGetSupportedDocumentFormats429Response | DocumentTranslationGetSupportedDocumentFormats500Response | DocumentTranslationGetSupportedDocumentFormats503Response): response is DocumentTranslationGetSupportedDocumentFormats429Response;
|
|
9
|
+
export declare function isUnexpected(response: DocumentTranslationGetSupportedGlossaryFormats200Response | DocumentTranslationGetSupportedGlossaryFormats429Response | DocumentTranslationGetSupportedGlossaryFormats500Response | DocumentTranslationGetSupportedGlossaryFormats503Response): response is DocumentTranslationGetSupportedGlossaryFormats429Response;
|
|
10
|
+
export declare function isUnexpected(response: DocumentTranslationGetSupportedStorageSources200Response | DocumentTranslationGetSupportedStorageSources429Response | DocumentTranslationGetSupportedStorageSources500Response | DocumentTranslationGetSupportedStorageSources503Response): response is DocumentTranslationGetSupportedStorageSources429Response;
|
|
11
|
+
//# sourceMappingURL=isUnexpected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,8CAA8C,EAC9C,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,mDAAmD,EACnD,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,kDAAkD,EAClD,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,gDAAgD,EAChD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,yDAAyD,EACzD,wDAAwD,EACxD,wDAAwD,EACxD,wDAAwD,EACxD,wDAAwD,EACzD,MAAM,gBAAgB,CAAC;AAcxB,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GAC9C,8CAA8C,GACjD,QAAQ,IAAI,8CAA8C,CAAC;AAC9D,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACnD,mDAAmD,GACtD,QAAQ,IAAI,mDAAmD,CAAC;AACnE,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAClD,QAAQ,IAAI,+CAA+C,CAAC;AAC/D,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GAClD,kDAAkD,GACrD,QAAQ,IAAI,kDAAkD,CAAC;AAClE,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAC/C,+CAA+C,GAClD,QAAQ,IAAI,+CAA+C,CAAC;AAC/D,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GAChD,gDAAgD,GACnD,QAAQ,IAAI,gDAAgD,CAAC;AAChE,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,GAC5D,QAAQ,IAAI,yDAAyD,CAAC;AACzE,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,GACzD,yDAAyD,GAC5D,QAAQ,IAAI,yDAAyD,CAAC;AACzE,wBAAgB,YAAY,CAC1B,QAAQ,EACJ,wDAAwD,GACxD,wDAAwD,GACxD,wDAAwD,GACxD,wDAAwD,GAC3D,QAAQ,IAAI,wDAAwD,CAAC"}
|