@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
|
@@ -0,0 +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,8BAA8B,EAC9B,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EA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F;AAC/F,MAAM,WAAW,wDAAyD,SAAQ,YAAY;IAC5F,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,8BAA8B,CAAC;CACtC"}
|
|
@@ -0,0 +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 TranslationErrorResponseOutput,\n TranslationsStatusOutput,\n DocumentStatusOutput,\n TranslationStatusOutput,\n DocumentsStatusOutput,\n SupportedFileFormatsOutput,\n SupportedStorageSourcesOutput,\n} from \"./outputModels.js\";\n\nexport interface DocumentTranslationStartTranslation202Headers {\n /** Location of batch the operation */\n \"operation-location\"?: string;\n}\n\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 */\nexport interface DocumentTranslationStartTranslation202Response extends HttpResponse {\n status: \"202\";\n headers: RawHttpHeaders & DocumentTranslationStartTranslation202Headers;\n}\n\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 */\nexport interface DocumentTranslationStartTranslation400Response extends HttpResponse {\n status: \"400\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationStartTranslation401Response extends HttpResponse {\n status: \"401\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationStartTranslation429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationStartTranslation500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationStartTranslation503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetTranslationsStatus200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n /** The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control. */\n etag?: string;\n}\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 */\nexport interface DocumentTranslationGetTranslationsStatus200Response extends HttpResponse {\n status: \"200\";\n body: TranslationsStatusOutput;\n headers: RawHttpHeaders & DocumentTranslationGetTranslationsStatus200Headers;\n}\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 */\nexport interface DocumentTranslationGetTranslationsStatus400Response extends HttpResponse {\n status: \"400\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationGetTranslationsStatus401Response extends HttpResponse {\n status: \"401\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationGetTranslationsStatus429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationGetTranslationsStatus500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationGetTranslationsStatus503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetDocumentStatus200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n /** The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control. */\n etag?: string;\n}\n\n/** Returns the translation status for a specific document based on the request Id and document Id. */\nexport interface DocumentTranslationGetDocumentStatus200Response extends HttpResponse {\n status: \"200\";\n body: DocumentStatusOutput;\n headers: RawHttpHeaders & DocumentTranslationGetDocumentStatus200Headers;\n}\n\n/** Returns the translation status for a specific document based on the request Id and document Id. */\nexport interface DocumentTranslationGetDocumentStatus401Response extends HttpResponse {\n status: \"401\";\n body: TranslationErrorResponseOutput;\n}\n\n/** Returns the translation status for a specific document based on the request Id and document Id. */\nexport interface DocumentTranslationGetDocumentStatus404Response extends HttpResponse {\n status: \"404\";\n body: TranslationErrorResponseOutput;\n}\n\n/** Returns the translation status for a specific document based on the request Id and document Id. */\nexport interface DocumentTranslationGetDocumentStatus429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\n/** Returns the translation status for a specific document based on the request Id and document Id. */\nexport interface DocumentTranslationGetDocumentStatus500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\n/** Returns the translation status for a specific document based on the request Id and document Id. */\nexport interface DocumentTranslationGetDocumentStatus503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetTranslationStatus200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n /** The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control. */\n etag?: string;\n}\n\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 */\nexport interface DocumentTranslationGetTranslationStatus200Response extends HttpResponse {\n status: \"200\";\n body: TranslationStatusOutput;\n headers: RawHttpHeaders & DocumentTranslationGetTranslationStatus200Headers;\n}\n\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 */\nexport interface DocumentTranslationGetTranslationStatus401Response extends HttpResponse {\n status: \"401\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetTranslationStatus404Response extends HttpResponse {\n status: \"404\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetTranslationStatus429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetTranslationStatus500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetTranslationStatus503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationCancelTranslation200Response extends HttpResponse {\n status: \"200\";\n body: TranslationStatusOutput;\n}\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 */\nexport interface DocumentTranslationCancelTranslation401Response extends HttpResponse {\n status: \"401\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationCancelTranslation404Response extends HttpResponse {\n status: \"404\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationCancelTranslation429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationCancelTranslation500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\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 */\nexport interface DocumentTranslationCancelTranslation503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetDocumentsStatus200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n /** The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control. */\n etag?: string;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus200Response extends HttpResponse {\n status: \"200\";\n body: DocumentsStatusOutput;\n headers: RawHttpHeaders & DocumentTranslationGetDocumentsStatus200Headers;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus400Response extends HttpResponse {\n status: \"400\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus401Response extends HttpResponse {\n status: \"401\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus404Response extends HttpResponse {\n status: \"404\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetDocumentsStatus503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetSupportedDocumentFormats200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n}\n\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 */\nexport interface DocumentTranslationGetSupportedDocumentFormats200Response extends HttpResponse {\n status: \"200\";\n body: SupportedFileFormatsOutput;\n headers: RawHttpHeaders & DocumentTranslationGetSupportedDocumentFormats200Headers;\n}\n\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 */\nexport interface DocumentTranslationGetSupportedDocumentFormats429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetSupportedDocumentFormats500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\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 */\nexport interface DocumentTranslationGetSupportedDocumentFormats503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetSupportedGlossaryFormats200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n}\n\n/**\n * The list of supported glossary formats supported by the Document Translation service.\n * The list includes the common file extension used.\n */\nexport interface DocumentTranslationGetSupportedGlossaryFormats200Response extends HttpResponse {\n status: \"200\";\n body: SupportedFileFormatsOutput;\n headers: RawHttpHeaders & DocumentTranslationGetSupportedGlossaryFormats200Headers;\n}\n\n/**\n * The list of supported glossary formats supported by the Document Translation service.\n * The list includes the common file extension used.\n */\nexport interface DocumentTranslationGetSupportedGlossaryFormats429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\n/**\n * The list of supported glossary formats supported by the Document Translation service.\n * The list includes the common file extension used.\n */\nexport interface DocumentTranslationGetSupportedGlossaryFormats500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\n/**\n * The list of supported glossary formats supported by the Document Translation service.\n * The list includes the common file extension used.\n */\nexport interface DocumentTranslationGetSupportedGlossaryFormats503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n\nexport interface DocumentTranslationGetSupportedStorageSources200Headers {\n /** Indicates how long to wait before making a new request. */\n \"retry-after\"?: number;\n}\n\n/** Returns a list of storage sources/options supported by the Document Translation service. */\nexport interface DocumentTranslationGetSupportedStorageSources200Response extends HttpResponse {\n status: \"200\";\n body: SupportedStorageSourcesOutput;\n headers: RawHttpHeaders & DocumentTranslationGetSupportedStorageSources200Headers;\n}\n\n/** Returns a list of storage sources/options supported by the Document Translation service. */\nexport interface DocumentTranslationGetSupportedStorageSources429Response extends HttpResponse {\n status: \"429\";\n body: TranslationErrorResponseOutput;\n}\n\n/** Returns a list of storage sources/options supported by the Document Translation service. */\nexport interface DocumentTranslationGetSupportedStorageSources500Response extends HttpResponse {\n status: \"500\";\n body: TranslationErrorResponseOutput;\n}\n\n/** Returns a list of storage sources/options supported by the Document Translation service. */\nexport interface DocumentTranslationGetSupportedStorageSources503Response extends HttpResponse {\n status: \"503\";\n body: TranslationErrorResponseOutput;\n}\n"]}
|
|
@@ -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,KA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C,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,yDAAy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D,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"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
const responseMap = {
|
|
4
|
+
"GET /batches": ["200"],
|
|
5
|
+
"POST /batches": ["202"],
|
|
6
|
+
"GET /batches/{id}/documents/{documentId}": ["200"],
|
|
7
|
+
"GET /batches/{id}": ["200"],
|
|
8
|
+
"DELETE /batches/{id}": ["200"],
|
|
9
|
+
"GET /batches/{id}/documents": ["200"],
|
|
10
|
+
"GET /documents/formats": ["200"],
|
|
11
|
+
"GET /glossaries/formats": ["200"],
|
|
12
|
+
"GET /storagesources": ["200"],
|
|
13
|
+
};
|
|
14
|
+
export function isUnexpected(response) {
|
|
15
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
16
|
+
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
17
|
+
const method = response.request.method;
|
|
18
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
19
|
+
if (!pathDetails) {
|
|
20
|
+
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
21
|
+
}
|
|
22
|
+
return !pathDetails.includes(response.status);
|
|
23
|
+
}
|
|
24
|
+
function getParametrizedPathSuccess(method, path) {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
const pathParts = path.split("/");
|
|
27
|
+
// Traverse list to match the longest candidate
|
|
28
|
+
// matchedLen: the length of candidate path
|
|
29
|
+
// matchedValue: the matched status code array
|
|
30
|
+
let matchedLen = -1, matchedValue = [];
|
|
31
|
+
// Iterate the responseMap to find a match
|
|
32
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
33
|
+
// Extracting the path from the map key which is in format
|
|
34
|
+
// GET /path/foo
|
|
35
|
+
if (!key.startsWith(method)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const candidatePath = getPathFromMapKey(key);
|
|
39
|
+
// Get each part of the url path
|
|
40
|
+
const candidateParts = candidatePath.split("/");
|
|
41
|
+
// track if we have found a match to return the values found.
|
|
42
|
+
let found = true;
|
|
43
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
44
|
+
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
45
|
+
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
46
|
+
// If the current part of the candidate is a "template" part
|
|
47
|
+
// Try to use the suffix of pattern to match the path
|
|
48
|
+
// {guid} ==> $
|
|
49
|
+
// {guid}:export ==> :export$
|
|
50
|
+
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
51
|
+
if (!isMatched) {
|
|
52
|
+
found = false;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
// If the candidate part is not a template and
|
|
58
|
+
// the parts don't match mark the candidate as not found
|
|
59
|
+
// to move on with the next candidate path.
|
|
60
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
61
|
+
found = false;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// We finished evaluating the current candidate parts
|
|
66
|
+
// Update the matched value if and only if we found the longer pattern
|
|
67
|
+
if (found && candidatePath.length > matchedLen) {
|
|
68
|
+
matchedLen = candidatePath.length;
|
|
69
|
+
matchedValue = value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return matchedValue;
|
|
73
|
+
}
|
|
74
|
+
function getPathFromMapKey(mapKey) {
|
|
75
|
+
const pathStart = mapKey.indexOf("/");
|
|
76
|
+
return mapKey.slice(pathStart);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsDlC,MAAM,WAAW,GAA6B;IAC5C,cAAc,EAAE,CAAC,KAAK,CAAC;IACvB,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,mBAAmB,EAAE,CAAC,KAAK,CAAC;IAC5B,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,wBAAwB,EAAE,CAAC,KAAK,CAAC;IACjC,yBAAyB,EAAE,CAAC,KAAK,CAAC;IAClC,qBAAqB,EAAE,CAAC,KAAK,CAAC;CAC/B,CAAC;AA8EF,MAAM,UAAU,YAAY,CAC1B,QAiD4D;IA0C5D,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,0BA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CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,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 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\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /batches\": [\"200\"],\n \"POST /batches\": [\"202\"],\n \"GET /batches/{id}/documents/{documentId}\": [\"200\"],\n \"GET /batches/{id}\": [\"200\"],\n \"DELETE /batches/{id}\": [\"200\"],\n \"GET /batches/{id}/documents\": [\"200\"],\n \"GET /documents/formats\": [\"200\"],\n \"GET /glossaries/formats\": [\"200\"],\n \"GET /storagesources\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | DocumentTranslationStartTranslation202Response\n | DocumentTranslationStartTranslation400Response\n | DocumentTranslationStartTranslation401Response\n | DocumentTranslationStartTranslation429Response\n | DocumentTranslationStartTranslation500Response\n | DocumentTranslationStartTranslation503Response,\n): response is DocumentTranslationStartTranslation400Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetTranslationsStatus200Response\n | DocumentTranslationGetTranslationsStatus400Response\n | DocumentTranslationGetTranslationsStatus401Response\n | DocumentTranslationGetTranslationsStatus429Response\n | DocumentTranslationGetTranslationsStatus500Response\n | DocumentTranslationGetTranslationsStatus503Response,\n): response is DocumentTranslationGetTranslationsStatus400Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetDocumentStatus200Response\n | DocumentTranslationGetDocumentStatus401Response\n | DocumentTranslationGetDocumentStatus404Response\n | DocumentTranslationGetDocumentStatus429Response\n | DocumentTranslationGetDocumentStatus500Response\n | DocumentTranslationGetDocumentStatus503Response,\n): response is DocumentTranslationGetDocumentStatus401Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetTranslationStatus200Response\n | DocumentTranslationGetTranslationStatus401Response\n | DocumentTranslationGetTranslationStatus404Response\n | DocumentTranslationGetTranslationStatus429Response\n | DocumentTranslationGetTranslationStatus500Response\n | DocumentTranslationGetTranslationStatus503Response,\n): response is DocumentTranslationGetTranslationStatus401Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationCancelTranslation200Response\n | DocumentTranslationCancelTranslation401Response\n | DocumentTranslationCancelTranslation404Response\n | DocumentTranslationCancelTranslation429Response\n | DocumentTranslationCancelTranslation500Response\n | DocumentTranslationCancelTranslation503Response,\n): response is DocumentTranslationCancelTranslation401Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetDocumentsStatus200Response\n | DocumentTranslationGetDocumentsStatus400Response\n | DocumentTranslationGetDocumentsStatus401Response\n | DocumentTranslationGetDocumentsStatus404Response\n | DocumentTranslationGetDocumentsStatus429Response\n | DocumentTranslationGetDocumentsStatus500Response\n | DocumentTranslationGetDocumentsStatus503Response,\n): response is DocumentTranslationGetDocumentsStatus400Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetSupportedDocumentFormats200Response\n | DocumentTranslationGetSupportedDocumentFormats429Response\n | DocumentTranslationGetSupportedDocumentFormats500Response\n | DocumentTranslationGetSupportedDocumentFormats503Response,\n): response is DocumentTranslationGetSupportedDocumentFormats429Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetSupportedGlossaryFormats200Response\n | DocumentTranslationGetSupportedGlossaryFormats429Response\n | DocumentTranslationGetSupportedGlossaryFormats500Response\n | DocumentTranslationGetSupportedGlossaryFormats503Response,\n): response is DocumentTranslationGetSupportedGlossaryFormats429Response;\nexport function isUnexpected(\n response:\n | DocumentTranslationGetSupportedStorageSources200Response\n | DocumentTranslationGetSupportedStorageSources429Response\n | DocumentTranslationGetSupportedStorageSources500Response\n | DocumentTranslationGetSupportedStorageSources503Response,\n): response is DocumentTranslationGetSupportedStorageSources429Response;\nexport function isUnexpected(\n response:\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): response is\n | DocumentTranslationStartTranslation400Response\n | DocumentTranslationStartTranslation401Response\n | DocumentTranslationStartTranslation429Response\n | DocumentTranslationStartTranslation500Response\n | DocumentTranslationStartTranslation503Response\n | DocumentTranslationGetTranslationsStatus400Response\n | DocumentTranslationGetTranslationsStatus401Response\n | DocumentTranslationGetTranslationsStatus429Response\n | DocumentTranslationGetTranslationsStatus500Response\n | DocumentTranslationGetTranslationsStatus503Response\n | DocumentTranslationGetDocumentStatus401Response\n | DocumentTranslationGetDocumentStatus404Response\n | DocumentTranslationGetDocumentStatus429Response\n | DocumentTranslationGetDocumentStatus500Response\n | DocumentTranslationGetDocumentStatus503Response\n | DocumentTranslationGetTranslationStatus401Response\n | DocumentTranslationGetTranslationStatus404Response\n | DocumentTranslationGetTranslationStatus429Response\n | DocumentTranslationGetTranslationStatus500Response\n | DocumentTranslationGetTranslationStatus503Response\n | DocumentTranslationCancelTranslation401Response\n | DocumentTranslationCancelTranslation404Response\n | DocumentTranslationCancelTranslation429Response\n | DocumentTranslationCancelTranslation500Response\n | DocumentTranslationCancelTranslation503Response\n | DocumentTranslationGetDocumentsStatus400Response\n | DocumentTranslationGetDocumentsStatus401Response\n | DocumentTranslationGetDocumentsStatus404Response\n | DocumentTranslationGetDocumentsStatus429Response\n | DocumentTranslationGetDocumentsStatus500Response\n | DocumentTranslationGetDocumentsStatus503Response\n | DocumentTranslationGetSupportedDocumentFormats429Response\n | DocumentTranslationGetSupportedDocumentFormats500Response\n | DocumentTranslationGetSupportedDocumentFormats503Response\n | DocumentTranslationGetSupportedGlossaryFormats429Response\n | DocumentTranslationGetSupportedGlossaryFormats500Response\n | DocumentTranslationGetSupportedGlossaryFormats503Response\n | DocumentTranslationGetSupportedStorageSources429Response\n | DocumentTranslationGetSupportedStorageSources500Response\n | DocumentTranslationGetSupportedStorageSources503Response {\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAA+C,CAAC"}
|