@azure-rest/ai-translation-text 1.0.3-alpha.20251209.1 → 2.0.0-alpha.20251217.1
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/CHANGELOG.md +9 -2
- package/README.md +26 -173
- package/dist/browser/clientDefinitions.d.ts +2 -20
- package/dist/browser/clientDefinitions.d.ts.map +1 -1
- package/dist/browser/clientDefinitions.js.map +1 -1
- package/dist/browser/customClient.js +2 -2
- package/dist/browser/customClient.js.map +1 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +0 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/isUnexpected.d.ts +1 -4
- package/dist/browser/isUnexpected.d.ts.map +1 -1
- package/dist/browser/isUnexpected.js +0 -3
- package/dist/browser/isUnexpected.js.map +1 -1
- package/dist/browser/models.d.ts +96 -7
- package/dist/browser/models.d.ts.map +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/outputModels.d.ts +31 -209
- package/dist/browser/outputModels.d.ts.map +1 -1
- package/dist/browser/outputModels.js.map +1 -1
- package/dist/browser/parameters.d.ts +4 -160
- package/dist/browser/parameters.d.ts.map +1 -1
- package/dist/browser/parameters.js.map +1 -1
- package/dist/browser/responses.d.ts +5 -62
- package/dist/browser/responses.d.ts.map +1 -1
- package/dist/browser/responses.js.map +1 -1
- package/dist/browser/textTranslationClient.d.ts.map +1 -1
- package/dist/browser/textTranslationClient.js +3 -3
- package/dist/browser/textTranslationClient.js.map +1 -1
- package/dist/commonjs/clientDefinitions.d.ts +2 -20
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -1
- package/dist/commonjs/clientDefinitions.js.map +1 -1
- package/dist/commonjs/customClient.js +2 -2
- package/dist/commonjs/customClient.js.map +1 -1
- package/dist/commonjs/index.d.ts +0 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/isUnexpected.d.ts +1 -4
- package/dist/commonjs/isUnexpected.d.ts.map +1 -1
- package/dist/commonjs/isUnexpected.js +0 -3
- package/dist/commonjs/isUnexpected.js.map +1 -1
- package/dist/commonjs/models.d.ts +96 -7
- package/dist/commonjs/models.d.ts.map +1 -1
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/outputModels.d.ts +31 -209
- package/dist/commonjs/outputModels.d.ts.map +1 -1
- package/dist/commonjs/outputModels.js.map +1 -1
- package/dist/commonjs/parameters.d.ts +4 -160
- package/dist/commonjs/parameters.d.ts.map +1 -1
- package/dist/commonjs/parameters.js.map +1 -1
- package/dist/commonjs/responses.d.ts +5 -62
- package/dist/commonjs/responses.d.ts.map +1 -1
- package/dist/commonjs/responses.js.map +1 -1
- package/dist/commonjs/textTranslationClient.d.ts.map +1 -1
- package/dist/commonjs/textTranslationClient.js +3 -3
- package/dist/commonjs/textTranslationClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/clientDefinitions.d.ts +2 -20
- package/dist/esm/clientDefinitions.d.ts.map +1 -1
- package/dist/esm/clientDefinitions.js.map +1 -1
- package/dist/esm/customClient.js +2 -2
- package/dist/esm/customClient.js.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isUnexpected.d.ts +1 -4
- package/dist/esm/isUnexpected.d.ts.map +1 -1
- package/dist/esm/isUnexpected.js +0 -3
- package/dist/esm/isUnexpected.js.map +1 -1
- package/dist/esm/models.d.ts +96 -7
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/outputModels.d.ts +31 -209
- package/dist/esm/outputModels.d.ts.map +1 -1
- package/dist/esm/outputModels.js.map +1 -1
- package/dist/esm/parameters.d.ts +4 -160
- package/dist/esm/parameters.d.ts.map +1 -1
- package/dist/esm/parameters.js.map +1 -1
- package/dist/esm/responses.d.ts +5 -62
- package/dist/esm/responses.d.ts.map +1 -1
- package/dist/esm/responses.js.map +1 -1
- package/dist/esm/textTranslationClient.d.ts.map +1 -1
- package/dist/esm/textTranslationClient.js +3 -3
- package/dist/esm/textTranslationClient.js.map +1 -1
- package/dist/react-native/clientDefinitions.d.ts +2 -20
- package/dist/react-native/clientDefinitions.d.ts.map +1 -1
- package/dist/react-native/clientDefinitions.js.map +1 -1
- package/dist/react-native/customClient.js +2 -2
- package/dist/react-native/customClient.js.map +1 -1
- package/dist/react-native/index.d.ts +0 -1
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +0 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/isUnexpected.d.ts +1 -4
- package/dist/react-native/isUnexpected.d.ts.map +1 -1
- package/dist/react-native/isUnexpected.js +0 -3
- package/dist/react-native/isUnexpected.js.map +1 -1
- package/dist/react-native/models.d.ts +96 -7
- package/dist/react-native/models.d.ts.map +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/outputModels.d.ts +31 -209
- package/dist/react-native/outputModels.d.ts.map +1 -1
- package/dist/react-native/outputModels.js.map +1 -1
- package/dist/react-native/parameters.d.ts +4 -160
- package/dist/react-native/parameters.d.ts.map +1 -1
- package/dist/react-native/parameters.js.map +1 -1
- package/dist/react-native/responses.d.ts +5 -62
- package/dist/react-native/responses.d.ts.map +1 -1
- package/dist/react-native/responses.js.map +1 -1
- package/dist/react-native/textTranslationClient.d.ts.map +1 -1
- package/dist/react-native/textTranslationClient.js +3 -3
- package/dist/react-native/textTranslationClient.js.map +1 -1
- package/package.json +3 -3
- package/review/ai-translation-text-node.api.md +66 -334
- package/dist/browser/serializeHelper.d.ts +0 -2
- package/dist/browser/serializeHelper.d.ts.map +0 -1
- package/dist/browser/serializeHelper.js +0 -13
- package/dist/browser/serializeHelper.js.map +0 -1
- package/dist/commonjs/serializeHelper.d.ts +0 -2
- package/dist/commonjs/serializeHelper.d.ts.map +0 -1
- package/dist/commonjs/serializeHelper.js +0 -16
- package/dist/commonjs/serializeHelper.js.map +0 -1
- package/dist/esm/serializeHelper.d.ts +0 -2
- package/dist/esm/serializeHelper.d.ts.map +0 -1
- package/dist/esm/serializeHelper.js +0 -13
- package/dist/esm/serializeHelper.js.map +0 -1
- package/dist/react-native/serializeHelper.d.ts +0 -2
- package/dist/react-native/serializeHelper.d.ts.map +0 -1
- package/dist/react-native/serializeHelper.js +0 -13
- package/dist/react-native/serializeHelper.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
|
|
2
2
|
import type { RequestParameters } from "@azure-rest/core-client";
|
|
3
|
-
import type {
|
|
3
|
+
import type { TranslateBody, TransliterateBody } from "./models.js";
|
|
4
4
|
export interface GetSupportedLanguagesHeaders {
|
|
5
5
|
/** A client-generated GUID to uniquely identify the request. */
|
|
6
6
|
"X-ClientTraceId"?: string;
|
|
@@ -42,94 +42,19 @@ export interface TranslateHeaders {
|
|
|
42
42
|
}
|
|
43
43
|
export interface TranslateBodyParam {
|
|
44
44
|
/** Defines the content of the request */
|
|
45
|
-
body:
|
|
46
|
-
}
|
|
47
|
-
export interface TranslateQueryParamProperties {
|
|
48
|
-
/**
|
|
49
|
-
* Specifies the language of the output text. The target language must be one of the supported languages included
|
|
50
|
-
* in the translation scope. For example, use to=de to translate to German.
|
|
51
|
-
* It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string.
|
|
52
|
-
* For example, use to=de&to=it to translate to German and Italian. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request
|
|
53
|
-
*/
|
|
54
|
-
to: string;
|
|
55
|
-
/**
|
|
56
|
-
* Specifies the language of the input text. Find which languages are available to translate from by
|
|
57
|
-
* looking up supported languages using the translation scope. If the from parameter isn't specified,
|
|
58
|
-
* automatic language detection is applied to determine the source language.
|
|
59
|
-
*
|
|
60
|
-
* You must use the from parameter rather than autodetection when using the dynamic dictionary feature.
|
|
61
|
-
* Note: the dynamic dictionary feature is case-sensitive.
|
|
62
|
-
*/
|
|
63
|
-
from?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed,
|
|
66
|
-
* complete element. Possible values are: plain (default) or html.
|
|
67
|
-
*
|
|
68
|
-
* Possible values: "Plain", "Html"
|
|
69
|
-
*/
|
|
70
|
-
textType?: TextType;
|
|
71
|
-
/**
|
|
72
|
-
* A string specifying the category (domain) of the translation. This parameter is used to get translations
|
|
73
|
-
* from a customized system built with Custom Translator. Add the Category ID from your Custom Translator
|
|
74
|
-
* project details to this parameter to use your deployed customized system. Default value is: general.
|
|
75
|
-
*/
|
|
76
|
-
category?: string;
|
|
77
|
-
/**
|
|
78
|
-
* Specifies how profanities should be treated in translations.
|
|
79
|
-
* Possible values are: NoAction (default), Marked or Deleted.
|
|
80
|
-
*/
|
|
81
|
-
profanityAction?: ProfanityAction;
|
|
82
|
-
/**
|
|
83
|
-
* Specifies how profanities should be marked in translations.
|
|
84
|
-
* Possible values are: Asterisk (default) or Tag.
|
|
85
|
-
*/
|
|
86
|
-
profanityMarker?: ProfanityMarker;
|
|
87
|
-
/**
|
|
88
|
-
* Specifies whether to include alignment projection from source text to translated text.
|
|
89
|
-
* Possible values are: true or false (default).
|
|
90
|
-
*/
|
|
91
|
-
includeAlignment?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Specifies whether to include sentence boundaries for the input text and the translated text.
|
|
94
|
-
* Possible values are: true or false (default).
|
|
95
|
-
*/
|
|
96
|
-
includeSentenceLength?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Specifies a fallback language if the language of the input text can't be identified.
|
|
99
|
-
* Language autodetection is applied when the from parameter is omitted. If detection fails,
|
|
100
|
-
* the suggestedFrom language will be assumed.
|
|
101
|
-
*/
|
|
102
|
-
suggestedFrom?: string;
|
|
103
|
-
/** Specifies the script of the input text. */
|
|
104
|
-
fromScript?: string;
|
|
105
|
-
/** Specifies the script of the translated text. */
|
|
106
|
-
toScript?: string;
|
|
107
|
-
/**
|
|
108
|
-
* Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.
|
|
109
|
-
* Possible values are: true (default) or false.
|
|
110
|
-
*
|
|
111
|
-
* allowFallback=false specifies that the translation should only use systems trained for the category specified
|
|
112
|
-
* by the request. If a translation for language X to language Y requires chaining through a pivot language E,
|
|
113
|
-
* then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category.
|
|
114
|
-
* If no system is found with the specific category, the request will return a 400 status code. allowFallback=true
|
|
115
|
-
* specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.
|
|
116
|
-
*/
|
|
117
|
-
allowFallback?: boolean;
|
|
118
|
-
}
|
|
119
|
-
export interface TranslateQueryParam {
|
|
120
|
-
queryParameters: TranslateQueryParamProperties;
|
|
45
|
+
body: TranslateBody;
|
|
121
46
|
}
|
|
122
47
|
export interface TranslateHeaderParam {
|
|
123
48
|
headers?: RawHttpHeadersInput & TranslateHeaders;
|
|
124
49
|
}
|
|
125
|
-
export type TranslateParameters =
|
|
50
|
+
export type TranslateParameters = TranslateHeaderParam & TranslateBodyParam & RequestParameters;
|
|
126
51
|
export interface TransliterateHeaders {
|
|
127
52
|
/** A client-generated GUID to uniquely identify the request. */
|
|
128
53
|
"X-ClientTraceId"?: string;
|
|
129
54
|
}
|
|
130
55
|
export interface TransliterateBodyParam {
|
|
131
56
|
/** Defines the content of the request */
|
|
132
|
-
body:
|
|
57
|
+
body: TransliterateBody;
|
|
133
58
|
}
|
|
134
59
|
export interface TransliterateQueryParamProperties {
|
|
135
60
|
/**
|
|
@@ -156,85 +81,4 @@ export interface TransliterateHeaderParam {
|
|
|
156
81
|
headers?: RawHttpHeadersInput & TransliterateHeaders;
|
|
157
82
|
}
|
|
158
83
|
export type TransliterateParameters = TransliterateQueryParam & TransliterateHeaderParam & TransliterateBodyParam & RequestParameters;
|
|
159
|
-
export interface FindSentenceBoundariesHeaders {
|
|
160
|
-
/** A client-generated GUID to uniquely identify the request. */
|
|
161
|
-
"X-ClientTraceId"?: string;
|
|
162
|
-
}
|
|
163
|
-
export interface FindSentenceBoundariesBodyParam {
|
|
164
|
-
/** Defines the content of the request */
|
|
165
|
-
body: Array<InputTextItem>;
|
|
166
|
-
}
|
|
167
|
-
export interface FindSentenceBoundariesQueryParamProperties {
|
|
168
|
-
/**
|
|
169
|
-
* Language tag identifying the language of the input text.
|
|
170
|
-
* If a code isn't specified, automatic language detection will be applied.
|
|
171
|
-
*/
|
|
172
|
-
language?: string;
|
|
173
|
-
/**
|
|
174
|
-
* Script tag identifying the script used by the input text.
|
|
175
|
-
* If a script isn't specified, the default script of the language will be assumed.
|
|
176
|
-
*/
|
|
177
|
-
script?: string;
|
|
178
|
-
}
|
|
179
|
-
export interface FindSentenceBoundariesQueryParam {
|
|
180
|
-
queryParameters?: FindSentenceBoundariesQueryParamProperties;
|
|
181
|
-
}
|
|
182
|
-
export interface FindSentenceBoundariesHeaderParam {
|
|
183
|
-
headers?: RawHttpHeadersInput & FindSentenceBoundariesHeaders;
|
|
184
|
-
}
|
|
185
|
-
export type FindSentenceBoundariesParameters = FindSentenceBoundariesQueryParam & FindSentenceBoundariesHeaderParam & FindSentenceBoundariesBodyParam & RequestParameters;
|
|
186
|
-
export interface LookupDictionaryEntriesHeaders {
|
|
187
|
-
/** A client-generated GUID to uniquely identify the request. */
|
|
188
|
-
"X-ClientTraceId"?: string;
|
|
189
|
-
}
|
|
190
|
-
export interface LookupDictionaryEntriesBodyParam {
|
|
191
|
-
/** Defines the content of the request */
|
|
192
|
-
body: Array<InputTextItem>;
|
|
193
|
-
}
|
|
194
|
-
export interface LookupDictionaryEntriesQueryParamProperties {
|
|
195
|
-
/**
|
|
196
|
-
* Specifies the language of the input text.
|
|
197
|
-
* The source language must be one of the supported languages included in the dictionary scope.
|
|
198
|
-
*/
|
|
199
|
-
from: string;
|
|
200
|
-
/**
|
|
201
|
-
* Specifies the language of the output text.
|
|
202
|
-
* The target language must be one of the supported languages included in the dictionary scope.
|
|
203
|
-
*/
|
|
204
|
-
to: string;
|
|
205
|
-
}
|
|
206
|
-
export interface LookupDictionaryEntriesQueryParam {
|
|
207
|
-
queryParameters: LookupDictionaryEntriesQueryParamProperties;
|
|
208
|
-
}
|
|
209
|
-
export interface LookupDictionaryEntriesHeaderParam {
|
|
210
|
-
headers?: RawHttpHeadersInput & LookupDictionaryEntriesHeaders;
|
|
211
|
-
}
|
|
212
|
-
export type LookupDictionaryEntriesParameters = LookupDictionaryEntriesQueryParam & LookupDictionaryEntriesHeaderParam & LookupDictionaryEntriesBodyParam & RequestParameters;
|
|
213
|
-
export interface LookupDictionaryExamplesHeaders {
|
|
214
|
-
/** A client-generated GUID to uniquely identify the request. */
|
|
215
|
-
"X-ClientTraceId"?: string;
|
|
216
|
-
}
|
|
217
|
-
export interface LookupDictionaryExamplesBodyParam {
|
|
218
|
-
/** Defines the content of the request */
|
|
219
|
-
body: Array<DictionaryExampleTextItem>;
|
|
220
|
-
}
|
|
221
|
-
export interface LookupDictionaryExamplesQueryParamProperties {
|
|
222
|
-
/**
|
|
223
|
-
* Specifies the language of the input text.
|
|
224
|
-
* The source language must be one of the supported languages included in the dictionary scope.
|
|
225
|
-
*/
|
|
226
|
-
from: string;
|
|
227
|
-
/**
|
|
228
|
-
* Specifies the language of the output text.
|
|
229
|
-
* The target language must be one of the supported languages included in the dictionary scope.
|
|
230
|
-
*/
|
|
231
|
-
to: string;
|
|
232
|
-
}
|
|
233
|
-
export interface LookupDictionaryExamplesQueryParam {
|
|
234
|
-
queryParameters: LookupDictionaryExamplesQueryParamProperties;
|
|
235
|
-
}
|
|
236
|
-
export interface LookupDictionaryExamplesHeaderParam {
|
|
237
|
-
headers?: RawHttpHeadersInput & LookupDictionaryExamplesHeaders;
|
|
238
|
-
}
|
|
239
|
-
export type LookupDictionaryExamplesParameters = LookupDictionaryExamplesQueryParam & LookupDictionaryExamplesHeaderParam & LookupDictionaryExamplesBodyParam & RequestParameters;
|
|
240
84
|
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yCAAyC;IACxD;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,eAAe,CAAC,EAAE,yCAAyC,CAAC;CAC7D;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,CAAC,EAAE,mBAAmB,GAAG,4BAA4B,CAAC;CAC9D;AAED,MAAM,MAAM,+BAA+B,GAAG,+BAA+B,GAC3E,gCAAgC,GAChC,iBAAiB,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,CAAC;CAClD;AAED,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAEhG,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,iCAAiC;IAChD;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,iCAAiC,CAAC;CACpD;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAAC;CACtD;AAED,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,GAC3D,wBAAwB,GACxB,sBAAsB,GACtB,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type {\n TextType,\n ProfanityAction,\n ProfanityMarker,\n InputTextItem,\n DictionaryExampleTextItem,\n} from \"./models.js\";\n\nexport interface GetSupportedLanguagesHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n /**\n * The language to use for user interface strings. Some of the fields in the response are names of languages or\n * names of regions. Use this parameter to define the language in which these names are returned.\n * The language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr`\n * to request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\n * Names are provided in the English language when a target language is not specified or when localization\n * is not available.\n */\n \"Accept-Language\"?: string;\n /**\n * Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response.\n * If the resource has not been modified, the service will return status code 304 and an empty response body.\n */\n \"If-None-Match\"?: string;\n}\n\nexport interface GetSupportedLanguagesQueryParamProperties {\n /**\n * A comma-separated list of names defining the group of languages to return.\n * Allowed group names are: `translation`, `transliteration` and `dictionary`.\n * If no scope is given, then all groups are returned, which is equivalent to passing\n * `scope=translation,transliteration,dictionary`. To decide which set of supported languages\n * is appropriate for your scenario, see the description of the [response object](#response-body).\n */\n scope?: string;\n}\n\nexport interface GetSupportedLanguagesQueryParam {\n queryParameters?: GetSupportedLanguagesQueryParamProperties;\n}\n\nexport interface GetSupportedLanguagesHeaderParam {\n headers?: RawHttpHeadersInput & GetSupportedLanguagesHeaders;\n}\n\nexport type GetSupportedLanguagesParameters = GetSupportedLanguagesQueryParam &\n GetSupportedLanguagesHeaderParam &\n RequestParameters;\n\nexport interface TranslateHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface TranslateBodyParam {\n /** Defines the content of the request */\n body: Array<InputTextItem>;\n}\n\nexport interface TranslateQueryParamProperties {\n /**\n * Specifies the language of the output text. The target language must be one of the supported languages included\n * in the translation scope. For example, use to=de to translate to German.\n * It's possible to translate to multiple languages simultaneously by repeating the parameter in the query string.\n * For example, use to=de&to=it to translate to German and Italian. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request\n */\n to: string;\n /**\n * Specifies the language of the input text. Find which languages are available to translate from by\n * looking up supported languages using the translation scope. If the from parameter isn't specified,\n * automatic language detection is applied to determine the source language.\n *\n * You must use the from parameter rather than autodetection when using the dynamic dictionary feature.\n * Note: the dynamic dictionary feature is case-sensitive.\n */\n from?: string;\n /**\n * Defines whether the text being translated is plain text or HTML text. Any HTML needs to be a well-formed,\n * complete element. Possible values are: plain (default) or html.\n *\n * Possible values: \"Plain\", \"Html\"\n */\n textType?: TextType;\n /**\n * A string specifying the category (domain) of the translation. This parameter is used to get translations\n * from a customized system built with Custom Translator. Add the Category ID from your Custom Translator\n * project details to this parameter to use your deployed customized system. Default value is: general.\n */\n category?: string;\n /**\n * Specifies how profanities should be treated in translations.\n * Possible values are: NoAction (default), Marked or Deleted.\n */\n profanityAction?: ProfanityAction;\n /**\n * Specifies how profanities should be marked in translations.\n * Possible values are: Asterisk (default) or Tag.\n */\n profanityMarker?: ProfanityMarker;\n /**\n * Specifies whether to include alignment projection from source text to translated text.\n * Possible values are: true or false (default).\n */\n includeAlignment?: boolean;\n /**\n * Specifies whether to include sentence boundaries for the input text and the translated text.\n * Possible values are: true or false (default).\n */\n includeSentenceLength?: boolean;\n /**\n * Specifies a fallback language if the language of the input text can't be identified.\n * Language autodetection is applied when the from parameter is omitted. If detection fails,\n * the suggestedFrom language will be assumed.\n */\n suggestedFrom?: string;\n /** Specifies the script of the input text. */\n fromScript?: string;\n /** Specifies the script of the translated text. */\n toScript?: string;\n /**\n * Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.\n * Possible values are: true (default) or false.\n *\n * allowFallback=false specifies that the translation should only use systems trained for the category specified\n * by the request. If a translation for language X to language Y requires chaining through a pivot language E,\n * then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category.\n * If no system is found with the specific category, the request will return a 400 status code. allowFallback=true\n * specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.\n */\n allowFallback?: boolean;\n}\n\nexport interface TranslateQueryParam {\n queryParameters: TranslateQueryParamProperties;\n}\n\nexport interface TranslateHeaderParam {\n headers?: RawHttpHeadersInput & TranslateHeaders;\n}\n\nexport type TranslateParameters = TranslateQueryParam &\n TranslateHeaderParam &\n TranslateBodyParam &\n RequestParameters;\n\nexport interface TransliterateHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface TransliterateBodyParam {\n /** Defines the content of the request */\n body: Array<InputTextItem>;\n}\n\nexport interface TransliterateQueryParamProperties {\n /**\n * Specifies the language of the text to convert from one script to another.\n * Possible languages are listed in the transliteration scope obtained by querying the service\n * for its supported languages.\n */\n language: string;\n /**\n * Specifies the script used by the input text. Look up supported languages using the transliteration scope,\n * to find input scripts available for the selected language.\n */\n fromScript: string;\n /**\n * Specifies the output script. Look up supported languages using the transliteration scope, to find output\n * scripts available for the selected combination of input language and input script.\n */\n toScript: string;\n}\n\nexport interface TransliterateQueryParam {\n queryParameters: TransliterateQueryParamProperties;\n}\n\nexport interface TransliterateHeaderParam {\n headers?: RawHttpHeadersInput & TransliterateHeaders;\n}\n\nexport type TransliterateParameters = TransliterateQueryParam &\n TransliterateHeaderParam &\n TransliterateBodyParam &\n RequestParameters;\n\nexport interface FindSentenceBoundariesHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface FindSentenceBoundariesBodyParam {\n /** Defines the content of the request */\n body: Array<InputTextItem>;\n}\n\nexport interface FindSentenceBoundariesQueryParamProperties {\n /**\n * Language tag identifying the language of the input text.\n * If a code isn't specified, automatic language detection will be applied.\n */\n language?: string;\n /**\n * Script tag identifying the script used by the input text.\n * If a script isn't specified, the default script of the language will be assumed.\n */\n script?: string;\n}\n\nexport interface FindSentenceBoundariesQueryParam {\n queryParameters?: FindSentenceBoundariesQueryParamProperties;\n}\n\nexport interface FindSentenceBoundariesHeaderParam {\n headers?: RawHttpHeadersInput & FindSentenceBoundariesHeaders;\n}\n\nexport type FindSentenceBoundariesParameters = FindSentenceBoundariesQueryParam &\n FindSentenceBoundariesHeaderParam &\n FindSentenceBoundariesBodyParam &\n RequestParameters;\n\nexport interface LookupDictionaryEntriesHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface LookupDictionaryEntriesBodyParam {\n /** Defines the content of the request */\n body: Array<InputTextItem>;\n}\n\nexport interface LookupDictionaryEntriesQueryParamProperties {\n /**\n * Specifies the language of the input text.\n * The source language must be one of the supported languages included in the dictionary scope.\n */\n from: string;\n /**\n * Specifies the language of the output text.\n * The target language must be one of the supported languages included in the dictionary scope.\n */\n to: string;\n}\n\nexport interface LookupDictionaryEntriesQueryParam {\n queryParameters: LookupDictionaryEntriesQueryParamProperties;\n}\n\nexport interface LookupDictionaryEntriesHeaderParam {\n headers?: RawHttpHeadersInput & LookupDictionaryEntriesHeaders;\n}\n\nexport type LookupDictionaryEntriesParameters = LookupDictionaryEntriesQueryParam &\n LookupDictionaryEntriesHeaderParam &\n LookupDictionaryEntriesBodyParam &\n RequestParameters;\n\nexport interface LookupDictionaryExamplesHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface LookupDictionaryExamplesBodyParam {\n /** Defines the content of the request */\n body: Array<DictionaryExampleTextItem>;\n}\n\nexport interface LookupDictionaryExamplesQueryParamProperties {\n /**\n * Specifies the language of the input text.\n * The source language must be one of the supported languages included in the dictionary scope.\n */\n from: string;\n /**\n * Specifies the language of the output text.\n * The target language must be one of the supported languages included in the dictionary scope.\n */\n to: string;\n}\n\nexport interface LookupDictionaryExamplesQueryParam {\n queryParameters: LookupDictionaryExamplesQueryParamProperties;\n}\n\nexport interface LookupDictionaryExamplesHeaderParam {\n headers?: RawHttpHeadersInput & LookupDictionaryExamplesHeaders;\n}\n\nexport type LookupDictionaryExamplesParameters = LookupDictionaryExamplesQueryParam &\n LookupDictionaryExamplesHeaderParam &\n LookupDictionaryExamplesBodyParam &\n RequestParameters;\n"]}
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { TranslateBody, TransliterateBody } from \"./models.js\";\n\nexport interface GetSupportedLanguagesHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n /**\n * The language to use for user interface strings. Some of the fields in the response are names of languages or\n * names of regions. Use this parameter to define the language in which these names are returned.\n * The language is specified by providing a well-formed BCP 47 language tag. For instance, use the value `fr`\n * to request names in French or use the value `zh-Hant` to request names in Chinese Traditional.\n * Names are provided in the English language when a target language is not specified or when localization\n * is not available.\n */\n \"Accept-Language\"?: string;\n /**\n * Passing the value of the ETag response header in an If-None-Match field will allow the service to optimize the response.\n * If the resource has not been modified, the service will return status code 304 and an empty response body.\n */\n \"If-None-Match\"?: string;\n}\n\nexport interface GetSupportedLanguagesQueryParamProperties {\n /**\n * A comma-separated list of names defining the group of languages to return.\n * Allowed group names are: `translation`, `transliteration` and `dictionary`.\n * If no scope is given, then all groups are returned, which is equivalent to passing\n * `scope=translation,transliteration,dictionary`. To decide which set of supported languages\n * is appropriate for your scenario, see the description of the [response object](#response-body).\n */\n scope?: string;\n}\n\nexport interface GetSupportedLanguagesQueryParam {\n queryParameters?: GetSupportedLanguagesQueryParamProperties;\n}\n\nexport interface GetSupportedLanguagesHeaderParam {\n headers?: RawHttpHeadersInput & GetSupportedLanguagesHeaders;\n}\n\nexport type GetSupportedLanguagesParameters = GetSupportedLanguagesQueryParam &\n GetSupportedLanguagesHeaderParam &\n RequestParameters;\n\nexport interface TranslateHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface TranslateBodyParam {\n /** Defines the content of the request */\n body: TranslateBody;\n}\n\nexport interface TranslateHeaderParam {\n headers?: RawHttpHeadersInput & TranslateHeaders;\n}\n\nexport type TranslateParameters = TranslateHeaderParam & TranslateBodyParam & RequestParameters;\n\nexport interface TransliterateHeaders {\n /** A client-generated GUID to uniquely identify the request. */\n \"X-ClientTraceId\"?: string;\n}\n\nexport interface TransliterateBodyParam {\n /** Defines the content of the request */\n body: TransliterateBody;\n}\n\nexport interface TransliterateQueryParamProperties {\n /**\n * Specifies the language of the text to convert from one script to another.\n * Possible languages are listed in the transliteration scope obtained by querying the service\n * for its supported languages.\n */\n language: string;\n /**\n * Specifies the script used by the input text. Look up supported languages using the transliteration scope,\n * to find input scripts available for the selected language.\n */\n fromScript: string;\n /**\n * Specifies the output script. Look up supported languages using the transliteration scope, to find output\n * scripts available for the selected combination of input language and input script.\n */\n toScript: string;\n}\n\nexport interface TransliterateQueryParam {\n queryParameters: TransliterateQueryParamProperties;\n}\n\nexport interface TransliterateHeaderParam {\n headers?: RawHttpHeadersInput & TransliterateHeaders;\n}\n\nexport type TransliterateParameters = TransliterateQueryParam &\n TransliterateHeaderParam &\n TransliterateBodyParam &\n RequestParameters;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RawHttpHeaders } from "@azure/core-rest-pipeline";
|
|
2
2
|
import type { HttpResponse } from "@azure-rest/core-client";
|
|
3
|
-
import type { GetSupportedLanguagesResultOutput, ErrorResponseOutput,
|
|
3
|
+
import type { GetSupportedLanguagesResultOutput, ErrorResponseOutput, TranslationResultOutput, TransliterateResultOutput } from "./outputModels.js";
|
|
4
4
|
export interface GetSupportedLanguages200Headers {
|
|
5
5
|
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
6
6
|
"x-requestid": string;
|
|
@@ -44,10 +44,10 @@ export interface Translate200Headers {
|
|
|
44
44
|
*/
|
|
45
45
|
"x-metered-usage": number;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
47
|
+
/** The request has succeeded. */
|
|
48
48
|
export interface Translate200Response extends HttpResponse {
|
|
49
49
|
status: "200";
|
|
50
|
-
body:
|
|
50
|
+
body: TranslationResultOutput;
|
|
51
51
|
headers: RawHttpHeaders & Translate200Headers;
|
|
52
52
|
}
|
|
53
53
|
export interface TranslateDefaultHeaders {
|
|
@@ -63,10 +63,10 @@ export interface Transliterate200Headers {
|
|
|
63
63
|
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
64
64
|
"x-requestid": string;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
66
|
+
/** The request has succeeded. */
|
|
67
67
|
export interface Transliterate200Response extends HttpResponse {
|
|
68
68
|
status: "200";
|
|
69
|
-
body:
|
|
69
|
+
body: TransliterateResultOutput;
|
|
70
70
|
headers: RawHttpHeaders & Transliterate200Headers;
|
|
71
71
|
}
|
|
72
72
|
export interface TransliterateDefaultHeaders {
|
|
@@ -78,61 +78,4 @@ export interface TransliterateDefaultResponse extends HttpResponse {
|
|
|
78
78
|
body: ErrorResponseOutput;
|
|
79
79
|
headers: RawHttpHeaders & TransliterateDefaultHeaders;
|
|
80
80
|
}
|
|
81
|
-
export interface FindSentenceBoundaries200Headers {
|
|
82
|
-
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
83
|
-
"x-requestid": string;
|
|
84
|
-
}
|
|
85
|
-
/** Response for the Break SEntence API. */
|
|
86
|
-
export interface FindSentenceBoundaries200Response extends HttpResponse {
|
|
87
|
-
status: "200";
|
|
88
|
-
body: Array<BreakSentenceItemOutput>;
|
|
89
|
-
headers: RawHttpHeaders & FindSentenceBoundaries200Headers;
|
|
90
|
-
}
|
|
91
|
-
export interface FindSentenceBoundariesDefaultHeaders {
|
|
92
|
-
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
93
|
-
"x-requestid": string;
|
|
94
|
-
}
|
|
95
|
-
export interface FindSentenceBoundariesDefaultResponse extends HttpResponse {
|
|
96
|
-
status: string;
|
|
97
|
-
body: ErrorResponseOutput;
|
|
98
|
-
headers: RawHttpHeaders & FindSentenceBoundariesDefaultHeaders;
|
|
99
|
-
}
|
|
100
|
-
export interface LookupDictionaryEntries200Headers {
|
|
101
|
-
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
102
|
-
"x-requestid": string;
|
|
103
|
-
}
|
|
104
|
-
/** Response for the dictionary lookup API. */
|
|
105
|
-
export interface LookupDictionaryEntries200Response extends HttpResponse {
|
|
106
|
-
status: "200";
|
|
107
|
-
body: Array<DictionaryLookupItemOutput>;
|
|
108
|
-
headers: RawHttpHeaders & LookupDictionaryEntries200Headers;
|
|
109
|
-
}
|
|
110
|
-
export interface LookupDictionaryEntriesDefaultHeaders {
|
|
111
|
-
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
112
|
-
"x-requestid": string;
|
|
113
|
-
}
|
|
114
|
-
export interface LookupDictionaryEntriesDefaultResponse extends HttpResponse {
|
|
115
|
-
status: string;
|
|
116
|
-
body: ErrorResponseOutput;
|
|
117
|
-
headers: RawHttpHeaders & LookupDictionaryEntriesDefaultHeaders;
|
|
118
|
-
}
|
|
119
|
-
export interface LookupDictionaryExamples200Headers {
|
|
120
|
-
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
121
|
-
"x-requestid": string;
|
|
122
|
-
}
|
|
123
|
-
/** Response for the dictionary examples API. */
|
|
124
|
-
export interface LookupDictionaryExamples200Response extends HttpResponse {
|
|
125
|
-
status: "200";
|
|
126
|
-
body: Array<DictionaryExampleItemOutput>;
|
|
127
|
-
headers: RawHttpHeaders & LookupDictionaryExamples200Headers;
|
|
128
|
-
}
|
|
129
|
-
export interface LookupDictionaryExamplesDefaultHeaders {
|
|
130
|
-
/** Value generated by the service to identify the request. It is used for troubleshooting purposes. */
|
|
131
|
-
"x-requestid": string;
|
|
132
|
-
}
|
|
133
|
-
export interface LookupDictionaryExamplesDefaultResponse extends HttpResponse {
|
|
134
|
-
status: string;
|
|
135
|
-
body: ErrorResponseOutput;
|
|
136
|
-
headers: RawHttpHeaders & LookupDictionaryExamplesDefaultHeaders;
|
|
137
|
-
}
|
|
138
81
|
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EACV,iCAAiC,EACjC,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EACV,iCAAiC,EACjC,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,+BAA+B;IAC9C,uGAAuG;IACvG,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iCAAiC;AACjC,MAAM,WAAW,gCAAiC,SAAQ,YAAY;IACpE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,cAAc,GAAG,+BAA+B,CAAC;CAC3D;AAED,MAAM,WAAW,mCAAmC;IAClD,uGAAuG;IACvG,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oCAAqC,SAAQ,YAAY;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,cAAc,GAAG,mCAAmC,CAAC;CAC/D;AAED,MAAM,WAAW,mBAAmB;IAClC,uGAAuG;IACvG,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,iCAAiC;AACjC,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,cAAc,GAAG,mBAAmB,CAAC;CAC/C;AAED,MAAM,WAAW,uBAAuB;IACtC,uGAAuG;IACvG,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,cAAc,GAAG,uBAAuB,CAAC;CACnD;AAED,MAAM,WAAW,uBAAuB;IACtC,uGAAuG;IACvG,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,iCAAiC;AACjC,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,cAAc,GAAG,uBAAuB,CAAC;CACnD;AAED,MAAM,WAAW,2BAA2B;IAC1C,uGAAuG;IACvG,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA6B,SAAQ,YAAY;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,cAAc,GAAG,2BAA2B,CAAC;CACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n GetSupportedLanguagesResultOutput,\n ErrorResponseOutput,\n
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n GetSupportedLanguagesResultOutput,\n ErrorResponseOutput,\n TranslationResultOutput,\n TransliterateResultOutput,\n} from \"./outputModels.js\";\n\nexport interface GetSupportedLanguages200Headers {\n /** Value generated by the service to identify the request. It is used for troubleshooting purposes. */\n \"x-requestid\": string;\n /**\n * Current value of the entity tag for the requested groups of supported languages.\n * To make subsequent requests more efficient, the client may send the `ETag` value in an\n * `If-None-Match` header field.\n */\n etag: string;\n}\n\n/** The request has succeeded. */\nexport interface GetSupportedLanguages200Response extends HttpResponse {\n status: \"200\";\n body: GetSupportedLanguagesResultOutput;\n headers: RawHttpHeaders & GetSupportedLanguages200Headers;\n}\n\nexport interface GetSupportedLanguagesDefaultHeaders {\n /** Value generated by the service to identify the request. It is used for troubleshooting purposes. */\n \"x-requestid\": string;\n}\n\nexport interface GetSupportedLanguagesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & GetSupportedLanguagesDefaultHeaders;\n}\n\nexport interface Translate200Headers {\n /** Value generated by the service to identify the request. It is used for troubleshooting purposes. */\n \"x-requestid\": string;\n /**\n * Specifies the system type that was used for translation for each 'to' language requested for translation.\n * The value is a comma-separated list of strings. Each string indicates a type:\n *\n * * Custom - Request includes a custom system and at least one custom system was used during translation.\n * * Team - All other requests\n */\n \"x-mt-system\": string;\n /**\n * Specifies consumption (the number of characters for which the user will be charged) for the translation\n * job request. For example, if the word \"Hello\" is translated from English (en) to French (fr),\n * this field will return the value '5'.\n */\n \"x-metered-usage\": number;\n}\n\n/** The request has succeeded. */\nexport interface Translate200Response extends HttpResponse {\n status: \"200\";\n body: TranslationResultOutput;\n headers: RawHttpHeaders & Translate200Headers;\n}\n\nexport interface TranslateDefaultHeaders {\n /** Value generated by the service to identify the request. It is used for troubleshooting purposes. */\n \"x-requestid\": string;\n}\n\nexport interface TranslateDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & TranslateDefaultHeaders;\n}\n\nexport interface Transliterate200Headers {\n /** Value generated by the service to identify the request. It is used for troubleshooting purposes. */\n \"x-requestid\": string;\n}\n\n/** The request has succeeded. */\nexport interface Transliterate200Response extends HttpResponse {\n status: \"200\";\n body: TransliterateResultOutput;\n headers: RawHttpHeaders & Transliterate200Headers;\n}\n\nexport interface TransliterateDefaultHeaders {\n /** Value generated by the service to identify the request. It is used for troubleshooting purposes. */\n \"x-requestid\": string;\n}\n\nexport interface TransliterateDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & TransliterateDefaultHeaders;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textTranslationClient.d.ts","sourceRoot":"","sources":["../../src/textTranslationClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,EAAE,
|
|
1
|
+
{"version":3,"file":"textTranslationClient.d.ts","sourceRoot":"","sources":["../../src/textTranslationClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,4BAAiC,GACnF,qBAAqB,CAoCvB"}
|
|
@@ -8,9 +8,9 @@ import { logger } from "./logger.js";
|
|
|
8
8
|
* https://api.cognitive.microsofttranslator.com).
|
|
9
9
|
* @param options - the parameter for all optional parameters
|
|
10
10
|
*/
|
|
11
|
-
export default function createClient(endpointParam, { apiVersion = "
|
|
12
|
-
const endpointUrl = options.endpoint ??
|
|
13
|
-
const userAgentInfo = `azsdk-js-ai-translation-text-rest/
|
|
11
|
+
export default function createClient(endpointParam, { apiVersion = "2025-10-01-preview", ...options } = {}) {
|
|
12
|
+
const endpointUrl = options.endpoint ?? `${endpointParam}`;
|
|
13
|
+
const userAgentInfo = `azsdk-js-ai-translation-text-rest/2.0.0-beta.1`;
|
|
14
14
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
15
15
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
16
16
|
: `${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textTranslationClient.js","sourceRoot":"","sources":["../../src/textTranslationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,EAAE,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"textTranslationClient.js","sourceRoot":"","sources":["../../src/textTranslationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAAmC,EAAE;IAEpF,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,GAAG,aAAa,EAAE,CAAC;IAC3D,MAAM,aAAa,GAAG,gDAAgD,CAAC;IACvE,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,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI;SACtD;KACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,OAAO,CAA0B,CAAC;IAExE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,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 { TextTranslationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface TextTranslationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `TextTranslationClient`\n * @param endpointParam - Supported Text Translation endpoints (protocol and hostname, for example:\n * https://api.cognitive.microsofttranslator.com).\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n { apiVersion = \"2025-10-01-preview\", ...options }: TextTranslationClientOptions = {},\n): TextTranslationClient {\n const endpointUrl = options.endpoint ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-ai-translation-text-rest/2.0.0-beta.1`;\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 };\n const client = getClient(endpointUrl, options) as TextTranslationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/ai-translation-text",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.0-alpha.20251217.1",
|
|
6
6
|
"description": "An isomorphic client library for the Azure Cognitive Translator Service",
|
|
7
7
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/translation/ai-translation-text-rest/README.md",
|
|
8
8
|
"keywords": [
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"typescript": "~5.9.3",
|
|
74
74
|
"vitest": "^4.0.8",
|
|
75
75
|
"@azure-tools/test-credential": "^2.1.2",
|
|
76
|
-
"@azure
|
|
76
|
+
"@azure/dev-tool": "^1.0.0",
|
|
77
77
|
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
78
|
-
"@azure/
|
|
78
|
+
"@azure-tools/test-recorder": "^4.1.1"
|
|
79
79
|
},
|
|
80
80
|
"//metadata": {
|
|
81
81
|
"constantPaths": [
|