@azure-rest/ai-document-intelligence 1.0.0-beta.2 → 1.0.0

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 (224) hide show
  1. package/CHANGELOG.md +263 -0
  2. package/LICENSE +21 -0
  3. package/README.md +133 -7
  4. package/dist/browser/clientDefinitions.d.ts +175 -0
  5. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  6. package/dist/browser/clientDefinitions.js +4 -0
  7. package/dist/browser/clientDefinitions.js.map +1 -0
  8. package/dist/browser/documentIntelligence.d.ts +16 -0
  9. package/dist/browser/documentIntelligence.d.ts.map +1 -0
  10. package/dist/browser/documentIntelligence.js +44 -0
  11. package/dist/browser/documentIntelligence.js.map +1 -0
  12. package/dist/browser/index.d.ts +13 -0
  13. package/dist/browser/index.d.ts.map +1 -0
  14. package/dist/browser/index.js +15 -0
  15. package/dist/browser/index.js.map +1 -0
  16. package/dist/browser/isUnexpected.d.ts +36 -0
  17. package/dist/browser/isUnexpected.d.ts.map +1 -0
  18. package/{dist-esm/src → dist/browser}/isUnexpected.js +18 -7
  19. package/dist/browser/isUnexpected.js.map +1 -0
  20. package/dist/browser/logger.d.ts +2 -0
  21. package/dist/browser/logger.d.ts.map +1 -0
  22. package/{dist-esm/src → dist/browser}/logger.js +1 -1
  23. package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
  24. package/dist/browser/models.d.ts +254 -0
  25. package/dist/browser/models.d.ts.map +1 -0
  26. package/dist/browser/models.js +4 -0
  27. package/dist/browser/models.js.map +1 -0
  28. package/dist/browser/outputModels.d.ts +914 -0
  29. package/dist/browser/outputModels.d.ts.map +1 -0
  30. package/dist/browser/outputModels.js +4 -0
  31. package/dist/browser/outputModels.js.map +1 -0
  32. package/dist/browser/package.json +3 -0
  33. package/dist/browser/paginateHelper.d.ts +68 -0
  34. package/dist/browser/paginateHelper.d.ts.map +1 -0
  35. package/dist/browser/paginateHelper.js +167 -0
  36. package/dist/browser/paginateHelper.js.map +1 -0
  37. package/dist/browser/parameters.d.ts +414 -0
  38. package/dist/browser/parameters.d.ts.map +1 -0
  39. package/dist/browser/parameters.js +4 -0
  40. package/dist/browser/parameters.js.map +1 -0
  41. package/dist/browser/pollingHelper.d.ts +40 -0
  42. package/dist/browser/pollingHelper.d.ts.map +1 -0
  43. package/dist/browser/pollingHelper.js +80 -0
  44. package/dist/browser/pollingHelper.js.map +1 -0
  45. package/dist/browser/responses.d.ts +473 -0
  46. package/dist/browser/responses.d.ts.map +1 -0
  47. package/dist/browser/responses.js +4 -0
  48. package/dist/browser/responses.js.map +1 -0
  49. package/dist/browser/utils.d.ts +5 -0
  50. package/dist/browser/utils.d.ts.map +1 -0
  51. package/dist/browser/utils.js +33 -0
  52. package/dist/browser/utils.js.map +1 -0
  53. package/dist/commonjs/clientDefinitions.d.ts +175 -0
  54. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  55. package/dist/commonjs/clientDefinitions.js +5 -0
  56. package/dist/commonjs/clientDefinitions.js.map +1 -0
  57. package/dist/commonjs/documentIntelligence.d.ts +16 -0
  58. package/dist/commonjs/documentIntelligence.d.ts.map +1 -0
  59. package/dist/commonjs/documentIntelligence.js +47 -0
  60. package/dist/commonjs/documentIntelligence.js.map +1 -0
  61. package/dist/commonjs/index.d.ts +13 -0
  62. package/dist/commonjs/index.d.ts.map +1 -0
  63. package/dist/commonjs/index.js +18 -0
  64. package/dist/commonjs/index.js.map +1 -0
  65. package/dist/commonjs/isUnexpected.d.ts +36 -0
  66. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  67. package/dist/commonjs/isUnexpected.js +107 -0
  68. package/dist/commonjs/isUnexpected.js.map +1 -0
  69. package/dist/commonjs/logger.d.ts +2 -0
  70. package/dist/commonjs/logger.d.ts.map +1 -0
  71. package/dist/commonjs/logger.js +8 -0
  72. package/dist/commonjs/logger.js.map +1 -0
  73. package/dist/commonjs/models.d.ts +254 -0
  74. package/dist/commonjs/models.d.ts.map +1 -0
  75. package/dist/commonjs/models.js +5 -0
  76. package/dist/commonjs/models.js.map +1 -0
  77. package/dist/commonjs/outputModels.d.ts +914 -0
  78. package/dist/commonjs/outputModels.d.ts.map +1 -0
  79. package/dist/commonjs/outputModels.js +5 -0
  80. package/dist/commonjs/outputModels.js.map +1 -0
  81. package/dist/commonjs/package.json +3 -0
  82. package/dist/commonjs/paginateHelper.d.ts +68 -0
  83. package/dist/commonjs/paginateHelper.d.ts.map +1 -0
  84. package/dist/commonjs/paginateHelper.js +170 -0
  85. package/dist/commonjs/paginateHelper.js.map +1 -0
  86. package/dist/commonjs/parameters.d.ts +414 -0
  87. package/dist/commonjs/parameters.d.ts.map +1 -0
  88. package/dist/commonjs/parameters.js +5 -0
  89. package/dist/commonjs/parameters.js.map +1 -0
  90. package/dist/commonjs/pollingHelper.d.ts +40 -0
  91. package/dist/commonjs/pollingHelper.d.ts.map +1 -0
  92. package/dist/commonjs/pollingHelper.js +84 -0
  93. package/dist/commonjs/pollingHelper.js.map +1 -0
  94. package/dist/commonjs/responses.d.ts +473 -0
  95. package/dist/commonjs/responses.d.ts.map +1 -0
  96. package/dist/commonjs/responses.js +5 -0
  97. package/dist/commonjs/responses.js.map +1 -0
  98. package/dist/commonjs/tsdoc-metadata.json +11 -0
  99. package/dist/commonjs/utils.d.ts +5 -0
  100. package/dist/commonjs/utils.d.ts.map +1 -0
  101. package/dist/commonjs/utils.js +36 -0
  102. package/dist/commonjs/utils.js.map +1 -0
  103. package/dist/esm/clientDefinitions.d.ts +175 -0
  104. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  105. package/dist/esm/clientDefinitions.js +4 -0
  106. package/dist/esm/clientDefinitions.js.map +1 -0
  107. package/dist/esm/documentIntelligence.d.ts +16 -0
  108. package/dist/esm/documentIntelligence.d.ts.map +1 -0
  109. package/dist/esm/documentIntelligence.js +44 -0
  110. package/dist/esm/documentIntelligence.js.map +1 -0
  111. package/dist/esm/index.d.ts +13 -0
  112. package/dist/esm/index.d.ts.map +1 -0
  113. package/dist/esm/index.js +15 -0
  114. package/dist/esm/index.js.map +1 -0
  115. package/dist/esm/isUnexpected.d.ts +36 -0
  116. package/dist/esm/isUnexpected.d.ts.map +1 -0
  117. package/dist/esm/isUnexpected.js +104 -0
  118. package/dist/esm/isUnexpected.js.map +1 -0
  119. package/dist/esm/logger.d.ts +2 -0
  120. package/dist/esm/logger.d.ts.map +1 -0
  121. package/dist/esm/logger.js +5 -0
  122. package/dist/esm/logger.js.map +1 -0
  123. package/dist/esm/models.d.ts +254 -0
  124. package/dist/esm/models.d.ts.map +1 -0
  125. package/dist/esm/models.js +4 -0
  126. package/dist/esm/models.js.map +1 -0
  127. package/dist/esm/outputModels.d.ts +914 -0
  128. package/dist/esm/outputModels.d.ts.map +1 -0
  129. package/dist/esm/outputModels.js +4 -0
  130. package/dist/esm/outputModels.js.map +1 -0
  131. package/dist/esm/package.json +3 -0
  132. package/dist/esm/paginateHelper.d.ts +68 -0
  133. package/dist/esm/paginateHelper.d.ts.map +1 -0
  134. package/dist/esm/paginateHelper.js +167 -0
  135. package/dist/esm/paginateHelper.js.map +1 -0
  136. package/dist/esm/parameters.d.ts +414 -0
  137. package/dist/esm/parameters.d.ts.map +1 -0
  138. package/dist/esm/parameters.js +4 -0
  139. package/dist/esm/parameters.js.map +1 -0
  140. package/dist/esm/pollingHelper.d.ts +40 -0
  141. package/dist/esm/pollingHelper.d.ts.map +1 -0
  142. package/dist/esm/pollingHelper.js +80 -0
  143. package/dist/esm/pollingHelper.js.map +1 -0
  144. package/dist/esm/responses.d.ts +473 -0
  145. package/dist/esm/responses.d.ts.map +1 -0
  146. package/dist/esm/responses.js +4 -0
  147. package/dist/esm/responses.js.map +1 -0
  148. package/dist/esm/utils.d.ts +5 -0
  149. package/dist/esm/utils.d.ts.map +1 -0
  150. package/dist/esm/utils.js +33 -0
  151. package/dist/esm/utils.js.map +1 -0
  152. package/dist/react-native/clientDefinitions.d.ts +175 -0
  153. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  154. package/dist/react-native/clientDefinitions.js +4 -0
  155. package/dist/react-native/clientDefinitions.js.map +1 -0
  156. package/dist/react-native/documentIntelligence.d.ts +16 -0
  157. package/dist/react-native/documentIntelligence.d.ts.map +1 -0
  158. package/dist/react-native/documentIntelligence.js +44 -0
  159. package/dist/react-native/documentIntelligence.js.map +1 -0
  160. package/dist/react-native/index.d.ts +13 -0
  161. package/dist/react-native/index.d.ts.map +1 -0
  162. package/dist/react-native/index.js +15 -0
  163. package/dist/react-native/index.js.map +1 -0
  164. package/dist/react-native/isUnexpected.d.ts +36 -0
  165. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  166. package/dist/react-native/isUnexpected.js +104 -0
  167. package/dist/react-native/isUnexpected.js.map +1 -0
  168. package/dist/react-native/logger.d.ts +2 -0
  169. package/dist/react-native/logger.d.ts.map +1 -0
  170. package/dist/react-native/logger.js +5 -0
  171. package/dist/react-native/logger.js.map +1 -0
  172. package/dist/react-native/models.d.ts +254 -0
  173. package/dist/react-native/models.d.ts.map +1 -0
  174. package/dist/react-native/models.js +4 -0
  175. package/dist/react-native/models.js.map +1 -0
  176. package/dist/react-native/outputModels.d.ts +914 -0
  177. package/dist/react-native/outputModels.d.ts.map +1 -0
  178. package/dist/react-native/outputModels.js +4 -0
  179. package/dist/react-native/outputModels.js.map +1 -0
  180. package/dist/react-native/package.json +3 -0
  181. package/dist/react-native/paginateHelper.d.ts +68 -0
  182. package/dist/react-native/paginateHelper.d.ts.map +1 -0
  183. package/dist/react-native/paginateHelper.js +167 -0
  184. package/dist/react-native/paginateHelper.js.map +1 -0
  185. package/dist/react-native/parameters.d.ts +414 -0
  186. package/dist/react-native/parameters.d.ts.map +1 -0
  187. package/dist/react-native/parameters.js +4 -0
  188. package/dist/react-native/parameters.js.map +1 -0
  189. package/dist/react-native/pollingHelper.d.ts +40 -0
  190. package/dist/react-native/pollingHelper.d.ts.map +1 -0
  191. package/dist/react-native/pollingHelper.js +80 -0
  192. package/dist/react-native/pollingHelper.js.map +1 -0
  193. package/dist/react-native/responses.d.ts +473 -0
  194. package/dist/react-native/responses.d.ts.map +1 -0
  195. package/dist/react-native/responses.js +4 -0
  196. package/dist/react-native/responses.js.map +1 -0
  197. package/dist/react-native/utils.d.ts +5 -0
  198. package/dist/react-native/utils.d.ts.map +1 -0
  199. package/dist/react-native/utils.js +33 -0
  200. package/dist/react-native/utils.js.map +1 -0
  201. package/package.json +108 -92
  202. package/review/ai-document-intelligence.api.md +866 -225
  203. package/dist/index.js +0 -252
  204. package/dist/index.js.map +0 -1
  205. package/dist-esm/src/clientDefinitions.js +0 -4
  206. package/dist-esm/src/clientDefinitions.js.map +0 -1
  207. package/dist-esm/src/documentIntelligence.js +0 -30
  208. package/dist-esm/src/documentIntelligence.js.map +0 -1
  209. package/dist-esm/src/index.js +0 -14
  210. package/dist-esm/src/index.js.map +0 -1
  211. package/dist-esm/src/isUnexpected.js.map +0 -1
  212. package/dist-esm/src/models.js +0 -4
  213. package/dist-esm/src/models.js.map +0 -1
  214. package/dist-esm/src/outputModels.js +0 -4
  215. package/dist-esm/src/outputModels.js.map +0 -1
  216. package/dist-esm/src/paginateHelper.js +0 -70
  217. package/dist-esm/src/paginateHelper.js.map +0 -1
  218. package/dist-esm/src/parameters.js +0 -4
  219. package/dist-esm/src/parameters.js.map +0 -1
  220. package/dist-esm/src/pollingHelper.js +0 -43
  221. package/dist-esm/src/pollingHelper.js.map +0 -1
  222. package/dist-esm/src/responses.js +0 -4
  223. package/dist-esm/src/responses.js.map +0 -1
  224. package/types/ai-document-intelligence.d.ts +0 -2003
