retab 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retab/client.rb +8 -0
  3. data/lib/retab/consensus/create_consensus_request.rb +28 -0
  4. data/lib/retab/consensus/reconciliation_alignment.rb +30 -0
  5. data/lib/retab/consensus/reconciliation_field.rb +34 -0
  6. data/lib/retab/consensus/reconciliation_path_alignment.rb +25 -0
  7. data/lib/retab/consensus/reconciliation_result.rb +31 -0
  8. data/lib/retab/consensus.rb +46 -0
  9. data/lib/retab/experiment_run_metrics/experiment_summary_metrics_response.rb +6 -0
  10. data/lib/retab/extractions/extraction_request.rb +3 -3
  11. data/lib/retab/extractions.rb +6 -6
  12. data/lib/retab/paginated_list.rb +1 -1
  13. data/lib/retab/splits/reconstruct_document_ref.rb +28 -0
  14. data/lib/retab/splits/reconstruct_enriched_row.rb +20 -0
  15. data/lib/retab/splits/reconstruct_enriched_table.rb +31 -0
  16. data/lib/retab/splits/reconstruct_enrichment_options.rb +28 -0
  17. data/lib/retab/splits/reconstruct_request.rb +25 -0
  18. data/lib/retab/splits/reconstruct_response.rb +20 -0
  19. data/lib/retab/splits/reconstruct_subdocument.rb +31 -0
  20. data/lib/retab/splits/sheet_region.rb +40 -0
  21. data/lib/retab/splits/split_result.rb +5 -2
  22. data/lib/retab/splits.rb +30 -0
  23. data/lib/retab/types/usage_order.rb +9 -0
  24. data/lib/retab/usage/usage_block_record.rb +49 -0
  25. data/lib/retab/usage/usage_primitive_document.rb +25 -0
  26. data/lib/retab/usage/usage_primitive_record.rb +73 -0
  27. data/lib/retab/usage/usage_primitive_triggered_by.rb +40 -0
  28. data/lib/retab/usage/usage_run_record.rb +58 -0
  29. data/lib/retab/usage/v_1_usage_usage_run_triggered_by.rb +28 -0
  30. data/lib/retab/usage.rb +267 -0
  31. data/lib/retab/version.rb +1 -1
  32. data/lib/retab/workflow_experiments.rb +5 -1
  33. data/lib/retab/workflow_reviews/review.rb +0 -2
  34. data/lib/retab/workflow_reviews/review_all_of.rb +0 -2
  35. data/lib/retab/workflow_reviews/review_any_of.rb +0 -2
  36. data/lib/retab/workflow_runs/create_workflow_run_request.rb +5 -2
  37. data/lib/retab/workflow_runs/workflow_run.rb +5 -2
  38. data/lib/retab/workflow_runs.rb +9 -1
  39. data/lib/retab/workflow_steps.rb +5 -0
  40. data/lib/retab/workflows/workflow.rb +2 -8
  41. data/lib/retab.rb +2 -0
  42. data/rbi/retab/client.rbi +6 -0
  43. data/rbi/retab/consensus.rbi +23 -0
  44. data/rbi/retab/create_consensus_request.rbi +36 -0
  45. data/rbi/retab/create_workflow_run_request.rbi +6 -0
  46. data/rbi/retab/experiment_summary_metrics_response.rbi +12 -0
  47. data/rbi/retab/extraction_request.rbi +4 -4
  48. data/rbi/retab/extractions.rbi +4 -4
  49. data/rbi/retab/reconciliation_alignment.rbi +36 -0
  50. data/rbi/retab/reconciliation_field.rbi +48 -0
  51. data/rbi/retab/reconciliation_path_alignment.rbi +30 -0
  52. data/rbi/retab/reconciliation_result.rbi +42 -0
  53. data/rbi/retab/{review_field_confidence_lt.rbi → reconstruct_document_ref.rbi} +11 -11
  54. data/rbi/retab/reconstruct_enriched_row.rbi +24 -0
  55. data/rbi/retab/reconstruct_enriched_table.rbi +42 -0
  56. data/rbi/retab/reconstruct_enrichment_options.rbi +36 -0
  57. data/rbi/retab/reconstruct_request.rbi +30 -0
  58. data/rbi/retab/reconstruct_response.rbi +24 -0
  59. data/rbi/retab/reconstruct_subdocument.rbi +42 -0
  60. data/rbi/retab/review.rbi +2 -2
  61. data/rbi/retab/review_all_of.rbi +2 -2
  62. data/rbi/retab/review_any_of.rbi +2 -2
  63. data/rbi/retab/sheet_region.rbi +60 -0
  64. data/rbi/retab/split_result.rbi +6 -0
  65. data/rbi/retab/splits.rbi +9 -0
  66. data/rbi/retab/usage.rbi +68 -0
  67. data/rbi/retab/usage_block_record.rbi +78 -0
  68. data/rbi/retab/usage_primitive_document.rbi +30 -0
  69. data/rbi/retab/usage_primitive_record.rbi +126 -0
  70. data/rbi/retab/usage_primitive_triggered_by.rbi +60 -0
  71. data/rbi/retab/usage_run_record.rbi +96 -0
  72. data/rbi/retab/v_1_usage_usage_run_triggered_by.rbi +36 -0
  73. data/rbi/retab/workflow.rbi +0 -12
  74. data/rbi/retab/workflow_experiment.rbi +2 -2
  75. data/rbi/retab/workflow_experiments.rbi +2 -1
  76. data/rbi/retab/workflow_run.rbi +6 -0
  77. data/rbi/retab/workflow_runs.rbi +4 -2
  78. data/rbi/retab/workflow_steps.rbi +2 -1
  79. metadata +45 -6
  80. data/lib/retab/types/workflow_authz_status.rb +0 -16
  81. data/lib/retab/types/workflow_capabilities.rb +0 -26
  82. data/lib/retab/workflow_reviews/review_field_confidence_lt.rb +0 -28
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class UsageBlockRecord < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ block_id: :block_id,
10
+ block_type: :block_type,
11
+ credits: :credits,
12
+ execution_count: :execution_count,
13
+ first_activity_at: :first_activity_at,
14
+ last_activity_at: :last_activity_at,
15
+ page_count: :page_count,
16
+ run_count: :run_count,
17
+ status_counts: :status_counts,
18
+ workflow_id: :workflow_id
19
+ }.freeze
20
+
21
+ attr_accessor(
22
+ :block_id,
23
+ :block_type,
24
+ :credits,
25
+ :execution_count,
26
+ :first_activity_at,
27
+ :last_activity_at,
28
+ :page_count,
29
+ :run_count,
30
+ :status_counts,
31
+ :workflow_id
32
+ )
33
+
34
+ def initialize(json)
35
+ super()
36
+ hash = self.class.normalize(json)
37
+ @block_id = hash[:block_id]
38
+ @block_type = hash[:block_type]
39
+ @credits = hash[:credits]
40
+ @execution_count = hash[:execution_count]
41
+ @first_activity_at = hash[:first_activity_at]
42
+ @last_activity_at = hash[:last_activity_at]
43
+ @page_count = hash[:page_count]
44
+ @run_count = hash[:run_count]
45
+ @status_counts = hash[:status_counts] || {}
46
+ @workflow_id = hash[:workflow_id]
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class UsagePrimitiveDocument < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ file_id: :file_id,
10
+ filename: :filename
11
+ }.freeze
12
+
13
+ attr_accessor(
14
+ :file_id,
15
+ :filename
16
+ )
17
+
18
+ def initialize(json)
19
+ super()
20
+ hash = self.class.normalize(json)
21
+ @file_id = hash[:file_id]
22
+ @filename = hash[:filename]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class UsagePrimitiveRecord < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ block_id: :block_id,
10
+ completed_at: :completed_at,
11
+ created_at: :created_at,
12
+ credits: :credits,
13
+ documents: :documents,
14
+ duration_ms: :duration_ms,
15
+ environment_id: :environment_id,
16
+ metadata: :metadata,
17
+ model: :model,
18
+ operation: :operation,
19
+ page_count: :page_count,
20
+ primitive_execution_id: :primitive_execution_id,
21
+ project_id: :project_id,
22
+ resource_kind: :resource_kind,
23
+ run_id: :run_id,
24
+ status: :status,
25
+ triggered_by: :triggered_by,
26
+ workflow_id: :workflow_id
27
+ }.freeze
28
+
29
+ attr_accessor(
30
+ :block_id,
31
+ :completed_at,
32
+ :created_at,
33
+ :credits,
34
+ :documents,
35
+ :duration_ms,
36
+ :environment_id,
37
+ :metadata,
38
+ :model,
39
+ :operation,
40
+ :page_count,
41
+ :primitive_execution_id,
42
+ :project_id,
43
+ :resource_kind,
44
+ :run_id,
45
+ :status,
46
+ :triggered_by,
47
+ :workflow_id
48
+ )
49
+
50
+ def initialize(json)
51
+ super()
52
+ hash = self.class.normalize(json)
53
+ @block_id = hash[:block_id]
54
+ @completed_at = hash[:completed_at]
55
+ @created_at = hash[:created_at]
56
+ @credits = hash[:credits]
57
+ @documents = (hash[:documents] || []).map { |item| item ? Retab::UsagePrimitiveDocument.new(item) : nil }
58
+ @duration_ms = hash[:duration_ms]
59
+ @environment_id = hash[:environment_id]
60
+ @metadata = hash[:metadata] || {}
61
+ @model = hash[:model]
62
+ @operation = hash[:operation]
63
+ @page_count = hash[:page_count]
64
+ @primitive_execution_id = hash[:primitive_execution_id]
65
+ @project_id = hash[:project_id]
66
+ @resource_kind = hash[:resource_kind]
67
+ @run_id = hash[:run_id]
68
+ @status = hash[:status]
69
+ @triggered_by = hash[:triggered_by] ? Retab::UsagePrimitiveTriggeredBy.new(hash[:triggered_by]) : nil
70
+ @workflow_id = hash[:workflow_id]
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class UsagePrimitiveTriggeredBy < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ access_token_id: :access_token_id,
10
+ api_key_id: :api_key_id,
11
+ auth_method: :auth_method,
12
+ key_name: :key_name,
13
+ key_prefix: :key_prefix,
14
+ user_email: :user_email,
15
+ user_id: :user_id
16
+ }.freeze
17
+
18
+ attr_accessor(
19
+ :access_token_id,
20
+ :api_key_id,
21
+ :auth_method,
22
+ :key_name,
23
+ :key_prefix,
24
+ :user_email,
25
+ :user_id
26
+ )
27
+
28
+ def initialize(json)
29
+ super()
30
+ hash = self.class.normalize(json)
31
+ @access_token_id = hash[:access_token_id]
32
+ @api_key_id = hash[:api_key_id]
33
+ @auth_method = hash[:auth_method]
34
+ @key_name = hash[:key_name]
35
+ @key_prefix = hash[:key_prefix]
36
+ @user_email = hash[:user_email]
37
+ @user_id = hash[:user_id]
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class UsageRunRecord < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ completed_at: :completed_at,
10
+ created_at: :created_at,
11
+ credits: :credits,
12
+ duration_ms: :duration_ms,
13
+ execution_duration_ms: :execution_duration_ms,
14
+ page_count: :page_count,
15
+ retry_count: :retry_count,
16
+ run_id: :run_id,
17
+ started_at: :started_at,
18
+ status: :status,
19
+ trigger_type: :trigger_type,
20
+ triggered_by: :triggered_by,
21
+ workflow_id: :workflow_id
22
+ }.freeze
23
+
24
+ attr_accessor(
25
+ :completed_at,
26
+ :created_at,
27
+ :credits,
28
+ :duration_ms,
29
+ :execution_duration_ms,
30
+ :page_count,
31
+ :retry_count,
32
+ :run_id,
33
+ :started_at,
34
+ :status,
35
+ :trigger_type,
36
+ :triggered_by,
37
+ :workflow_id
38
+ )
39
+
40
+ def initialize(json)
41
+ super()
42
+ hash = self.class.normalize(json)
43
+ @completed_at = hash[:completed_at]
44
+ @created_at = hash[:created_at]
45
+ @credits = hash[:credits]
46
+ @duration_ms = hash[:duration_ms]
47
+ @execution_duration_ms = hash[:execution_duration_ms]
48
+ @page_count = hash[:page_count]
49
+ @retry_count = hash[:retry_count]
50
+ @run_id = hash[:run_id]
51
+ @started_at = hash[:started_at]
52
+ @status = hash[:status]
53
+ @trigger_type = hash[:trigger_type]
54
+ @triggered_by = hash[:triggered_by] ? Retab::V1UsageUsageRunTriggeredBy.new(hash[:triggered_by]) : nil
55
+ @workflow_id = hash[:workflow_id]
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class V1UsageUsageRunTriggeredBy < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ api_key_id: :api_key_id,
10
+ user_email: :user_email,
11
+ user_id: :user_id
12
+ }.freeze
13
+
14
+ attr_accessor(
15
+ :api_key_id,
16
+ :user_email,
17
+ :user_id
18
+ )
19
+
20
+ def initialize(json)
21
+ super()
22
+ hash = self.class.normalize(json)
23
+ @api_key_id = hash[:api_key_id]
24
+ @user_email = hash[:user_email]
25
+ @user_id = hash[:user_id]
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,267 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "json"
6
+
7
+ module Retab
8
+ class Usage
9
+ def initialize(client)
10
+ @client = client
11
+ end
12
+
13
+ # List Usage Blocks
14
+ # @param limit [Integer, nil] Maximum number of block rows to return.
15
+ # @param order [Retab::Types::UsageOrder, nil] Sort direction on block id.
16
+ # @param before [String, nil] Return blocks before this cursor (opaque token from a prior page's list_metadata).
17
+ # @param after [String, nil] Return blocks after this cursor (opaque token from a prior page's list_metadata).
18
+ # @param workflow_id [String, nil] Filter to a single workflow id.
19
+ # @param block_type [String, nil] Filter by block type: extract, classify, split, parse, edit, or partition. These are the primitive-kind names recorded on the execution, which differ from the workflow block type enum (a classifier block records classify). An unknown value is rejected with 422.
20
+ # @param from_date [String, nil] Inclusive activity lower bound (YYYY-MM-DD, UTC).
21
+ # @param to_date [String, nil] Inclusive activity upper bound (YYYY-MM-DD, UTC).
22
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
23
+ # @return [Retab::PaginatedList<Retab::UsageBlockRecord>]
24
+ def list_blocks(
25
+ limit: 20,
26
+ order: "desc",
27
+ before: nil,
28
+ after: nil,
29
+ workflow_id: nil,
30
+ block_type: nil,
31
+ from_date: nil,
32
+ to_date: nil,
33
+ request_options: {}
34
+ )
35
+ params = {
36
+ "limit" => limit,
37
+ "order" => order,
38
+ "before" => before,
39
+ "after" => after,
40
+ "workflow_id" => workflow_id,
41
+ "block_type" => block_type,
42
+ "from_date" => from_date,
43
+ "to_date" => to_date
44
+ }.compact
45
+ response = @client.request(
46
+ method: :get,
47
+ path: "/v1/usage/blocks",
48
+ auth: true,
49
+ params: params,
50
+ request_options: request_options
51
+ )
52
+ fetch_next = -> (cursor) {
53
+ list_blocks(
54
+ limit: limit,
55
+ order: order,
56
+ before: before,
57
+ after: cursor,
58
+ workflow_id: workflow_id,
59
+ block_type: block_type,
60
+ from_date: from_date,
61
+ to_date: to_date,
62
+ request_options: request_options
63
+ )
64
+ }
65
+ Retab::PaginatedList.from_response(
66
+ response,
67
+ model: Retab::UsageBlockRecord,
68
+ filters: {
69
+ limit: limit,
70
+ order: order,
71
+ before: before,
72
+ workflow_id: workflow_id,
73
+ block_type: block_type,
74
+ from_date: from_date,
75
+ to_date: to_date
76
+ },
77
+ fetch_next: fetch_next
78
+ )
79
+ end
80
+
81
+ # List Usage Primitives
82
+ # @param limit [Integer, nil] Maximum number of execution rows to return.
83
+ # @param order [Retab::Types::UsageOrder, nil] Sort direction on execution created_at.
84
+ # @param before [String, nil] Return executions before this primitive-execution id (keyset cursor).
85
+ # @param after [String, nil] Return executions after this primitive-execution id (keyset cursor).
86
+ # @param environment_id [String, nil] Scope the export to this environment id within the caller's organization. Defaults to the authenticated identity's environment.
87
+ # @param workflow_id [String, nil] Filter to a single workflow id (origin workflow).
88
+ # @param project_id [String, nil] Filter to executions owned by a single project id.
89
+ # @param api_key_id [String, nil] Filter to executions triggered by a single API key id (the api_key_id returned under triggered_by).
90
+ # @param access_token_id [String, nil] Filter to executions triggered by a single access token id (the access_token_id returned under triggered_by).
91
+ # @param user_id [String, nil] Filter to executions triggered by a single user id (the user_id returned under triggered_by).
92
+ # @param run_id [String, nil] Filter to a single workflow run id (origin run).
93
+ # @param block_id [String, nil] Filter to a single workflow block id (origin block).
94
+ # @param operation [String, nil] Filter by operation: extraction, classify, split, parse, edit, partition, or schema_generation. The stored-kind aliases extract and classification are also accepted. An unknown value is rejected with 422.
95
+ # @param status [String, nil] Filter by execution lifecycle status: created, running, completed, failed, or canceled. Note the single-l spelling: a primitive execution is canceled, whereas a workflow run's status is cancelled. An unknown value is rejected with 422.
96
+ # @param metadata [String, nil] Filter by metadata equality: a JSON object of string key/value pairs (e.g. {"tenant":"acme"}). Pairs AND together.
97
+ # @param from_date [String, nil] Inclusive created_at lower bound (YYYY-MM-DD, UTC).
98
+ # @param to_date [String, nil] Inclusive created_at upper bound (YYYY-MM-DD, UTC).
99
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
100
+ # @return [Retab::PaginatedList<Retab::UsagePrimitiveRecord>]
101
+ def list_primitives(
102
+ limit: 20,
103
+ order: "desc",
104
+ before: nil,
105
+ after: nil,
106
+ environment_id: nil,
107
+ workflow_id: nil,
108
+ project_id: nil,
109
+ api_key_id: nil,
110
+ access_token_id: nil,
111
+ user_id: nil,
112
+ run_id: nil,
113
+ block_id: nil,
114
+ operation: nil,
115
+ status: nil,
116
+ metadata: nil,
117
+ from_date: nil,
118
+ to_date: nil,
119
+ request_options: {}
120
+ )
121
+ params = {
122
+ "limit" => limit,
123
+ "order" => order,
124
+ "before" => before,
125
+ "after" => after,
126
+ "environment_id" => environment_id,
127
+ "workflow_id" => workflow_id,
128
+ "project_id" => project_id,
129
+ "api_key_id" => api_key_id,
130
+ "access_token_id" => access_token_id,
131
+ "user_id" => user_id,
132
+ "run_id" => run_id,
133
+ "block_id" => block_id,
134
+ "operation" => operation,
135
+ "status" => status,
136
+ "metadata" => metadata,
137
+ "from_date" => from_date,
138
+ "to_date" => to_date
139
+ }.compact
140
+ response = @client.request(
141
+ method: :get,
142
+ path: "/v1/usage/primitives",
143
+ auth: true,
144
+ params: params,
145
+ request_options: request_options
146
+ )
147
+ fetch_next = -> (cursor) {
148
+ list_primitives(
149
+ limit: limit,
150
+ order: order,
151
+ before: before,
152
+ after: cursor,
153
+ environment_id: environment_id,
154
+ workflow_id: workflow_id,
155
+ project_id: project_id,
156
+ api_key_id: api_key_id,
157
+ access_token_id: access_token_id,
158
+ user_id: user_id,
159
+ run_id: run_id,
160
+ block_id: block_id,
161
+ operation: operation,
162
+ status: status,
163
+ metadata: metadata,
164
+ from_date: from_date,
165
+ to_date: to_date,
166
+ request_options: request_options
167
+ )
168
+ }
169
+ Retab::PaginatedList.from_response(
170
+ response,
171
+ model: Retab::UsagePrimitiveRecord,
172
+ filters: {
173
+ limit: limit,
174
+ order: order,
175
+ before: before,
176
+ environment_id: environment_id,
177
+ workflow_id: workflow_id,
178
+ project_id: project_id,
179
+ api_key_id: api_key_id,
180
+ access_token_id: access_token_id,
181
+ user_id: user_id,
182
+ run_id: run_id,
183
+ block_id: block_id,
184
+ operation: operation,
185
+ status: status,
186
+ metadata: metadata,
187
+ from_date: from_date,
188
+ to_date: to_date
189
+ },
190
+ fetch_next: fetch_next
191
+ )
192
+ end
193
+
194
+ # List Usage Runs
195
+ # @param limit [Integer, nil] Maximum number of run rows to return.
196
+ # @param order [Retab::Types::UsageOrder, nil] Sort direction on run created_at.
197
+ # @param before [String, nil] Return runs before this run id (keyset cursor).
198
+ # @param after [String, nil] Return runs after this run id (keyset cursor).
199
+ # @param workflow_id [String, nil] Filter to a single workflow id.
200
+ # @param status [String, nil] Filter by lifecycle status: pending, queued, running, completed, error, failed, awaiting_review, or cancelled.
201
+ # @param trigger_type [String, nil] Filter by trigger type: manual, api, schedule, webhook, email, or restart.
202
+ # @param from_date [String, nil] Inclusive created_at lower bound (YYYY-MM-DD, UTC).
203
+ # @param to_date [String, nil] Inclusive created_at upper bound (YYYY-MM-DD, UTC).
204
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
205
+ # @return [Retab::PaginatedList<Retab::UsageRunRecord>]
206
+ def list_runs(
207
+ limit: 20,
208
+ order: "desc",
209
+ before: nil,
210
+ after: nil,
211
+ workflow_id: nil,
212
+ status: nil,
213
+ trigger_type: nil,
214
+ from_date: nil,
215
+ to_date: nil,
216
+ request_options: {}
217
+ )
218
+ params = {
219
+ "limit" => limit,
220
+ "order" => order,
221
+ "before" => before,
222
+ "after" => after,
223
+ "workflow_id" => workflow_id,
224
+ "status" => status,
225
+ "trigger_type" => trigger_type,
226
+ "from_date" => from_date,
227
+ "to_date" => to_date
228
+ }.compact
229
+ response = @client.request(
230
+ method: :get,
231
+ path: "/v1/usage/runs",
232
+ auth: true,
233
+ params: params,
234
+ request_options: request_options
235
+ )
236
+ fetch_next = -> (cursor) {
237
+ list_runs(
238
+ limit: limit,
239
+ order: order,
240
+ before: before,
241
+ after: cursor,
242
+ workflow_id: workflow_id,
243
+ status: status,
244
+ trigger_type: trigger_type,
245
+ from_date: from_date,
246
+ to_date: to_date,
247
+ request_options: request_options
248
+ )
249
+ }
250
+ Retab::PaginatedList.from_response(
251
+ response,
252
+ model: Retab::UsageRunRecord,
253
+ filters: {
254
+ limit: limit,
255
+ order: order,
256
+ before: before,
257
+ workflow_id: workflow_id,
258
+ status: status,
259
+ trigger_type: trigger_type,
260
+ from_date: from_date,
261
+ to_date: to_date
262
+ },
263
+ fetch_next: fetch_next
264
+ )
265
+ end
266
+ end
267
+ end
data/lib/retab/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  # @oagen-ignore-file
6
6
 
