@azure-rest/ai-document-translator 1.0.0-alpha.20241121.1 → 1.0.0-alpha.20241125.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +1 -1
  2. package/dist/browser/constants.d.ts +5 -0
  3. package/dist/browser/constants.d.ts.map +1 -0
  4. package/dist/browser/documentTranslator.d.ts +130 -0
  5. package/dist/browser/documentTranslator.d.ts.map +1 -0
  6. package/dist/browser/documentTranslator.js.map +1 -0
  7. package/dist/browser/index.d.ts +11 -0
  8. package/dist/browser/index.d.ts.map +1 -0
  9. package/dist/browser/index.js +14 -0
  10. package/dist/browser/index.js.map +1 -0
  11. package/dist/browser/models.d.ts +189 -0
  12. package/dist/browser/models.d.ts.map +1 -0
  13. package/dist/browser/package.json +3 -0
  14. package/dist/browser/parameters.d.ts +93 -0
  15. package/dist/browser/parameters.d.ts.map +1 -0
  16. package/dist/browser/parameters.js.map +1 -0
  17. package/dist/browser/responses.d.ts +725 -0
  18. package/dist/browser/responses.d.ts.map +1 -0
  19. package/dist/browser/responses.js.map +1 -0
  20. package/dist/commonjs/constants.d.ts +5 -0
  21. package/dist/commonjs/constants.d.ts.map +1 -0
  22. package/dist/commonjs/constants.js +10 -0
  23. package/dist/commonjs/constants.js.map +1 -0
  24. package/dist/commonjs/documentTranslator.d.ts +130 -0
  25. package/dist/commonjs/documentTranslator.d.ts.map +1 -0
  26. package/dist/{index.js → commonjs/documentTranslator.js} +6 -17
  27. package/dist/commonjs/documentTranslator.js.map +1 -0
  28. package/dist/commonjs/index.d.ts +11 -0
  29. package/dist/commonjs/index.d.ts.map +1 -0
  30. package/dist/commonjs/index.js +17 -0
  31. package/dist/commonjs/index.js.map +1 -0
  32. package/dist/commonjs/models.d.ts +189 -0
  33. package/dist/commonjs/models.d.ts.map +1 -0
  34. package/dist/commonjs/models.js +5 -0
  35. package/dist/commonjs/models.js.map +1 -0
  36. package/dist/commonjs/package.json +3 -0
  37. package/dist/commonjs/parameters.d.ts +93 -0
  38. package/dist/commonjs/parameters.d.ts.map +1 -0
  39. package/dist/commonjs/parameters.js +5 -0
  40. package/dist/commonjs/parameters.js.map +1 -0
  41. package/dist/commonjs/responses.d.ts +725 -0
  42. package/dist/commonjs/responses.d.ts.map +1 -0
  43. package/dist/commonjs/responses.js +5 -0
  44. package/dist/commonjs/responses.js.map +1 -0
  45. package/dist/commonjs/tsdoc-metadata.json +11 -0
  46. package/dist/esm/constants.d.ts +5 -0
  47. package/dist/esm/constants.d.ts.map +1 -0
  48. package/dist/esm/constants.js +7 -0
  49. package/dist/esm/constants.js.map +1 -0
  50. package/dist/esm/documentTranslator.d.ts +130 -0
  51. package/dist/esm/documentTranslator.d.ts.map +1 -0
  52. package/dist/esm/documentTranslator.js +13 -0
  53. package/dist/esm/documentTranslator.js.map +1 -0
  54. package/dist/esm/index.d.ts +11 -0
  55. package/dist/esm/index.d.ts.map +1 -0
  56. package/dist/esm/index.js +14 -0
  57. package/dist/esm/index.js.map +1 -0
  58. package/dist/esm/models.d.ts +189 -0
  59. package/dist/esm/models.d.ts.map +1 -0
  60. package/dist/esm/models.js +4 -0
  61. package/dist/esm/models.js.map +1 -0
  62. package/dist/esm/package.json +3 -0
  63. package/dist/esm/parameters.d.ts +93 -0
  64. package/dist/esm/parameters.d.ts.map +1 -0
  65. package/dist/esm/parameters.js +4 -0
  66. package/dist/esm/parameters.js.map +1 -0
  67. package/dist/esm/responses.d.ts +725 -0
  68. package/dist/esm/responses.d.ts.map +1 -0
  69. package/dist/esm/responses.js +4 -0
  70. package/dist/esm/responses.js.map +1 -0
  71. package/dist/react-native/constants.d.ts +5 -0
  72. package/dist/react-native/constants.d.ts.map +1 -0
  73. package/dist/react-native/constants.js +7 -0
  74. package/dist/react-native/constants.js.map +1 -0
  75. package/dist/react-native/documentTranslator.d.ts +130 -0
  76. package/dist/react-native/documentTranslator.d.ts.map +1 -0
  77. package/dist/react-native/documentTranslator.js +13 -0
  78. package/dist/react-native/documentTranslator.js.map +1 -0
  79. package/dist/react-native/index.d.ts +11 -0
  80. package/dist/react-native/index.d.ts.map +1 -0
  81. package/dist/react-native/index.js +14 -0
  82. package/dist/react-native/index.js.map +1 -0
  83. package/dist/react-native/models.d.ts +189 -0
  84. package/dist/react-native/models.d.ts.map +1 -0
  85. package/dist/react-native/models.js +4 -0
  86. package/dist/react-native/models.js.map +1 -0
  87. package/dist/react-native/package.json +3 -0
  88. package/dist/react-native/parameters.d.ts +93 -0
  89. package/dist/react-native/parameters.d.ts.map +1 -0
  90. package/dist/react-native/parameters.js +4 -0
  91. package/dist/react-native/parameters.js.map +1 -0
  92. package/dist/react-native/responses.d.ts +725 -0
  93. package/dist/react-native/responses.d.ts.map +1 -0
  94. package/dist/react-native/responses.js +4 -0
  95. package/dist/react-native/responses.js.map +1 -0
  96. package/package.json +66 -44
  97. package/dist/index.js.map +0 -1
  98. package/dist-esm/src/documentTranslator.js.map +0 -1
  99. package/dist-esm/src/index.js +0 -13
  100. package/dist-esm/src/index.js.map +0 -1
  101. package/dist-esm/src/parameters.js.map +0 -1
  102. package/dist-esm/src/responses.js.map +0 -1
  103. /package/{types → dist}/ai-document-translator.d.ts +0 -0
  104. /package/{dist-esm/src → dist/browser}/constants.js +0 -0
  105. /package/{dist-esm/src → dist/browser}/constants.js.map +0 -0
  106. /package/{dist-esm/src → dist/browser}/documentTranslator.js +0 -0
  107. /package/{dist-esm/src → dist/browser}/models.js +0 -0
  108. /package/{dist-esm/src → dist/browser}/models.js.map +0 -0
  109. /package/{dist-esm/src → dist/browser}/parameters.js +0 -0
  110. /package/{dist-esm/src → dist/browser}/responses.js +0 -0
