@azure-rest/ai-translation-text 1.0.2-alpha.20250718.1 → 1.0.2-alpha.20250730.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/dist/browser/authenticationCustomized.js +6 -3
- package/dist/browser/authenticationCustomized.js.map +1 -1
- package/dist/browser/customClient.js +17 -14
- package/dist/browser/customClient.js.map +1 -1
- package/dist/browser/isUnexpected.js +4 -5
- package/dist/browser/isUnexpected.js.map +1 -1
- package/dist/browser/textTranslationClient.js +10 -9
- package/dist/browser/textTranslationClient.js.map +1 -1
- package/dist/commonjs/authenticationCustomized.js +6 -3
- package/dist/commonjs/authenticationCustomized.js.map +1 -1
- package/dist/commonjs/customClient.js +17 -14
- package/dist/commonjs/customClient.js.map +1 -1
- package/dist/commonjs/isUnexpected.js +4 -5
- package/dist/commonjs/isUnexpected.js.map +1 -1
- package/dist/commonjs/textTranslationClient.js +10 -9
- package/dist/commonjs/textTranslationClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/authenticationCustomized.js +6 -3
- package/dist/esm/authenticationCustomized.js.map +1 -1
- package/dist/esm/customClient.js +17 -14
- package/dist/esm/customClient.js.map +1 -1
- package/dist/esm/isUnexpected.js +4 -5
- package/dist/esm/isUnexpected.js.map +1 -1
- package/dist/esm/textTranslationClient.js +10 -9
- package/dist/esm/textTranslationClient.js.map +1 -1
- package/dist/react-native/authenticationCustomized.js +6 -3
- package/dist/react-native/authenticationCustomized.js.map +1 -1
- package/dist/react-native/customClient.js +17 -14
- package/dist/react-native/customClient.js.map +1 -1
- package/dist/react-native/isUnexpected.js +4 -5
- package/dist/react-native/isUnexpected.js.map +1 -1
- package/dist/react-native/textTranslationClient.js +10 -9
- package/dist/react-native/textTranslationClient.js.map +1 -1
- package/package.json +2 -2
- package/review/ai-translation-text-node.api.md +664 -664
|
@@ -10,7 +10,7 @@ const responseMap = {
|
|
|
10
10
|
};
|
|
11
11
|
export function isUnexpected(response) {
|
|
12
12
|
const lroOriginal = response.headers["x-ms-original-url"];
|
|
13
|
-
const url = new URL(lroOriginal
|
|
13
|
+
const url = new URL(lroOriginal ?? response.request.url);
|
|
14
14
|
const method = response.request.method;
|
|
15
15
|
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
16
16
|
if (!pathDetails) {
|
|
@@ -19,7 +19,6 @@ export function isUnexpected(response) {
|
|
|
19
19
|
return !pathDetails.includes(response.status);
|
|
20
20
|
}
|
|
21
21
|
function getParametrizedPathSuccess(method, path) {
|
|
22
|
-
var _a, _b, _c, _d;
|
|
23
22
|
const pathParts = path.split("/");
|
|
24
23
|
// Traverse list to match the longest candidate
|
|
25
24
|
// matchedLen: the length of candidate path
|
|
@@ -38,13 +37,13 @@ function getParametrizedPathSuccess(method, path) {
|
|
|
38
37
|
// track if we have found a match to return the values found.
|
|
39
38
|
let found = true;
|
|
40
39
|
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
41
|
-
if (
|
|
42
|
-
const start = candidateParts[i].indexOf("}") + 1, end =
|
|
40
|
+
if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
|
|
41
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
43
42
|
// If the current part of the candidate is a "template" part
|
|
44
43
|
// Try to use the suffix of pattern to match the path
|
|
45
44
|
// {guid} ==> $
|
|
46
45
|
// {guid}:export ==> :export$
|
|
47
|
-
const isMatched = new RegExp(`${
|
|
46
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
48
47
|
if (!isMatched) {
|
|
49
48
|
found = false;
|
|
50
49
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiBlC,MAAM,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C,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetSupportedLanguages200Response,\n GetSupportedLanguagesDefaultResponse,\n Translate200Response,\n TranslateDefaultResponse,\n Transliterate200Response,\n TransliterateDefaultResponse,\n FindSentenceBoundaries200Response,\n FindSentenceBoundariesDefaultResponse,\n LookupDictionaryEntries200Response,\n LookupDictionaryEntriesDefaultResponse,\n LookupDictionaryExamples200Response,\n LookupDictionaryExamplesDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /languages\": [\"200\"],\n \"POST /translate\": [\"200\"],\n \"POST /transliterate\": [\"200\"],\n \"POST /breaksentence\": [\"200\"],\n \"POST /dictionary/lookup\": [\"200\"],\n \"POST /dictionary/examples\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetSupportedLanguages200Response | GetSupportedLanguagesDefaultResponse,\n): response is GetSupportedLanguagesDefaultResponse;\nexport function isUnexpected(\n response: Translate200Response | TranslateDefaultResponse,\n): response is TranslateDefaultResponse;\nexport function isUnexpected(\n response: Transliterate200Response | TransliterateDefaultResponse,\n): response is TransliterateDefaultResponse;\nexport function isUnexpected(\n response: FindSentenceBoundaries200Response | FindSentenceBoundariesDefaultResponse,\n): response is FindSentenceBoundariesDefaultResponse;\nexport function isUnexpected(\n response: LookupDictionaryEntries200Response | LookupDictionaryEntriesDefaultResponse,\n): response is LookupDictionaryEntriesDefaultResponse;\nexport function isUnexpected(\n response: LookupDictionaryExamples200Response | LookupDictionaryExamplesDefaultResponse,\n): response is LookupDictionaryExamplesDefaultResponse;\nexport function isUnexpected(\n response:\n | GetSupportedLanguages200Response\n | GetSupportedLanguagesDefaultResponse\n | Translate200Response\n | TranslateDefaultResponse\n | Transliterate200Response\n | TransliterateDefaultResponse\n | FindSentenceBoundaries200Response\n | FindSentenceBoundariesDefaultResponse\n | LookupDictionaryEntries200Response\n | LookupDictionaryEntriesDefaultResponse\n | LookupDictionaryExamples200Response\n | LookupDictionaryExamplesDefaultResponse,\n): response is\n | GetSupportedLanguagesDefaultResponse\n | TranslateDefaultResponse\n | TransliterateDefaultResponse\n | FindSentenceBoundariesDefaultResponse\n | LookupDictionaryEntriesDefaultResponse\n | LookupDictionaryExamplesDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { __rest } from "tslib";
|
|
4
3
|
import { getClient } from "@azure-rest/core-client";
|
|
5
4
|
import { logger } from "./logger.js";
|
|
6
5
|
/**
|
|
@@ -9,19 +8,21 @@ import { logger } from "./logger.js";
|
|
|
9
8
|
* https://api.cognitive.microsofttranslator.com).
|
|
10
9
|
* @param options - the parameter for all optional parameters
|
|
11
10
|
*/
|
|
12
|
-
export default function createClient(endpointParam,
|
|
13
|
-
|
|
14
|
-
var { apiVersion = "3.0" } = _a, options = __rest(_a, ["apiVersion"]);
|
|
15
|
-
const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpointParam}`;
|
|
11
|
+
export default function createClient(endpointParam, { apiVersion = "3.0", ...options } = {}) {
|
|
12
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;
|
|
16
13
|
const userAgentInfo = `azsdk-js-ai-translation-text-rest/1.0.0-beta.1`;
|
|
17
14
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
18
15
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
19
16
|
: `${userAgentInfo}`;
|
|
20
|
-
options =
|
|
17
|
+
options = {
|
|
18
|
+
...options,
|
|
19
|
+
userAgentOptions: {
|
|
21
20
|
userAgentPrefix,
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
},
|
|
22
|
+
loggingOptions: {
|
|
23
|
+
logger: options.loggingOptions?.logger ?? logger.info,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
25
26
|
const client = getClient(endpointUrl, options);
|
|
26
27
|
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
27
28
|
client.pipeline.addPolicy({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textTranslationClient.js","sourceRoot":"","sources":["../../src/textTranslationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
|
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,KAAK,EAAE,GAAG,OAAO,KAAmC,EAAE;IAErE,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,aAAa,EAAE,CAAC;IAC9E,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 = \"3.0\", ...options }: TextTranslationClientOptions = {},\n): TextTranslationClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-ai-translation-text-rest/1.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": "1.0.2-alpha.
|
|
5
|
+
"version": "1.0.2-alpha.20250730.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": [
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"type": "module",
|
|
103
103
|
"tshy": {
|
|
104
|
-
"project": "
|
|
104
|
+
"project": "../../../tsconfig.src.build.json",
|
|
105
105
|
"exports": {
|
|
106
106
|
"./package.json": "./package.json",
|
|
107
107
|
".": "./src/index.ts"
|