7
7
  module Retab
8
- VERSION = "0.1.10"
8
+ VERSION = "0.1.12"
9
9
  end
@@ -24,6 +24,7 @@ module Retab
24
24
 
25
25
  # List Experiments
26
26
  # @param workflow_id [String]
27
+ # @param block_id [String, nil]
27
28
  # @param before [String, nil]
28
29
  # @param after [String, nil]
29
30
  # @param limit [Integer, nil]
@@ -32,6 +33,7 @@ module Retab
32
33
  # @return [Retab::PaginatedList<Retab::WorkflowExperiment>]
33
34
  def list(
34
35
  workflow_id:,
36
+ block_id: nil,
35
37
  before: nil,
36
38
  after: nil,
37
39
  limit: 50,
@@ -40,6 +42,7 @@ module Retab
40
42
  )
41
43
  params = {
42
44
  "workflow_id" => workflow_id,
45
+ "block_id" => block_id,
43
46
  "before" => before,
44
47
  "after" => after,
45
48
  "limit" => limit,
@@ -55,6 +58,7 @@ module Retab
55
58
  fetch_next = -> (cursor) {
56
59
  list(
57
60
  workflow_id: workflow_id,
61
+ block_id: block_id,
58
62
  before: before,
59
63
  after: cursor,
60
64
  limit: limit,
@@ -65,7 +69,7 @@ module Retab
65
69
  Retab::PaginatedList.from_response(
66
70
  response,
67
71
  model: Retab::WorkflowExperiment,
68
- filters: {workflow_id: workflow_id, before: before, limit: limit, order: order},
72
+ filters: {workflow_id: workflow_id, block_id: block_id, before: before, limit: limit, order: order},
69
73
  fetch_next: fetch_next
70
74
  )
71
75
  end
@@ -67,8 +67,6 @@ module Retab
67
67
  Retab::ReviewCategoryIn.new(hash[:triggered_by])
68
68
  when "confidence_lt"
69
69
  Retab::ReviewConfidenceLt.new(hash[:triggered_by])
70
- when "field_confidence_lt"
71
- Retab::ReviewFieldConfidenceLt.new(hash[:triggered_by])
72
70
  when "json_condition"
73
71
  Retab::ReviewJsonCondition.new(hash[:triggered_by])
74
72
  when "split_count_neq"
@@ -40,8 +40,6 @@ module Retab
40
40
  Retab::ReviewCategoryIn.new(item)
41
41
  when "confidence_lt"
42
42
  Retab::ReviewConfidenceLt.new(item)
43
- when "field_confidence_lt"
44
- Retab::ReviewFieldConfidenceLt.new(item)
45
43
  when "json_condition"
46
44
  Retab::ReviewJsonCondition.new(item)
47
45
  when "split_count_neq"
@@ -40,8 +40,6 @@ module Retab
40
40
  Retab::ReviewCategoryIn.new(item)
41
41
  when "confidence_lt"
42
42
  Retab::ReviewConfidenceLt.new(item)
43
- when "field_confidence_lt"
44
- Retab::ReviewFieldConfidenceLt.new(item)
45
43
  when "json_condition"
46
44
  Retab::ReviewJsonCondition.new(item)
47
45
  when "split_count_neq"
@@ -9,14 +9,16 @@ module Retab
9
9
  workflow_id: :workflow_id,
10
10
  documents: :documents,
11
11
  json_inputs: :json_inputs,
12
- version: :version
12
+ version: :version,
13
+ metadata: :metadata
13
14
  }.freeze
14
15
 
15
16
  attr_accessor(
16
17
  :workflow_id,
17
18
  :documents,
18
19
  :json_inputs,
19
- :version
20
+ :version,
21
+ :metadata
20
22
  )
21
23
 
22
24
  def initialize(json)
@@ -26,6 +28,7 @@ module Retab
26
28
  @documents = hash[:documents] || {}
27
29
  @json_inputs = hash[:json_inputs] || {}
28
30
  @version = hash[:version].nil? ? "production" : hash[:version]
31
+ @metadata = hash[:metadata] || {}
29
32
  end
30
33
  end
31
34
  end
@@ -12,7 +12,8 @@ module Retab
12
12
  trigger: :trigger,
13
13
  lifecycle: :lifecycle,
14
14
  timing: :timing,
15
- inputs: :inputs
15
+ inputs: :inputs,
16
+ metadata: :metadata
16
17
  }.freeze
17
18
 
18
19
  attr_accessor(
@@ -22,7 +23,8 @@ module Retab
22
23
  :trigger,
23
24
  :lifecycle,
24
25
  :timing,
25
- :inputs
26
+ :inputs,
27
+ :metadata
26
28
  )
27
29
 
28
30
  def initialize(json)
@@ -52,6 +54,7 @@ module Retab
52
54
  ) : nil
53
55
  @timing = hash[:timing] ? Retab::RunTiming.new(hash[:timing]) : nil
54
56
  @inputs = hash[:inputs] ? Retab::RunInputs.new(hash[:inputs]) : nil
57
+ @metadata = hash[:metadata] || {}
55
58
  end
56
59
  end
57
60
  end