mindee 5.9.0 → 5.10.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 (318) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +12 -13
  3. package/src/geometry/bbox.d.ts +18 -6
  4. package/src/geometry/bbox.js +6 -2
  5. package/src/geometry/boundingBox.d.ts +3 -1
  6. package/src/geometry/boundingBox.js +3 -1
  7. package/src/geometry/boundingBoxUtils.d.ts +4 -4
  8. package/src/geometry/boundingBoxUtils.js +7 -7
  9. package/src/geometry/minMax.d.ts +9 -3
  10. package/src/geometry/point.d.ts +3 -1
  11. package/src/geometry/polygon.d.ts +3 -1
  12. package/src/geometry/polygon.js +3 -1
  13. package/src/http/apiCore.js +1 -1
  14. package/src/http/baseSettings.d.ts +15 -5
  15. package/src/http/baseSettings.js +4 -2
  16. package/src/http/dispatcher.js +4 -2
  17. package/src/image/extractedImage.d.ts +13 -5
  18. package/src/image/extractedImage.js +3 -3
  19. package/src/image/extractedImages.d.ts +3 -1
  20. package/src/image/extractedImages.js +3 -1
  21. package/src/image/imageCompressor.d.ts +1 -0
  22. package/src/image/imageCompressor.js +2 -2
  23. package/src/image/imageExtractor.d.ts +1 -1
  24. package/src/image/imageExtractor.js +12 -12
  25. package/src/input/base64Input.d.ts +9 -3
  26. package/src/input/base64Input.js +9 -3
  27. package/src/input/bufferInput.d.ts +7 -2
  28. package/src/input/bufferInput.js +6 -2
  29. package/src/input/bytesInput.d.ts +10 -3
  30. package/src/input/bytesInput.js +10 -3
  31. package/src/input/inputSource.d.ts +4 -2
  32. package/src/input/inputSource.js +3 -2
  33. package/src/input/localInputSource.d.ts +19 -6
  34. package/src/input/localInputSource.js +12 -5
  35. package/src/input/pageOptions.d.ts +9 -3
  36. package/src/input/pageOptions.js +6 -2
  37. package/src/input/pathInput.d.ts +12 -4
  38. package/src/input/pathInput.js +11 -5
  39. package/src/input/streamInput.d.ts +14 -5
  40. package/src/input/streamInput.js +13 -4
  41. package/src/input/urlInput.d.ts +19 -7
  42. package/src/input/urlInput.js +20 -12
  43. package/src/parsing/baseLocalResponse.d.ts +7 -3
  44. package/src/parsing/baseLocalResponse.js +15 -11
  45. package/src/parsing/stringDict.d.ts +3 -1
  46. package/src/pdf/extractedPdf.d.ts +16 -6
  47. package/src/pdf/extractedPdf.js +5 -3
  48. package/src/pdf/extractedPdfs.d.ts +3 -1
  49. package/src/pdf/extractedPdfs.js +3 -1
  50. package/src/pdf/pdfCompressor.js +14 -14
  51. package/src/pdf/pdfExtractor.js +1 -1
  52. package/src/pdf/pdfOperation.d.ts +9 -3
  53. package/src/pdf/pdfOperation.js +14 -14
  54. package/src/pdf/pdfUtils.js +1 -1
  55. package/src/v1/cli.js +1 -1
  56. package/src/v1/client.d.ts +42 -14
  57. package/src/v1/client.js +8 -8
  58. package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.d.ts +6 -2
  59. package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +4 -4
  60. package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.d.ts +6 -2
  61. package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +2 -2
  62. package/src/v1/http/apiSettingsV1.d.ts +15 -5
  63. package/src/v1/http/apiSettingsV1.js +12 -4
  64. package/src/v1/http/baseEndpoint.d.ts +6 -2
  65. package/src/v1/http/endpoint.d.ts +9 -3
  66. package/src/v1/http/endpoint.js +1 -1
  67. package/src/v1/http/errors.d.ts +9 -3
  68. package/src/v1/http/errors.js +6 -2
  69. package/src/v1/http/httpParams.d.ts +36 -12
  70. package/src/v1/http/workflowEndpoint.js +1 -1
  71. package/src/v1/parsing/common/apiRequest.d.ts +15 -5
  72. package/src/v1/parsing/common/apiResponse.d.ts +6 -2
  73. package/src/v1/parsing/common/asyncPredictResponse.d.ts +21 -7
  74. package/src/v1/parsing/common/document.d.ts +18 -6
  75. package/src/v1/parsing/common/document.js +2 -2
  76. package/src/v1/parsing/common/execution.d.ts +39 -13
  77. package/src/v1/parsing/common/executionFile.d.ts +6 -2
  78. package/src/v1/parsing/common/executionPriority.d.ts +12 -4
  79. package/src/v1/parsing/common/executionPriority.js +12 -4
  80. package/src/v1/parsing/common/extras/cropperExtra.d.ts +7 -3
  81. package/src/v1/parsing/common/extras/cropperExtra.js +6 -3
  82. package/src/v1/parsing/common/extras/extras.d.ts +9 -3
  83. package/src/v1/parsing/common/extras/extras.js +6 -2
  84. package/src/v1/parsing/common/extras/fullTextOcrExtra.d.ts +9 -3
  85. package/src/v1/parsing/common/extras/fullTextOcrExtra.js +3 -1
  86. package/src/v1/parsing/common/extras/ragExtra.d.ts +3 -1
  87. package/src/v1/parsing/common/extras/ragExtra.js +3 -1
  88. package/src/v1/parsing/common/feedback/feedbackResponse.d.ts +3 -1
  89. package/src/v1/parsing/common/feedback/feedbackResponse.js +0 -1
  90. package/src/v1/parsing/common/inference.d.ts +24 -8
  91. package/src/v1/parsing/common/inference.js +6 -2
  92. package/src/v1/parsing/common/mvisionV1.d.ts +3 -1
  93. package/src/v1/parsing/common/mvisionV1.js +3 -1
  94. package/src/v1/parsing/common/ocr.d.ts +3 -1
  95. package/src/v1/parsing/common/ocrPage.d.ts +6 -2
  96. package/src/v1/parsing/common/ocrPage.js +6 -2
  97. package/src/v1/parsing/common/orientation.d.ts +6 -2
  98. package/src/v1/parsing/common/page.d.ts +12 -4
  99. package/src/v1/parsing/common/predictResponse.d.ts +3 -1
  100. package/src/v1/parsing/common/prediction.d.ts +3 -1
  101. package/src/v1/parsing/common/prediction.js +3 -1
  102. package/src/v1/parsing/generated/generatedList.d.ts +6 -2
  103. package/src/v1/parsing/generated/generatedObject.d.ts +25 -9
  104. package/src/v1/parsing/generated/generatedObject.js +13 -7
  105. package/src/v1/parsing/localResponse.d.ts +3 -1
  106. package/src/v1/parsing/localResponse.js +3 -1
  107. package/src/v1/parsing/standard/addressField.d.ts +24 -8
  108. package/src/v1/parsing/standard/amount.d.ts +3 -1
  109. package/src/v1/parsing/standard/amount.js +3 -1
  110. package/src/v1/parsing/standard/base.d.ts +27 -9
  111. package/src/v1/parsing/standard/base.js +6 -2
  112. package/src/v1/parsing/standard/boolean.d.ts +3 -1
  113. package/src/v1/parsing/standard/classification.d.ts +6 -2
  114. package/src/v1/parsing/standard/companyRegistration.d.ts +9 -3
  115. package/src/v1/parsing/standard/companyRegistration.js +3 -1
  116. package/src/v1/parsing/standard/date.d.ts +12 -4
  117. package/src/v1/parsing/standard/date.js +3 -1
  118. package/src/v1/parsing/standard/field.d.ts +7 -5
  119. package/src/v1/parsing/standard/field.js +4 -4
  120. package/src/v1/parsing/standard/locale.d.ts +15 -5
  121. package/src/v1/parsing/standard/paymentDetails.d.ts +15 -5
  122. package/src/v1/parsing/standard/position.d.ts +15 -5
  123. package/src/v1/parsing/standard/tax.d.ts +18 -6
  124. package/src/v1/parsing/standard/tax.js +15 -5
  125. package/src/v1/parsing/standard/text.d.ts +6 -2
  126. package/src/v1/parsing/standard/word.d.ts +9 -3
  127. package/src/v1/parsing/standard/word.js +3 -1
  128. package/src/v1/product/barcodeReader/barcodeReaderV1.d.ts +12 -4
  129. package/src/v1/product/barcodeReader/barcodeReaderV1.js +9 -3
  130. package/src/v1/product/barcodeReader/barcodeReaderV1Document.d.ts +6 -2
  131. package/src/v1/product/barcodeReader/barcodeReaderV1Document.js +6 -2
  132. package/src/v1/product/cropper/cropperV1.d.ts +12 -4
  133. package/src/v1/product/cropper/cropperV1.js +9 -3
  134. package/src/v1/product/cropper/cropperV1Page.d.ts +3 -1
  135. package/src/v1/product/cropper/cropperV1Page.js +3 -1
  136. package/src/v1/product/driverLicense/driverLicenseV1.d.ts +12 -4
  137. package/src/v1/product/driverLicense/driverLicenseV1.js +9 -3
  138. package/src/v1/product/driverLicense/driverLicenseV1Document.d.ts +39 -13
  139. package/src/v1/product/financialDocument/financialDocumentV1.d.ts +12 -4
  140. package/src/v1/product/financialDocument/financialDocumentV1.js +9 -3
  141. package/src/v1/product/financialDocument/financialDocumentV1Document.d.ts +96 -32
  142. package/src/v1/product/financialDocument/financialDocumentV1Document.js +15 -5
  143. package/src/v1/product/financialDocument/financialDocumentV1LineItem.d.ts +30 -10
  144. package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +3 -1
  145. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +12 -4
  146. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.js +9 -3
  147. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +9 -3
  148. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +12 -4
  149. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.js +9 -3
  150. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +18 -6
  151. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +3 -1
  152. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +12 -4
  153. package/src/v1/product/fr/carteGrise/carteGriseV1.d.ts +12 -4
  154. package/src/v1/product/fr/carteGrise/carteGriseV1.js +9 -3
  155. package/src/v1/product/fr/carteGrise/carteGriseV1Document.d.ts +123 -41
  156. package/src/v1/product/fr/idCard/idCardV2.d.ts +12 -4
  157. package/src/v1/product/fr/idCard/idCardV2.js +9 -3
  158. package/src/v1/product/fr/idCard/idCardV2Document.d.ts +45 -15
  159. package/src/v1/product/fr/idCard/idCardV2Document.js +3 -1
  160. package/src/v1/product/fr/idCard/idCardV2Page.d.ts +6 -2
  161. package/src/v1/product/generated/generatedV1.d.ts +12 -4
  162. package/src/v1/product/generated/generatedV1.js +9 -3
  163. package/src/v1/product/generated/generatedV1Prediction.d.ts +6 -2
  164. package/src/v1/product/generated/generatedV1Prediction.js +3 -1
  165. package/src/v1/product/internationalId/internationalIdV2.d.ts +12 -4
  166. package/src/v1/product/internationalId/internationalIdV2.js +9 -3
  167. package/src/v1/product/internationalId/internationalIdV2Document.d.ts +51 -17
  168. package/src/v1/product/internationalId/internationalIdV2Document.js +6 -2
  169. package/src/v1/product/invoice/invoiceV4.d.ts +12 -4
  170. package/src/v1/product/invoice/invoiceV4.js +9 -3
  171. package/src/v1/product/invoice/invoiceV4Document.d.ts +87 -29
  172. package/src/v1/product/invoice/invoiceV4Document.js +15 -5
  173. package/src/v1/product/invoice/invoiceV4LineItem.d.ts +30 -10
  174. package/src/v1/product/invoice/invoiceV4LineItem.js +3 -1
  175. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.d.ts +12 -4
  176. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.js +9 -3
  177. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +3 -1
  178. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.js +3 -1
  179. package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.d.ts +9 -3
  180. package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.js +3 -1
  181. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +12 -4
  182. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +9 -3
  183. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +3 -1
  184. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +3 -1
  185. package/src/v1/product/passport/passportV1.d.ts +12 -4
  186. package/src/v1/product/passport/passportV1.js +9 -3
  187. package/src/v1/product/passport/passportV1Document.d.ts +33 -11
  188. package/src/v1/product/passport/passportV1Document.js +3 -1
  189. package/src/v1/product/receipt/receiptV5.d.ts +12 -4
  190. package/src/v1/product/receipt/receiptV5.js +9 -3
  191. package/src/v1/product/receipt/receiptV5Document.d.ts +51 -17
  192. package/src/v1/product/receipt/receiptV5Document.js +6 -2
  193. package/src/v1/product/receipt/receiptV5LineItem.d.ts +18 -6
  194. package/src/v1/product/receipt/receiptV5LineItem.js +3 -1
  195. package/src/v1/product/resume/resumeV1.d.ts +12 -4
  196. package/src/v1/product/resume/resumeV1.js +9 -3
  197. package/src/v1/product/resume/resumeV1Certificate.d.ts +18 -6
  198. package/src/v1/product/resume/resumeV1Certificate.js +3 -1
  199. package/src/v1/product/resume/resumeV1Document.d.ts +51 -17
  200. package/src/v1/product/resume/resumeV1Document.js +27 -9
  201. package/src/v1/product/resume/resumeV1Education.d.ts +27 -9
  202. package/src/v1/product/resume/resumeV1Education.js +3 -1
  203. package/src/v1/product/resume/resumeV1Language.d.ts +12 -4
  204. package/src/v1/product/resume/resumeV1Language.js +3 -1
  205. package/src/v1/product/resume/resumeV1ProfessionalExperience.d.ts +33 -11
  206. package/src/v1/product/resume/resumeV1ProfessionalExperience.js +3 -1
  207. package/src/v1/product/resume/resumeV1SocialNetworksUrl.d.ts +12 -4
  208. package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +3 -1
  209. package/src/v1/product/us/bankCheck/bankCheckV1.d.ts +12 -4
  210. package/src/v1/product/us/bankCheck/bankCheckV1.js +9 -3
  211. package/src/v1/product/us/bankCheck/bankCheckV1Document.d.ts +18 -6
  212. package/src/v1/product/us/bankCheck/bankCheckV1Document.js +3 -1
  213. package/src/v1/product/us/bankCheck/bankCheckV1Page.d.ts +6 -2
  214. package/src/v1/product/us/bankCheck/bankCheckV1Page.js +3 -1
  215. package/src/v2/cli.js +1 -1
  216. package/src/v2/client.d.ts +9 -3
  217. package/src/v2/clientOptions/pollingOptions.d.ts +30 -10
  218. package/src/v2/clientOptions/pollingOptions.js +6 -2
  219. package/src/v2/http/mindeeApiV2.d.ts +1 -1
  220. package/src/v2/http/mindeeApiV2.js +1 -1
  221. package/src/v2/parsing/error/errorDetails.d.ts +3 -1
  222. package/src/v2/parsing/inference/baseInference.d.ts +6 -2
  223. package/src/v2/parsing/inference/baseInference.js +6 -2
  224. package/src/v2/parsing/inference/field/baseField.d.ts +9 -3
  225. package/src/v2/parsing/inference/field/fieldConfidence.d.ts +12 -4
  226. package/src/v2/parsing/inference/field/fieldConfidence.js +12 -4
  227. package/src/v2/parsing/inference/field/fieldLocation.d.ts +9 -3
  228. package/src/v2/parsing/inference/field/fieldLocation.js +3 -1
  229. package/src/v2/parsing/inference/field/inferenceFields.d.ts +6 -2
  230. package/src/v2/parsing/inference/field/inferenceFields.js +3 -1
  231. package/src/v2/parsing/inference/field/listField.d.ts +6 -2
  232. package/src/v2/parsing/inference/field/listField.js +6 -2
  233. package/src/v2/parsing/inference/field/objectField.d.ts +6 -2
  234. package/src/v2/parsing/inference/field/objectField.js +3 -1
  235. package/src/v2/parsing/inference/field/ragMetadata.d.ts +3 -1
  236. package/src/v2/parsing/inference/field/ragMetadata.js +3 -1
  237. package/src/v2/parsing/inference/field/rawText.d.ts +6 -2
  238. package/src/v2/parsing/inference/field/rawText.js +6 -2
  239. package/src/v2/parsing/inference/field/simpleField.d.ts +6 -2
  240. package/src/v2/parsing/inference/field/simpleField.js +8 -4
  241. package/src/v2/parsing/inference/inferenceFile.d.ts +6 -2
  242. package/src/v2/parsing/inference/inferenceFile.js +6 -2
  243. package/src/v2/parsing/inference/inferenceModel.d.ts +6 -2
  244. package/src/v2/parsing/inference/inferenceModel.js +6 -2
  245. package/src/v2/product/classification/classification.d.ts +9 -3
  246. package/src/v2/product/classification/classification.js +9 -3
  247. package/src/v2/product/classification/classificationClassifier.d.ts +6 -2
  248. package/src/v2/product/classification/classificationClassifier.js +6 -2
  249. package/src/v2/product/classification/classificationInference.d.ts +6 -2
  250. package/src/v2/product/classification/classificationInference.js +6 -2
  251. package/src/v2/product/classification/classificationResponse.d.ts +3 -1
  252. package/src/v2/product/classification/classificationResponse.js +3 -1
  253. package/src/v2/product/classification/classificationResult.d.ts +6 -2
  254. package/src/v2/product/classification/classificationResult.js +6 -2
  255. package/src/v2/product/crop/crop.d.ts +9 -3
  256. package/src/v2/product/crop/crop.js +9 -3
  257. package/src/v2/product/crop/cropInference.d.ts +6 -2
  258. package/src/v2/product/crop/cropInference.js +6 -2
  259. package/src/v2/product/crop/cropItem.d.ts +6 -2
  260. package/src/v2/product/crop/cropItem.js +6 -2
  261. package/src/v2/product/crop/cropResponse.d.ts +3 -1
  262. package/src/v2/product/crop/cropResponse.js +3 -1
  263. package/src/v2/product/crop/cropResult.d.ts +6 -2
  264. package/src/v2/product/crop/cropResult.js +6 -2
  265. package/src/v2/product/extraction/dataSchemaActiveOption.d.ts +3 -1
  266. package/src/v2/product/extraction/dataSchemaActiveOption.js +3 -1
  267. package/src/v2/product/extraction/extraction.d.ts +18 -6
  268. package/src/v2/product/extraction/extraction.js +18 -6
  269. package/src/v2/product/extraction/extractionActiveOptions.d.ts +6 -2
  270. package/src/v2/product/extraction/extractionActiveOptions.js +6 -2
  271. package/src/v2/product/extraction/extractionInference.d.ts +6 -2
  272. package/src/v2/product/extraction/extractionInference.js +6 -2
  273. package/src/v2/product/extraction/extractionResponse.d.ts +3 -1
  274. package/src/v2/product/extraction/extractionResponse.js +3 -1
  275. package/src/v2/product/extraction/extractionResult.d.ts +6 -2
  276. package/src/v2/product/extraction/extractionResult.js +6 -2
  277. package/src/v2/product/extraction/params/dataSchema.d.ts +12 -4
  278. package/src/v2/product/extraction/params/dataSchema.js +6 -2
  279. package/src/v2/product/extraction/params/dataSchemaField.d.ts +39 -13
  280. package/src/v2/product/extraction/params/dataSchemaField.js +9 -3
  281. package/src/v2/product/extraction/params/dataSchemaReplace.d.ts +12 -4
  282. package/src/v2/product/extraction/params/dataSchemaReplace.js +6 -2
  283. package/src/v2/product/extraction/params/extractionParameters.js +3 -3
  284. package/src/v2/product/extraction/ragDocuments/annotatedListField.d.ts +3 -1
  285. package/src/v2/product/extraction/ragDocuments/annotatedListField.js +3 -1
  286. package/src/v2/product/extraction/ragDocuments/params/ragDocumentAnnotationParameters.js +1 -1
  287. package/src/v2/product/ocr/ocr.d.ts +9 -3
  288. package/src/v2/product/ocr/ocr.js +9 -3
  289. package/src/v2/product/ocr/ocrInference.d.ts +6 -2
  290. package/src/v2/product/ocr/ocrInference.js +6 -2
  291. package/src/v2/product/ocr/ocrPage.d.ts +6 -2
  292. package/src/v2/product/ocr/ocrPage.js +6 -2
  293. package/src/v2/product/ocr/ocrResponse.d.ts +3 -1
  294. package/src/v2/product/ocr/ocrResponse.js +3 -1
  295. package/src/v2/product/ocr/ocrResult.d.ts +3 -1
  296. package/src/v2/product/ocr/ocrResult.js +3 -1
  297. package/src/v2/product/ocr/ocrWord.d.ts +6 -2
  298. package/src/v2/product/ocr/ocrWord.js +6 -2
  299. package/src/v2/product/split/split.d.ts +9 -3
  300. package/src/v2/product/split/split.js +9 -3
  301. package/src/v2/product/split/splitInference.d.ts +6 -2
  302. package/src/v2/product/split/splitInference.js +6 -2
  303. package/src/v2/product/split/splitRange.d.ts +3 -1
  304. package/src/v2/product/split/splitRange.js +3 -1
  305. package/src/v2/product/split/splitResponse.d.ts +3 -1
  306. package/src/v2/product/split/splitResponse.js +3 -1
  307. package/src/v2/product/split/splitResult.d.ts +3 -1
  308. package/src/v2/product/split/splitResult.js +3 -1
  309. package/src/v2/search/baseSearch.d.ts +9 -3
  310. package/src/v2/search/baseSearch.js +9 -3
  311. package/src/v2/search/models/modelSearch.d.ts +9 -3
  312. package/src/v2/search/models/modelSearch.js +9 -3
  313. package/src/v2/search/models/modelSearchParameters.d.ts +3 -1
  314. package/src/v2/search/models/modelSearchParameters.js +3 -1
  315. package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +9 -3
  316. package/src/v2/search/ragDocuments/ragDocumentSearch.js +9 -3
  317. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +3 -1
  318. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +3 -1
