mindee 5.7.2 → 5.9.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 (264) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/package.json +104 -95
  3. package/src/geometry/bbox.js +1 -1
  4. package/src/image/extractedImages.d.ts +1 -1
  5. package/src/image/imageExtractor.d.ts +1 -1
  6. package/src/image/imageExtractor.js +2 -2
  7. package/src/input/localInputSource.d.ts +1 -1
  8. package/src/parsing/baseLocalResponse.d.ts +1 -1
  9. package/src/pdf/extractedPdfs.d.ts +1 -1
  10. package/src/pdf/pdfExtractor.d.ts +1 -1
  11. package/src/pdf/pdfExtractor.js +2 -2
  12. package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +2 -2
  13. package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +2 -2
  14. package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.d.ts +2 -2
  15. package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +1 -1
  16. package/src/v1/http/baseEndpoint.d.ts +1 -1
  17. package/src/v1/http/endpoint.d.ts +1 -1
  18. package/src/v1/http/endpoint.js +1 -1
  19. package/src/v1/http/httpParams.d.ts +1 -1
  20. package/src/v1/http/workflowEndpoint.d.ts +2 -2
  21. package/src/v1/http/workflowEndpoint.js +1 -1
  22. package/src/v1/parsing/common/execution.d.ts +1 -1
  23. package/src/v1/parsing/common/execution.js +1 -1
  24. package/src/v1/parsing/common/extras/cropperExtra.d.ts +1 -1
  25. package/src/v1/parsing/common/extras/cropperExtra.js +1 -1
  26. package/src/v1/parsing/common/ocrPage.d.ts +1 -1
  27. package/src/v1/parsing/common/ocrPage.js +1 -1
  28. package/src/v1/parsing/common/orientation.d.ts +1 -1
  29. package/src/v1/parsing/common/orientation.js +1 -1
  30. package/src/v1/parsing/generated/generatedList.d.ts +1 -1
  31. package/src/v1/parsing/generated/generatedList.js +1 -1
  32. package/src/v1/parsing/generated/generatedObject.d.ts +1 -1
  33. package/src/v1/parsing/generated/generatedObject.js +1 -1
  34. package/src/v1/parsing/localResponse.d.ts +1 -1
  35. package/src/v1/parsing/localResponse.js +1 -1
  36. package/src/v1/parsing/standard/amount.js +1 -1
  37. package/src/v1/parsing/standard/companyRegistration.js +1 -1
  38. package/src/v1/parsing/standard/tax.d.ts +1 -1
  39. package/src/v1/parsing/standard/tax.js +1 -1
  40. package/src/v1/product/barcodeReader/barcodeReaderV1.d.ts +1 -1
  41. package/src/v1/product/barcodeReader/barcodeReaderV1.js +1 -1
  42. package/src/v1/product/barcodeReader/barcodeReaderV1Document.d.ts +2 -2
  43. package/src/v1/product/barcodeReader/barcodeReaderV1Document.js +2 -2
  44. package/src/v1/product/cliProducts.d.ts +2 -2
  45. package/src/v1/product/cliProducts.js +1 -1
  46. package/src/v1/product/cropper/cropperV1.d.ts +1 -1
  47. package/src/v1/product/cropper/cropperV1.js +1 -1
  48. package/src/v1/product/cropper/cropperV1Document.d.ts +1 -1
  49. package/src/v1/product/cropper/cropperV1Page.d.ts +2 -2
  50. package/src/v1/product/cropper/cropperV1Page.js +2 -2
  51. package/src/v1/product/driverLicense/driverLicenseV1.d.ts +1 -1
  52. package/src/v1/product/driverLicense/driverLicenseV1.js +1 -1
  53. package/src/v1/product/driverLicense/driverLicenseV1Document.d.ts +2 -2
  54. package/src/v1/product/driverLicense/driverLicenseV1Document.js +2 -2
  55. package/src/v1/product/financialDocument/financialDocumentV1.d.ts +1 -1
  56. package/src/v1/product/financialDocument/financialDocumentV1.js +1 -1
  57. package/src/v1/product/financialDocument/financialDocumentV1Document.d.ts +2 -2
  58. package/src/v1/product/financialDocument/financialDocumentV1Document.js +2 -2
  59. package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +1 -1
  60. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +1 -1
  61. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.js +1 -1
  62. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +2 -2
  63. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +2 -2
  64. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +1 -1
  65. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.js +1 -1
  66. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +2 -2
  67. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +2 -2
  68. package/src/v1/product/fr/carteGrise/carteGriseV1.d.ts +1 -1
  69. package/src/v1/product/fr/carteGrise/carteGriseV1.js +1 -1
  70. package/src/v1/product/fr/carteGrise/carteGriseV1Document.d.ts +2 -2
  71. package/src/v1/product/fr/carteGrise/carteGriseV1Document.js +2 -2
  72. package/src/v1/product/fr/idCard/idCardV2.d.ts +1 -1
  73. package/src/v1/product/fr/idCard/idCardV2.js +1 -1
  74. package/src/v1/product/fr/idCard/idCardV2Document.d.ts +2 -2
  75. package/src/v1/product/fr/idCard/idCardV2Document.js +2 -2
  76. package/src/v1/product/fr/idCard/idCardV2Page.d.ts +2 -2
  77. package/src/v1/product/fr/idCard/idCardV2Page.js +2 -2
  78. package/src/v1/product/generated/generatedV1.d.ts +1 -1
  79. package/src/v1/product/generated/generatedV1.js +1 -1
  80. package/src/v1/product/generated/generatedV1Document.js +2 -2
  81. package/src/v1/product/generated/generatedV1Page.js +2 -2
  82. package/src/v1/product/generated/generatedV1Prediction.d.ts +3 -3
  83. package/src/v1/product/generated/generatedV1Prediction.js +3 -3
  84. package/src/v1/product/internationalId/internationalIdV2.d.ts +1 -1
  85. package/src/v1/product/internationalId/internationalIdV2.js +1 -1
  86. package/src/v1/product/internationalId/internationalIdV2Document.d.ts +2 -2
  87. package/src/v1/product/internationalId/internationalIdV2Document.js +2 -2
  88. package/src/v1/product/invoice/invoiceV4.d.ts +1 -1
  89. package/src/v1/product/invoice/invoiceV4.js +1 -1
  90. package/src/v1/product/invoice/invoiceV4Document.d.ts +2 -2
  91. package/src/v1/product/invoice/invoiceV4Document.js +2 -2
  92. package/src/v1/product/invoice/invoiceV4LineItem.js +1 -1
  93. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.d.ts +1 -1
  94. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.js +1 -1
  95. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +1 -1
  96. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.js +1 -1
  97. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +1 -1
  98. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +1 -1
  99. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +2 -2
  100. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +2 -2
  101. package/src/v1/product/passport/passportV1.d.ts +1 -1
  102. package/src/v1/product/passport/passportV1.js +1 -1
  103. package/src/v1/product/passport/passportV1Document.d.ts +2 -2
  104. package/src/v1/product/passport/passportV1Document.js +2 -2
  105. package/src/v1/product/receipt/receiptV5.d.ts +1 -1
  106. package/src/v1/product/receipt/receiptV5.js +1 -1
  107. package/src/v1/product/receipt/receiptV5Document.d.ts +2 -2
  108. package/src/v1/product/receipt/receiptV5Document.js +2 -2
  109. package/src/v1/product/receipt/receiptV5LineItem.js +1 -1
  110. package/src/v1/product/resume/resumeV1.d.ts +1 -1
  111. package/src/v1/product/resume/resumeV1.js +1 -1
  112. package/src/v1/product/resume/resumeV1Certificate.js +1 -1
  113. package/src/v1/product/resume/resumeV1Document.d.ts +2 -2
  114. package/src/v1/product/resume/resumeV1Document.js +2 -2
  115. package/src/v1/product/resume/resumeV1Education.js +1 -1
  116. package/src/v1/product/resume/resumeV1Language.js +1 -1
  117. package/src/v1/product/resume/resumeV1ProfessionalExperience.js +1 -1
  118. package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +1 -1
  119. package/src/v1/product/us/bankCheck/bankCheckV1.d.ts +1 -1
  120. package/src/v1/product/us/bankCheck/bankCheckV1.js +1 -1
  121. package/src/v1/product/us/bankCheck/bankCheckV1Document.d.ts +2 -2
  122. package/src/v1/product/us/bankCheck/bankCheckV1Document.js +2 -2
  123. package/src/v1/product/us/bankCheck/bankCheckV1Page.d.ts +2 -2
  124. package/src/v1/product/us/bankCheck/bankCheckV1Page.js +2 -2
  125. package/src/v2/cli.js +1 -1
  126. package/src/v2/client.d.ts +94 -18
  127. package/src/v2/client.js +171 -27
  128. package/src/v2/clientOptions/baseAnnotationParameters.d.ts +23 -0
  129. package/src/v2/clientOptions/baseAnnotationParameters.js +17 -0
  130. package/src/v2/clientOptions/baseProductParameters.js +3 -2
  131. package/src/v2/clientOptions/baseRagDocumentUploadParameters.d.ts +23 -0
  132. package/src/v2/clientOptions/baseRagDocumentUploadParameters.js +24 -0
  133. package/src/v2/clientOptions/index.d.ts +2 -0
  134. package/src/v2/clientOptions/index.js +2 -0
  135. package/src/v2/fileOperations/crop.d.ts +1 -1
  136. package/src/v2/http/errors.d.ts +1 -1
  137. package/src/v2/http/mindeeApiV2.d.ts +35 -6
  138. package/src/v2/http/mindeeApiV2.js +91 -10
  139. package/src/v2/index.d.ts +1 -1
  140. package/src/v2/index.js +1 -1
  141. package/src/v2/parsing/baseRagAnnotationResponse.d.ts +28 -0
  142. package/src/v2/parsing/baseRagAnnotationResponse.js +14 -0
  143. package/src/v2/parsing/baseResponse.d.ts +6 -2
  144. package/src/v2/parsing/baseResponse.js +3 -1
  145. package/src/v2/parsing/error/errorItem.d.ts +1 -1
  146. package/src/v2/parsing/error/errorItem.js +1 -3
  147. package/src/v2/parsing/error/errorResponse.d.ts +5 -1
  148. package/src/v2/parsing/error/errorResponse.js +27 -1
  149. package/src/v2/parsing/index.d.ts +3 -1
  150. package/src/v2/parsing/index.js +2 -1
  151. package/src/v2/parsing/inference/failedInferenceResponse.d.ts +2 -2
  152. package/src/v2/parsing/inference/failedInferenceResponse.js +2 -2
  153. package/src/v2/parsing/inference/field/inferenceFields.d.ts +9 -3
  154. package/src/v2/parsing/inference/field/inferenceFields.js +9 -3
  155. package/src/v2/parsing/inference/field/objectField.d.ts +13 -9
  156. package/src/v2/parsing/inference/field/objectField.js +19 -33
  157. package/src/v2/parsing/inference/index.d.ts +1 -0
  158. package/src/v2/parsing/inference/index.js +1 -0
  159. package/src/v2/parsing/job/job.d.ts +8 -8
  160. package/src/v2/parsing/job/job.js +1 -1
  161. package/src/v2/parsing/job/jobResponse.d.ts +1 -1
  162. package/src/v2/parsing/job/jobResponse.js +1 -1
  163. package/src/v2/parsing/job/jobWebhook.d.ts +1 -1
  164. package/src/v2/parsing/job/jobWebhook.js +1 -1
  165. package/src/v2/parsing/search/baseSearchResponse.d.ts +1 -1
  166. package/src/v2/parsing/search/baseSearchResponse.js +1 -1
  167. package/src/v2/parsing/search/searchModels.d.ts +1 -1
  168. package/src/v2/parsing/search/searchModels.js +1 -1
  169. package/src/v2/parsing/search/searchRagDocuments.d.ts +1 -1
  170. package/src/v2/parsing/search/searchRagDocuments.js +1 -1
  171. package/src/v2/parsing/search/searchResponse.d.ts +1 -1
  172. package/src/v2/parsing/search/searchResponse.js +1 -1
  173. package/src/v2/product/baseProduct.d.ts +26 -6
  174. package/src/v2/product/baseProduct.js +31 -7
  175. package/src/v2/product/classification/classification.d.ts +1 -1
  176. package/src/v2/product/classification/classification.js +1 -1
  177. package/src/v2/product/classification/classificationClassifier.d.ts +1 -1
  178. package/src/v2/product/classification/classificationClassifier.js +1 -1
  179. package/src/v2/product/classification/classificationInference.d.ts +1 -1
  180. package/src/v2/product/classification/classificationInference.js +1 -1
  181. package/src/v2/product/classification/classificationResponse.d.ts +1 -1
  182. package/src/v2/product/classification/classificationResponse.js +1 -1
  183. package/src/v2/product/classification/params/classificationParameters.d.ts +1 -1
  184. package/src/v2/product/classification/params/classificationParameters.js +1 -1
  185. package/src/v2/product/crop/crop.d.ts +1 -1
  186. package/src/v2/product/crop/crop.js +1 -1
  187. package/src/v2/product/crop/cropInference.d.ts +2 -2
  188. package/src/v2/product/crop/cropInference.js +2 -2
  189. package/src/v2/product/crop/cropItem.d.ts +2 -2
  190. package/src/v2/product/crop/cropItem.js +3 -3
  191. package/src/v2/product/crop/cropResponse.d.ts +1 -1
  192. package/src/v2/product/crop/cropResponse.js +1 -1
  193. package/src/v2/product/crop/cropResult.d.ts +1 -1
  194. package/src/v2/product/crop/cropResult.js +2 -2
  195. package/src/v2/product/crop/params/cropParameters.d.ts +1 -1
  196. package/src/v2/product/crop/params/cropParameters.js +1 -1
  197. package/src/v2/product/extraction/extraction.d.ts +10 -2
  198. package/src/v2/product/extraction/extraction.js +17 -3
  199. package/src/v2/product/extraction/extractionInference.d.ts +1 -1
  200. package/src/v2/product/extraction/extractionInference.js +1 -1
  201. package/src/v2/product/extraction/extractionResponse.d.ts +1 -1
  202. package/src/v2/product/extraction/extractionResponse.js +1 -1
  203. package/src/v2/product/extraction/extractionResult.d.ts +3 -3
  204. package/src/v2/product/extraction/extractionResult.js +3 -3
  205. package/src/v2/product/extraction/index.d.ts +1 -0
  206. package/src/v2/product/extraction/index.js +1 -0
  207. package/src/v2/product/extraction/params/extractionParameters.d.ts +1 -1
  208. package/src/v2/product/extraction/params/extractionParameters.js +1 -1
  209. package/src/v2/product/extraction/ragDocuments/annotatedBaseField.d.ts +20 -0
  210. package/src/v2/product/extraction/ragDocuments/annotatedBaseField.js +15 -0
  211. package/src/v2/product/extraction/ragDocuments/annotatedFields.d.ts +27 -0
  212. package/src/v2/product/extraction/ragDocuments/annotatedFields.js +57 -0
  213. package/src/v2/product/extraction/ragDocuments/annotatedListField.d.ts +24 -0
  214. package/src/v2/product/extraction/ragDocuments/annotatedListField.js +67 -0
  215. package/src/v2/product/extraction/ragDocuments/annotatedObjectField.d.ts +43 -0
  216. package/src/v2/product/extraction/ragDocuments/annotatedObjectField.js +47 -0
  217. package/src/v2/product/extraction/ragDocuments/annotatedSimpleField.d.ts +15 -0
  218. package/src/v2/product/extraction/ragDocuments/annotatedSimpleField.js +13 -0
  219. package/src/v2/product/extraction/ragDocuments/extractionRagAnnotationResponse.d.ts +25 -0
  220. package/src/v2/product/extraction/ragDocuments/extractionRagAnnotationResponse.js +17 -0
  221. package/src/v2/product/extraction/ragDocuments/fieldFactory.d.ts +12 -0
  222. package/src/v2/product/extraction/ragDocuments/fieldFactory.js +23 -0
  223. package/src/v2/product/extraction/ragDocuments/index.d.ts +7 -0
  224. package/src/v2/product/extraction/ragDocuments/index.js +7 -0
  225. package/src/v2/product/extraction/ragDocuments/params/index.d.ts +2 -0
  226. package/src/v2/product/extraction/ragDocuments/params/index.js +2 -0
  227. package/src/v2/product/extraction/ragDocuments/params/ragDocumentAnnotationParameters.d.ts +27 -0
  228. package/src/v2/product/extraction/ragDocuments/params/ragDocumentAnnotationParameters.js +43 -0
  229. package/src/v2/product/extraction/ragDocuments/params/ragDocumentUploadParameters.d.ts +7 -0
  230. package/src/v2/product/extraction/ragDocuments/params/ragDocumentUploadParameters.js +9 -0
  231. package/src/v2/product/extraction/ragDocuments/ragAnnotation.d.ts +12 -0
  232. package/src/v2/product/extraction/ragDocuments/ragAnnotation.js +9 -0
  233. package/src/v2/product/ocr/ocr.d.ts +1 -1
  234. package/src/v2/product/ocr/ocr.js +1 -1
  235. package/src/v2/product/ocr/ocrInference.d.ts +2 -2
  236. package/src/v2/product/ocr/ocrInference.js +2 -2
  237. package/src/v2/product/ocr/ocrResponse.d.ts +1 -1
  238. package/src/v2/product/ocr/ocrResponse.js +1 -1
  239. package/src/v2/product/ocr/params/ocrParameters.d.ts +1 -1
  240. package/src/v2/product/ocr/params/ocrParameters.js +1 -1
  241. package/src/v2/product/split/params/splitParameters.d.ts +1 -1
  242. package/src/v2/product/split/params/splitParameters.js +1 -1
  243. package/src/v2/product/split/split.d.ts +1 -1
  244. package/src/v2/product/split/split.js +1 -1
  245. package/src/v2/product/split/splitInference.d.ts +1 -1
  246. package/src/v2/product/split/splitInference.js +1 -1
  247. package/src/v2/product/split/splitRange.d.ts +1 -1
  248. package/src/v2/product/split/splitRange.js +2 -2
  249. package/src/v2/product/split/splitResponse.d.ts +1 -1
  250. package/src/v2/product/split/splitResponse.js +1 -1
  251. package/src/v2/product/split/splitResult.js +1 -1
  252. package/src/v2/search/baseSearch.d.ts +2 -2
  253. package/src/v2/search/models/modelSearch.d.ts +3 -3
  254. package/src/v2/search/models/modelSearch.js +3 -3
  255. package/src/v2/search/models/modelSearchParameters.d.ts +1 -1
  256. package/src/v2/search/models/modelSearchParameters.js +1 -1
  257. package/src/v2/search/models/modelSearchResponse.d.ts +2 -2
  258. package/src/v2/search/models/modelSearchResponse.js +2 -2
  259. package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +3 -3
  260. package/src/v2/search/ragDocuments/ragDocumentSearch.js +3 -3
  261. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +1 -1
  262. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +1 -1
  263. package/src/v2/search/ragDocuments/ragDocumentSearchResponse.d.ts +2 -2
  264. package/src/v2/search/ragDocuments/ragDocumentSearchResponse.js +2 -2
