mindee 5.9.0 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +12 -13
  3. package/src/geometry/bbox.d.ts +18 -6
  4. package/src/geometry/bbox.js +6 -2
  5. package/src/geometry/boundingBox.d.ts +3 -1
  6. package/src/geometry/boundingBox.js +3 -1
  7. package/src/geometry/boundingBoxUtils.d.ts +4 -4
  8. package/src/geometry/boundingBoxUtils.js +7 -7
  9. package/src/geometry/minMax.d.ts +9 -3
  10. package/src/geometry/point.d.ts +3 -1
  11. package/src/geometry/polygon.d.ts +3 -1
  12. package/src/geometry/polygon.js +3 -1
  13. package/src/http/apiCore.js +1 -1
  14. package/src/http/baseSettings.d.ts +15 -5
  15. package/src/http/baseSettings.js +4 -2
  16. package/src/http/dispatcher.js +4 -2
  17. package/src/image/extractedImage.d.ts +13 -5
  18. package/src/image/extractedImage.js +3 -3
  19. package/src/image/extractedImages.d.ts +3 -1
  20. package/src/image/extractedImages.js +3 -1
  21. package/src/image/imageCompressor.d.ts +1 -0
  22. package/src/image/imageCompressor.js +2 -2
  23. package/src/image/imageExtractor.d.ts +1 -1
  24. package/src/image/imageExtractor.js +12 -12
  25. package/src/input/base64Input.d.ts +9 -3
  26. package/src/input/base64Input.js +9 -3
  27. package/src/input/bufferInput.d.ts +7 -2
  28. package/src/input/bufferInput.js +6 -2
  29. package/src/input/bytesInput.d.ts +10 -3
  30. package/src/input/bytesInput.js +10 -3
  31. package/src/input/inputSource.d.ts +4 -2
  32. package/src/input/inputSource.js +3 -2
  33. package/src/input/localInputSource.d.ts +19 -6
  34. package/src/input/localInputSource.js +12 -5
  35. package/src/input/pageOptions.d.ts +9 -3
  36. package/src/input/pageOptions.js +6 -2
  37. package/src/input/pathInput.d.ts +12 -4
  38. package/src/input/pathInput.js +11 -5
  39. package/src/input/streamInput.d.ts +14 -5
  40. package/src/input/streamInput.js +13 -4
  41. package/src/input/urlInput.d.ts +19 -7
  42. package/src/input/urlInput.js +20 -12
  43. package/src/parsing/baseLocalResponse.d.ts +7 -3
  44. package/src/parsing/baseLocalResponse.js +15 -11
  45. package/src/parsing/stringDict.d.ts +3 -1
  46. package/src/pdf/extractedPdf.d.ts +16 -6
  47. package/src/pdf/extractedPdf.js +5 -3
  48. package/src/pdf/extractedPdfs.d.ts +3 -1
  49. package/src/pdf/extractedPdfs.js +3 -1
  50. package/src/pdf/pdfCompressor.js +14 -14
  51. package/src/pdf/pdfExtractor.js +1 -1
  52. package/src/pdf/pdfOperation.d.ts +9 -3
  53. package/src/pdf/pdfOperation.js +14 -14
  54. package/src/pdf/pdfUtils.js +1 -1
  55. package/src/v1/cli.js +1 -1
  56. package/src/v1/client.d.ts +42 -14
  57. package/src/v1/client.js +8 -8
  58. package/src/v1/extraction/invoiceSplitterExtractor/extractedInvoiceSplitterImage.d.ts +6 -2
  59. package/src/v1/extraction/invoiceSplitterExtractor/invoiceSplitterExtractor.js +4 -4
  60. package/src/v1/extraction/multiReceiptsExtractor/extractedMultiReceiptImage.d.ts +6 -2
  61. package/src/v1/extraction/multiReceiptsExtractor/multiReceiptsExtractor.js +2 -2
  62. package/src/v1/http/apiSettingsV1.d.ts +15 -5
  63. package/src/v1/http/apiSettingsV1.js +12 -4
  64. package/src/v1/http/baseEndpoint.d.ts +6 -2
  65. package/src/v1/http/endpoint.d.ts +9 -3
  66. package/src/v1/http/endpoint.js +1 -1
  67. package/src/v1/http/errors.d.ts +9 -3
  68. package/src/v1/http/errors.js +6 -2
  69. package/src/v1/http/httpParams.d.ts +36 -12
  70. package/src/v1/http/workflowEndpoint.js +1 -1
  71. package/src/v1/parsing/common/apiRequest.d.ts +15 -5
  72. package/src/v1/parsing/common/apiResponse.d.ts +6 -2
  73. package/src/v1/parsing/common/asyncPredictResponse.d.ts +21 -7
  74. package/src/v1/parsing/common/document.d.ts +18 -6
  75. package/src/v1/parsing/common/document.js +2 -2
  76. package/src/v1/parsing/common/execution.d.ts +39 -13
  77. package/src/v1/parsing/common/executionFile.d.ts +6 -2
  78. package/src/v1/parsing/common/executionPriority.d.ts +12 -4
  79. package/src/v1/parsing/common/executionPriority.js +12 -4
  80. package/src/v1/parsing/common/extras/cropperExtra.d.ts +7 -3
  81. package/src/v1/parsing/common/extras/cropperExtra.js +6 -3
  82. package/src/v1/parsing/common/extras/extras.d.ts +9 -3
  83. package/src/v1/parsing/common/extras/extras.js +6 -2
  84. package/src/v1/parsing/common/extras/fullTextOcrExtra.d.ts +9 -3
  85. package/src/v1/parsing/common/extras/fullTextOcrExtra.js +3 -1
  86. package/src/v1/parsing/common/extras/ragExtra.d.ts +3 -1
  87. package/src/v1/parsing/common/extras/ragExtra.js +3 -1
  88. package/src/v1/parsing/common/feedback/feedbackResponse.d.ts +3 -1
  89. package/src/v1/parsing/common/feedback/feedbackResponse.js +0 -1
  90. package/src/v1/parsing/common/inference.d.ts +24 -8
  91. package/src/v1/parsing/common/inference.js +6 -2
  92. package/src/v1/parsing/common/mvisionV1.d.ts +3 -1
  93. package/src/v1/parsing/common/mvisionV1.js +3 -1
  94. package/src/v1/parsing/common/ocr.d.ts +3 -1
  95. package/src/v1/parsing/common/ocrPage.d.ts +6 -2
  96. package/src/v1/parsing/common/ocrPage.js +6 -2
  97. package/src/v1/parsing/common/orientation.d.ts +6 -2
  98. package/src/v1/parsing/common/page.d.ts +12 -4
  99. package/src/v1/parsing/common/predictResponse.d.ts +3 -1
  100. package/src/v1/parsing/common/prediction.d.ts +3 -1
  101. package/src/v1/parsing/common/prediction.js +3 -1
  102. package/src/v1/parsing/generated/generatedList.d.ts +6 -2
  103. package/src/v1/parsing/generated/generatedObject.d.ts +25 -9
  104. package/src/v1/parsing/generated/generatedObject.js +13 -7
  105. package/src/v1/parsing/localResponse.d.ts +3 -1
  106. package/src/v1/parsing/localResponse.js +3 -1
  107. package/src/v1/parsing/standard/addressField.d.ts +24 -8
  108. package/src/v1/parsing/standard/amount.d.ts +3 -1
  109. package/src/v1/parsing/standard/amount.js +3 -1
  110. package/src/v1/parsing/standard/base.d.ts +27 -9
  111. package/src/v1/parsing/standard/base.js +6 -2
  112. package/src/v1/parsing/standard/boolean.d.ts +3 -1
  113. package/src/v1/parsing/standard/classification.d.ts +6 -2
  114. package/src/v1/parsing/standard/companyRegistration.d.ts +9 -3
  115. package/src/v1/parsing/standard/companyRegistration.js +3 -1
  116. package/src/v1/parsing/standard/date.d.ts +12 -4
  117. package/src/v1/parsing/standard/date.js +3 -1
  118. package/src/v1/parsing/standard/field.d.ts +7 -5
  119. package/src/v1/parsing/standard/field.js +4 -4
  120. package/src/v1/parsing/standard/locale.d.ts +15 -5
  121. package/src/v1/parsing/standard/paymentDetails.d.ts +15 -5
  122. package/src/v1/parsing/standard/position.d.ts +15 -5
  123. package/src/v1/parsing/standard/tax.d.ts +18 -6
  124. package/src/v1/parsing/standard/tax.js +15 -5
  125. package/src/v1/parsing/standard/text.d.ts +6 -2
  126. package/src/v1/parsing/standard/word.d.ts +9 -3
  127. package/src/v1/parsing/standard/word.js +3 -1
  128. package/src/v1/product/barcodeReader/barcodeReaderV1.d.ts +12 -4
  129. package/src/v1/product/barcodeReader/barcodeReaderV1.js +9 -3
  130. package/src/v1/product/barcodeReader/barcodeReaderV1Document.d.ts +6 -2
  131. package/src/v1/product/barcodeReader/barcodeReaderV1Document.js +6 -2
  132. package/src/v1/product/cropper/cropperV1.d.ts +12 -4
  133. package/src/v1/product/cropper/cropperV1.js +9 -3
  134. package/src/v1/product/cropper/cropperV1Page.d.ts +3 -1
  135. package/src/v1/product/cropper/cropperV1Page.js +3 -1
  136. package/src/v1/product/driverLicense/driverLicenseV1.d.ts +12 -4
  137. package/src/v1/product/driverLicense/driverLicenseV1.js +9 -3
  138. package/src/v1/product/driverLicense/driverLicenseV1Document.d.ts +39 -13
  139. package/src/v1/product/financialDocument/financialDocumentV1.d.ts +12 -4
  140. package/src/v1/product/financialDocument/financialDocumentV1.js +9 -3
  141. package/src/v1/product/financialDocument/financialDocumentV1Document.d.ts +96 -32
  142. package/src/v1/product/financialDocument/financialDocumentV1Document.js +15 -5
  143. package/src/v1/product/financialDocument/financialDocumentV1LineItem.d.ts +30 -10
  144. package/src/v1/product/financialDocument/financialDocumentV1LineItem.js +3 -1
  145. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.d.ts +12 -4
  146. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1.js +9 -3
  147. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV1Document.d.ts +9 -3
  148. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.d.ts +12 -4
  149. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2.js +9 -3
  150. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.d.ts +18 -6
  151. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Bban.js +3 -1
  152. package/src/v1/product/fr/bankAccountDetails/bankAccountDetailsV2Document.d.ts +12 -4
  153. package/src/v1/product/fr/carteGrise/carteGriseV1.d.ts +12 -4
  154. package/src/v1/product/fr/carteGrise/carteGriseV1.js +9 -3
  155. package/src/v1/product/fr/carteGrise/carteGriseV1Document.d.ts +123 -41
  156. package/src/v1/product/fr/idCard/idCardV2.d.ts +12 -4
  157. package/src/v1/product/fr/idCard/idCardV2.js +9 -3
  158. package/src/v1/product/fr/idCard/idCardV2Document.d.ts +45 -15
  159. package/src/v1/product/fr/idCard/idCardV2Document.js +3 -1
  160. package/src/v1/product/fr/idCard/idCardV2Page.d.ts +6 -2
  161. package/src/v1/product/generated/generatedV1.d.ts +12 -4
  162. package/src/v1/product/generated/generatedV1.js +9 -3
  163. package/src/v1/product/generated/generatedV1Prediction.d.ts +6 -2
  164. package/src/v1/product/generated/generatedV1Prediction.js +3 -1
  165. package/src/v1/product/internationalId/internationalIdV2.d.ts +12 -4
  166. package/src/v1/product/internationalId/internationalIdV2.js +9 -3
  167. package/src/v1/product/internationalId/internationalIdV2Document.d.ts +51 -17
  168. package/src/v1/product/internationalId/internationalIdV2Document.js +6 -2
  169. package/src/v1/product/invoice/invoiceV4.d.ts +12 -4
  170. package/src/v1/product/invoice/invoiceV4.js +9 -3
  171. package/src/v1/product/invoice/invoiceV4Document.d.ts +87 -29
  172. package/src/v1/product/invoice/invoiceV4Document.js +15 -5
  173. package/src/v1/product/invoice/invoiceV4LineItem.d.ts +30 -10
  174. package/src/v1/product/invoice/invoiceV4LineItem.js +3 -1
  175. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.d.ts +12 -4
  176. package/src/v1/product/invoiceSplitter/invoiceSplitterV1.js +9 -3
  177. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.d.ts +3 -1
  178. package/src/v1/product/invoiceSplitter/invoiceSplitterV1Document.js +3 -1
  179. package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.d.ts +9 -3
  180. package/src/v1/product/invoiceSplitter/invoiceSplitterV1InvoicePageGroup.js +3 -1
  181. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.d.ts +12 -4
  182. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1.js +9 -3
  183. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.d.ts +3 -1
  184. package/src/v1/product/multiReceiptsDetector/multiReceiptsDetectorV1Document.js +3 -1
  185. package/src/v1/product/passport/passportV1.d.ts +12 -4
  186. package/src/v1/product/passport/passportV1.js +9 -3
  187. package/src/v1/product/passport/passportV1Document.d.ts +33 -11
  188. package/src/v1/product/passport/passportV1Document.js +3 -1
  189. package/src/v1/product/receipt/receiptV5.d.ts +12 -4
  190. package/src/v1/product/receipt/receiptV5.js +9 -3
  191. package/src/v1/product/receipt/receiptV5Document.d.ts +51 -17
  192. package/src/v1/product/receipt/receiptV5Document.js +6 -2
  193. package/src/v1/product/receipt/receiptV5LineItem.d.ts +18 -6
  194. package/src/v1/product/receipt/receiptV5LineItem.js +3 -1
  195. package/src/v1/product/resume/resumeV1.d.ts +12 -4
  196. package/src/v1/product/resume/resumeV1.js +9 -3
  197. package/src/v1/product/resume/resumeV1Certificate.d.ts +18 -6
  198. package/src/v1/product/resume/resumeV1Certificate.js +3 -1
  199. package/src/v1/product/resume/resumeV1Document.d.ts +51 -17
  200. package/src/v1/product/resume/resumeV1Document.js +27 -9
  201. package/src/v1/product/resume/resumeV1Education.d.ts +27 -9
  202. package/src/v1/product/resume/resumeV1Education.js +3 -1
  203. package/src/v1/product/resume/resumeV1Language.d.ts +12 -4
  204. package/src/v1/product/resume/resumeV1Language.js +3 -1
  205. package/src/v1/product/resume/resumeV1ProfessionalExperience.d.ts +33 -11
  206. package/src/v1/product/resume/resumeV1ProfessionalExperience.js +3 -1
  207. package/src/v1/product/resume/resumeV1SocialNetworksUrl.d.ts +12 -4
  208. package/src/v1/product/resume/resumeV1SocialNetworksUrl.js +3 -1
  209. package/src/v1/product/us/bankCheck/bankCheckV1.d.ts +12 -4
  210. package/src/v1/product/us/bankCheck/bankCheckV1.js +9 -3
  211. package/src/v1/product/us/bankCheck/bankCheckV1Document.d.ts +18 -6
  212. package/src/v1/product/us/bankCheck/bankCheckV1Document.js +3 -1
  213. package/src/v1/product/us/bankCheck/bankCheckV1Page.d.ts +6 -2
  214. package/src/v1/product/us/bankCheck/bankCheckV1Page.js +3 -1
  215. package/src/v2/cli.js +1 -1
  216. package/src/v2/client.d.ts +9 -3
  217. package/src/v2/clientOptions/pollingOptions.d.ts +30 -10
  218. package/src/v2/clientOptions/pollingOptions.js +6 -2
  219. package/src/v2/http/mindeeApiV2.d.ts +1 -1
  220. package/src/v2/http/mindeeApiV2.js +1 -1
  221. package/src/v2/parsing/error/errorDetails.d.ts +3 -1
  222. package/src/v2/parsing/inference/baseInference.d.ts +6 -2
  223. package/src/v2/parsing/inference/baseInference.js +6 -2
  224. package/src/v2/parsing/inference/field/baseField.d.ts +9 -3
  225. package/src/v2/parsing/inference/field/fieldConfidence.d.ts +12 -4
  226. package/src/v2/parsing/inference/field/fieldConfidence.js +12 -4
  227. package/src/v2/parsing/inference/field/fieldLocation.d.ts +9 -3
  228. package/src/v2/parsing/inference/field/fieldLocation.js +3 -1
  229. package/src/v2/parsing/inference/field/inferenceFields.d.ts +6 -2
  230. package/src/v2/parsing/inference/field/inferenceFields.js +3 -1
  231. package/src/v2/parsing/inference/field/listField.d.ts +6 -2
  232. package/src/v2/parsing/inference/field/listField.js +6 -2
  233. package/src/v2/parsing/inference/field/objectField.d.ts +6 -2
  234. package/src/v2/parsing/inference/field/objectField.js +3 -1
  235. package/src/v2/parsing/inference/field/ragMetadata.d.ts +3 -1
  236. package/src/v2/parsing/inference/field/ragMetadata.js +3 -1
  237. package/src/v2/parsing/inference/field/rawText.d.ts +6 -2
  238. package/src/v2/parsing/inference/field/rawText.js +6 -2
  239. package/src/v2/parsing/inference/field/simpleField.d.ts +6 -2
  240. package/src/v2/parsing/inference/field/simpleField.js +8 -4
  241. package/src/v2/parsing/inference/inferenceFile.d.ts +6 -2
  242. package/src/v2/parsing/inference/inferenceFile.js +6 -2
  243. package/src/v2/parsing/inference/inferenceModel.d.ts +6 -2
  244. package/src/v2/parsing/inference/inferenceModel.js +6 -2
  245. package/src/v2/product/classification/classification.d.ts +9 -3
  246. package/src/v2/product/classification/classification.js +9 -3
  247. package/src/v2/product/classification/classificationClassifier.d.ts +6 -2
  248. package/src/v2/product/classification/classificationClassifier.js +6 -2
  249. package/src/v2/product/classification/classificationInference.d.ts +6 -2
  250. package/src/v2/product/classification/classificationInference.js +6 -2
  251. package/src/v2/product/classification/classificationResponse.d.ts +3 -1
  252. package/src/v2/product/classification/classificationResponse.js +3 -1
  253. package/src/v2/product/classification/classificationResult.d.ts +6 -2
  254. package/src/v2/product/classification/classificationResult.js +6 -2
  255. package/src/v2/product/crop/crop.d.ts +9 -3
  256. package/src/v2/product/crop/crop.js +9 -3
  257. package/src/v2/product/crop/cropInference.d.ts +6 -2
  258. package/src/v2/product/crop/cropInference.js +6 -2
  259. package/src/v2/product/crop/cropItem.d.ts +6 -2
  260. package/src/v2/product/crop/cropItem.js +6 -2
  261. package/src/v2/product/crop/cropResponse.d.ts +3 -1
  262. package/src/v2/product/crop/cropResponse.js +3 -1
  263. package/src/v2/product/crop/cropResult.d.ts +6 -2
  264. package/src/v2/product/crop/cropResult.js +6 -2
  265. package/src/v2/product/extraction/dataSchemaActiveOption.d.ts +3 -1
  266. package/src/v2/product/extraction/dataSchemaActiveOption.js +3 -1
  267. package/src/v2/product/extraction/extraction.d.ts +18 -6
  268. package/src/v2/product/extraction/extraction.js +18 -6
  269. package/src/v2/product/extraction/extractionActiveOptions.d.ts +6 -2
  270. package/src/v2/product/extraction/extractionActiveOptions.js +6 -2
  271. package/src/v2/product/extraction/extractionInference.d.ts +6 -2
  272. package/src/v2/product/extraction/extractionInference.js +6 -2
  273. package/src/v2/product/extraction/extractionResponse.d.ts +3 -1
  274. package/src/v2/product/extraction/extractionResponse.js +3 -1
  275. package/src/v2/product/extraction/extractionResult.d.ts +6 -2
  276. package/src/v2/product/extraction/extractionResult.js +6 -2
  277. package/src/v2/product/extraction/params/dataSchema.d.ts +12 -4
  278. package/src/v2/product/extraction/params/dataSchema.js +6 -2
  279. package/src/v2/product/extraction/params/dataSchemaField.d.ts +39 -13
  280. package/src/v2/product/extraction/params/dataSchemaField.js +9 -3
  281. package/src/v2/product/extraction/params/dataSchemaReplace.d.ts +12 -4
  282. package/src/v2/product/extraction/params/dataSchemaReplace.js +6 -2
  283. package/src/v2/product/extraction/params/extractionParameters.js +3 -3
  284. package/src/v2/product/extraction/ragDocuments/annotatedListField.d.ts +3 -1
  285. package/src/v2/product/extraction/ragDocuments/annotatedListField.js +3 -1
  286. package/src/v2/product/extraction/ragDocuments/params/ragDocumentAnnotationParameters.js +1 -1
  287. package/src/v2/product/ocr/ocr.d.ts +9 -3
  288. package/src/v2/product/ocr/ocr.js +9 -3
  289. package/src/v2/product/ocr/ocrInference.d.ts +6 -2
  290. package/src/v2/product/ocr/ocrInference.js +6 -2
  291. package/src/v2/product/ocr/ocrPage.d.ts +6 -2
  292. package/src/v2/product/ocr/ocrPage.js +6 -2
  293. package/src/v2/product/ocr/ocrResponse.d.ts +3 -1
  294. package/src/v2/product/ocr/ocrResponse.js +3 -1
  295. package/src/v2/product/ocr/ocrResult.d.ts +3 -1
  296. package/src/v2/product/ocr/ocrResult.js +3 -1
  297. package/src/v2/product/ocr/ocrWord.d.ts +6 -2
  298. package/src/v2/product/ocr/ocrWord.js +6 -2
  299. package/src/v2/product/split/split.d.ts +9 -3
  300. package/src/v2/product/split/split.js +9 -3
  301. package/src/v2/product/split/splitInference.d.ts +6 -2
  302. package/src/v2/product/split/splitInference.js +6 -2
  303. package/src/v2/product/split/splitRange.d.ts +3 -1
  304. package/src/v2/product/split/splitRange.js +3 -1
  305. package/src/v2/product/split/splitResponse.d.ts +3 -1
  306. package/src/v2/product/split/splitResponse.js +3 -1
  307. package/src/v2/product/split/splitResult.d.ts +3 -1
  308. package/src/v2/product/split/splitResult.js +3 -1
  309. package/src/v2/search/baseSearch.d.ts +9 -3
  310. package/src/v2/search/baseSearch.js +9 -3
  311. package/src/v2/search/models/modelSearch.d.ts +9 -3
  312. package/src/v2/search/models/modelSearch.js +9 -3
  313. package/src/v2/search/models/modelSearchParameters.d.ts +3 -1
  314. package/src/v2/search/models/modelSearchParameters.js +3 -1
  315. package/src/v2/search/ragDocuments/ragDocumentSearch.d.ts +9 -3
  316. package/src/v2/search/ragDocuments/ragDocumentSearch.js +9 -3
  317. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.d.ts +3 -1
  318. package/src/v2/search/ragDocuments/ragDocumentSearchParameters.js +3 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Mindee Node.js API Library Changelog