@@ -80,8 +80,8 @@ async function compressPdfPages(pdfData, extractedPdfInfo, imageQuality, disable
80
80
  * @returns A Promise resolving to an array of compressed page buffers.
81
81
  */
82
82
  async function compressPagesWithQuality(pdfData, extractedPdfInfo, imageQuality, disableSourceText, extractedText) {
83
- const pdfLib = await getPdfLib();
84
- const pdfDoc = await pdfLib.PDFDocument.load(pdfData, {
83
+ const currentPdfLib = await getPdfLib();
84
+ const pdfDoc = await currentPdfLib.PDFDocument.load(pdfData, {
85
85
  ignoreEncryption: true,
86
86
  password: ""
87
87
  });
@@ -126,19 +126,19 @@ function isCompressionSuccessful(totalCompressedSize, originalSize, imageQuality
126
126
  * @returns A Promise resolving to the new PDF as a Buffer.
127
127
  */
128
128
  async function createNewPdfFromCompressedPages(compressedPages) {
129
- const pdfLib = await getPdfLib();
130
- const newPdfDoc = await pdfLib.PDFDocument.create();
129
+ const currentPdfLib = await getPdfLib();
130
+ const pdfDocument = await currentPdfLib.PDFDocument.create();
131
131
  for (const compressedPage of compressedPages) {
132
- const image = await newPdfDoc.embedJpg(compressedPage);
133
- const newPage = newPdfDoc.addPage([image.width, image.height]);
134
- newPage.drawImage(image, {
132
+ const image = await pdfDocument.embedJpg(compressedPage);
133
+ const pdfPage = pdfDocument.addPage([image.width, image.height]);
134
+ pdfPage.drawImage(image, {
135
135
  x: 0,
136
136
  y: 0,
137
137
  width: image.width,
138
138
  height: image.height,
139
139
  });
140
140
  }
141
- const compressedPdfBytes = await newPdfDoc.save();
141
+ const compressedPdfBytes = await pdfDocument.save();
142
142
  return Buffer.from(compressedPdfBytes);
143
143
  }
144
144
  /**
@@ -150,14 +150,14 @@ async function addTextToPdfPage(page, textInfo) {
150
150
  if (textInfo === null) {
151
151
  return;
152
152
  }
153
- const pdfLib = await getPdfLib();
153
+ const currentPdfLib = await getPdfLib();
154
154
  for (const textPages of textInfo.pages) {
155
155
  for (const textPage of textPages.content) {
156
156
  page.drawText(textPage.str, {
157
157
  x: textPage.x,
158
158
  y: textPage.y,
159
159
  size: textPage.height,
160
- color: pdfLib.rgb(0, 0, 0),
160
+ color: currentPdfLib.rgb(0, 0, 0),
161
161
  font: await getFontFromName(textPage.fontName)
162
162
  });
163
163
  }
@@ -168,15 +168,15 @@ async function addTextToPdfPage(page, textInfo) {
168
168
  * @param fontName The name of the font to get.
169
169
  */
170
170
  async function getFontFromName(fontName) {
171
- const pdfLib = await getPdfLib();
172
- const pdfDoc = await pdfLib.PDFDocument.create();
171
+ const currentPdfLib = await getPdfLib();
172
+ const pdfDoc = await currentPdfLib.PDFDocument.create();
173
173
  let font;
174
- const standardFontValues = Object.values(pdfLib.StandardFonts);
174
+ const standardFontValues = Object.values(currentPdfLib.StandardFonts);
175
175
  if (standardFontValues.includes(fontName)) {
176
176
  font = await pdfDoc.embedFont(fontName);
177
177
  }
178
178
  else {
179
- font = await pdfDoc.embedFont(pdfLib.StandardFonts.Helvetica);
179
+ font = await pdfDoc.embedFont(currentPdfLib.StandardFonts.Helvetica);
180
180
  }
181
181
  return font;
182
182
  }
@@ -1,6 +1,6 @@
1
+ import path from "node:path";
1
2
  import { PageOptionsOperation, PathInput } from "../input/index.js";
2
3
  import { logger } from "../logger.js";
3
- import path from "path";
4
4
  import { loadOptionalDependency } from "../dependency/index.js";
5
5
  import { MindeeInputSourceError, MindeePdfError } from "../errors/index.js";
6
6
  import { ExtractedPdf } from "./extractedPdf.js";
@@ -1,11 +1,17 @@
1
1
  import type * as pdfLibTypes from "@cantoo/pdf-lib";
2
2
  import { PageOptions } from "../input/pageOptions.js";
3
3
  import { LocalInputSource } from "../input/index.js";
4
- /** Result of a PDF split/extract operation. */
4
+ /**
5
+ * Result of a PDF split/extract operation.
6
+ */
5
7
  export interface SplitPdf {
6
- /** PDF content after page extraction. */
8
+ /**
9
+ * PDF content after page extraction.
10
+ */
7
11
  file: Buffer;
8
- /** Number of pages removed from the source PDF. */
12
+ /**
13
+ * Number of pages removed from the source PDF.
14
+ */
9
15
  totalPagesRemoved: number;
10
16
  }
11
17
  /**
@@ -21,12 +21,12 @@ async function getPdfLib() {
21
21
  * @returns the new cut PDF file.
22
22
  */
23
23
  export async function extractPages(file, pageOptions) {
24
- const pdfLib = await getPdfLib();
25
- const currentPdf = await pdfLib.PDFDocument.load(file, {
24
+ const currentPdfLib = await getPdfLib();
25
+ const currentPdf = await currentPdfLib.PDFDocument.load(file, {
26
26
  ignoreEncryption: true,
27
27
  password: ""
28
28
  });
29
- const newPdf = await pdfLib.PDFDocument.create();
29
+ const pdfDocument = await currentPdfLib.PDFDocument.create();
30
30
  const pageCount = currentPdf.getPageCount();
31
31
  if (pageCount < pageOptions.onMinPages) {
32
32
  logger.debug(`File skipped because it had less than ${pageOptions} pages (${pageCount}).`);
@@ -53,25 +53,25 @@ export async function extractPages(file, pageOptions) {
53
53
  (${currentPdf.getPageIndices().join(", ")})`));
54
54
  }
55
55
  if (pageOptions.operation === PageOptionsOperation.KeepOnly) {
56
- const keptPages = await newPdf.copyPages(currentPdf, pageIndexes);
56
+ const keptPages = await pdfDocument.copyPages(currentPdf, pageIndexes);
57
57
  keptPages.forEach((keptPage) => {
58
- newPdf.addPage(keptPage);
58
+ pdfDocument.addPage(keptPage);
59
59
  });
60
60
  }
61
61
  else if (pageOptions.operation === PageOptionsOperation.Remove) {
62
62
  const pagesToKeep = currentPdf
63
63
  .getPageIndices()
64
64
  .filter((v) => !pageIndexes.includes(v));
65
- const keptPages = await newPdf.copyPages(currentPdf, pagesToKeep);
65
+ const keptPages = await pdfDocument.copyPages(currentPdf, pagesToKeep);
66
66
  keptPages.forEach((keptPage) => {
67
- newPdf.addPage(keptPage);
67
+ pdfDocument.addPage(keptPage);
68
68
  });
69
69
  }
70
70
  else {
71
71
  throw new Error(`The operation ${pageOptions.operation} is not available.`);
72
72
  }
73
- const sumRemovedPages = pageCount - newPdf.getPageCount();
74
- const fileBuffer = Buffer.from(await newPdf.save());
73
+ const sumRemovedPages = pageCount - pdfDocument.getPageCount();
74
+ const fileBuffer = Buffer.from(await pdfDocument.save());
75
75
  return { file: fileBuffer, totalPagesRemoved: sumRemovedPages };
76
76
  }
77
77
  /**
@@ -80,8 +80,8 @@ export async function extractPages(file, pageOptions) {
80
80
  * @returns the number of pages in the file.
81
81
  */
82
82
  export async function countPages(file) {
83
- const pdfLib = await getPdfLib();
84
- const currentPdf = await pdfLib.PDFDocument.load(file, {
83
+ const currentPdfLib = await getPdfLib();
84
+ const currentPdf = await currentPdfLib.PDFDocument.load(file, {
85
85
  ignoreEncryption: true,
86
86
  password: ""
87
87
  });
@@ -92,7 +92,7 @@ export async function countPages(file) {
92
92
  * @param inputSource The input source to create a PDF from.
93
93
  */
94
94
  export async function createPdfFromInputSource(inputSource) {
95
- const pdfLib = await getPdfLib();
95
+ const currentPdfLib = await getPdfLib();
96
96
  let pdfDoc;
97
97
  if (!["image/jpeg", "image/jpg", "image/png", "application/pdf"].includes(inputSource.mimeType)) {
98
98
  throw new MindeeInputSourceError('Unsupported file type "' +
@@ -100,13 +100,13 @@ export async function createPdfFromInputSource(inputSource) {
100
100
  '" Currently supported types are .png, .jpg and .pdf');
101
101
  }
102
102
  else if (inputSource.isPdf()) {
103
- pdfDoc = await pdfLib.PDFDocument.load(inputSource.fileObject, {
103
+ pdfDoc = await currentPdfLib.PDFDocument.load(inputSource.fileObject, {
104
104
  ignoreEncryption: true,
105
105
  password: ""
106
106
  });
107
107
  }
108
108
  else {
109
- pdfDoc = await pdfLib.PDFDocument.create();
109
+ pdfDoc = await currentPdfLib.PDFDocument.create();
110
110
  let image;
111
111
  if (inputSource.mimeType === "image/png") {
112
112
  image = await pdfDoc.embedPng(inputSource.fileObject);
@@ -1,5 +1,5 @@
1
- import tmp from "tmp";
2
1
  import * as fs from "node:fs";
2
+ import tmp from "tmp";
3
3
  import { MindeePdfError } from "../errors/index.js";
4
4
  import { loadOptionalDependency } from "../dependency/index.js";
5
5
  import { logger } from "../logger.js";
package/src/v1/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PageOptionsOperation, PathInput } from "../input/index.js";
2
2
  import { Command, Option } from "commander";
3
- import * as console from "console";
3
+ import * as console from "node:console";
4
4
  import { Client } from "./client.js";
5
5
  import { CLI_COMMAND_CONFIG, COMMAND_GENERATED } from "./product/cliProducts.js";
6
6
  const program = new Command();
@@ -25,7 +25,9 @@ interface BaseOptions {
25
25
  * Options relating to predictions.
26
26
  */
27
27
  export interface PredictOptions extends BaseOptions {
28
- /** A custom endpoint. */
28
+ /**
29
+ * A custom endpoint.
30
+ */
29
31
  endpoint?: Endpoint;
30
32
  /**
31
33
  * Whether to include the full text for each page.
@@ -60,26 +62,42 @@ export interface WorkflowOptions extends BaseOptions {
60
62
  */
61
63
  publicUrl?: string;
62
64
  }
63
- /** Timer options forwarded to `setTimeout` in polling loops. */
65
+ /**
66
+ * Timer options forwarded to `setTimeout` in polling loops.
67
+ */
64
68
  export interface TimerOptions {
65
- /** Whether the timer should keep the event loop active. */
69
+ /**
70
+ * Whether the timer should keep the event loop active.
71
+ */
66
72
  ref?: boolean;
67
- /** Optional signal used to abort timer waits. */
73
+ /**
74
+ * Optional signal used to abort timer waits.
75
+ */
68
76
  signal?: AbortSignal;
69
77
  }
70
78
  /**
71
79
  * Asynchronous polling parameters.
72
80
  */
73
81
  export interface OptionalAsyncOptions extends PredictOptions {
74
- /** Delay in seconds before the first polling attempt. */
82
+ /**
83
+ * Delay in seconds before the first polling attempt.
84
+ */
75
85
  initialDelaySec?: number;
76
- /** Delay in seconds between polling attempts. */
86
+ /**
87
+ * Delay in seconds between polling attempts.
88
+ */
77
89
  delaySec?: number;
78
- /** Maximum number of polling attempts. */
90
+ /**
91
+ * Maximum number of polling attempts.
92
+ */
79
93
  maxRetries?: number;
80
- /** Timer options used for the first delay. */
94
+ /**
95
+ * Timer options used for the first delay.
96
+ */
81
97
  initialTimerOptions?: TimerOptions;
82
- /** Timer options used for recurring polling delays. */
98
+ /**
99
+ * Timer options used for recurring polling delays.
100
+ */
83
101
  recurringTimerOptions?: TimerOptions;
84
102
  }
85
103
  export interface AsyncOptions extends PredictOptions {
@@ -90,13 +108,21 @@ export interface AsyncOptions extends PredictOptions {
90
108
  recurringTimerOptions?: TimerOptions;
91
109
  }
92
110
  export interface ClientOptions {
93
- /** Your API key for all endpoints. */
111
+ /**
112
+ * Your API key for all endpoints.
113
+ */
94
114
  apiKey?: string;
95
- /** Raise an `Error` on errors. */
115
+ /**
116
+ * Raise an `Error` on errors.
117
+ */
96
118
  throwOnError?: boolean;
97
- /** Log debug messages. */
119
+ /**
120
+ * Log debug messages.
121
+ */
98
122
  debug?: boolean;
99
- /** Custom dispatcher for HTTP requests. */
123
+ /**
124
+ * Custom dispatcher for HTTP requests.
125
+ */
100
126
  dispatcher?: Dispatcher;
101
127
  }
102
128
  /**
@@ -106,7 +132,9 @@ export interface ClientOptions {
106
132
  */
107
133
  export declare class Client {
108
134
  #private;
109
- /** Mindee V1 API settings. */
135
+ /**
136
+ * Mindee V1 API settings.
137
+ */
110
138
  protected apiSettings: ApiSettingsV1;
111
139
  /**
112
140
  * @param {ClientOptions} options options for the initialization of a client.
package/src/v1/client.js CHANGED
@@ -252,20 +252,20 @@ _Client_instances = new WeakSet(), _Client_setAsyncParams = function _Client_set
252
252
  const minDelaySec = 1;
253
253
  const minInitialDelay = 1;
254
254
  const minRetries = 2;
255
- const newAsyncParams = { ...asyncParams };
256
- newAsyncParams.delaySec ?? (newAsyncParams.delaySec = 1.5);
257
- newAsyncParams.initialDelaySec ?? (newAsyncParams.initialDelaySec = 2);
258
- newAsyncParams.maxRetries ?? (newAsyncParams.maxRetries = 80);
259
- if (newAsyncParams.delaySec < minDelaySec) {
255
+ const asyncParamsInstance = { ...asyncParams };
256
+ asyncParamsInstance.delaySec ??= 1.5;
257
+ asyncParamsInstance.initialDelaySec ??= 2;
258
+ asyncParamsInstance.maxRetries ??= 80;
259
+ if (asyncParamsInstance.delaySec < minDelaySec) {
260
260
  throw Error(`Cannot set auto-parsing delay to less than ${minDelaySec} second(s).`);
261
261
  }
262
- if (newAsyncParams.initialDelaySec < minInitialDelay) {
262
+ if (asyncParamsInstance.initialDelaySec < minInitialDelay) {
263
263
  throw Error(`Cannot set initial parsing delay to less than ${minInitialDelay} second(s).`);
264
264
  }
265
- if (newAsyncParams.maxRetries < minRetries) {
265
+ if (asyncParamsInstance.maxRetries < minRetries) {
266
266
  throw Error(`Cannot set retry to less than ${minRetries}.`);
267
267
  }
268
- return newAsyncParams;
268
+ return asyncParamsInstance;
269
269
  }, _Client_buildProductEndpoint = function _Client_buildProductEndpoint(endpointName, accountName, endpointVersion) {
270
270
  return new Endpoint(endpointName, accountName, endpointVersion, this.apiSettings);
271
271
  }, _Client_initializeOTSEndpoint = function _Client_initializeOTSEndpoint(productClass) {
@@ -3,9 +3,13 @@ import { ExtractedPdf } from "../../../pdf/index.js";
3
3
  * Wrapper class for extracted invoice pages.
4
4
  */
5
5
  export declare class ExtractedInvoiceSplitterImage extends ExtractedPdf {
6
- /** Start page index of the extracted invoice segment. */
6
+ /**
7
+ * Start page index of the extracted invoice segment.
8
+ */
7
9
  readonly pageIdMin: number;
8
- /** End page index of the extracted invoice segment. */
10
+ /**
11
+ * End page index of the extracted invoice segment.
12
+ */
9
13
  readonly pageIdMax: number;
10
14
  constructor(bytes: Uint8Array, pageIndices: [number, number]);
11
15
  }
@@ -20,13 +20,13 @@ async function getPdfLib() {
20
20
  * @returns Extracted invoice splitter images.
21
21
  */
22
22
  async function splitPdf(pdfDoc, invoicePageGroups) {
23
- const pdfLib = await getPdfLib();
23
+ const currentPdfLib = await getPdfLib();
24
24
  if (invoicePageGroups.length === 0) {
25
25
  return [];
26
26
  }
27
27
  const generatedPdfs = [];
28
28
  for (let i = 0; i < invoicePageGroups.length; i++) {
29
- const subdocument = await pdfLib.PDFDocument.create();
29
+ const subdocument = await currentPdfLib.PDFDocument.create();
30
30
  const fullIndexes = [];
31
31
  for (let j = invoicePageGroups[i][0]; j <= invoicePageGroups[i][invoicePageGroups[i].length - 1]; j++) {
32
32
  fullIndexes.push(j);
@@ -46,12 +46,12 @@ async function splitPdf(pdfDoc, invoicePageGroups) {
46
46
  * @returns PDF document.
47
47
  */
48
48
  async function getPdfDoc(inputFile) {
49
- const pdfLib = await getPdfLib();
49
+ const currentPdfLib = await getPdfLib();
50
50
  await inputFile.init();
51
51
  if (!inputFile.isPdf()) {
52
52
  throw new MindeeInputSourceError("Invoice Splitter is only compatible with PDF documents.");
53
53
  }
54
- const pdfDoc = await pdfLib.PDFDocument.load(inputFile.fileObject, {
54
+ const pdfDoc = await currentPdfLib.PDFDocument.load(inputFile.fileObject, {
55
55
  ignoreEncryption: true,
56
56
  password: ""
57
57
  });
@@ -3,9 +3,13 @@ import { ExtractedImage } from "../../../image/index.js";
3
3
  * Wrapper class for extracted multiple-receipts images.
4
4
  */
5
5
  export declare class ExtractedMultiReceiptImage extends ExtractedImage {
6
- /** Receipt index within the source page. */
6
+ /**
7
+ * Receipt index within the source page.
8
+ */
7
9
  readonly receiptId: number;
8
- /** Source page identifier. */
10
+ /**
11
+ * Source page identifier.
12
+ */
9
13
  readonly pageId: number;
10
14
  constructor(buffer: Uint8Array, pageId: number, receiptId: number);
11
15
  }
@@ -40,7 +40,7 @@ async function extractReceiptsFromPage(pdfPage, boundingBoxes, pageId) {
40
40
  * @returns Individual extracted receipts as an array of ExtractedMultiReceiptImage.
41
41
  */
42
42
  export async function extractReceipts(inputFile, inference) {
43
- const pdfLib = await getPdfLib();
43
+ const currentPdfLib = await getPdfLib();
44
44
  const images = [];
45
45
  if (!inference.prediction.receipts) {
46
46
  throw new MindeeError("No possible receipts candidates found for MultiReceipts extraction.");
@@ -48,7 +48,7 @@ export async function extractReceipts(inputFile, inference) {
48
48
  const pdfDoc = await createPdfFromInputSource(inputFile);
49
49
  for (let pageId = 0; pageId < pdfDoc.getPageCount(); pageId++) {
50
50
  const page = pdfDoc.getPage(pageId);
51
- page.setRotation(pdfLib.degrees(inference.pages[pageId].orientation?.value ?? 0));
51
+ page.setRotation(currentPdfLib.degrees(inference.pages[pageId].orientation?.value ?? 0));
52
52
  const receiptPositions = inference.pages[pageId].prediction.receipts.map((receipt) => receipt.boundingBox);
53
53
  const extractedReceipts = await extractReceiptsFromPage(page, receiptPositions, pageId);
54
54
  images.push(...extractedReceipts);
@@ -1,13 +1,23 @@
1
1
  import { BaseSettings, MindeeApiConstructorProps } from "../../http/baseSettings.js";
2
- /** Default account owner for built-in v1 APIs. */
2
+ /**
3
+ * Default account owner for built-in v1 APIs.
4
+ */
3
5
  export declare const STANDARD_API_OWNER: string;
4
- /** Runtime settings container for v1 API calls. */
6
+ /**
7
+ * Runtime settings container for v1 API calls.
8
+ */
5
9
  export declare class ApiSettingsV1 extends BaseSettings {
6
- /** Default headers sent with each v1 API request. */
10
+ /**
11
+ * Default headers sent with each v1 API request.
12
+ */
7
13
  baseHeaders: Record<string, string>;
8
14
  constructor({ apiKey, dispatcher, }: MindeeApiConstructorProps);
9
- /** Resolves the API key from environment variables. */
15
+ /**
16
+ * Resolves the API key from environment variables.
17
+ */
10
18
  protected apiKeyFromEnv(): string;
11
- /** Resolves the API hostname from environment variables. */
19
+ /**
20
+ * Resolves the API hostname from environment variables.
21
+ */
12
22
  protected hostnameFromEnv(): string;
13
23
  }
@@ -1,12 +1,16 @@
1
1
  import { logger } from "../../logger.js";
2
2
  import { BaseSettings } from "../../http/baseSettings.js";
3
3
  import { MindeeConfigurationError } from "../../errors/index.js";
4
- /** Default account owner for built-in v1 APIs. */
4
+ /**
5
+ * Default account owner for built-in v1 APIs.
6
+ */
5
7
  export const STANDARD_API_OWNER = "mindee";
6
8
  const API_V1_KEY_ENVVAR_NAME = "MINDEE_API_KEY";
7
9
  const API_V1_HOST_ENVVAR_NAME = "MINDEE_API_HOST";
8
10
  const DEFAULT_MINDEE_API_HOST = "api.mindee.net";
9
- /** Runtime settings container for v1 API calls. */
11
+ /**
12
+ * Runtime settings container for v1 API calls.
13
+ */
10
14
  export class ApiSettingsV1 extends BaseSettings {
11
15
  constructor({ apiKey, dispatcher, }) {
12
16
  super(apiKey, dispatcher);
@@ -20,7 +24,9 @@ export class ApiSettingsV1 extends BaseSettings {
20
24
  Authorization: `Token ${this.apiKey}`,
21
25
  };
22
26
  }
23
- /** Resolves the API key from environment variables. */
27
+ /**
28
+ * Resolves the API key from environment variables.
29
+ */
24
30
  apiKeyFromEnv() {
25
31
  const envVarValue = process.env[API_V1_KEY_ENVVAR_NAME];
26
32
  if (envVarValue) {
@@ -29,7 +35,9 @@ export class ApiSettingsV1 extends BaseSettings {
29
35
  }
30
36
  return "";
31
37
  }
32
- /** Resolves the API hostname from environment variables. */
38
+ /**
39
+ * Resolves the API hostname from environment variables.
40
+ */
33
41
  hostnameFromEnv() {
34
42
  const envVarValue = process.env[API_V1_HOST_ENVVAR_NAME];
35
43
  if (envVarValue) {
@@ -1,9 +1,13 @@
1
1
  import { InputSource, PageOptions } from "../../input/index.js";
2
2
  import { ApiSettingsV1 } from "./apiSettingsV1.js";
3
3
  export declare abstract class BaseEndpoint {
4
- /** Settings relating to the API. */
4
+ /**
5
+ * Settings relating to the API.
6
+ */
5
7
  settings: ApiSettingsV1;
6
- /** Root of the URL for API calls. */
8
+ /**
9
+ * Root of the URL for API calls.
10
+ */
7
11
  urlRoot: string;
8
12
  protected constructor(settings: ApiSettingsV1, urlRoot: string);
9
13
  /**
@@ -9,11 +9,17 @@ import { BaseEndpoint } from "./baseEndpoint.js";
9
9
  */
10
10
  export declare class Endpoint extends BaseEndpoint {
11
11
  #private;
12
- /** URL of a product. */
12
+ /**
13
+ * URL of a product.
14
+ */
13
15
  urlName: string;
14
- /** Account owning the product. */
16
+ /**
17
+ * Account owning the product.
18
+ */
15
19
  owner: string;
16
- /** Product's version, as a string. */
20
+ /**
21
+ * Product's version, as a string.
22
+ */
17
23
  version: string;
18
24
  constructor(urlName: string, owner: string, version: string, settings: ApiSettingsV1);
19
25
  /**
@@ -4,7 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _Endpoint_instances, _Endpoint_predictReqPost, _Endpoint_predictAsyncReqPost, _Endpoint_documentQueueReqGet, _Endpoint_documentGetReq, _Endpoint_documentFeedbackPutReq;
7
- import { URLSearchParams } from "url";
7
+ import { URLSearchParams } from "node:url";
8
8
  import { FormData } from "undici";
9
9
  import { LocalInputSource } from "../../input/index.js";
10
10
  import { sendRequestAndReadResponse, } from "../../http/apiCore.js";
@@ -13,11 +13,17 @@ export declare function handleError(urlName: string, response: BaseHttpResponse,
13
13
  * Is used when an error is lacking a handled error code.
14
14
  */
15
15
  export declare class MindeeHttpErrorV1 extends MindeeError {
16
- /** Description of the error. */
16
+ /**
17
+ * Description of the error.
18
+ */
17
19
  message: string;
18
- /** Additional details on the error. */
20
+ /**
21
+ * Additional details on the error.
22
+ */
19
23
  details: string | StringDict;
20
- /** Standard HTTP error code. */
24
+ /**
25
+ * Standard HTTP error code.
26
+ */
21
27
  code?: number;
22
28
  constructor(httpError: StringDict, urlName: string, code?: number);
23
29
  }
@@ -83,9 +83,13 @@ export function handleError(urlName, response, serverError) {
83
83
  export class MindeeHttpErrorV1 extends MindeeError {
84
84
  constructor(httpError, urlName, code) {
85
85
  super(`${urlName} API ${code} HTTP error: ${httpError.message}`);
86
- /** Description of the error. */
86
+ /**
87
+ * Description of the error.
88
+ */
87
89
  this.message = "";
88
- /** Additional details on the error. */
90
+ /**
91
+ * Additional details on the error.
92
+ */
89
93
  this.details = "";
90
94
  this.details = httpError.details;
91
95
  this.message = httpError.message;
@@ -1,31 +1,55 @@
1
1
  import { InputSource, PageOptions } from "../../input/index.js";
2
2
  import { ExecutionPriority } from "../parsing/common/index.js";
3
3
  interface HTTPParams {
4
- /** Input source to submit to the API. */
4
+ /**
5
+ * Input source to submit to the API.
6
+ */
5
7
  inputDoc: InputSource;
6
- /** Enables full-text OCR output when supported. */
8
+ /**
9
+ * Enables full-text OCR output when supported.
10
+ */
7
11
  fullText: boolean;
8
- /** Optional local page filtering options applied before upload. */
12
+ /**
13
+ * Optional local page filtering options applied before upload.
14
+ */
9
15
  pageOptions?: PageOptions;
10
- /** Enables Retrieval-Augmented Generation when supported. */
16
+ /**
17
+ * Enables Retrieval-Augmented Generation when supported.
18
+ */
11
19
  rag?: boolean;
12
20
  }
13
- /** Parameters sent to synchronous/asynchronous prediction endpoints. */
21
+ /**
22
+ * Parameters sent to synchronous/asynchronous prediction endpoints.
23
+ */
14
24
  export interface PredictParams extends HTTPParams {
15
- /** Enables word-level OCR details in the response. */
25
+ /**
26
+ * Enables word-level OCR details in the response.
27
+ */
16
28
  includeWords: boolean;
17
- /** Enables cropper extras in the response. */
29
+ /**
30
+ * Enables cropper extras in the response.
31
+ */
18
32
  cropper: boolean;
19
- /** Optional workflow ID used for workflow-backed inference. */
33
+ /**
34
+ * Optional workflow ID used for workflow-backed inference.
35
+ */
20
36
  workflowId?: string;
21
37
  }
22
- /** Parameters sent to workflow execution endpoints. */
38
+ /**
39
+ * Parameters sent to workflow execution endpoints.
40
+ */
23
41
  export interface WorkflowParams extends HTTPParams {
24
- /** Custom alias assigned to the submitted file. */
42
+ /**
43
+ * Custom alias assigned to the submitted file.
44
+ */
25
45
  alias?: string;
26
- /** Processing priority of the workflow execution. */
46
+ /**
47
+ * Processing priority of the workflow execution.
48
+ */
27
49
  priority?: ExecutionPriority;
28
- /** Whether to request a public validation URL. */
50
+ /**
51
+ * Whether to request a public validation URL.
52
+ */
29
53
  publicUrl?: string;
30
54
  }
31
55
  export {};
@@ -4,7 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _WorkflowEndpoint_instances, _WorkflowEndpoint_workflowReqPost;
7
- import { URLSearchParams } from "url";
7
+ import { URLSearchParams } from "node:url";
8
8
  import { FormData } from "undici";
9
9
  import { LocalInputSource } from "../../input/index.js";
10
10
  import { sendRequestAndReadResponse, } from "../../http/apiCore.js";