mindee 4.36.3 → 5.0.0-alpha2

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 (1084) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/bin/mindeeV1.js +3 -0
  3. package/bin/mindeeV2.d.ts +2 -0
  4. package/bin/mindeeV2.js +3 -0
  5. package/package.json +30 -25
  6. package/src/dependency/index.d.ts +1 -0
  7. package/src/dependency/index.js +1 -0
  8. package/src/dependency/optionalLoader.d.ts +6 -0
  9. package/src/dependency/optionalLoader.js +20 -0
  10. package/src/errors/handler.js +4 -8
  11. package/src/errors/index.d.ts +1 -1
  12. package/src/errors/index.js +1 -6
  13. package/src/errors/mindeeError.d.ts +6 -15
  14. package/src/errors/mindeeError.js +13 -30
  15. package/src/geometry/bbox.d.ts +9 -0
  16. package/src/geometry/bbox.js +13 -0
  17. package/src/geometry/boundingBox.d.ts +2 -10
  18. package/src/geometry/boundingBox.js +2 -16
  19. package/src/geometry/boundingBoxUtils.d.ts +3 -2
  20. package/src/geometry/boundingBoxUtils.js +11 -17
  21. package/src/geometry/index.d.ts +7 -6
  22. package/src/geometry/index.js +5 -24
  23. package/src/geometry/minMax.js +1 -2
  24. package/src/geometry/point.js +1 -2
  25. package/src/geometry/polygon.d.ts +2 -2
  26. package/src/geometry/polygon.js +7 -11
  27. package/src/geometry/polygonUtils.d.ts +2 -2
  28. package/src/geometry/polygonUtils.js +14 -30
  29. package/src/http/apiCore.d.ts +30 -0
  30. package/src/http/apiCore.js +53 -0
  31. package/src/http/baseSettings.d.ts +5 -1
  32. package/src/http/baseSettings.js +15 -44
  33. package/src/http/index.d.ts +3 -6
  34. package/src/http/index.js +2 -24
  35. package/src/image/extractedImage.d.ts +29 -0
  36. package/src/image/extractedImage.js +99 -0
  37. package/src/image/imageCompressor.js +32 -0
  38. package/src/image/imageExtractor.d.ts +9 -0
  39. package/src/image/imageExtractor.js +93 -0
  40. package/src/image/index.d.ts +3 -0
  41. package/src/image/index.js +3 -0
  42. package/src/index.d.ts +10 -8
  43. package/src/index.js +12 -66
  44. package/src/input/base64Input.d.ts +12 -0
  45. package/src/input/base64Input.js +24 -0
  46. package/src/input/bufferInput.d.ts +10 -0
  47. package/src/input/bufferInput.js +20 -0
  48. package/src/input/bytesInput.d.ts +12 -0
  49. package/src/input/bytesInput.js +23 -0
  50. package/src/input/index.d.ts +11 -4
  51. package/src/input/index.js +9 -26
  52. package/src/input/inputSource.js +18 -0
  53. package/src/input/localInputSource.d.ts +55 -0
  54. package/src/input/localInputSource.js +146 -0
  55. package/src/input/pageOptions.d.ts +2 -2
  56. package/src/input/pageOptions.js +3 -5
  57. package/src/input/pathInput.d.ts +11 -0
  58. package/src/input/pathInput.js +24 -0
  59. package/src/input/streamInput.d.ts +14 -0
  60. package/src/input/streamInput.js +55 -0
  61. package/src/input/urlInput.d.ts +35 -0
  62. package/src/input/urlInput.js +95 -0
  63. package/src/logger.js +9 -12
  64. package/src/parsing/dateParser.js +9 -0
  65. package/src/parsing/index.d.ts +2 -5
  66. package/src/parsing/index.js +1 -41
  67. package/src/parsing/localResponseBase.d.ts +34 -0
  68. package/src/parsing/localResponseBase.js +91 -0
  69. package/src/parsing/stringDict.js +1 -0
  70. package/src/pdf/index.d.ts +4 -3
  71. package/src/pdf/index.js +3 -10
  72. package/src/pdf/pdfCompressor.js +42 -67
  73. package/src/pdf/pdfOperation.d.ts +4 -4
  74. package/src/pdf/pdfOperation.js +28 -22
  75. package/src/pdf/pdfUtils.js +9 -11
  76. package/src/v1/cli.js +201 -0
  77. package/src/v1/client.d.ts +215 -0
  78. package/src/v1/client.js +277 -0
  79. package/src/v1/extraction/index.d.ts +2 -0
  80. package/src/v1/extraction/index.js +2 -0
  81. package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.d.ts +9 -0
  82. package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.js +11 -0
  83. package/src/v1/extraction/invoiceSplitterExtractor/index.d.ts +2 -0
  84. package/src/v1/extraction/invoiceSplitterExtractor/index.js +2 -0
  85. package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +13 -0
  86. package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +83 -0
  87. package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.d.ts +9 -0
  88. package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.js +11 -0
  89. package/src/v1/extraction/multiReceiptsExtractor/index.d.ts +2 -0
  90. package/src/v1/extraction/multiReceiptsExtractor/index.js +2 -0
  91. package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.d.ts +11 -0
  92. package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +81 -0
  93. package/src/v1/http/apiSettingsV1.d.ts +8 -0
  94. package/src/v1/http/apiSettingsV1.js +37 -0
  95. package/src/v1/http/endpoint.d.ts +69 -0
  96. package/src/v1/http/endpoint.js +229 -0
  97. package/src/v1/http/errors.d.ts +67 -0
  98. package/src/v1/http/errors.js +198 -0
  99. package/src/v1/http/httpParams.d.ts +19 -0
  100. package/src/v1/http/httpParams.js +1 -0
  101. package/src/v1/http/index.d.ts +5 -0
  102. package/src/v1/http/index.js +4 -0
  103. package/src/v1/http/responseValidation.d.ts +23 -0
  104. package/src/v1/http/responseValidation.js +73 -0
  105. package/src/v1/http/workflowEndpoint.d.ts +34 -0
  106. package/src/v1/http/workflowEndpoint.js +89 -0
  107. package/src/v1/index.d.ts +8 -0
  108. package/src/v1/index.js +7 -0
  109. package/src/v1/parsing/common/apiRequest.d.ts +19 -0
  110. package/src/v1/parsing/common/apiRequest.js +14 -0
  111. package/src/v1/parsing/common/apiResponse.d.ts +21 -0
  112. package/src/v1/parsing/common/apiResponse.js +21 -0
  113. package/src/v1/parsing/common/asyncPredictResponse.d.ts +44 -0
  114. package/src/v1/parsing/common/asyncPredictResponse.js +49 -0
  115. package/src/v1/parsing/common/document.d.ts +33 -0
  116. package/src/v1/parsing/common/document.js +71 -0
  117. package/src/v1/parsing/common/execution.d.ts +38 -0
  118. package/src/v1/parsing/common/execution.js +24 -0
  119. package/src/v1/parsing/common/executionFile.d.ts +12 -0
  120. package/src/v1/parsing/common/executionFile.js +10 -0
  121. package/src/v1/parsing/common/executionPriority.js +6 -0
  122. package/src/v1/parsing/common/extras/cropperExtra.d.ts +11 -0
  123. package/src/v1/parsing/common/extras/cropperExtra.js +26 -0
  124. package/src/v1/parsing/common/extras/extras.js +17 -0
  125. package/src/v1/parsing/common/extras/fullTextOcrExtra.d.ts +11 -0
  126. package/src/v1/parsing/common/extras/fullTextOcrExtra.js +16 -0
  127. package/src/v1/parsing/common/extras/index.d.ts +4 -0
  128. package/src/v1/parsing/common/extras/index.js +4 -0
  129. package/src/v1/parsing/common/extras/ragExtra.d.ts +9 -0
  130. package/src/v1/parsing/common/extras/ragExtra.js +9 -0
  131. package/src/v1/parsing/common/feedback/feedbackResponse.d.ts +15 -0
  132. package/src/v1/parsing/common/feedback/feedbackResponse.js +15 -0
  133. package/src/v1/parsing/common/index.d.ts +16 -0
  134. package/src/v1/parsing/common/index.js +15 -0
  135. package/src/v1/parsing/common/inference.d.ts +52 -0
  136. package/src/v1/parsing/common/inference.js +90 -0
  137. package/src/v1/parsing/common/mvisionV1.d.ts +11 -0
  138. package/src/v1/parsing/common/mvisionV1.js +16 -0
  139. package/src/v1/parsing/common/ocr.d.ts +11 -0
  140. package/src/v1/parsing/common/ocr.js +12 -0
  141. package/src/v1/parsing/common/ocrPage.d.ts +19 -0
  142. package/src/v1/parsing/common/ocrPage.js +67 -0
  143. package/src/v1/parsing/common/orientation.d.ts +22 -0
  144. package/src/v1/parsing/common/orientation.js +23 -0
  145. package/src/v1/parsing/common/page.d.ts +31 -0
  146. package/src/v1/parsing/common/page.js +82 -0
  147. package/src/v1/parsing/common/predictResponse.d.ts +19 -0
  148. package/src/v1/parsing/common/predictResponse.js +18 -0
  149. package/src/v1/parsing/common/prediction.js +2 -0
  150. package/src/v1/parsing/common/product.js +1 -0
  151. package/src/v1/parsing/common/summaryHelper.js +41 -0
  152. package/src/v1/parsing/common/workflowResponse.d.ts +17 -0
  153. package/src/v1/parsing/common/workflowResponse.js +13 -0
  154. package/src/v1/parsing/generated/generatedList.d.ts +31 -0
  155. package/src/v1/parsing/generated/generatedList.js +45 -0
  156. package/src/v1/parsing/generated/generatedObject.d.ts +35 -0
  157. package/src/v1/parsing/generated/generatedObject.js +102 -0
  158. package/src/v1/parsing/generated/index.d.ts +2 -0
  159. package/src/v1/parsing/generated/index.js +2 -0
  160. package/src/v1/parsing/index.d.ts +4 -0
  161. package/src/v1/parsing/index.js +4 -0
  162. package/src/v1/parsing/localResponse.d.ts +10 -0
  163. package/src/v1/parsing/localResponse.js +29 -0
  164. package/src/v1/parsing/standard/addressField.d.ts +25 -0
  165. package/src/v1/parsing/standard/addressField.js +36 -0
  166. package/src/v1/parsing/standard/amount.d.ts +17 -0
  167. package/src/v1/parsing/standard/amount.js +29 -0
  168. package/src/v1/parsing/standard/base.d.ts +38 -0
  169. package/src/v1/parsing/standard/base.js +54 -0
  170. package/src/v1/parsing/standard/boolean.d.ts +17 -0
  171. package/src/v1/parsing/standard/boolean.js +18 -0
  172. package/src/v1/parsing/standard/classification.d.ts +11 -0
  173. package/src/v1/parsing/standard/classification.js +10 -0
  174. package/src/v1/parsing/standard/companyRegistration.d.ts +15 -0
  175. package/src/v1/parsing/standard/companyRegistration.js +25 -0
  176. package/src/v1/parsing/standard/date.d.ts +18 -0
  177. package/src/v1/parsing/standard/date.js +31 -0
  178. package/src/v1/parsing/standard/field.d.ts +35 -0
  179. package/src/v1/parsing/standard/field.js +53 -0
  180. package/src/v1/parsing/standard/index.d.ts +15 -0
  181. package/src/v1/parsing/standard/index.js +14 -0
  182. package/src/v1/parsing/standard/locale.d.ts +24 -0
  183. package/src/v1/parsing/standard/locale.js +39 -0
  184. package/src/v1/parsing/standard/paymentDetails.d.ts +47 -0
  185. package/src/v1/parsing/standard/paymentDetails.js +56 -0
  186. package/src/v1/parsing/standard/position.d.ts +27 -0
  187. package/src/v1/parsing/standard/position.js +29 -0
  188. package/src/v1/parsing/standard/tax.d.ts +53 -0
  189. package/src/v1/parsing/standard/tax.js +119 -0
  190. package/src/v1/parsing/standard/text.d.ts +18 -0
  191. package/src/v1/parsing/standard/text.js +12 -0
  192. package/src/v1/parsing/standard/word.d.ts +12 -0
  193. package/src/v1/parsing/standard/word.js +9 -0
  194. package/src/v1/product/barcodeReader/barcodeReaderV1.d.ts +16 -0
  195. package/src/v1/product/barcodeReader/barcodeReaderV1.js +23 -0
  196. package/src/v1/product/barcodeReader/barcodeReaderV1Document.d.ts +16 -0
  197. package/src/v1/product/barcodeReader/barcodeReaderV1Document.js +35 -0
  198. package/src/v1/product/barcodeReader/index.d.ts +2 -0
  199. package/src/v1/product/barcodeReader/index.js +2 -0
  200. package/src/v1/product/cliProducts.d.ts +10 -0
  201. package/src/v1/product/cliProducts.js +159 -0
  202. package/src/v1/product/cropper/cropperV1.d.ts +17 -0
  203. package/src/v1/product/cropper/cropperV1.js +24 -0
  204. package/src/v1/product/cropper/cropperV1Document.d.ts +10 -0
  205. package/src/v1/product/cropper/cropperV1Document.js +11 -0
  206. package/src/v1/product/cropper/cropperV1Page.d.ts +12 -0
  207. package/src/v1/product/cropper/cropperV1Page.js +22 -0
  208. package/src/v1/product/cropper/index.d.ts +3 -0
  209. package/src/v1/product/cropper/index.js +3 -0
  210. package/src/v1/product/driverLicense/driverLicenseV1.d.ts +16 -0
  211. package/src/v1/product/driverLicense/driverLicenseV1.js +23 -0
  212. package/src/v1/product/driverLicense/driverLicenseV1Document.d.ts +38 -0
  213. package/src/v1/product/driverLicense/driverLicenseV1Document.js +80 -0
  214. package/src/v1/product/driverLicense/index.d.ts +2 -0
  215. package/src/v1/product/driverLicense/index.js +2 -0
  216. package/src/v1/product/financialDocument/financialDocumentV1.d.ts +16 -0
  217. package/src/v1/product/financialDocument/financialDocumentV1.js +23 -0
  218. package/src/v1/product/financialDocument/financialDocumentV1Document.d.ts +82 -0
  219. package/src/v1/product/financialDocument/financialDocumentV1Document.js +212 -0
  220. package/src/v1/product/financialDocument/financialDocumentV1LineItem.d.ts +42 -0
  221. package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +140 -0
  222. package/src/v1/product/financialDocument/index.d.ts +3 -0
  223. package/src/v1/product/financialDocument/index.js +3 -0
  224. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +16 -0
  225. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.js +23 -0
  226. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +18 -0
  227. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +30 -0
  228. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +16 -0
  229. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.js +23 -0
  230. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +34 -0
  231. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +64 -0
  232. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +21 -0
  233. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +36 -0
  234. package/src/v1/product/fr/bankAccountDetails/index.d.ts +5 -0
  235. package/src/v1/product/fr/bankAccountDetails/index.js +5 -0
  236. package/src/v1/product/fr/carteGrise/carteGriseV1.d.ts +16 -0
  237. package/src/v1/product/fr/carteGrise/carteGriseV1.js +23 -0
  238. package/src/v1/product/fr/carteGrise/carteGriseV1Document.d.ts +94 -0
  239. package/src/v1/product/fr/carteGrise/carteGriseV1Document.js +220 -0
  240. package/src/v1/product/fr/carteGrise/index.d.ts +2 -0
  241. package/src/v1/product/fr/carteGrise/index.js +2 -0
  242. package/src/v1/product/fr/idCard/idCardV2.d.ts +17 -0
  243. package/src/v1/product/fr/idCard/idCardV2.js +24 -0
  244. package/src/v1/product/fr/idCard/idCardV2Document.d.ts +42 -0
  245. package/src/v1/product/fr/idCard/idCardV2Document.js +95 -0
  246. package/src/v1/product/fr/idCard/idCardV2Page.d.ts +14 -0
  247. package/src/v1/product/fr/idCard/idCardV2Page.js +23 -0
  248. package/src/v1/product/fr/idCard/index.d.ts +3 -0
  249. package/src/v1/product/fr/idCard/index.js +3 -0
  250. package/src/v1/product/fr/index.d.ts +6 -0
  251. package/src/v1/product/fr/index.js +6 -0
  252. package/src/v1/product/generated/generatedV1.d.ts +17 -0
  253. package/src/v1/product/generated/generatedV1.js +20 -0
  254. package/src/v1/product/generated/generatedV1Document.d.ts +8 -0
  255. package/src/v1/product/generated/generatedV1Document.js +26 -0
  256. package/src/v1/product/generated/generatedV1Page.d.ts +8 -0
  257. package/src/v1/product/generated/generatedV1Page.js +26 -0
  258. package/src/v1/product/generated/generatedV1Prediction.d.ts +25 -0
  259. package/src/v1/product/generated/generatedV1Prediction.js +80 -0
  260. package/src/v1/product/generated/index.d.ts +4 -0
  261. package/src/v1/product/generated/index.js +4 -0
  262. package/src/v1/product/index.d.ts +26 -0
  263. package/src/v1/product/index.js +27 -0
  264. package/src/v1/product/internationalId/index.d.ts +2 -0
  265. package/src/v1/product/internationalId/index.js +2 -0
  266. package/src/v1/product/internationalId/internationalIdV2.d.ts +16 -0
  267. package/src/v1/product/internationalId/internationalIdV2.js +23 -0
  268. package/src/v1/product/internationalId/internationalIdV2Document.d.ts +46 -0
  269. package/src/v1/product/internationalId/internationalIdV2Document.js +109 -0
  270. package/src/v1/product/invoice/index.d.ts +3 -0
  271. package/src/v1/product/invoice/index.js +3 -0
  272. package/src/v1/product/invoice/invoiceV4.d.ts +16 -0
  273. package/src/v1/product/invoice/invoiceV4.js +23 -0
  274. package/src/v1/product/invoice/invoiceV4Document.d.ts +71 -0
  275. package/src/v1/product/invoice/invoiceV4Document.js +192 -0
  276. package/src/v1/product/invoice/invoiceV4LineItem.d.ts +42 -0
  277. package/src/v1/product/invoice/invoiceV4LineItem.js +140 -0
  278. package/src/v1/product/invoiceSplitter/index.d.ts +3 -0
  279. package/src/v1/product/invoiceSplitter/index.js +3 -0
  280. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.d.ts +16 -0
  281. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.js +23 -0
  282. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +14 -0
  283. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.js +32 -0
  284. package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.d.ts +28 -0
  285. package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.js +50 -0
  286. package/src/v1/product/multiReceiptsDetector/index.d.ts +2 -0
  287. package/src/v1/product/multiReceiptsDetector/index.js +2 -0
  288. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +16 -0
  289. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +23 -0
  290. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +14 -0
  291. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +25 -0
  292. package/src/v1/product/passport/index.d.ts +2 -0
  293. package/src/v1/product/passport/index.js +2 -0
  294. package/src/v1/product/passport/passportV1.d.ts +16 -0
  295. package/src/v1/product/passport/passportV1.js +23 -0
  296. package/src/v1/product/passport/passportV1Document.d.ts +34 -0
  297. package/src/v1/product/passport/passportV1Document.js +75 -0
  298. package/src/v1/product/receipt/index.d.ts +3 -0
  299. package/src/v1/product/receipt/index.js +3 -0
  300. package/src/v1/product/receipt/receiptV5.d.ts +16 -0
  301. package/src/v1/product/receipt/receiptV5.js +23 -0
  302. package/src/v1/product/receipt/receiptV5Document.d.ts +47 -0
  303. package/src/v1/product/receipt/receiptV5Document.js +114 -0
  304. package/src/v1/product/receipt/receiptV5LineItem.d.ts +34 -0
  305. package/src/v1/product/receipt/receiptV5LineItem.js +94 -0
  306. package/src/v1/product/resume/index.d.ts +7 -0
  307. package/src/v1/product/resume/index.js +7 -0
  308. package/src/v1/product/resume/resumeV1.d.ts +16 -0
  309. package/src/v1/product/resume/resumeV1.js +23 -0
  310. package/src/v1/product/resume/resumeV1Certificate.d.ts +34 -0
  311. package/src/v1/product/resume/resumeV1Certificate.js +85 -0
  312. package/src/v1/product/resume/resumeV1Document.d.ts +51 -0
  313. package/src/v1/product/resume/resumeV1Document.js +203 -0
  314. package/src/v1/product/resume/resumeV1Education.d.ts +40 -0
  315. package/src/v1/product/resume/resumeV1Education.js +115 -0
  316. package/src/v1/product/resume/resumeV1Language.d.ts +30 -0
  317. package/src/v1/product/resume/resumeV1Language.js +65 -0
  318. package/src/v1/product/resume/resumeV1ProfessionalExperience.d.ts +44 -0
  319. package/src/v1/product/resume/resumeV1ProfessionalExperience.js +135 -0
  320. package/src/v1/product/resume/resumeV1SocialNetworksUrl.d.ts +30 -0
  321. package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +65 -0
  322. package/src/v1/product/us/bankCheck/bankCheckV1.d.ts +17 -0
  323. package/src/v1/product/us/bankCheck/bankCheckV1.js +24 -0
  324. package/src/v1/product/us/bankCheck/bankCheckV1Document.d.ts +24 -0
  325. package/src/v1/product/us/bankCheck/bankCheckV1Document.js +50 -0
  326. package/src/v1/product/us/bankCheck/bankCheckV1Page.d.ts +14 -0
  327. package/src/v1/product/us/bankCheck/bankCheckV1Page.js +28 -0
  328. package/src/v1/product/us/bankCheck/index.d.ts +3 -0
  329. package/src/v1/product/us/bankCheck/index.js +3 -0
  330. package/src/v1/product/us/index.d.ts +2 -0
  331. package/src/v1/product/us/index.js +2 -0
  332. package/src/v2/cli.d.ts +1 -0
  333. package/src/v2/cli.js +66 -0
  334. package/src/v2/client/baseParameters.d.ts +66 -0
  335. package/src/v2/client/baseParameters.js +81 -0
  336. package/src/v2/client/index.d.ts +2 -0
  337. package/src/v2/client/index.js +1 -0
  338. package/src/v2/client/pollingOptions.d.ts +49 -0
  339. package/src/v2/client/pollingOptions.js +1 -0
  340. package/src/v2/client.d.ts +79 -0
  341. package/src/v2/client.js +121 -0
  342. package/src/v2/http/apiSettingsV2.d.ts +7 -0
  343. package/src/v2/http/apiSettingsV2.js +36 -0
  344. package/src/v2/http/errors.d.ts +10 -0
  345. package/src/v2/http/errors.js +12 -0
  346. package/src/v2/http/index.d.ts +1 -0
  347. package/src/v2/http/index.js +1 -0
  348. package/src/v2/http/mindeeApiV2.d.ts +38 -0
  349. package/src/v2/http/mindeeApiV2.js +131 -0
  350. package/src/v2/index.d.ts +6 -0
  351. package/src/v2/index.js +5 -0
  352. package/src/v2/parsing/baseResponse.d.ts +17 -0
  353. package/src/v2/parsing/baseResponse.js +17 -0
  354. package/src/v2/parsing/error/errorDetails.d.ts +23 -0
  355. package/src/v2/parsing/error/errorDetails.js +1 -0
  356. package/src/v2/parsing/error/errorItem.d.ts +18 -0
  357. package/src/v2/parsing/error/errorItem.js +14 -0
  358. package/src/v2/parsing/error/errorResponse.d.ts +18 -0
  359. package/src/v2/parsing/error/errorResponse.js +23 -0
  360. package/src/v2/parsing/error/index.d.ts +3 -0
  361. package/src/v2/parsing/error/index.js +2 -0
  362. package/src/v2/parsing/index.d.ts +8 -0
  363. package/src/v2/parsing/index.js +6 -0
  364. package/src/v2/parsing/inference/baseInference.d.ts +19 -0
  365. package/src/v2/parsing/inference/baseInference.js +15 -0
  366. package/src/v2/parsing/inference/field/baseField.d.ts +9 -0
  367. package/src/v2/parsing/inference/field/baseField.js +14 -0
  368. package/src/v2/parsing/inference/field/fieldConfidence.js +74 -0
  369. package/src/v2/parsing/inference/field/fieldFactory.d.ts +8 -0
  370. package/src/v2/parsing/inference/field/fieldFactory.js +19 -0
  371. package/src/v2/parsing/inference/field/fieldLocation.d.ts +13 -0
  372. package/src/v2/parsing/inference/field/fieldLocation.js +13 -0
  373. package/src/v2/parsing/inference/field/index.d.ts +8 -0
  374. package/src/v2/parsing/inference/field/index.js +8 -0
  375. package/src/v2/parsing/inference/field/inferenceFields.d.ts +12 -0
  376. package/src/v2/parsing/inference/field/inferenceFields.js +64 -0
  377. package/src/v2/parsing/inference/field/listField.d.ts +20 -0
  378. package/src/v2/parsing/inference/field/listField.js +63 -0
  379. package/src/v2/parsing/inference/field/objectField.d.ts +53 -0
  380. package/src/v2/parsing/inference/field/objectField.js +104 -0
  381. package/src/v2/parsing/inference/field/ragMetadata.d.ts +8 -0
  382. package/src/v2/parsing/inference/field/ragMetadata.js +5 -0
  383. package/src/v2/parsing/inference/field/rawText.d.ts +10 -0
  384. package/src/v2/parsing/inference/field/rawText.js +9 -0
  385. package/src/v2/parsing/inference/field/rawTextPage.d.ts +11 -0
  386. package/src/v2/parsing/inference/field/rawTextPage.js +8 -0
  387. package/src/v2/parsing/inference/field/simpleField.d.ts +19 -0
  388. package/src/v2/parsing/inference/field/simpleField.js +47 -0
  389. package/src/v2/parsing/inference/index.d.ts +4 -0
  390. package/src/v2/parsing/inference/index.js +4 -0
  391. package/src/v2/parsing/inference/inferenceFile.d.ts +21 -0
  392. package/src/v2/parsing/inference/inferenceFile.js +16 -0
  393. package/src/v2/parsing/inference/inferenceModel.d.ts +9 -0
  394. package/src/v2/parsing/inference/inferenceModel.js +10 -0
  395. package/src/v2/parsing/job/index.d.ts +3 -0
  396. package/src/v2/parsing/job/index.js +3 -0
  397. package/src/v2/parsing/job/job.d.ts +49 -0
  398. package/src/v2/parsing/job/job.js +25 -0
  399. package/src/v2/parsing/job/jobResponse.d.ts +10 -0
  400. package/src/v2/parsing/job/jobResponse.js +8 -0
  401. package/src/v2/parsing/job/jobWebhook.d.ts +24 -0
  402. package/src/v2/parsing/job/jobWebhook.js +15 -0
  403. package/src/v2/parsing/localResponse.d.ts +20 -0
  404. package/src/v2/parsing/localResponse.js +27 -0
  405. package/src/v2/product/baseProduct.d.ts +7 -0
  406. package/src/v2/product/baseProduct.js +11 -0
  407. package/src/v2/product/classification/classification.d.ts +8 -0
  408. package/src/v2/product/classification/classification.js +14 -0
  409. package/src/v2/product/classification/classificationClassifier.d.ts +9 -0
  410. package/src/v2/product/classification/classificationClassifier.js +11 -0
  411. package/src/v2/product/classification/classificationInference.d.ts +11 -0
  412. package/src/v2/product/classification/classificationInference.js +12 -0
  413. package/src/v2/product/classification/classificationResponse.d.ts +13 -0
  414. package/src/v2/product/classification/classificationResponse.js +11 -0
  415. package/src/v2/product/classification/classificationResult.d.ts +10 -0
  416. package/src/v2/product/classification/classificationResult.js +9 -0
  417. package/src/v2/product/classification/index.d.ts +6 -0
  418. package/src/v2/product/classification/index.js +6 -0
  419. package/src/v2/product/classification/params/classificationParameters.d.ts +21 -0
  420. package/src/v2/product/classification/params/classificationParameters.js +25 -0
  421. package/src/v2/product/classification/params/index.d.ts +1 -0
  422. package/src/v2/product/classification/params/index.js +1 -0
  423. package/src/v2/product/crop/crop.d.ts +8 -0
  424. package/src/v2/product/crop/crop.js +14 -0
  425. package/src/v2/product/crop/cropInference.d.ts +11 -0
  426. package/src/v2/product/crop/cropInference.js +12 -0
  427. package/src/v2/product/crop/cropItem.d.ts +8 -0
  428. package/src/v2/product/crop/cropItem.js +10 -0
  429. package/src/v2/product/crop/cropResponse.d.ts +13 -0
  430. package/src/v2/product/crop/cropResponse.js +11 -0
  431. package/src/v2/product/crop/cropResult.d.ts +10 -0
  432. package/src/v2/product/crop/cropResult.js +14 -0
  433. package/src/v2/product/crop/index.d.ts +6 -0
  434. package/src/v2/product/crop/index.js +6 -0
  435. package/src/v2/product/crop/params/cropParameters.d.ts +21 -0
  436. package/src/v2/product/crop/params/cropParameters.js +25 -0
  437. package/src/v2/product/crop/params/index.d.ts +1 -0
  438. package/src/v2/product/crop/params/index.js +1 -0
  439. package/src/v2/product/extraction/dataSchemaActiveOption.d.ts +12 -0
  440. package/src/v2/product/extraction/dataSchemaActiveOption.js +11 -0
  441. package/src/v2/product/extraction/extraction.d.ts +8 -0
  442. package/src/v2/product/extraction/extraction.js +14 -0
  443. package/src/v2/product/extraction/extractionActiveOptions.d.ts +30 -0
  444. package/src/v2/product/extraction/extractionActiveOptions.js +21 -0
  445. package/src/v2/product/extraction/extractionInference.d.ts +16 -0
  446. package/src/v2/product/extraction/extractionInference.js +15 -0
  447. package/src/v2/product/extraction/extractionResponse.d.ts +13 -0
  448. package/src/v2/product/extraction/extractionResponse.js +11 -0
  449. package/src/v2/product/extraction/extractionResult.d.ts +20 -0
  450. package/src/v2/product/extraction/extractionResult.js +17 -0
  451. package/src/v2/product/extraction/index.d.ts +8 -0
  452. package/src/v2/product/extraction/index.js +8 -0
  453. package/src/v2/product/extraction/params/dataSchema.d.ts +18 -0
  454. package/src/v2/product/extraction/params/dataSchema.js +23 -0
  455. package/src/v2/product/extraction/params/dataSchemaField.d.ts +43 -0
  456. package/src/v2/product/extraction/params/dataSchemaField.js +39 -0
  457. package/src/v2/product/extraction/params/dataSchemaReplace.d.ts +16 -0
  458. package/src/v2/product/extraction/params/dataSchemaReplace.js +22 -0
  459. package/src/v2/product/extraction/params/extractionParameters.d.ts +59 -0
  460. package/src/v2/product/extraction/params/extractionParameters.js +66 -0
  461. package/src/v2/product/extraction/params/index.d.ts +4 -0
  462. package/src/v2/product/extraction/params/index.js +4 -0
  463. package/src/v2/product/index.d.ts +10 -0
  464. package/src/v2/product/index.js +10 -0
  465. package/src/v2/product/ocr/index.d.ts +7 -0
  466. package/src/v2/product/ocr/index.js +7 -0
  467. package/src/v2/product/ocr/ocr.d.ts +8 -0
  468. package/src/v2/product/ocr/ocr.js +14 -0
  469. package/src/v2/product/ocr/ocrInference.d.ts +11 -0
  470. package/src/v2/product/ocr/ocrInference.js +15 -0
  471. package/src/v2/product/ocr/ocrPage.d.ts +14 -0
  472. package/src/v2/product/ocr/ocrPage.js +16 -0
  473. package/src/v2/product/ocr/ocrResponse.d.ts +13 -0
  474. package/src/v2/product/ocr/ocrResponse.js +11 -0
  475. package/src/v2/product/ocr/ocrResult.d.ts +13 -0
  476. package/src/v2/product/ocr/ocrResult.js +16 -0
  477. package/src/v2/product/ocr/ocrWord.d.ts +14 -0
  478. package/src/v2/product/ocr/ocrWord.js +10 -0
  479. package/src/v2/product/ocr/params/index.d.ts +1 -0
  480. package/src/v2/product/ocr/params/index.js +1 -0
  481. package/src/v2/product/ocr/params/ocrParameters.d.ts +21 -0
  482. package/src/v2/product/ocr/params/ocrParameters.js +25 -0
  483. package/src/v2/product/split/index.d.ts +6 -0
  484. package/src/v2/product/split/index.js +6 -0
  485. package/src/v2/product/split/params/index.d.ts +1 -0
  486. package/src/v2/product/split/params/index.js +1 -0
  487. package/src/v2/product/split/params/splitParameters.d.ts +21 -0
  488. package/src/v2/product/split/params/splitParameters.js +25 -0
  489. package/src/v2/product/split/split.d.ts +8 -0
  490. package/src/v2/product/split/split.js +14 -0
  491. package/src/v2/product/split/splitInference.d.ts +11 -0
  492. package/src/v2/product/split/splitInference.js +12 -0
  493. package/src/v2/product/split/splitRange.d.ts +17 -0
  494. package/src/v2/product/split/splitRange.js +13 -0
  495. package/src/v2/product/split/splitResponse.d.ts +13 -0
  496. package/src/v2/product/split/splitResponse.js +11 -0
  497. package/src/v2/product/split/splitResult.d.ts +13 -0
  498. package/src/v2/product/split/splitResult.js +16 -0
  499. package/bin/mindee.js +0 -5
  500. package/src/cli.js +0 -264
  501. package/src/cliProducts.d.ts +0 -11
  502. package/src/cliProducts.js +0 -316
  503. package/src/client.d.ts +0 -256
  504. package/src/client.js +0 -386
  505. package/src/clientV2.d.ts +0 -176
  506. package/src/clientV2.js +0 -167
  507. package/src/http/apiSettings.d.ts +0 -12
  508. package/src/http/apiSettings.js +0 -47
  509. package/src/http/apiSettingsV2.d.ts +0 -10
  510. package/src/http/apiSettingsV2.js +0 -46
  511. package/src/http/baseEndpoint.d.ts +0 -34
  512. package/src/http/baseEndpoint.js +0 -77
  513. package/src/http/endpoint.d.ts +0 -70
  514. package/src/http/endpoint.js +0 -243
  515. package/src/http/error.d.ts +0 -67
  516. package/src/http/error.js +0 -211
  517. package/src/http/httpParams.d.ts +0 -19
  518. package/src/http/httpParams.js +0 -2
  519. package/src/http/mindeeApiV2.d.ts +0 -34
  520. package/src/http/mindeeApiV2.js +0 -146
  521. package/src/http/responseValidation.d.ts +0 -23
  522. package/src/http/responseValidation.js +0 -78
  523. package/src/http/workflowEndpoint.d.ts +0 -30
  524. package/src/http/workflowEndpoint.js +0 -103
  525. package/src/imageOperations/common/extractedImage.d.ts +0 -29
  526. package/src/imageOperations/common/extractedImage.js +0 -105
  527. package/src/imageOperations/common/imageExtractor.d.ts +0 -9
  528. package/src/imageOperations/common/imageExtractor.js +0 -87
  529. package/src/imageOperations/common/index.d.ts +0 -2
  530. package/src/imageOperations/common/index.js +0 -7
  531. package/src/imageOperations/imageCompressor.js +0 -36
  532. package/src/imageOperations/index.d.ts +0 -3
  533. package/src/imageOperations/index.js +0 -11
  534. package/src/imageOperations/internal.d.ts +0 -3
  535. package/src/imageOperations/internal.js +0 -11
  536. package/src/imageOperations/invoiceSplitterExtractor/extractedInvoiceSplitterImage.d.ts +0 -9
  537. package/src/imageOperations/invoiceSplitterExtractor/extractedInvoiceSplitterImage.js +0 -15
  538. package/src/imageOperations/invoiceSplitterExtractor/index.d.ts +0 -2
  539. package/src/imageOperations/invoiceSplitterExtractor/index.js +0 -7
  540. package/src/imageOperations/invoiceSplitterExtractor/invoiceSplitterExtractor.d.ts +0 -13
  541. package/src/imageOperations/invoiceSplitterExtractor/invoiceSplitterExtractor.js +0 -76
  542. package/src/imageOperations/multiReceiptsExtractor/extractedMultiReceiptImage.d.ts +0 -9
  543. package/src/imageOperations/multiReceiptsExtractor/extractedMultiReceiptImage.js +0 -15
  544. package/src/imageOperations/multiReceiptsExtractor/index.d.ts +0 -2
  545. package/src/imageOperations/multiReceiptsExtractor/index.js +0 -7
  546. package/src/imageOperations/multiReceiptsExtractor/multiReceiptsExtractor.d.ts +0 -11
  547. package/src/imageOperations/multiReceiptsExtractor/multiReceiptsExtractor.js +0 -74
  548. package/src/input/dataSchema.d.ts +0 -73
  549. package/src/input/dataSchema.js +0 -88
  550. package/src/input/localResponse.d.ts +0 -46
  551. package/src/input/localResponse.js +0 -143
  552. package/src/input/sources/base64Input.d.ts +0 -12
  553. package/src/input/sources/base64Input.js +0 -28
  554. package/src/input/sources/bufferInput.d.ts +0 -10
  555. package/src/input/sources/bufferInput.js +0 -24
  556. package/src/input/sources/bytesInput.d.ts +0 -12
  557. package/src/input/sources/bytesInput.js +0 -27
  558. package/src/input/sources/index.d.ts +0 -8
  559. package/src/input/sources/index.js +0 -24
  560. package/src/input/sources/inputSource.js +0 -21
  561. package/src/input/sources/localInputSource.d.ts +0 -61
  562. package/src/input/sources/localInputSource.js +0 -194
  563. package/src/input/sources/pathInput.d.ts +0 -11
  564. package/src/input/sources/pathInput.js +0 -31
  565. package/src/input/sources/streamInput.d.ts +0 -14
  566. package/src/input/sources/streamInput.js +0 -40
  567. package/src/input/sources/urlInput.d.ts +0 -32
  568. package/src/input/sources/urlInput.js +0 -104
  569. package/src/internal.d.ts +0 -7
  570. package/src/internal.js +0 -43
  571. package/src/parsing/common/apiRequest.d.ts +0 -19
  572. package/src/parsing/common/apiRequest.js +0 -18
  573. package/src/parsing/common/apiResponse.d.ts +0 -21
  574. package/src/parsing/common/apiResponse.js +0 -25
  575. package/src/parsing/common/asyncPredictResponse.d.ts +0 -44
  576. package/src/parsing/common/asyncPredictResponse.js +0 -55
  577. package/src/parsing/common/dateParser.js +0 -12
  578. package/src/parsing/common/document.d.ts +0 -33
  579. package/src/parsing/common/document.js +0 -76
  580. package/src/parsing/common/execution.d.ts +0 -38
  581. package/src/parsing/common/execution.js +0 -28
  582. package/src/parsing/common/executionFile.d.ts +0 -12
  583. package/src/parsing/common/executionFile.js +0 -14
  584. package/src/parsing/common/executionPriority.js +0 -9
  585. package/src/parsing/common/extras/cropperExtra.d.ts +0 -11
  586. package/src/parsing/common/extras/cropperExtra.js +0 -29
  587. package/src/parsing/common/extras/extras.js +0 -21
  588. package/src/parsing/common/extras/fullTextOcrExtra.d.ts +0 -11
  589. package/src/parsing/common/extras/fullTextOcrExtra.js +0 -20
  590. package/src/parsing/common/extras/index.d.ts +0 -3
  591. package/src/parsing/common/extras/index.js +0 -9
  592. package/src/parsing/common/extras/ragExtra.d.ts +0 -9
  593. package/src/parsing/common/extras/ragExtra.js +0 -13
  594. package/src/parsing/common/feedback/feedbackResponse.d.ts +0 -15
  595. package/src/parsing/common/feedback/feedbackResponse.js +0 -19
  596. package/src/parsing/common/index.d.ts +0 -16
  597. package/src/parsing/common/index.js +0 -67
  598. package/src/parsing/common/inference.d.ts +0 -52
  599. package/src/parsing/common/inference.js +0 -98
  600. package/src/parsing/common/mvisionV1.d.ts +0 -11
  601. package/src/parsing/common/mvisionV1.js +0 -20
  602. package/src/parsing/common/ocr.d.ts +0 -11
  603. package/src/parsing/common/ocr.js +0 -16
  604. package/src/parsing/common/ocrPage.d.ts +0 -19
  605. package/src/parsing/common/ocrPage.js +0 -69
  606. package/src/parsing/common/orientation.d.ts +0 -22
  607. package/src/parsing/common/orientation.js +0 -27
  608. package/src/parsing/common/page.d.ts +0 -31
  609. package/src/parsing/common/page.js +0 -87
  610. package/src/parsing/common/predictResponse.d.ts +0 -17
  611. package/src/parsing/common/predictResponse.js +0 -22
  612. package/src/parsing/common/prediction.js +0 -6
  613. package/src/parsing/common/product.js +0 -2
  614. package/src/parsing/common/stringDict.js +0 -2
  615. package/src/parsing/common/summaryHelper.js +0 -47
  616. package/src/parsing/common/workflowResponse.d.ts +0 -17
  617. package/src/parsing/common/workflowResponse.js +0 -17
  618. package/src/parsing/custom/classificationField.d.ts +0 -19
  619. package/src/parsing/custom/classificationField.js +0 -17
  620. package/src/parsing/custom/index.d.ts +0 -3
  621. package/src/parsing/custom/index.js +0 -12
  622. package/src/parsing/custom/lineItems.d.ts +0 -33
  623. package/src/parsing/custom/lineItems.js +0 -130
  624. package/src/parsing/custom/listField.d.ts +0 -45
  625. package/src/parsing/custom/listField.js +0 -60
  626. package/src/parsing/generated/generatedList.d.ts +0 -31
  627. package/src/parsing/generated/generatedList.js +0 -49
  628. package/src/parsing/generated/generatedObject.d.ts +0 -35
  629. package/src/parsing/generated/generatedObject.js +0 -107
  630. package/src/parsing/generated/index.d.ts +0 -2
  631. package/src/parsing/generated/index.js +0 -8
  632. package/src/parsing/standard/addressField.d.ts +0 -25
  633. package/src/parsing/standard/addressField.js +0 -40
  634. package/src/parsing/standard/amount.d.ts +0 -17
  635. package/src/parsing/standard/amount.js +0 -33
  636. package/src/parsing/standard/base.d.ts +0 -38
  637. package/src/parsing/standard/base.js +0 -58
  638. package/src/parsing/standard/boolean.d.ts +0 -17
  639. package/src/parsing/standard/boolean.js +0 -22
  640. package/src/parsing/standard/classification.d.ts +0 -11
  641. package/src/parsing/standard/classification.js +0 -14
  642. package/src/parsing/standard/companyRegistration.d.ts +0 -15
  643. package/src/parsing/standard/companyRegistration.js +0 -29
  644. package/src/parsing/standard/date.d.ts +0 -18
  645. package/src/parsing/standard/date.js +0 -35
  646. package/src/parsing/standard/field.d.ts +0 -35
  647. package/src/parsing/standard/field.js +0 -57
  648. package/src/parsing/standard/index.d.ts +0 -14
  649. package/src/parsing/standard/index.js +0 -30
  650. package/src/parsing/standard/locale.d.ts +0 -24
  651. package/src/parsing/standard/locale.js +0 -43
  652. package/src/parsing/standard/paymentDetails.d.ts +0 -47
  653. package/src/parsing/standard/paymentDetails.js +0 -60
  654. package/src/parsing/standard/position.d.ts +0 -27
  655. package/src/parsing/standard/position.js +0 -33
  656. package/src/parsing/standard/tax.d.ts +0 -53
  657. package/src/parsing/standard/tax.js +0 -124
  658. package/src/parsing/standard/text.d.ts +0 -18
  659. package/src/parsing/standard/text.js +0 -16
  660. package/src/parsing/standard/word.d.ts +0 -10
  661. package/src/parsing/standard/word.js +0 -2
  662. package/src/parsing/v2/commonResponse.d.ts +0 -16
  663. package/src/parsing/v2/commonResponse.js +0 -19
  664. package/src/parsing/v2/dataSchemaActiveOption.d.ts +0 -12
  665. package/src/parsing/v2/dataSchemaActiveOption.js +0 -15
  666. package/src/parsing/v2/errorItem.d.ts +0 -18
  667. package/src/parsing/v2/errorItem.js +0 -18
  668. package/src/parsing/v2/errorResponse.d.ts +0 -38
  669. package/src/parsing/v2/errorResponse.js +0 -25
  670. package/src/parsing/v2/field/baseField.d.ts +0 -9
  671. package/src/parsing/v2/field/baseField.js +0 -18
  672. package/src/parsing/v2/field/fieldConfidence.js +0 -77
  673. package/src/parsing/v2/field/fieldFactory.d.ts +0 -8
  674. package/src/parsing/v2/field/fieldFactory.js +0 -22
  675. package/src/parsing/v2/field/fieldLocation.d.ts +0 -13
  676. package/src/parsing/v2/field/fieldLocation.js +0 -16
  677. package/src/parsing/v2/field/index.d.ts +0 -6
  678. package/src/parsing/v2/field/index.js +0 -15
  679. package/src/parsing/v2/field/inferenceFields.d.ts +0 -12
  680. package/src/parsing/v2/field/inferenceFields.js +0 -68
  681. package/src/parsing/v2/field/listField.d.ts +0 -20
  682. package/src/parsing/v2/field/listField.js +0 -67
  683. package/src/parsing/v2/field/objectField.d.ts +0 -11
  684. package/src/parsing/v2/field/objectField.js +0 -30
  685. package/src/parsing/v2/field/simpleField.d.ts +0 -19
  686. package/src/parsing/v2/field/simpleField.js +0 -51
  687. package/src/parsing/v2/index.d.ts +0 -14
  688. package/src/parsing/v2/index.js +0 -31
  689. package/src/parsing/v2/inference.d.ts +0 -29
  690. package/src/parsing/v2/inference.js +0 -24
  691. package/src/parsing/v2/inferenceActiveOptions.d.ts +0 -30
  692. package/src/parsing/v2/inferenceActiveOptions.js +0 -25
  693. package/src/parsing/v2/inferenceFile.d.ts +0 -21
  694. package/src/parsing/v2/inferenceFile.js +0 -20
  695. package/src/parsing/v2/inferenceModel.d.ts +0 -9
  696. package/src/parsing/v2/inferenceModel.js +0 -14
  697. package/src/parsing/v2/inferenceResponse.d.ts +0 -10
  698. package/src/parsing/v2/inferenceResponse.js +0 -12
  699. package/src/parsing/v2/inferenceResult.d.ts +0 -20
  700. package/src/parsing/v2/inferenceResult.js +0 -21
  701. package/src/parsing/v2/job.d.ts +0 -49
  702. package/src/parsing/v2/job.js +0 -29
  703. package/src/parsing/v2/jobResponse.d.ts +0 -10
  704. package/src/parsing/v2/jobResponse.js +0 -12
  705. package/src/parsing/v2/jobWebhook.d.ts +0 -24
  706. package/src/parsing/v2/jobWebhook.js +0 -19
  707. package/src/parsing/v2/ragMetadata.d.ts +0 -8
  708. package/src/parsing/v2/ragMetadata.js +0 -9
  709. package/src/parsing/v2/rawText.d.ts +0 -10
  710. package/src/parsing/v2/rawText.js +0 -13
  711. package/src/parsing/v2/rawTextPage.d.ts +0 -11
  712. package/src/parsing/v2/rawTextPage.js +0 -12
  713. package/src/product/barcodeReader/barcodeReaderV1.d.ts +0 -16
  714. package/src/product/barcodeReader/barcodeReaderV1.js +0 -27
  715. package/src/product/barcodeReader/barcodeReaderV1Document.d.ts +0 -16
  716. package/src/product/barcodeReader/barcodeReaderV1Document.js +0 -37
  717. package/src/product/barcodeReader/index.d.ts +0 -1
  718. package/src/product/barcodeReader/index.js +0 -5
  719. package/src/product/barcodeReader/internal.d.ts +0 -2
  720. package/src/product/barcodeReader/internal.js +0 -7
  721. package/src/product/billOfLading/billOfLadingV1.d.ts +0 -16
  722. package/src/product/billOfLading/billOfLadingV1.js +0 -27
  723. package/src/product/billOfLading/billOfLadingV1Carrier.d.ts +0 -32
  724. package/src/product/billOfLading/billOfLadingV1Carrier.js +0 -63
  725. package/src/product/billOfLading/billOfLadingV1CarrierItem.d.ts +0 -38
  726. package/src/product/billOfLading/billOfLadingV1CarrierItem.js +0 -118
  727. package/src/product/billOfLading/billOfLadingV1Consignee.d.ts +0 -34
  728. package/src/product/billOfLading/billOfLadingV1Consignee.js +0 -68
  729. package/src/product/billOfLading/billOfLadingV1Document.d.ts +0 -39
  730. package/src/product/billOfLading/billOfLadingV1Document.js +0 -95
  731. package/src/product/billOfLading/billOfLadingV1NotifyParty.d.ts +0 -34
  732. package/src/product/billOfLading/billOfLadingV1NotifyParty.js +0 -68
  733. package/src/product/billOfLading/billOfLadingV1Shipper.d.ts +0 -34
  734. package/src/product/billOfLading/billOfLadingV1Shipper.js +0 -68
  735. package/src/product/billOfLading/index.d.ts +0 -1
  736. package/src/product/billOfLading/index.js +0 -5
  737. package/src/product/billOfLading/internal.d.ts +0 -7
  738. package/src/product/billOfLading/internal.js +0 -17
  739. package/src/product/businessCard/businessCardV1.d.ts +0 -16
  740. package/src/product/businessCard/businessCardV1.js +0 -27
  741. package/src/product/businessCard/businessCardV1Document.d.ts +0 -34
  742. package/src/product/businessCard/businessCardV1Document.js +0 -78
  743. package/src/product/businessCard/index.d.ts +0 -1
  744. package/src/product/businessCard/index.js +0 -5
  745. package/src/product/businessCard/internal.d.ts +0 -2
  746. package/src/product/businessCard/internal.js +0 -7
  747. package/src/product/cropper/cropperV1.d.ts +0 -17
  748. package/src/product/cropper/cropperV1.js +0 -28
  749. package/src/product/cropper/cropperV1Document.d.ts +0 -10
  750. package/src/product/cropper/cropperV1Document.js +0 -15
  751. package/src/product/cropper/cropperV1Page.d.ts +0 -12
  752. package/src/product/cropper/cropperV1Page.js +0 -26
  753. package/src/product/cropper/index.d.ts +0 -1
  754. package/src/product/cropper/index.js +0 -5
  755. package/src/product/cropper/internal.d.ts +0 -3
  756. package/src/product/cropper/internal.js +0 -9
  757. package/src/product/custom/customV1.d.ts +0 -17
  758. package/src/product/custom/customV1.js +0 -23
  759. package/src/product/custom/customV1Document.d.ts +0 -32
  760. package/src/product/custom/customV1Document.js +0 -66
  761. package/src/product/custom/customV1Page.d.ts +0 -21
  762. package/src/product/custom/customV1Page.js +0 -40
  763. package/src/product/custom/internal.d.ts +0 -3
  764. package/src/product/custom/internal.js +0 -9
  765. package/src/product/deliveryNote/deliveryNoteV1.d.ts +0 -16
  766. package/src/product/deliveryNote/deliveryNoteV1.js +0 -27
  767. package/src/product/deliveryNote/deliveryNoteV1Document.d.ts +0 -26
  768. package/src/product/deliveryNote/deliveryNoteV1Document.js +0 -54
  769. package/src/product/deliveryNote/index.d.ts +0 -1
  770. package/src/product/deliveryNote/index.js +0 -5
  771. package/src/product/deliveryNote/internal.d.ts +0 -2
  772. package/src/product/deliveryNote/internal.js +0 -7
  773. package/src/product/driverLicense/driverLicenseV1.d.ts +0 -16
  774. package/src/product/driverLicense/driverLicenseV1.js +0 -27
  775. package/src/product/driverLicense/driverLicenseV1Document.d.ts +0 -38
  776. package/src/product/driverLicense/driverLicenseV1Document.js +0 -84
  777. package/src/product/driverLicense/index.d.ts +0 -1
  778. package/src/product/driverLicense/index.js +0 -5
  779. package/src/product/driverLicense/internal.d.ts +0 -2
  780. package/src/product/driverLicense/internal.js +0 -7
  781. package/src/product/financialDocument/financialDocumentV1.d.ts +0 -16
  782. package/src/product/financialDocument/financialDocumentV1.js +0 -27
  783. package/src/product/financialDocument/financialDocumentV1Document.d.ts +0 -82
  784. package/src/product/financialDocument/financialDocumentV1Document.js +0 -211
  785. package/src/product/financialDocument/financialDocumentV1LineItem.d.ts +0 -42
  786. package/src/product/financialDocument/financialDocumentV1LineItem.js +0 -144
  787. package/src/product/financialDocument/index.d.ts +0 -1
  788. package/src/product/financialDocument/index.js +0 -5
  789. package/src/product/financialDocument/internal.d.ts +0 -3
  790. package/src/product/financialDocument/internal.js +0 -9
  791. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +0 -16
  792. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1.js +0 -27
  793. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +0 -18
  794. package/src/product/fr/bankAccountDetails/bankAccountDetailsV1Document.js +0 -34
  795. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +0 -16
  796. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2.js +0 -27
  797. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +0 -34
  798. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +0 -68
  799. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +0 -21
  800. package/src/product/fr/bankAccountDetails/bankAccountDetailsV2Document.js +0 -40
  801. package/src/product/fr/bankAccountDetails/index.d.ts +0 -2
  802. package/src/product/fr/bankAccountDetails/index.js +0 -7
  803. package/src/product/fr/bankAccountDetails/internal.d.ts +0 -5
  804. package/src/product/fr/bankAccountDetails/internal.js +0 -13
  805. package/src/product/fr/carteGrise/carteGriseV1.d.ts +0 -16
  806. package/src/product/fr/carteGrise/carteGriseV1.js +0 -27
  807. package/src/product/fr/carteGrise/carteGriseV1Document.d.ts +0 -94
  808. package/src/product/fr/carteGrise/carteGriseV1Document.js +0 -224
  809. package/src/product/fr/carteGrise/index.d.ts +0 -1
  810. package/src/product/fr/carteGrise/index.js +0 -5
  811. package/src/product/fr/carteGrise/internal.d.ts +0 -2
  812. package/src/product/fr/carteGrise/internal.js +0 -7
  813. package/src/product/fr/energyBill/energyBillV1.d.ts +0 -16
  814. package/src/product/fr/energyBill/energyBillV1.js +0 -27
  815. package/src/product/fr/energyBill/energyBillV1Document.d.ts +0 -49
  816. package/src/product/fr/energyBill/energyBillV1Document.js +0 -145
  817. package/src/product/fr/energyBill/energyBillV1EnergyConsumer.d.ts +0 -30
  818. package/src/product/fr/energyBill/energyBillV1EnergyConsumer.js +0 -58
  819. package/src/product/fr/energyBill/energyBillV1EnergySupplier.d.ts +0 -30
  820. package/src/product/fr/energyBill/energyBillV1EnergySupplier.js +0 -58
  821. package/src/product/fr/energyBill/energyBillV1EnergyUsage.d.ts +0 -42
  822. package/src/product/fr/energyBill/energyBillV1EnergyUsage.js +0 -141
  823. package/src/product/fr/energyBill/energyBillV1MeterDetail.d.ts +0 -32
  824. package/src/product/fr/energyBill/energyBillV1MeterDetail.js +0 -63
  825. package/src/product/fr/energyBill/energyBillV1Subscription.d.ts +0 -38
  826. package/src/product/fr/energyBill/energyBillV1Subscription.js +0 -118
  827. package/src/product/fr/energyBill/energyBillV1TaxesAndContribution.d.ts +0 -38
  828. package/src/product/fr/energyBill/energyBillV1TaxesAndContribution.js +0 -118
  829. package/src/product/fr/energyBill/index.d.ts +0 -1
  830. package/src/product/fr/energyBill/index.js +0 -5
  831. package/src/product/fr/energyBill/internal.d.ts +0 -8
  832. package/src/product/fr/energyBill/internal.js +0 -19
  833. package/src/product/fr/healthCard/healthCardV1.d.ts +0 -16
  834. package/src/product/fr/healthCard/healthCardV1.js +0 -27
  835. package/src/product/fr/healthCard/healthCardV1Document.d.ts +0 -20
  836. package/src/product/fr/healthCard/healthCardV1Document.js +0 -43
  837. package/src/product/fr/healthCard/index.d.ts +0 -1
  838. package/src/product/fr/healthCard/index.js +0 -5
  839. package/src/product/fr/healthCard/internal.d.ts +0 -2
  840. package/src/product/fr/healthCard/internal.js +0 -7
  841. package/src/product/fr/idCard/idCardV1.d.ts +0 -17
  842. package/src/product/fr/idCard/idCardV1.js +0 -28
  843. package/src/product/fr/idCard/idCardV1Document.d.ts +0 -32
  844. package/src/product/fr/idCard/idCardV1Document.js +0 -73
  845. package/src/product/fr/idCard/idCardV1Page.d.ts +0 -12
  846. package/src/product/fr/idCard/idCardV1Page.js +0 -23
  847. package/src/product/fr/idCard/idCardV2.d.ts +0 -17
  848. package/src/product/fr/idCard/idCardV2.js +0 -28
  849. package/src/product/fr/idCard/idCardV2Document.d.ts +0 -42
  850. package/src/product/fr/idCard/idCardV2Document.js +0 -98
  851. package/src/product/fr/idCard/idCardV2Page.d.ts +0 -14
  852. package/src/product/fr/idCard/idCardV2Page.js +0 -27
  853. package/src/product/fr/idCard/index.d.ts +0 -2
  854. package/src/product/fr/idCard/index.js +0 -7
  855. package/src/product/fr/idCard/internal.d.ts +0 -6
  856. package/src/product/fr/idCard/internal.js +0 -15
  857. package/src/product/fr/index.d.ts +0 -9
  858. package/src/product/fr/index.js +0 -21
  859. package/src/product/fr/internal.d.ts +0 -6
  860. package/src/product/fr/internal.js +0 -42
  861. package/src/product/fr/payslip/index.d.ts +0 -2
  862. package/src/product/fr/payslip/index.js +0 -7
  863. package/src/product/fr/payslip/internal.d.ts +0 -20
  864. package/src/product/fr/payslip/internal.js +0 -43
  865. package/src/product/fr/payslip/payslipV2.d.ts +0 -16
  866. package/src/product/fr/payslip/payslipV2.js +0 -27
  867. package/src/product/fr/payslip/payslipV2BankAccountDetail.d.ts +0 -32
  868. package/src/product/fr/payslip/payslipV2BankAccountDetail.js +0 -63
  869. package/src/product/fr/payslip/payslipV2Document.d.ts +0 -35
  870. package/src/product/fr/payslip/payslipV2Document.js +0 -80
  871. package/src/product/fr/payslip/payslipV2Employee.d.ts +0 -40
  872. package/src/product/fr/payslip/payslipV2Employee.js +0 -83
  873. package/src/product/fr/payslip/payslipV2Employer.d.ts +0 -40
  874. package/src/product/fr/payslip/payslipV2Employer.js +0 -83
  875. package/src/product/fr/payslip/payslipV2Employment.d.ts +0 -38
  876. package/src/product/fr/payslip/payslipV2Employment.js +0 -86
  877. package/src/product/fr/payslip/payslipV2PayDetail.d.ts +0 -46
  878. package/src/product/fr/payslip/payslipV2PayDetail.js +0 -169
  879. package/src/product/fr/payslip/payslipV2PayPeriod.d.ts +0 -36
  880. package/src/product/fr/payslip/payslipV2PayPeriod.js +0 -73
  881. package/src/product/fr/payslip/payslipV2Pto.d.ts +0 -32
  882. package/src/product/fr/payslip/payslipV2Pto.js +0 -85
  883. package/src/product/fr/payslip/payslipV2SalaryDetail.d.ts +0 -34
  884. package/src/product/fr/payslip/payslipV2SalaryDetail.js +0 -98
  885. package/src/product/fr/payslip/payslipV3.d.ts +0 -16
  886. package/src/product/fr/payslip/payslipV3.js +0 -27
  887. package/src/product/fr/payslip/payslipV3BankAccountDetail.d.ts +0 -32
  888. package/src/product/fr/payslip/payslipV3BankAccountDetail.js +0 -63
  889. package/src/product/fr/payslip/payslipV3Document.d.ts +0 -35
  890. package/src/product/fr/payslip/payslipV3Document.js +0 -96
  891. package/src/product/fr/payslip/payslipV3Employee.d.ts +0 -40
  892. package/src/product/fr/payslip/payslipV3Employee.js +0 -83
  893. package/src/product/fr/payslip/payslipV3Employer.d.ts +0 -40
  894. package/src/product/fr/payslip/payslipV3Employer.js +0 -83
  895. package/src/product/fr/payslip/payslipV3Employment.d.ts +0 -40
  896. package/src/product/fr/payslip/payslipV3Employment.js +0 -83
  897. package/src/product/fr/payslip/payslipV3PaidTimeOff.d.ts +0 -36
  898. package/src/product/fr/payslip/payslipV3PaidTimeOff.js +0 -108
  899. package/src/product/fr/payslip/payslipV3PayDetail.d.ts +0 -46
  900. package/src/product/fr/payslip/payslipV3PayDetail.js +0 -169
  901. package/src/product/fr/payslip/payslipV3PayPeriod.d.ts +0 -36
  902. package/src/product/fr/payslip/payslipV3PayPeriod.js +0 -73
  903. package/src/product/fr/payslip/payslipV3SalaryDetail.d.ts +0 -36
  904. package/src/product/fr/payslip/payslipV3SalaryDetail.js +0 -111
  905. package/src/product/generated/generatedV1.d.ts +0 -17
  906. package/src/product/generated/generatedV1.js +0 -24
  907. package/src/product/generated/generatedV1Document.d.ts +0 -8
  908. package/src/product/generated/generatedV1Document.js +0 -30
  909. package/src/product/generated/generatedV1Page.d.ts +0 -8
  910. package/src/product/generated/generatedV1Page.js +0 -30
  911. package/src/product/generated/generatedV1Prediction.d.ts +0 -25
  912. package/src/product/generated/generatedV1Prediction.js +0 -84
  913. package/src/product/generated/internal.d.ts +0 -4
  914. package/src/product/generated/internal.js +0 -11
  915. package/src/product/ind/index.d.ts +0 -1
  916. package/src/product/ind/index.js +0 -5
  917. package/src/product/ind/indianPassport/index.d.ts +0 -1
  918. package/src/product/ind/indianPassport/index.js +0 -5
  919. package/src/product/ind/indianPassport/indianPassportV1.d.ts +0 -16
  920. package/src/product/ind/indianPassport/indianPassportV1.js +0 -27
  921. package/src/product/ind/indianPassport/indianPassportV1Document.d.ts +0 -58
  922. package/src/product/ind/indianPassport/indianPassportV1Document.js +0 -132
  923. package/src/product/ind/indianPassport/internal.d.ts +0 -2
  924. package/src/product/ind/indianPassport/internal.js +0 -7
  925. package/src/product/ind/internal.d.ts +0 -1
  926. package/src/product/ind/internal.js +0 -37
  927. package/src/product/index.d.ts +0 -20
  928. package/src/product/index.js +0 -73
  929. package/src/product/internal.d.ts +0 -20
  930. package/src/product/internal.js +0 -56
  931. package/src/product/internationalId/index.d.ts +0 -1
  932. package/src/product/internationalId/index.js +0 -5
  933. package/src/product/internationalId/internal.d.ts +0 -2
  934. package/src/product/internationalId/internal.js +0 -7
  935. package/src/product/internationalId/internationalIdV2.d.ts +0 -16
  936. package/src/product/internationalId/internationalIdV2.js +0 -27
  937. package/src/product/internationalId/internationalIdV2Document.d.ts +0 -46
  938. package/src/product/internationalId/internationalIdV2Document.js +0 -111
  939. package/src/product/invoice/index.d.ts +0 -1
  940. package/src/product/invoice/index.js +0 -5
  941. package/src/product/invoice/internal.d.ts +0 -3
  942. package/src/product/invoice/internal.js +0 -9
  943. package/src/product/invoice/invoiceV4.d.ts +0 -16
  944. package/src/product/invoice/invoiceV4.js +0 -27
  945. package/src/product/invoice/invoiceV4Document.d.ts +0 -71
  946. package/src/product/invoice/invoiceV4Document.js +0 -191
  947. package/src/product/invoice/invoiceV4LineItem.d.ts +0 -42
  948. package/src/product/invoice/invoiceV4LineItem.js +0 -144
  949. package/src/product/invoiceSplitter/index.d.ts +0 -1
  950. package/src/product/invoiceSplitter/index.js +0 -5
  951. package/src/product/invoiceSplitter/internal.d.ts +0 -3
  952. package/src/product/invoiceSplitter/internal.js +0 -9
  953. package/src/product/invoiceSplitter/invoiceSplitterV1.d.ts +0 -16
  954. package/src/product/invoiceSplitter/invoiceSplitterV1.js +0 -27
  955. package/src/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +0 -14
  956. package/src/product/invoiceSplitter/invoiceSplitterV1Document.js +0 -35
  957. package/src/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.d.ts +0 -28
  958. package/src/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.js +0 -54
  959. package/src/product/multiReceiptsDetector/index.d.ts +0 -1
  960. package/src/product/multiReceiptsDetector/index.js +0 -5
  961. package/src/product/multiReceiptsDetector/internal.d.ts +0 -2
  962. package/src/product/multiReceiptsDetector/internal.js +0 -7
  963. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +0 -16
  964. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +0 -27
  965. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +0 -14
  966. package/src/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +0 -28
  967. package/src/product/nutritionFactsLabel/index.d.ts +0 -1
  968. package/src/product/nutritionFactsLabel/index.js +0 -5
  969. package/src/product/nutritionFactsLabel/internal.d.ts +0 -15
  970. package/src/product/nutritionFactsLabel/internal.js +0 -33
  971. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1.d.ts +0 -16
  972. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1.js +0 -27
  973. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1AddedSugar.d.ts +0 -32
  974. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1AddedSugar.js +0 -85
  975. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Calorie.d.ts +0 -32
  976. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Calorie.js +0 -85
  977. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Cholesterol.d.ts +0 -32
  978. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Cholesterol.js +0 -85
  979. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1DietaryFiber.d.ts +0 -32
  980. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1DietaryFiber.js +0 -85
  981. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Document.d.ts +0 -53
  982. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Document.js +0 -117
  983. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Nutrient.d.ts +0 -36
  984. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Nutrient.js +0 -108
  985. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Protein.d.ts +0 -32
  986. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Protein.js +0 -85
  987. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1SaturatedFat.d.ts +0 -32
  988. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1SaturatedFat.js +0 -85
  989. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1ServingSize.d.ts +0 -30
  990. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1ServingSize.js +0 -66
  991. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Sodium.d.ts +0 -34
  992. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1Sodium.js +0 -90
  993. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalCarbohydrate.d.ts +0 -32
  994. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalCarbohydrate.js +0 -85
  995. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalFat.d.ts +0 -32
  996. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalFat.js +0 -85
  997. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalSugar.d.ts +0 -32
  998. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TotalSugar.js +0 -85
  999. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TransFat.d.ts +0 -32
  1000. package/src/product/nutritionFactsLabel/nutritionFactsLabelV1TransFat.js +0 -85
  1001. package/src/product/passport/index.d.ts +0 -1
  1002. package/src/product/passport/index.js +0 -5
  1003. package/src/product/passport/internal.d.ts +0 -2
  1004. package/src/product/passport/internal.js +0 -7
  1005. package/src/product/passport/passportV1.d.ts +0 -16
  1006. package/src/product/passport/passportV1.js +0 -27
  1007. package/src/product/passport/passportV1Document.d.ts +0 -34
  1008. package/src/product/passport/passportV1Document.js +0 -78
  1009. package/src/product/receipt/index.d.ts +0 -1
  1010. package/src/product/receipt/index.js +0 -5
  1011. package/src/product/receipt/internal.d.ts +0 -3
  1012. package/src/product/receipt/internal.js +0 -9
  1013. package/src/product/receipt/receiptV5.d.ts +0 -16
  1014. package/src/product/receipt/receiptV5.js +0 -27
  1015. package/src/product/receipt/receiptV5Document.d.ts +0 -47
  1016. package/src/product/receipt/receiptV5Document.js +0 -116
  1017. package/src/product/receipt/receiptV5LineItem.d.ts +0 -34
  1018. package/src/product/receipt/receiptV5LineItem.js +0 -98
  1019. package/src/product/resume/index.d.ts +0 -1
  1020. package/src/product/resume/index.js +0 -5
  1021. package/src/product/resume/internal.d.ts +0 -7
  1022. package/src/product/resume/internal.js +0 -17
  1023. package/src/product/resume/resumeV1.d.ts +0 -16
  1024. package/src/product/resume/resumeV1.js +0 -27
  1025. package/src/product/resume/resumeV1Certificate.d.ts +0 -34
  1026. package/src/product/resume/resumeV1Certificate.js +0 -89
  1027. package/src/product/resume/resumeV1Document.d.ts +0 -51
  1028. package/src/product/resume/resumeV1Document.js +0 -198
  1029. package/src/product/resume/resumeV1Education.d.ts +0 -40
  1030. package/src/product/resume/resumeV1Education.js +0 -119
  1031. package/src/product/resume/resumeV1Language.d.ts +0 -30
  1032. package/src/product/resume/resumeV1Language.js +0 -69
  1033. package/src/product/resume/resumeV1ProfessionalExperience.d.ts +0 -44
  1034. package/src/product/resume/resumeV1ProfessionalExperience.js +0 -139
  1035. package/src/product/resume/resumeV1SocialNetworksUrl.d.ts +0 -30
  1036. package/src/product/resume/resumeV1SocialNetworksUrl.js +0 -69
  1037. package/src/product/us/bankCheck/bankCheckV1.d.ts +0 -17
  1038. package/src/product/us/bankCheck/bankCheckV1.js +0 -28
  1039. package/src/product/us/bankCheck/bankCheckV1Document.d.ts +0 -24
  1040. package/src/product/us/bankCheck/bankCheckV1Document.js +0 -53
  1041. package/src/product/us/bankCheck/bankCheckV1Page.d.ts +0 -14
  1042. package/src/product/us/bankCheck/bankCheckV1Page.js +0 -32
  1043. package/src/product/us/bankCheck/index.d.ts +0 -1
  1044. package/src/product/us/bankCheck/index.js +0 -5
  1045. package/src/product/us/bankCheck/internal.d.ts +0 -3
  1046. package/src/product/us/bankCheck/internal.js +0 -9
  1047. package/src/product/us/healthcareCard/healthcareCardV1.d.ts +0 -16
  1048. package/src/product/us/healthcareCard/healthcareCardV1.js +0 -27
  1049. package/src/product/us/healthcareCard/healthcareCardV1Copay.d.ts +0 -30
  1050. package/src/product/us/healthcareCard/healthcareCardV1Copay.js +0 -72
  1051. package/src/product/us/healthcareCard/healthcareCardV1Document.d.ts +0 -41
  1052. package/src/product/us/healthcareCard/healthcareCardV1Document.js +0 -106
  1053. package/src/product/us/healthcareCard/index.d.ts +0 -1
  1054. package/src/product/us/healthcareCard/index.js +0 -5
  1055. package/src/product/us/healthcareCard/internal.d.ts +0 -3
  1056. package/src/product/us/healthcareCard/internal.js +0 -9
  1057. package/src/product/us/index.d.ts +0 -3
  1058. package/src/product/us/index.js +0 -9
  1059. package/src/product/us/internal.d.ts +0 -3
  1060. package/src/product/us/internal.js +0 -39
  1061. package/src/product/us/usMail/index.d.ts +0 -1
  1062. package/src/product/us/usMail/index.js +0 -5
  1063. package/src/product/us/usMail/internal.d.ts +0 -4
  1064. package/src/product/us/usMail/internal.js +0 -11
  1065. package/src/product/us/usMail/usMailV3.d.ts +0 -16
  1066. package/src/product/us/usMail/usMailV3.js +0 -27
  1067. package/src/product/us/usMail/usMailV3Document.d.ts +0 -24
  1068. package/src/product/us/usMail/usMailV3Document.js +0 -68
  1069. package/src/product/us/usMail/usMailV3RecipientAddress.d.ts +0 -42
  1070. package/src/product/us/usMail/usMailV3RecipientAddress.js +0 -129
  1071. package/src/product/us/usMail/usMailV3SenderAddress.d.ts +0 -36
  1072. package/src/product/us/usMail/usMailV3SenderAddress.js +0 -73
  1073. /package/bin/{mindee.d.ts → mindeeV1.d.ts} +0 -0
  1074. /package/src/{imageOperations → image}/imageCompressor.d.ts +0 -0
  1075. /package/src/input/{sources/inputSource.d.ts → inputSource.d.ts} +0 -0
  1076. /package/src/parsing/{common/dateParser.d.ts → dateParser.d.ts} +0 -0
  1077. /package/src/parsing/{common/stringDict.d.ts → stringDict.d.ts} +0 -0
  1078. /package/src/{cli.d.ts → v1/cli.d.ts} +0 -0
  1079. /package/src/{parsing → v1/parsing}/common/executionPriority.d.ts +0 -0
  1080. /package/src/{parsing → v1/parsing}/common/extras/extras.d.ts +0 -0
  1081. /package/src/{parsing → v1/parsing}/common/prediction.d.ts +0 -0
  1082. /package/src/{parsing → v1/parsing}/common/product.d.ts +0 -0
  1083. /package/src/{parsing → v1/parsing}/common/summaryHelper.d.ts +0 -0
  1084. /package/src/{parsing/v2 → v2/parsing/inference}/field/fieldConfidence.d.ts +0 -0