2
2
 
3
+ ## v5.10.0 - 2026-09-23
4
+ ### Changes
5
+ * :arrow_up: migrate to TypeScript 6.0
6
+ * :arrow_up: bump output to ES2021
7
+
8
+
3
9
  ## v5.9.0 - 2026-09-18
4
10
  ### Changes
5
11
  * :sparkles: add RAG document CRUD
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindee",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
4
4
  "description": "Mindee Client Library for Node.js",
5
5
  "author": {
6
6
  "name": "Mindee",
@@ -39,12 +39,12 @@
39
39
  "test:light": "node tests/runner.mjs spec",
40
40
  "test:integration": "node tests/runner.mjs integration",
41
41
  "test:integration:light": "node tests/runner.mjs integration",
42
- "test:v2": "tsc --noEmit && node tests/runner.mjs spec v2",
43
- "lint": "tsc --noEmit && eslint --report-unused-disable-directives './src/**/*.ts' './tests/**/*.ts'",
44
- "lint:fix": "tsc --noEmit && eslint --fix --report-unused-disable-directives './src/**/*.ts' './tests/**/*.ts'",
42
+ "test:v2": "tsc -p tsconfig.test.json && node tests/runner.mjs spec v2",
43
+ "lint": "tsc -p tsconfig.test.json && eslint --report-unused-disable-directives './src/**/*.ts' './tests/**/*.ts'",
44
+ "lint:fix": "tsc -p tsconfig.test.json && eslint --fix --report-unused-disable-directives './src/**/*.ts' './tests/**/*.ts'",
45
45
  "lint:package": "npm run build:dist && publint ./dist && attw --pack ./dist --profile esm-only",
46
46
  "lint:secrets": "secretlint '**/*'",
47
- "license:check": "license-checker-rseidelsohn --onlyAllow \"MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;LGPL-3.0-or-later;Python-2.0;BlueOak-1.0.0;CC-BY-3.0;CC0-1.0;0BSD;LGPL-3.0-only;WTFPL;Artistic-2.0;Unlicense\"",
47
+ "license:check": "license-checker-rseidelsohn --onlyAllow \"MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;LGPL-3.0-or-later;LGPL-3.0-only;Python-2.0;BlueOak-1.0.0;CC-BY-3.0;CC-BY-4.0;CC0-1.0;0BSD;WTFPL;Artistic-2.0;Unlicense\"",
48
48
  "docs": "typedoc --out docs/_build ./src/index.ts",
49
49
  "docs:dist": "typedoc --out docs/_build ./src/index.ts && cp -r ./docs/code_samples ./docs/_build/",
50
50
  "prepare": "husky"
@@ -73,17 +73,15 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@arethetypeswrong/cli": "^0.18.5",
76
- "eslint": "^10.8.1",
77
- "@eslint/eslintrc": "^3.3.5",
78
76
  "@eslint/js": "^10.0.1",
79
- "eslint-plugin-jsdoc": "^62.7.1",
80
- "eslint-plugin-security": "^4.0.1",
81
- "eslint-plugin-sonarjs": "^4.2.0",
82
77
  "@secretlint/secretlint-rule-preset-recommend": "^13.0.4",
83
78
  "@types/node": "^20.19.37",
84
79
  "@types/tmp": "^0.2.6",
85
- "@typescript-eslint/eslint-plugin": "^8.57.0",
86
- "@typescript-eslint/parser": "^8.58.1",
80
+ "eslint": "^10.8.1",
81
+ "eslint-plugin-jsdoc": "^62.7.1",
82
+ "eslint-plugin-security": "^4.0.1",
83
+ "eslint-plugin-sonarjs": "^4.2.0",
84
+ "eslint-plugin-unicorn": "^75.0.0",
87
85
  "globals": "^17.4.0",
88
86
  "husky": "^9.1.7",
89
87
  "license-checker-rseidelsohn": "^4.4.2",
@@ -93,7 +91,8 @@
93
91
  "tslib": "^2.8.1",
94
92
  "tsx": "^4.21.0",
95
93
  "typedoc": "^0.28.18",
96
- "typescript": "^5.9.3"
94
+ "typescript": "^6.0.3",
95
+ "typescript-eslint": "^8.70.0"
97
96
  },
