@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
@@ -0,0 +1,414 @@
1
+ import type { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
2
+ import type { RequestParameters } from "@azure-rest/core-client";
3
+ import type { StringIndexType, DocumentAnalysisFeature, DocumentContentFormat, AnalyzeOutputOption, AnalyzeDocumentRequest, AnalyzeBatchDocumentsRequest, BuildDocumentModelRequest, ComposeDocumentModelRequest, AuthorizeCopyRequest, ModelCopyAuthorization, BuildDocumentClassifierRequest, SplitMode, ClassifyDocumentRequest, AuthorizeClassifierCopyRequest, ClassifierCopyAuthorization } from "./models.js";
4
+ export interface ListOperationsHeaders {
5
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
6
+ "x-ms-client-request-id"?: string;
7
+ }
8
+ export interface ListOperationsHeaderParam {
9
+ headers?: RawHttpHeadersInput & ListOperationsHeaders;
10
+ }
11
+ export type ListOperationsParameters = ListOperationsHeaderParam & RequestParameters;
12
+ export interface GetDocumentModelBuildOperationHeaders {
13
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
14
+ "x-ms-client-request-id"?: string;
15
+ }
16
+ export interface GetDocumentModelBuildOperationHeaderParam {
17
+ headers?: RawHttpHeadersInput & GetDocumentModelBuildOperationHeaders;
18
+ }
19
+ export type GetDocumentModelBuildOperationParameters = GetDocumentModelBuildOperationHeaderParam & RequestParameters;
20
+ export interface GetDocumentModelComposeOperationHeaders {
21
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
22
+ "x-ms-client-request-id"?: string;
23
+ }
24
+ export interface GetDocumentModelComposeOperationHeaderParam {
25
+ headers?: RawHttpHeadersInput & GetDocumentModelComposeOperationHeaders;
26
+ }
27
+ export type GetDocumentModelComposeOperationParameters = GetDocumentModelComposeOperationHeaderParam & RequestParameters;
28
+ export interface GetDocumentModelCopyToOperationHeaders {
29
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
30
+ "x-ms-client-request-id"?: string;
31
+ }
32
+ export interface GetDocumentModelCopyToOperationHeaderParam {
33
+ headers?: RawHttpHeadersInput & GetDocumentModelCopyToOperationHeaders;
34
+ }
35
+ export type GetDocumentModelCopyToOperationParameters = GetDocumentModelCopyToOperationHeaderParam & RequestParameters;
36
+ export interface GetDocumentClassifierCopyToOperationHeaders {
37
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
38
+ "x-ms-client-request-id"?: string;
39
+ }
40
+ export interface GetDocumentClassifierCopyToOperationHeaderParam {
41
+ headers?: RawHttpHeadersInput & GetDocumentClassifierCopyToOperationHeaders;
42
+ }
43
+ export type GetDocumentClassifierCopyToOperationParameters = GetDocumentClassifierCopyToOperationHeaderParam & RequestParameters;
44
+ export interface GetDocumentClassifierBuildOperationHeaders {
45
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
46
+ "x-ms-client-request-id"?: string;
47
+ }
48
+ export interface GetDocumentClassifierBuildOperationHeaderParam {
49
+ headers?: RawHttpHeadersInput & GetDocumentClassifierBuildOperationHeaders;
50
+ }
51
+ export type GetDocumentClassifierBuildOperationParameters = GetDocumentClassifierBuildOperationHeaderParam & RequestParameters;
52
+ export interface GetOperationHeaders {
53
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
54
+ "x-ms-client-request-id"?: string;
55
+ }
56
+ export interface GetOperationHeaderParam {
57
+ headers?: RawHttpHeadersInput & GetOperationHeaders;
58
+ }
59
+ export type GetOperationParameters = GetOperationHeaderParam & RequestParameters;
60
+ export type GetResourceDetailsParameters = RequestParameters;
61
+ export type GetAnalyzeResultParameters = RequestParameters;
62
+ export type GetAnalyzeResultPdfParameters = RequestParameters;
63
+ export type GetAnalyzeResultFigureParameters = RequestParameters;
64
+ export type DeleteAnalyzeResultParameters = RequestParameters;
65
+ export interface AnalyzeDocumentFromStreamBodyParam {
66
+ /**
67
+ * Input content.
68
+ *
69
+ * Value may contain any sequence of octets
70
+ */
71
+ body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream;
72
+ }
73
+ /** This is the wrapper object for the parameter `features` with explode set to false and style set to form. */
74
+ export interface AnalyzeDocumentFromStreamFeaturesQueryParam {
75
+ /** Value of the parameter */
76
+ value: DocumentAnalysisFeature[];
77
+ /** Should we explode the value? */
78
+ explode: false;
79
+ /** Style of the value */
80
+ style: "form";
81
+ }
82
+ /** This is the wrapper object for the parameter `queryFields` with explode set to false and style set to form. */
83
+ export interface AnalyzeDocumentFromStreamQueryFieldsQueryParam {
84
+ /** Value of the parameter */
85
+ value: string[];
86
+ /** Should we explode the value? */
87
+ explode: false;
88
+ /** Style of the value */
89
+ style: "form";
90
+ }
91
+ /** This is the wrapper object for the parameter `output` with explode set to false and style set to form. */
92
+ export interface AnalyzeDocumentFromStreamOutputQueryParam {
93
+ /** Value of the parameter */
94
+ value: AnalyzeOutputOption[];
95
+ /** Should we explode the value? */
96
+ explode: false;
97
+ /** Style of the value */
98
+ style: "form";
99
+ }
100
+ export interface AnalyzeDocumentFromStreamQueryParamProperties {
101
+ /** 1-based page numbers to analyze. Ex. "1-3,5,7-9" */
102
+ pages?: string;
103
+ /**
104
+ * Locale hint for text recognition and document analysis. Value may contain only
105
+ * the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US").
106
+ */
107
+ locale?: string;
108
+ /**
109
+ * Method used to compute string offset and length.
110
+ *
111
+ * Possible values: "textElements", "unicodeCodePoint", "utf16CodeUnit"
112
+ */
113
+ stringIndexType?: StringIndexType;
114
+ /** List of optional analysis features. */
115
+ features?: DocumentAnalysisFeature[] | AnalyzeDocumentFromStreamFeaturesQueryParam;
116
+ /** List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber" */
117
+ queryFields?: string[] | AnalyzeDocumentFromStreamQueryFieldsQueryParam;
118
+ /**
119
+ * Format of the analyze result top-level content.
120
+ *
121
+ * Possible values: "text", "markdown"
122
+ */
123
+ outputContentFormat?: DocumentContentFormat;
124
+ /** Additional outputs to generate during analysis. */
125
+ output?: AnalyzeOutputOption[] | AnalyzeDocumentFromStreamOutputQueryParam;
126
+ }
127
+ export interface AnalyzeDocumentFromStreamQueryParam {
128
+ queryParameters?: AnalyzeDocumentFromStreamQueryParamProperties;
129
+ }
130
+ export interface AnalyzeDocumentFromStreamMediaTypesParam {
131
+ /** Input content type. */
132
+ contentType: "application/octet-stream" | "application/pdf" | "image/jpeg" | "image/png" | "image/tiff" | "image/bmp" | "image/heif" | "text/html" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.presentationml.presentation";
133
+ }
134
+ export type AnalyzeDocumentFromStreamParameters = AnalyzeDocumentFromStreamQueryParam & AnalyzeDocumentFromStreamMediaTypesParam & AnalyzeDocumentFromStreamBodyParam & RequestParameters;
135
+ export interface AnalyzeDocumentBodyParam {
136
+ /** Analyze request parameters. */
137
+ body: AnalyzeDocumentRequest;
138
+ }
139
+ /** This is the wrapper object for the parameter `features` with explode set to false and style set to form. */
140
+ export interface AnalyzeDocumentFeaturesQueryParam {
141
+ /** Value of the parameter */
142
+ value: DocumentAnalysisFeature[];
143
+ /** Should we explode the value? */
144
+ explode: false;
145
+ /** Style of the value */
146
+ style: "form";
147
+ }
148
+ /** This is the wrapper object for the parameter `queryFields` with explode set to false and style set to form. */
149
+ export interface AnalyzeDocumentQueryFieldsQueryParam {
150
+ /** Value of the parameter */
151
+ value: string[];
152
+ /** Should we explode the value? */
153
+ explode: false;
154
+ /** Style of the value */
155
+ style: "form";
156
+ }
157
+ /** This is the wrapper object for the parameter `output` with explode set to false and style set to form. */
158
+ export interface AnalyzeDocumentOutputQueryParam {
159
+ /** Value of the parameter */
160
+ value: AnalyzeOutputOption[];
161
+ /** Should we explode the value? */
162
+ explode: false;
163
+ /** Style of the value */
164
+ style: "form";
165
+ }
166
+ export interface AnalyzeDocumentQueryParamProperties {
167
+ /** 1-based page numbers to analyze. Ex. "1-3,5,7-9" */
168
+ pages?: string;
169
+ /**
170
+ * Locale hint for text recognition and document analysis. Value may contain only
171
+ * the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US").
172
+ */
173
+ locale?: string;
174
+ /**
175
+ * Method used to compute string offset and length.
176
+ *
177
+ * Possible values: "textElements", "unicodeCodePoint", "utf16CodeUnit"
178
+ */
179
+ stringIndexType?: StringIndexType;
180
+ /** List of optional analysis features. */
181
+ features?: DocumentAnalysisFeature[] | AnalyzeDocumentFeaturesQueryParam;
182
+ /** List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber" */
183
+ queryFields?: string[] | AnalyzeDocumentQueryFieldsQueryParam;
184
+ /**
185
+ * Format of the analyze result top-level content.
186
+ *
187
+ * Possible values: "text", "markdown"
188
+ */
189
+ outputContentFormat?: DocumentContentFormat;
190
+ /** Additional outputs to generate during analysis. */
191
+ output?: AnalyzeOutputOption[] | AnalyzeDocumentOutputQueryParam;
192
+ }
193
+ export interface AnalyzeDocumentQueryParam {
194
+ queryParameters?: AnalyzeDocumentQueryParamProperties;
195
+ }
196
+ export interface AnalyzeDocumentMediaTypesParam {
197
+ /** Input content type. */
198
+ contentType: "application/json";
199
+ }
200
+ export type AnalyzeDocumentParameters = AnalyzeDocumentQueryParam & AnalyzeDocumentMediaTypesParam & AnalyzeDocumentBodyParam & RequestParameters;
201
+ export type GetAnalyzeBatchResultParameters = RequestParameters;
202
+ export interface AnalyzeBatchDocumentsBodyParam {
203
+ /** Analyze batch request parameters. */
204
+ body: AnalyzeBatchDocumentsRequest;
205
+ }
206
+ /** This is the wrapper object for the parameter `features` with explode set to false and style set to form. */
207
+ export interface AnalyzeBatchDocumentsFeaturesQueryParam {
208
+ /** Value of the parameter */
209
+ value: DocumentAnalysisFeature[];
210
+ /** Should we explode the value? */
211
+ explode: false;
212
+ /** Style of the value */
213
+ style: "form";
214
+ }
215
+ /** This is the wrapper object for the parameter `queryFields` with explode set to false and style set to form. */
216
+ export interface AnalyzeBatchDocumentsQueryFieldsQueryParam {
217
+ /** Value of the parameter */
218
+ value: string[];
219
+ /** Should we explode the value? */
220
+ explode: false;
221
+ /** Style of the value */
222
+ style: "form";
223
+ }
224
+ /** This is the wrapper object for the parameter `output` with explode set to false and style set to form. */
225
+ export interface AnalyzeBatchDocumentsOutputQueryParam {
226
+ /** Value of the parameter */
227
+ value: AnalyzeOutputOption[];
228
+ /** Should we explode the value? */
229
+ explode: false;
230
+ /** Style of the value */
231
+ style: "form";
232
+ }
233
+ export interface AnalyzeBatchDocumentsQueryParamProperties {
234
+ /** 1-based page numbers to analyze. Ex. "1-3,5,7-9" */
235
+ pages?: string;
236
+ /**
237
+ * Locale hint for text recognition and document analysis. Value may contain only
238
+ * the language code (ex. "en", "fr") or BCP 47 language tag (ex. "en-US").
239
+ */
240
+ locale?: string;
241
+ /**
242
+ * Method used to compute string offset and length.
243
+ *
244
+ * Possible values: "textElements", "unicodeCodePoint", "utf16CodeUnit"
245
+ */
246
+ stringIndexType?: StringIndexType;
247
+ /** List of optional analysis features. */
248
+ features?: DocumentAnalysisFeature[] | AnalyzeBatchDocumentsFeaturesQueryParam;
249
+ /** List of additional fields to extract. Ex. "NumberOfGuests,StoreNumber" */
250
+ queryFields?: string[] | AnalyzeBatchDocumentsQueryFieldsQueryParam;
251
+ /**
252
+ * Format of the analyze result top-level content.
253
+ *
254
+ * Possible values: "text", "markdown"
255
+ */
256
+ outputContentFormat?: DocumentContentFormat;
257
+ /** Additional outputs to generate during analysis. */
258
+ output?: AnalyzeOutputOption[] | AnalyzeBatchDocumentsOutputQueryParam;
259
+ }
260
+ export interface AnalyzeBatchDocumentsQueryParam {
261
+ queryParameters?: AnalyzeBatchDocumentsQueryParamProperties;
262
+ }
263
+ export interface AnalyzeBatchDocumentsMediaTypesParam {
264
+ /** Input content type */
265
+ contentType: "application/json";
266
+ }
267
+ export type AnalyzeBatchDocumentsParameters = AnalyzeBatchDocumentsQueryParam & AnalyzeBatchDocumentsMediaTypesParam & AnalyzeBatchDocumentsBodyParam & RequestParameters;
268
+ export type ListAnalyzeBatchResultsParameters = RequestParameters;
269
+ export type DeleteAnalyzeBatchResultParameters = RequestParameters;
270
+ export interface GetModelHeaders {
271
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
272
+ "x-ms-client-request-id"?: string;
273
+ }
274
+ export interface GetModelHeaderParam {
275
+ headers?: RawHttpHeadersInput & GetModelHeaders;
276
+ }
277
+ export type GetModelParameters = GetModelHeaderParam & RequestParameters;
278
+ export interface BuildModelBodyParam {
279
+ /** Build request parameters. */
280
+ body: BuildDocumentModelRequest;
281
+ }
282
+ export type BuildModelParameters = BuildModelBodyParam & RequestParameters;
283
+ export interface ComposeModelBodyParam {
284
+ /** Compose request parameters. */
285
+ body: ComposeDocumentModelRequest;
286
+ }
287
+ export type ComposeModelParameters = ComposeModelBodyParam & RequestParameters;
288
+ export interface AuthorizeModelCopyBodyParam {
289
+ /** Authorize copy request parameters. */
290
+ body: AuthorizeCopyRequest;
291
+ }
292
+ export type AuthorizeModelCopyParameters = AuthorizeModelCopyBodyParam & RequestParameters;
293
+ export interface CopyModelToBodyParam {
294
+ /** Copy to request parameters. */
295
+ body: ModelCopyAuthorization;
296
+ }
297
+ export type CopyModelToParameters = CopyModelToBodyParam & RequestParameters;
298
+ export interface ListModelsHeaders {
299
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
300
+ "x-ms-client-request-id"?: string;
301
+ }
302
+ export interface ListModelsHeaderParam {
303
+ headers?: RawHttpHeadersInput & ListModelsHeaders;
304
+ }
305
+ export type ListModelsParameters = ListModelsHeaderParam & RequestParameters;
306
+ export interface DeleteModelHeaders {
307
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
308
+ "x-ms-client-request-id"?: string;
309
+ }
310
+ export interface DeleteModelHeaderParam {
311
+ headers?: RawHttpHeadersInput & DeleteModelHeaders;
312
+ }
313
+ export type DeleteModelParameters = DeleteModelHeaderParam & RequestParameters;
314
+ export interface BuildClassifierBodyParam {
315
+ /** Build request parameters. */
316
+ body: BuildDocumentClassifierRequest;
317
+ }
318
+ export type BuildClassifierParameters = BuildClassifierBodyParam & RequestParameters;
319
+ export interface ListClassifiersHeaders {
320
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
321
+ "x-ms-client-request-id"?: string;
322
+ }
323
+ export interface ListClassifiersHeaderParam {
324
+ headers?: RawHttpHeadersInput & ListClassifiersHeaders;
325
+ }
326
+ export type ListClassifiersParameters = ListClassifiersHeaderParam & RequestParameters;
327
+ export interface GetClassifierHeaders {
328
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
329
+ "x-ms-client-request-id"?: string;
330
+ }
331
+ export interface GetClassifierHeaderParam {
332
+ headers?: RawHttpHeadersInput & GetClassifierHeaders;
333
+ }
334
+ export type GetClassifierParameters = GetClassifierHeaderParam & RequestParameters;
335
+ export interface DeleteClassifierHeaders {
336
+ /** An opaque, globally-unique, client-generated string identifier for the request. */
337
+ "x-ms-client-request-id"?: string;
338
+ }
339
+ export interface DeleteClassifierHeaderParam {
340
+ headers?: RawHttpHeadersInput & DeleteClassifierHeaders;
341
+ }
342
+ export type DeleteClassifierParameters = DeleteClassifierHeaderParam & RequestParameters;
343
+ export interface ClassifyDocumentFromStreamBodyParam {
344
+ /**
345
+ * Input content.
346
+ *
347
+ * Value may contain any sequence of octets
348
+ */
349
+ body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream;
350
+ }
351
+ export interface ClassifyDocumentFromStreamQueryParamProperties {
352
+ /**
353
+ * Method used to compute string offset and length.
354
+ *
355
+ * Possible values: "textElements", "unicodeCodePoint", "utf16CodeUnit"
356
+ */
357
+ stringIndexType?: StringIndexType;
358
+ /**
359
+ * Document splitting mode.
360
+ *
361
+ * Possible values: "auto", "none", "perPage"
362
+ */
363
+ split?: SplitMode;
364
+ /** 1-based page numbers to analyze. Ex. "1-3,5,7-9" */
365
+ pages?: string;
366
+ }
367
+ export interface ClassifyDocumentFromStreamQueryParam {
368
+ queryParameters?: ClassifyDocumentFromStreamQueryParamProperties;
369
+ }
370
+ export interface ClassifyDocumentFromStreamMediaTypesParam {
371
+ /** Input content type. */
372
+ contentType: "application/octet-stream" | "application/pdf" | "image/jpeg" | "image/png" | "image/tiff" | "image/bmp" | "image/heif" | "text/html" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.presentationml.presentation";
373
+ }
374
+ export type ClassifyDocumentFromStreamParameters = ClassifyDocumentFromStreamQueryParam & ClassifyDocumentFromStreamMediaTypesParam & ClassifyDocumentFromStreamBodyParam & RequestParameters;
375
+ export interface ClassifyDocumentBodyParam {
376
+ /** Classify request parameters. */
377
+ body: ClassifyDocumentRequest;
378
+ }
379
+ export interface ClassifyDocumentQueryParamProperties {
380
+ /**
381
+ * Method used to compute string offset and length.
382
+ *
383
+ * Possible values: "textElements", "unicodeCodePoint", "utf16CodeUnit"
384
+ */
385
+ stringIndexType?: StringIndexType;
386
+ /**
387
+ * Document splitting mode.
388
+ *
389
+ * Possible values: "auto", "none", "perPage"
390
+ */
391
+ split?: SplitMode;
392
+ /** 1-based page numbers to analyze. Ex. "1-3,5,7-9" */
393
+ pages?: string;
394
+ }
395
+ export interface ClassifyDocumentQueryParam {
396
+ queryParameters?: ClassifyDocumentQueryParamProperties;
397
+ }
398
+ export interface ClassifyDocumentMediaTypesParam {
399
+ /** Input content type */
400
+ contentType: "application/json";
401
+ }
402
+ export type ClassifyDocumentParameters = ClassifyDocumentQueryParam & ClassifyDocumentMediaTypesParam & ClassifyDocumentBodyParam & RequestParameters;
403
+ export type GetClassifyResultParameters = RequestParameters;
404
+ export interface AuthorizeClassifierCopyBodyParam {
405
+ /** Authorize copy request parameters. */
406
+ body: AuthorizeClassifierCopyRequest;
407
+ }
408
+ export type AuthorizeClassifierCopyParameters = AuthorizeClassifierCopyBodyParam & RequestParameters;
409
+ export interface CopyClassifierToBodyParam {
410
+ /** Copy to request parameters. */
411
+ body: ClassifierCopyAuthorization;
412
+ }
413
+ export type CopyClassifierToParameters = CopyClassifierToBodyParam & RequestParameters;
414
+ //# sourceMappingURL=parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,qB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AM,iCAAiC,GAAG,gCAAgC,GAC9E,iBAAiB,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,kCAAkC;IAClC,IAAI,EAAE,2BAA2B,CAAC;CACnC;AAED,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type {\n StringIndexType,\n DocumentAnalysisFeature,\n DocumentContentFormat,\n AnalyzeOutputOption,\n AnalyzeDocumentRequest,\n AnalyzeBatchDocumentsRequest,\n BuildDocumentModelRequest,\n ComposeDocumentModelRequest,\n AuthorizeCopyRequest,\n ModelCopyAuthorization,\n BuildDocumentClassifierRequest,\n SplitMode,\n ClassifyDocumentRequest,\n AuthorizeClassifierCopyRequest,\n ClassifierCopyAuthorization,\n} from \"./models.js\";\n\nexport interface ListOperationsHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface ListOperationsHeaderParam {\n headers?: RawHttpHeadersInput & ListOperationsHeaders;\n}\n\nexport type ListOperationsParameters = ListOperationsHeaderParam & RequestParameters;\n\nexport interface GetDocumentModelBuildOperationHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetDocumentModelBuildOperationHeaderParam {\n headers?: RawHttpHeadersInput & GetDocumentModelBuildOperationHeaders;\n}\n\nexport type GetDocumentModelBuildOperationParameters = GetDocumentModelBuildOperationHeaderParam &\n RequestParameters;\n\nexport interface GetDocumentModelComposeOperationHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetDocumentModelComposeOperationHeaderParam {\n headers?: RawHttpHeadersInput & GetDocumentModelComposeOperationHeaders;\n}\n\nexport type GetDocumentModelComposeOperationParameters =\n GetDocumentModelComposeOperationHeaderParam & RequestParameters;\n\nexport interface GetDocumentModelCopyToOperationHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetDocumentModelCopyToOperationHeaderParam {\n headers?: RawHttpHeadersInput & GetDocumentModelCopyToOperationHeaders;\n}\n\nexport type GetDocumentModelCopyToOperationParameters = GetDocumentModelCopyToOperationHeaderParam &\n RequestParameters;\n\nexport interface GetDocumentClassifierCopyToOperationHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetDocumentClassifierCopyToOperationHeaderParam {\n headers?: RawHttpHeadersInput & GetDocumentClassifierCopyToOperationHeaders;\n}\n\nexport type GetDocumentClassifierCopyToOperationParameters =\n GetDocumentClassifierCopyToOperationHeaderParam & RequestParameters;\n\nexport interface GetDocumentClassifierBuildOperationHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetDocumentClassifierBuildOperationHeaderParam {\n headers?: RawHttpHeadersInput & GetDocumentClassifierBuildOperationHeaders;\n}\n\nexport type GetDocumentClassifierBuildOperationParameters =\n GetDocumentClassifierBuildOperationHeaderParam & RequestParameters;\n\nexport interface GetOperationHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetOperationHeaderParam {\n headers?: RawHttpHeadersInput & GetOperationHeaders;\n}\n\nexport type GetOperationParameters = GetOperationHeaderParam & RequestParameters;\nexport type GetResourceDetailsParameters = RequestParameters;\nexport type GetAnalyzeResultParameters = RequestParameters;\nexport type GetAnalyzeResultPdfParameters = RequestParameters;\nexport type GetAnalyzeResultFigureParameters = RequestParameters;\nexport type DeleteAnalyzeResultParameters = RequestParameters;\n\nexport interface AnalyzeDocumentFromStreamBodyParam {\n /**\n * Input content.\n *\n * Value may contain any sequence of octets\n */\n body:\n | string\n | Uint8Array\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n | ReadableStream<Uint8Array>\n | NodeJS.ReadableStream;\n}\n\n/** This is the wrapper object for the parameter `features` with explode set to false and style set to form. */\nexport interface AnalyzeDocumentFromStreamFeaturesQueryParam {\n /** Value of the parameter */\n value: DocumentAnalysisFeature[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\n/** This is the wrapper object for the parameter `queryFields` with explode set to false and style set to form. */\nexport interface AnalyzeDocumentFromStreamQueryFieldsQueryParam {\n /** Value of the parameter */\n value: string[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\n/** This is the wrapper object for the parameter `output` with explode set to false and style set to form. */\nexport interface AnalyzeDocumentFromStreamOutputQueryParam {\n /** Value of the parameter */\n value: AnalyzeOutputOption[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\nexport interface AnalyzeDocumentFromStreamQueryParamProperties {\n /** 1-based page numbers to analyze. Ex. \"1-3,5,7-9\" */\n pages?: string;\n /**\n * Locale hint for text recognition and document analysis. Value may contain only\n * the language code (ex. \"en\", \"fr\") or BCP 47 language tag (ex. \"en-US\").\n */\n locale?: string;\n /**\n * Method used to compute string offset and length.\n *\n * Possible values: \"textElements\", \"unicodeCodePoint\", \"utf16CodeUnit\"\n */\n stringIndexType?: StringIndexType;\n /** List of optional analysis features. */\n features?: DocumentAnalysisFeature[] | AnalyzeDocumentFromStreamFeaturesQueryParam;\n /** List of additional fields to extract. Ex. \"NumberOfGuests,StoreNumber\" */\n queryFields?: string[] | AnalyzeDocumentFromStreamQueryFieldsQueryParam;\n /**\n * Format of the analyze result top-level content.\n *\n * Possible values: \"text\", \"markdown\"\n */\n outputContentFormat?: DocumentContentFormat;\n /** Additional outputs to generate during analysis. */\n output?: AnalyzeOutputOption[] | AnalyzeDocumentFromStreamOutputQueryParam;\n}\n\nexport interface AnalyzeDocumentFromStreamQueryParam {\n queryParameters?: AnalyzeDocumentFromStreamQueryParamProperties;\n}\n\nexport interface AnalyzeDocumentFromStreamMediaTypesParam {\n /** Input content type. */\n contentType:\n | \"application/octet-stream\"\n | \"application/pdf\"\n | \"image/jpeg\"\n | \"image/png\"\n | \"image/tiff\"\n | \"image/bmp\"\n | \"image/heif\"\n | \"text/html\"\n | \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n | \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n | \"application/vnd.openxmlformats-officedocument.presentationml.presentation\";\n}\n\nexport type AnalyzeDocumentFromStreamParameters = AnalyzeDocumentFromStreamQueryParam &\n AnalyzeDocumentFromStreamMediaTypesParam &\n AnalyzeDocumentFromStreamBodyParam &\n RequestParameters;\n\nexport interface AnalyzeDocumentBodyParam {\n /** Analyze request parameters. */\n body: AnalyzeDocumentRequest;\n}\n\n/** This is the wrapper object for the parameter `features` with explode set to false and style set to form. */\nexport interface AnalyzeDocumentFeaturesQueryParam {\n /** Value of the parameter */\n value: DocumentAnalysisFeature[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\n/** This is the wrapper object for the parameter `queryFields` with explode set to false and style set to form. */\nexport interface AnalyzeDocumentQueryFieldsQueryParam {\n /** Value of the parameter */\n value: string[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\n/** This is the wrapper object for the parameter `output` with explode set to false and style set to form. */\nexport interface AnalyzeDocumentOutputQueryParam {\n /** Value of the parameter */\n value: AnalyzeOutputOption[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\nexport interface AnalyzeDocumentQueryParamProperties {\n /** 1-based page numbers to analyze. Ex. \"1-3,5,7-9\" */\n pages?: string;\n /**\n * Locale hint for text recognition and document analysis. Value may contain only\n * the language code (ex. \"en\", \"fr\") or BCP 47 language tag (ex. \"en-US\").\n */\n locale?: string;\n /**\n * Method used to compute string offset and length.\n *\n * Possible values: \"textElements\", \"unicodeCodePoint\", \"utf16CodeUnit\"\n */\n stringIndexType?: StringIndexType;\n /** List of optional analysis features. */\n features?: DocumentAnalysisFeature[] | AnalyzeDocumentFeaturesQueryParam;\n /** List of additional fields to extract. Ex. \"NumberOfGuests,StoreNumber\" */\n queryFields?: string[] | AnalyzeDocumentQueryFieldsQueryParam;\n /**\n * Format of the analyze result top-level content.\n *\n * Possible values: \"text\", \"markdown\"\n */\n outputContentFormat?: DocumentContentFormat;\n /** Additional outputs to generate during analysis. */\n output?: AnalyzeOutputOption[] | AnalyzeDocumentOutputQueryParam;\n}\n\nexport interface AnalyzeDocumentQueryParam {\n queryParameters?: AnalyzeDocumentQueryParamProperties;\n}\n\nexport interface AnalyzeDocumentMediaTypesParam {\n /** Input content type. */\n contentType: \"application/json\";\n}\n\nexport type AnalyzeDocumentParameters = AnalyzeDocumentQueryParam &\n AnalyzeDocumentMediaTypesParam &\n AnalyzeDocumentBodyParam &\n RequestParameters;\nexport type GetAnalyzeBatchResultParameters = RequestParameters;\n\nexport interface AnalyzeBatchDocumentsBodyParam {\n /** Analyze batch request parameters. */\n body: AnalyzeBatchDocumentsRequest;\n}\n\n/** This is the wrapper object for the parameter `features` with explode set to false and style set to form. */\nexport interface AnalyzeBatchDocumentsFeaturesQueryParam {\n /** Value of the parameter */\n value: DocumentAnalysisFeature[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\n/** This is the wrapper object for the parameter `queryFields` with explode set to false and style set to form. */\nexport interface AnalyzeBatchDocumentsQueryFieldsQueryParam {\n /** Value of the parameter */\n value: string[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\n/** This is the wrapper object for the parameter `output` with explode set to false and style set to form. */\nexport interface AnalyzeBatchDocumentsOutputQueryParam {\n /** Value of the parameter */\n value: AnalyzeOutputOption[];\n /** Should we explode the value? */\n explode: false;\n /** Style of the value */\n style: \"form\";\n}\n\nexport interface AnalyzeBatchDocumentsQueryParamProperties {\n /** 1-based page numbers to analyze. Ex. \"1-3,5,7-9\" */\n pages?: string;\n /**\n * Locale hint for text recognition and document analysis. Value may contain only\n * the language code (ex. \"en\", \"fr\") or BCP 47 language tag (ex. \"en-US\").\n */\n locale?: string;\n /**\n * Method used to compute string offset and length.\n *\n * Possible values: \"textElements\", \"unicodeCodePoint\", \"utf16CodeUnit\"\n */\n stringIndexType?: StringIndexType;\n /** List of optional analysis features. */\n features?: DocumentAnalysisFeature[] | AnalyzeBatchDocumentsFeaturesQueryParam;\n /** List of additional fields to extract. Ex. \"NumberOfGuests,StoreNumber\" */\n queryFields?: string[] | AnalyzeBatchDocumentsQueryFieldsQueryParam;\n /**\n * Format of the analyze result top-level content.\n *\n * Possible values: \"text\", \"markdown\"\n */\n outputContentFormat?: DocumentContentFormat;\n /** Additional outputs to generate during analysis. */\n output?: AnalyzeOutputOption[] | AnalyzeBatchDocumentsOutputQueryParam;\n}\n\nexport interface AnalyzeBatchDocumentsQueryParam {\n queryParameters?: AnalyzeBatchDocumentsQueryParamProperties;\n}\n\nexport interface AnalyzeBatchDocumentsMediaTypesParam {\n /** Input content type */\n contentType: \"application/json\";\n}\n\nexport type AnalyzeBatchDocumentsParameters = AnalyzeBatchDocumentsQueryParam &\n AnalyzeBatchDocumentsMediaTypesParam &\n AnalyzeBatchDocumentsBodyParam &\n RequestParameters;\nexport type ListAnalyzeBatchResultsParameters = RequestParameters;\nexport type DeleteAnalyzeBatchResultParameters = RequestParameters;\n\nexport interface GetModelHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetModelHeaderParam {\n headers?: RawHttpHeadersInput & GetModelHeaders;\n}\n\nexport type GetModelParameters = GetModelHeaderParam & RequestParameters;\n\nexport interface BuildModelBodyParam {\n /** Build request parameters. */\n body: BuildDocumentModelRequest;\n}\n\nexport type BuildModelParameters = BuildModelBodyParam & RequestParameters;\n\nexport interface ComposeModelBodyParam {\n /** Compose request parameters. */\n body: ComposeDocumentModelRequest;\n}\n\nexport type ComposeModelParameters = ComposeModelBodyParam & RequestParameters;\n\nexport interface AuthorizeModelCopyBodyParam {\n /** Authorize copy request parameters. */\n body: AuthorizeCopyRequest;\n}\n\nexport type AuthorizeModelCopyParameters = AuthorizeModelCopyBodyParam & RequestParameters;\n\nexport interface CopyModelToBodyParam {\n /** Copy to request parameters. */\n body: ModelCopyAuthorization;\n}\n\nexport type CopyModelToParameters = CopyModelToBodyParam & RequestParameters;\n\nexport interface ListModelsHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface ListModelsHeaderParam {\n headers?: RawHttpHeadersInput & ListModelsHeaders;\n}\n\nexport type ListModelsParameters = ListModelsHeaderParam & RequestParameters;\n\nexport interface DeleteModelHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface DeleteModelHeaderParam {\n headers?: RawHttpHeadersInput & DeleteModelHeaders;\n}\n\nexport type DeleteModelParameters = DeleteModelHeaderParam & RequestParameters;\n\nexport interface BuildClassifierBodyParam {\n /** Build request parameters. */\n body: BuildDocumentClassifierRequest;\n}\n\nexport type BuildClassifierParameters = BuildClassifierBodyParam & RequestParameters;\n\nexport interface ListClassifiersHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface ListClassifiersHeaderParam {\n headers?: RawHttpHeadersInput & ListClassifiersHeaders;\n}\n\nexport type ListClassifiersParameters = ListClassifiersHeaderParam & RequestParameters;\n\nexport interface GetClassifierHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetClassifierHeaderParam {\n headers?: RawHttpHeadersInput & GetClassifierHeaders;\n}\n\nexport type GetClassifierParameters = GetClassifierHeaderParam & RequestParameters;\n\nexport interface DeleteClassifierHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface DeleteClassifierHeaderParam {\n headers?: RawHttpHeadersInput & DeleteClassifierHeaders;\n}\n\nexport type DeleteClassifierParameters = DeleteClassifierHeaderParam & RequestParameters;\n\nexport interface ClassifyDocumentFromStreamBodyParam {\n /**\n * Input content.\n *\n * Value may contain any sequence of octets\n */\n body:\n | string\n | Uint8Array\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n | ReadableStream<Uint8Array>\n | NodeJS.ReadableStream;\n}\n\nexport interface ClassifyDocumentFromStreamQueryParamProperties {\n /**\n * Method used to compute string offset and length.\n *\n * Possible values: \"textElements\", \"unicodeCodePoint\", \"utf16CodeUnit\"\n */\n stringIndexType?: StringIndexType;\n /**\n * Document splitting mode.\n *\n * Possible values: \"auto\", \"none\", \"perPage\"\n */\n split?: SplitMode;\n /** 1-based page numbers to analyze. Ex. \"1-3,5,7-9\" */\n pages?: string;\n}\n\nexport interface ClassifyDocumentFromStreamQueryParam {\n queryParameters?: ClassifyDocumentFromStreamQueryParamProperties;\n}\n\nexport interface ClassifyDocumentFromStreamMediaTypesParam {\n /** Input content type. */\n contentType:\n | \"application/octet-stream\"\n | \"application/pdf\"\n | \"image/jpeg\"\n | \"image/png\"\n | \"image/tiff\"\n | \"image/bmp\"\n | \"image/heif\"\n | \"text/html\"\n | \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n | \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n | \"application/vnd.openxmlformats-officedocument.presentationml.presentation\";\n}\n\nexport type ClassifyDocumentFromStreamParameters = ClassifyDocumentFromStreamQueryParam &\n ClassifyDocumentFromStreamMediaTypesParam &\n ClassifyDocumentFromStreamBodyParam &\n RequestParameters;\n\nexport interface ClassifyDocumentBodyParam {\n /** Classify request parameters. */\n body: ClassifyDocumentRequest;\n}\n\nexport interface ClassifyDocumentQueryParamProperties {\n /**\n * Method used to compute string offset and length.\n *\n * Possible values: \"textElements\", \"unicodeCodePoint\", \"utf16CodeUnit\"\n */\n stringIndexType?: StringIndexType;\n /**\n * Document splitting mode.\n *\n * Possible values: \"auto\", \"none\", \"perPage\"\n */\n split?: SplitMode;\n /** 1-based page numbers to analyze. Ex. \"1-3,5,7-9\" */\n pages?: string;\n}\n\nexport interface ClassifyDocumentQueryParam {\n queryParameters?: ClassifyDocumentQueryParamProperties;\n}\n\nexport interface ClassifyDocumentMediaTypesParam {\n /** Input content type */\n contentType: \"application/json\";\n}\n\nexport type ClassifyDocumentParameters = ClassifyDocumentQueryParam &\n ClassifyDocumentMediaTypesParam &\n ClassifyDocumentBodyParam &\n RequestParameters;\nexport type GetClassifyResultParameters = RequestParameters;\n\nexport interface AuthorizeClassifierCopyBodyParam {\n /** Authorize copy request parameters. */\n body: AuthorizeClassifierCopyRequest;\n}\n\nexport type AuthorizeClassifierCopyParameters = AuthorizeClassifierCopyBodyParam &\n RequestParameters;\n\nexport interface CopyClassifierToBodyParam {\n /** Copy to request parameters. */\n body: ClassifierCopyAuthorization;\n}\n\nexport type CopyClassifierToParameters = CopyClassifierToBodyParam & RequestParameters;\n"]}
@@ -0,0 +1,40 @@
1
+ import type { Client } from "@azure-rest/core-client";
2
+ import type { OperationState, PollerLike } from "@azure/core-lro";
3
+ import type { AnalyzeDocumentFromStream202Response, AnalyzeDocumentFromStreamDefaultResponse, AnalyzeDocumentFromStreamLogicalResponse, AnalyzeBatchDocuments202Response, AnalyzeBatchDocumentsDefaultResponse, AnalyzeBatchDocumentsLogicalResponse, BuildModel202Response, BuildModelDefaultResponse, BuildModelLogicalResponse, ComposeModel202Response, ComposeModelDefaultResponse, ComposeModelLogicalResponse, CopyModelTo202Response, CopyModelToDefaultResponse, CopyModelToLogicalResponse, BuildClassifier202Response, BuildClassifierDefaultResponse, BuildClassifierLogicalResponse, ClassifyDocumentFromStream202Response, ClassifyDocumentFromStreamDefaultResponse, ClassifyDocumentFromStreamLogicalResponse, CopyClassifierTo202Response, CopyClassifierToDefaultResponse, CopyClassifierToLogicalResponse } from "./responses.js";
4
+ /**
5
+ * Options for `getLongRunningPoller`.
6
+ */
7
+ export interface GetLongRunningPollerOptions {
8
+ /**
9
+ * Defines how much time the poller is going to wait before making a new request to the service.
10
+ */
11
+ intervalInMs?: number;
12
+ /**
13
+ * A serialized poller which can be used to resume an existing paused Long-Running-Operation.
14
+ */
15
+ restoreFrom?: string;
16
+ }
17
+ /**
18
+ * Helper function that builds a Poller object to help polling a long running operation.
19
+ * @param client - Client to use for sending the request to get additional pages.
20
+ * @param initialResponse - The initial response.
21
+ * @param options - Options to set a resume state or custom polling interval.
22
+ * @returns - A poller object to poll for operation state updates and eventually get the final response.
23
+ */
24
+ export declare function getLongRunningPoller<TResult extends AnalyzeBatchDocumentsLogicalResponse | AnalyzeBatchDocumentsDefaultResponse>(client: Client, initialResponse: AnalyzeBatchDocuments202Response | AnalyzeBatchDocumentsDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
25
+ export declare function getLongRunningPoller<TResult extends BuildModelLogicalResponse | BuildModelDefaultResponse>(client: Client, initialResponse: BuildModel202Response | BuildModelDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
26
+ export declare function getLongRunningPoller<TResult extends ComposeModelLogicalResponse | ComposeModelDefaultResponse>(client: Client, initialResponse: ComposeModel202Response | ComposeModelDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
27
+ export declare function getLongRunningPoller<TResult extends CopyModelToLogicalResponse | CopyModelToDefaultResponse>(client: Client, initialResponse: CopyModelTo202Response | CopyModelToDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
28
+ export declare function getLongRunningPoller<TResult extends BuildClassifierLogicalResponse | BuildClassifierDefaultResponse>(client: Client, initialResponse: BuildClassifier202Response | BuildClassifierDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
29
+ export declare function getLongRunningPoller<TResult extends CopyClassifierToLogicalResponse | CopyClassifierToDefaultResponse>(client: Client, initialResponse: CopyClassifierTo202Response | CopyClassifierToDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
30
+ export declare function getLongRunningPoller<TResult extends AnalyzeDocumentFromStreamLogicalResponse | AnalyzeDocumentFromStreamDefaultResponse>(client: Client, initialResponse: AnalyzeDocumentFromStream202Response | AnalyzeDocumentFromStreamDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
31
+ export declare function getLongRunningPoller<TResult extends ClassifyDocumentFromStreamLogicalResponse | ClassifyDocumentFromStreamDefaultResponse>(client: Client, initialResponse: ClassifyDocumentFromStream202Response | ClassifyDocumentFromStreamDefaultResponse, options?: GetLongRunningPollerOptions): PollerLike<OperationState<TResult>, TResult>;
32
+ /**
33
+ * Returns the operation-id from the initialResponse header
34
+ */
35
+ export declare function parseResultIdFromResponse(initialResponse: {
36
+ headers: {
37
+ "operation-location": string;
38
+ };
39
+ }): string;
40
+ //# sourceMappingURL=pollingHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollingHelper.d.ts","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAGV,cAAc,EACd,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,oCAAoC,EACpC,wCAAwC,EACxC,wCAAwC,EACxC,gCAAgC,EACh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
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createHttpPoller } from "@azure/core-lro";
4
+ export function getLongRunningPoller(client, initialResponse, options = {}) {
5
+ const abortController = new AbortController();
6
+ const poller = {
7
+ sendInitialRequest: async () => {
8
+ // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
9
+ // we are not triggering the initial request here, just extracting the information from the
10
+ // response we were provided.
11
+ return getLroResponse(initialResponse);
12
+ },
13
+ sendPollRequest: async (path, pollOptions) => {
14
+ // This is the callback that is going to be called to poll the service
15
+ // to get the latest status. We use the client provided and the polling path
16
+ // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
17
+ // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
18
+ function abortListener() {
19
+ abortController.abort();
20
+ }
21
+ const inputAbortSignal = pollOptions === null || pollOptions === void 0 ? void 0 : pollOptions.abortSignal;
22
+ const abortSignal = abortController.signal;
23
+ if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) {
24
+ abortController.abort();
25
+ }
26
+ else if (!abortSignal.aborted) {
27
+ inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, {
28
+ once: true,
29
+ });
30
+ }
31
+ let response;
32
+ try {
33
+ response = await client
34
+ .pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url)
35
+ .get({ abortSignal });
36
+ }
37
+ finally {
38
+ inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener);
39
+ }
40
+ const lroResponse = getLroResponse(response);
41
+ lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
42
+ return lroResponse;
43
+ },
44
+ };
45
+ return createHttpPoller(poller, options);
46
+ }
47
+ /**
48
+ * Returns the operation-id from the operation-location header
49
+ */
50
+ function parseResultId(operationLocationHeader) {
51
+ // regex to extract the operation id from the operation-location header with the regex "[^:]+://[^/]+/documentintelligence/.+/([^?/]+)"
52
+ const regex = /[^:]+:\/\/[^/]+\/documentintelligence\/.+\/([^?/]+)/;
53
+ const match = operationLocationHeader.match(regex);
54
+ if (!match) {
55
+ throw new Error(`Failed to parse result id from the operation-location header: ${operationLocationHeader}`);
56
+ }
57
+ return match[1];
58
+ }
59
+ /**
60
+ * Returns the operation-id from the initialResponse header
61
+ */
62
+ export function parseResultIdFromResponse(initialResponse) {
63
+ const operationLocationHeader = initialResponse.headers["operation-location"];
64
+ return parseResultId(operationLocationHeader);
65
+ }
66
+ /**
67
+ * Converts a Rest Client response to a response that the LRO implementation understands
68
+ * @param response - a rest client http response
69
+ * @returns - An LRO response that the LRO implementation understands
70
+ */
71
+ function getLroResponse(response) {
72
+ if (Number.isNaN(response.status)) {
73
+ throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
74
+ }
75
+ return {
76
+ flatResponse: response,
77
+ rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
78
+ };
79
+ }
80
+ //# sourceMappingURL=pollingHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+GnD,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,eAAwB,EACxB,UAAuC,EAAE;IAEzC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9C,MAAM,MAAM,GAA8B;QACxC,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,sGAAsG;YACtG,2FAA2F;YAC3F,6BAA6B;YAC7B,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,IAAY,EAAE,WAA+C,EAAE,EAAE;YACvF,sEAAsE;YACtE,4EAA4E;YAC5E,0JAA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K,GAAG,qDAAqD,CAAC;IACpE,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,iEAAiE,uBAAuB,EAAE,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,eAEzC;IACC,MAAM,uBAAuB,GAAG,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9E,OAAO,aAAa,CAAC,uBAAuB,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CACrB,QAAiB;IAEjB,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,SAAS,CAAC,uDAAuD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,kCACN,QAAQ,KACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n RunningOperation,\n OperationResponse,\n OperationState,\n PollerLike,\n} from \"@azure/core-lro\";\nimport { createHttpPoller } from \"@azure/core-lro\";\nimport type {\n AnalyzeDocumentFromStream202Response,\n AnalyzeDocumentFromStreamDefaultResponse,\n AnalyzeDocumentFromStreamLogicalResponse,\n AnalyzeBatchDocuments202Response,\n AnalyzeBatchDocumentsDefaultResponse,\n AnalyzeBatchDocumentsLogicalResponse,\n BuildModel202Response,\n BuildModelDefaultResponse,\n BuildModelLogicalResponse,\n ComposeModel202Response,\n ComposeModelDefaultResponse,\n ComposeModelLogicalResponse,\n CopyModelTo202Response,\n CopyModelToDefaultResponse,\n CopyModelToLogicalResponse,\n BuildClassifier202Response,\n BuildClassifierDefaultResponse,\n BuildClassifierLogicalResponse,\n ClassifyDocumentFromStream202Response,\n ClassifyDocumentFromStreamDefaultResponse,\n ClassifyDocumentFromStreamLogicalResponse,\n CopyClassifierTo202Response,\n CopyClassifierToDefaultResponse,\n CopyClassifierToLogicalResponse,\n} from \"./responses.js\";\n\n/**\n * Options for `getLongRunningPoller`.\n */\nexport interface GetLongRunningPollerOptions {\n /**\n * Defines how much time the poller is going to wait before making a new request to the service.\n */\n intervalInMs?: number;\n /**\n * A serialized poller which can be used to resume an existing paused Long-Running-Operation.\n */\n restoreFrom?: string;\n}\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<\n TResult extends AnalyzeBatchDocumentsLogicalResponse | AnalyzeBatchDocumentsDefaultResponse,\n>(\n client: Client,\n initialResponse: AnalyzeBatchDocuments202Response | AnalyzeBatchDocumentsDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends BuildModelLogicalResponse | BuildModelDefaultResponse,\n>(\n client: Client,\n initialResponse: BuildModel202Response | BuildModelDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends ComposeModelLogicalResponse | ComposeModelDefaultResponse,\n>(\n client: Client,\n initialResponse: ComposeModel202Response | ComposeModelDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends CopyModelToLogicalResponse | CopyModelToDefaultResponse,\n>(\n client: Client,\n initialResponse: CopyModelTo202Response | CopyModelToDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends BuildClassifierLogicalResponse | BuildClassifierDefaultResponse,\n>(\n client: Client,\n initialResponse: BuildClassifier202Response | BuildClassifierDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends CopyClassifierToLogicalResponse | CopyClassifierToDefaultResponse,\n>(\n client: Client,\n initialResponse: CopyClassifierTo202Response | CopyClassifierToDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends\n | AnalyzeDocumentFromStreamLogicalResponse\n | AnalyzeDocumentFromStreamDefaultResponse,\n>(\n client: Client,\n initialResponse: AnalyzeDocumentFromStream202Response | AnalyzeDocumentFromStreamDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<\n TResult extends\n | ClassifyDocumentFromStreamLogicalResponse\n | ClassifyDocumentFromStreamDefaultResponse,\n>(\n client: Client,\n initialResponse:\n | ClassifyDocumentFromStream202Response\n | ClassifyDocumentFromStreamDefaultResponse,\n options?: GetLongRunningPollerOptions,\n): PollerLike<OperationState<TResult>, TResult>;\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: GetLongRunningPollerOptions = {},\n): PollerLike<OperationState<TResult>, TResult> {\n const abortController = new AbortController();\n const poller: RunningOperation<TResult> = {\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path: string, pollOptions?: { abortSignal?: AbortSignalLike }) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get({ abortSignal });\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n return createHttpPoller(poller, options);\n}\n\n/**\n * Returns the operation-id from the operation-location header\n */\nfunction parseResultId(operationLocationHeader: string): string {\n // regex to extract the operation id from the operation-location header with the regex \"[^:]+://[^/]+/documentintelligence/.+/([^?/]+)\"\n const regex = /[^:]+:\\/\\/[^/]+\\/documentintelligence\\/.+\\/([^?/]+)/;\n const match = operationLocationHeader.match(regex);\n if (!match) {\n throw new Error(\n `Failed to parse result id from the operation-location header: ${operationLocationHeader}`,\n );\n }\n return match[1];\n}\n\n/**\n * Returns the operation-id from the initialResponse header\n */\nexport function parseResultIdFromResponse(initialResponse: {\n headers: { \"operation-location\": string };\n}): string {\n const operationLocationHeader = initialResponse.headers[\"operation-location\"];\n return parseResultId(operationLocationHeader);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult,\n): OperationResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}