package/src/index.js CHANGED
@@ -1,66 +1,12 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.imageOperations = exports.internal = exports.LocalResponse = exports.PageOptionsOperation = exports.UrlInput = exports.StreamInput = exports.PathInput = exports.BytesInput = exports.BufferInput = exports.Base64Input = exports.InputSource = exports.RagMetadata = exports.RawText = exports.JobResponse = exports.InferenceResponse = exports.InferenceFile = exports.Page = exports.Document = exports.Prediction = exports.Inference = exports.PredictResponse = exports.AsyncPredictResponse = exports.ClientV2 = exports.Client = exports.product = void 0;
37
- exports.product = __importStar(require("./product"));
38
- var client_1 = require("./client");
39
- Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } });
40
- var clientV2_1 = require("./clientV2");
41
- Object.defineProperty(exports, "ClientV2", { enumerable: true, get: function () { return clientV2_1.ClientV2; } });
42
- var common_1 = require("./parsing/common");
43
- Object.defineProperty(exports, "AsyncPredictResponse", { enumerable: true, get: function () { return common_1.AsyncPredictResponse; } });
44
- Object.defineProperty(exports, "PredictResponse", { enumerable: true, get: function () { return common_1.PredictResponse; } });
45
- Object.defineProperty(exports, "Inference", { enumerable: true, get: function () { return common_1.Inference; } });
46
- Object.defineProperty(exports, "Prediction", { enumerable: true, get: function () { return common_1.Prediction; } });
47
- Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return common_1.Document; } });
48
- Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return common_1.Page; } });
49
- var v2_1 = require("./parsing/v2");
50
- Object.defineProperty(exports, "InferenceFile", { enumerable: true, get: function () { return v2_1.InferenceFile; } });
51
- Object.defineProperty(exports, "InferenceResponse", { enumerable: true, get: function () { return v2_1.InferenceResponse; } });
52
- Object.defineProperty(exports, "JobResponse", { enumerable: true, get: function () { return v2_1.JobResponse; } });
53
- Object.defineProperty(exports, "RawText", { enumerable: true, get: function () { return v2_1.RawText; } });
54
- Object.defineProperty(exports, "RagMetadata", { enumerable: true, get: function () { return v2_1.RagMetadata; } });
55
- var input_1 = require("./input");
56
- Object.defineProperty(exports, "InputSource", { enumerable: true, get: function () { return input_1.InputSource; } });
57
- Object.defineProperty(exports, "Base64Input", { enumerable: true, get: function () { return input_1.Base64Input; } });
58
- Object.defineProperty(exports, "BufferInput", { enumerable: true, get: function () { return input_1.BufferInput; } });
59
- Object.defineProperty(exports, "BytesInput", { enumerable: true, get: function () { return input_1.BytesInput; } });
60
- Object.defineProperty(exports, "PathInput", { enumerable: true, get: function () { return input_1.PathInput; } });
61
- Object.defineProperty(exports, "StreamInput", { enumerable: true, get: function () { return input_1.StreamInput; } });
62
- Object.defineProperty(exports, "UrlInput", { enumerable: true, get: function () { return input_1.UrlInput; } });
63
- Object.defineProperty(exports, "PageOptionsOperation", { enumerable: true, get: function () { return input_1.PageOptionsOperation; } });
64
- Object.defineProperty(exports, "LocalResponse", { enumerable: true, get: function () { return input_1.LocalResponse; } });
65
- exports.internal = __importStar(require("./internal"));
66
- exports.imageOperations = __importStar(require("./imageOperations"));
1
+ // Core
2
+ export { InputSource, Base64Input, BufferInput, BytesInput, PathInput, StreamInput, UrlInput, PageOptionsOperation, } from "./input/index.js";
3
+ export * as image from "./image/index.js";
4
+ export * as pdf from "./pdf/index.js";
5
+ export * as geometry from "./geometry/index.js";
6
+ // V1
7
+ export * as v1 from "./v1/index.js";
8
+ // V2
9
+ export * as v2 from "./v2/index.js";
10
+ // Consider v2 the default
11
+ export * as product from "./v2/product/index.js";
12
+ export { Client, JobResponse, ErrorResponse, } from "./v2/index.js";
@@ -0,0 +1,12 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ interface Base64InputProps {
3
+ inputString: string;
4
+ filename: string;
5
+ }
6
+ export declare class Base64Input extends LocalInputSource {
7
+ private inputString;
8
+ fileObject: Buffer;
9
+ constructor({ inputString, filename }: Base64InputProps);
10
+ init(): Promise<void>;
11
+ }
12
+ export {};
@@ -0,0 +1,24 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ import { INPUT_TYPE_BASE64 } from "./inputSource.js";
3
+ import { logger } from "../logger.js";
4
+ export class Base64Input extends LocalInputSource {
5
+ constructor({ inputString, filename }) {
6
+ super({
7
+ inputType: INPUT_TYPE_BASE64,
8
+ });
9
+ this.fileObject = Buffer.alloc(0);
10
+ this.filename = filename;
11
+ this.inputString = inputString;
12
+ }
13
+ async init() {
14
+ if (this.initialized) {
15
+ return;
16
+ }
17
+ logger.debug("Loading from base64");
18
+ this.fileObject = Buffer.from(this.inputString, "base64");
19
+ this.mimeType = await this.checkMimetype();
20
+ // clear out the string
21
+ this.inputString = "";
22
+ this.initialized = true;
23
+ }
24
+ }
@@ -0,0 +1,10 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ interface BufferInputProps {
3
+ buffer: Buffer;
4
+ filename: string;
5
+ }
6
+ export declare class BufferInput extends LocalInputSource {
7
+ constructor({ buffer, filename }: BufferInputProps);
8
+ init(): Promise<void>;
9
+ }
10
+ export {};
@@ -0,0 +1,20 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ import { INPUT_TYPE_BUFFER } from "./inputSource.js";
3
+ import { logger } from "../logger.js";
4
+ export class BufferInput extends LocalInputSource {
5
+ constructor({ buffer, filename }) {
6
+ super({
7
+ inputType: INPUT_TYPE_BUFFER,
8
+ });
9
+ this.fileObject = buffer;
10
+ this.filename = filename;
11
+ }
12
+ async init() {
13
+ if (this.initialized) {
14
+ return;
15
+ }
16
+ logger.debug("Loading from buffer");
17
+ this.mimeType = await this.checkMimetype();
18
+ this.initialized = true;
19
+ }
20
+ }
@@ -0,0 +1,12 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ interface BytesInputProps {
3
+ inputBytes: Uint8Array;
4
+ filename: string;
5
+ }
6
+ export declare class BytesInput extends LocalInputSource {
7
+ private inputBytes;
8
+ fileObject: Buffer;
9
+ constructor({ inputBytes, filename }: BytesInputProps);
10
+ init(): Promise<void>;
11
+ }
12
+ export {};
@@ -0,0 +1,23 @@
1
+ import { INPUT_TYPE_BYTES } from "./inputSource.js";
2
+ import { LocalInputSource } from "./localInputSource.js";
3
+ import { logger } from "../logger.js";
4
+ export class BytesInput extends LocalInputSource {
5
+ constructor({ inputBytes, filename }) {
6
+ super({
7
+ inputType: INPUT_TYPE_BYTES,
8
+ });
9
+ this.fileObject = Buffer.alloc(0);
10
+ this.filename = filename;
11
+ this.inputBytes = inputBytes;
12
+ }
13
+ async init() {
14
+ if (this.initialized) {
15
+ return;
16
+ }
17
+ logger.debug("Loading from bytes");
18
+ this.fileObject = Buffer.from(this.inputBytes);
19
+ this.mimeType = await this.checkMimetype();
20
+ this.inputBytes = new Uint8Array(0);
21
+ this.initialized = true;
22
+ }
23
+ }
@@ -1,4 +1,11 @@
1
- export { DataSchema, DataSchemaField, DataSchemaReplace } from "./dataSchema";
2
- export * from "./sources";
3
- export { LocalResponse } from "./localResponse";
4
- export { PageOptions, PageOptionsOperation } from "./pageOptions";
1
+ export { Base64Input } from "./base64Input.js";
2
+ export { BufferInput } from "./bufferInput.js";
3
+ export { BytesInput } from "./bytesInput.js";
4
+ export { InputSource, INPUT_TYPE_PATH, INPUT_TYPE_STREAM, INPUT_TYPE_BUFFER, INPUT_TYPE_BASE64, INPUT_TYPE_BYTES } from "./inputSource.js";
5
+ export type { InputConstructor } from "./inputSource.js";
6
+ export { LocalInputSource, MIMETYPES } from "./localInputSource.js";
7
+ export { PathInput } from "./pathInput.js";
8
+ export { StreamInput } from "./streamInput.js";
9
+ export { UrlInput } from "./urlInput.js";
10
+ export { PageOptionsOperation } from "./pageOptions.js";
11
+ export type { PageOptions } from "./pageOptions.js";
@@ -1,26 +1,9 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.PageOptionsOperation = exports.LocalResponse = exports.DataSchemaReplace = exports.DataSchemaField = exports.DataSchema = void 0;
18
- var dataSchema_1 = require("./dataSchema");
19
- Object.defineProperty(exports, "DataSchema", { enumerable: true, get: function () { return dataSchema_1.DataSchema; } });
20
- Object.defineProperty(exports, "DataSchemaField", { enumerable: true, get: function () { return dataSchema_1.DataSchemaField; } });
21
- Object.defineProperty(exports, "DataSchemaReplace", { enumerable: true, get: function () { return dataSchema_1.DataSchemaReplace; } });
22
- __exportStar(require("./sources"), exports);
23
- var localResponse_1 = require("./localResponse");
24
- Object.defineProperty(exports, "LocalResponse", { enumerable: true, get: function () { return localResponse_1.LocalResponse; } });
25
- var pageOptions_1 = require("./pageOptions");
26
- Object.defineProperty(exports, "PageOptionsOperation", { enumerable: true, get: function () { return pageOptions_1.PageOptionsOperation; } });
1
+ export { Base64Input } from "./base64Input.js";
2
+ export { BufferInput } from "./bufferInput.js";
3
+ export { BytesInput } from "./bytesInput.js";
4
+ export { InputSource, INPUT_TYPE_PATH, INPUT_TYPE_STREAM, INPUT_TYPE_BUFFER, INPUT_TYPE_BASE64, INPUT_TYPE_BYTES } from "./inputSource.js";
5
+ export { LocalInputSource, MIMETYPES } from "./localInputSource.js";
6
+ export { PathInput } from "./pathInput.js";
7
+ export { StreamInput } from "./streamInput.js";
8
+ export { UrlInput } from "./urlInput.js";
9
+ export { PageOptionsOperation } from "./pageOptions.js";
@@ -0,0 +1,18 @@
1
+ import { MindeeInputSourceError } from "../errors/index.js";
2
+ export const INPUT_TYPE_STREAM = "stream";
3
+ export const INPUT_TYPE_BASE64 = "base64";
4
+ export const INPUT_TYPE_BYTES = "bytes";
5
+ export const INPUT_TYPE_PATH = "path";
6
+ export const INPUT_TYPE_BUFFER = "buffer";
7
+ export class InputSource {
8
+ constructor() {
9
+ this.fileObject = "";
10
+ this.initialized = false;
11
+ }
12
+ async init() {
13
+ throw new MindeeInputSourceError("not Implemented");
14
+ }
15
+ isInitialized() {
16
+ return this.initialized;
17
+ }
18
+ }
@@ -0,0 +1,55 @@
1
+ import { PageOptions } from "../input/pageOptions.js";
2
+ import { InputSource, InputConstructor } from "./inputSource.js";
3
+ export declare const MIMETYPES: Map<string, string>;
4
+ export declare abstract class LocalInputSource extends InputSource {
5
+ inputType: string;
6
+ filename: string;
7
+ filepath?: string;
8
+ mimeType: string;
9
+ fileObject: Buffer | string;
10
+ /**
11
+ * @param {InputConstructor} constructor Constructor parameters.
12
+ */
13
+ protected constructor({ inputType }: InputConstructor);
14
+ protected checkMimetype(): Promise<string>;
15
+ /**
16
+ * Returns the file object as a Buffer.
17
+ * @returns Buffer representation of the file object
18
+ * @protected
19
+ */
20
+ protected getBuffer(): Buffer;
21
+ /**
22
+ * Determines whether the current file is a PDF.
23
+ * @returns {boolean} Returns true if the file is a PDF; otherwise, returns false.
24
+ */
25
+ isPdf(): boolean;
26
+ /**
27
+ * Cut PDF pages.
28
+ * @param pageOptions
29
+ */
30
+ applyPageOptions(pageOptions: PageOptions): Promise<void>;
31
+ /**
32
+ * Compresses the file object, either as a PDF or an image.
33
+ *
34
+ * @param quality Quality of the compression. For images, this is the JPEG quality.
35
+ * For PDFs, this affects image quality within the PDF.
36
+ * @param maxWidth Maximum width for image resizing. Ignored for PDFs.
37
+ * @param maxHeight Maximum height for image resizing. Ignored for PDFs.
38
+ * @param forceSourceText For PDFs, whether to force compression even if source text is present.
39
+ * @param disableSourceText For PDFs, whether to disable source text during compression.
40
+ *
41
+ * @returns A Promise that resolves when the compression is complete.
42
+ */
43
+ compress(quality?: number, maxWidth?: number | null, maxHeight?: number | null, forceSourceText?: boolean, disableSourceText?: boolean): Promise<void>;
44
+ /**
45
+ * Returns true if the object is a PDF and has source text. False otherwise.
46
+ * @return boolean
47
+ */
48
+ hasSourceText(): Promise<boolean>;
49
+ /**
50
+ * Returns the number of pages in the input source.
51
+ * For PDFs, returns the actual page count. For images, returns 1.
52
+ * @return Promise<number> The number of pages
53
+ */
54
+ getPageCount(): Promise<number>;
55
+ }
@@ -0,0 +1,146 @@
1
+ import path from "path";
2
+ import { MindeeInputSourceError } from "../errors/index.js";
3
+ import { errorHandler } from "../errors/handler.js";
4
+ import { logger } from "../logger.js";
5
+ import { compressImage } from "../image/index.js";
6
+ import { compressPdf, countPages, extractPages, hasSourceText } from "../pdf/index.js";
7
+ import { fileTypeFromBuffer } from "file-type";
8
+ import { InputSource, INPUT_TYPE_STREAM, INPUT_TYPE_BASE64, INPUT_TYPE_BYTES, INPUT_TYPE_PATH, INPUT_TYPE_BUFFER } from "./inputSource.js";
9
+ export const MIMETYPES = new Map([
10
+ [".pdf", "application/pdf"],
11
+ [".heic", "image/heic"],
12
+ [".jpg", "image/jpeg"],
13
+ [".jpeg", "image/jpeg"],
14
+ [".png", "image/png"],
15
+ [".tif", "image/tiff"],
16
+ [".tiff", "image/tiff"],
17
+ [".webp", "image/webp"],
18
+ ]);
19
+ const ALLOWED_INPUT_TYPES = [
20
+ INPUT_TYPE_STREAM,
21
+ INPUT_TYPE_BASE64,
22
+ INPUT_TYPE_BYTES,
23
+ INPUT_TYPE_PATH,
24
+ INPUT_TYPE_BUFFER,
25
+ ];
26
+ export class LocalInputSource extends InputSource {
27
+ /**
28
+ * @param {InputConstructor} constructor Constructor parameters.
29
+ */
30
+ constructor({ inputType }) {
31
+ super();
32
+ this.filename = "";
33
+ this.mimeType = "";
34
+ // Check if inputType is valid
35
+ if (!ALLOWED_INPUT_TYPES.includes(inputType)) {
36
+ const allowed = Array.from(ALLOWED_INPUT_TYPES.keys()).join(", ");
37
+ errorHandler.throw(new MindeeInputSourceError(`Invalid input type, must be one of ${allowed}.`));
38
+ }
39
+ this.inputType = inputType;
40
+ logger.debug(`Initialized local input source of type: ${inputType}`);
41
+ }
42
+ async checkMimetype() {
43
+ if (!(this.fileObject instanceof Buffer)) {
44
+ throw new MindeeInputSourceError(`MIME type cannot be verified on input source of type ${this.inputType}.`);
45
+ }
46
+ let mimeType;
47
+ const fileExt = path.extname(this.filename);
48
+ if (fileExt) {
49
+ mimeType = MIMETYPES.get(fileExt.toLowerCase()) || "";
50
+ }
51
+ else {
52
+ const guess = await fileTypeFromBuffer(this.fileObject);
53
+ if (guess !== undefined) {
54
+ mimeType = guess.mime;
55
+ }
56
+ else {
57
+ throw "Could not determine the MIME type of the file";
58
+ }
59
+ }
60
+ if (!mimeType) {
61
+ const allowed = Array.from(MIMETYPES.keys()).join(", ");
62
+ const err = new MindeeInputSourceError(`Invalid file type, must be one of ${allowed}.`);
63
+ errorHandler.throw(err);
64
+ }
65
+ logger.debug(`File is of type: ${mimeType}`);
66
+ return mimeType;
67
+ }
68
+ /**
69
+ * Returns the file object as a Buffer.
70
+ * @returns Buffer representation of the file object
71
+ * @protected
72
+ */
73
+ getBuffer() {
74
+ if (typeof this.fileObject === "string") {
75
+ return Buffer.from(this.fileObject);
76
+ }
77
+ return this.fileObject;
78
+ }
79
+ /**
80
+ * Determines whether the current file is a PDF.
81
+ * @returns {boolean} Returns true if the file is a PDF; otherwise, returns false.
82
+ */
83
+ isPdf() {
84
+ if (!this.initialized) {
85
+ throw new MindeeInputSourceError("The `init()` method must be called before calling `isPdf()`.");
86
+ }
87
+ return this.mimeType === "application/pdf";
88
+ }
89
+ /**
90
+ * Cut PDF pages.
91
+ * @param pageOptions
92
+ */
93
+ async applyPageOptions(pageOptions) {
94
+ await this.init();
95
+ const buffer = this.getBuffer();
96
+ const processedPdf = await extractPages(buffer, pageOptions);
97
+ this.fileObject = processedPdf.file;
98
+ }
99
+ /**
100
+ * Compresses the file object, either as a PDF or an image.
101
+ *
102
+ * @param quality Quality of the compression. For images, this is the JPEG quality.
103
+ * For PDFs, this affects image quality within the PDF.
104
+ * @param maxWidth Maximum width for image resizing. Ignored for PDFs.
105
+ * @param maxHeight Maximum height for image resizing. Ignored for PDFs.
106
+ * @param forceSourceText For PDFs, whether to force compression even if source text is present.
107
+ * @param disableSourceText For PDFs, whether to disable source text during compression.
108
+ *
109
+ * @returns A Promise that resolves when the compression is complete.
110
+ */
111
+ async compress(quality = 85, maxWidth = null, maxHeight = null, forceSourceText = false, disableSourceText = true) {
112
+ await this.init();
113
+ const buffer = this.getBuffer();
114
+ if (this.isPdf()) {
115
+ this.fileObject = await compressPdf(buffer, quality, forceSourceText, disableSourceText);
116
+ }
117
+ else {
118
+ this.fileObject = await compressImage(buffer, quality, maxWidth, maxHeight);
119
+ }
120
+ }
121
+ /**
122
+ * Returns true if the object is a PDF and has source text. False otherwise.
123
+ * @return boolean
124
+ */
125
+ async hasSourceText() {
126
+ await this.init();
127
+ if (!this.isPdf()) {
128
+ return false;
129
+ }
130
+ const buffer = this.getBuffer();
131
+ return hasSourceText(buffer);
132
+ }
133
+ /**
134
+ * Returns the number of pages in the input source.
135
+ * For PDFs, returns the actual page count. For images, returns 1.
136
+ * @return Promise<number> The number of pages
137
+ */
138
+ async getPageCount() {
139
+ await this.init();
140
+ if (!this.isPdf()) {
141
+ return 1;
142
+ }
143
+ const buffer = this.getBuffer();
144
+ return countPages(buffer);
145
+ }
146
+ }
@@ -7,13 +7,13 @@ export interface PageOptions {
7
7
  *
8
8
  * A negative index can be used, indicating an offset from the end of the document.
9
9
  *
10
- * [0, -1] represents the fist and last pages of the document.
10
+ * [0, -1] represents the first and last pages of the document.
11
11
  */
12
12
  pageIndexes: number[];
13
13
  /** Operation to apply on the document, given the `pageIndexes` specified. */
14
14
  operation: PageOptionsOperation;
15
15
  /**
16
- * Apply the operation only if document has at least this many pages.
16
+ * Apply the operation only if the document has at least this many pages.
17
17
  */
18
18
  onMinPages: number;
19
19
  }