package/README.md CHANGED
@@ -197,7 +197,7 @@ Please refer to the samples folder to see code samples, including:
197
197
 
198
198
  Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
199
199
 
200
- ```javascript
200
+ ```ts
201
201
  import { setLogLevel } from "@azure/logger";
202
202
 
203
203
  setLogLevel("info");
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const SDK_VERSION: string;
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAuB,CAAC"}
@@ -0,0 +1,130 @@
1
+ import type { CancelTranslation200Response, CancelTranslation401Response, CancelTranslation404Response, CancelTranslation429Response, CancelTranslation500Response, CancelTranslation503Response, GetDocumentStatus200Response, GetDocumentStatus401Response, GetDocumentStatus404Response, GetDocumentStatus429Response, GetDocumentStatus500Response, GetDocumentStatus503Response, GetDocumentsStatus200Response, GetDocumentsStatus400Response, GetDocumentsStatus401Response, GetDocumentsStatus404Response, GetDocumentsStatus429Response, GetDocumentsStatus500Response, GetDocumentsStatus503Response, GetSupportedDocumentFormats200Response, GetSupportedDocumentFormats429Response, GetSupportedDocumentFormats500Response, GetSupportedDocumentFormats503Response, GetSupportedGlossaryFormats200Response, GetSupportedGlossaryFormats429Response, GetSupportedGlossaryFormats500Response, GetSupportedGlossaryFormats503Response, GetSupportedStorageSources200Response, GetSupportedStorageSources429Response, GetSupportedStorageSources500Response, GetSupportedStorageSources503Response, GetTranslationStatus200Response, GetTranslationStatus401Response, GetTranslationStatus404Response, GetTranslationStatus429Response, GetTranslationStatus500Response, GetTranslationStatus503Response, GetTranslationsStatus200Response, GetTranslationsStatus400Response, GetTranslationsStatus401Response, GetTranslationsStatus429Response, GetTranslationsStatus500Response, GetTranslationsStatus503Response, StartTranslation202Response, StartTranslation400Response, StartTranslation401Response, StartTranslation429Response, StartTranslation500Response, StartTranslation503Response } from "./responses.js";
2
+ import type { CancelTranslationParameters, GetDocumentStatusParameters, GetDocumentsStatusParameters, GetSupportedDocumentFormatsParameters, GetSupportedGlossaryFormatsParameters, GetSupportedStorageSourcesParameters, GetTranslationStatusParameters, GetTranslationsStatusParameters, StartTranslationParameters } from "./parameters.js";
3
+ import type { Client, ClientOptions } from "@azure-rest/core-client";
4
+ import type { KeyCredential, TokenCredential } from "@azure/core-auth";
5
+ export interface GetTranslationsStatus {
6
+ /**
7
+ * Use this API to submit a bulk (batch) translation request to the Document Translation service.
8
+ * Each request can contain multiple documents and must contain a source and destination container for each document.
9
+ *
10
+ * The prefix and suffix filter (if supplied) are used to filter folders. The prefix is applied to the subpath after the container name.
11
+ *
12
+ * Glossaries / Translation memory can be included in the request and are applied by the service when the document is translated.
13
+ *
14
+ * If the glossary is invalid or unreachable during translation, an error is indicated in the document status.
15
+ * 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.
16
+ */
17
+ post(options: StartTranslationParameters): Promise<StartTranslation202Response | StartTranslation400Response | StartTranslation401Response | StartTranslation429Response | StartTranslation500Response | StartTranslation503Response>;
18
+ /**
19
+ * Returns a list of batch requests submitted and the status for each request.
20
+ * This list only contains batch requests submitted by the user (based on the resource).
21
+ *
22
+ * 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.
23
+ * The absence of a continuation token means that no additional pages are available.
24
+ *
25
+ * $top, $skip and $maxpagesize query parameters can be used to specify a number of results to return and an offset for the collection.
26
+ *
27
+ * $top indicates the total number of records the user wants to be returned across all pages.
28
+ * $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.
29
+ * $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.
30
+ *
31
+ * $orderBy query parameter can be used to sort the returned list (ex "$orderBy=createdDateTimeUtc asc" or "$orderBy=createdDateTimeUtc desc").
32
+ * The default sorting is descending by createdDateTimeUtc.
33
+ * Some query parameters can be used to filter the returned list (ex: "status=Succeeded,Cancelled") will only return succeeded and cancelled operations.
34
+ * createdDateTimeUtcStart and createdDateTimeUtcEnd can be used combined or separately to specify a range of datetime to filter the returned list by.
35
+ * The supported filtering query parameters are (status, ids, createdDateTimeUtcStart, createdDateTimeUtcEnd).
36
+ *
37
+ * 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.
38
+ *
39
+ * When both $top and $skip are included, the server should first apply $skip and then $top on the collection.
40
+ * 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.
41
+ * This reduces the risk of the client making assumptions about the data returned.
42
+ */
43
+ get(options?: GetTranslationsStatusParameters): Promise<GetTranslationsStatus200Response | GetTranslationsStatus400Response | GetTranslationsStatus401Response | GetTranslationsStatus429Response | GetTranslationsStatus500Response | GetTranslationsStatus503Response>;
44
+ }
45
+ export interface GetDocumentStatus {
46
+ /** Returns the translation status for a specific document based on the request Id and document Id. */
47
+ get(options?: GetDocumentStatusParameters): Promise<GetDocumentStatus200Response | GetDocumentStatus401Response | GetDocumentStatus404Response | GetDocumentStatus429Response | GetDocumentStatus500Response | GetDocumentStatus503Response>;
48
+ }
49
+ export interface CancelTranslation {
50
+ /**
51
+ * Returns the status for a document translation request.
52
+ * The status includes the overall request status, as well as the status for documents that are being translated as part of that request.
53
+ */
54
+ get(options?: GetTranslationStatusParameters): Promise<GetTranslationStatus200Response | GetTranslationStatus401Response | GetTranslationStatus404Response | GetTranslationStatus429Response | GetTranslationStatus500Response | GetTranslationStatus503Response>;
55
+ /**
56
+ * Cancel a currently processing or queued translation.
57
+ * Cancel a currently processing or queued translation.
58
+ * A translation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned.
59
+ * All documents that have completed translation will not be cancelled and will be charged.
60
+ * All pending documents will be cancelled if possible.
61
+ */
62
+ delete(options?: CancelTranslationParameters): Promise<CancelTranslation200Response | CancelTranslation401Response | CancelTranslation404Response | CancelTranslation429Response | CancelTranslation500Response | CancelTranslation503Response>;
63
+ }
64
+ export interface GetDocumentsStatus {
65
+ /**
66
+ * Returns the status for all documents in a batch document translation request.
67
+ *
68
+ * If the number of documents in the response exceeds our paging limit, server-side paging is used.
69
+ * 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.
70
+ *
71
+ * $top, $skip and $maxpagesize query parameters can be used to specify a number of results to return and an offset for the collection.
72
+ *
73
+ * $top indicates the total number of records the user wants to be returned across all pages.
74
+ * $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.
75
+ * $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.
76
+ *
77
+ * $orderBy query parameter can be used to sort the returned list (ex "$orderBy=createdDateTimeUtc asc" or "$orderBy=createdDateTimeUtc desc").
78
+ * The default sorting is descending by createdDateTimeUtc.
79
+ * Some query parameters can be used to filter the returned list (ex: "status=Succeeded,Cancelled") will only return succeeded and cancelled documents.
80
+ * createdDateTimeUtcStart and createdDateTimeUtcEnd can be used combined or separately to specify a range of datetime to filter the returned list by.
81
+ * The supported filtering query parameters are (status, ids, createdDateTimeUtcStart, createdDateTimeUtcEnd).
82
+ *
83
+ * When both $top and $skip are included, the server should first apply $skip and then $top on the collection.
84
+ * 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.
85
+ * This reduces the risk of the client making assumptions about the data returned.
86
+ */
87
+ get(options?: GetDocumentsStatusParameters): Promise<GetDocumentsStatus200Response | GetDocumentsStatus400Response | GetDocumentsStatus401Response | GetDocumentsStatus404Response | GetDocumentsStatus429Response | GetDocumentsStatus500Response | GetDocumentsStatus503Response>;
88
+ }
89
+ export interface GetSupportedDocumentFormats {
90
+ /**
91
+ * The list of supported document formats supported by the Document Translation service.
92
+ * The list includes the common file extension, as well as the content-type if using the upload API.
93
+ */
94
+ get(options?: GetSupportedDocumentFormatsParameters): Promise<GetSupportedDocumentFormats200Response | GetSupportedDocumentFormats429Response | GetSupportedDocumentFormats500Response | GetSupportedDocumentFormats503Response>;
95
+ }
96
+ export interface GetSupportedGlossaryFormats {
97
+ /**
98
+ * The list of supported glossary formats supported by the Document Translation service.
99
+ * The list includes the common file extension used.
100
+ */
101
+ get(options?: GetSupportedGlossaryFormatsParameters): Promise<GetSupportedGlossaryFormats200Response | GetSupportedGlossaryFormats429Response | GetSupportedGlossaryFormats500Response | GetSupportedGlossaryFormats503Response>;
102
+ }
103
+ export interface GetSupportedStorageSources {
104
+ /** Returns a list of storage sources/options supported by the Document Translation service. */
105
+ get(options?: GetSupportedStorageSourcesParameters): Promise<GetSupportedStorageSources200Response | GetSupportedStorageSources429Response | GetSupportedStorageSources500Response | GetSupportedStorageSources503Response>;
106
+ }
107
+ export interface Routes {
108
+ /** Resource for '/batches' has methods for the following verbs: post, get */
109
+ (path: "/batches"): GetTranslationsStatus;
110
+ /** Resource for '/batches/\{id\}/documents/\{documentId\}' has methods for the following verbs: get */
111
+ (path: "/batches/{id}/documents/{documentId}", id: string, documentId: string): GetDocumentStatus;
112
+ /** Resource for '/batches/\{id\}' has methods for the following verbs: get, delete */
113
+ (path: "/batches/{id}", id: string): CancelTranslation;
114
+ /** Resource for '/batches/\{id\}/documents' has methods for the following verbs: get */
115
+ (path: "/batches/{id}/documents", id: string): GetDocumentsStatus;
116
+ /** Resource for '/documents/formats' has methods for the following verbs: get */
117
+ (path: "/documents/formats"): GetSupportedDocumentFormats;
118
+ /** Resource for '/glossaries/formats' has methods for the following verbs: get */
119
+ (path: "/glossaries/formats"): GetSupportedGlossaryFormats;
120
+ /** Resource for '/storagesources' has methods for the following verbs: get */
121
+ (path: "/storagesources"): GetSupportedStorageSources;
122
+ }
123
+ export type DocumentTranslatorClient = Client & {
124
+ path: Routes;
125
+ };
126
+ export interface DocumentTranslatorFactory {
127
+ (endpoint: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): void;
128
+ }
129
+ export default function DocumentTranslator(endpoint: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): DocumentTranslatorClient;
130
+ //# sourceMappingURL=documentTranslator.d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AAE,eAAe,GAAG,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACjG;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,GAAG,aAAa,EAC5C,OAAO,GAAE,aAAkB,GAC1B,wBAAwB,CAW1B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentTranslator.js","sourceRoot":"","sources":["../../src/documentTranslator.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiElC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAqNpD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,QAAgB,EAChB,WAA4C,EAC5C,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,6BAA6B,CAAC;IAC5E,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,8CAA8C,CAAC;YACxD,gBAAgB,EAAE,2BAA2B;SAC9C,GACF,CAAC;IAEF,OAAO,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA6B,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CancelTranslation200Response,\n CancelTranslation401Response,\n CancelTranslation404Response,\n CancelTranslation429Response,\n CancelTranslation500Response,\n CancelTranslation503Response,\n GetDocumentStatus200Response,\n GetDocumentStatus401Response,\n GetDocumentStatus404Response,\n GetDocumentStatus429Response,\n GetDocumentStatus500Response,\n GetDocumentStatus503Response,\n GetDocumentsStatus200Response,\n GetDocumentsStatus400Response,\n GetDocumentsStatus401Response,\n GetDocumentsStatus404Response,\n GetDocumentsStatus429Response,\n GetDocumentsStatus500Response,\n GetDocumentsStatus503Response,\n GetSupportedDocumentFormats200Response,\n GetSupportedDocumentFormats429Response,\n GetSupportedDocumentFormats500Response,\n GetSupportedDocumentFormats503Response,\n GetSupportedGlossaryFormats200Response,\n GetSupportedGlossaryFormats429Response,\n GetSupportedGlossaryFormats500Response,\n GetSupportedGlossaryFormats503Response,\n GetSupportedStorageSources200Response,\n GetSupportedStorageSources429Response,\n GetSupportedStorageSources500Response,\n GetSupportedStorageSources503Response,\n GetTranslationStatus200Response,\n GetTranslationStatus401Response,\n GetTranslationStatus404Response,\n GetTranslationStatus429Response,\n GetTranslationStatus500Response,\n GetTranslationStatus503Response,\n GetTranslationsStatus200Response,\n GetTranslationsStatus400Response,\n GetTranslationsStatus401Response,\n GetTranslationsStatus429Response,\n GetTranslationsStatus500Response,\n GetTranslationsStatus503Response,\n StartTranslation202Response,\n StartTranslation400Response,\n StartTranslation401Response,\n StartTranslation429Response,\n StartTranslation500Response,\n StartTranslation503Response,\n} from \"./responses.js\";\nimport type {\n CancelTranslationParameters,\n GetDocumentStatusParameters,\n GetDocumentsStatusParameters,\n GetSupportedDocumentFormatsParameters,\n GetSupportedGlossaryFormatsParameters,\n GetSupportedStorageSourcesParameters,\n GetTranslationStatusParameters,\n GetTranslationsStatusParameters,\n StartTranslationParameters,\n} from \"./parameters.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\n\nexport interface GetTranslationsStatus {\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: StartTranslationParameters,\n ): Promise<\n | StartTranslation202Response\n | StartTranslation400Response\n | StartTranslation401Response\n | StartTranslation429Response\n | StartTranslation500Response\n | StartTranslation503Response\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?: GetTranslationsStatusParameters,\n ): Promise<\n | GetTranslationsStatus200Response\n | GetTranslationsStatus400Response\n | GetTranslationsStatus401Response\n | GetTranslationsStatus429Response\n | GetTranslationsStatus500Response\n | GetTranslationsStatus503Response\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?: GetDocumentStatusParameters,\n ): Promise<\n | GetDocumentStatus200Response\n | GetDocumentStatus401Response\n | GetDocumentStatus404Response\n | GetDocumentStatus429Response\n | GetDocumentStatus500Response\n | GetDocumentStatus503Response\n >;\n}\n\nexport interface CancelTranslation {\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?: GetTranslationStatusParameters,\n ): Promise<\n | GetTranslationStatus200Response\n | GetTranslationStatus401Response\n | GetTranslationStatus404Response\n | GetTranslationStatus429Response\n | GetTranslationStatus500Response\n | GetTranslationStatus503Response\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?: CancelTranslationParameters,\n ): Promise<\n | CancelTranslation200Response\n | CancelTranslation401Response\n | CancelTranslation404Response\n | CancelTranslation429Response\n | CancelTranslation500Response\n | CancelTranslation503Response\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?: GetDocumentsStatusParameters,\n ): Promise<\n | GetDocumentsStatus200Response\n | GetDocumentsStatus400Response\n | GetDocumentsStatus401Response\n | GetDocumentsStatus404Response\n | GetDocumentsStatus429Response\n | GetDocumentsStatus500Response\n | GetDocumentsStatus503Response\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?: GetSupportedDocumentFormatsParameters,\n ): Promise<\n | GetSupportedDocumentFormats200Response\n | GetSupportedDocumentFormats429Response\n | GetSupportedDocumentFormats500Response\n | GetSupportedDocumentFormats503Response\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?: GetSupportedGlossaryFormatsParameters,\n ): Promise<\n | GetSupportedGlossaryFormats200Response\n | GetSupportedGlossaryFormats429Response\n | GetSupportedGlossaryFormats500Response\n | GetSupportedGlossaryFormats503Response\n >;\n}\n\nexport interface GetSupportedStorageSources {\n /** Returns a list of storage sources/options supported by the Document Translation service. */\n get(\n options?: GetSupportedStorageSourcesParameters,\n ): Promise<\n | GetSupportedStorageSources200Response\n | GetSupportedStorageSources429Response\n | GetSupportedStorageSources500Response\n | GetSupportedStorageSources503Response\n >;\n}\n\nexport interface Routes {\n /** Resource for '/batches' has methods for the following verbs: post, get */\n (path: \"/batches\"): GetTranslationsStatus;\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): CancelTranslation;\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\nexport interface DocumentTranslatorFactory {\n (endpoint: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): void;\n}\n\nexport default function DocumentTranslator(\n endpoint: string,\n credentials: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): DocumentTranslatorClient {\n const baseUrl = options.baseUrl ?? `${endpoint}/translator/text/batch/v1.0`;\n options = {\n ...options,\n credentials: {\n scopes: [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: \"Ocp-Apim-Subscription-Key\",\n },\n };\n\n return getClient(baseUrl, credentials, options) as DocumentTranslatorClient;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A rest library for working with the Azure Document Translator service.
3
+ * @packageDocumentation
4
+ */
5
+ import DocumentTranslator from "./documentTranslator.js";
6
+ export * from "./documentTranslator.js";
7
+ export * from "./models.js";
8
+ export * from "./parameters.js";
9
+ export * from "./responses.js";
10
+ export default DocumentTranslator;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * A rest library for working with the Azure Document Translator service.
5
+ * @packageDocumentation
6
+ */
7
+ import DocumentTranslator from "./documentTranslator.js";
8
+ export * from "./documentTranslator.js";
9
+ export * from "./models.js";
10
+ export * from "./parameters.js";
11
+ export * from "./responses.js";
12
+ // eslint-disable-next-line @azure/azure-sdk/ts-modules-only-named
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;;;GAGG;AAEH,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,kEAAkE;AAClE,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * A rest library for working with the Azure Document Translator service.\n * @packageDocumentation\n */\n\nimport DocumentTranslator from \"./documentTranslator.js\";\nexport * from \"./documentTranslator.js\";\nexport * from \"./models.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\n// eslint-disable-next-line @azure/azure-sdk/ts-modules-only-named\nexport default DocumentTranslator;\n"]}
@@ -0,0 +1,189 @@
1
+ export interface StartTranslationDetails {
2
+ /** The input list of documents or folders containing documents */
3
+ inputs: BatchRequest[];
4
+ }
5
+ export interface BatchRequest {
6
+ /** Source of the input documents */
7
+ source: SourceInput;
8
+ /** Location of the destination for the output */
9
+ targets: TargetInput[];
10
+ /** Storage type of the input documents source string */
11
+ storageType?: StorageInputType;
12
+ }
13
+ export interface SourceInput {
14
+ /** Location of the folder / container or single file with your documents */
15
+ sourceUrl: string;
16
+ /** */
17
+ filter?: DocumentFilter;
18
+ /**
19
+ * Language code
20
+ * If none is specified, we will perform auto detect on the document
21
+ */
22
+ language?: string;
23
+ /** Storage Source */
24
+ storageSource?: StorageSource;
25
+ }
26
+ export interface DocumentFilter {
27
+ /**
28
+ * A case-sensitive prefix string to filter documents in the source path for translation.
29
+ * For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for translation.
30
+ */
31
+ prefix?: string;
32
+ /**
33
+ * A case-sensitive suffix string to filter documents in the source path for translation.
34
+ * This is most often use for file extensions
35
+ */
36
+ suffix?: string;
37
+ }
38
+ export interface TargetInput {
39
+ /** Location of the folder / container with your documents */
40
+ targetUrl: string;
41
+ /** Category / custom system for translation request */
42
+ category?: string;
43
+ /** Target Language */
44
+ language: string;
45
+ /** List of Glossary */
46
+ glossaries?: Glossary[];
47
+ /** Storage Source */
48
+ storageSource?: StorageSource;
49
+ }
50
+ export interface Glossary {
51
+ /**
52
+ * Location of the glossary.
53
+ * We will use the file extension to extract the formatting if the format parameter is not supplied.
54
+ *
55
+ * If the translation language pair is not present in the glossary, it will not be applied
56
+ */
57
+ glossaryUrl: string;
58
+ /** Format */
59
+ format: string;
60
+ /** Optional Version. If not specified, default is used. */
61
+ version?: string;
62
+ /** Storage Source */
63
+ storageSource?: StorageSource;
64
+ }
65
+ export interface TranslationErrorResponse {
66
+ /** This contains an outer error with error code, message, details, target and an inner error with more descriptive details. */
67
+ error?: TranslationError;
68
+ }
69
+ export interface TranslationError {
70
+ /** Enums containing high level error codes. */
71
+ code: TranslationErrorCode;
72
+ /** Gets high level error message. */
73
+ message: string;
74
+ /**
75
+ * Gets the source of the error.
76
+ * For example it would be "documents" or "document id" in case of invalid document.
77
+ */
78
+ target?: string;
79
+ /**
80
+ * New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow.
81
+ * This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).
82
+ */
83
+ innerError?: InnerTranslationError;
84
+ }
85
+ export interface InnerTranslationError {
86
+ /** Gets code error string. */
87
+ code: string;
88
+ /** Gets high level error message. */
89
+ message: string;
90
+ /**
91
+ * Gets the source of the error.
92
+ * For example it would be "documents" or "document id" in case of invalid document.
93
+ */
94
+ target?: string;
95
+ /**
96
+ * New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow.
97
+ * This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).
98
+ */
99
+ innerError?: InnerTranslationError;
100
+ }
101
+ export interface TranslationsStatus {
102
+ /** The summary status of individual operation */
103
+ value: TranslationStatus[];
104
+ /** Url for the next page. Null if no more pages available */
105
+ nextLink?: string;
106
+ }
107
+ export interface TranslationStatus {
108
+ /** Id of the operation. */
109
+ id: string;
110
+ /** Operation created date time */
111
+ createdDateTimeUtc: Date;
112
+ /** Date time in which the operation's status has been updated */
113
+ lastActionDateTimeUtc: Date;
114
+ /** List of possible statuses for job or document */
115
+ status: Status;
116
+ /** This contains an outer error with error code, message, details, target and an inner error with more descriptive details. */
117
+ error?: TranslationError;
118
+ /** */
119
+ summary: StatusSummary;
120
+ }
121
+ export interface StatusSummary {
122
+ /** Total count */
123
+ total: number;
124
+ /** Failed count */
125
+ failed: number;
126
+ /** Number of Success */
127
+ success: number;
128
+ /** Number of in progress */
129
+ inProgress: number;
130
+ /** Count of not yet started */
131
+ notYetStarted: number;
132
+ /** Number of cancelled */
133
+ cancelled: number;
134
+ /** Total characters charged by the API */
135
+ totalCharacterCharged: number;
136
+ }
137
+ export interface DocumentStatus {
138
+ /** Location of the document or folder */
139
+ path?: string;
140
+ /** Location of the source document */
141
+ sourcePath: string;
142
+ /** Operation created date time */
143
+ createdDateTimeUtc: Date;
144
+ /** Date time in which the operation's status has been updated */
145
+ lastActionDateTimeUtc: Date;
146
+ /** List of possible statuses for job or document */
147
+ status: Status;
148
+ /** To language */
149
+ to: string;
150
+ /** This contains an outer error with error code, message, details, target and an inner error with more descriptive details. */
151
+ error?: TranslationError;
152
+ /** Progress of the translation if available */
153
+ progress: number;
154
+ /** Document Id */
155
+ id: string;
156
+ /** Character charged by the API */
157
+ characterCharged?: number;
158
+ }
159
+ export interface DocumentsStatus {
160
+ /** The detail status of individual documents */
161
+ value: DocumentStatus[];
162
+ /** Url for the next page. Null if no more pages available */
163
+ nextLink?: string;
164
+ }
165
+ export interface SupportedFileFormats {
166
+ /** list of objects */
167
+ value: FileFormat[];
168
+ }
169
+ export interface FileFormat {
170
+ /** Name of the format */
171
+ format: string;
172
+ /** Supported file extension for this format */
173
+ fileExtensions: string[];
174
+ /** Supported Content-Types for this format */
175
+ contentTypes: string[];
176
+ /** Default version if none is specified */
177
+ defaultVersion?: string;
178
+ /** Supported Version */
179
+ versions?: string[];
180
+ }
181
+ export interface SupportedStorageSources {
182
+ /** list of objects */
183
+ value: "AzureBlob"[];
184
+ }
185
+ export type StorageSource = "AzureBlob";
186
+ export type StorageInputType = "Folder" | "File";
187
+ export type TranslationErrorCode = "InvalidRequest" | "InvalidArgument" | "InternalServerError" | "ServiceUnavailable" | "ResourceNotFound" | "Unauthorized" | "RequestRateTooHigh";
188
+ export type Status = "NotStarted" | "Running" | "Succeeded" | "Failed" | "Cancelled" | "Cancelling" | "ValidationFailed";
189
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,kEAAkE;IAClE,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,MAAM,EAAE,WAAW,CAAC;IACpB,iDAAiD;IACjD,OAAO,EAAE,WAAW,EAAE,CAAC;IAC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 {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,93 @@
1
+ import type { RequestParameters } from "@azure-rest/core-client";
2
+ import type { StartTranslationDetails } from "./models.js";
3
+ export interface StartTranslationBodyParam {
4
+ body: StartTranslationDetails;
5
+ }
6
+ export type StartTranslationParameters = RequestParameters & StartTranslationBodyParam;
7
+ export interface GetTranslationsStatusQueryParamProperties {
8
+ /**
9
+ * $top indicates the total number of records the user wants to be returned across all pages.
10
+ *
11
+ * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.
12
+ * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.
13
+ *
14
+ * 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.
15
+ */
16
+ $top?: number;
17
+ /**
18
+ * $skip indicates the number of records to skip from the list of records held by the server based on the sorting method specified. By default, we sort by descending start time.
19
+ *
20
+ * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.
21
+ * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.
22
+ *
23
+ * 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.
24
+ */
25
+ $skip?: number;
26
+ /**
27
+ * $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.
28
+ *
29
+ * Clients MAY request server-driven paging with a specific page size by specifying a $maxpagesize preference. The server SHOULD honor this preference if the specified page size is smaller than the server's default page size.
30
+ */
31
+ $maxpagesize?: number;
32
+ /** Ids to use in filtering */
33
+ ids?: string[];
34
+ /** Statuses to use in filtering */
35
+ statuses?: string[];
36
+ /** the start datetime to get items after */
37
+ createdDateTimeUtcStart?: Date;
38
+ /** the end datetime to get items before */
39
+ createdDateTimeUtcEnd?: Date;
40
+ /** the sorting query for the collection (ex: 'CreatedDateTimeUtc asc', 'CreatedDateTimeUtc desc') */
41
+ $orderBy?: string[];
42
+ }
43
+ export interface GetTranslationsStatusQueryParam {
44
+ queryParameters?: GetTranslationsStatusQueryParamProperties;
45
+ }
46
+ export type GetTranslationsStatusParameters = RequestParameters & GetTranslationsStatusQueryParam;
47
+ export type GetDocumentStatusParameters = RequestParameters;
48
+ export type GetTranslationStatusParameters = RequestParameters;
49
+ export type CancelTranslationParameters = RequestParameters;
50
+ export interface GetDocumentsStatusQueryParamProperties {
51
+ /**
52
+ * $top indicates the total number of records the user wants to be returned across all pages.
53
+ *
54
+ * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.
55
+ * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.
56
+ *
57
+ * 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.
58
+ */
59
+ $top?: number;
60
+ /**
61
+ * $skip indicates the number of records to skip from the list of records held by the server based on the sorting method specified. By default, we sort by descending start time.
62
+ *
63
+ * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.
64
+ * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.
65
+ *
66
+ * 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.
67
+ */
68
+ $skip?: number;
69
+ /**
70
+ * $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.
71
+ *
72
+ * Clients MAY request server-driven paging with a specific page size by specifying a $maxpagesize preference. The server SHOULD honor this preference if the specified page size is smaller than the server's default page size.
73
+ */
74
+ $maxpagesize?: number;
75
+ /** Ids to use in filtering */
76
+ ids?: string[];
77
+ /** Statuses to use in filtering */
78
+ statuses?: string[];
79
+ /** the start datetime to get items after */
80
+ createdDateTimeUtcStart?: Date;
81
+ /** the end datetime to get items before */
82
+ createdDateTimeUtcEnd?: Date;
83
+ /** the sorting query for the collection (ex: 'CreatedDateTimeUtc asc', 'CreatedDateTimeUtc desc') */
84
+ $orderBy?: string[];
85
+ }
86
+ export interface GetDocumentsStatusQueryParam {
87
+ queryParameters?: GetDocumentsStatusQueryParamProperties;
88
+ }
89
+ export type GetDocumentsStatusParameters = RequestParameters & GetDocumentsStatusQueryParam;
90
+ export type GetSupportedDocumentFormatsParameters = RequestParameters;
91
+ export type GetSupportedGlossaryFormatsParameters = RequestParameters;
92
+ export type GetSupportedStorageSourcesParameters = RequestParameters;
93
+ //# sourceMappingURL=parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,uBAAuB,CAAC;CAC/B;AAED,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,GAAG,yBAAyB,CAAC;AAEvF,MAAM,WAAW,yCAAyC;IACxD;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,4CAA4C;IAC5C,uBAAuB,CAAC,EAAE,IAAI,CAAC;IAC/B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,IAAI,CAAC;IAC7B,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,+BAA+B;IAC9C,eAAe,CAAC,EAAE,yCAAyC,CAAC;CAC7D;AAED,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,GAAG,+BAA+B,CAAC;AAClG,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;AAC5D,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;AAC/D,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;AAE5D,MAAM,WAAW,sCAAsC;IACrD;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,4CAA4C;IAC5C,uBAAuB,CAAC,EAAE,IAAI,CAAC;IAC/B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,IAAI,CAAC;IAC7B,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,sCAAsC,CAAC;CAC1D;AAED,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,GAAG,4BAA4B,CAAC;AAC5F,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,CAAC;AACtE,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,CAAC;AACtE,MAAM,MAAM,oCAAoC,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { StartTranslationDetails } from \"./models.js\";\n\nexport interface StartTranslationBodyParam {\n body: StartTranslationDetails;\n}\n\nexport type StartTranslationParameters = RequestParameters & StartTranslationBodyParam;\n\nexport interface GetTranslationsStatusQueryParamProperties {\n /**\n * $top indicates the total number of records the user wants to be returned across all pages.\n *\n * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\n * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\n *\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 */\n $top?: number;\n /**\n * $skip indicates the number of records to skip from the list of records held by the server based on the sorting method specified. By default, we sort by descending start time.\n *\n * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\n * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\n *\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 */\n $skip?: number;\n /**\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 * Clients MAY request server-driven paging with a specific page size by specifying a $maxpagesize preference. The server SHOULD honor this preference if the specified page size is smaller than the server's default page size.\n */\n $maxpagesize?: number;\n /** Ids to use in filtering */\n ids?: string[];\n /** Statuses to use in filtering */\n statuses?: string[];\n /** the start datetime to get items after */\n createdDateTimeUtcStart?: Date;\n /** the end datetime to get items before */\n createdDateTimeUtcEnd?: Date;\n /** the sorting query for the collection (ex: 'CreatedDateTimeUtc asc', 'CreatedDateTimeUtc desc') */\n $orderBy?: string[];\n}\n\nexport interface GetTranslationsStatusQueryParam {\n queryParameters?: GetTranslationsStatusQueryParamProperties;\n}\n\nexport type GetTranslationsStatusParameters = RequestParameters & GetTranslationsStatusQueryParam;\nexport type GetDocumentStatusParameters = RequestParameters;\nexport type GetTranslationStatusParameters = RequestParameters;\nexport type CancelTranslationParameters = RequestParameters;\n\nexport interface GetDocumentsStatusQueryParamProperties {\n /**\n * $top indicates the total number of records the user wants to be returned across all pages.\n *\n * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\n * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\n *\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 */\n $top?: number;\n /**\n * $skip indicates the number of records to skip from the list of records held by the server based on the sorting method specified. By default, we sort by descending start time.\n *\n * Clients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\n * When both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\n *\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 */\n $skip?: number;\n /**\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 * Clients MAY request server-driven paging with a specific page size by specifying a $maxpagesize preference. The server SHOULD honor this preference if the specified page size is smaller than the server's default page size.\n */\n $maxpagesize?: number;\n /** Ids to use in filtering */\n ids?: string[];\n /** Statuses to use in filtering */\n statuses?: string[];\n /** the start datetime to get items after */\n createdDateTimeUtcStart?: Date;\n /** the end datetime to get items before */\n createdDateTimeUtcEnd?: Date;\n /** the sorting query for the collection (ex: 'CreatedDateTimeUtc asc', 'CreatedDateTimeUtc desc') */\n $orderBy?: string[];\n}\n\nexport interface GetDocumentsStatusQueryParam {\n queryParameters?: GetDocumentsStatusQueryParamProperties;\n}\n\nexport type GetDocumentsStatusParameters = RequestParameters & GetDocumentsStatusQueryParam;\nexport type GetSupportedDocumentFormatsParameters = RequestParameters;\nexport type GetSupportedGlossaryFormatsParameters = RequestParameters;\nexport type GetSupportedStorageSourcesParameters = RequestParameters;\n"]}