package/CHANGELOG.md ADDED
@@ -0,0 +1,263 @@
1
+ # Release History
2
+
3
+ ## 1.0.0 (2024-12-16)
4
+
5
+ ### Features Added
6
+
7
+ - Adds `streamToUint8Array`, a convenience function that buffers a `NodeJS.ReadableStream` in a `Uint8Array`. It can be used to read the pdf and png responses from the results of an analysis.
8
+
9
+ ```ts
10
+ import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
11
+ import { streamToUint8Array } from "@azure-rest/ai-document-intelligence";
12
+
13
+ const client = DocumentIntelligence("<DOCUMENT_INTELLIGENCE_ENDPOINT>", {
14
+ key: "<DOCUMENT_INTELLIGENCE_API_KEY>",
15
+ });
16
+
17
+ // Do analysis on you document and get the resultId, figureId
18
+
19
+ // Example for the figures api that provides an image output
20
+ const output = await client
21
+ .path(
22
+ "/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}",
23
+ "prebuilt-layout",
24
+ resultId,
25
+ figureId
26
+ )
27
+ .get()
28
+ .asNodeStream(); // output.body would be NodeJS.ReadableStream
29
+
30
+ if (output.status !== "200" || !output.body) {
31
+ throw new Error("The response was unexpected, expected NodeJS.ReadableStream in the body.");
32
+ }
33
+
34
+ const imageData = await streamToUint8Array(output.body);
35
+ fs.promises.writeFile(`./figures/${figureId}.png`, imageData); // Or you can consume the NodeJS.ReadableStream directly
36
+ ```
37
+
38
+ - Adds `parseResultIdFromResponse`, a convenience function that extracts the `operationId` from the batch analysis response.
39
+
40
+ ```js
41
+ // Example
42
+ const initialResponse = await client
43
+ .path("/documentModels/{modelId}:analyzeBatch", "prebuilt-layout")
44
+ .post({
45
+ contentType: "application/json",
46
+ body: {
47
+ azureBlobSource: {
48
+ containerUrl: batchTrainingFilesContainerUrl(),
49
+ },
50
+ resultContainerUrl: batchTrainingFilesResultContainerUrl(),
51
+ resultPrefix: "result",
52
+ },
53
+ });
54
+
55
+ if (isUnexpected(initialResponse)) {
56
+ throw initialResponse.body.error;
57
+ }
58
+ const batchResultId = parseResultIdFromResponse(initialResponse);
59
+
60
+ const response = await client
61
+ .path(
62
+ "/documentModels/{modelId}/analyzeBatchResults/{resultId}",
63
+ "prebuilt-layout",
64
+ batchResultId
65
+ )
66
+ .get();
67
+ ```
68
+
69
+ - Changes the following interfaces as follows:
70
+
71
+ - `AnalyzeBatchDocumentsBodyParam`:
72
+ - Updates `body` to be required.
73
+ - `AnalyzeBatchOperationOutput`:
74
+ - Adds `resultId`.
75
+ - `AnalyzeDocumentBodyParam`:
76
+ - Changes `body` from optional to required.
77
+ - `DocumentClassifierDetailsOutput`:
78
+ - Adds `modifiedDateTime`.
79
+ - `DocumentModelDetailsOutput`:
80
+ - Adds `modifiedDateTime`.
81
+
82
+ - Introduces new interfaces to define query parameters for document analysis requests, allowing customizable `style` and `explode` options:
83
+ - **AnalyzeBatchDocumentsFeaturesQueryParam**: Accepts DocumentAnalysisFeature[] values.
84
+ - **AnalyzeBatchDocumentsOutputQueryParam**: Accepts AnalyzeOutputOption[] values.
85
+ - **AnalyzeBatchDocumentsQueryFieldsQueryParam**: Accepts string[] values.
86
+ - **AnalyzeDocumentFeaturesQueryParam**: Accepts DocumentAnalysisFeature[] values.
87
+ - **AnalyzeDocumentFromStreamFeaturesQueryParam**: Accepts DocumentAnalysisFeature[] values.
88
+
89
+ ### Breaking Changes
90
+
91
+ - Removes the `poller.getOperationId()` for a given polling operation. Use `parseResultIdFromResponse` to extract the `operationId` directly.
92
+ - `getLongRunningPoller` function is not async anymore, do not `await` on it.
93
+
94
+ ### Other Changes
95
+
96
+ The following types are renamed
97
+
98
+ - `CopyAuthorization` to `ModelCopyAuthorization`
99
+ - `ErrorResponseOutput` to `DocumentIntelligenceErrorResponseOutput`
100
+ - `ErrorModelOutput` to `DocumentIntelligenceErrorOutput`
101
+ - `InnerErrorOutput` to `DocumentIntelligenceInnerErrorOutput`
102
+ - `WarningOutput` to `DocumentIntelligenceWarningOutput`
103
+ - `ContentFormat` to `DocumentContentFormat`
104
+ - `ContentFormatOutput` to `DocumentContentFormatOutput`
105
+ - `OperationDetailsOutputParent` to `DocumentIntelligenceOperationDetailsOutputParent`
106
+ - `OperationDetailsOutput` to `DocumentIntelligenceOperationDetailsOutput`
107
+ - `OperationStatusOutput` to `DocumentIntelligenceOperationStatusOutput`
108
+ - `ResourceDetailsOutput` to `DocumentIntelligenceResourceDetailsOutput`
109
+ - `PagedOperationDetailsOutput` to `PagedDocumentIntelligenceOperationDetailsOutput`
110
+ - `GetResourceInfo` to `GetResourceDetails`
111
+
112
+ ## 1.0.0-beta.3 (2024-08-20)
113
+
114
+ ### Features Added
115
+
116
+ - Added support for the Analyze Batch Documents API with the long-running operations, `/documentModels/{modelId}:analyzeBatch`.
117
+ - Added support for method `/documentModels/{modelId}/analyzeResults/{resultId}/pdf`.
118
+ - Added support for method `/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}`.
119
+ - Added support for the analysis method to specify other kinds of output through `AnalyzeDocumentFromStreamBodyParam#output` param : can be `pdf` and `figures`.
120
+ - Added property `id` to `Output` model.
121
+ - Added support for the Copy Classifier API with method `/documentClassifiers:authorizeCopy`.
122
+ - Added method `/documentClassifiers/{classifierId}:copyTo`.
123
+ - Added new enum type to `DocumentBuildMode`: `generative`.
124
+ - Added property `warnings` to `AnalyzeResultOutput ` model.
125
+ - Added properties `classifierId`, `split`, and `trainingHours` to `DocumentModelDetailsOutput` model.
126
+ - Added properties `confidenceThreshold`, `features`, `maxDocumentsToAnalyze`, `modelId`, and `queryFields` to `DocumentTypeDetailsOutput` model.
127
+ - Added properties `allowOverwrite` and `maxTrainingHours` to `BuildDocumentModelRequest` model.
128
+ - Added parameter `pages` to `ClassifyDocument` overloads.
129
+ - Added properties `classifierId`, `docTypes`, and `split` to `ComposeDocumentModelRequest`.
130
+ - Added property `allowOverwrite` to `BuildDocumentClassifierRequest`.
131
+ - Added property `getOperationId()` method to the pollers.
132
+
133
+ ### Other Changes
134
+
135
+ - The `@azure-rest/ai-document-intelligence` Rest Level Client Library, now targets the Azure AI Document Intelligence service API version `2024-07-31-preview`. Support for `2024-02-29-preview` has been removed.
136
+ - Removed support for extracting lists from analyzed documents:
137
+ - Removed models `DocumentListOutput` and `DocumentListItemOutput`.
138
+ - Removed property `lists` from `AnalyzeResultOutput`.
139
+ - Changes to the Compose Document API:
140
+ - Removed model `ComponentDocumentModelDetails`.
141
+ - Removed property `componentModels` from `ComposeDocumentModelRequest`.
142
+ - `ComposeDocumentModelRequest` now requires a map of `DocumentTypeDetails` and a classifier ID.
143
+ - Removed model `QuotaDetailsOutput`.
144
+ - Removed property `customNeuralDocumentModelBuilds` from `ResourceDetailsOutput`.
145
+ - Removed required property `fieldSchema` and from `DocumentTypeDetailsOuput`.
146
+ - `DocumentFieldType` is now a required property of `DocumentFieldSchema`.
147
+
148
+ ## 1.0.0-beta.2 (2024-03-06)
149
+
150
+ ### Features Added
151
+
152
+ - Support for "retry-after" header has been added for long-running operations, including `/documentModels/{modelId}:analyze`, `/documentModels:build`, and `/documentClassifiers:build`.
153
+ - `BuildDocumentClassifierContent` now includes a new property, `baseClassifierId`.
154
+ - `DocumentClassifierDetailsOutput` now includes a new property, `baseClassifierId`.
155
+ - A new property, `warnings`, has been added to `DocumentModelDetailsOutput` and `DocumentClassifierDetailsOutput`, represents an array of objects with `code`, `message`, and `target`.
156
+ - `DocumentFieldOutput` now includes a new property, `valueSelectionGroup`.
157
+ - A new member, `"completed"`, has been added to `OperationDetails#status`.
158
+
159
+ ### Breaking Changes
160
+
161
+ - The `@azure-rest/ai-document-intelligence` Rest Level Client Library, previously known as Form Recognizer, now targets the Azure AI Document Intelligence service API version `"2024-02-29-preview"`. Please note that support for `2023-10-31-preview` has been discontinued.
162
+
163
+ ## 1.0.0-beta.1 (2023-11-16)
164
+
165
+ ### Features Added
166
+
167
+ This marks the first preview of `@azure-rest/ai-document-intelligence` Rest Level Client Library for the Azure AI Document Intelligence service (formerly known as Form Recognizer), targeting service API version `"2023-10-31-preview"`.
168
+
169
+ _**Note: Form Recognizer has been rebranded to Document Intelligence.**_
170
+
171
+ - Updates all REST API operation paths from `{endpoint}/formrecognizer` to `{endpoint}/documentintelligence`. SDK would handle this change automatically, users would not have to do additional work to support this.
172
+ - `@azure-rest/ai-document-intelligence` is the new package, replacing `@azure/ai-form-recognizer` package. The new package supports a Rest Level Client, which is part of the new generation of Azure SDKs to simplify the development experience. The new package is not compatible with the previous `@azure/ai-form-recognizer` package without necessary changes to your code.
173
+ - **Breaking Changes (with the `@azure/ai-form-recognizer` SDK)** - API shapes have been designed from scratch to support the new Rest Level Client for the Document Intelligence service. Please refer to the [Readme](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documentintelligence/ai-document-intelligence-rest/README.md) and [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/samples) for more understanding.
174
+
175
+ ### `"2023-10-31-preview"` Service API version
176
+
177
+ The new `"2023-10-31-preview"` service version comes with some new features and a few breaking changes when compared to the API versions supported by the `@azure/ai-form-recognizer` library.
178
+
179
+ **New Features**
180
+
181
+ - **Markdown content format**
182
+
183
+ Supports output with Markdown content format along with the default plain _text_. For now, this is only supported for "prebuilt-layout". Markdown content format is deemed a more friendly format for LLM consumption in a chat or automation use scenario.
184
+
185
+ Service follows the GFM spec ([GitHub Flavored Markdown](https://github.github.com/gfm/)) for the Markdown format. Also introduces a new _contentFormat_ property with value "text" or "markdown" to indicate the result content format.
186
+
187
+ ```ts
188
+ import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
189
+ const client = DocumentIntelligence(process.env["DOCUMENT_INTELLIGENCE_ENDPOINT"], {
190
+ key: process.env["DOCUMENT_INTELLIGENCE_API_KEY"],
191
+ });
192
+
193
+ const initialResponse = await client
194
+ .path("/documentModels/{modelId}:analyze", "prebuilt-layout")
195
+ .post({
196
+ contentType: "application/json",
197
+ body: {
198
+ urlSource:
199
+ "https://raw.githubusercontent.com/Azure/azure-sdk-for-js/6704eff082aaaf2d97c1371a28461f512f8d748a/sdk/formrecognizer/ai-form-recognizer/assets/forms/Invoice_1.pdf",
200
+ },
201
+ queryParameters: { outputContentFormat: "markdown" }, // <-- new query parameter
202
+ });
203
+ ```
204
+
205
+ - **Query Fields**
206
+
207
+ When this feature flag is specified, the service will further extract the values of the fields specified via the queryFields query parameter to supplement any existing fields defined by the model as fallback.
208
+
209
+ ```ts
210
+ await client.path("/documentModels/{modelId}:analyze", "prebuilt-layout").post({
211
+ contentType: "application/json",
212
+ body: { urlSource: "..." },
213
+ queryParameters: {
214
+ features: ["queryFields"],
215
+ queryFields: ["NumberOfGuests", "StoreNumber"],
216
+ }, // <-- new query parameter
217
+ });
218
+ ```
219
+
220
+ - **Split Options**
221
+
222
+ In the previous API versions supported by the older `@azure/ai-form-recognizer` library, document splitting and classification operation (`"/documentClassifiers/{classifierId}:analyze"`) always tried to split the input file into multiple documents.
223
+
224
+ To enable a wider set of scenarios, service introduces a "split" query parameter with the new "2023-10-31-preview" service version. The following values are supported:
225
+
226
+ - `split: "auto"`
227
+
228
+ Let service determine where to split.
229
+
230
+ - `split: "none"`
231
+
232
+ The entire file is treated as a single document. No splitting is performed.
233
+
234
+ - `split: "perPage"`
235
+
236
+ Each page is treated as a separate document. Each empty page is kept as its own document.
237
+
238
+ **Breaking Changes**
239
+
240
+ - **prebuilt-receipt** - Currency related fields have been updated. Currency symbol ("$") and code ("USD") are returned along with the amount as shown below.
241
+
242
+ ```json
243
+ {
244
+ "content": "$123.45",
245
+ "confidence": 0.995,
246
+ "type": "currency",
247
+ "valueCurrency": {
248
+ "amount": 123.45,
249
+ "currencySymbol": "$",
250
+ "currencyCode": "USD"
251
+ },
252
+ ...
253
+ }
254
+ ```
255
+
256
+ **Retirements/Deprecations**
257
+
258
+ - `"prebuilt-businessCard"` model is retired.
259
+ - `"prebuilt-document"` model is retired, this model is essentially `"prebuilt-layout"` with `features: ["keyValuePairs"]` specified. _(This is only supported as an optional feature for "prebuilt-layout" and "prebuilt-invoice".)_
260
+
261
+ If you wish to still use these models, please rely on the older `@azure/ai-form-recognizer` library through the older service API versions.
262
+
263
+ If you were using the old `@azure/ai-form-recognizer` package, please refer [MIGRATION_GUIDE.MD](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/documentintelligence/ai-document-intelligence-rest/MIGRATION-FR_v4-DI_v1.md) for more details.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -15,14 +15,13 @@ Key links:
15
15
  - [Changelog](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/CHANGELOG.md)
16
16
  - [Migration Guide from Form Recognizer](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/MIGRATION-FR_v4-DI_v1.md)
17
17
 
18
- > This version of the client library defaults to the `"2024-02-29-preview"` version of the service.
18
+ > This version of the client library defaults to the `"2024-11-30"` version of the service.
19
19
 
20
20
  This table shows the relationship between SDK versions and supported API versions of the service:
21
21
 
22
22
  | SDK version | Supported API version of service |
23
23
  | ------------ | -------------------------------- |
24
- | 1.0.0-beta.2 | 2024-02-29-preview |
25
- | 1.0.0-beta.1 | 2023-10-31-preview |
24
+ | 1.0.0 | 2024-11-30 |
26
25
 
27
26
  > Please rely on the older `@azure/ai-form-recognizer` library through the older service API versions for retired models, such as `"prebuilt-businessCard"` and `"prebuilt-document"`. For more information, see [Changelog](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/CHANGELOG.md).
28
27
 
@@ -30,8 +29,7 @@ The below table describes the relationship of each client and its supported API
30
29
 
31
30
  | Service API version | Supported clients | Package |
32
31
  | ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------- |
33
- | 2024-02-29-preview | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0-beta.2` |
34
- | 2023-10-31-preview | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0-beta.1` |
32
+ | 2024-11-30 | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0` |
35
33
  | 2023-07-31 | DocumentAnalysisClient and DocumentModelAdministrationClient | `@azure/ai-form-recognizer` version `^5.0.0` |
36
34
  | 2022-08-01 | DocumentAnalysisClient and DocumentModelAdministrationClient | `@azure/ai-form-recognizer` version `^4.0.0` |
37
35
 
@@ -137,7 +135,7 @@ import {
137
135
  if (isUnexpected(initialResponse)) {
138
136
  throw initialResponse.body.error;
139
137
  }
140
- const poller = await getLongRunningPoller(client, initialResponse);
138
+ const poller = getLongRunningPoller(client, initialResponse);
141
139
  const result = (await poller.pollUntilDone()).body as AnalyzeResultOperationOutput;
142
140
  console.log(result);
143
141
  // {
@@ -154,6 +152,42 @@ console.log(result);
154
152
  // }
155
153
  ```
156
154
 
155
+ ## Batch analysis
156
+
157
+ ```ts
158
+ import { parseResultIdFromResponse, isUnexpected } from "@azure-rest/ai-document-intelligence";
159
+
160
+ // 1. Analyze a batch of documents
161
+ const initialResponse = await client
162
+ .path("/documentModels/{modelId}:analyzeBatch", "prebuilt-layout")
163
+ .post({
164
+ contentType: "application/json",
165
+ body: {
166
+ azureBlobSource: {
167
+ containerUrl: batchTrainingFilesContainerUrl(),
168
+ },
169
+ resultContainerUrl: batchTrainingFilesResultContainerUrl(),
170
+ resultPrefix: "result",
171
+ },
172
+ });
173
+
174
+ if (isUnexpected(initialResponse)) {
175
+ throw initialResponse.body.error;
176
+ }
177
+ const resultId = parseResultIdFromResponse(initialResponse);
178
+ console.log("resultId: ", resultId);
179
+
180
+ // (Optional) You can poll for the batch analysis result but be aware that a job may take unexpectedly long time, and polling could incur additional costs.
181
+ // const poller = getLongRunningPoller(client, initialResponse);
182
+ // await poller.pollUntilDone();
183
+
184
+ // 2. At a later time, you can retrieve the operation result using the resultId
185
+ const output = await client
186
+ .path("/documentModels/{modelId}/analyzeResults/{resultId}", "prebuilt-layout", resultId)
187
+ .get();
188
+ console.log(output);
189
+ ```
190
+
157
191
  ### Markdown content format
158
192
 
159
193
  Supports output with Markdown content format along with the default plain _text_. For now, this is only supported for "prebuilt-layout". Markdown content format is deemed a more friendly format for LLM consumption in a chat or automation use scenario.
@@ -244,7 +278,7 @@ const initialResponse = await client.path("/documentClassifiers:build").post({
244
278
  if (isUnexpected(initialResponse)) {
245
279
  throw initialResponse.body.error;
246
280
  }
247
- const poller = await getLongRunningPoller(client, initialResponse);
281
+ const poller = getLongRunningPoller(client, initialResponse);
248
282
  const response = (await poller.pollUntilDone())
249
283
  .body as DocumentClassifierBuildOperationDetailsOutput;
250
284
  console.log(response);
@@ -265,6 +299,98 @@ console.log(response);
265
299
  // }
266
300
  ```
267
301
 
302
+ ## Get the generated PDF output from document analysis
303
+
304
+ ```ts
305
+ const filePath = path.join(ASSET_PATH, "layout-pageobject.pdf");
306
+
307
+ const base64Source = await fs.readFile(filePath, { encoding: "base64" });
308
+
309
+ const initialResponse = await client
310
+ .path("/documentModels/{modelId}:analyze", "prebuilt-read")
311
+ .post({
312
+ contentType: "application/json",
313
+ body: {
314
+ base64Source,
315
+ },
316
+ queryParameters: { output: ["pdf"] },
317
+ });
318
+
319
+ if (isUnexpected(initialResponse)) {
320
+ throw initialResponse.body.error;
321
+ }
322
+
323
+ const poller = getLongRunningPoller(client, initialResponse);
324
+
325
+ await poller.pollUntilDone();
326
+
327
+ const output = await client
328
+ .path(
329
+ "/documentModels/{modelId}/analyzeResults/{resultId}/pdf",
330
+ "prebuilt-read",
331
+ parseResultIdFromResponse(initialResponse)
332
+ )
333
+ .get()
334
+ .asNodeStream(); // output.body would be NodeJS.ReadableStream
335
+
336
+ if (output.status !== "200" || !output.body) {
337
+ throw new Error("The response was unexpected, expected NodeJS.ReadableStream in the body.");
338
+ }
339
+
340
+ const pdfData = await streamToUint8Array(output.body);
341
+ fs.promises.writeFile(`./output.pdf`, pdfData);
342
+ // Or you can consume the NodeJS.ReadableStream directly
343
+ ```
344
+
345
+ ## Get the generated cropped image of specified figure from document analysis
346
+
347
+ ```ts
348
+ const filePath = path.join(ASSET_PATH, "layout-pageobject.pdf");
349
+
350
+ const base64Source = fs.readFileSync(filePath, { encoding: "base64" });
351
+
352
+ const initialResponse = await client
353
+ .path("/documentModels/{modelId}:analyze", "prebuilt-layout")
354
+ .post({
355
+ contentType: "application/json",
356
+ body: {
357
+ base64Source,
358
+ },
359
+ queryParameters: { output: ["figures"] },
360
+ });
361
+
362
+ if (isUnexpected(initialResponse)) {
363
+ throw initialResponse.body.error;
364
+ }
365
+
366
+ const poller = getLongRunningPoller(client, initialResponse, { ...testPollingOptions });
367
+
368
+ const result = (await poller.pollUntilDone()).body as AnalyzeResultOperationOutput;
369
+ const figures = result.analyzeResult?.figures;
370
+ assert.isArray(figures);
371
+ assert.isNotEmpty(figures?.[0]);
372
+ const figureId = figures?.[0].id || "";
373
+ assert.isDefined(figureId);
374
+
375
+ const output = await client
376
+ .path(
377
+ "/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}",
378
+ "prebuilt-layout",
379
+ parseResultIdFromResponse(initialResponse),
380
+ figureId
381
+ )
382
+ .get()
383
+ .asNodeStream(); // output.body would be NodeJS.ReadableStream
384
+
385
+ if (output.status !== "200" || !output.body) {
386
+ throw new Error("The response was unexpected, expected NodeJS.ReadableStream in the body.");
387
+ }
388
+
389
+ const imageData = await streamToUint8Array(output.body);
390
+ fs.promises.writeFile(`./figures/${figureId}.png`, imageData);
391
+ // Or you can consume the NodeJS.ReadableStream directly
392
+ ```
393
+
268
394
  ## Get Info
269
395
 
270
396
  ```ts
@@ -0,0 +1,175 @@
1
+ import type { ListOperationsParameters, GetDocumentModelBuildOperationParameters, GetDocumentModelComposeOperationParameters, GetDocumentModelCopyToOperationParameters, GetDocumentClassifierCopyToOperationParameters, GetDocumentClassifierBuildOperationParameters, GetOperationParameters, GetResourceDetailsParameters, GetAnalyzeResultParameters, DeleteAnalyzeResultParameters, GetAnalyzeResultPdfParameters, GetAnalyzeResultFigureParameters, AnalyzeDocumentFromStreamParameters, AnalyzeDocumentParameters, GetAnalyzeBatchResultParameters, DeleteAnalyzeBatchResultParameters, AnalyzeBatchDocumentsParameters, ListAnalyzeBatchResultsParameters, GetModelParameters, DeleteModelParameters, BuildModelParameters, ComposeModelParameters, AuthorizeModelCopyParameters, CopyModelToParameters, ListModelsParameters, BuildClassifierParameters, ListClassifiersParameters, GetClassifierParameters, DeleteClassifierParameters, ClassifyDocumentFromStreamParameters, ClassifyDocumentParameters, GetClassifyResultParameters, AuthorizeClassifierCopyParameters, CopyClassifierToParameters } from "./parameters.js";
2
+ import type { ListOperations200Response, ListOperationsDefaultResponse, GetDocumentModelBuildOperation200Response, GetDocumentModelBuildOperationDefaultResponse, GetDocumentModelComposeOperation200Response, GetDocumentModelComposeOperationDefaultResponse, GetDocumentModelCopyToOperation200Response, GetDocumentModelCopyToOperationDefaultResponse, GetDocumentClassifierCopyToOperation200Response, GetDocumentClassifierCopyToOperationDefaultResponse, GetDocumentClassifierBuildOperation200Response, GetDocumentClassifierBuildOperationDefaultResponse, GetOperation200Response, GetOperationDefaultResponse, GetResourceDetails200Response, GetResourceDetailsDefaultResponse, GetAnalyzeResult200Response, GetAnalyzeResultDefaultResponse, DeleteAnalyzeResult204Response, DeleteAnalyzeResultDefaultResponse, GetAnalyzeResultPdf200Response, GetAnalyzeResultPdfDefaultResponse, GetAnalyzeResultFigure200Response, GetAnalyzeResultFigureDefaultResponse, AnalyzeDocumentFromStream202Response, AnalyzeDocumentFromStreamDefaultResponse, AnalyzeDocument202Response, AnalyzeDocumentDefaultResponse, GetAnalyzeBatchResult200Response, GetAnalyzeBatchResultDefaultResponse, DeleteAnalyzeBatchResult204Response, DeleteAnalyzeBatchResultDefaultResponse, AnalyzeBatchDocuments202Response, AnalyzeBatchDocumentsDefaultResponse, ListAnalyzeBatchResults200Response, ListAnalyzeBatchResultsDefaultResponse, GetModel200Response, GetModelDefaultResponse, DeleteModel204Response, DeleteModelDefaultResponse, BuildModel202Response, BuildModelDefaultResponse, ComposeModel202Response, ComposeModelDefaultResponse, AuthorizeModelCopy200Response, AuthorizeModelCopyDefaultResponse, CopyModelTo202Response, CopyModelToDefaultResponse, ListModels200Response, ListModelsDefaultResponse, BuildClassifier202Response, BuildClassifierDefaultResponse, ListClassifiers200Response, ListClassifiersDefaultResponse, GetClassifier200Response, GetClassifierDefaultResponse, DeleteClassifier204Response, DeleteClassifierDefaultResponse, ClassifyDocumentFromStream202Response, ClassifyDocumentFromStreamDefaultResponse, ClassifyDocument202Response, ClassifyDocumentDefaultResponse, GetClassifyResult200Response, GetClassifyResultDefaultResponse, AuthorizeClassifierCopy200Response, AuthorizeClassifierCopyDefaultResponse, CopyClassifierTo202Response, CopyClassifierToDefaultResponse } from "./responses.js";
3
+ import type { Client, StreamableMethod } from "@azure-rest/core-client";
4
+ export interface ListOperations {
5
+ /** Lists all operations. */
6
+ get(options?: ListOperationsParameters): StreamableMethod<ListOperations200Response | ListOperationsDefaultResponse>;
7
+ }
8
+ export interface GetDocumentModelBuildOperation {
9
+ /** Gets operation info. */
10
+ get(options?: GetDocumentModelBuildOperationParameters): StreamableMethod<GetDocumentModelBuildOperation200Response | GetDocumentModelBuildOperationDefaultResponse>;
11
+ /** Gets operation info. */
12
+ get(options?: GetDocumentModelComposeOperationParameters): StreamableMethod<GetDocumentModelComposeOperation200Response | GetDocumentModelComposeOperationDefaultResponse>;
13
+ /** Gets operation info. */
14
+ get(options?: GetDocumentModelCopyToOperationParameters): StreamableMethod<GetDocumentModelCopyToOperation200Response | GetDocumentModelCopyToOperationDefaultResponse>;
15
+ /** Gets operation info. */
16
+ get(options?: GetDocumentClassifierCopyToOperationParameters): StreamableMethod<GetDocumentClassifierCopyToOperation200Response | GetDocumentClassifierCopyToOperationDefaultResponse>;
17
+ /** Gets operation info. */
18
+ get(options?: GetDocumentClassifierBuildOperationParameters): StreamableMethod<GetDocumentClassifierBuildOperation200Response | GetDocumentClassifierBuildOperationDefaultResponse>;
19
+ /** Gets operation info. */
20
+ get(options?: GetOperationParameters): StreamableMethod<GetOperation200Response | GetOperationDefaultResponse>;
21
+ }
22
+ export interface GetResourceDetails {
23
+ /** Return information about the current resource. */
24
+ get(options?: GetResourceDetailsParameters): StreamableMethod<GetResourceDetails200Response | GetResourceDetailsDefaultResponse>;
25
+ }
26
+ export interface GetAnalyzeResult {
27
+ /** Gets the result of document analysis. */
28
+ get(options?: GetAnalyzeResultParameters): StreamableMethod<GetAnalyzeResult200Response | GetAnalyzeResultDefaultResponse>;
29
+ /** Mark the result of document analysis for deletion. */
30
+ delete(options?: DeleteAnalyzeResultParameters): StreamableMethod<DeleteAnalyzeResult204Response | DeleteAnalyzeResultDefaultResponse>;
31
+ }
32
+ export interface GetAnalyzeResultPdf {
33
+ /** Gets the generated searchable PDF output from document analysis. */
34
+ get(options?: GetAnalyzeResultPdfParameters): StreamableMethod<GetAnalyzeResultPdf200Response | GetAnalyzeResultPdfDefaultResponse>;
35
+ }
36
+ export interface GetAnalyzeResultFigure {
37
+ /** Gets the generated cropped image of specified figure from document analysis. */
38
+ get(options?: GetAnalyzeResultFigureParameters): StreamableMethod<GetAnalyzeResultFigure200Response | GetAnalyzeResultFigureDefaultResponse>;
39
+ }
40
+ export interface AnalyzeDocumentFromStream {
41
+ /** Analyzes document with document model. */
42
+ post(options: AnalyzeDocumentFromStreamParameters): StreamableMethod<AnalyzeDocumentFromStream202Response | AnalyzeDocumentFromStreamDefaultResponse>;
43
+ /** Analyzes document with document model. */
44
+ post(options: AnalyzeDocumentParameters): StreamableMethod<AnalyzeDocument202Response | AnalyzeDocumentDefaultResponse>;
45
+ }
46
+ export interface GetAnalyzeBatchResult {
47
+ /** Gets the result of batch document analysis. */
48
+ get(options?: GetAnalyzeBatchResultParameters): StreamableMethod<GetAnalyzeBatchResult200Response | GetAnalyzeBatchResultDefaultResponse>;
49
+ /** Mark the batch document analysis result for deletion. */
50
+ delete(options?: DeleteAnalyzeBatchResultParameters): StreamableMethod<DeleteAnalyzeBatchResult204Response | DeleteAnalyzeBatchResultDefaultResponse>;
51
+ }
52
+ export interface AnalyzeBatchDocuments {
53
+ /** Analyzes batch documents with document model. */
54
+ post(options: AnalyzeBatchDocumentsParameters): StreamableMethod<AnalyzeBatchDocuments202Response | AnalyzeBatchDocumentsDefaultResponse>;
55
+ }
56
+ export interface ListAnalyzeBatchResults {
57
+ /** List batch document analysis results. */
58
+ get(options?: ListAnalyzeBatchResultsParameters): StreamableMethod<ListAnalyzeBatchResults200Response | ListAnalyzeBatchResultsDefaultResponse>;
59
+ }
60
+ export interface GetModel {
61
+ /** Gets detailed document model information. */
62
+ get(options?: GetModelParameters): StreamableMethod<GetModel200Response | GetModelDefaultResponse>;
63
+ /** Deletes document model. */
64
+ delete(options?: DeleteModelParameters): StreamableMethod<DeleteModel204Response | DeleteModelDefaultResponse>;
65
+ }
66
+ export interface BuildModel {
67
+ /** Builds a custom document analysis model. */
68
+ post(options: BuildModelParameters): StreamableMethod<BuildModel202Response | BuildModelDefaultResponse>;
69
+ }
70
+ export interface ComposeModel {
71
+ /** Creates a new document model from document types of existing document models. */
72
+ post(options: ComposeModelParameters): StreamableMethod<ComposeModel202Response | ComposeModelDefaultResponse>;
73
+ }
74
+ export interface AuthorizeModelCopy {
75
+ /**
76
+ * Generates authorization to copy a document model to this location with
77
+ * specified modelId and optional description.
78
+ */
79
+ post(options: AuthorizeModelCopyParameters): StreamableMethod<AuthorizeModelCopy200Response | AuthorizeModelCopyDefaultResponse>;
80
+ }
81
+ export interface CopyModelTo {
82
+ /** Copies document model to the target resource, region, and modelId. */
83
+ post(options: CopyModelToParameters): StreamableMethod<CopyModelTo202Response | CopyModelToDefaultResponse>;
84
+ }
85
+ export interface ListModels {
86
+ /** List all document models */
87
+ get(options?: ListModelsParameters): StreamableMethod<ListModels200Response | ListModelsDefaultResponse>;
88
+ }
89
+ export interface BuildClassifier {
90
+ /** Builds a custom document classifier. */
91
+ post(options: BuildClassifierParameters): StreamableMethod<BuildClassifier202Response | BuildClassifierDefaultResponse>;
92
+ }
93
+ export interface ListClassifiers {
94
+ /** List all document classifiers. */
95
+ get(options?: ListClassifiersParameters): StreamableMethod<ListClassifiers200Response | ListClassifiersDefaultResponse>;
96
+ }
97
+ export interface GetClassifier {
98
+ /** Gets detailed document classifier information. */
99
+ get(options?: GetClassifierParameters): StreamableMethod<GetClassifier200Response | GetClassifierDefaultResponse>;
100
+ /** Deletes document classifier. */
101
+ delete(options?: DeleteClassifierParameters): StreamableMethod<DeleteClassifier204Response | DeleteClassifierDefaultResponse>;
102
+ }
103
+ export interface ClassifyDocumentFromStream {
104
+ /** Classifies document with document classifier. */
105
+ post(options: ClassifyDocumentFromStreamParameters): StreamableMethod<ClassifyDocumentFromStream202Response | ClassifyDocumentFromStreamDefaultResponse>;
106
+ /** Classifies document with document classifier. */
107
+ post(options: ClassifyDocumentParameters): StreamableMethod<ClassifyDocument202Response | ClassifyDocumentDefaultResponse>;
108
+ }
109
+ export interface GetClassifyResult {
110
+ /** Gets the result of document classifier. */
111
+ get(options?: GetClassifyResultParameters): StreamableMethod<GetClassifyResult200Response | GetClassifyResultDefaultResponse>;
112
+ }
113
+ export interface AuthorizeClassifierCopy {
114
+ /**
115
+ * Generates authorization to copy a document classifier to this location with
116
+ * specified classifierId and optional description.
117
+ */
118
+ post(options: AuthorizeClassifierCopyParameters): StreamableMethod<AuthorizeClassifierCopy200Response | AuthorizeClassifierCopyDefaultResponse>;
119
+ }
120
+ export interface CopyClassifierTo {
121
+ /** Copies document classifier to the target resource, region, and classifierId. */
122
+ post(options: CopyClassifierToParameters): StreamableMethod<CopyClassifierTo202Response | CopyClassifierToDefaultResponse>;
123
+ }
124
+ export interface Routes {
125
+ /** Resource for '/operations' has methods for the following verbs: get */
126
+ (path: "/operations"): ListOperations;
127
+ /** Resource for '/operations/\{operationId\}' has methods for the following verbs: get */
128
+ (path: "/operations/{operationId}", operationId: string): GetDocumentModelBuildOperation;
129
+ /** Resource for '/info' has methods for the following verbs: get */
130
+ (path: "/info"): GetResourceDetails;
131
+ /** Resource for '/documentModels/\{modelId\}/analyzeResults/\{resultId\}' has methods for the following verbs: get, delete */
132
+ (path: "/documentModels/{modelId}/analyzeResults/{resultId}", modelId: string, resultId: string): GetAnalyzeResult;
133
+ /** Resource for '/documentModels/\{modelId\}/analyzeResults/\{resultId\}/pdf' has methods for the following verbs: get */
134
+ (path: "/documentModels/{modelId}/analyzeResults/{resultId}/pdf", modelId: string, resultId: string): GetAnalyzeResultPdf;
135
+ /** Resource for '/documentModels/\{modelId\}/analyzeResults/\{resultId\}/figures/\{figureId\}' has methods for the following verbs: get */
136
+ (path: "/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}", modelId: string, resultId: string, figureId: string): GetAnalyzeResultFigure;
137
+ /** Resource for '/documentModels/\{modelId\}:analyze' has methods for the following verbs: post */
138
+ (path: "/documentModels/{modelId}:analyze", modelId: string): AnalyzeDocumentFromStream;
139
+ /** Resource for '/documentModels/\{modelId\}/analyzeBatchResults/\{resultId\}' has methods for the following verbs: get, delete */
140
+ (path: "/documentModels/{modelId}/analyzeBatchResults/{resultId}", modelId: string, resultId: string): GetAnalyzeBatchResult;
141
+ /** Resource for '/documentModels/\{modelId\}:analyzeBatch' has methods for the following verbs: post */
142
+ (path: "/documentModels/{modelId}:analyzeBatch", modelId: string): AnalyzeBatchDocuments;
143
+ /** Resource for '/documentModels/\{modelId\}/analyzeBatchResults' has methods for the following verbs: get */
144
+ (path: "/documentModels/{modelId}/analyzeBatchResults", modelId: string): ListAnalyzeBatchResults;
145
+ /** Resource for '/documentModels/\{modelId\}' has methods for the following verbs: get, delete */
146
+ (path: "/documentModels/{modelId}", modelId: string): GetModel;
147
+ /** Resource for '/documentModels:build' has methods for the following verbs: post */
148
+ (path: "/documentModels:build"): BuildModel;
149
+ /** Resource for '/documentModels:compose' has methods for the following verbs: post */
150
+ (path: "/documentModels:compose"): ComposeModel;
151
+ /** Resource for '/documentModels:authorizeCopy' has methods for the following verbs: post */
152
+ (path: "/documentModels:authorizeCopy"): AuthorizeModelCopy;
153
+ /** Resource for '/documentModels/\{modelId\}:copyTo' has methods for the following verbs: post */
154
+ (path: "/documentModels/{modelId}:copyTo", modelId: string): CopyModelTo;
155
+ /** Resource for '/documentModels' has methods for the following verbs: get */
156
+ (path: "/documentModels"): ListModels;
157
+ /** Resource for '/documentClassifiers:build' has methods for the following verbs: post */
158
+ (path: "/documentClassifiers:build"): BuildClassifier;
159
+ /** Resource for '/documentClassifiers' has methods for the following verbs: get */
160
+ (path: "/documentClassifiers"): ListClassifiers;
161
+ /** Resource for '/documentClassifiers/\{classifierId\}' has methods for the following verbs: get, delete */
162
+ (path: "/documentClassifiers/{classifierId}", classifierId: string): GetClassifier;
163
+ /** Resource for '/documentClassifiers/\{classifierId\}:analyze' has methods for the following verbs: post */
164
+ (path: "/documentClassifiers/{classifierId}:analyze", classifierId: string): ClassifyDocumentFromStream;
165
+ /** Resource for '/documentClassifiers/\{classifierId\}/analyzeResults/\{resultId\}' has methods for the following verbs: get */
166
+ (path: "/documentClassifiers/{classifierId}/analyzeResults/{resultId}", classifierId: string, resultId: string): GetClassifyResult;
167
+ /** Resource for '/documentClassifiers:authorizeCopy' has methods for the following verbs: post */
168
+ (path: "/documentClassifiers:authorizeCopy"): AuthorizeClassifierCopy;
169
+ /** Resource for '/documentClassifiers/\{classifierId\}:copyTo' has methods for the following verbs: post */
170
+ (path: "/documentClassifiers/{classifierId}:copyTo", classifierId: string): CopyClassifierTo;
171
+ }
172
+ export type DocumentIntelligenceClient = Client & {
173
+ path: Routes;
174
+ };
175
+ //# sourceMappingURL=clientDefinitions.d.ts.map