mindee 4.10.1 → 4.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0acff570cd3c1b3528696ce80e37acd582cd1ca6947ec1683c74c1896af9fb9
4
- data.tar.gz: 88cc394a27c17e14bf7b5c348a3db59117e1e1508f89429e5f2b6c090155175c
3
+ metadata.gz: 43659b03f8409d595466a6a97647aa49fc18f87c06da2d487f5f3642327d7903
4
+ data.tar.gz: 046b2d6be2bad2ce4e1be68b30b6da6d3848b1dcca7d4a87969a0cd8f17980c4
5
5
  SHA512:
6
- metadata.gz: c961bb98da8ef3bd701810eae1ec1a98a9fb7111142e4d40eee1add7bc959d55d66076e287e7c050aa594ee5fb900594c6bf24010a85564d0e38282c76aa6a93
7
- data.tar.gz: a4b802f0a7c8312baa55eef7635063eb395f5251420770468e0e59f8ba3cae57a0ffd6ac63eff9e6a3fdc2d24acf577d8dbf990f9b71c22386d8bc326093e011
6
+ metadata.gz: 25ec82428fd6ddcbf1187c6b23312c867378a703928388a76478db0e81ff42e157e066b1a9508c9478397664f0a5cf3226d482ac2533d2f433f524d093e0a322
7
+ data.tar.gz: 769ca5bf411c393fa32f1c46acf7922b3cd80d9390b36ce3bfaf07ab9439cd4d229d69cbba792ee7917e8e1aa33cefd0e7cbee619a7f0226820408c26e020d20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v4.11.0 - 2026-02-11
4
+ ### Changes
5
+ * :sparkles: add complementary accessors for ObjectField
6
+
3
7
  ## v4.10.1 - 2026-02-05
4
8
  ### Fixes
5
9
  * :bug: fix NoMethodError in JobWebhook when error is nil (#222) (Co-authored-by: haris_delalic <haris.delalic@datamolino.com>)
@@ -85,6 +85,49 @@ module Mindee
85
85
  def get_simple_field(key)
86
86
  @fields.get_simple_field(key)
87
87
  end
88
+
89
+ # Get a field by key and ensure it is a ListField.
90
+ # @param key [String] Field key to retrieve.
91
+ # @return [ListField] The ListField.
92
+ # @raise [TypeError] If the field is not a ListField.
93
+ def get_list_field(key)
94
+ field = @fields.get_list_field(key)
95
+ raise TypeError, "Field #{key} is not a ListField" unless field.is_a?(ListField)
96
+
97
+ field
98
+ end
99
+
100
+ # Get a field by key and ensure it is an ObjectField.
101
+ # @param key [String] Field key to retrieve.
102
+ # @return [ObjectField] The ObjectField.
103
+ # @raise [TypeError] If the field is not an ObjectField.
104
+ def get_object_field(key)
105
+ field = @fields.get_object_field(key)
106
+ raise TypeError, "Field #{key} is not an ObjectField" unless field.is_a?(ObjectField)
107
+
108
+ field
109
+ end
110
+
111
+ # Get all simple fields.
112
+ # @return [Hash<String, SimpleField>] Simple fields contained in the object.
113
+ def simple_fields
114
+ # @type var fields: Hash<String, SimpleField>
115
+ @fields.select { |_, value| value.is_a?(SimpleField) }
116
+ end
117
+
118
+ # Get all list fields.
119
+ # @return [Hash<String, ListField>] List fields contained in the object.
120
+ def list_fields
121
+ # @type var fields: Hash<String, ListField>
122
+ @fields.select { |_, value| value.is_a?(ListField) }
123
+ end
124
+
125
+ # Get all object fields.
126
+ # @return [Hash<String, ObjectField>] Object fields contained in the object.
127
+ def object_fields
128
+ # @type var fields: Hash<String, ObjectField>
129
+ @fields.select { |_, value| value.is_a?(ObjectField) }
130
+ end
88
131
  end
89
132
  end
90
133
  end
@@ -3,7 +3,7 @@
3
3
  # Mindee
4
4
  module Mindee
5
5
  # Current version.
6
- VERSION = '4.10.1'
6
+ VERSION = '4.11.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [Symbol, Hash[String | Symbol, Regexp], Nil?]
@@ -1,5 +1,4 @@
1
- # TypeProf 0.30.1
2
-
1
+ # lib/mindee/parsing/v2/field/object_field.rb
3
2
  module Mindee
4
3
  module Parsing
5
4
  module V2
@@ -8,7 +7,15 @@ module Mindee
8
7
  class ObjectField < BaseField
9
8
  attr_reader fields: InferenceFields
10
9
  def initialize: (Hash[String | Symbol, untyped], ?Integer) -> void
10
+
11
11
  def get_simple_field: (String) -> SimpleField
12
+ def get_list_field: (String) -> ListField
13
+ def get_object_field: (String) -> ObjectField
14
+
15
+ def simple_fields: () -> Hash[String, SimpleField]
16
+ def list_fields: () -> Hash[String, ListField]
17
+ def object_fields: () -> Hash[String, ObjectField]
18
+
12
19
  def multi_str: -> String
13
20
  def single_str: -> String
14
21
  def to_s: -> String
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindee
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.1
4
+ version: 4.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindee, SA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-05 00:00:00.000000000 Z
11
+ date: 2026-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64