mindee 3.20.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +23 -0
- data/README.md +25 -44
- data/Steepfile +31 -0
- data/bin/mindee.rb +30 -62
- data/docs/advanced_file_operations.md +111 -0
- data/docs/code_samples/bank_account_details_v1.txt +5 -0
- data/docs/code_samples/bank_account_details_v2.txt +5 -0
- data/docs/code_samples/bank_check_v1.txt +5 -0
- data/docs/code_samples/bank_statement_fr_v2_async.txt +6 -1
- data/docs/code_samples/barcode_reader_v1.txt +5 -0
- data/docs/code_samples/bill_of_lading_v1_async.txt +6 -1
- data/docs/code_samples/business_card_v1_async.txt +6 -1
- data/docs/code_samples/carte_grise_v1.txt +5 -0
- data/docs/code_samples/cropper_v1.txt +5 -0
- data/docs/code_samples/default.txt +8 -2
- data/docs/code_samples/default_async.txt +7 -2
- data/docs/code_samples/delivery_notes_v1_async.txt +6 -1
- data/docs/code_samples/driver_license_v1_async.txt +6 -1
- data/docs/code_samples/energy_bill_fra_v1_async.txt +6 -1
- data/docs/code_samples/expense_receipts_v5.txt +7 -1
- data/docs/code_samples/expense_receipts_v5_async.txt +6 -1
- data/docs/code_samples/financial_document_v1.txt +7 -1
- data/docs/code_samples/financial_document_v1_async.txt +6 -1
- data/docs/code_samples/french_healthcard_v1_async.txt +6 -1
- data/docs/code_samples/idcard_fr_v1.txt +5 -0
- data/docs/code_samples/idcard_fr_v2.txt +5 -0
- data/docs/code_samples/ind_passport_v1_async.txt +6 -1
- data/docs/code_samples/international_id_v2_async.txt +6 -1
- data/docs/code_samples/invoice_splitter_v1_async.txt +6 -1
- data/docs/code_samples/invoices_v4.txt +7 -1
- data/docs/code_samples/invoices_v4_async.txt +6 -1
- data/docs/code_samples/license_plates_v1.txt +5 -0
- data/docs/code_samples/multi_receipts_detector_v1.txt +5 -0
- data/docs/code_samples/nutrition_facts_v1_async.txt +6 -1
- data/docs/code_samples/passport_v1.txt +5 -0
- data/docs/code_samples/payslip_fra_v2_async.txt +6 -1
- data/docs/code_samples/payslip_fra_v3_async.txt +6 -1
- data/docs/code_samples/resume_v1_async.txt +6 -1
- data/docs/code_samples/us_healthcare_cards_v1_async.txt +6 -1
- data/docs/code_samples/us_mail_v3_async.txt +6 -1
- data/docs/code_samples/us_w9_v1.txt +5 -0
- data/docs/getting_started.md +50 -118
- data/docs/{barcode_reader_v1.md → global_products/barcode_reader_v1.md} +26 -9
- data/docs/{bill_of_lading_v1.md → global_products/bill_of_lading_v1.md} +62 -37
- data/docs/{business_card_v1.md → global_products/business_card_v1.md} +35 -10
- data/docs/{cropper_v1.md → global_products/cropper_v1.md} +32 -13
- data/docs/{delivery_notes_v1.md → global_products/delivery_notes_v1.md} +35 -10
- data/docs/{driver_license_v1.md → global_products/driver_license_v1.md} +35 -10
- data/docs/{expense_receipts_v5.md → global_products/expense_receipts_v5.md} +57 -21
- data/docs/{financial_document_v1.md → global_products/financial_document_v1.md} +65 -28
- data/docs/{international_id_v2.md → global_products/international_id_v2.md} +39 -13
- data/docs/{invoice_splitter_v1.md → global_products/invoice_splitter_v1.md} +25 -6
- data/docs/{invoices_v4.md → global_products/invoices_v4.md} +65 -28
- data/docs/{multi_receipts_detector_v1.md → global_products/multi_receipts_detector_v1.md} +32 -13
- data/docs/{nutrition_facts_v1.md → global_products/nutrition_facts_v1.md} +103 -78
- data/docs/{passport_v1.md → global_products/passport_v1.md} +26 -9
- data/docs/{resume_v1.md → global_products/resume_v1.md} +72 -46
- data/docs/{generated_v1.md → global_products/universal.md} +39 -19
- data/docs/global_products.md +6 -0
- data/docs/loading_a_document.md +316 -0
- data/docs/{bank_account_details_v2.md → localized_products/bank_account_details_v2.md} +24 -7
- data/docs/{bank_check_v1.md → localized_products/bank_check_v1.md} +37 -18
- data/docs/{bank_statement_fr_v2.md → localized_products/bank_statement_fr_v2.md} +37 -12
- data/docs/{carte_grise_v1.md → localized_products/carte_grise_v1.md} +25 -8
- data/docs/{energy_bill_fra_v1.md → localized_products/energy_bill_fra_v1.md} +70 -45
- data/docs/{french_healthcard_v1.md → localized_products/french_healthcard_v1.md} +36 -11
- data/docs/{idcard_fr_v2.md → localized_products/idcard_fr_v2.md} +34 -16
- data/docs/{ind_passport_v1.md → localized_products/ind_passport_v1.md} +37 -11
- data/docs/{license_plates_v1.md → localized_products/license_plates_v1.md} +25 -8
- data/docs/{payslip_fra_v3.md → localized_products/payslip_fra_v3.md} +80 -55
- data/docs/{us_healthcare_cards_v1.md → localized_products/us_healthcare_cards_v1.md} +37 -12
- data/docs/{us_mail_v3.md → localized_products/us_mail_v3.md} +49 -24
- data/docs/{us_w9_v1.md → localized_products/us_w9_v1.md} +64 -45
- data/docs/localized_products.md +6 -0
- data/examples/auto_invoice_splitter_extraction.rb +5 -5
- data/examples/auto_multi_receipts_detector_extraction.rb +4 -5
- data/lib/mindee/client.rb +354 -209
- data/lib/mindee/errors/mindee_error.rb +17 -0
- data/lib/mindee/errors/mindee_http_error.rb +36 -0
- data/lib/mindee/errors/mindee_input_error.rb +30 -0
- data/lib/mindee/errors.rb +5 -0
- data/lib/mindee/extraction/multi_receipts_extractor.rb +28 -1
- data/lib/mindee/extraction.rb +0 -3
- data/lib/mindee/geometry/polygon.rb +1 -1
- data/lib/mindee/geometry/utils.rb +1 -1
- data/lib/mindee/http/endpoint.rb +48 -40
- data/lib/mindee/http/{error.rb → http_error_handler.rb} +5 -35
- data/lib/mindee/http/response_validation.rb +2 -2
- data/lib/mindee/http/workflow_endpoint.rb +12 -12
- data/lib/mindee/http.rb +1 -1
- data/lib/mindee/{extraction/common → image}/extracted_image.rb +22 -18
- data/lib/mindee/{extraction/common → image}/image_extractor.rb +20 -78
- data/lib/mindee/image/image_utils.rb +68 -7
- data/lib/mindee/image.rb +2 -0
- data/lib/mindee/input/local_response.rb +8 -8
- data/lib/mindee/input/sources/base64_input_source.rb +6 -6
- data/lib/mindee/input/sources/bytes_input_source.rb +3 -3
- data/lib/mindee/input/sources/file_input_source.rb +3 -3
- data/lib/mindee/input/sources/local_input_source.rb +43 -41
- data/lib/mindee/input/sources/path_input_source.rb +3 -3
- data/lib/mindee/input/sources/url_input_source.rb +11 -8
- data/lib/mindee/logging/logger.rb +16 -0
- data/lib/mindee/logging.rb +3 -0
- data/lib/mindee/parsing/common/api_request.rb +36 -0
- data/lib/mindee/parsing/common/api_response.rb +6 -96
- data/lib/mindee/parsing/common/document.rb +12 -8
- data/lib/mindee/parsing/common/execution.rb +4 -2
- data/lib/mindee/parsing/common/execution_priority.rb +6 -0
- data/lib/mindee/parsing/common/extras/cropper_extra.rb +2 -1
- data/lib/mindee/parsing/common/extras/extras.rb +9 -4
- data/lib/mindee/parsing/common/extras/full_text_ocr_extra.rb +1 -0
- data/lib/mindee/parsing/common/inference.rb +23 -4
- data/lib/mindee/parsing/common/job.rb +46 -0
- data/lib/mindee/parsing/common/ocr/mvision_v1.rb +6 -6
- data/lib/mindee/parsing/common/ocr/ocr.rb +29 -29
- data/lib/mindee/parsing/common/page.rb +5 -3
- data/lib/mindee/parsing/common/prediction.rb +2 -0
- data/lib/mindee/parsing/common/workflow_response.rb +28 -0
- data/lib/mindee/parsing/common.rb +3 -0
- data/lib/mindee/parsing/standard/abstract_field.rb +72 -0
- data/lib/mindee/parsing/standard/amount_field.rb +2 -2
- data/lib/mindee/parsing/standard/base_field.rb +5 -84
- data/lib/mindee/parsing/standard/boolean_field.rb +4 -3
- data/lib/mindee/parsing/standard/classification_field.rb +1 -1
- data/lib/mindee/parsing/standard/company_registration_field.rb +7 -2
- data/lib/mindee/parsing/standard/date_field.rb +2 -2
- data/lib/mindee/parsing/standard/feature_field.rb +24 -0
- data/lib/mindee/parsing/standard/payment_details_field.rb +2 -2
- data/lib/mindee/parsing/standard/position_field.rb +3 -1
- data/lib/mindee/parsing/standard/string_field.rb +1 -1
- data/lib/mindee/parsing/standard/tax_field.rb +1 -1
- data/lib/mindee/parsing/standard.rb +1 -0
- data/lib/mindee/parsing/{generated/generated_list_field.rb → universal/universal_list_field.rb} +12 -12
- data/lib/mindee/parsing/{generated/generated_object_field.rb → universal/universal_object_field.rb} +23 -14
- data/lib/mindee/parsing/universal.rb +4 -0
- data/lib/mindee/parsing.rb +1 -2
- data/lib/mindee/{extraction/pdf_extractor → pdf}/extracted_pdf.rb +15 -12
- data/lib/mindee/pdf/pdf_compressor.rb +12 -10
- data/lib/mindee/{extraction/pdf_extractor → pdf}/pdf_extractor.rb +20 -17
- data/lib/mindee/pdf/pdf_processor.rb +12 -22
- data/lib/mindee/pdf/pdf_tools.rb +52 -6
- data/lib/mindee/pdf.rb +2 -0
- data/lib/mindee/product/.rubocop.yml +3 -0
- data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +9 -3
- data/lib/mindee/product/barcode_reader/barcode_reader_v1_document.rb +5 -5
- data/lib/mindee/product/barcode_reader/barcode_reader_v1_page.rb +9 -5
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1.rb +9 -3
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb +1 -1
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +13 -7
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rb +62 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb +1 -1
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_document.rb +44 -17
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +1 -1
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb +9 -5
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb +1 -1
- data/lib/mindee/product/business_card/business_card_v1.rb +9 -3
- data/lib/mindee/product/business_card/business_card_v1_document.rb +40 -13
- data/lib/mindee/product/business_card/business_card_v1_page.rb +9 -5
- data/lib/mindee/product/cropper/cropper_v1.rb +10 -4
- data/lib/mindee/product/cropper/cropper_v1_page.rb +11 -7
- data/lib/mindee/product/delivery_note/delivery_note_v1.rb +9 -3
- data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +29 -8
- data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +9 -5
- data/lib/mindee/product/driver_license/driver_license_v1.rb +9 -3
- data/lib/mindee/product/driver_license/driver_license_v1_document.rb +44 -14
- data/lib/mindee/product/driver_license/driver_license_v1_page.rb +9 -5
- data/lib/mindee/product/eu/license_plate/license_plate_v1.rb +9 -3
- data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +3 -3
- data/lib/mindee/product/eu/license_plate/license_plate_v1_page.rb +9 -5
- data/lib/mindee/product/financial_document/financial_document_v1.rb +9 -3
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +110 -42
- data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +21 -11
- data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +62 -0
- data/lib/mindee/product/financial_document/financial_document_v1_page.rb +9 -5
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1.rb +9 -3
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rb +7 -4
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rb +9 -5
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +9 -3
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rb +1 -1
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rb +11 -5
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rb +9 -5
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2.rb +9 -3
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_document.rb +52 -20
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_page.rb +9 -5
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rb +5 -3
- data/lib/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rb +54 -0
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +9 -3
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +51 -42
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1_page.rb +9 -5
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1.rb +9 -3
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +56 -30
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +13 -7
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +65 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +9 -5
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb +13 -7
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rb +65 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +13 -7
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rb +65 -0
- data/lib/mindee/product/fr/health_card/health_card_v1.rb +9 -3
- data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +15 -6
- data/lib/mindee/product/fr/health_card/health_card_v1_page.rb +9 -5
- data/lib/mindee/product/fr/id_card/id_card_v1.rb +9 -3
- data/lib/mindee/product/fr/id_card/id_card_v1_document.rb +33 -12
- data/lib/mindee/product/fr/id_card/id_card_v1_page.rb +14 -7
- data/lib/mindee/product/fr/id_card/id_card_v2.rb +9 -3
- data/lib/mindee/product/fr/id_card/id_card_v2_document.rb +50 -17
- data/lib/mindee/product/fr/id_card/id_card_v2_page.rb +18 -8
- data/lib/mindee/product/fr/payslip/payslip_v2.rb +9 -3
- data/lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_document.rb +29 -14
- data/lib/mindee/product/fr/payslip/payslip_v2_employee.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_employer.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_employment.rb +3 -2
- data/lib/mindee/product/fr/payslip/payslip_v2_page.rb +9 -5
- data/lib/mindee/product/fr/payslip/payslip_v2_pay_detail.rb +33 -11
- data/lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v2_pto.rb +13 -4
- data/lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb +13 -7
- data/lib/mindee/product/fr/payslip/payslip_v2_salary_details.rb +63 -0
- data/lib/mindee/product/fr/payslip/payslip_v3.rb +9 -3
- data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +31 -19
- data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +9 -5
- data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +13 -7
- data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rb +65 -0
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +33 -11
- data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +1 -1
- data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +17 -9
- data/lib/mindee/product/fr/payslip/payslip_v3_salary_details.rb +65 -0
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1.rb +9 -3
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +87 -24
- data/lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb +9 -5
- data/lib/mindee/product/international_id/international_id_v2.rb +9 -3
- data/lib/mindee/product/international_id/international_id_v2_document.rb +62 -20
- data/lib/mindee/product/international_id/international_id_v2_page.rb +9 -5
- data/lib/mindee/product/invoice/invoice_v4.rb +9 -3
- data/lib/mindee/product/invoice/invoice_v4_document.rb +90 -36
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +21 -11
- data/lib/mindee/product/invoice/invoice_v4_line_items.rb +62 -0
- data/lib/mindee/product/invoice/invoice_v4_page.rb +9 -5
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +8 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +2 -2
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +1 -1
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +9 -3
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rb +3 -3
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rb +9 -5
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rb +9 -3
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +58 -20
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +13 -7
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rb +68 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +9 -5
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +3 -2
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +7 -4
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +7 -4
- data/lib/mindee/product/passport/passport_v1.rb +9 -3
- data/lib/mindee/product/passport/passport_v1_document.rb +37 -13
- data/lib/mindee/product/passport/passport_v1_page.rb +9 -5
- data/lib/mindee/product/receipt/receipt_v5.rb +9 -3
- data/lib/mindee/product/receipt/receipt_v5_document.rb +54 -24
- data/lib/mindee/product/receipt/receipt_v5_line_item.rb +13 -7
- data/lib/mindee/product/receipt/receipt_v5_line_items.rb +54 -0
- data/lib/mindee/product/receipt/receipt_v5_page.rb +9 -5
- data/lib/mindee/product/resume/resume_v1.rb +9 -3
- data/lib/mindee/product/resume/resume_v1_certificate.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_certificates.rb +58 -0
- data/lib/mindee/product/resume/resume_v1_document.rb +60 -47
- data/lib/mindee/product/resume/resume_v1_education.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_educations.rb +64 -0
- data/lib/mindee/product/resume/resume_v1_language.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_languages.rb +54 -0
- data/lib/mindee/product/resume/resume_v1_page.rb +9 -5
- data/lib/mindee/product/resume/resume_v1_professional_experience.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_professional_experiences.rb +68 -0
- data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +1 -1
- data/lib/mindee/product/resume/resume_v1_social_networks_urls.rb +54 -0
- data/lib/mindee/product/universal/universal.rb +46 -0
- data/lib/mindee/product/universal/universal_document.rb +32 -0
- data/lib/mindee/product/{generated/generated_v1_page.rb → universal/universal_page.rb} +14 -14
- data/lib/mindee/product/{generated/generated_v1_prediction.rb → universal/universal_prediction.rb} +32 -24
- data/lib/mindee/product/us/bank_check/bank_check_v1.rb +9 -3
- data/lib/mindee/product/us/bank_check/bank_check_v1_document.rb +20 -8
- data/lib/mindee/product/us/bank_check/bank_check_v1_page.rb +15 -8
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1.rb +9 -3
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +5 -3
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rb +52 -0
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +46 -19
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +9 -5
- data/lib/mindee/product/us/us_mail/us_mail_v3.rb +9 -3
- data/lib/mindee/product/us/us_mail/us_mail_v3_document.rb +20 -12
- data/lib/mindee/product/us/us_mail/us_mail_v3_page.rb +9 -5
- data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_address.rb +2 -2
- data/lib/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rb +65 -0
- data/lib/mindee/product/us/us_mail/us_mail_v3_sender_address.rb +1 -1
- data/lib/mindee/product/us/w9/w9_v1.rb +10 -4
- data/lib/mindee/product/us/w9/w9_v1_page.rb +49 -18
- data/lib/mindee/product.rb +1 -8
- data/lib/mindee/version.rb +2 -2
- data/lib/mindee.rb +22 -9
- data/mindee.gemspec +19 -17
- data/sig/custom/marcel.rbs +3 -0
- data/sig/custom/mini_magick.rbs +24 -0
- data/sig/custom/net_http.rbs +34 -0
- data/sig/custom/origami.rbs +54 -0
- data/sig/mindee/client.rbs +63 -0
- data/sig/mindee/errors/mindee_error.rbs +13 -0
- data/sig/mindee/errors/mindee_http_error.rbs +16 -0
- data/sig/mindee/errors/mindee_input_error.rbs +17 -0
- data/sig/mindee/extraction/multi_receipts_extractor.rbs +6 -0
- data/sig/mindee/geometry/min_max.rbs +10 -0
- data/sig/mindee/geometry/point.rbs +13 -0
- data/sig/mindee/geometry/polygon.rbs +9 -0
- data/sig/mindee/geometry/quadrilateral.rbs +18 -0
- data/sig/mindee/geometry/utils.rbs +13 -0
- data/sig/mindee/http/endpoint.rbs +26 -0
- data/sig/mindee/http/http_error_handler.rbs +10 -0
- data/sig/mindee/http/response_validation.rbs +10 -0
- data/sig/mindee/http/workflow_endpoint.rbs +14 -0
- data/sig/mindee/image/extracted_image.rbs +15 -0
- data/sig/mindee/image/image_compressor.rbs +8 -0
- data/sig/mindee/image/image_extractor.rbs +13 -0
- data/sig/mindee/image/image_utils.rbs +19 -0
- data/sig/mindee/input/local_response.rbs +13 -0
- data/sig/mindee/input/sources/base64_input_source.rbs +11 -0
- data/sig/mindee/input/sources/bytes_input_source.rbs +10 -0
- data/sig/mindee/input/sources/file_input_source.rbs +10 -0
- data/sig/mindee/input/sources/local_input_source.rbs +24 -0
- data/sig/mindee/input/sources/path_input_source.rbs +10 -0
- data/sig/mindee/input/sources/url_input_source.rbs +20 -0
- data/sig/mindee/logging/logger.rbs +9 -0
- data/sig/mindee/parsing/common/api_request.rbs +15 -0
- data/sig/mindee/parsing/common/api_response.rbs +27 -0
- data/sig/mindee/parsing/common/document.rbs +20 -0
- data/sig/mindee/parsing/common/execution.rbs +23 -0
- data/sig/mindee/parsing/common/execution_file.rbs +12 -0
- data/sig/mindee/parsing/common/execution_priority.rbs +13 -0
- data/sig/mindee/parsing/common/extras/cropper_extra.rbs +14 -0
- data/sig/mindee/parsing/common/extras/extras.rbs +18 -0
- data/sig/mindee/parsing/common/extras/full_text_ocr_extra.rbs +15 -0
- data/sig/mindee/parsing/common/inference.rbs +19 -0
- data/sig/mindee/parsing/common/job.rbs +16 -0
- data/sig/mindee/parsing/common/ocr/mvision_v1.rbs +15 -0
- data/sig/mindee/parsing/common/ocr/ocr.rbs +39 -0
- data/sig/mindee/parsing/common/orientation.rbs +12 -0
- data/sig/mindee/parsing/common/page.rbs +15 -0
- data/sig/mindee/parsing/common/prediction.rbs +11 -0
- data/sig/mindee/parsing/common/product.rbs +13 -0
- data/sig/mindee/parsing/common/workflow_response.rbs +13 -0
- data/sig/mindee/parsing/standard/abstract_field.rbs +19 -0
- data/sig/mindee/parsing/standard/amount_field.rbs +12 -0
- data/sig/mindee/parsing/standard/base_field.rbs +12 -0
- data/sig/mindee/parsing/standard/boolean_field.rbs +12 -0
- data/sig/mindee/parsing/standard/classification_field.rbs +10 -0
- data/sig/mindee/parsing/standard/company_registration_field.rbs +14 -0
- data/sig/mindee/parsing/standard/date_field.rbs +14 -0
- data/sig/mindee/parsing/standard/feature_field.rbs +10 -0
- data/sig/mindee/parsing/standard/locale_field.rbs +16 -0
- data/sig/mindee/parsing/standard/payment_details_field.rbs +15 -0
- data/sig/mindee/parsing/standard/position_field.rbs +17 -0
- data/sig/mindee/parsing/standard/string_field.rbs +12 -0
- data/sig/mindee/parsing/standard/tax_field.rbs +23 -0
- data/sig/mindee/parsing/universal/universal_list_field.rbs +17 -0
- data/sig/mindee/parsing/universal/universal_object_field.rbs +23 -0
- data/sig/mindee/pdf/extracted_pdf.rbs +15 -0
- data/sig/mindee/pdf/pdf_compressor.rbs +15 -0
- data/sig/mindee/pdf/pdf_extractor.rbs +16 -0
- data/sig/mindee/pdf/pdf_processor.rbs +12 -0
- data/sig/mindee/pdf/pdf_tools.rbs +23 -0
- data/sig/mindee/product/barcode_reader/barcode_reader_v1.rbs +11 -0
- data/sig/mindee/product/barcode_reader/barcode_reader_v1_document.rbs +14 -0
- data/sig/mindee/product/barcode_reader/barcode_reader_v1_page.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1.rbs +11 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rbs +14 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rbs +19 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +13 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_document.rbs +25 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_page.rbs +15 -0
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rbs +15 -0
- data/sig/mindee/product/business_card/business_card_v1.rbs +11 -0
- data/sig/mindee/product/business_card/business_card_v1_document.rbs +23 -0
- data/sig/mindee/product/business_card/business_card_v1_page.rbs +15 -0
- data/sig/mindee/product/cropper/cropper_v1.rbs +11 -0
- data/sig/mindee/product/cropper/cropper_v1_document.rbs +12 -0
- data/sig/mindee/product/cropper/cropper_v1_page.rbs +16 -0
- data/sig/mindee/product/delivery_note/delivery_note_v1.rbs +11 -0
- data/sig/mindee/product/delivery_note/delivery_note_v1_document.rbs +19 -0
- data/sig/mindee/product/delivery_note/delivery_note_v1_page.rbs +15 -0
- data/sig/mindee/product/driver_license/driver_license_v1.rbs +11 -0
- data/sig/mindee/product/driver_license/driver_license_v1_document.rbs +25 -0
- data/sig/mindee/product/driver_license/driver_license_v1_page.rbs +15 -0
- data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +13 -0
- data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +15 -0
- data/sig/mindee/product/eu/license_plate/license_plate_v1_page.rbs +17 -0
- data/sig/mindee/product/financial_document/financial_document_v1.rbs +11 -0
- data/sig/mindee/product/financial_document/financial_document_v1_document.rbs +46 -0
- data/sig/mindee/product/financial_document/financial_document_v1_line_item.rbs +21 -0
- data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +13 -0
- data/sig/mindee/product/financial_document/financial_document_v1_page.rbs +15 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1.rbs +13 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1_document.rbs +17 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2.rbs +13 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rbs +17 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_document.rbs +18 -0
- data/sig/mindee/product/fr/bank_account_details/bank_account_details_v2_page.rbs +17 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2.rbs +13 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_document.rbs +29 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_page.rbs +17 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transaction.rbs +18 -0
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +15 -0
- data/sig/mindee/product/fr/carte_grise/carte_grise_v1.rbs +13 -0
- data/sig/mindee/product/fr/carte_grise/carte_grise_v1_document.rbs +55 -0
- data/sig/mindee/product/fr/carte_grise/carte_grise_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1.rbs +13 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_document.rbs +34 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +21 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rbs +16 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rbs +21 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +15 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rbs +21 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +15 -0
- data/sig/mindee/product/fr/health_card/health_card_v1.rbs +13 -0
- data/sig/mindee/product/fr/health_card/health_card_v1_document.rbs +18 -0
- data/sig/mindee/product/fr/health_card/health_card_v1_page.rbs +17 -0
- data/sig/mindee/product/fr/id_card/id_card_v1.rbs +13 -0
- data/sig/mindee/product/fr/id_card/id_card_v1_document.rbs +24 -0
- data/sig/mindee/product/fr/id_card/id_card_v1_page.rbs +18 -0
- data/sig/mindee/product/fr/id_card/id_card_v2.rbs +13 -0
- data/sig/mindee/product/fr/id_card/id_card_v2_document.rbs +29 -0
- data/sig/mindee/product/fr/id_card/id_card_v2_page.rbs +19 -0
- data/sig/mindee/product/fr/payslip/payslip_v2.rbs +13 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rbs +16 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_document.rbs +24 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_employee.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_employer.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_employment.rbs +19 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_page.rbs +17 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_pay_detail.rbs +23 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_pay_period.rbs +18 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_pto.rbs +16 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_detail.rbs +19 -0
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +15 -0
- data/sig/mindee/product/fr/payslip/payslip_v3.rbs +13 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rbs +16 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_document.rbs +26 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_employee.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_employer.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_employment.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_page.rbs +17 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_off.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +15 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_pay_detail.rbs +23 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_pay_period.rbs +18 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_detail.rbs +20 -0
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +15 -0
- data/sig/mindee/product/ind/indian_passport/indian_passport_v1.rbs +13 -0
- data/sig/mindee/product/ind/indian_passport/indian_passport_v1_document.rbs +37 -0
- data/sig/mindee/product/ind/indian_passport/indian_passport_v1_page.rbs +17 -0
- data/sig/mindee/product/international_id/international_id_v2.rbs +11 -0
- data/sig/mindee/product/international_id/international_id_v2_document.rbs +29 -0
- data/sig/mindee/product/international_id/international_id_v2_page.rbs +15 -0
- data/sig/mindee/product/invoice/invoice_v4.rbs +11 -0
- data/sig/mindee/product/invoice/invoice_v4_document.rbs +40 -0
- data/sig/mindee/product/invoice/invoice_v4_line_item.rbs +21 -0
- data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +13 -0
- data/sig/mindee/product/invoice/invoice_v4_page.rbs +15 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +14 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +19 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +13 -0
- data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rbs +11 -0
- data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_document.rbs +13 -0
- data/sig/mindee/product/multi_receipts_detector/multi_receipts_detector_v1_page.rbs +15 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rbs +11 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rbs +28 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rbs +18 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +13 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rbs +15 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rbs +13 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rbs +15 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rbs +14 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rbs +14 -0
- data/sig/mindee/product/passport/passport_v1.rbs +11 -0
- data/sig/mindee/product/passport/passport_v1_document.rbs +23 -0
- data/sig/mindee/product/passport/passport_v1_page.rbs +15 -0
- data/sig/mindee/product/receipt/receipt_v5.rbs +11 -0
- data/sig/mindee/product/receipt/receipt_v5_document.rbs +31 -0
- data/sig/mindee/product/receipt/receipt_v5_line_item.rbs +17 -0
- data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +13 -0
- data/sig/mindee/product/receipt/receipt_v5_page.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1.rbs +11 -0
- data/sig/mindee/product/resume/resume_v1_certificate.rbs +17 -0
- data/sig/mindee/product/resume/resume_v1_certificates.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_document.rbs +39 -0
- data/sig/mindee/product/resume/resume_v1_education.rbs +20 -0
- data/sig/mindee/product/resume/resume_v1_educations.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_language.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1_languages.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_page.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1_professional_experience.rbs +22 -0
- data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +13 -0
- data/sig/mindee/product/resume/resume_v1_social_networks_url.rbs +15 -0
- data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +13 -0
- data/sig/mindee/product/universal/universal.rbs +14 -0
- data/sig/mindee/product/universal/universal_document.rbs +10 -0
- data/sig/mindee/product/universal/universal_page.rbs +14 -0
- data/sig/mindee/product/universal/universal_prediction.rbs +19 -0
- data/sig/mindee/product/us/bank_check/bank_check_v1.rbs +13 -0
- data/sig/mindee/product/us/bank_check/bank_check_v1_document.rbs +20 -0
- data/sig/mindee/product/us/bank_check/bank_check_v1_page.rbs +19 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1.rbs +13 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rbs +17 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +15 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_document.rbs +28 -0
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_page.rbs +17 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3.rbs +13 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_document.rbs +21 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_page.rbs +17 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_address.rbs +23 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +15 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_sender_address.rbs +18 -0
- data/sig/mindee/product/us/w9/w9_v1.rbs +13 -0
- data/sig/mindee/product/us/w9/w9_v1_document.rbs +14 -0
- data/sig/mindee/product/us/w9/w9_v1_page.rbs +29 -0
- data/sig/mindee/version.rbs +6 -0
- data/sig/mindee.rbs +59 -0
- metadata +390 -104
- data/docs/bank_statement_fr_v1.md +0 -178
- data/docs/code_samples/bank_statement_fr_v1_async.txt +0 -19
- data/docs/code_samples/custom_v1.txt +0 -33
- data/docs/code_samples/eu_driver_license_v1.txt +0 -19
- data/docs/code_samples/expense_receipts_v4.txt +0 -19
- data/docs/code_samples/proof_of_address_v1.txt +0 -19
- data/docs/code_samples/us_driver_license_v1.txt +0 -19
- data/docs/code_samples/us_mail_v2_async.txt +0 -19
- data/docs/code_samples/workflow_execution.txt +0 -29
- data/docs/custom_v1.md +0 -111
- data/docs/payslip_fra_v2.md +0 -294
- data/lib/mindee/extraction/common.rb +0 -4
- data/lib/mindee/extraction/multi_receipts_extractor/multi_receipts_extractor.rb +0 -32
- data/lib/mindee/extraction/pdf_extractor.rb +0 -4
- data/lib/mindee/extraction/tax_extractor/ocr_extractor.rb +0 -110
- data/lib/mindee/extraction/tax_extractor/tax_extractor.rb +0 -338
- data/lib/mindee/extraction/tax_extractor.rb +0 -3
- data/lib/mindee/parsing/custom/classification_field.rb +0 -28
- data/lib/mindee/parsing/custom/list_field.rb +0 -78
- data/lib/mindee/parsing/custom.rb +0 -4
- data/lib/mindee/parsing/generated.rb +0 -4
- data/lib/mindee/product/custom/custom_v1.rb +0 -36
- data/lib/mindee/product/custom/custom_v1_document.rb +0 -60
- data/lib/mindee/product/custom/custom_v1_page.rb +0 -32
- data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +0 -41
- data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +0 -88
- data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +0 -53
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1.rb +0 -41
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb +0 -130
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_page.rb +0 -34
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_transaction.rb +0 -64
- data/lib/mindee/product/generated/generated_v1.rb +0 -38
- data/lib/mindee/product/generated/generated_v1_document.rb +0 -35
- data/lib/mindee/product/proof_of_address/proof_of_address_v1.rb +0 -39
- data/lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb +0 -83
- data/lib/mindee/product/proof_of_address/proof_of_address_v1_page.rb +0 -32
- data/lib/mindee/product/receipt/receipt_v4.rb +0 -36
- data/lib/mindee/product/receipt/receipt_v4_document.rb +0 -86
- data/lib/mindee/product/receipt/receipt_v4_page.rb +0 -32
- data/lib/mindee/product/us/driver_license/driver_license_v1.rb +0 -41
- data/lib/mindee/product/us/driver_license/driver_license_v1_document.rb +0 -113
- data/lib/mindee/product/us/driver_license/driver_license_v1_page.rb +0 -53
- data/lib/mindee/product/us/us_mail/us_mail_v2.rb +0 -41
- data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +0 -100
- data/lib/mindee/product/us/us_mail/us_mail_v2_page.rb +0 -34
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +0 -105
- data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +0 -66
|
@@ -13,16 +13,16 @@ module Mindee
|
|
|
13
13
|
class W9V1 < Mindee::Parsing::Common::Inference
|
|
14
14
|
@endpoint_name = 'us_w9'
|
|
15
15
|
@endpoint_version = '1'
|
|
16
|
+
@has_async = false
|
|
17
|
+
@has_sync = true
|
|
16
18
|
|
|
17
19
|
# @param prediction [Hash]
|
|
18
20
|
def initialize(prediction)
|
|
19
21
|
super
|
|
20
|
-
@prediction = W9V1Document.new
|
|
22
|
+
@prediction = W9V1Document.new(prediction['prediction'], nil)
|
|
21
23
|
@pages = []
|
|
22
24
|
prediction['pages'].each do |page|
|
|
23
|
-
|
|
24
|
-
@pages.push(W9V1Page.new(page))
|
|
25
|
-
end
|
|
25
|
+
@pages.push(W9V1Page.new(page))
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -33,6 +33,12 @@ module Mindee
|
|
|
33
33
|
# Version for this product.
|
|
34
34
|
# @return [String]
|
|
35
35
|
attr_reader :endpoint_version
|
|
36
|
+
# Whether this product has access to an asynchronous endpoint.
|
|
37
|
+
# @return [bool]
|
|
38
|
+
attr_reader :has_async
|
|
39
|
+
# Whether this product has access to synchronous endpoint.
|
|
40
|
+
# @return [bool]
|
|
41
|
+
attr_reader :has_sync
|
|
36
42
|
end
|
|
37
43
|
end
|
|
38
44
|
end
|
|
@@ -11,11 +11,15 @@ module Mindee
|
|
|
11
11
|
class W9V1Page < Mindee::Parsing::Common::Page
|
|
12
12
|
# @param prediction [Hash]
|
|
13
13
|
def initialize(prediction)
|
|
14
|
-
super
|
|
15
|
-
@prediction =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
super
|
|
15
|
+
@prediction = if prediction['prediction'].empty?
|
|
16
|
+
nil
|
|
17
|
+
else
|
|
18
|
+
W9V1PagePrediction.new(
|
|
19
|
+
prediction['prediction'],
|
|
20
|
+
prediction['id']
|
|
21
|
+
)
|
|
22
|
+
end
|
|
19
23
|
end
|
|
20
24
|
end
|
|
21
25
|
|
|
@@ -63,19 +67,46 @@ module Mindee
|
|
|
63
67
|
# @param prediction [Hash]
|
|
64
68
|
# @param page_id [Integer, nil]
|
|
65
69
|
def initialize(prediction, page_id)
|
|
66
|
-
@address = StringField.new(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
@
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
@
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
@address = Parsing::Standard::StringField.new(
|
|
71
|
+
prediction['address'],
|
|
72
|
+
page_id
|
|
73
|
+
)
|
|
74
|
+
@business_name = Parsing::Standard::StringField.new(
|
|
75
|
+
prediction['business_name'],
|
|
76
|
+
page_id
|
|
77
|
+
)
|
|
78
|
+
@city_state_zip = Parsing::Standard::StringField.new(
|
|
79
|
+
prediction['city_state_zip'],
|
|
80
|
+
page_id
|
|
81
|
+
)
|
|
82
|
+
@ein = Parsing::Standard::StringField.new(prediction['ein'], page_id)
|
|
83
|
+
@name = Parsing::Standard::StringField.new(prediction['name'], page_id)
|
|
84
|
+
@signature_date_position = Parsing::Standard::PositionField.new(
|
|
85
|
+
prediction['signature_date_position'],
|
|
86
|
+
page_id
|
|
87
|
+
)
|
|
88
|
+
@signature_position = Parsing::Standard::PositionField.new(
|
|
89
|
+
prediction['signature_position'],
|
|
90
|
+
page_id
|
|
91
|
+
)
|
|
92
|
+
@ssn = Parsing::Standard::StringField.new(prediction['ssn'], page_id)
|
|
93
|
+
@tax_classification = Parsing::Standard::StringField.new(
|
|
94
|
+
prediction['tax_classification'],
|
|
95
|
+
page_id
|
|
96
|
+
)
|
|
97
|
+
@tax_classification_llc = Parsing::Standard::StringField.new(
|
|
98
|
+
prediction['tax_classification_llc'],
|
|
99
|
+
page_id
|
|
100
|
+
)
|
|
101
|
+
@tax_classification_other_details = Parsing::Standard::StringField.new(
|
|
102
|
+
prediction['tax_classification_other_details'],
|
|
103
|
+
page_id
|
|
104
|
+
)
|
|
105
|
+
@w9_revision_date = Parsing::Standard::StringField.new(
|
|
106
|
+
prediction['w9_revision_date'],
|
|
107
|
+
page_id
|
|
108
|
+
)
|
|
109
|
+
super
|
|
79
110
|
end
|
|
80
111
|
|
|
81
112
|
# @return [String]
|
data/lib/mindee/product.rb
CHANGED
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
require_relative 'product/barcode_reader/barcode_reader_v1'
|
|
4
4
|
require_relative 'product/bill_of_lading/bill_of_lading_v1'
|
|
5
5
|
require_relative 'product/business_card/business_card_v1'
|
|
6
|
-
require_relative 'product/custom/custom_v1'
|
|
7
6
|
require_relative 'product/cropper/cropper_v1'
|
|
8
7
|
require_relative 'product/delivery_note/delivery_note_v1'
|
|
9
8
|
require_relative 'product/driver_license/driver_license_v1'
|
|
10
9
|
require_relative 'product/eu/license_plate/license_plate_v1'
|
|
11
|
-
require_relative 'product/eu/driver_license/driver_license_v1'
|
|
12
10
|
require_relative 'product/fr/bank_account_details/bank_account_details_v1'
|
|
13
11
|
require_relative 'product/fr/bank_account_details/bank_account_details_v2'
|
|
14
|
-
require_relative 'product/fr/bank_statement/bank_statement_v1'
|
|
15
12
|
require_relative 'product/fr/bank_statement/bank_statement_v2'
|
|
16
13
|
require_relative 'product/fr/carte_grise/carte_grise_v1'
|
|
17
14
|
require_relative 'product/fr/id_card/id_card_v1'
|
|
@@ -21,7 +18,6 @@ require_relative 'product/fr/health_card/health_card_v1'
|
|
|
21
18
|
require_relative 'product/fr/payslip/payslip_v2'
|
|
22
19
|
require_relative 'product/fr/payslip/payslip_v3'
|
|
23
20
|
require_relative 'product/financial_document/financial_document_v1'
|
|
24
|
-
require_relative 'product/generated/generated_v1'
|
|
25
21
|
require_relative 'product/ind/indian_passport/indian_passport_v1'
|
|
26
22
|
require_relative 'product/invoice/invoice_v4'
|
|
27
23
|
require_relative 'product/invoice_splitter/invoice_splitter_v1'
|
|
@@ -29,13 +25,10 @@ require_relative 'product/international_id/international_id_v2'
|
|
|
29
25
|
require_relative 'product/multi_receipts_detector/multi_receipts_detector_v1'
|
|
30
26
|
require_relative 'product/nutrition_facts_label/nutrition_facts_label_v1'
|
|
31
27
|
require_relative 'product/passport/passport_v1'
|
|
32
|
-
require_relative 'product/proof_of_address/proof_of_address_v1'
|
|
33
|
-
require_relative 'product/receipt/receipt_v4'
|
|
34
28
|
require_relative 'product/receipt/receipt_v5'
|
|
35
29
|
require_relative 'product/resume/resume_v1'
|
|
30
|
+
require_relative 'product/universal/universal'
|
|
36
31
|
require_relative 'product/us/bank_check/bank_check_v1'
|
|
37
|
-
require_relative 'product/us/driver_license/driver_license_v1'
|
|
38
32
|
require_relative 'product/us/healthcare_card/healthcare_card_v1'
|
|
39
|
-
require_relative 'product/us/us_mail/us_mail_v2'
|
|
40
33
|
require_relative 'product/us/us_mail/us_mail_v3'
|
|
41
34
|
require_relative 'product/us/w9/w9_v1'
|
data/lib/mindee/version.rb
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
# Mindee
|
|
4
4
|
module Mindee
|
|
5
5
|
# Current version.
|
|
6
|
-
VERSION = '
|
|
6
|
+
VERSION = '4.0.0'
|
|
7
7
|
|
|
8
8
|
# Finds and return the current platform.
|
|
9
|
-
# @return [String]
|
|
9
|
+
# @return [Symbol, Hash[Symbol | String, Regexp], Nil?]
|
|
10
10
|
def self.find_platform
|
|
11
11
|
host = RbConfig::CONFIG['host_os']
|
|
12
12
|
platforms = {
|
data/lib/mindee.rb
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'mindee/client'
|
|
4
|
-
require 'mindee/
|
|
4
|
+
require 'mindee/logging'
|
|
5
5
|
|
|
6
6
|
module Mindee
|
|
7
|
+
# Mindee internal error module.
|
|
8
|
+
module Errors
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Custom extraction module
|
|
12
|
+
module Extraction
|
|
13
|
+
end
|
|
14
|
+
|
|
7
15
|
# Mindee internal http module.
|
|
8
16
|
module HTTP
|
|
9
17
|
end
|
|
@@ -29,8 +37,8 @@ module Mindee
|
|
|
29
37
|
end
|
|
30
38
|
end
|
|
31
39
|
|
|
32
|
-
#
|
|
33
|
-
module
|
|
40
|
+
# Logging
|
|
41
|
+
module Logging
|
|
34
42
|
end
|
|
35
43
|
|
|
36
44
|
# Parsing internals and fields.
|
|
@@ -39,16 +47,12 @@ module Mindee
|
|
|
39
47
|
module Common
|
|
40
48
|
end
|
|
41
49
|
|
|
42
|
-
# Custom fields and functions.
|
|
43
|
-
module Custom
|
|
44
|
-
end
|
|
45
|
-
|
|
46
50
|
# Standard fields and functions.
|
|
47
51
|
module Standard
|
|
48
52
|
end
|
|
49
53
|
|
|
50
|
-
#
|
|
51
|
-
module
|
|
54
|
+
# Universal fields and functions.
|
|
55
|
+
module Universal
|
|
52
56
|
end
|
|
53
57
|
end
|
|
54
58
|
|
|
@@ -66,8 +70,17 @@ module Mindee
|
|
|
66
70
|
module FR
|
|
67
71
|
end
|
|
68
72
|
|
|
73
|
+
# Indian-specific products.
|
|
74
|
+
module IND
|
|
75
|
+
end
|
|
76
|
+
|
|
69
77
|
# US-specific products.
|
|
70
78
|
module US
|
|
71
79
|
end
|
|
72
80
|
end
|
|
73
81
|
end
|
|
82
|
+
|
|
83
|
+
# Shorthand to call the logger from anywhere.
|
|
84
|
+
def logger
|
|
85
|
+
Mindee::Logging.logger
|
|
86
|
+
end
|
data/mindee.gemspec
CHANGED
|
@@ -6,20 +6,18 @@ Gem::Specification.new do |spec|
|
|
|
6
6
|
spec.name = 'mindee'
|
|
7
7
|
spec.version = Mindee::VERSION
|
|
8
8
|
spec.authors = ['Mindee, SA']
|
|
9
|
-
spec.email = ['
|
|
9
|
+
spec.email = ['opensource@mindee.co']
|
|
10
10
|
|
|
11
11
|
spec.summary = 'Mindee API Helper Library for Ruby'
|
|
12
12
|
spec.description = "Quickly and easily connect to Mindee's API services using Ruby."
|
|
13
13
|
spec.homepage = 'https://github.com/mindee/mindee-api-ruby'
|
|
14
14
|
spec.license = 'MIT'
|
|
15
15
|
|
|
16
|
-
spec.metadata['homepage_uri']
|
|
17
|
-
spec.metadata['source_code_uri']
|
|
18
|
-
spec.metadata['changelog_uri']
|
|
16
|
+
spec.metadata['homepage_uri'] = 'https://mindee.com/'
|
|
17
|
+
spec.metadata['source_code_uri'] = 'https://github.com/mindee/mindee-api-ruby'
|
|
18
|
+
spec.metadata['changelog_uri'] = 'https://github.com/mindee/mindee-api-ruby/blob/main/CHANGELOG.md'
|
|
19
19
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
20
20
|
|
|
21
|
-
# Specify which files should be added to the gem when it is released.
|
|
22
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
23
21
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
24
22
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(.github|spec|features)/}) }
|
|
25
23
|
end
|
|
@@ -27,15 +25,19 @@ Gem::Specification.new do |spec|
|
|
|
27
25
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
28
26
|
spec.require_paths = ['lib']
|
|
29
27
|
|
|
30
|
-
spec.required_ruby_version = Gem::Requirement.new('>=
|
|
31
|
-
|
|
32
|
-
spec.
|
|
33
|
-
spec.
|
|
34
|
-
spec.
|
|
35
|
-
spec.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
spec.add_development_dependency '
|
|
39
|
-
spec.add_development_dependency '
|
|
40
|
-
spec.add_development_dependency '
|
|
28
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.0')
|
|
29
|
+
|
|
30
|
+
spec.add_dependency 'base64', '~> 0.1.0'
|
|
31
|
+
spec.add_dependency 'marcel', '~> 1.0.4'
|
|
32
|
+
spec.add_dependency 'mini_magick', '>= 4', '< 6'
|
|
33
|
+
spec.add_dependency 'origamindee', '~> 4.0.0'
|
|
34
|
+
spec.add_dependency 'pdf-reader', '~> 2.13.0'
|
|
35
|
+
|
|
36
|
+
spec.add_development_dependency 'prism', '~> 1.3'
|
|
37
|
+
spec.add_development_dependency 'rake', '~> 13.2.1'
|
|
38
|
+
spec.add_development_dependency 'rbs', '~> 3.6'
|
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.13.0'
|
|
40
|
+
spec.add_development_dependency 'rubocop', '~> 1.70.0'
|
|
41
|
+
spec.add_development_dependency 'steep', '~> 1.7.1'
|
|
42
|
+
spec.add_development_dependency 'yard', '~> 0.9.37'
|
|
41
43
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Stub for the mini_magick library.
|
|
2
|
+
module MiniMagick
|
|
3
|
+
class Image
|
|
4
|
+
def format: (String, ?Integer?, ?Hash[Symbol, untyped]?) -> Net::BufferedIO
|
|
5
|
+
def self.format: (String, ?Integer?, ?Hash[Symbol, untyped]?) -> Net::BufferedIO
|
|
6
|
+
def self.quality: (String) -> Net::BufferedIO
|
|
7
|
+
def self.crop: (String) -> Net::BufferedIO
|
|
8
|
+
def self.height: () -> Integer
|
|
9
|
+
def height: () -> Integer
|
|
10
|
+
def self.width: () -> Integer
|
|
11
|
+
def width: () -> Integer
|
|
12
|
+
def self.read: (untyped) -> self
|
|
13
|
+
def self.resolution: () -> Array[Float | Integer]
|
|
14
|
+
def self.write: (StringIO | String) -> Net::BufferedIO
|
|
15
|
+
def write: (StringIO | String) -> Net::BufferedIO
|
|
16
|
+
def quality: (Integer) -> void
|
|
17
|
+
def self.resize: (String) -> void
|
|
18
|
+
def resize: (String) -> void
|
|
19
|
+
def self.to_blob: () -> String
|
|
20
|
+
def to_blob: () -> String
|
|
21
|
+
def self.[]: (?untyped) -> untyped
|
|
22
|
+
def []: (?untyped) -> untyped
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This is a stub of mock type declarations for the net/http standard library, which isn't
|
|
2
|
+
# currently supported by Steep.
|
|
3
|
+
# Do not mess with it unless Steep fixes the handling of this library.
|
|
4
|
+
|
|
5
|
+
module Net
|
|
6
|
+
class BufferedIO
|
|
7
|
+
end
|
|
8
|
+
class HTTP
|
|
9
|
+
def self.start: [T] (String?, Integer?, use_ssl: bool?, ?read_timeout: Integer) { (HTTP) -> T } -> T
|
|
10
|
+
|
|
11
|
+
def request: (untyped) -> untyped
|
|
12
|
+
|
|
13
|
+
# Stub for the HTTP POST request class.
|
|
14
|
+
class Post
|
|
15
|
+
def initialize: (untyped, Hash[String, String]?) -> void
|
|
16
|
+
def set_form: (untyped, String?) -> void
|
|
17
|
+
def new: (untyped, untyped) -> void
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Stub for the HTTP GET request class.
|
|
21
|
+
class Get
|
|
22
|
+
def initialize: (untyped, ?Hash[String, String]?) -> void
|
|
23
|
+
def new: (untyped, untyped) -> void
|
|
24
|
+
def basic_auth: (untyped, untyped) -> void
|
|
25
|
+
def []=: (?untyped, ?untyped) -> bool
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class HTTPRedirection
|
|
30
|
+
def []: (untyped) -> untyped
|
|
31
|
+
def body: -> untyped
|
|
32
|
+
def code: -> String?
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Stubs for the origami library.
|
|
2
|
+
# This one _should_ exist, but it would take too long, so this is a stub.
|
|
3
|
+
module Origami
|
|
4
|
+
class Array
|
|
5
|
+
def each: { (untyped) -> untyped } -> untyped
|
|
6
|
+
end
|
|
7
|
+
class PDF
|
|
8
|
+
def self.read: (StringIO) -> untyped
|
|
9
|
+
def initialize: () -> void
|
|
10
|
+
def append_page: (Page) -> void
|
|
11
|
+
def delete_pages_at: (::Array[Integer]) -> void
|
|
12
|
+
def pages: () -> untyped
|
|
13
|
+
def save: (StringIO) -> void
|
|
14
|
+
def to_io_stream: -> StringIO
|
|
15
|
+
class LinearParser
|
|
16
|
+
def initialize: (Hash[Symbol, untyped]) -> void
|
|
17
|
+
def new: (Hash[Symbol, untyped]) -> void
|
|
18
|
+
def parse: (StringIO?) -> PDF
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class Page
|
|
23
|
+
def initialize: () -> void
|
|
24
|
+
def add_xobject: (Graphics::ImageXObject, String) -> untyped
|
|
25
|
+
def Contents: (?untyped?) -> untyped
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
module Graphics
|
|
29
|
+
class ImageXObject
|
|
30
|
+
def initialize: () -> void
|
|
31
|
+
|
|
32
|
+
def BitsPerComponent=: (Integer) -> untyped
|
|
33
|
+
def ColorSpace=: (Symbol) -> untyped
|
|
34
|
+
def data=: (StringIO) -> untyped
|
|
35
|
+
def self.from_image_file: (StringIO, String) -> untyped
|
|
36
|
+
def Height=: (Integer | Float) -> untyped
|
|
37
|
+
def Width=: (Integer | Float) -> untyped
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class InvalidPDFError < StandardError
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
class Parser
|
|
45
|
+
VERBOSE_QUIET: String
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class Stream
|
|
49
|
+
def initialize: (?String) -> untyped
|
|
50
|
+
def data : () -> untyped
|
|
51
|
+
def data= : (String | StringIO) -> void
|
|
52
|
+
def dictionary : -> Hash[Symbol, untyped]
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
OTS_OWNER: String
|
|
2
|
+
|
|
3
|
+
module Mindee
|
|
4
|
+
OTS_OWNER: String
|
|
5
|
+
|
|
6
|
+
class PageOptions
|
|
7
|
+
attr_accessor page_indexes: Array[Integer]
|
|
8
|
+
attr_accessor operation: :KEEP_ONLY | :REMOVE
|
|
9
|
+
attr_accessor on_min_pages: Integer?
|
|
10
|
+
|
|
11
|
+
def initialize: (params: Hash[Symbol | String, untyped]) -> void
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class ParseOptions
|
|
15
|
+
attr_accessor all_words: bool
|
|
16
|
+
attr_accessor full_text: bool
|
|
17
|
+
attr_accessor close_file: bool
|
|
18
|
+
attr_accessor page_options: PageOptions
|
|
19
|
+
attr_accessor cropper: bool
|
|
20
|
+
attr_accessor initial_delay_sec: Integer | Float
|
|
21
|
+
attr_accessor delay_sec: Integer | Float
|
|
22
|
+
attr_accessor max_retries: Integer
|
|
23
|
+
|
|
24
|
+
def initialize: (params: Hash[Symbol | String, untyped]) -> void
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
class WorkflowOptions
|
|
28
|
+
attr_accessor document_alias: (String?)
|
|
29
|
+
attr_accessor priority: (Symbol?)
|
|
30
|
+
attr_accessor full_text: bool
|
|
31
|
+
attr_accessor public_url: (String?)
|
|
32
|
+
attr_accessor page_options: (PageOptions)
|
|
33
|
+
|
|
34
|
+
def initialize: (params: Hash[Symbol | String, untyped]) -> void
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class Client
|
|
38
|
+
def initialize: (api_key: String) -> void
|
|
39
|
+
def logger: () -> untyped
|
|
40
|
+
def parse: (Input::Source::LocalInputSource | Input::Source::URLInputSource, untyped, ?endpoint: (HTTP::Endpoint?), options: ParseOptions | Hash[Symbol | String, untyped]) -> Parsing::Common::ApiResponse
|
|
41
|
+
def parse_sync: (Input::Source::LocalInputSource | Input::Source::URLInputSource, untyped, HTTP::Endpoint, ParseOptions) -> Parsing::Common::ApiResponse
|
|
42
|
+
def enqueue: (Input::Source::LocalInputSource | Input::Source::URLInputSource, untyped, ?endpoint: (HTTP::Endpoint?), options: ParseOptions|Hash[Symbol | String, untyped]) -> Parsing::Common::ApiResponse
|
|
43
|
+
def parse_queued: (String, singleton(Parsing::Common::Inference), ?endpoint: HTTP::Endpoint?) -> Parsing::Common::ApiResponse
|
|
44
|
+
def enqueue_and_parse: (Input::Source::URLInputSource|Input::Source::LocalInputSource, untyped, HTTP::Endpoint, ParseOptions) -> Parsing::Common::ApiResponse
|
|
45
|
+
def execute_workflow: (Input::Source::URLInputSource|Input::Source::LocalInputSource, String, options: (Hash[Symbol | String, untyped] | WorkflowOptions)) -> Parsing::Common::WorkflowResponse
|
|
46
|
+
def load_prediction: (singleton(Parsing::Common::Inference), Input::LocalResponse) -> Parsing::Common::ApiResponse
|
|
47
|
+
def source_from_path: (String, ?repair_pdf: bool) -> Input::Source::PathInputSource
|
|
48
|
+
def source_from_bytes: (String, String, ?repair_pdf: bool) -> Input::Source::BytesInputSource
|
|
49
|
+
def source_from_b64string: (String, String, ?repair_pdf: bool) -> Input::Source::Base64InputSource
|
|
50
|
+
def source_from_file: (File, String, ?repair_pdf: bool) -> Input::Source::FileInputSource
|
|
51
|
+
def source_from_url: (String) -> Input::Source::URLInputSource
|
|
52
|
+
def create_endpoint: (endpoint_name: String, account_name: String, version: String) -> HTTP::Endpoint
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
def normalize_parse_options: ((Hash[Symbol | String, untyped] | ParseOptions)) -> ParseOptions
|
|
56
|
+
def process_pdf_if_required: (Input::Source::LocalInputSource, ParseOptions | WorkflowOptions) -> void
|
|
57
|
+
def initialize_endpoint: (singleton(Parsing::Common::Inference), ?endpoint_name: String, ?account_name: String, ?version: String) -> HTTP::Endpoint
|
|
58
|
+
def validate_async_params: (Integer | Float, Integer | Float, Integer) -> void
|
|
59
|
+
def fix_endpoint_name: (singleton(Parsing::Common::Inference), String?) -> String?
|
|
60
|
+
def fix_account_name: (String) -> String
|
|
61
|
+
def fix_version: (singleton(Parsing::Common::Inference), String) -> String
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# lib/mindee/errors/mindee_error.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module Errors
|
|
4
|
+
class MindeeError < StandardError
|
|
5
|
+
end
|
|
6
|
+
class MindeeAPIError < MindeeError
|
|
7
|
+
end
|
|
8
|
+
class MindeeConfigurationError < MindeeError
|
|
9
|
+
end
|
|
10
|
+
class MindeeGeometryError < MindeeError
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# lib/mindee/errors/mindee_http_error.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module Errors
|
|
4
|
+
class MindeeHTTPError < Errors::MindeeError
|
|
5
|
+
def status_code: -> untyped
|
|
6
|
+
def api_code: -> untyped
|
|
7
|
+
def api_details: -> untyped
|
|
8
|
+
def api_message: -> untyped
|
|
9
|
+
def initialize: (untyped, untyped, untyped) -> untyped
|
|
10
|
+
end
|
|
11
|
+
class MindeeHTTPClientError < MindeeHTTPError
|
|
12
|
+
end
|
|
13
|
+
class MindeeHTTPServerError < MindeeHTTPError
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# lib/mindee/errors/mindee_input_error.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module Errors
|
|
4
|
+
class MindeeInputError < MindeeError
|
|
5
|
+
end
|
|
6
|
+
class MindeeSourceError < MindeeInputError
|
|
7
|
+
end
|
|
8
|
+
class MindeeMimeTypeError < MindeeSourceError
|
|
9
|
+
def invalid_mimetype: -> untyped
|
|
10
|
+
def initialize: (untyped) -> untyped
|
|
11
|
+
end
|
|
12
|
+
class MindeeImageError < MindeeInputError
|
|
13
|
+
end
|
|
14
|
+
class MindeePDFError < MindeeInputError
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# lib/mindee/geometry/point.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module Geometry
|
|
4
|
+
class Point
|
|
5
|
+
def x: -> untyped
|
|
6
|
+
def x=: (untyped) -> untyped
|
|
7
|
+
def y: -> untyped
|
|
8
|
+
def y=: (untyped) -> untyped
|
|
9
|
+
def initialize: (untyped, untyped) -> untyped
|
|
10
|
+
def []: (untyped) -> bot
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# lib/mindee/geometry/quadrilateral.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module Geometry
|
|
4
|
+
class Quadrilateral
|
|
5
|
+
def top_left: -> Point
|
|
6
|
+
def top_left=: (Point) -> bool
|
|
7
|
+
def top_right: -> Point
|
|
8
|
+
def top_right=: (Point) -> untyped
|
|
9
|
+
def bottom_right: -> Point
|
|
10
|
+
def bottom_right=: (Point) -> untyped
|
|
11
|
+
def bottom_left: -> Point
|
|
12
|
+
def bottom_left=: (Point) -> untyped
|
|
13
|
+
def initialize: (Point, Point, Point, Point) -> void
|
|
14
|
+
def []: (Integer) -> Point
|
|
15
|
+
def size: -> Integer
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# lib/mindee/geometry/utils.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module Geometry
|
|
4
|
+
def self.quadrilateral_from_prediction: (untyped) -> untyped
|
|
5
|
+
def self.polygon_from_prediction: (untyped) -> untyped
|
|
6
|
+
def self.get_bbox: (untyped) -> [untyped, untyped, untyped, untyped]
|
|
7
|
+
def self.get_bounding_box: (untyped) -> Quadrilateral
|
|
8
|
+
def self.get_centroid: (untyped) -> untyped
|
|
9
|
+
def self.get_min_max_y: (untyped) -> untyped
|
|
10
|
+
def self.get_min_max_x: (untyped) -> untyped
|
|
11
|
+
def self.below?: (untyped, untyped, untyped, untyped) -> bool
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# lib/mindee/http/endpoint.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module HTTP
|
|
4
|
+
API_KEY_ENV_NAME: String
|
|
5
|
+
API_KEY_DEFAULT: nil
|
|
6
|
+
BASE_URL_ENV_NAME: String
|
|
7
|
+
BASE_URL_DEFAULT: String
|
|
8
|
+
REQUEST_TIMEOUT_ENV_NAME: String
|
|
9
|
+
TIMEOUT_DEFAULT: Integer
|
|
10
|
+
USER_AGENT: String
|
|
11
|
+
class Endpoint
|
|
12
|
+
def logger: () -> untyped
|
|
13
|
+
def api_key: -> String?
|
|
14
|
+
def request_timeout: -> Integer
|
|
15
|
+
def url_root: -> String
|
|
16
|
+
def initialize: (untyped, untyped, untyped, ?api_key: String) -> String
|
|
17
|
+
def predict: (untyped, untyped, untyped, untyped, untyped) -> [untyped, untyped]
|
|
18
|
+
def predict_async: (untyped, untyped, untyped, untyped, untyped) -> [untyped, untyped]
|
|
19
|
+
def parse_async: (untyped) -> [untyped, untyped]
|
|
20
|
+
def predict_req_post: (untyped, ?all_words: false, ?full_text: false, ?close_file: true, ?cropper: false) -> untyped
|
|
21
|
+
def document_queue_req_get: (untyped, untyped, untyped, untyped, untyped) -> untyped
|
|
22
|
+
def document_queue_req: (untyped) -> untyped
|
|
23
|
+
def check_api_key: -> nil
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# lib/mindee/http/http_error_handler.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module HTTP
|
|
4
|
+
module ErrorHandler
|
|
5
|
+
def extract_error: (untyped) -> nil
|
|
6
|
+
def create_error_obj: (untyped) -> (Hash[String, String] | Hash[untyped, untyped])?
|
|
7
|
+
def self.handle_error: (untyped, untyped) -> untyped
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# lib/mindee/http/response_validation.rb
|
|
2
|
+
module Mindee
|
|
3
|
+
module HTTP
|
|
4
|
+
module ResponseValidation
|
|
5
|
+
def self.valid_sync_response?: (untyped) -> bool
|
|
6
|
+
def self.valid_async_response?: (untyped) -> bool
|
|
7
|
+
def self.clean_request!: (untyped) -> nil
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|