98
97
  "keywords": [
99
98
  "typescript",
@@ -1,14 +1,26 @@
1
- /** A simple bounding box defined by 4 coordinates: xMin, yMin, xMax, yMax */
1
+ /**
2
+ * A simple bounding box defined by 4 coordinates: xMin, yMin, xMax, yMax
3
+ */
2
4
  export declare class BBox {
3
- /** Minimum X coordinate. */
5
+ /**
6
+ * Minimum X coordinate.
7
+ */
4
8
  xMin: number;
5
- /** Minimum Y coordinate. */
9
+ /**
10
+ * Minimum Y coordinate.
11
+ */
6
12
  yMin: number;
7
- /** Maximum X coordinate. */
13
+ /**
14
+ * Maximum X coordinate.
15
+ */
8
16
  xMax: number;
9
- /** Maximum Y coordinate. */
17
+ /**
18
+ * Maximum Y coordinate.
19
+ */
10
20
  yMax: number;
11
21
  constructor(xMin: number, yMin: number, xMax: number, yMax: number);
12
- /** Returns a bounding box that contains this box and another one. */
22
+ /**
23
+ * Returns a bounding box that contains this box and another one.
24
+ */
13
25
  mergeBbox(bbox: BBox): BBox;
14
26
  }
@@ -1,5 +1,7 @@
1
1
  import { mergeBbox } from "./boundingBoxUtils.js";
2
- /** A simple bounding box defined by 4 coordinates: xMin, yMin, xMax, yMax */
2
+ /**
3
+ * A simple bounding box defined by 4 coordinates: xMin, yMin, xMax, yMax
4
+ */
3
5
  export class BBox {
4
6
  constructor(xMin, yMin, xMax, yMax) {
5
7
  this.xMin = xMin;
@@ -7,7 +9,9 @@ export class BBox {
7
9
  this.xMax = xMax;
8
10
  this.yMax = yMax;
9
11
  }
10
- /** Returns a bounding box that contains this box and another one. */
12
+ /**
13
+ * Returns a bounding box that contains this box and another one.
14
+ */
11
15
  mergeBbox(bbox) {
12
16
  return mergeBbox(this, bbox);
13
17
  }
@@ -1,6 +1,8 @@
1
1
  import { Point } from "./point.js";
2
2
  import { Polygon } from "./polygon.js";
3
- /** A bounding box defined by 4 points. */
3
+ /**
4
+ * A bounding box defined by 4 points.
5
+ */
4
6
  export declare class BoundingBox extends Polygon {
5
7
  constructor(topLeft: Point, topRight: Point, bottomRight: Point, bottomLeft: Point);
6
8
  }
@@ -1,5 +1,7 @@
1
1
  import { Polygon } from "./polygon.js";
2
- /** A bounding box defined by 4 points. */
2
+ /**
3
+ * A bounding box defined by 4 points.
4
+ */
3
5
  export class BoundingBox extends Polygon {
4
6
  constructor(topLeft, topRight, bottomRight, bottomLeft) {
5
7
  super(topLeft, topRight, bottomRight, bottomLeft);
@@ -1,10 +1,6 @@
1
1
  import { BoundingBox } from "./boundingBox.js";
2
2
  import { BBox } from "./bbox.js";
3
3
  import { Polygon } from "./polygon.js";
4
- /**
5
- * Given a Polygon, calculate a polygon that encompasses all points.
6
- */
7
- export declare function getBoundingBox(polygon: Polygon): BoundingBox;
8
4
  /**
9
5
  * Given a BBox, generate the associated bounding box.
10
6
  */
@@ -21,3 +17,7 @@ export declare function getBbox(polygon: Polygon): BBox;
21
17
  * Given polygons, calculate a BBox that encompasses all points.
22
18
  */
23
19
  export declare function getBBoxForPolygons(polygons: Polygon[]): BBox;
20
+ /**
21
+ * Given a Polygon, calculate a polygon that encompasses all points.
22
+ */
23
+ export declare function getBoundingBox(polygon: Polygon): BoundingBox;
@@ -1,12 +1,5 @@
1
1
  import { BoundingBox } from "./boundingBox.js";
2
2
  import { BBox } from "./bbox.js";
3
- /**
4
- * Given a Polygon, calculate a polygon that encompasses all points.
5
- */
6
- export function getBoundingBox(polygon) {
7
- const bbox = getBbox(polygon);
8
- return getBoundingBoxFromBBox(bbox);
9
- }
10
3
  /**
11
4
  * Given a BBox, generate the associated bounding box.
12
5
  */
@@ -35,3 +28,10 @@ export function getBBoxForPolygons(polygons) {
35
28
  const allX = polygons.flatMap((polygon) => polygon.map((point) => point[0]));
36
29
  return new BBox(Math.min(...allX), Math.min(...allY), Math.max(...allX), Math.max(...allY));
37
30
  }
31
+ /**
32
+ * Given a Polygon, calculate a polygon that encompasses all points.
33
+ */
34
+ export function getBoundingBox(polygon) {
35
+ const bbox = getBbox(polygon);
36
+ return getBoundingBoxFromBBox(bbox);
37
+ }
@@ -1,7 +1,13 @@
1
- /** Numeric range boundaries. */
1
+ /**
2
+ * Numeric range boundaries.
3
+ */
2
4
  export type MinMax = {
3
- /** Lower bound. */
5
+ /**
6
+ * Lower bound.
7
+ */
4
8
  min: number;
5
- /** Upper bound. */
9
+ /**
10
+ * Upper bound.
11
+ */
6
12
  max: number;
7
13
  };
@@ -1,2 +1,4 @@
1
- /** A point on the document defined by 2 coordinates: X, Y */
1
+ /**
2
+ * A point on the document defined by 2 coordinates: X, Y
3
+ */
2
4
  export type Point = [number, number];
@@ -1,6 +1,8 @@
1
1
  import { Point } from "./point.js";
2
2
  import { MinMax } from "./minMax.js";
3
- /** A polygon, composed of several Points. */
3
+ /**
4
+ * A polygon, composed of several Points.
5
+ */
4
6
  export declare class Polygon extends Array<Point> {
5
7
  constructor(...args: Point[]);
6
8
  /**
@@ -1,5 +1,7 @@
1
1
  import { getCentroid, getMinMaxX, getMinMaxY, isPointInX, isPointInY } from "./polygonUtils.js";
2
- /** A polygon, composed of several Points. */
2
+ /**
3
+ * A polygon, composed of several Points.
4
+ */
3
5
  export class Polygon extends Array {
4
6
  constructor(...args) {
5
7
  super(...args);
@@ -1,5 +1,5 @@
1
- import { logger } from "../logger.js";
2
1
  import { request } from "undici";
2
+ import { logger } from "../logger.js";
3
3
  export const TIMEOUT_SECS_DEFAULT = 120;
4
4
  /**
5
5
  * Reads a response from the API and processes it.
@@ -4,16 +4,26 @@ export interface MindeeApiConstructorProps {
4
4
  dispatcher?: Dispatcher;
5
5
  }
6
6
  export declare abstract class BaseSettings {
7
- /** API key used for authenticated requests. */
7
+ /**
8
+ * API key used for authenticated requests.
9
+ */
8
10
  apiKey: string;
9
- /** API hostname used for requests. */
11
+ /**
12
+ * API hostname used for requests.
13
+ */
10
14
  hostname: string;
11
- /** Request timeout in seconds. */
15
+ /**
16
+ * Request timeout in seconds.
17
+ */
12
18
  timeoutSecs: number;
13
- /** HTTP dispatcher used by undici. */
19
+ /**
20
+ * HTTP dispatcher used by undici.
21
+ */
14
22
  dispatcher: Dispatcher;
15
23
  protected constructor(apiKey?: string, dispatcher?: Dispatcher);
16
- /** Builds a default user-agent string for outgoing requests. */
24
+ /**
25
+ * Builds a default user-agent string for outgoing requests.
26
+ */
17
27
  protected getUserAgent(): string;
18
28
  protected abstract apiKeyFromEnv(): string;
19
29
  protected abstract hostnameFromEnv(): string;
@@ -1,6 +1,6 @@
1
+ import * as os from "node:os";
1
2
  // eslint-disable-next-line no-restricted-imports
2
3
  import packageJson from "../../package.json" with { type: "json" };
3
- import * as os from "os";
4
4
  import { TIMEOUT_SECS_DEFAULT } from "./apiCore.js";
5
5
  import { resolveDefaultDispatcher } from "./dispatcher.js";
6
6
  export class BaseSettings {
@@ -17,7 +17,9 @@ export class BaseSettings {
17
17
  ? parseInt(process.env.MINDEE_REQUEST_TIMEOUT)
18
18
  : TIMEOUT_SECS_DEFAULT;
19
19
  }
20
- /** Builds a default user-agent string for outgoing requests. */
20
+ /**
21
+ * Builds a default user-agent string for outgoing requests.
22
+ */
21
23
  getUserAgent() {
22
24
  let platform = os.type().toLowerCase();
23
25
  if (platform.includes("darwin")) {
@@ -1,6 +1,8 @@
1
1
  import { Agent, Dispatcher, getGlobalDispatcher } from "undici";
2
2
  import { logger } from "../logger.js";
3
- /** Library-owned fallback dispatcher, shared across all components. */
3
+ /**
4
+ * Library-owned fallback dispatcher, shared across all components.
5
+ */
4
6
  let fallbackDispatcher;
5
7
  /**
6
8
  * Returns the global undici dispatcher, provided it was created by the same
@@ -12,6 +14,6 @@ export function resolveDefaultDispatcher() {
12
14
  return globalDispatcher;
13
15
  }
14
16
  logger.debug("Global dispatcher belongs to a different undici instance, using a library-owned Agent instead.");
15
- fallbackDispatcher ?? (fallbackDispatcher = new Agent());
17
+ fallbackDispatcher ??= new Agent();
16
18
  return fallbackDispatcher;
17
19
  }
@@ -4,13 +4,21 @@ import { BufferInput } from "../input/index.js";
4
4
  * Generic class for image extraction.
5
5
  */
6
6
  export declare class ExtractedImage {
7
- /** Raw file bytes for the extracted image artifact. */
7
+ /**
8
+ * Raw file bytes for the extracted image artifact.
9
+ */
8
10
  buffer: Buffer;
9
- /** Filename used when exporting the extracted image. */
11
+ /**
12
+ * Filename used when exporting the extracted image.
13
+ */
10
14
  filename: string;
11
- /** 1-based source page identifier. */
15
+ /**
16
+ * 1-based source page identifier.
17
+ */
12
18
  readonly pageId: number;
13
- /** Identifier of the extracted element on the page. */
19
+ /**
20
+ * Identifier of the extracted element on the page.
21
+ */
14
22
  readonly elementId: number;
15
23
  constructor(buffer: Uint8Array, fileName: string, pageId: number, elementId: number);
16
24
  /**
@@ -20,7 +28,7 @@ export declare class ExtractedImage {
20
28
  */
21
29
  saveToFileAsync(outputPath: string): Promise<void>;
22
30
  /**
23
- * Attempts to saves the document to a file synchronously.
31
+ * Attempts to save the document to a file synchronously.
24
32
  * Throws an error if the file extension is not supported or if the file could not be saved to disk for some reason.
25
33
  *
26
34
  * @param outputPath Path to save the file to.
@@ -1,8 +1,8 @@
1
1
  import { Buffer } from "node:buffer";
2
- import { MindeeError } from "../errors/index.js";
3
2
  import { writeFileSync } from "node:fs";
4
- import { writeFile } from "fs/promises";
3
+ import { writeFile } from "node:fs/promises";
5
4
  import path from "node:path";
5
+ import { MindeeError } from "../errors/index.js";
6
6
  import { BufferInput, MIMETYPES } from "../input/index.js";
7
7
  import { logger } from "../logger.js";
8
8
  import { loadOptionalDependency } from "../dependency/index.js";
@@ -62,7 +62,7 @@ export class ExtractedImage {
62
62
  }
63
63
  }
64
64
  /**
65
- * Attempts to saves the document to a file synchronously.
65
+ * Attempts to save the document to a file synchronously.
66
66
  * Throws an error if the file extension is not supported or if the file could not be saved to disk for some reason.
67
67
  *
68
68
  * @param outputPath Path to save the file to.
@@ -1,5 +1,7 @@
1
1
  import { ExtractedImage } from "./index.js";
2
- /** Collection of extracted image artifacts. */
2
+ /**
3
+ * Collection of extracted image artifacts.
4
+ */
3
5
  export declare class ExtractedImages extends Array<ExtractedImage> {
4
6
  constructor(...items: ExtractedImage[]);
5
7
  }
@@ -1,4 +1,6 @@
1
- /** Collection of extracted image artifacts. */
1
+ /**
2
+ * Collection of extracted image artifacts.
3
+ */
2
4
  export class ExtractedImages extends Array {
3
5
  constructor(...items) {
4
6
  super(...items);
@@ -1,3 +1,4 @@
1
+ import { Buffer } from "node:buffer";
1
2
  /**
2
3
  * Compresses an image with the given parameters.
3
4
  *
@@ -16,8 +16,8 @@ export async function compressImage(imageBuffer, quality = 85, maxWidth = null,
16
16
  if (metadata.width === undefined || metadata.height === undefined) {
17
17
  throw new MindeeImageError("Source image has invalid dimensions.");
18
18
  }
19
- maxWidth ?? (maxWidth = metadata.width);
20
- maxHeight ?? (maxHeight = metadata.height);
19
+ maxWidth ??= metadata.width;
20
+ maxHeight ??= metadata.height;
21
21
  if (maxWidth || maxHeight) {
22
22
  sharpImage = sharpImage.resize({
23
23
  width: maxWidth,
@@ -1,7 +1,7 @@
1
+ import type * as pdfLibTypes from "@cantoo/pdf-lib";
1
2
  import { Polygon } from "../geometry/index.js";
2
3
  import { ExtractedImages } from "./extractedImages.js";
3
4
  import { LocalInputSource } from "../input/index.js";
4
- import type * as pdfLibTypes from "@cantoo/pdf-lib";
5
5
  /**
6
6
  * Extracts elements from a PDF document based on a list of bounding boxes.
7
7
  * @param inputSource The input source to extract from.
@@ -39,7 +39,7 @@ export async function extractImagesFromPolygon(inputSource, polygonsPerPage, qua
39
39
  /**
40
40
  * Helper function to handle the drawing math and orientation.
41
41
  */
42
- function drawOrientedPage(pdfLib, samplePage, cropped, orientation, finalWidth, finalHeight, scaledWidth, scaledHeight) {
42
+ function drawOrientedPage(currentPdfLib, samplePage, cropped, orientation, finalWidth, finalHeight, scaledWidth, scaledHeight) {
43
43
  if (orientation === 0) {
44
44
  samplePage.drawPage(cropped, {
45
45
  width: scaledWidth,
@@ -52,7 +52,7 @@ function drawOrientedPage(pdfLib, samplePage, cropped, orientation, finalWidth,
52
52
  y: finalHeight,
53
53
  width: scaledWidth,
54
54
  height: scaledHeight,
55
- rotate: pdfLib.degrees(270),
55
+ rotate: currentPdfLib.degrees(270),
56
56
  });
57
57
  }
58
58
  else if (orientation === 180) {
@@ -61,7 +61,7 @@ function drawOrientedPage(pdfLib, samplePage, cropped, orientation, finalWidth,
61
61
  y: finalHeight,
62
62
  width: scaledWidth,
63
63
  height: scaledHeight,
64
- rotate: pdfLib.degrees(180),
64
+ rotate: currentPdfLib.degrees(180),
65
65
  });
66
66
  }
67
67
  else if (orientation === 270) {
@@ -70,7 +70,7 @@ function drawOrientedPage(pdfLib, samplePage, cropped, orientation, finalWidth,
70
70
  y: 0,
71
71
  width: scaledWidth,
72
72
  height: scaledHeight,
73
- rotate: pdfLib.degrees(90),
73
+ rotate: currentPdfLib.degrees(90),
74
74
  });
75
75
  }
76
76
  }
@@ -82,7 +82,7 @@ function drawOrientedPage(pdfLib, samplePage, cropped, orientation, finalWidth,
82
82
  * @param quality The quality of the extracted images.
83
83
  */
84
84
  export async function extractFromPage(pdfPage, polygons, asImage = false, quality) {
85
- const pdfLib = await getPdfLib();
85
+ const currentPdfLib = await getPdfLib();
86
86
  const { width, height } = pdfPage.getSize();
87
87
  const extractedElements = [];
88
88
  if (quality !== undefined) {
@@ -100,15 +100,15 @@ export async function extractFromPage(pdfPage, polygons, asImage = false, qualit
100
100
  const pageIndex = sourceDoc.getPages().indexOf(pdfPage);
101
101
  for (const origPolygon of polygons) {
102
102
  logger.debug(`Extracting image with polygon: ${origPolygon.toString()}`);
103
- const tempPdf = await pdfLib.PDFDocument.create();
103
+ const tempPdf = await currentPdfLib.PDFDocument.create();
104
104
  const [copiedPage] = await tempPdf.copyPages(sourceDoc, [pageIndex]);
105
105
  const polygon = adjustForRotation(origPolygon, orientation);
106
106
  const minX = getMinMaxX(polygon).min;
107
107
  const maxX = getMinMaxX(polygon).max;
108
108
  const minY = getMinMaxY(polygon).min;
109
109
  const maxY = getMinMaxY(polygon).max;
110
- const newWidth = width * (maxX - minX);
111
- const newHeight = height * (maxY - minY);
110
+ const imgWidth = width * (maxX - minX);
111
+ const imgHeight = height * (maxY - minY);
112
112
  const cropped = await tempPdf.embedPage(copiedPage, {
113
113
  left: minX * width,
114
114
  right: maxX * width,
@@ -116,13 +116,13 @@ export async function extractFromPage(pdfPage, polygons, asImage = false, qualit
116
116
  bottom: height - (maxY * height),
117
117
  });
118
118
  const isVertical = orientation === 90 || orientation === 270;
119
- const finalWidth = (isVertical ? newHeight : newWidth) * qualityScale;
120
- const finalHeight = (isVertical ? newWidth : newHeight) * qualityScale;
119
+ const finalWidth = (isVertical ? imgHeight : imgWidth) * qualityScale;
120
+ const finalHeight = (isVertical ? imgWidth : imgHeight) * qualityScale;
121
121
  const samplePage = tempPdf.addPage([finalWidth, finalHeight]);
122
122
  samplePage.drawRectangle({
123
- x: 0, y: 0, width: finalWidth, height: finalHeight, color: pdfLib.rgb(1, 1, 1),
123
+ x: 0, y: 0, width: finalWidth, height: finalHeight, color: currentPdfLib.rgb(1, 1, 1),
124
124
  });
125
- drawOrientedPage(pdfLib, samplePage, cropped, orientation, finalWidth, finalHeight, newWidth * qualityScale, newHeight * qualityScale);
125
+ drawOrientedPage(currentPdfLib, samplePage, cropped, orientation, finalWidth, finalHeight, imgWidth * qualityScale, imgHeight * qualityScale);
126
126
  const pdfBuffer = Buffer.from(await tempPdf.save());
127
127
  extractedElements.push(asImage ? await rasterizePage(pdfBuffer, 0, 100) : pdfBuffer);
128
128
  }
@@ -3,13 +3,19 @@ interface Base64InputProps {
3
3
  inputString: string;
4
4
  filename: string;
5
5
  }
6
- /** Local input source backed by a base64-encoded payload. */
6
+ /**
7
+ * Local input source backed by a base64-encoded payload.
8
+ */
7
9
  export declare class Base64Input extends LocalInputSource {
8
10
  private inputString;
9
- /** Decoded binary payload built from the base64 input. */
11
+ /**
12
+ * Decoded binary payload built from the base64 input.
13
+ */
10
14
  fileObject: Buffer;
11
15
  constructor({ inputString, filename }: Base64InputProps);
12
- /** Decodes and validates the provided base64 content. */
16
+ /**
17
+ * Decodes and validates the provided base64 content.
18
+ */
13
19
  init(): Promise<void>;
14
20
  }
15
21
  export {};
@@ -1,18 +1,24 @@
1
1
  import { LocalInputSource } from "./localInputSource.js";
2
2
  import { INPUT_TYPE_BASE64 } from "./inputSource.js";
3
3
  import { logger } from "../logger.js";
4
- /** Local input source backed by a base64-encoded payload. */
4
+ /**
5
+ * Local input source backed by a base64-encoded payload.
6
+ */
5
7
  export class Base64Input extends LocalInputSource {
6
8
  constructor({ inputString, filename }) {
7
9
  super({
8
10
  inputType: INPUT_TYPE_BASE64,
9
11
  });
10
- /** Decoded binary payload built from the base64 input. */
12
+ /**
13
+ * Decoded binary payload built from the base64 input.
14
+ */
11
15
  this.fileObject = Buffer.alloc(0);
12
16
  this.filename = filename;
13
17
  this.inputString = inputString;
14
18
  }
15
- /** Decodes and validates the provided base64 content. */
19
+ /**
20
+ * Decodes and validates the provided base64 content.
21
+ */
16
22
  async init() {
17
23
  if (this.initialized) {
18
24
  return;
@@ -1,12 +1,17 @@
1
+ import { Buffer } from "node:buffer";
1
2
  import { LocalInputSource } from "./localInputSource.js";
2
3
  interface BufferInputProps {
3
4
  buffer: Buffer;
4
5
  filename: string;
5
6
  }
6
- /** Local input source backed by an in-memory `Buffer`. */
7
+ /**
8
+ * Local input source backed by an in-memory `Buffer`.
9
+ */
7
10
  export declare class BufferInput extends LocalInputSource {
8
11
  constructor({ buffer, filename }: BufferInputProps);
9
- /** Validates and initializes the in-memory buffer input. */
12
+ /**
13
+ * Validates and initializes the in-memory buffer input.
14
+ */
10
15
  init(): Promise<void>;
11
16
  }
12
17
  export {};
@@ -1,7 +1,9 @@
1
1
  import { LocalInputSource } from "./localInputSource.js";
2
2
  import { INPUT_TYPE_BUFFER } from "./inputSource.js";
3
3
  import { logger } from "../logger.js";
4
- /** Local input source backed by an in-memory `Buffer`. */
4
+ /**
5
+ * Local input source backed by an in-memory `Buffer`.
6
+ */
5
7
  export class BufferInput extends LocalInputSource {
6
8
  constructor({ buffer, filename }) {
7
9
  super({
@@ -10,7 +12,9 @@ export class BufferInput extends LocalInputSource {
10
12
  this.fileObject = buffer;
11
13
  this.filename = filename;
12
14
  }
13
- /** Validates and initializes the in-memory buffer input. */
15
+ /**
16
+ * Validates and initializes the in-memory buffer input.
17
+ */
14
18
  async init() {
15
19
  if (this.initialized) {
16
20
  return;
@@ -1,15 +1,22 @@
1
+ import { Buffer } from "node:buffer";
1
2
  import { LocalInputSource } from "./localInputSource.js";
2
3
  interface BytesInputProps {
3
4
  inputBytes: Uint8Array;
4
5
  filename: string;
5
6
  }
6
- /** Local input source backed by a `Uint8Array`. */
7
+ /**
8
+ * Local input source backed by a `Uint8Array`.
9
+ */
7
10
  export declare class BytesInput extends LocalInputSource {
8
11
  private inputBytes;
9
- /** Binary payload built from the byte array. */
12
+ /**
13
+ * Binary payload built from the byte array.
14
+ */
10
15
  fileObject: Buffer;
11
16
  constructor({ inputBytes, filename }: BytesInputProps);
12
- /** Converts bytes to a buffer and validates MIME type. */
17
+ /**
18
+ * Converts bytes to a buffer and validates MIME type.
19
+ */
13
20
  init(): Promise<void>;
14
21
  }
15
22
  export {};
@@ -1,18 +1,25 @@
1
+ import { Buffer } from "node:buffer";
1
2
  import { INPUT_TYPE_BYTES } from "./inputSource.js";
2
3
  import { LocalInputSource } from "./localInputSource.js";
3
4
  import { logger } from "../logger.js";
4
- /** Local input source backed by a `Uint8Array`. */
5
+ /**
6
+ * Local input source backed by a `Uint8Array`.
7
+ */
5
8
  export class BytesInput extends LocalInputSource {
6
9
  constructor({ inputBytes, filename }) {
7
10
  super({
8
11
  inputType: INPUT_TYPE_BYTES,
9
12
  });
10
- /** Binary payload built from the byte array. */
13
+ /**
14
+ * Binary payload built from the byte array.
15
+ */
11
16
  this.fileObject = Buffer.alloc(0);
12
17
  this.filename = filename;
13
18
  this.inputBytes = inputBytes;
14
19
  }
15
- /** Converts bytes to a buffer and validates MIME type. */
20
+ /**
21
+ * Converts bytes to a buffer and validates MIME type.
22
+ */
16
23
  async init() {
17
24
  if (this.initialized) {
18
25
  return;