From e9745f68e60ec59df4673b05f6acdacd69d2f2b7 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 27 Oct 2026 16:26:19 +0100 Subject: [PATCH 1/6] :coffin: remove dead v1 products --- bin/v1/products.rb | 6 - docs/code_samples/bank_account_details_v1.txt | 24 ---- docs/code_samples/barcode_reader_v1.txt | 24 ---- docs/code_samples/idcard_fr_v1.txt | 24 ---- lib/mindee/v1/product.rb | 3 - .../barcode_reader/barcode_reader_v1.rb | 47 -------- .../barcode_reader_v1_document.rb | 47 -------- .../barcode_reader/barcode_reader_v1_page.rb | 38 ------- .../bank_account_details_v1.rb | 49 -------- .../bank_account_details_v1_document.rb | 49 -------- .../bank_account_details_v1_page.rb | 40 ------- .../v1/product/fr/id_card/id_card_v1.rb | 49 -------- .../product/fr/id_card/id_card_v1_document.rb | 106 ------------------ .../v1/product/fr/id_card/id_card_v1_page.rb | 57 ---------- .../barcode_reader/barcode_reader_v1.rbs | 13 --- .../barcode_reader_v1_document.rbs | 16 --- .../barcode_reader/barcode_reader_v1_page.rbs | 17 --- .../bank_account_details_v1.rbs | 15 --- .../bank_account_details_v1_document.rbs | 19 ---- .../bank_account_details_v1_page.rbs | 19 ---- .../v1/product/fr/id_card/id_card_v1.rbs | 15 --- .../fr/id_card/id_card_v1_document.rbs | 26 ----- .../v1/product/fr/id_card/id_card_v1_page.rbs | 20 ---- spec/image/image_extractor_spec.rb | 50 --------- spec/v1/product/barcode_reader_v1_spec.rb | 32 ------ .../fr/bank_account_details_v1_spec.rb | 32 ------ spec/v1/product/fr/id_card_v1_spec.rb | 42 ------- 27 files changed, 879 deletions(-) delete mode 100644 docs/code_samples/bank_account_details_v1.txt delete mode 100644 docs/code_samples/barcode_reader_v1.txt delete mode 100644 docs/code_samples/idcard_fr_v1.txt delete mode 100644 lib/mindee/v1/product/barcode_reader/barcode_reader_v1.rb delete mode 100644 lib/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rb delete mode 100644 lib/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rb delete mode 100644 lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rb delete mode 100644 lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rb delete mode 100644 lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rb delete mode 100644 lib/mindee/v1/product/fr/id_card/id_card_v1.rb delete mode 100644 lib/mindee/v1/product/fr/id_card/id_card_v1_document.rb delete mode 100644 lib/mindee/v1/product/fr/id_card/id_card_v1_page.rb delete mode 100644 sig/mindee/v1/product/barcode_reader/barcode_reader_v1.rbs delete mode 100644 sig/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rbs delete mode 100644 sig/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rbs delete mode 100644 sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rbs delete mode 100644 sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rbs delete mode 100644 sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rbs delete mode 100644 sig/mindee/v1/product/fr/id_card/id_card_v1.rbs delete mode 100644 sig/mindee/v1/product/fr/id_card/id_card_v1_document.rbs delete mode 100644 sig/mindee/v1/product/fr/id_card/id_card_v1_page.rbs delete mode 100644 spec/image/image_extractor_spec.rb delete mode 100644 spec/v1/product/barcode_reader_v1_spec.rb delete mode 100644 spec/v1/product/fr/bank_account_details_v1_spec.rb delete mode 100644 spec/v1/product/fr/id_card_v1_spec.rb diff --git a/bin/v1/products.rb b/bin/v1/products.rb index e7133fc89..7def8765c 100644 --- a/bin/v1/products.rb +++ b/bin/v1/products.rb @@ -7,12 +7,6 @@ sync: true, async: true, }, - 'barcode-reader' => { - description: 'Barcode Reader', - doc_class: Mindee::V1::Product::BarcodeReader::BarcodeReaderV1, - sync: true, - async: false, - }, 'cropper' => { description: 'Cropper', doc_class: Mindee::V1::Product::Cropper::CropperV1, diff --git a/docs/code_samples/bank_account_details_v1.txt b/docs/code_samples/bank_account_details_v1.txt deleted file mode 100644 index ce1d5994a..000000000 --- a/docs/code_samples/bank_account_details_v1.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::FR::BankAccountDetails::BankAccountDetailsV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/barcode_reader_v1.txt b/docs/code_samples/barcode_reader_v1.txt deleted file mode 100644 index ca28409d0..000000000 --- a/docs/code_samples/barcode_reader_v1.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::BarcodeReader::BarcodeReaderV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/docs/code_samples/idcard_fr_v1.txt b/docs/code_samples/idcard_fr_v1.txt deleted file mode 100644 index 7a88de63d..000000000 --- a/docs/code_samples/idcard_fr_v1.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::V1::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::V1::Product::FR::IdCard::IdCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction diff --git a/lib/mindee/v1/product.rb b/lib/mindee/v1/product.rb index 1758b29cd..a92c4224c 100644 --- a/lib/mindee/v1/product.rb +++ b/lib/mindee/v1/product.rb @@ -1,12 +1,9 @@ # frozen_string_literal: true -require_relative 'product/barcode_reader/barcode_reader_v1' require_relative 'product/cropper/cropper_v1' require_relative 'product/financial_document/financial_document_v1' -require_relative 'product/fr/bank_account_details/bank_account_details_v1' require_relative 'product/fr/bank_account_details/bank_account_details_v2' require_relative 'product/fr/bank_statement/bank_statement_v2' -require_relative 'product/fr/id_card/id_card_v1' require_relative 'product/fr/id_card/id_card_v2' require_relative 'product/international_id/international_id_v2' require_relative 'product/invoice/invoice_v4' diff --git a/lib/mindee/v1/product/barcode_reader/barcode_reader_v1.rb b/lib/mindee/v1/product/barcode_reader/barcode_reader_v1.rb deleted file mode 100644 index b4ee0580d..000000000 --- a/lib/mindee/v1/product/barcode_reader/barcode_reader_v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'barcode_reader_v1_document' -require_relative 'barcode_reader_v1_page' - -module Mindee - module V1 - module Product - # Barcode Reader module. - module BarcodeReader - # Barcode Reader API version 1 inference prediction. - class BarcodeReaderV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'barcode_reader' - @endpoint_version = '1' - @has_async = false - @has_sync = true - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = BarcodeReaderV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(BarcodeReaderV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rb b/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rb deleted file mode 100644 index c6a6cffbf..000000000 --- a/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' - -module Mindee - module V1 - module Product - module BarcodeReader - # Barcode Reader API version 1.0 document data. - class BarcodeReaderV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - - # List of decoded 1D barcodes. - # @return [Array] - attr_reader :codes_1d - # List of decoded 2D barcodes. - # @return [Array] - attr_reader :codes_2d - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @codes_1d = [] # : Array[Parsing::Standard::StringField] - prediction['codes_1d'].each do |item| - @codes_1d.push(Parsing::Standard::StringField.new(item, page_id)) - end - @codes_2d = [] # : Array[Parsing::Standard::StringField] - prediction['codes_2d'].each do |item| - @codes_2d.push(Parsing::Standard::StringField.new(item, page_id)) - end - end - - # @return [String] - def to_s - codes_1d = @codes_1d.join("\n #{' ' * 13}") - codes_2d = @codes_2d.join("\n #{' ' * 13}") - out_str = String.new - out_str << "\n:Barcodes 1D: #{codes_1d}".rstrip - out_str << "\n:Barcodes 2D: #{codes_2d}".rstrip - out_str[1..].to_s - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rb b/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rb deleted file mode 100644 index 05e003b4e..000000000 --- a/lib/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../parsing' -require_relative 'barcode_reader_v1_document' - -module Mindee - module V1 - module Product - module BarcodeReader - # Barcode Reader API version 1.0 page data. - class BarcodeReaderV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - BarcodeReaderV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Barcode Reader V1 page prediction. - class BarcodeReaderV1PagePrediction < BarcodeReaderV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rb b/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rb deleted file mode 100644 index 0f05a1372..000000000 --- a/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'bank_account_details_v1_document' -require_relative 'bank_account_details_v1_page' - -module Mindee - module V1 - module Product - module FR - # Bank Account Details module. - module BankAccountDetails - # Bank Account Details API version 1 inference prediction. - class BankAccountDetailsV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'bank_account_details' - @endpoint_version = '1' - @has_async = false - @has_sync = true - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = BankAccountDetailsV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(BankAccountDetailsV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rb b/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rb deleted file mode 100644 index b58fa1780..000000000 --- a/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module BankAccountDetails - # Bank Account Details API version 1.0 document data. - class BankAccountDetailsV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - - # The name of the account holder as seen on the document. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :account_holder_name - # The International Bank Account Number (IBAN). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :iban - # The bank's SWIFT Business Identifier Code (BIC). - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :swift - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @account_holder_name = Parsing::Standard::StringField.new( - prediction['account_holder_name'], - page_id - ) - @iban = Parsing::Standard::StringField.new(prediction['iban'], page_id) - @swift = Parsing::Standard::StringField.new(prediction['swift'], page_id) - end - - # @return [String] - def to_s - out_str = String.new - out_str << "\n:IBAN: #{@iban}".rstrip - out_str << "\n:Account Holder's Name: #{@account_holder_name}".rstrip - out_str << "\n:SWIFT Code: #{@swift}".rstrip - out_str[1..].to_s - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rb b/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rb deleted file mode 100644 index 6dfd7ca0d..000000000 --- a/lib/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'bank_account_details_v1_document' - -module Mindee - module V1 - module Product - module FR - module BankAccountDetails - # Bank Account Details API version 1.0 page data. - class BankAccountDetailsV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - BankAccountDetailsV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Bank Account Details V1 page prediction. - class BankAccountDetailsV1PagePrediction < BankAccountDetailsV1Document - # @return [String] - def to_s - out_str = String.new - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/id_card/id_card_v1.rb b/lib/mindee/v1/product/fr/id_card/id_card_v1.rb deleted file mode 100644 index 40819ebf9..000000000 --- a/lib/mindee/v1/product/fr/id_card/id_card_v1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'id_card_v1_document' -require_relative 'id_card_v1_page' - -module Mindee - module V1 - module Product - module FR - # Carte Nationale d'Identité module. - module IdCard - # Carte Nationale d'Identité API version 1 inference prediction. - class IdCardV1 < Mindee::V1::Parsing::Common::Inference - @endpoint_name = 'idcard_fr' - @endpoint_version = '1' - @has_async = false - @has_sync = true - - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = IdCardV1Document.new(prediction['prediction'], nil) - @pages = [] - prediction['pages'].each do |page| - @pages.push(IdCardV1Page.new(page)) - end - end - - class << self - # Name of the endpoint for this product. - # @return [String] - attr_reader :endpoint_name - # Version for this product. - # @return [String] - attr_reader :endpoint_version - # Whether this product has access to an asynchronous endpoint. - # @return [bool] - attr_reader :has_async - # Whether this product has access to synchronous endpoint. - # @return [bool] - attr_reader :has_sync - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/id_card/id_card_v1_document.rb b/lib/mindee/v1/product/fr/id_card/id_card_v1_document.rb deleted file mode 100644 index b151903d7..000000000 --- a/lib/mindee/v1/product/fr/id_card/id_card_v1_document.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' - -module Mindee - module V1 - module Product - module FR - module IdCard - # Carte Nationale d'Identité API version 1.1 document data. - class IdCardV1Document < Mindee::V1::Parsing::Common::Prediction - include Mindee::V1::Parsing::Standard - - # The name of the issuing authority. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :authority - # The date of birth of the card holder. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :birth_date - # The place of birth of the card holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :birth_place - # The expiry date of the identification card. - # @return [Mindee::V1::Parsing::Standard::DateField] - attr_reader :expiry_date - # The gender of the card holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :gender - # The given name(s) of the card holder. - # @return [Array] - attr_reader :given_names - # The identification card number. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :id_number - # Machine Readable Zone, first line - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz1 - # Machine Readable Zone, second line - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :mrz2 - # The surname of the card holder. - # @return [Mindee::V1::Parsing::Standard::StringField] - attr_reader :surname - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - super - @authority = Parsing::Standard::StringField.new( - prediction['authority'], - page_id - ) - @birth_date = Parsing::Standard::DateField.new( - prediction['birth_date'], - page_id - ) - @birth_place = Parsing::Standard::StringField.new( - prediction['birth_place'], - page_id - ) - @expiry_date = Parsing::Standard::DateField.new( - prediction['expiry_date'], - page_id - ) - @gender = Parsing::Standard::StringField.new( - prediction['gender'], - page_id - ) - @given_names = [] # : Array[Parsing::Standard::StringField] - prediction['given_names'].each do |item| - @given_names.push(Parsing::Standard::StringField.new(item, page_id)) - end - @id_number = Parsing::Standard::StringField.new( - prediction['id_number'], - page_id - ) - @mrz1 = Parsing::Standard::StringField.new(prediction['mrz1'], page_id) - @mrz2 = Parsing::Standard::StringField.new(prediction['mrz2'], page_id) - @surname = Parsing::Standard::StringField.new( - prediction['surname'], - page_id - ) - end - - # @return [String] - def to_s - given_names = @given_names.join("\n #{' ' * 15}") - out_str = String.new - out_str << "\n:Identity Number: #{@id_number}".rstrip - out_str << "\n:Given Name(s): #{given_names}".rstrip - out_str << "\n:Surname: #{@surname}".rstrip - out_str << "\n:Date of Birth: #{@birth_date}".rstrip - out_str << "\n:Place of Birth: #{@birth_place}".rstrip - out_str << "\n:Expiry Date: #{@expiry_date}".rstrip - out_str << "\n:Issuing Authority: #{@authority}".rstrip - out_str << "\n:Gender: #{@gender}".rstrip - out_str << "\n:MRZ Line 1: #{@mrz1}".rstrip - out_str << "\n:MRZ Line 2: #{@mrz2}".rstrip - out_str[1..].to_s - end - end - end - end - end - end -end diff --git a/lib/mindee/v1/product/fr/id_card/id_card_v1_page.rb b/lib/mindee/v1/product/fr/id_card/id_card_v1_page.rb deleted file mode 100644 index d81bdf893..000000000 --- a/lib/mindee/v1/product/fr/id_card/id_card_v1_page.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../parsing' -require_relative 'id_card_v1_document' - -module Mindee - module V1 - module Product - module FR - module IdCard - # Carte Nationale d'Identité API version 1.1 page data. - class IdCardV1Page < Mindee::V1::Parsing::Common::Page - # @param prediction [Hash] - def initialize(prediction) - super - @prediction = if prediction['prediction'].empty? - nil - else - IdCardV1PagePrediction.new( - prediction['prediction'], - prediction['id'] - ) - end - end - end - - # Carte Nationale d'Identité V1 page prediction. - class IdCardV1PagePrediction < IdCardV1Document - include Mindee::V1::Parsing::Standard - - # The side of the document which is visible. - # @return [Mindee::V1::Parsing::Standard::ClassificationField] - attr_reader :document_side - - # @param prediction [Hash] - # @param page_id [Integer, nil] - def initialize(prediction, page_id) - @document_side = Parsing::Standard::ClassificationField.new( - prediction['document_side'], - page_id - ) - super - end - - # @return [String] - def to_s - out_str = String.new - out_str << "\n:Document Side: #{@document_side}".rstrip - out_str << "\n#{super}" - out_str - end - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/barcode_reader/barcode_reader_v1.rbs b/sig/mindee/v1/product/barcode_reader/barcode_reader_v1.rbs deleted file mode 100644 index a17f2f1a9..000000000 --- a/sig/mindee/v1/product/barcode_reader/barcode_reader_v1.rbs +++ /dev/null @@ -1,13 +0,0 @@ -# lib/mindee/v1/product/barcode_reader/barcode_reader_v1.rb - -module Mindee - module V1 - module Product - module BarcodeReader - class BarcodeReaderV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end -end diff --git a/sig/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rbs b/sig/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rbs deleted file mode 100644 index 2ffcc0a26..000000000 --- a/sig/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rbs +++ /dev/null @@ -1,16 +0,0 @@ -# lib/mindee/v1/product/barcode_reader/barcode_reader_v1_document.rb - -module Mindee - module V1 - module Product - module BarcodeReader - class BarcodeReaderV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def codes_1d: -> (Array[Parsing::Standard::StringField]) - def codes_2d: -> (Array[Parsing::Standard::StringField]) - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rbs b/sig/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rbs deleted file mode 100644 index 41834d483..000000000 --- a/sig/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rbs +++ /dev/null @@ -1,17 +0,0 @@ -# lib/mindee/v1/product/barcode_reader/barcode_reader_v1_page.rb - -module Mindee - module V1 - module Product - module BarcodeReader - class BarcodeReaderV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class BarcodeReaderV1PagePrediction < BarcodeReaderV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rbs b/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rbs deleted file mode 100644 index 0f8c6b974..000000000 --- a/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/bank_account_details/bank_account_details_v1.rb - -module Mindee - module V1 - module Product - module FR - module BankAccountDetails - class BankAccountDetailsV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rbs b/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rbs deleted file mode 100644 index c406f444b..000000000 --- a/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_document.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# lib/mindee/v1/product/bank_account_details/bank_account_details_v1_document.rb - -module Mindee - module V1 - module Product - module FR - module BankAccountDetails - class BankAccountDetailsV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def account_holder_name: -> (Parsing::Standard::StringField) - def iban: -> (Parsing::Standard::StringField) - def swift: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rbs b/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rbs deleted file mode 100644 index cadfe4779..000000000 --- a/sig/mindee/v1/product/fr/bank_account_details/bank_account_details_v1_page.rbs +++ /dev/null @@ -1,19 +0,0 @@ -# lib/mindee/v1/product/bank_account_details/bank_account_details_v1_page.rb - -module Mindee - module V1 - module Product - module FR - module BankAccountDetails - class BankAccountDetailsV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class BankAccountDetailsV1PagePrediction < BankAccountDetailsV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/id_card/id_card_v1.rbs b/sig/mindee/v1/product/fr/id_card/id_card_v1.rbs deleted file mode 100644 index 9f4de18d0..000000000 --- a/sig/mindee/v1/product/fr/id_card/id_card_v1.rbs +++ /dev/null @@ -1,15 +0,0 @@ -# lib/mindee/v1/product/id_card/id_card_v1.rb - -module Mindee - module V1 - module Product - module FR - module IdCard - class IdCardV1 < Parsing::Common::Inference - def initialize: (Hash[String | Symbol, untyped]) -> void - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/id_card/id_card_v1_document.rbs b/sig/mindee/v1/product/fr/id_card/id_card_v1_document.rbs deleted file mode 100644 index 4fd206feb..000000000 --- a/sig/mindee/v1/product/fr/id_card/id_card_v1_document.rbs +++ /dev/null @@ -1,26 +0,0 @@ -# lib/mindee/v1/product/id_card/id_card_v1_document.rb - -module Mindee - module V1 - module Product - module FR - module IdCard - class IdCardV1Document < Parsing::Common::Prediction - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def authority: -> (Parsing::Standard::StringField) - def birth_date: -> (Parsing::Standard::DateField) - def birth_place: -> (Parsing::Standard::StringField) - def expiry_date: -> (Parsing::Standard::DateField) - def gender: -> (Parsing::Standard::StringField) - def given_names: -> (Array[Parsing::Standard::StringField]) - def id_number: -> (Parsing::Standard::StringField) - def mrz1: -> (Parsing::Standard::StringField) - def mrz2: -> (Parsing::Standard::StringField) - def surname: -> (Parsing::Standard::StringField) - def to_s: -> String - end - end - end - end - end -end diff --git a/sig/mindee/v1/product/fr/id_card/id_card_v1_page.rbs b/sig/mindee/v1/product/fr/id_card/id_card_v1_page.rbs deleted file mode 100644 index 601ddba1d..000000000 --- a/sig/mindee/v1/product/fr/id_card/id_card_v1_page.rbs +++ /dev/null @@ -1,20 +0,0 @@ -# lib/mindee/v1/product/id_card/id_card_v1_page.rb - -module Mindee - module V1 - module Product - module FR - module IdCard - class IdCardV1Page < Parsing::Common::Page - def initialize: (Hash[String | Symbol, untyped]) -> void - end - class IdCardV1PagePrediction < IdCardV1Document - def initialize: (Hash[String | Symbol, untyped], Integer?) -> void - def document_side: -> Parsing::Standard::ClassificationField - def to_s: -> String - end - end - end - end - end -end diff --git a/spec/image/image_extractor_spec.rb b/spec/image/image_extractor_spec.rb deleted file mode 100644 index 93e44aa9a..000000000 --- a/spec/image/image_extractor_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -require 'mindee/v1/product' -require 'mindee/input/sources' -require_relative '../data' - -describe Mindee::Image, :all_deps do - include Mindee::Image - - let(:barcode_path) do - File.join(V1_DATA_DIR, 'products', 'barcode_reader', 'default_sample.jpg') - end - - let(:barcode_json_path) do - File.join(V1_DATA_DIR, 'products', 'barcode_reader', 'response_v1', 'complete.json') - end - - context 'an image extractor' do - it 'extracts barcode images correctly' do - json_data = JSON.parse(File.read(barcode_json_path)) - inference = Mindee::V1::Product::BarcodeReader::BarcodeReaderV1.new(json_data['document']['inference']) - barcodes1 = inference.prediction.codes_1d.map(&:polygon) - barcodes2 = inference.prediction.codes_2d.map(&:polygon) - input_source = Mindee::Input::Source::PathInputSource.new(barcode_path) - - extracted_barcodes_1d = Mindee::Image::ImageExtractor.extract_multiple_images_from_source(input_source, 1, - barcodes1) - extracted_barcodes_2d = Mindee::Image::ImageExtractor.extract_multiple_images_from_source(input_source, 1, - barcodes2) - - expect(extracted_barcodes_1d.size).to eq(1) - expect(extracted_barcodes_2d.size).to eq(2) - - expect(extracted_barcodes_1d[0].as_input_source.filename).to end_with('jpg') - extracted_barcodes_1d[0].buffer.rewind - image_buffer1 = MiniMagick::Image.read(extracted_barcodes_1d[0].buffer) - expect(image_buffer1.dimensions).to eq([353, 199]) - - extracted_barcodes_2d[0].buffer.rewind - image_buffer2 = MiniMagick::Image.read(extracted_barcodes_2d[0].buffer) - expect(image_buffer2.dimensions).to eq([214, 216]) - expect(extracted_barcodes_2d[0].as_input_source.filename).to end_with('jpg') - - extracted_barcodes_2d[0].buffer.rewind - image_buffer3 = MiniMagick::Image.read(extracted_barcodes_2d[1].buffer) - expect(image_buffer3.dimensions).to eq([193, 201]) - expect(extracted_barcodes_2d[1].as_input_source.filename).to end_with('jpg') - end - end -end diff --git a/spec/v1/product/barcode_reader_v1_spec.rb b/spec/v1/product/barcode_reader_v1_spec.rb deleted file mode 100644 index 55aa36092..000000000 --- a/spec/v1/product/barcode_reader_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../data' - -DIR_BARCODE_READER_V1 = File.join(V1_DATA_DIR, 'products', 'barcode_reader', 'response_v1').freeze - -describe Mindee::V1::Product::BarcodeReader::BarcodeReaderV1 do - context 'A Barcode Reader V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_BARCODE_READER_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::BarcodeReader::BarcodeReaderV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_BARCODE_READER_V1, 'summary_full.rst') - response = load_json(DIR_BARCODE_READER_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::BarcodeReader::BarcodeReaderV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/fr/bank_account_details_v1_spec.rb b/spec/v1/product/fr/bank_account_details_v1_spec.rb deleted file mode 100644 index 7afbb01d1..000000000 --- a/spec/v1/product/fr/bank_account_details_v1_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_FR_BANK_ACCOUNT_DETAILS_V1 = File.join(V1_DATA_DIR, 'products', 'bank_account_details', 'response_v1').freeze - -describe Mindee::V1::Product::FR::BankAccountDetails::BankAccountDetailsV1 do - context 'A Bank Account Details V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_FR_BANK_ACCOUNT_DETAILS_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::BankAccountDetails::BankAccountDetailsV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_FR_BANK_ACCOUNT_DETAILS_V1, 'summary_full.rst') - response = load_json(DIR_FR_BANK_ACCOUNT_DETAILS_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::BankAccountDetails::BankAccountDetailsV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - end -end diff --git a/spec/v1/product/fr/id_card_v1_spec.rb b/spec/v1/product/fr/id_card_v1_spec.rb deleted file mode 100644 index 35bcaab36..000000000 --- a/spec/v1/product/fr/id_card_v1_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'mindee/v1/product' -require 'mindee/v1/parsing' - -require_relative '../../../data' - -DIR_FR_ID_CARD_V1 = File.join(V1_DATA_DIR, 'products', 'idcard_fr', 'response_v1').freeze - -describe Mindee::V1::Product::FR::IdCard::IdCardV1 do - context 'A Carte Nationale d\'Identité V1' do - it 'should load an empty document prediction' do - response = load_json(DIR_FR_ID_CARD_V1, 'empty.json') - inference = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::IdCard::IdCardV1, - response['document'] - ).inference - expect(inference.product.type).to eq('standard') - end - - it 'should load a complete document prediction' do - to_string = read_file(DIR_FR_ID_CARD_V1, 'summary_full.rst') - response = load_json(DIR_FR_ID_CARD_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::IdCard::IdCardV1, - response['document'] - ) - expect(document.to_s).to eq(to_string) - end - it 'should load a complete page 0 prediction' do - to_string = read_file(DIR_FR_ID_CARD_V1, 'summary_page0.rst') - response = load_json(DIR_FR_ID_CARD_V1, 'complete.json') - document = Mindee::V1::Parsing::Common::Document.new( - Mindee::V1::Product::FR::IdCard::IdCardV1, - response['document'] - ) - page = document.inference.pages[0] - expect(page.to_s).to eq(to_string) - end - end -end From c6322a816afa235ba0437ff334869aa6a87d7ce8 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 12:18:30 +0100 Subject: [PATCH 2/6] :coffin: remove unused workflow methods --- docs/code_samples/workflow_execution.txt | 28 ----------------- lib/mindee/v1/client.rb | 39 ------------------------ spec/v1/workflow/workflow_integration.rb | 16 ---------- 3 files changed, 83 deletions(-) delete mode 100644 docs/code_samples/workflow_execution.txt diff --git a/docs/code_samples/workflow_execution.txt b/docs/code_samples/workflow_execution.txt deleted file mode 100644 index ac74b7330..000000000 --- a/docs/code_samples/workflow_execution.txt +++ /dev/null @@ -1,28 +0,0 @@ -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -workflow_id = 'workflow-id' - -# Init a new client -mindee_client = Mindee::V1::Client.new - -# Load a file from disk -input_source = mindee_client.source_from_path('path/to/my/file.ext') - -# Send the file to the workflow -result = mindee_client.execute_workflow( - input_source, - workflow_id, -# options: { # Optionally, you can provide the following parameters: -# document_alias: 'my-document-alias', # Potential alias for the document -# priority: Mindee::V1::Parsing::Common::ExecutionPriority::LOW, # Priority of the execution -# rag: true # Whether to enable Retrieval-Augmented Generation -# } -) - -# Print the execution's ID to make sure it worked -puts result.execution.id diff --git a/lib/mindee/v1/client.rb b/lib/mindee/v1/client.rb index 3a22b536b..eb40408e5 100644 --- a/lib/mindee/v1/client.rb +++ b/lib/mindee/v1/client.rb @@ -294,45 +294,6 @@ def enqueue_and_parse( queue_res end - # rubocop:enable Metrics/CyclomaticComplexity - # Sends a document to a workflow. - # - # Accepts options either as a Hash or as a WorkflowOptions struct. - # - # @param input_source [Mindee::Input::Source::LocalInputSource, Mindee::Input::Source::URLInputSource] - # @param workflow_id [String] - # @param options [Hash, WorkflowOptions] Options to configure workflow behavior. Possible keys: - # * `document_alias` [String, nil] Alias to give to the document. - # * `priority` [Symbol, nil] Priority to give to the document. - # * `full_text` [bool] Whether to include the full OCR text response in compatible APIs. - # * `rag` [bool, nil] Whether to enable Retrieval-Augmented Generation. - # - # * `public_url` [String, nil] A unique, encrypted URL for accessing the document validation interface without - # requiring authentication. - # * `page_options` [Hash, nil] Page cutting/merge options: - # * `:page_indexes` Zero-based list of page indexes. - # * `:operation` Operation to apply on the document, given the `page_indexes specified: - # * `:KEEP_ONLY` - keep only the specified pages, and remove all others. - # * `:REMOVE` - remove the specified pages, and keep all others. - # * `:on_min_pages` Apply the operation only if document has at least this many pages. - # @return [Mindee::V1::Parsing::Common::WorkflowResponse] - def execute_workflow(input_source, workflow_id, options: {}) - opts = options.is_a?(WorkflowOptions) ? options : WorkflowOptions.new(params: options) - if opts.respond_to?(:page_options) && input_source.is_a?(Input::Source::LocalInputSource) - process_pdf_if_required(input_source, opts) - end - - workflow_endpoint = V1::HTTP::WorkflowEndpoint.new(workflow_id, api_key: @api_key.to_s) - logger.debug("Sending document to workflow '#{workflow_id}'") - - prediction, raw_http = workflow_endpoint.execute_workflow( - input_source, - opts - ) - - Mindee::V1::Parsing::Common::WorkflowResponse.new(V1::Product::Universal::Universal, prediction, raw_http) - end - # Load a prediction. # # @param product_class [Mindee::Inference] class of the product diff --git a/spec/v1/workflow/workflow_integration.rb b/spec/v1/workflow/workflow_integration.rb index 2cd4afaac..bc5cc5168 100644 --- a/spec/v1/workflow/workflow_integration.rb +++ b/spec/v1/workflow/workflow_integration.rb @@ -12,22 +12,6 @@ File.join(V1_PRODUCT_DATA_DIR, 'financial_document', 'default_sample.jpg') ) end - let(:workflow_id) { ENV.fetch('WORKFLOW_ID') } - it 'should return a valid response' do - current_date_time = Time.now.strftime('%Y-%m-%d-%H:%M:%S') - document_alias = "ruby-#{current_date_time}" - priority = Mindee::V1::Parsing::Common::ExecutionPriority::LOW - - response = client.execute_workflow( - sample_input, - workflow_id, - options: { document_alias: document_alias, - priority: priority, rag: true } - ) - - expect(response.execution.file.alias).to eq(document_alias) - expect(response.execution.priority).to eq(priority) - end it 'should poll a workflow with RAG' do options = { workflow_id: workflow_id, rag: true } From 141f5c4b932dee0da46e67574a2416156d96c0e2 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 13:14:37 +0100 Subject: [PATCH 3/6] bmump submodule --- spec/data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/data b/spec/data index 5037ffc3c..bf5893c5c 160000 --- a/spec/data +++ b/spec/data @@ -1 +1 @@ -Subproject commit 5037ffc3c443ec0c93ed673acd22d6ae1c65771a +Subproject commit bf5893c5c631f37f01419b4a9c71c8a5ce036939 From 5ee8f349354521239bb5566be601eff4d15bc019 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 13:15:27 +0100 Subject: [PATCH 4/6] remove invalid sig --- sig/mindee/v1/client.rbs | 2 -- 1 file changed, 2 deletions(-) diff --git a/sig/mindee/v1/client.rbs b/sig/mindee/v1/client.rbs index 2896d7594..2fdbb8634 100644 --- a/sig/mindee/v1/client.rbs +++ b/sig/mindee/v1/client.rbs @@ -48,8 +48,6 @@ module Mindee def enqueue_and_parse: (Input::Source::URLInputSource | Input::Source::LocalInputSource, singleton(V1::Parsing::Common::Inference), V1::HTTP::Endpoint, ParseOptions) -> V1::Parsing::Common::ApiResponse - def execute_workflow: (Input::Source::URLInputSource | Input::Source::LocalInputSource, String, options: (Hash[String | Symbol, untyped] | WorkflowOptions)) -> V1::Parsing::Common::WorkflowResponse - def load_prediction: (singleton(V1::Parsing::Common::Inference), Input::LocalResponse) -> V1::Parsing::Common::ApiResponse def source_from_path: (String, ?repair_pdf: bool) -> Input::Source::PathInputSource From ff6123f6928c6083cf32e3eb80f337bfbf41aa6f Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 15:18:41 +0100 Subject: [PATCH 5/6] fix macos CI --- .github/workflows/_test-integration.yml | 11 ++++++++++- .github/workflows/_test-units.yml | 11 +++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_test-integration.yml b/.github/workflows/_test-integration.yml index 9ac72cf23..9a93242d4 100644 --- a/.github/workflows/_test-integration.yml +++ b/.github/workflows/_test-integration.yml @@ -53,7 +53,16 @@ jobs: - name: Install Ghostscript and ImageMagick on macOS if: runner.os == 'macOS' - run: brew install ghostscript imagemagick + run: | + brew update + brew install ghostscript imagemagick || true + brew reinstall jpeg-turbo imagemagick + # Diagnostics: fail early with a readable message if JPEG can't be written + magick -version + which -a magick + magick -list format | grep -iE '^\s*JPE?G' + magick -size 10x10 xc:white /tmp/check.jpg && magick mogrify -resize 5x5 /tmp/check.jpg + - name: Change ImageMagick security policy on Ubuntu if: runner.os == 'Linux' run: | diff --git a/.github/workflows/_test-units.yml b/.github/workflows/_test-units.yml index 5769e6e13..f36de2fe8 100644 --- a/.github/workflows/_test-units.yml +++ b/.github/workflows/_test-units.yml @@ -41,8 +41,15 @@ jobs: - name: Install Ghostscript and ImageMagick on macOS if: runner.os == 'macOS' run: | - brew install ghostscript imagemagick - /usr/bin/security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain + brew update + brew install ghostscript imagemagick || true + brew reinstall jpeg-turbo imagemagick + # Diagnostics: fail early with a readable message if JPEG can't be written + magick -version + which -a magick + magick -list format | grep -iE '^\s*JPE?G' + magick -size 10x10 xc:white /tmp/check.jpg && magick mogrify -resize 5x5 /tmp/check.jpg + - name: Change ImageMagick security policy on Ubuntu if: runner.os == 'Linux' run: | From 2a047da2ed99d39159f709d2d09d51f750e4fea7 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 15:33:09 +0100 Subject: [PATCH 6/6] restore unadvertently deleted variable --- spec/v1/workflow/workflow_integration.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/v1/workflow/workflow_integration.rb b/spec/v1/workflow/workflow_integration.rb index bc5cc5168..6d0066a08 100644 --- a/spec/v1/workflow/workflow_integration.rb +++ b/spec/v1/workflow/workflow_integration.rb @@ -12,6 +12,7 @@ File.join(V1_PRODUCT_DATA_DIR, 'financial_document', 'default_sample.jpg') ) end + let(:workflow_id) { ENV.fetch('WORKFLOW_ID') } it 'should poll a workflow with RAG' do options = { workflow_id: workflow_id, rag: true }