@@ -1,32 +1,32 @@
1
1
  import { StringDict } from "../../../parsing/index.js";
2
- import { ErrorResponse } from "../../../v2/index.js";
2
+ import { ErrorResponse } from "../../index.js";
3
3
  import { JobWebhook } from "./jobWebhook.js";
4
4
  /**
5
5
  * Job information for a V2 polling attempt.
6
6
  */
7
7
  export declare class Job {
8
8
  /**
9
- * Job ID.
9
+ * UUID of the Job.
10
10
  */
11
11
  id: string;
12
12
  /**
13
- * Error response if any.
13
+ * If an error occurred during processing, contains the problem details.
14
14
  */
15
15
  error?: ErrorResponse;
16
16
  /**
17
17
  * Date and time of the Job creation.
18
18
  */
19
- createdAt: Date | null;
19
+ createdAt: Date;
20
20
  /**
21
21
  * Date and time of the Job completion. Filled once processing is finished.
22
22
  */
23
23
  completedAt: Date | null | undefined;
24
24
  /**
25
- * ID of the model.
25
+ * UUID of the model to be used for the inference.
26
26
  */
27
27
  modelId: string;
28
28
  /**
29
- * Name for the file.
29
+ * Name of the file sent.
30
30
  */
31
31
  filename: string;
32
32
  /**
@@ -42,11 +42,11 @@ export declare class Job {
42
42
  */
43
43
  pollingUrl: string;
44
44
  /**
45
- * URL to poll for the job result, redirects to the result if available.
45
+ * URL to retrieve the inference results. Will be filled once the inference is ready.
46
46
  */
47
47
  resultUrl?: string;
48
48
  /**
49
- * ID of webhooks associated with the job.
49
+ * List of responses from webhooks called. Empty until processing is finished.
50
50
  */
51
51
  webhooks: Array<JobWebhook>;
52
52
  constructor(serverResponse: StringDict);
@@ -1,5 +1,5 @@
1
1
  import { parseDate } from "../../../parsing/index.js";
2
- import { ErrorResponse } from "../../../v2/index.js";
2
+ import { ErrorResponse } from "../../index.js";
3
3
  import { JobWebhook } from "./jobWebhook.js";
4
4
  /**
5
5
  * Job information for a V2 polling attempt.
@@ -1,4 +1,4 @@
1
- import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
1
+ import { BaseResponse } from "../baseResponse.js";
2
2
  import { StringDict } from "../../../parsing/stringDict.js";
3
3
  import { Job } from "./job.js";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
1
+ import { BaseResponse } from "../baseResponse.js";
2
2
  import { Job } from "./job.js";
3
3
  /**
4
4
  * Job response class.
@@ -1,4 +1,4 @@
1
- import { ErrorResponse } from "../../../v2/parsing/index.js";
1
+ import { ErrorResponse } from "../index.js";
2
2
  import { StringDict } from "../../../parsing/index.js";
3
3
  /**
4
4
  * JobWebhook information.
@@ -1,4 +1,4 @@
1
- import { ErrorResponse } from "../../../v2/parsing/index.js";
1
+ import { ErrorResponse } from "../index.js";
2
2
  import { parseDate } from "../../../parsing/index.js";
3
3
  /**
4
4
  * JobWebhook information.
@@ -1,5 +1,5 @@
1
1
  import { StringDict } from "../../../parsing/index.js";
2
- import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
2
+ import { BaseResponse } from "../baseResponse.js";
3
3
  import { PaginationMetadata } from "./paginationMetadata.js";
4
4
  /**
5
5
  * Base class for search responses.
@@ -1,4 +1,4 @@
1
- import { BaseResponse } from "../../../v2/parsing/baseResponse.js";
1
+ import { BaseResponse } from "../baseResponse.js";
2
2
  import { PaginationMetadata } from "./paginationMetadata.js";
3
3
  /**
4
4
  * Base class for search responses.
@@ -1,4 +1,4 @@
1
- import { SearchModel } from "../../../v2/parsing/search/searchModel.js";
1
+ import { SearchModel } from "./searchModel.js";
2
2
  import { StringDict } from "../../../parsing/index.js";
3
3
  /**
4
4
  * List of search models.
@@ -1,4 +1,4 @@
1
- import { SearchModel } from "../../../v2/parsing/search/searchModel.js";
1
+ import { SearchModel } from "./searchModel.js";
2
2
  /**
3
3
  * List of search models.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SearchRagDocument } from "../../../v2/parsing/search/searchRagDocument.js";
1
+ import { SearchRagDocument } from "./searchRagDocument.js";
2
2
  import { StringDict } from "../../../parsing/index.js";
3
3
  /**
4
4
  * List of RAG documents.
@@ -1,4 +1,4 @@
1
- import { SearchRagDocument } from "../../../v2/parsing/search/searchRagDocument.js";
1
+ import { SearchRagDocument } from "./searchRagDocument.js";
2
2
  /**
3
3
  * List of RAG documents.
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { StringDict } from "../../../parsing/index.js";
2
- import { ModelSearchResponse } from "../../../v2/search/models/modelSearchResponse.js";
2
+ import { ModelSearchResponse } from "../../search/models/modelSearchResponse.js";
3
3
  /**
4
4
  * Models search response.
5
5
  * @deprecated Use `ModelSearchResponse` instead.
@@ -1,4 +1,4 @@
1
- import { ModelSearchResponse } from "../../../v2/search/models/modelSearchResponse.js";
1
+ import { ModelSearchResponse } from "../../search/models/modelSearchResponse.js";
2
2
  /**
3
3
  * Models search response.
4
4
  * @deprecated Use `ModelSearchResponse` instead.
@@ -1,15 +1,35 @@
1
- import { BaseProductParameters } from "../../v2/index.js";
2
- import { ResponseConstructor } from "../../v2/parsing/index.js";
1
+ import { BaseProductParameters } from "../index.js";
2
+ import { ResponseConstructor, AnnotationResponseConstructor } from "../parsing/index.js";
3
+ import { BaseAnnotationParameters } from "../clientOptions/index.js";
4
+ import { BaseRagDocumentUploadParameters } from "../clientOptions/index.js";
3
5
  /**
4
6
  * Base class for all V2 product definitions.
5
7
  *
6
8
  * Child classes are passed to the Client when making requests.
7
9
  */
8
10
  export declare abstract class BaseProduct {
9
- /** Parameter class accepted by this product. */
11
+ /**
12
+ * API slug for this product.
13
+ */
14
+ static get slug(): string;
15
+ /**
16
+ * Parameter class accepted by this product.
17
+ */
10
18
  static get parametersClass(): new (...args: any[]) => BaseProductParameters;
11
- /** Response class returned by this product. */
19
+ /**
20
+ * Response class returned by this product.
21
+ */
12
22
  static get responseClass(): ResponseConstructor<any>;
13
- /** API slug for this product. */
14
- static get slug(): string;
23
+ /**
24
+ * Annotation Response class returned by this product.
25
+ */
26
+ static get annotationResponseClass(): AnnotationResponseConstructor<any>;
27
+ /**
28
+ * Annotation Parameters class for this product.
29
+ */
30
+ static get annotationParametersClass(): new (...args: any[]) => BaseAnnotationParameters;
31
+ /**
32
+ * Document Upload class for this product.
33
+ */
34
+ static get ragDocumentUploadClass(): new (...args: any[]) => BaseRagDocumentUploadParameters;
15
35
  }
@@ -4,16 +4,40 @@
4
4
  * Child classes are passed to the Client when making requests.
5
5
  */
6
6
  export class BaseProduct {
7
- /** Parameter class accepted by this product. */
7
+ /**
8
+ * API slug for this product.
9
+ */
10
+ static get slug() {
11
+ throw new Error("Must define static slug property");
12
+ }
13
+ /**
14
+ * Parameter class accepted by this product.
15
+ */
8
16
  static get parametersClass() {
9
- throw new Error("Must define static parameters property");
17
+ throw new Error("Must define static parametersClass property");
10
18
  }
11
- /** Response class returned by this product. */
19
+ /**
20
+ * Response class returned by this product.
21
+ */
12
22
  static get responseClass() {
13
- throw new Error("Must define static response property");
23
+ throw new Error("Must define static responseClass property");
14
24
  }
15
- /** API slug for this product. */
16
- static get slug() {
17
- throw new Error("Must define static slug property");
25
+ /**
26
+ * Annotation Response class returned by this product.
27
+ */
28
+ static get annotationResponseClass() {
29
+ throw new Error("Must define static annotationResponseClass property");
30
+ }
31
+ /**
32
+ * Annotation Parameters class for this product.
33
+ */
34
+ static get annotationParametersClass() {
35
+ throw new Error("Must define static annotationParametersClass property");
36
+ }
37
+ /**
38
+ * Document Upload class for this product.
39
+ */
40
+ static get ragDocumentUploadClass() {
41
+ throw new Error("Must define static ragDocumentUploadClass property");
18
42
  }
19
43
  }
@@ -1,6 +1,6 @@
1
1
  import { ClassificationResponse } from "./classificationResponse.js";
2
2
  import { ClassificationParameters } from "./params/index.js";
3
- import { BaseProduct } from "../../../v2/product/baseProduct.js";
3
+ import { BaseProduct } from "../baseProduct.js";
4
4
  /**
5
5
  * Automatically sort any image or scanned document into categories.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { ClassificationResponse } from "./classificationResponse.js";
2
2
  import { ClassificationParameters } from "./params/index.js";
3
- import { BaseProduct } from "../../../v2/product/baseProduct.js";
3
+ import { BaseProduct } from "../baseProduct.js";
4
4
  /**
5
5
  * Automatically sort any image or scanned document into categories.
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import { StringDict } from "../../../parsing/index.js";
2
- import { ExtractionResponse } from "../../../v2/product/index.js";
2
+ import { ExtractionResponse } from "../index.js";
3
3
  /**
4
4
  * Document level classification.
5
5
  */
@@ -1,4 +1,4 @@
1
- import { ExtractionResponse } from "../../../v2/product/index.js";
1
+ import { ExtractionResponse } from "../index.js";
2
2
  /**
3
3
  * Document level classification.
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { StringDict } from "../../../parsing/index.js";
2
- import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
2
+ import { BaseInference } from "../../parsing/inference/baseInference.js";
3
3
  import { ClassificationResult } from "./classificationResult.js";
4
4
  /** Inference payload for classification responses. */
5
5
  export declare class ClassificationInference extends BaseInference {
@@ -1,4 +1,4 @@
1
- import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
1
+ import { BaseInference } from "../../parsing/inference/baseInference.js";
2
2
  import { ClassificationResult } from "./classificationResult.js";
3
3
  /** Inference payload for classification responses. */
4
4
  export class ClassificationInference extends BaseInference {
@@ -1,6 +1,6 @@
1
1
  import { StringDict } from "../../../parsing/stringDict.js";
2
2
  import { ClassificationInference } from "./classificationInference.js";
3
- import { BaseResponse } from "../../../v2/parsing/index.js";
3
+ import { BaseResponse } from "../../parsing/index.js";
4
4
  /** Response wrapper for classification product calls. */
5
5
  export declare class ClassificationResponse extends BaseResponse {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { ClassificationInference } from "./classificationInference.js";
2
- import { BaseResponse } from "../../../v2/parsing/index.js";
2
+ import { BaseResponse } from "../../parsing/index.js";
3
3
  /** Response wrapper for classification product calls. */
4
4
  export class ClassificationResponse extends BaseResponse {
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
1
+ import { BaseProductParameters, BaseProductParametersConstructor } from "../../../clientOptions/baseProductParameters.js";
2
2
  /**
3
3
  * Parameters for sending a file to a Classification product.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
1
+ import { BaseProductParameters } from "../../../clientOptions/baseProductParameters.js";
2
2
  import { logger } from "../../../../logger.js";
3
3
  /**
4
4
  * Parameters for sending a file to a Classification product.
@@ -1,6 +1,6 @@
1
1
  import { CropResponse } from "./cropResponse.js";
2
2
  import { CropParameters } from "./params/index.js";
3
- import { BaseProduct } from "../../../v2/product/baseProduct.js";
3
+ import { BaseProduct } from "../baseProduct.js";
4
4
  /**
5
5
  * Identify the borders of documents on each page, matching each one to a category.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { CropResponse } from "./cropResponse.js";
2
2
  import { CropParameters } from "./params/index.js";
3
- import { BaseProduct } from "../../../v2/product/baseProduct.js";
3
+ import { BaseProduct } from "../baseProduct.js";
4
4
  /**
5
5
  * Identify the borders of documents on each page, matching each one to a category.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { StringDict } from "../../../parsing/index.js";
2
- import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
3
- import { CropResult } from "../../../v2/product/crop/cropResult.js";
2
+ import { BaseInference } from "../../parsing/inference/baseInference.js";
3
+ import { CropResult } from "./cropResult.js";
4
4
  /** Inference payload for crop responses. */
5
5
  export declare class CropInference extends BaseInference {
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
2
- import { CropResult } from "../../../v2/product/crop/cropResult.js";
1
+ import { BaseInference } from "../../parsing/inference/baseInference.js";
2
+ import { CropResult } from "./cropResult.js";
3
3
  /** Inference payload for crop responses. */
4
4
  export class CropInference extends BaseInference {
5
5
  constructor(serverResponse) {
@@ -1,8 +1,8 @@
1
- import { FieldLocation } from "../../../v2/parsing/inference/field/index.js";
1
+ import { FieldLocation } from "../../parsing/inference/field/index.js";
2
2
  import { StringDict } from "../../../parsing/index.js";
3
3
  import { LocalInputSource } from "../../../input/index.js";
4
4
  import { ExtractedImage } from "../../../image/index.js";
5
- import { ExtractionResponse } from "../../../v2/product/index.js";
5
+ import { ExtractionResponse } from "../index.js";
6
6
  /** Single crop detection returned by the crop product. */
7
7
  export declare class CropItem {
8
8
  /**
@@ -1,6 +1,6 @@
1
- import { FieldLocation } from "../../../v2/parsing/inference/field/index.js";
2
- import { extractSingleCrop } from "../../../v2/fileOperations/crop.js";
3
- import { ExtractionResponse } from "../../../v2/product/index.js";
1
+ import { FieldLocation } from "../../parsing/inference/field/index.js";
2
+ import { extractSingleCrop } from "../../fileOperations/crop.js";
3
+ import { ExtractionResponse } from "../index.js";
4
4
  /** Single crop detection returned by the crop product. */
5
5
  export class CropItem {
6
6
  constructor(serverResponse) {
@@ -1,5 +1,5 @@
1
1
  import { StringDict } from "../../../parsing/stringDict.js";
2
- import { BaseResponse } from "../../../v2/parsing/index.js";
2
+ import { BaseResponse } from "../../parsing/index.js";
3
3
  import { CropInference } from "./cropInference.js";
4
4
  /** Response wrapper for crop product calls. */
5
5
  export declare class CropResponse extends BaseResponse {
@@ -1,4 +1,4 @@
1
- import { BaseResponse } from "../../../v2/parsing/index.js";
1
+ import { BaseResponse } from "../../parsing/index.js";
2
2
  import { CropInference } from "./cropInference.js";
3
3
  /** Response wrapper for crop product calls. */
4
4
  export class CropResponse extends BaseResponse {
@@ -1,5 +1,5 @@
1
1
  import { StringDict } from "../../../parsing/stringDict.js";
2
- import { CropItem } from "../../../v2/product/crop/cropItem.js";
2
+ import { CropItem } from "./cropItem.js";
3
3
  import { LocalInputSource } from "../../../input/index.js";
4
4
  import { ExtractedImages } from "../../../image/extractedImages.js";
5
5
  /** Crop section of a crop inference result. */
@@ -1,5 +1,5 @@
1
- import { CropItem } from "../../../v2/product/crop/cropItem.js";
2
- import { extractMultipleCrops } from "../../../v2/fileOperations/crop.js";
1
+ import { CropItem } from "./cropItem.js";
2
+ import { extractMultipleCrops } from "../../fileOperations/crop.js";
3
3
  /** Crop section of a crop inference result. */
4
4
  export class CropResult {
5
5
  constructor(serverResponse) {
@@ -1,4 +1,4 @@
1
- import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
1
+ import { BaseProductParameters, BaseProductParametersConstructor } from "../../../clientOptions/baseProductParameters.js";
2
2
  /**
3
3
  * Parameters for sending a file to a Crop product.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
1
+ import { BaseProductParameters } from "../../../clientOptions/baseProductParameters.js";
2
2
  import { logger } from "../../../../logger.js";
3
3
  /**
4
4
  * Parameters for sending a file to a Crop product.
@@ -1,14 +1,22 @@
1
1
  import { ExtractionResponse } from "./extractionResponse.js";
2
2
  import { ExtractionParameters } from "./params/index.js";
3
- import { BaseProduct } from "../../../v2/product/baseProduct.js";
3
+ import { BaseProduct } from "../baseProduct.js";
4
+ import { ExtractionRagAnnotationResponse } from "./ragDocuments/index.js";
5
+ import { RagDocumentAnnotationParameters, RagDocumentUploadParameters } from "./ragDocuments/params/index.js";
4
6
  /**
5
7
  * Automatically extract structured data from any image or scanned document.
6
8
  */
7
9
  export declare class Extraction extends BaseProduct {
10
+ /** @inheritDoc */
11
+ static get slug(): string;
8
12
  /** @inheritDoc */
9
13
  static get parametersClass(): typeof ExtractionParameters;
10
14
  /** @inheritDoc */
11
15
  static get responseClass(): typeof ExtractionResponse;
12
16
  /** @inheritDoc */
13
- static get slug(): string;
17
+ static get annotationResponseClass(): typeof ExtractionRagAnnotationResponse;
18
+ /** @inheritDoc */
19
+ static get annotationParametersClass(): typeof RagDocumentAnnotationParameters;
20
+ /** @inheritDoc */
21
+ static get ragDocumentUploadClass(): typeof RagDocumentUploadParameters;
14
22
  }
@@ -1,10 +1,16 @@
1
1
  import { ExtractionResponse } from "./extractionResponse.js";
2
2
  import { ExtractionParameters } from "./params/index.js";
3
- import { BaseProduct } from "../../../v2/product/baseProduct.js";
3
+ import { BaseProduct } from "../baseProduct.js";
4
+ import { ExtractionRagAnnotationResponse } from "./ragDocuments/index.js";
5
+ import { RagDocumentAnnotationParameters, RagDocumentUploadParameters } from "./ragDocuments/params/index.js";
4
6
  /**
5
7
  * Automatically extract structured data from any image or scanned document.
6
8
  */
7
9
  export class Extraction extends BaseProduct {
10
+ /** @inheritDoc */
11
+ static get slug() {
12
+ return "extraction";
13
+ }
8
14
  /** @inheritDoc */
9
15
  static get parametersClass() {
10
16
  return ExtractionParameters;
@@ -14,7 +20,15 @@ export class Extraction extends BaseProduct {
14
20
  return ExtractionResponse;
15
21
  }
16
22
  /** @inheritDoc */
17
- static get slug() {
18
- return "extraction";
23
+ static get annotationResponseClass() {
24
+ return ExtractionRagAnnotationResponse;
25
+ }
26
+ /** @inheritDoc */
27
+ static get annotationParametersClass() {
28
+ return RagDocumentAnnotationParameters;
29
+ }
30
+ /** @inheritDoc */
31
+ static get ragDocumentUploadClass() {
32
+ return RagDocumentUploadParameters;
19
33
  }
20
34
  }
@@ -1,7 +1,7 @@
1
1
  import { StringDict } from "../../../parsing/stringDict.js";
2
2
  import { ExtractionResult } from "./extractionResult.js";
3
3
  import { ExtractionActiveOptions } from "./extractionActiveOptions.js";
4
- import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
4
+ import { BaseInference } from "../../parsing/inference/baseInference.js";
5
5
  /** Inference payload for extraction responses. */
6
6
  export declare class ExtractionInference extends BaseInference {
7
7
  /**
@@ -1,6 +1,6 @@
1
1
  import { ExtractionResult } from "./extractionResult.js";
2
2
  import { ExtractionActiveOptions } from "./extractionActiveOptions.js";
3
- import { BaseInference } from "../../../v2/parsing/inference/baseInference.js";
3
+ import { BaseInference } from "../../parsing/inference/baseInference.js";
4
4
  /** Inference payload for extraction responses. */
5
5
  export class ExtractionInference extends BaseInference {
6
6
  constructor(serverResponse) {
@@ -1,6 +1,6 @@
1
1
  import { ExtractionInference } from "./extractionInference.js";
2
2
  import { StringDict } from "../../../parsing/stringDict.js";
3
- import { BaseResponse } from "../../../v2/parsing/index.js";
3
+ import { BaseResponse } from "../../parsing/index.js";
4
4
  /** Response wrapper for extraction product calls. */
5
5
  export declare class ExtractionResponse extends BaseResponse {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { ExtractionInference } from "./extractionInference.js";
2
- import { BaseResponse } from "../../../v2/parsing/index.js";
2
+ import { BaseResponse } from "../../parsing/index.js";
3
3
  /** Response wrapper for extraction product calls. */
4
4
  export class ExtractionResponse extends BaseResponse {
5
5
  /**
@@ -1,7 +1,7 @@
1
- import { InferenceFields } from "../../../v2/parsing/inference/field/index.js";
1
+ import { InferenceFields } from "../../parsing/inference/field/index.js";
2
2
  import { StringDict } from "../../../parsing/stringDict.js";
3
- import { RawText } from "../../../v2/parsing/inference/field/rawText.js";
4
- import { RagMetadata } from "../../../v2/parsing/inference/field/ragMetadata.js";
3
+ import { RawText } from "../../parsing/inference/field/rawText.js";
4
+ import { RagMetadata } from "../../parsing/inference/field/ragMetadata.js";
5
5
  /** Extraction result payload containing fields and optional extras. */
6
6
  export declare class ExtractionResult {
7
7
  /**
@@ -1,6 +1,6 @@
1
- import { InferenceFields } from "../../../v2/parsing/inference/field/index.js";
2
- import { RawText } from "../../../v2/parsing/inference/field/rawText.js";
3
- import { RagMetadata } from "../../../v2/parsing/inference/field/ragMetadata.js";
1
+ import { InferenceFields } from "../../parsing/inference/field/index.js";
2
+ import { RawText } from "../../parsing/inference/field/rawText.js";
3
+ import { RagMetadata } from "../../parsing/inference/field/ragMetadata.js";
4
4
  /** Extraction result payload containing fields and optional extras. */
5
5
  export class ExtractionResult {
6
6
  constructor(serverResponse) {
@@ -6,3 +6,4 @@ export { ExtractionActiveOptions } from "./extractionActiveOptions.js";
6
6
  export { ExtractionResponse } from "./extractionResponse.js";
7
7
  export { ExtractionResult } from "./extractionResult.js";
8
8
  export { DataSchemaActiveOption } from "./dataSchemaActiveOption.js";
9
+ export * as ragDocuments from "./ragDocuments/index.js";
@@ -6,3 +6,4 @@ export { ExtractionActiveOptions } from "./extractionActiveOptions.js";
6
6
  export { ExtractionResponse } from "./extractionResponse.js";
7
7
  export { ExtractionResult } from "./extractionResult.js";
8
8
  export { DataSchemaActiveOption } from "./dataSchemaActiveOption.js";
9
+ export * as ragDocuments from "./ragDocuments/index.js";
@@ -1,6 +1,6 @@
1
1
  import { StringDict } from "../../../../parsing/stringDict.js";
2
2
  import { DataSchema } from "./dataSchema.js";
3
- import { BaseProductParameters, BaseProductParametersConstructor } from "../../../../v2/clientOptions/baseProductParameters.js";
3
+ import { BaseProductParameters, BaseProductParametersConstructor } from "../../../clientOptions/baseProductParameters.js";
4
4
  /**
5
5
  * Parameters for sending a file to an Extraction product.
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import { DataSchema } from "./dataSchema.js";
2
- import { BaseProductParameters } from "../../../../v2/clientOptions/baseProductParameters.js";
2
+ import { BaseProductParameters } from "../../../clientOptions/baseProductParameters.js";
3
3
  import { logger } from "../../../../logger.js";
4
4
  /**
5
5
  * Parameters for sending a file to an Extraction product.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Base class for annotated fields.
3
+ */
4
+ export declare abstract class AnnotatedBaseField {
5
+ /**
6
+ * When true, use the RAG information for the final result. When false, use the Data Schema information.
7
+ */
8
+ selected: boolean;
9
+ /**
10
+ * Guidelines or instructions for processing this field.
11
+ */
12
+ guidelines: string | null;
13
+ /**
14
+ * Default constructor.
15
+ * @param selected When true, use the RAG information for the final result.
16
+ * When false, use the Data Schema information.
17
+ * @param guidelines Guidelines or instructions for processing this field.
18
+ */
19
+ protected constructor(selected: boolean, guidelines?: string | null);
20
+ }