@azure-rest/ai-document-intelligence 1.0.0-beta.3 → 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.
- package/CHANGELOG.md +109 -0
- package/README.md +134 -10
- package/dist/browser/clientDefinitions.d.ts +18 -8
- package/dist/browser/clientDefinitions.d.ts.map +1 -1
- package/dist/browser/clientDefinitions.js +1 -1
- package/dist/browser/clientDefinitions.js.map +1 -1
- package/dist/browser/documentIntelligence.d.ts +3 -3
- package/dist/browser/documentIntelligence.d.ts.map +1 -1
- package/dist/browser/documentIntelligence.js +3 -3
- package/dist/browser/documentIntelligence.js.map +1 -1
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +2 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/isUnexpected.d.ts +5 -2
- package/dist/browser/isUnexpected.d.ts.map +1 -1
- package/dist/browser/isUnexpected.js +4 -1
- package/dist/browser/isUnexpected.js.map +1 -1
- package/dist/browser/logger.js +1 -1
- package/dist/browser/logger.js.map +1 -1
- package/dist/browser/models.d.ts +5 -5
- package/dist/browser/models.d.ts.map +1 -1
- package/dist/browser/models.js +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/outputModels.d.ts +85 -58
- package/dist/browser/outputModels.d.ts.map +1 -1
- package/dist/browser/outputModels.js +1 -1
- package/dist/browser/outputModels.js.map +1 -1
- package/dist/browser/paginateHelper.d.ts +28 -3
- package/dist/browser/paginateHelper.d.ts.map +1 -1
- package/dist/browser/paginateHelper.js +99 -2
- package/dist/browser/paginateHelper.js.map +1 -1
- package/dist/browser/parameters.d.ts +108 -24
- package/dist/browser/parameters.d.ts.map +1 -1
- package/dist/browser/parameters.js +1 -1
- package/dist/browser/parameters.js.map +1 -1
- package/dist/browser/pollingHelper.d.ts +25 -73
- package/dist/browser/pollingHelper.d.ts.map +1 -1
- package/dist/browser/pollingHelper.js +13 -51
- package/dist/browser/pollingHelper.js.map +1 -1
- package/dist/browser/responses.d.ts +68 -43
- package/dist/browser/responses.d.ts.map +1 -1
- package/dist/browser/responses.js +1 -1
- package/dist/browser/responses.js.map +1 -1
- package/dist/browser/utils.d.ts +5 -0
- package/dist/browser/utils.d.ts.map +1 -0
- package/dist/browser/utils.js +33 -0
- package/dist/browser/utils.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +18 -8
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -1
- package/dist/commonjs/clientDefinitions.js +1 -1
- package/dist/commonjs/clientDefinitions.js.map +1 -1
- package/dist/commonjs/documentIntelligence.d.ts +3 -3
- package/dist/commonjs/documentIntelligence.d.ts.map +1 -1
- package/dist/commonjs/documentIntelligence.js +3 -3
- package/dist/commonjs/documentIntelligence.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/isUnexpected.d.ts +5 -2
- package/dist/commonjs/isUnexpected.d.ts.map +1 -1
- package/dist/commonjs/isUnexpected.js +4 -1
- package/dist/commonjs/isUnexpected.js.map +1 -1
- package/dist/commonjs/logger.js +1 -1
- package/dist/commonjs/logger.js.map +1 -1
- package/dist/commonjs/models.d.ts +5 -5
- package/dist/commonjs/models.d.ts.map +1 -1
- package/dist/commonjs/models.js +1 -1
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/outputModels.d.ts +85 -58
- package/dist/commonjs/outputModels.d.ts.map +1 -1
- package/dist/commonjs/outputModels.js +1 -1
- package/dist/commonjs/outputModels.js.map +1 -1
- package/dist/commonjs/paginateHelper.d.ts +28 -3
- package/dist/commonjs/paginateHelper.d.ts.map +1 -1
- package/dist/commonjs/paginateHelper.js +100 -3
- package/dist/commonjs/paginateHelper.js.map +1 -1
- package/dist/commonjs/parameters.d.ts +108 -24
- package/dist/commonjs/parameters.d.ts.map +1 -1
- package/dist/commonjs/parameters.js +1 -1
- package/dist/commonjs/parameters.js.map +1 -1
- package/dist/commonjs/pollingHelper.d.ts +25 -73
- package/dist/commonjs/pollingHelper.d.ts.map +1 -1
- package/dist/commonjs/pollingHelper.js +13 -50
- package/dist/commonjs/pollingHelper.js.map +1 -1
- package/dist/commonjs/responses.d.ts +68 -43
- package/dist/commonjs/responses.d.ts.map +1 -1
- package/dist/commonjs/responses.js +1 -1
- package/dist/commonjs/responses.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils.d.ts +5 -0
- package/dist/commonjs/utils.d.ts.map +1 -0
- package/dist/commonjs/utils.js +36 -0
- package/dist/commonjs/utils.js.map +1 -0
- package/dist/esm/clientDefinitions.d.ts +18 -8
- package/dist/esm/clientDefinitions.d.ts.map +1 -1
- package/dist/esm/clientDefinitions.js +1 -1
- package/dist/esm/clientDefinitions.js.map +1 -1
- package/dist/esm/documentIntelligence.d.ts +3 -3
- package/dist/esm/documentIntelligence.d.ts.map +1 -1
- package/dist/esm/documentIntelligence.js +3 -3
- package/dist/esm/documentIntelligence.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isUnexpected.d.ts +5 -2
- package/dist/esm/isUnexpected.d.ts.map +1 -1
- package/dist/esm/isUnexpected.js +4 -1
- package/dist/esm/isUnexpected.js.map +1 -1
- package/dist/esm/logger.js +1 -1
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/models.d.ts +5 -5
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/outputModels.d.ts +85 -58
- package/dist/esm/outputModels.d.ts.map +1 -1
- package/dist/esm/outputModels.js +1 -1
- package/dist/esm/outputModels.js.map +1 -1
- package/dist/esm/paginateHelper.d.ts +28 -3
- package/dist/esm/paginateHelper.d.ts.map +1 -1
- package/dist/esm/paginateHelper.js +99 -2
- package/dist/esm/paginateHelper.js.map +1 -1
- package/dist/esm/parameters.d.ts +108 -24
- package/dist/esm/parameters.d.ts.map +1 -1
- package/dist/esm/parameters.js +1 -1
- package/dist/esm/parameters.js.map +1 -1
- package/dist/esm/pollingHelper.d.ts +25 -73
- package/dist/esm/pollingHelper.d.ts.map +1 -1
- package/dist/esm/pollingHelper.js +13 -51
- package/dist/esm/pollingHelper.js.map +1 -1
- package/dist/esm/responses.d.ts +68 -43
- package/dist/esm/responses.d.ts.map +1 -1
- package/dist/esm/responses.js +1 -1
- package/dist/esm/responses.js.map +1 -1
- package/dist/esm/utils.d.ts +5 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +33 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +18 -8
- package/dist/react-native/clientDefinitions.d.ts.map +1 -1
- package/dist/react-native/clientDefinitions.js +1 -1
- package/dist/react-native/clientDefinitions.js.map +1 -1
- package/dist/react-native/documentIntelligence.d.ts +3 -3
- package/dist/react-native/documentIntelligence.d.ts.map +1 -1
- package/dist/react-native/documentIntelligence.js +3 -3
- package/dist/react-native/documentIntelligence.js.map +1 -1
- package/dist/react-native/index.d.ts +1 -0
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +2 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/isUnexpected.d.ts +5 -2
- package/dist/react-native/isUnexpected.d.ts.map +1 -1
- package/dist/react-native/isUnexpected.js +4 -1
- package/dist/react-native/isUnexpected.js.map +1 -1
- package/dist/react-native/logger.js +1 -1
- package/dist/react-native/logger.js.map +1 -1
- package/dist/react-native/models.d.ts +5 -5
- package/dist/react-native/models.d.ts.map +1 -1
- package/dist/react-native/models.js +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/outputModels.d.ts +85 -58
- package/dist/react-native/outputModels.d.ts.map +1 -1
- package/dist/react-native/outputModels.js +1 -1
- package/dist/react-native/outputModels.js.map +1 -1
- package/dist/react-native/paginateHelper.d.ts +28 -3
- package/dist/react-native/paginateHelper.d.ts.map +1 -1
- package/dist/react-native/paginateHelper.js +99 -2
- package/dist/react-native/paginateHelper.js.map +1 -1
- package/dist/react-native/parameters.d.ts +108 -24
- package/dist/react-native/parameters.d.ts.map +1 -1
- package/dist/react-native/parameters.js +1 -1
- package/dist/react-native/parameters.js.map +1 -1
- package/dist/react-native/pollingHelper.d.ts +25 -73
- package/dist/react-native/pollingHelper.d.ts.map +1 -1
- package/dist/react-native/pollingHelper.js +13 -51
- package/dist/react-native/pollingHelper.js.map +1 -1
- package/dist/react-native/responses.d.ts +68 -43
- package/dist/react-native/responses.d.ts.map +1 -1
- package/dist/react-native/responses.js +1 -1
- package/dist/react-native/responses.js.map +1 -1
- package/dist/react-native/utils.d.ts +5 -0
- package/dist/react-native/utils.d.ts.map +1 -0
- package/dist/react-native/utils.js +33 -0
- package/dist/react-native/utils.js.map +1 -0
- package/package.json +27 -37
- package/review/ai-document-intelligence.api.md +373 -221
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,114 @@
|
|
|
1
1
|
# Release History
|
|
2
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
|
+
|
|
3
112
|
## 1.0.0-beta.3 (2024-08-20)
|
|
4
113
|
|
|
5
114
|
### Features Added
|
package/README.md
CHANGED
|
@@ -15,15 +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-
|
|
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
|
|
25
|
-
| 1.0.0-beta.2 | 2024-02-29-preview |
|
|
26
|
-
| 1.0.0-beta.1 | 2023-10-31-preview |
|
|
24
|
+
| 1.0.0 | 2024-11-30 |
|
|
27
25
|
|
|
28
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).
|
|
29
27
|
|
|
@@ -31,9 +29,7 @@ The below table describes the relationship of each client and its supported API
|
|
|
31
29
|
|
|
32
30
|
| Service API version | Supported clients | Package |
|
|
33
31
|
| ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------- |
|
|
34
|
-
| 2024-
|
|
35
|
-
| 2024-02-29-preview | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0-beta.2` |
|
|
36
|
-
| 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` |
|
|
37
33
|
| 2023-07-31 | DocumentAnalysisClient and DocumentModelAdministrationClient | `@azure/ai-form-recognizer` version `^5.0.0` |
|
|
38
34
|
| 2022-08-01 | DocumentAnalysisClient and DocumentModelAdministrationClient | `@azure/ai-form-recognizer` version `^4.0.0` |
|
|
39
35
|
|
|
@@ -77,7 +73,7 @@ import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
|
|
|
77
73
|
|
|
78
74
|
const client = DocumentIntelligence(
|
|
79
75
|
process.env["DOCUMENT_INTELLIGENCE_ENDPOINT"],
|
|
80
|
-
new DefaultAzureCredential()
|
|
76
|
+
new DefaultAzureCredential()
|
|
81
77
|
);
|
|
82
78
|
```
|
|
83
79
|
|
|
@@ -139,7 +135,7 @@ import {
|
|
|
139
135
|
if (isUnexpected(initialResponse)) {
|
|
140
136
|
throw initialResponse.body.error;
|
|
141
137
|
}
|
|
142
|
-
const poller =
|
|
138
|
+
const poller = getLongRunningPoller(client, initialResponse);
|
|
143
139
|
const result = (await poller.pollUntilDone()).body as AnalyzeResultOperationOutput;
|
|
144
140
|
console.log(result);
|
|
145
141
|
// {
|
|
@@ -156,6 +152,42 @@ console.log(result);
|
|
|
156
152
|
// }
|
|
157
153
|
```
|
|
158
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
|
+
|
|
159
191
|
### Markdown content format
|
|
160
192
|
|
|
161
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.
|
|
@@ -246,7 +278,7 @@ const initialResponse = await client.path("/documentClassifiers:build").post({
|
|
|
246
278
|
if (isUnexpected(initialResponse)) {
|
|
247
279
|
throw initialResponse.body.error;
|
|
248
280
|
}
|
|
249
|
-
const poller =
|
|
281
|
+
const poller = getLongRunningPoller(client, initialResponse);
|
|
250
282
|
const response = (await poller.pollUntilDone())
|
|
251
283
|
.body as DocumentClassifierBuildOperationDetailsOutput;
|
|
252
284
|
console.log(response);
|
|
@@ -267,6 +299,98 @@ console.log(response);
|
|
|
267
299
|
// }
|
|
268
300
|
```
|
|
269
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
|
+
|
|
270
394
|
## Get Info
|
|
271
395
|
|
|
272
396
|
```ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ListOperationsParameters, GetDocumentModelBuildOperationParameters, GetDocumentModelComposeOperationParameters, GetDocumentModelCopyToOperationParameters, GetDocumentClassifierCopyToOperationParameters, GetDocumentClassifierBuildOperationParameters, GetOperationParameters,
|
|
2
|
-
import { ListOperations200Response, ListOperationsDefaultResponse, GetDocumentModelBuildOperation200Response, GetDocumentModelBuildOperationDefaultResponse, GetDocumentModelComposeOperation200Response, GetDocumentModelComposeOperationDefaultResponse, GetDocumentModelCopyToOperation200Response, GetDocumentModelCopyToOperationDefaultResponse, GetDocumentClassifierCopyToOperation200Response, GetDocumentClassifierCopyToOperationDefaultResponse, GetDocumentClassifierBuildOperation200Response, GetDocumentClassifierBuildOperationDefaultResponse, GetOperation200Response, GetOperationDefaultResponse,
|
|
3
|
-
import { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
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
4
|
export interface ListOperations {
|
|
5
5
|
/** Lists all operations. */
|
|
6
6
|
get(options?: ListOperationsParameters): StreamableMethod<ListOperations200Response | ListOperationsDefaultResponse>;
|
|
@@ -19,13 +19,15 @@ export interface GetDocumentModelBuildOperation {
|
|
|
19
19
|
/** Gets operation info. */
|
|
20
20
|
get(options?: GetOperationParameters): StreamableMethod<GetOperation200Response | GetOperationDefaultResponse>;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface GetResourceDetails {
|
|
23
23
|
/** Return information about the current resource. */
|
|
24
|
-
get(options?:
|
|
24
|
+
get(options?: GetResourceDetailsParameters): StreamableMethod<GetResourceDetails200Response | GetResourceDetailsDefaultResponse>;
|
|
25
25
|
}
|
|
26
26
|
export interface GetAnalyzeResult {
|
|
27
27
|
/** Gets the result of document analysis. */
|
|
28
28
|
get(options?: GetAnalyzeResultParameters): StreamableMethod<GetAnalyzeResult200Response | GetAnalyzeResultDefaultResponse>;
|
|
29
|
+
/** Mark the result of document analysis for deletion. */
|
|
30
|
+
delete(options?: DeleteAnalyzeResultParameters): StreamableMethod<DeleteAnalyzeResult204Response | DeleteAnalyzeResultDefaultResponse>;
|
|
29
31
|
}
|
|
30
32
|
export interface GetAnalyzeResultPdf {
|
|
31
33
|
/** Gets the generated searchable PDF output from document analysis. */
|
|
@@ -44,11 +46,17 @@ export interface AnalyzeDocumentFromStream {
|
|
|
44
46
|
export interface GetAnalyzeBatchResult {
|
|
45
47
|
/** Gets the result of batch document analysis. */
|
|
46
48
|
get(options?: GetAnalyzeBatchResultParameters): StreamableMethod<GetAnalyzeBatchResult200Response | GetAnalyzeBatchResultDefaultResponse>;
|
|
49
|
+
/** Mark the batch document analysis result for deletion. */
|
|
50
|
+
delete(options?: DeleteAnalyzeBatchResultParameters): StreamableMethod<DeleteAnalyzeBatchResult204Response | DeleteAnalyzeBatchResultDefaultResponse>;
|
|
47
51
|
}
|
|
48
52
|
export interface AnalyzeBatchDocuments {
|
|
49
53
|
/** Analyzes batch documents with document model. */
|
|
50
54
|
post(options: AnalyzeBatchDocumentsParameters): StreamableMethod<AnalyzeBatchDocuments202Response | AnalyzeBatchDocumentsDefaultResponse>;
|
|
51
55
|
}
|
|
56
|
+
export interface ListAnalyzeBatchResults {
|
|
57
|
+
/** List batch document analysis results. */
|
|
58
|
+
get(options?: ListAnalyzeBatchResultsParameters): StreamableMethod<ListAnalyzeBatchResults200Response | ListAnalyzeBatchResultsDefaultResponse>;
|
|
59
|
+
}
|
|
52
60
|
export interface GetModel {
|
|
53
61
|
/** Gets detailed document model information. */
|
|
54
62
|
get(options?: GetModelParameters): StreamableMethod<GetModel200Response | GetModelDefaultResponse>;
|
|
@@ -119,8 +127,8 @@ export interface Routes {
|
|
|
119
127
|
/** Resource for '/operations/\{operationId\}' has methods for the following verbs: get */
|
|
120
128
|
(path: "/operations/{operationId}", operationId: string): GetDocumentModelBuildOperation;
|
|
121
129
|
/** Resource for '/info' has methods for the following verbs: get */
|
|
122
|
-
(path: "/info"):
|
|
123
|
-
/** Resource for '/documentModels/\{modelId\}/analyzeResults/\{resultId\}' 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 */
|
|
124
132
|
(path: "/documentModels/{modelId}/analyzeResults/{resultId}", modelId: string, resultId: string): GetAnalyzeResult;
|
|
125
133
|
/** Resource for '/documentModels/\{modelId\}/analyzeResults/\{resultId\}/pdf' has methods for the following verbs: get */
|
|
126
134
|
(path: "/documentModels/{modelId}/analyzeResults/{resultId}/pdf", modelId: string, resultId: string): GetAnalyzeResultPdf;
|
|
@@ -128,10 +136,12 @@ export interface Routes {
|
|
|
128
136
|
(path: "/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}", modelId: string, resultId: string, figureId: string): GetAnalyzeResultFigure;
|
|
129
137
|
/** Resource for '/documentModels/\{modelId\}:analyze' has methods for the following verbs: post */
|
|
130
138
|
(path: "/documentModels/{modelId}:analyze", modelId: string): AnalyzeDocumentFromStream;
|
|
131
|
-
/** Resource for '/documentModels/\{modelId\}/analyzeBatchResults/\{resultId\}' has methods for the following verbs: get */
|
|
139
|
+
/** Resource for '/documentModels/\{modelId\}/analyzeBatchResults/\{resultId\}' has methods for the following verbs: get, delete */
|
|
132
140
|
(path: "/documentModels/{modelId}/analyzeBatchResults/{resultId}", modelId: string, resultId: string): GetAnalyzeBatchResult;
|
|
133
141
|
/** Resource for '/documentModels/\{modelId\}:analyzeBatch' has methods for the following verbs: post */
|
|
134
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;
|
|
135
145
|
/** Resource for '/documentModels/\{modelId\}' has methods for the following verbs: get, delete */
|
|
136
146
|
(path: "/documentModels/{modelId}", modelId: string): GetModel;
|
|
137
147
|
/** Resource for '/documentModels:build' has methods for the following verbs: post */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EACxB,wCAAwC,EACxC,0CAA0C,EAC1C,yCAAyC,EACzC,8CAA8C,EAC9C,6CAA6C,EAC7C,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,gCAAgC,EAChC,mCAAmC,EACnC,yBAAyB,EACzB,+BAA+B,EAC/B,kCAAkC,EAClC,+BAA+B,EAC/B,iCAAiC,EACjC,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,oCAAoC,EACpC,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,yCAAyC,EACzC,6CAA6C,EAC7C,2CAA2C,EAC3C,+CAA+C,EAC/C,0CAA0C,EAC1C,8CAA8C,EAC9C,+CAA+C,EAC/C,mDAAmD,EACnD,8CAA8C,EAC9C,kDAAkD,EAClD,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,iCAAiC,EACjC,qCAAqC,EACrC,oCAAoC,EACpC,wCAAwC,EACxC,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,EAChC,oCAAoC,EACpC,mCAAmC,EACnC,uCAAuC,EACvC,gCAAgC,EAChC,oCAAoC,EACpC,kCAAkC,EAClC,sCAAsC,EACtC,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O,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/D,qFAAqF;IACrF,CAAC,IAAI,EAAE,uBAAuB,GAAG,UAAU,CAAC;IAC5C,uFAAuF;IACvF,CAAC,IAAI,EAAE,yBAAyB,GAAG,YAAY,CAAC;IAChD,6FAA6F;IAC7F,CAAC,IAAI,EAAE,+BAA+B,GAAG,kBAAkB,CAAC;IAC5D,kGAAkG;IAClG,CAAC,IAAI,EAAE,kCAAkC,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IACzE,8EAA8E;IAC9E,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAAC;IACtC,0FAA0F;IAC1F,CAAC,IAAI,EAAE,4BAA4B,GAAG,eAAe,CAAC;IACtD,mFAAmF;IACnF,CAAC,IAAI,EAAE,sBAAsB,GAAG,eAAe,CAAC;IAChD,4GAA4G;IAC5G,CAAC,IAAI,EAAE,qCAAqC,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IACnF,6GAA6G;IAC7G,CACE,IAAI,EAAE,6CAA6C,EACnD,YAAY,EAAE,MAAM,GACnB,0BAA0B,CAAC;IAC9B,gIAAgI;IAChI,CACE,IAAI,EAAE,+DAA+D,EACrE,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,iBAAiB,CAAC;IACrB,kGAAkG;IAClG,CAAC,IAAI,EAAE,oCAAoC,GAAG,uBAAuB,CAAC;IACtE,4GAA4G;IAC5G,CAAC,IAAI,EAAE,4CAA4C,EAAE,YAAY,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC9F;AAED,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ListOperationsParameters,\n GetDocumentModelBuildOperationParameters,\n GetDocumentModelComposeOperationParameters,\n GetDocumentModelCopyToOperationParameters,\n GetDocumentClassifierCopyToOperationParameters,\n GetDocumentClassifierBuildOperationParameters,\n GetOperationParameters,\n GetResourceInfoParameters,\n GetAnalyzeResultParameters,\n GetAnalyzeResultPdfParameters,\n GetAnalyzeResultFigureParameters,\n AnalyzeDocumentFromStreamParameters,\n AnalyzeDocumentParameters,\n GetAnalyzeBatchResultParameters,\n AnalyzeBatchDocumentsParameters,\n GetModelParameters,\n DeleteModelParameters,\n BuildModelParameters,\n ComposeModelParameters,\n AuthorizeModelCopyParameters,\n CopyModelToParameters,\n ListModelsParameters,\n BuildClassifierParameters,\n ListClassifiersParameters,\n GetClassifierParameters,\n DeleteClassifierParameters,\n ClassifyDocumentFromStreamParameters,\n ClassifyDocumentParameters,\n GetClassifyResultParameters,\n AuthorizeClassifierCopyParameters,\n CopyClassifierToParameters,\n} from \"./parameters.js\";\nimport {\n ListOperations200Response,\n ListOperationsDefaultResponse,\n GetDocumentModelBuildOperation200Response,\n GetDocumentModelBuildOperationDefaultResponse,\n GetDocumentModelComposeOperation200Response,\n GetDocumentModelComposeOperationDefaultResponse,\n GetDocumentModelCopyToOperation200Response,\n GetDocumentModelCopyToOperationDefaultResponse,\n GetDocumentClassifierCopyToOperation200Response,\n GetDocumentClassifierCopyToOperationDefaultResponse,\n GetDocumentClassifierBuildOperation200Response,\n GetDocumentClassifierBuildOperationDefaultResponse,\n GetOperation200Response,\n GetOperationDefaultResponse,\n GetResourceInfo200Response,\n GetResourceInfoDefaultResponse,\n GetAnalyzeResult200Response,\n GetAnalyzeResultDefaultResponse,\n GetAnalyzeResultPdf200Response,\n GetAnalyzeResultPdfDefaultResponse,\n GetAnalyzeResultFigure200Response,\n GetAnalyzeResultFigureDefaultResponse,\n AnalyzeDocumentFromStream202Response,\n AnalyzeDocumentFromStreamDefaultResponse,\n AnalyzeDocument202Response,\n AnalyzeDocumentDefaultResponse,\n GetAnalyzeBatchResult200Response,\n GetAnalyzeBatchResultDefaultResponse,\n AnalyzeBatchDocuments202Response,\n AnalyzeBatchDocumentsDefaultResponse,\n GetModel200Response,\n GetModelDefaultResponse,\n DeleteModel204Response,\n DeleteModelDefaultResponse,\n BuildModel202Response,\n BuildModelDefaultResponse,\n ComposeModel202Response,\n ComposeModelDefaultResponse,\n AuthorizeModelCopy200Response,\n AuthorizeModelCopyDefaultResponse,\n CopyModelTo202Response,\n CopyModelToDefaultResponse,\n ListModels200Response,\n ListModelsDefaultResponse,\n BuildClassifier202Response,\n BuildClassifierDefaultResponse,\n ListClassifiers200Response,\n ListClassifiersDefaultResponse,\n GetClassifier200Response,\n GetClassifierDefaultResponse,\n DeleteClassifier204Response,\n DeleteClassifierDefaultResponse,\n ClassifyDocumentFromStream202Response,\n ClassifyDocumentFromStreamDefaultResponse,\n ClassifyDocument202Response,\n ClassifyDocumentDefaultResponse,\n GetClassifyResult200Response,\n GetClassifyResultDefaultResponse,\n AuthorizeClassifierCopy200Response,\n AuthorizeClassifierCopyDefaultResponse,\n CopyClassifierTo202Response,\n CopyClassifierToDefaultResponse,\n} from \"./responses.js\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ListOperations {\n /** Lists all operations. */\n get(\n options?: ListOperationsParameters,\n ): StreamableMethod<ListOperations200Response | ListOperationsDefaultResponse>;\n}\n\nexport interface GetDocumentModelBuildOperation {\n /** Gets operation info. */\n get(\n options?: GetDocumentModelBuildOperationParameters,\n ): StreamableMethod<\n GetDocumentModelBuildOperation200Response | GetDocumentModelBuildOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentModelComposeOperationParameters,\n ): StreamableMethod<\n GetDocumentModelComposeOperation200Response | GetDocumentModelComposeOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentModelCopyToOperationParameters,\n ): StreamableMethod<\n GetDocumentModelCopyToOperation200Response | GetDocumentModelCopyToOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentClassifierCopyToOperationParameters,\n ): StreamableMethod<\n | GetDocumentClassifierCopyToOperation200Response\n | GetDocumentClassifierCopyToOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentClassifierBuildOperationParameters,\n ): StreamableMethod<\n | GetDocumentClassifierBuildOperation200Response\n | GetDocumentClassifierBuildOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetOperationParameters,\n ): StreamableMethod<GetOperation200Response | GetOperationDefaultResponse>;\n}\n\nexport interface GetResourceInfo {\n /** Return information about the current resource. */\n get(\n options?: GetResourceInfoParameters,\n ): StreamableMethod<GetResourceInfo200Response | GetResourceInfoDefaultResponse>;\n}\n\nexport interface GetAnalyzeResult {\n /** Gets the result of document analysis. */\n get(\n options?: GetAnalyzeResultParameters,\n ): StreamableMethod<GetAnalyzeResult200Response | GetAnalyzeResultDefaultResponse>;\n}\n\nexport interface GetAnalyzeResultPdf {\n /** Gets the generated searchable PDF output from document analysis. */\n get(\n options?: GetAnalyzeResultPdfParameters,\n ): StreamableMethod<GetAnalyzeResultPdf200Response | GetAnalyzeResultPdfDefaultResponse>;\n}\n\nexport interface GetAnalyzeResultFigure {\n /** Gets the generated cropped image of specified figure from document analysis. */\n get(\n options?: GetAnalyzeResultFigureParameters,\n ): StreamableMethod<GetAnalyzeResultFigure200Response | GetAnalyzeResultFigureDefaultResponse>;\n}\n\nexport interface AnalyzeDocumentFromStream {\n /** Analyzes document with document model. */\n post(\n options: AnalyzeDocumentFromStreamParameters,\n ): StreamableMethod<\n AnalyzeDocumentFromStream202Response | AnalyzeDocumentFromStreamDefaultResponse\n >;\n /** Analyzes document with document model. */\n post(\n options: AnalyzeDocumentParameters,\n ): StreamableMethod<AnalyzeDocument202Response | AnalyzeDocumentDefaultResponse>;\n}\n\nexport interface GetAnalyzeBatchResult {\n /** Gets the result of batch document analysis. */\n get(\n options?: GetAnalyzeBatchResultParameters,\n ): StreamableMethod<GetAnalyzeBatchResult200Response | GetAnalyzeBatchResultDefaultResponse>;\n}\n\nexport interface AnalyzeBatchDocuments {\n /** Analyzes batch documents with document model. */\n post(\n options: AnalyzeBatchDocumentsParameters,\n ): StreamableMethod<AnalyzeBatchDocuments202Response | AnalyzeBatchDocumentsDefaultResponse>;\n}\n\nexport interface GetModel {\n /** Gets detailed document model information. */\n get(\n options?: GetModelParameters,\n ): StreamableMethod<GetModel200Response | GetModelDefaultResponse>;\n /** Deletes document model. */\n delete(\n options?: DeleteModelParameters,\n ): StreamableMethod<DeleteModel204Response | DeleteModelDefaultResponse>;\n}\n\nexport interface BuildModel {\n /** Builds a custom document analysis model. */\n post(\n options: BuildModelParameters,\n ): StreamableMethod<BuildModel202Response | BuildModelDefaultResponse>;\n}\n\nexport interface ComposeModel {\n /** Creates a new document model from document types of existing document models. */\n post(\n options: ComposeModelParameters,\n ): StreamableMethod<ComposeModel202Response | ComposeModelDefaultResponse>;\n}\n\nexport interface AuthorizeModelCopy {\n /**\n * Generates authorization to copy a document model to this location with\n * specified modelId and optional description.\n */\n post(\n options: AuthorizeModelCopyParameters,\n ): StreamableMethod<AuthorizeModelCopy200Response | AuthorizeModelCopyDefaultResponse>;\n}\n\nexport interface CopyModelTo {\n /** Copies document model to the target resource, region, and modelId. */\n post(\n options: CopyModelToParameters,\n ): StreamableMethod<CopyModelTo202Response | CopyModelToDefaultResponse>;\n}\n\nexport interface ListModels {\n /** List all document models */\n get(\n options?: ListModelsParameters,\n ): StreamableMethod<ListModels200Response | ListModelsDefaultResponse>;\n}\n\nexport interface BuildClassifier {\n /** Builds a custom document classifier. */\n post(\n options: BuildClassifierParameters,\n ): StreamableMethod<BuildClassifier202Response | BuildClassifierDefaultResponse>;\n}\n\nexport interface ListClassifiers {\n /** List all document classifiers. */\n get(\n options?: ListClassifiersParameters,\n ): StreamableMethod<ListClassifiers200Response | ListClassifiersDefaultResponse>;\n}\n\nexport interface GetClassifier {\n /** Gets detailed document classifier information. */\n get(\n options?: GetClassifierParameters,\n ): StreamableMethod<GetClassifier200Response | GetClassifierDefaultResponse>;\n /** Deletes document classifier. */\n delete(\n options?: DeleteClassifierParameters,\n ): StreamableMethod<DeleteClassifier204Response | DeleteClassifierDefaultResponse>;\n}\n\nexport interface ClassifyDocumentFromStream {\n /** Classifies document with document classifier. */\n post(\n options: ClassifyDocumentFromStreamParameters,\n ): StreamableMethod<\n ClassifyDocumentFromStream202Response | ClassifyDocumentFromStreamDefaultResponse\n >;\n /** Classifies document with document classifier. */\n post(\n options: ClassifyDocumentParameters,\n ): StreamableMethod<ClassifyDocument202Response | ClassifyDocumentDefaultResponse>;\n}\n\nexport interface GetClassifyResult {\n /** Gets the result of document classifier. */\n get(\n options?: GetClassifyResultParameters,\n ): StreamableMethod<GetClassifyResult200Response | GetClassifyResultDefaultResponse>;\n}\n\nexport interface AuthorizeClassifierCopy {\n /**\n * Generates authorization to copy a document classifier to this location with\n * specified classifierId and optional description.\n */\n post(\n options: AuthorizeClassifierCopyParameters,\n ): StreamableMethod<AuthorizeClassifierCopy200Response | AuthorizeClassifierCopyDefaultResponse>;\n}\n\nexport interface CopyClassifierTo {\n /** Copies document classifier to the target resource, region, and classifierId. */\n post(\n options: CopyClassifierToParameters,\n ): StreamableMethod<CopyClassifierTo202Response | CopyClassifierToDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/operations' has methods for the following verbs: get */\n (path: \"/operations\"): ListOperations;\n /** Resource for '/operations/\\{operationId\\}' has methods for the following verbs: get */\n (path: \"/operations/{operationId}\", operationId: string): GetDocumentModelBuildOperation;\n /** Resource for '/info' has methods for the following verbs: get */\n (path: \"/info\"): GetResourceInfo;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeResults/\\{resultId\\}' has methods for the following verbs: get */\n (\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}\",\n modelId: string,\n resultId: string,\n ): GetAnalyzeResult;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeResults/\\{resultId\\}/pdf' has methods for the following verbs: get */\n (\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}/pdf\",\n modelId: string,\n resultId: string,\n ): GetAnalyzeResultPdf;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeResults/\\{resultId\\}/figures/\\{figureId\\}' has methods for the following verbs: get */\n (\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}\",\n modelId: string,\n resultId: string,\n figureId: string,\n ): GetAnalyzeResultFigure;\n /** Resource for '/documentModels/\\{modelId\\}:analyze' has methods for the following verbs: post */\n (path: \"/documentModels/{modelId}:analyze\", modelId: string): AnalyzeDocumentFromStream;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeBatchResults/\\{resultId\\}' has methods for the following verbs: get */\n (\n path: \"/documentModels/{modelId}/analyzeBatchResults/{resultId}\",\n modelId: string,\n resultId: string,\n ): GetAnalyzeBatchResult;\n /** Resource for '/documentModels/\\{modelId\\}:analyzeBatch' has methods for the following verbs: post */\n (path: \"/documentModels/{modelId}:analyzeBatch\", modelId: string): AnalyzeBatchDocuments;\n /** Resource for '/documentModels/\\{modelId\\}' has methods for the following verbs: get, delete */\n (path: \"/documentModels/{modelId}\", modelId: string): GetModel;\n /** Resource for '/documentModels:build' has methods for the following verbs: post */\n (path: \"/documentModels:build\"): BuildModel;\n /** Resource for '/documentModels:compose' has methods for the following verbs: post */\n (path: \"/documentModels:compose\"): ComposeModel;\n /** Resource for '/documentModels:authorizeCopy' has methods for the following verbs: post */\n (path: \"/documentModels:authorizeCopy\"): AuthorizeModelCopy;\n /** Resource for '/documentModels/\\{modelId\\}:copyTo' has methods for the following verbs: post */\n (path: \"/documentModels/{modelId}:copyTo\", modelId: string): CopyModelTo;\n /** Resource for '/documentModels' has methods for the following verbs: get */\n (path: \"/documentModels\"): ListModels;\n /** Resource for '/documentClassifiers:build' has methods for the following verbs: post */\n (path: \"/documentClassifiers:build\"): BuildClassifier;\n /** Resource for '/documentClassifiers' has methods for the following verbs: get */\n (path: \"/documentClassifiers\"): ListClassifiers;\n /** Resource for '/documentClassifiers/\\{classifierId\\}' has methods for the following verbs: get, delete */\n (path: \"/documentClassifiers/{classifierId}\", classifierId: string): GetClassifier;\n /** Resource for '/documentClassifiers/\\{classifierId\\}:analyze' has methods for the following verbs: post */\n (\n path: \"/documentClassifiers/{classifierId}:analyze\",\n classifierId: string,\n ): ClassifyDocumentFromStream;\n /** Resource for '/documentClassifiers/\\{classifierId\\}/analyzeResults/\\{resultId\\}' has methods for the following verbs: get */\n (\n path: \"/documentClassifiers/{classifierId}/analyzeResults/{resultId}\",\n classifierId: string,\n resultId: string,\n ): GetClassifyResult;\n /** Resource for '/documentClassifiers:authorizeCopy' has methods for the following verbs: post */\n (path: \"/documentClassifiers:authorizeCopy\"): AuthorizeClassifierCopy;\n /** Resource for '/documentClassifiers/\\{classifierId\\}:copyTo' has methods for the following verbs: post */\n (path: \"/documentClassifiers/{classifierId}:copyTo\", classifierId: string): CopyClassifierTo;\n}\n\nexport type DocumentIntelligenceClient = Client & {\n path: Routes;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ListOperationsParameters,\n GetDocumentModelBuildOperationParameters,\n GetDocumentModelComposeOperationParameters,\n GetDocumentModelCopyToOperationParameters,\n GetDocumentClassifierCopyToOperationParameters,\n GetDocumentClassifierBuildOperationParameters,\n GetOperationParameters,\n GetResourceDetailsParameters,\n GetAnalyzeResultParameters,\n DeleteAnalyzeResultParameters,\n GetAnalyzeResultPdfParameters,\n GetAnalyzeResultFigureParameters,\n AnalyzeDocumentFromStreamParameters,\n AnalyzeDocumentParameters,\n GetAnalyzeBatchResultParameters,\n DeleteAnalyzeBatchResultParameters,\n AnalyzeBatchDocumentsParameters,\n ListAnalyzeBatchResultsParameters,\n GetModelParameters,\n DeleteModelParameters,\n BuildModelParameters,\n ComposeModelParameters,\n AuthorizeModelCopyParameters,\n CopyModelToParameters,\n ListModelsParameters,\n BuildClassifierParameters,\n ListClassifiersParameters,\n GetClassifierParameters,\n DeleteClassifierParameters,\n ClassifyDocumentFromStreamParameters,\n ClassifyDocumentParameters,\n GetClassifyResultParameters,\n AuthorizeClassifierCopyParameters,\n CopyClassifierToParameters,\n} from \"./parameters.js\";\nimport type {\n ListOperations200Response,\n ListOperationsDefaultResponse,\n GetDocumentModelBuildOperation200Response,\n GetDocumentModelBuildOperationDefaultResponse,\n GetDocumentModelComposeOperation200Response,\n GetDocumentModelComposeOperationDefaultResponse,\n GetDocumentModelCopyToOperation200Response,\n GetDocumentModelCopyToOperationDefaultResponse,\n GetDocumentClassifierCopyToOperation200Response,\n GetDocumentClassifierCopyToOperationDefaultResponse,\n GetDocumentClassifierBuildOperation200Response,\n GetDocumentClassifierBuildOperationDefaultResponse,\n GetOperation200Response,\n GetOperationDefaultResponse,\n GetResourceDetails200Response,\n GetResourceDetailsDefaultResponse,\n GetAnalyzeResult200Response,\n GetAnalyzeResultDefaultResponse,\n DeleteAnalyzeResult204Response,\n DeleteAnalyzeResultDefaultResponse,\n GetAnalyzeResultPdf200Response,\n GetAnalyzeResultPdfDefaultResponse,\n GetAnalyzeResultFigure200Response,\n GetAnalyzeResultFigureDefaultResponse,\n AnalyzeDocumentFromStream202Response,\n AnalyzeDocumentFromStreamDefaultResponse,\n AnalyzeDocument202Response,\n AnalyzeDocumentDefaultResponse,\n GetAnalyzeBatchResult200Response,\n GetAnalyzeBatchResultDefaultResponse,\n DeleteAnalyzeBatchResult204Response,\n DeleteAnalyzeBatchResultDefaultResponse,\n AnalyzeBatchDocuments202Response,\n AnalyzeBatchDocumentsDefaultResponse,\n ListAnalyzeBatchResults200Response,\n ListAnalyzeBatchResultsDefaultResponse,\n GetModel200Response,\n GetModelDefaultResponse,\n DeleteModel204Response,\n DeleteModelDefaultResponse,\n BuildModel202Response,\n BuildModelDefaultResponse,\n ComposeModel202Response,\n ComposeModelDefaultResponse,\n AuthorizeModelCopy200Response,\n AuthorizeModelCopyDefaultResponse,\n CopyModelTo202Response,\n CopyModelToDefaultResponse,\n ListModels200Response,\n ListModelsDefaultResponse,\n BuildClassifier202Response,\n BuildClassifierDefaultResponse,\n ListClassifiers200Response,\n ListClassifiersDefaultResponse,\n GetClassifier200Response,\n GetClassifierDefaultResponse,\n DeleteClassifier204Response,\n DeleteClassifierDefaultResponse,\n ClassifyDocumentFromStream202Response,\n ClassifyDocumentFromStreamDefaultResponse,\n ClassifyDocument202Response,\n ClassifyDocumentDefaultResponse,\n GetClassifyResult200Response,\n GetClassifyResultDefaultResponse,\n AuthorizeClassifierCopy200Response,\n AuthorizeClassifierCopyDefaultResponse,\n CopyClassifierTo202Response,\n CopyClassifierToDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ListOperations {\n /** Lists all operations. */\n get(\n options?: ListOperationsParameters,\n ): StreamableMethod<ListOperations200Response | ListOperationsDefaultResponse>;\n}\n\nexport interface GetDocumentModelBuildOperation {\n /** Gets operation info. */\n get(\n options?: GetDocumentModelBuildOperationParameters,\n ): StreamableMethod<\n GetDocumentModelBuildOperation200Response | GetDocumentModelBuildOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentModelComposeOperationParameters,\n ): StreamableMethod<\n GetDocumentModelComposeOperation200Response | GetDocumentModelComposeOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentModelCopyToOperationParameters,\n ): StreamableMethod<\n GetDocumentModelCopyToOperation200Response | GetDocumentModelCopyToOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentClassifierCopyToOperationParameters,\n ): StreamableMethod<\n | GetDocumentClassifierCopyToOperation200Response\n | GetDocumentClassifierCopyToOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetDocumentClassifierBuildOperationParameters,\n ): StreamableMethod<\n | GetDocumentClassifierBuildOperation200Response\n | GetDocumentClassifierBuildOperationDefaultResponse\n >;\n /** Gets operation info. */\n get(\n options?: GetOperationParameters,\n ): StreamableMethod<GetOperation200Response | GetOperationDefaultResponse>;\n}\n\nexport interface GetResourceDetails {\n /** Return information about the current resource. */\n get(\n options?: GetResourceDetailsParameters,\n ): StreamableMethod<GetResourceDetails200Response | GetResourceDetailsDefaultResponse>;\n}\n\nexport interface GetAnalyzeResult {\n /** Gets the result of document analysis. */\n get(\n options?: GetAnalyzeResultParameters,\n ): StreamableMethod<GetAnalyzeResult200Response | GetAnalyzeResultDefaultResponse>;\n /** Mark the result of document analysis for deletion. */\n delete(\n options?: DeleteAnalyzeResultParameters,\n ): StreamableMethod<DeleteAnalyzeResult204Response | DeleteAnalyzeResultDefaultResponse>;\n}\n\nexport interface GetAnalyzeResultPdf {\n /** Gets the generated searchable PDF output from document analysis. */\n get(\n options?: GetAnalyzeResultPdfParameters,\n ): StreamableMethod<GetAnalyzeResultPdf200Response | GetAnalyzeResultPdfDefaultResponse>;\n}\n\nexport interface GetAnalyzeResultFigure {\n /** Gets the generated cropped image of specified figure from document analysis. */\n get(\n options?: GetAnalyzeResultFigureParameters,\n ): StreamableMethod<GetAnalyzeResultFigure200Response | GetAnalyzeResultFigureDefaultResponse>;\n}\n\nexport interface AnalyzeDocumentFromStream {\n /** Analyzes document with document model. */\n post(\n options: AnalyzeDocumentFromStreamParameters,\n ): StreamableMethod<\n AnalyzeDocumentFromStream202Response | AnalyzeDocumentFromStreamDefaultResponse\n >;\n /** Analyzes document with document model. */\n post(\n options: AnalyzeDocumentParameters,\n ): StreamableMethod<AnalyzeDocument202Response | AnalyzeDocumentDefaultResponse>;\n}\n\nexport interface GetAnalyzeBatchResult {\n /** Gets the result of batch document analysis. */\n get(\n options?: GetAnalyzeBatchResultParameters,\n ): StreamableMethod<GetAnalyzeBatchResult200Response | GetAnalyzeBatchResultDefaultResponse>;\n /** Mark the batch document analysis result for deletion. */\n delete(\n options?: DeleteAnalyzeBatchResultParameters,\n ): StreamableMethod<\n DeleteAnalyzeBatchResult204Response | DeleteAnalyzeBatchResultDefaultResponse\n >;\n}\n\nexport interface AnalyzeBatchDocuments {\n /** Analyzes batch documents with document model. */\n post(\n options: AnalyzeBatchDocumentsParameters,\n ): StreamableMethod<AnalyzeBatchDocuments202Response | AnalyzeBatchDocumentsDefaultResponse>;\n}\n\nexport interface ListAnalyzeBatchResults {\n /** List batch document analysis results. */\n get(\n options?: ListAnalyzeBatchResultsParameters,\n ): StreamableMethod<ListAnalyzeBatchResults200Response | ListAnalyzeBatchResultsDefaultResponse>;\n}\n\nexport interface GetModel {\n /** Gets detailed document model information. */\n get(\n options?: GetModelParameters,\n ): StreamableMethod<GetModel200Response | GetModelDefaultResponse>;\n /** Deletes document model. */\n delete(\n options?: DeleteModelParameters,\n ): StreamableMethod<DeleteModel204Response | DeleteModelDefaultResponse>;\n}\n\nexport interface BuildModel {\n /** Builds a custom document analysis model. */\n post(\n options: BuildModelParameters,\n ): StreamableMethod<BuildModel202Response | BuildModelDefaultResponse>;\n}\n\nexport interface ComposeModel {\n /** Creates a new document model from document types of existing document models. */\n post(\n options: ComposeModelParameters,\n ): StreamableMethod<ComposeModel202Response | ComposeModelDefaultResponse>;\n}\n\nexport interface AuthorizeModelCopy {\n /**\n * Generates authorization to copy a document model to this location with\n * specified modelId and optional description.\n */\n post(\n options: AuthorizeModelCopyParameters,\n ): StreamableMethod<AuthorizeModelCopy200Response | AuthorizeModelCopyDefaultResponse>;\n}\n\nexport interface CopyModelTo {\n /** Copies document model to the target resource, region, and modelId. */\n post(\n options: CopyModelToParameters,\n ): StreamableMethod<CopyModelTo202Response | CopyModelToDefaultResponse>;\n}\n\nexport interface ListModels {\n /** List all document models */\n get(\n options?: ListModelsParameters,\n ): StreamableMethod<ListModels200Response | ListModelsDefaultResponse>;\n}\n\nexport interface BuildClassifier {\n /** Builds a custom document classifier. */\n post(\n options: BuildClassifierParameters,\n ): StreamableMethod<BuildClassifier202Response | BuildClassifierDefaultResponse>;\n}\n\nexport interface ListClassifiers {\n /** List all document classifiers. */\n get(\n options?: ListClassifiersParameters,\n ): StreamableMethod<ListClassifiers200Response | ListClassifiersDefaultResponse>;\n}\n\nexport interface GetClassifier {\n /** Gets detailed document classifier information. */\n get(\n options?: GetClassifierParameters,\n ): StreamableMethod<GetClassifier200Response | GetClassifierDefaultResponse>;\n /** Deletes document classifier. */\n delete(\n options?: DeleteClassifierParameters,\n ): StreamableMethod<DeleteClassifier204Response | DeleteClassifierDefaultResponse>;\n}\n\nexport interface ClassifyDocumentFromStream {\n /** Classifies document with document classifier. */\n post(\n options: ClassifyDocumentFromStreamParameters,\n ): StreamableMethod<\n ClassifyDocumentFromStream202Response | ClassifyDocumentFromStreamDefaultResponse\n >;\n /** Classifies document with document classifier. */\n post(\n options: ClassifyDocumentParameters,\n ): StreamableMethod<ClassifyDocument202Response | ClassifyDocumentDefaultResponse>;\n}\n\nexport interface GetClassifyResult {\n /** Gets the result of document classifier. */\n get(\n options?: GetClassifyResultParameters,\n ): StreamableMethod<GetClassifyResult200Response | GetClassifyResultDefaultResponse>;\n}\n\nexport interface AuthorizeClassifierCopy {\n /**\n * Generates authorization to copy a document classifier to this location with\n * specified classifierId and optional description.\n */\n post(\n options: AuthorizeClassifierCopyParameters,\n ): StreamableMethod<AuthorizeClassifierCopy200Response | AuthorizeClassifierCopyDefaultResponse>;\n}\n\nexport interface CopyClassifierTo {\n /** Copies document classifier to the target resource, region, and classifierId. */\n post(\n options: CopyClassifierToParameters,\n ): StreamableMethod<CopyClassifierTo202Response | CopyClassifierToDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/operations' has methods for the following verbs: get */\n (path: \"/operations\"): ListOperations;\n /** Resource for '/operations/\\{operationId\\}' has methods for the following verbs: get */\n (path: \"/operations/{operationId}\", operationId: string): GetDocumentModelBuildOperation;\n /** Resource for '/info' has methods for the following verbs: get */\n (path: \"/info\"): GetResourceDetails;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeResults/\\{resultId\\}' has methods for the following verbs: get, delete */\n (\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}\",\n modelId: string,\n resultId: string,\n ): GetAnalyzeResult;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeResults/\\{resultId\\}/pdf' has methods for the following verbs: get */\n (\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}/pdf\",\n modelId: string,\n resultId: string,\n ): GetAnalyzeResultPdf;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeResults/\\{resultId\\}/figures/\\{figureId\\}' has methods for the following verbs: get */\n (\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}\",\n modelId: string,\n resultId: string,\n figureId: string,\n ): GetAnalyzeResultFigure;\n /** Resource for '/documentModels/\\{modelId\\}:analyze' has methods for the following verbs: post */\n (path: \"/documentModels/{modelId}:analyze\", modelId: string): AnalyzeDocumentFromStream;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeBatchResults/\\{resultId\\}' has methods for the following verbs: get, delete */\n (\n path: \"/documentModels/{modelId}/analyzeBatchResults/{resultId}\",\n modelId: string,\n resultId: string,\n ): GetAnalyzeBatchResult;\n /** Resource for '/documentModels/\\{modelId\\}:analyzeBatch' has methods for the following verbs: post */\n (path: \"/documentModels/{modelId}:analyzeBatch\", modelId: string): AnalyzeBatchDocuments;\n /** Resource for '/documentModels/\\{modelId\\}/analyzeBatchResults' has methods for the following verbs: get */\n (path: \"/documentModels/{modelId}/analyzeBatchResults\", modelId: string): ListAnalyzeBatchResults;\n /** Resource for '/documentModels/\\{modelId\\}' has methods for the following verbs: get, delete */\n (path: \"/documentModels/{modelId}\", modelId: string): GetModel;\n /** Resource for '/documentModels:build' has methods for the following verbs: post */\n (path: \"/documentModels:build\"): BuildModel;\n /** Resource for '/documentModels:compose' has methods for the following verbs: post */\n (path: \"/documentModels:compose\"): ComposeModel;\n /** Resource for '/documentModels:authorizeCopy' has methods for the following verbs: post */\n (path: \"/documentModels:authorizeCopy\"): AuthorizeModelCopy;\n /** Resource for '/documentModels/\\{modelId\\}:copyTo' has methods for the following verbs: post */\n (path: \"/documentModels/{modelId}:copyTo\", modelId: string): CopyModelTo;\n /** Resource for '/documentModels' has methods for the following verbs: get */\n (path: \"/documentModels\"): ListModels;\n /** Resource for '/documentClassifiers:build' has methods for the following verbs: post */\n (path: \"/documentClassifiers:build\"): BuildClassifier;\n /** Resource for '/documentClassifiers' has methods for the following verbs: get */\n (path: \"/documentClassifiers\"): ListClassifiers;\n /** Resource for '/documentClassifiers/\\{classifierId\\}' has methods for the following verbs: get, delete */\n (path: \"/documentClassifiers/{classifierId}\", classifierId: string): GetClassifier;\n /** Resource for '/documentClassifiers/\\{classifierId\\}:analyze' has methods for the following verbs: post */\n (\n path: \"/documentClassifiers/{classifierId}:analyze\",\n classifierId: string,\n ): ClassifyDocumentFromStream;\n /** Resource for '/documentClassifiers/\\{classifierId\\}/analyzeResults/\\{resultId\\}' has methods for the following verbs: get */\n (\n path: \"/documentClassifiers/{classifierId}/analyzeResults/{resultId}\",\n classifierId: string,\n resultId: string,\n ): GetClassifyResult;\n /** Resource for '/documentClassifiers:authorizeCopy' has methods for the following verbs: post */\n (path: \"/documentClassifiers:authorizeCopy\"): AuthorizeClassifierCopy;\n /** Resource for '/documentClassifiers/\\{classifierId\\}:copyTo' has methods for the following verbs: post */\n (path: \"/documentClassifiers/{classifierId}:copyTo\", classifierId: string): CopyClassifierTo;\n}\n\nexport type DocumentIntelligenceClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
-
import { TokenCredential, KeyCredential } from "@azure/core-auth";
|
|
3
|
-
import { DocumentIntelligenceClient } from "./clientDefinitions.js";
|
|
1
|
+
import type { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import type { TokenCredential, KeyCredential } from "@azure/core-auth";
|
|
3
|
+
import type { DocumentIntelligenceClient } from "./clientDefinitions.js";
|
|
4
4
|
/** The optional parameters for the client */
|
|
5
5
|
export interface DocumentIntelligenceClientOptions extends ClientOptions {
|
|
6
6
|
/** The api version option of the client */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentIntelligence.d.ts","sourceRoot":"","sources":["../../src/documentIntelligence.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"documentIntelligence.d.ts","sourceRoot":"","sources":["../../src/documentIntelligence.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEzE,6CAA6C;AAC7C,MAAM,WAAW,iCAAkC,SAAQ,aAAa;IACtE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,eAAe,GAAG,aAAa,EAC5C,EAAE,UAAyB,EAAE,GAAG,OAAO,EAAE,GAAE,iCAAsC,GAChF,0BAA0B,CAyC5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
3
|
import { __rest } from "tslib";
|
|
4
4
|
import { getClient } from "@azure-rest/core-client";
|
|
5
5
|
import { logger } from "./logger.js";
|
|
@@ -11,9 +11,9 @@ import { logger } from "./logger.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createClient(endpointParam, credentials, _a = {}) {
|
|
13
13
|
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
14
|
-
var { apiVersion = "2024-
|
|
14
|
+
var { apiVersion = "2024-11-30" } = _a, options = __rest(_a, ["apiVersion"]);
|
|
15
15
|
const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpointParam}/documentintelligence`;
|
|
16
|
-
const userAgentInfo = `azsdk-js-ai-document-intelligence-rest/1.0.0
|
|
16
|
+
const userAgentInfo = `azsdk-js-ai-document-intelligence-rest/1.0.0`;
|
|
17
17
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
18
18
|
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
19
19
|
: `${userAgentInfo}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentIntelligence.js","sourceRoot":"","sources":["../../src/documentIntelligence.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"documentIntelligence.js","sourceRoot":"","sources":["../../src/documentIntelligence.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,KAA+E,EAAE;;QAAjF,EAAE,UAAU,GAAG,YAAY,OAAsD,EAAjD,OAAO,cAAvC,cAAyC,CAAF;IAEvC,MAAM,WAAW,GACf,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,aAAa,uBAAuB,CAAC;IACjF,MAAM,aAAa,GAAG,8CAA8C,CAAC;IACrE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC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AAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport type { DocumentIntelligenceClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface DocumentIntelligenceClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `DocumentIntelligenceClient`\n * @param endpointParam - The Document Intelligence service endpoint.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2024-11-30\", ...options }: DocumentIntelligenceClientOptions = {},\n): DocumentIntelligenceClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `${endpointParam}/documentintelligence`;\n const userAgentInfo = `azsdk-js-ai-document-intelligence-rest/1.0.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as DocumentIntelligenceClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAE7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAE7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAE3B,eAAe,oBAAoB,CAAC"}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
3
|
import DocumentIntelligence from "./documentIntelligence.js";
|
|
4
4
|
export * from "./documentIntelligence.js";
|
|
5
5
|
export * from "./parameters.js";
|
|
@@ -10,5 +10,6 @@ export * from "./models.js";
|
|
|
10
10
|
export * from "./outputModels.js";
|
|
11
11
|
export * from "./paginateHelper.js";
|
|
12
12
|
export * from "./pollingHelper.js";
|
|
13
|
+
export * from "./utils.js";
|
|
13
14
|
export default DocumentIntelligence;
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAE7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAE7D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAE3B,eAAe,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport DocumentIntelligence from \"./documentIntelligence.js\";\n\nexport * from \"./documentIntelligence.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./models.js\";\nexport * from \"./outputModels.js\";\nexport * from \"./paginateHelper.js\";\nexport * from \"./pollingHelper.js\";\nexport * from \"./utils.js\";\n\nexport default DocumentIntelligence;\n"]}
|