@@ -1,13 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageOptionsOperation = void 0;
4
1
  /**
5
2
  * Operation to apply on the document, given the page indexes specified.
6
3
  */
7
- var PageOptionsOperation;
4
+ /* eslint-disable @typescript-eslint/naming-convention */
5
+ export var PageOptionsOperation;
8
6
  (function (PageOptionsOperation) {
9
7
  /** Only keep pages matching the provided indexes. */
10
8
  PageOptionsOperation["KeepOnly"] = "KEEP_ONLY";
11
9
  /** Remove pages matching the provided indexes. */
12
10
  PageOptionsOperation["Remove"] = "REMOVE";
13
- })(PageOptionsOperation || (exports.PageOptionsOperation = PageOptionsOperation = {}));
11
+ })(PageOptionsOperation || (PageOptionsOperation = {}));
@@ -0,0 +1,11 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ interface PathInputProps {
3
+ inputPath: string;
4
+ }
5
+ export declare class PathInput extends LocalInputSource {
6
+ readonly inputPath: string;
7
+ fileObject: Buffer;
8
+ constructor({ inputPath }: PathInputProps);
9
+ init(): Promise<void>;
10
+ }
11
+ export {};
@@ -0,0 +1,24 @@
1
+ import { INPUT_TYPE_PATH } from "./inputSource.js";
2
+ import { LocalInputSource } from "./localInputSource.js";
3
+ import path from "path";
4
+ import { logger } from "../logger.js";
5
+ import { promises as fs } from "fs";
6
+ export class PathInput extends LocalInputSource {
7
+ constructor({ inputPath }) {
8
+ super({
9
+ inputType: INPUT_TYPE_PATH,
10
+ });
11
+ this.fileObject = Buffer.alloc(0);
12
+ this.inputPath = inputPath;
13
+ this.filename = path.basename(this.inputPath);
14
+ }
15
+ async init() {
16
+ if (this.initialized) {
17
+ return;
18
+ }
19
+ logger.debug(`Loading from path: ${this.inputPath}`);
20
+ this.fileObject = Buffer.from(await fs.readFile(this.inputPath));
21
+ this.mimeType = await this.checkMimetype();
22
+ this.initialized = true;
23
+ }
24
+ }
@@ -0,0 +1,14 @@
1
+ import { Readable } from "stream";
2
+ import { LocalInputSource } from "./localInputSource.js";
3
+ interface StreamInputProps {
4
+ inputStream: Readable;
5
+ filename: string;
6
+ }
7
+ export declare class StreamInput extends LocalInputSource {
8
+ private readonly inputStream;
9
+ fileObject: Buffer;
10
+ constructor({ inputStream, filename }: StreamInputProps);
11
+ init(): Promise<void>;
12
+ stream2buffer(stream: Readable, signal?: AbortSignal): Promise<Buffer>;
13
+ }
14
+ export {};
@@ -0,0 +1,55 @@
1
+ import { LocalInputSource } from "./localInputSource.js";
2
+ import { INPUT_TYPE_STREAM } from "./inputSource.js";
3
+ import { logger } from "../logger.js";
4
+ import { MindeeInputSourceError } from "../errors/index.js";
5
+ export class StreamInput extends LocalInputSource {
6
+ constructor({ inputStream, filename }) {
7
+ super({
8
+ inputType: INPUT_TYPE_STREAM,
9
+ });
10
+ this.fileObject = Buffer.alloc(0);
11
+ this.filename = filename;
12
+ this.inputStream = inputStream;
13
+ }
14
+ async init() {
15
+ if (this.initialized) {
16
+ return;
17
+ }
18
+ logger.debug("Loading from stream");
19
+ this.fileObject = await this.stream2buffer(this.inputStream);
20
+ this.mimeType = await this.checkMimetype();
21
+ this.initialized = true;
22
+ }
23
+ async stream2buffer(stream, signal) {
24
+ return new Promise((resolve, reject) => {
25
+ if (stream.closed || stream.destroyed) {
26
+ return reject(new MindeeInputSourceError("Stream is already closed"));
27
+ }
28
+ if (signal?.aborted) {
29
+ return reject(new MindeeInputSourceError("Operation aborted"));
30
+ }
31
+ const onAbort = () => {
32
+ stream.destroy();
33
+ reject(new MindeeInputSourceError("Operation aborted"));
34
+ };
35
+ if (signal) {
36
+ signal.addEventListener("abort", onAbort, { once: true });
37
+ }
38
+ const cleanup = () => {
39
+ signal?.removeEventListener("abort", onAbort);
40
+ };
41
+ const _buf = [];
42
+ stream.pause();
43
+ stream.on("data", (chunk) => _buf.push(chunk));
44
+ stream.on("end", () => {
45
+ cleanup();
46
+ resolve(Buffer.concat(_buf));
47
+ });
48
+ stream.on("error", (err) => {
49
+ cleanup();
50
+ reject(new MindeeInputSourceError(`Error converting stream - ${err}`));
51
+ });
52
+ stream.resume();
53
+ });
54
+ }
55
+ }
@@ -0,0 +1,35 @@
1
+ import { InputSource } from "./inputSource.js";
2
+ import { Dispatcher } from "undici";
3
+ import { BytesInput } from "./bytesInput.js";
4
+ export declare class UrlInput extends InputSource {
5
+ readonly url: string;
6
+ readonly dispatcher: Dispatcher;
7
+ constructor({ url, dispatcher }: {
8
+ url: string;
9
+ dispatcher?: Dispatcher;
10
+ });
11
+ init(): Promise<void>;
12
+ private fetchFileContent;
13
+ saveToFile(options: {
14
+ filepath: string;
15
+ filename?: string;
16
+ username?: string;
17
+ password?: string;
18
+ token?: string;
19
+ headers?: Record<string, string>;
20
+ maxRedirects?: number;
21
+ }): Promise<string>;
22
+ asLocalInputSource(options?: {
23
+ filename?: string;
24
+ username?: string;
25
+ password?: string;
26
+ token?: string;
27
+ headers?: Record<string, string>;
28
+ maxRedirects?: number;
29
+ }): Promise<BytesInput>;
30
+ private static extractFilenameFromUrl;
31
+ private static generateFileName;
32
+ private static getFileExtension;
33
+ private fillFilename;
34
+ private makeRequest;
35
+ }