retab 0.1.6 → 0.1.7

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/base_client.rb +9 -2
  3. data/lib/retab/experiment_runs/experiment_run.rb +9 -0
  4. data/lib/retab/multipart.rb +73 -0
  5. data/lib/retab/secrets.rb +6 -6
  6. data/lib/retab/tables/{body_create_table_v_1_tables_post.rb → create_workflow_table_upload_request.rb} +6 -3
  7. data/lib/retab/tables/{body_replace_table_v_1_tables_table_id_put.rb → replace_workflow_table_upload_request.rb} +1 -1
  8. data/lib/retab/tables/workflow_table.rb +3 -0
  9. data/lib/retab/tables.rb +40 -35
  10. data/lib/retab/types/artifact_drift_status.rb +15 -0
  11. data/lib/retab/types/artifact_freshness_reasons.rb +16 -0
  12. data/lib/retab/types/artifact_freshness_status.rb +14 -0
  13. data/lib/retab/types/workflow_authz_status.rb +16 -0
  14. data/lib/retab/types/workflow_block_version_type.rb +9 -0
  15. data/lib/retab/types/workflow_capabilities.rb +26 -0
  16. data/lib/retab/types/workflow_config_block_type.rb +9 -0
  17. data/lib/retab/types/workflow_table_validation_column_rule_type.rb +18 -0
  18. data/lib/retab/workflow_blocks/workflow_block_version.rb +64 -0
  19. data/lib/retab/workflow_blocks/workflow_block_version_diff.rb +31 -0
  20. data/lib/retab/workflow_blocks/workflow_version_field_diff.rb +28 -0
  21. data/lib/retab/workflow_blocks.rb +135 -1
  22. data/lib/retab/workflow_edges/workflow_edge_version.rb +49 -0
  23. data/lib/retab/workflow_edges/workflow_edge_version_diff.rb +31 -0
  24. data/lib/retab/workflow_edges.rb +134 -0
  25. data/lib/retab/workflow_experiments/artifact_drift.rb +28 -0
  26. data/lib/retab/workflow_experiments/artifact_freshness.rb +34 -0
  27. data/lib/retab/workflow_experiments/workflow_experiment.rb +8 -2
  28. data/lib/retab/workflow_review_versions.rb +3 -3
  29. data/lib/retab/workflow_reviews.rb +4 -4
  30. data/lib/retab/workflow_runs.rb +1 -1
  31. data/lib/retab/workflow_spec.rb +6 -57
  32. data/lib/retab/workflow_test_runs/workflow_test_run.rb +5 -2
  33. data/lib/retab/workflow_tests/latest_block_test_run_summary.rb +6 -0
  34. data/lib/retab/workflow_tests/workflow_test.rb +6 -0
  35. data/lib/retab/workflows/create_workflow_request.rb +5 -2
  36. data/lib/retab/{workflow_spec → workflows}/declarative_workflow_request.rb +7 -2
  37. data/lib/retab/workflows/workflow.rb +11 -2
  38. data/lib/retab/workflows/workflow_block_position.rb +25 -0
  39. data/lib/retab/workflows/workflow_config_block.rb +46 -0
  40. data/lib/retab/workflows/workflow_config_edge.rb +37 -0
  41. data/lib/retab/workflows/workflow_graph_version.rb +40 -0
  42. data/lib/retab/workflows/workflow_graph_version_diff.rb +43 -0
  43. data/lib/retab/workflows.rb +209 -3
  44. data/rbi/retab/artifact_drift.rbi +36 -0
  45. data/rbi/retab/artifact_freshness.rbi +48 -0
  46. data/rbi/retab/create_upload_response.rbi +2 -2
  47. data/rbi/retab/create_workflow_request.rbi +6 -0
  48. data/rbi/retab/{body_create_table_v_1_tables_post.rbi → create_workflow_table_upload_request.rbi} +7 -1
  49. data/rbi/retab/declarative_workflow_request.rbi +6 -0
  50. data/rbi/retab/experiment_run.rbi +18 -0
  51. data/rbi/retab/latest_block_test_run_summary.rbi +12 -0
  52. data/rbi/retab/{body_replace_table_v_1_tables_table_id_put.rbi → replace_workflow_table_upload_request.rbi} +1 -1
  53. data/rbi/retab/secret_list_response.rbi +2 -2
  54. data/rbi/retab/tables.rbi +6 -4
  55. data/rbi/retab/workflow.rbi +18 -0
  56. data/rbi/retab/workflow_block_position.rbi +30 -0
  57. data/rbi/retab/workflow_block_version.rbi +108 -0
  58. data/rbi/retab/workflow_block_version_diff.rbi +42 -0
  59. data/rbi/retab/workflow_blocks.rbi +38 -0
  60. data/rbi/retab/workflow_config_block.rbi +72 -0
  61. data/rbi/retab/workflow_config_edge.rbi +54 -0
  62. data/rbi/retab/workflow_edge_version.rbi +78 -0
  63. data/rbi/retab/workflow_edge_version_diff.rbi +42 -0
  64. data/rbi/retab/workflow_edges.rbi +38 -0
  65. data/rbi/retab/workflow_experiment.rbi +12 -0
  66. data/rbi/retab/workflow_graph_version.rbi +60 -0
  67. data/rbi/retab/workflow_graph_version_diff.rbi +66 -0
  68. data/rbi/retab/workflow_spec.rbi +2 -17
  69. data/rbi/retab/workflow_table.rbi +6 -0
  70. data/rbi/retab/workflow_table_list_response.rbi +2 -2
  71. data/rbi/retab/workflow_table_schema_response.rbi +2 -2
  72. data/rbi/retab/workflow_test.rbi +12 -0
  73. data/rbi/retab/workflow_test_run.rbi +6 -0
  74. data/rbi/retab/workflow_version_field_diff.rbi +36 -0
  75. data/rbi/retab/workflows.rbi +61 -2
  76. metadata +45 -12
  77. /data/lib/retab/{workflow_spec → workflows}/declarative_apply_response.rb +0 -0
  78. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_change.rb +0 -0
  79. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_field_change.rb +0 -0
  80. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_resource_change.rb +0 -0
  81. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_response.rb +0 -0
  82. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_summary.rb +0 -0
@@ -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 WorkflowVersionFieldDiff < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ field: :field,
10
+ from_value: :from_value,
11
+ to_value: :to_value
12
+ }.freeze
13
+
14
+ attr_accessor(
15
+ :field,
16
+ :from_value,
17
+ :to_value
18
+ )
19
+
20
+ def initialize(json)
21
+ super()
22
+ hash = self.class.normalize(json)
23
+ @field = hash[:field]
24
+ @from_value = hash[:from_value]
25
+ @to_value = hash[:to_value]
26
+ end
27
+ end
28
+ end
@@ -112,6 +112,140 @@ module Retab
112
112
  result
113
113
  end
114
114
 
115
+ # List Block Versions
116
+ # @param workflow_id [String]
117
+ # @param block_id [String, nil] Filter by stable block ID
118
+ # @param workflow_version_id [String, nil] Filter by workflow version ID
119
+ # @param before [String, nil] Block version cursor before
120
+ # @param after [String, nil] Block version cursor after
121
+ # @param limit [Integer, nil] Maximum number of block versions to return
122
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
123
+ # @return [Retab::PaginatedList<Retab::WorkflowBlockVersion>]
124
+ def list_versions(
125
+ workflow_id:,
126
+ block_id: nil,
127
+ workflow_version_id: nil,
128
+ before: nil,
129
+ after: nil,
130
+ limit: 50,
131
+ request_options: {}
132
+ )
133
+ params = {
134
+ "workflow_id" => workflow_id,
135
+ "block_id" => block_id,
136
+ "workflow_version_id" => workflow_version_id,
137
+ "before" => before,
138
+ "after" => after,
139
+ "limit" => limit
140
+ }.compact
141
+ response = @client.request(
142
+ method: :get,
143
+ path: "/v1/workflows/blocks/versions",
144
+ auth: true,
145
+ params: params,
146
+ request_options: request_options
147
+ )
148
+ fetch_next = -> (cursor) {
149
+ list_versions(
150
+ workflow_id: workflow_id,
151
+ block_id: block_id,
152
+ workflow_version_id: workflow_version_id,
153
+ before: before,
154
+ after: cursor,
155
+ limit: limit,
156
+ request_options: request_options
157
+ )
158
+ }
159
+ Retab::PaginatedList.from_response(
160
+ response,
161
+ model: Retab::WorkflowBlockVersion,
162
+ filters: {
163
+ workflow_id: workflow_id,
164
+ block_id: block_id,
165
+ workflow_version_id: workflow_version_id,
166
+ before: before,
167
+ limit: limit
168
+ },
169
+ fetch_next: fetch_next
170
+ )
171
+ end
172
+
173
+ # Diff Block Versions
174
+ # @param from_block_version_id [String]
175
+ # @param to_block_version_id [String]
176
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
177
+ # @return [Retab::WorkflowBlockVersionDiff]
178
+ def list_diff(
179
+ from_block_version_id:,
180
+ to_block_version_id:,
181
+ request_options: {}
182
+ )
183
+ params = {
184
+ "from_block_version_id" => from_block_version_id,
185
+ "to_block_version_id" => to_block_version_id
186
+ }
187
+ response = @client.request(
188
+ method: :get,
189
+ path: "/v1/workflows/blocks/versions/diff",
190
+ auth: true,
191
+ params: params,
192
+ request_options: request_options
193
+ )
194
+ result = Retab::WorkflowBlockVersionDiff.new(response.body)
195
+ result.last_response = Retab::Types::ApiResponse.new(
196
+ http_status: response.code.to_i,
197
+ http_headers: response.each_header.to_h,
198
+ request_id: response["x-request-id"]
199
+ )
200
+ result
201
+ end
202
+
203
+ # Get Block Version
204
+ # @param block_version_id [String]
205
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
206
+ # @return [Retab::WorkflowBlockVersion]
207
+ def get_version(
208
+ block_version_id:,
209
+ request_options: {}
210
+ )
211
+ response = @client.request(
212
+ method: :get,
213
+ path: "/v1/workflows/blocks/versions/#{Retab::Util.encode_path(block_version_id)}",
214
+ auth: true,
215
+ request_options: request_options
216
+ )
217
+ result = Retab::WorkflowBlockVersion.new(response.body)
218
+ result.last_response = Retab::Types::ApiResponse.new(
219
+ http_status: response.code.to_i,
220
+ http_headers: response.each_header.to_h,
221
+ request_id: response["x-request-id"]
222
+ )
223
+ result
224
+ end
225
+
226
+ # Restore Block Version
227
+ # @param block_version_id [String]
228
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
229
+ # @return [Retab::WorkflowBlock]
230
+ def create_version_restore(
231
+ block_version_id:,
232
+ request_options: {}
233
+ )
234
+ response = @client.request(
235
+ method: :post,
236
+ path: "/v1/workflows/blocks/versions/#{Retab::Util.encode_path(block_version_id)}/restore",
237
+ auth: true,
238
+ request_options: request_options
239
+ )
240
+ result = Retab::WorkflowBlock.new(response.body)
241
+ result.last_response = Retab::Types::ApiResponse.new(
242
+ http_status: response.code.to_i,
243
+ http_headers: response.each_header.to_h,
244
+ request_id: response["x-request-id"]
245
+ )
246
+ result
247
+ end
248
+
115
249
  # Get Block
116
250
  # @param block_id [String]
117
251
  # @param workflow_id [String, nil] Disambiguates a block id that is shared by more than one workflow. Required only when the block id is not unique within your organization — otherwise the call returns 409 listing the colliding workflow_ids. Server-generated block IDs are always unique and never need this.
@@ -220,7 +354,7 @@ module Retab
220
354
  nil
221
355
  end
222
356
 
223
- # Validate Block Config Dry Run
357
+ # Validate Block Config
224
358
  # @param block_id [String]
225
359
  # @param config [Hash{String => Object}] Assembled block config to validate.
226
360
  # @param config_mode [Retab::Types::ValidateWorkflowBlockConfigRequestConfigMode, nil] How to apply the config before validation. 'replace' validates the config as the full block config; 'merge' validates the result of merging it into the existing block config.
@@ -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 WorkflowEdgeVersion < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ id: :id,
10
+ edge_id: :edge_id,
11
+ workflow_id: :workflow_id,
12
+ workflow_version_id: :workflow_version_id,
13
+ source: :source,
14
+ source_handle: :source_handle,
15
+ target: :target,
16
+ target_handle: :target_handle,
17
+ animated: :animated,
18
+ created_at: :created_at
19
+ }.freeze
20
+
21
+ attr_accessor(
22
+ :id,
23
+ :edge_id,
24
+ :workflow_id,
25
+ :workflow_version_id,
26
+ :source,
27
+ :source_handle,
28
+ :target,
29
+ :target_handle,
30
+ :animated,
31
+ :created_at
32
+ )
33
+
34
+ def initialize(json)
35
+ super()
36
+ hash = self.class.normalize(json)
37
+ @id = hash[:id]
38
+ @edge_id = hash[:edge_id]
39
+ @workflow_id = hash[:workflow_id]
40
+ @workflow_version_id = hash[:workflow_version_id]
41
+ @source = hash[:source]
42
+ @source_handle = hash[:source_handle]
43
+ @target = hash[:target]
44
+ @target_handle = hash[:target_handle]
45
+ @animated = hash[:animated].nil? ? true : hash[:animated]
46
+ @created_at = hash[:created_at]
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class WorkflowEdgeVersionDiff < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ from_edge_version_id: :from_edge_version_id,
10
+ to_edge_version_id: :to_edge_version_id,
11
+ edge_id: :edge_id,
12
+ changes: :changes
13
+ }.freeze
14
+
15
+ attr_accessor(
16
+ :from_edge_version_id,
17
+ :to_edge_version_id,
18
+ :edge_id,
19
+ :changes
20
+ )
21
+
22
+ def initialize(json)
23
+ super()
24
+ hash = self.class.normalize(json)
25
+ @from_edge_version_id = hash[:from_edge_version_id]
26
+ @to_edge_version_id = hash[:to_edge_version_id]
27
+ @edge_id = hash[:edge_id]
28
+ @changes = (hash[:changes] || []).map { |item| item ? Retab::WorkflowVersionFieldDiff.new(item) : nil }
29
+ end
30
+ end
31
+ end
@@ -110,6 +110,140 @@ module Retab
110
110
  result
111
111
  end
112
112
 
113
+ # List Edge Versions
114
+ # @param workflow_id [String]
115
+ # @param edge_id [String, nil] Filter by stable edge ID
116
+ # @param workflow_version_id [String, nil] Filter by workflow version ID
117
+ # @param before [String, nil] Edge version cursor before
118
+ # @param after [String, nil] Edge version cursor after
119
+ # @param limit [Integer, nil] Maximum number of edge versions to return
120
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
121
+ # @return [Retab::PaginatedList<Retab::WorkflowEdgeVersion>]
122
+ def list_versions(
123
+ workflow_id:,
124
+ edge_id: nil,
125
+ workflow_version_id: nil,
126
+ before: nil,
127
+ after: nil,
128
+ limit: 50,
129
+ request_options: {}
130
+ )
131
+ params = {
132
+ "workflow_id" => workflow_id,
133
+ "edge_id" => edge_id,
134
+ "workflow_version_id" => workflow_version_id,
135
+ "before" => before,
136
+ "after" => after,
137
+ "limit" => limit
138
+ }.compact
139
+ response = @client.request(
140
+ method: :get,
141
+ path: "/v1/workflows/edges/versions",
142
+ auth: true,
143
+ params: params,
144
+ request_options: request_options
145
+ )
146
+ fetch_next = -> (cursor) {
147
+ list_versions(
148
+ workflow_id: workflow_id,
149
+ edge_id: edge_id,
150
+ workflow_version_id: workflow_version_id,
151
+ before: before,
152
+ after: cursor,
153
+ limit: limit,
154
+ request_options: request_options
155
+ )
156
+ }
157
+ Retab::PaginatedList.from_response(
158
+ response,
159
+ model: Retab::WorkflowEdgeVersion,
160
+ filters: {
161
+ workflow_id: workflow_id,
162
+ edge_id: edge_id,
163
+ workflow_version_id: workflow_version_id,
164
+ before: before,
165
+ limit: limit
166
+ },
167
+ fetch_next: fetch_next
168
+ )
169
+ end
170
+
171
+ # Diff Edge Versions
172
+ # @param from_edge_version_id [String]
173
+ # @param to_edge_version_id [String]
174
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
175
+ # @return [Retab::WorkflowEdgeVersionDiff]
176
+ def list_diff(
177
+ from_edge_version_id:,
178
+ to_edge_version_id:,
179
+ request_options: {}
180
+ )
181
+ params = {
182
+ "from_edge_version_id" => from_edge_version_id,
183
+ "to_edge_version_id" => to_edge_version_id
184
+ }
185
+ response = @client.request(
186
+ method: :get,
187
+ path: "/v1/workflows/edges/versions/diff",
188
+ auth: true,
189
+ params: params,
190
+ request_options: request_options
191
+ )
192
+ result = Retab::WorkflowEdgeVersionDiff.new(response.body)
193
+ result.last_response = Retab::Types::ApiResponse.new(
194
+ http_status: response.code.to_i,
195
+ http_headers: response.each_header.to_h,
196
+ request_id: response["x-request-id"]
197
+ )
198
+ result
199
+ end
200
+
201
+ # Get Edge Version
202
+ # @param edge_version_id [String]
203
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
204
+ # @return [Retab::WorkflowEdgeVersion]
205
+ def get_version(
206
+ edge_version_id:,
207
+ request_options: {}
208
+ )
209
+ response = @client.request(
210
+ method: :get,
211
+ path: "/v1/workflows/edges/versions/#{Retab::Util.encode_path(edge_version_id)}",
212
+ auth: true,
213
+ request_options: request_options
214
+ )
215
+ result = Retab::WorkflowEdgeVersion.new(response.body)
216
+ result.last_response = Retab::Types::ApiResponse.new(
217
+ http_status: response.code.to_i,
218
+ http_headers: response.each_header.to_h,
219
+ request_id: response["x-request-id"]
220
+ )
221
+ result
222
+ end
223
+
224
+ # Restore Edge Version
225
+ # @param edge_version_id [String]
226
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
227
+ # @return [Retab::WorkflowEdgeDoc]
228
+ def create_version_restore(
229
+ edge_version_id:,
230
+ request_options: {}
231
+ )
232
+ response = @client.request(
233
+ method: :post,
234
+ path: "/v1/workflows/edges/versions/#{Retab::Util.encode_path(edge_version_id)}/restore",
235
+ auth: true,
236
+ request_options: request_options
237
+ )
238
+ result = Retab::WorkflowEdgeDoc.new(response.body)
239
+ result.last_response = Retab::Types::ApiResponse.new(
240
+ http_status: response.code.to_i,
241
+ http_headers: response.each_header.to_h,
242
+ request_id: response["x-request-id"]
243
+ )
244
+ result
245
+ end
246
+
113
247
  # Get Edge
114
248
  # @param edge_id [String]
115
249
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
@@ -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 ArtifactDrift < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ status: :status,
10
+ affected_targets: :affected_targets,
11
+ detail: :detail
12
+ }.freeze
13
+
14
+ attr_accessor(
15
+ :status,
16
+ :affected_targets,
17
+ :detail
18
+ )
19
+
20
+ def initialize(json)
21
+ super()
22
+ hash = self.class.normalize(json)
23
+ @status = hash[:status].nil? ? "unknown" : hash[:status]
24
+ @affected_targets = (hash[:affected_targets] || [])
25
+ @detail = hash[:detail]
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class ArtifactFreshness < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ status: :status,
10
+ reasons: :reasons,
11
+ validity_fingerprint: :validity_fingerprint,
12
+ input_fingerprint: :input_fingerprint,
13
+ baseline_run_id: :baseline_run_id
14
+ }.freeze
15
+
16
+ attr_accessor(
17
+ :status,
18
+ :reasons,
19
+ :validity_fingerprint,
20
+ :input_fingerprint,
21
+ :baseline_run_id
22
+ )
23
+
24
+ def initialize(json)
25
+ super()
26
+ hash = self.class.normalize(json)
27
+ @status = hash[:status].nil? ? "unknown" : hash[:status]
28
+ @reasons = (hash[:reasons] || [])
29
+ @validity_fingerprint = hash[:validity_fingerprint]
30
+ @input_fingerprint = hash[:input_fingerprint]
31
+ @baseline_run_id = hash[:baseline_run_id]
32
+ end
33
+ end
34
+ end
@@ -19,8 +19,10 @@ module Retab
19
19
  block_type: :block_type,
20
20
  score: :score,
21
21
  is_stale: :is_stale,
22
+ freshness: :freshness,
22
23
  schema_drift: :schema_drift,
23
- schema_drift_detail: :schema_drift_detail
24
+ schema_drift_detail: :schema_drift_detail,
25
+ drift: :drift
24
26
  }.freeze
25
27
 
26
28
  attr_accessor(
@@ -37,8 +39,10 @@ module Retab
37
39
  :block_type,
38
40
  :score,
39
41
  :is_stale,
42
+ :freshness,
40
43
  :schema_drift,
41
- :schema_drift_detail
44
+ :schema_drift_detail,
45
+ :drift
42
46
  )
43
47
 
44
48
  def initialize(json)
@@ -57,8 +61,10 @@ module Retab
57
61
  @block_type = hash[:block_type]
58
62
  @score = hash[:score]
59
63
  @is_stale = hash[:is_stale].nil? ? false : hash[:is_stale]
64
+ @freshness = hash[:freshness] ? Retab::ArtifactFreshness.new(hash[:freshness]) : nil
60
65
  @schema_drift = hash[:schema_drift].nil? ? "unknown" : hash[:schema_drift]
61
66
  @schema_drift_detail = hash[:schema_drift_detail]
67
+ @drift = hash[:drift] ? Retab::ArtifactDrift.new(hash[:drift]) : nil
62
68
  end
63
69
  end
64
70
  end
@@ -10,7 +10,7 @@ module Retab
10
10
  @client = client
11
11
  end
12
12
 
13
- # List Review Versions Route
13
+ # List Review Versions
14
14
  # @param review_id [String] Required: the review whose versions to list.
15
15
  # @param before [String, nil]
16
16
  # @param after [String, nil]
@@ -54,7 +54,7 @@ module Retab
54
54
  )
55
55
  end
56
56
 
57
- # Create Review Version Route
57
+ # Create Review Version
58
58
  # @param review_id [String]
59
59
  # @param parent_id [String]
60
60
  # @param snapshot [Hash{String => Object}] The full reviewed snapshot to store as an immutable version. The object must match the gated block type: extract uses the raw output object; classifier uses {'category': string}; split uses {'documents': [{'name': string, 'pages': positive sorted int[]}]}; for_each uses {'partitions': [{'key': string, 'pages': positive sorted int[]}]}. The server validates the shape and stores the exact submitted object when valid.
@@ -90,7 +90,7 @@ module Retab
90
90
  result
91
91
  end
92
92
 
93
- # Get Review Version Route
93
+ # Get Review Version
94
94
  # @param version_id [String]
95
95
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
96
96
  # @return [Retab::ReviewVersion]
@@ -14,7 +14,7 @@ module Retab
14
14
  @versions ||= Retab::WorkflowReviewVersions.new(@client)
15
15
  end
16
16
 
17
- # List Reviews Route
17
+ # List Reviews
18
18
  # @param workflow_id [String, nil]
19
19
  # @param run_id [String, nil]
20
20
  # @param block_id [String, nil]
@@ -87,7 +87,7 @@ module Retab
87
87
  )
88
88
  end
89
89
 
90
- # Get Review Route
90
+ # Get Review
91
91
  # @param review_id [String]
92
92
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
93
93
  # @return [Retab::Review]
@@ -110,7 +110,7 @@ module Retab
110
110
  result
111
111
  end
112
112
 
113
- # Approve Review Route
113
+ # Approve Review
114
114
  # @param review_id [String]
115
115
  # @param version_id [String] Exact content-addressed key of the version to approve.
116
116
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
@@ -139,7 +139,7 @@ module Retab
139
139
  result
140
140
  end
141
141
 
142
- # Reject Review Route
142
+ # Reject Review
143
143
  # @param review_id [String]
144
144
  # @param version_id [String] Exact content-addressed key of the version to reject.
145
145
  # @param reason [String] Required, non-empty rejection reason.
@@ -108,7 +108,7 @@ module Retab
108
108
  )
109
109
  end
110
110
 
111
- # Create Workflow Run Route
111
+ # Create Workflow Run
112
112
  # @param workflow_id [String] Workflow id for the fresh run.
113
113
  # @param documents [Hash{String => Retab::MimeData, Retab::FileRef, Pathname, IO, String, Hash}, nil] Mapping of start_document block IDs to their input documents.
114
114
  # @param json_inputs [Hash{String => Object}, nil] Mapping of start-json block IDs to their input JSON data.
@@ -10,71 +10,20 @@ module Retab
10
10
  @client = client
11
11
  end
12
12
 
13
- # Apply Workflow Spec
14
- # @param yaml_definition [String] Workflow YAML definition
15
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
16
- # @return [Retab::DeclarativeApplyResponse]
17
- def apply(
18
- yaml_definition:,
19
- request_options: {}
20
- )
21
- body = {
22
- "yaml_definition" => yaml_definition
23
- }
24
- response = @client.request(
25
- method: :post,
26
- path: "/v1/workflows/spec/apply",
27
- auth: true,
28
- body: body,
29
- request_options: request_options
30
- )
31
- result = Retab::DeclarativeApplyResponse.new(response.body)
32
- result.last_response = Retab::Types::ApiResponse.new(
33
- http_status: response.code.to_i,
34
- http_headers: response.each_header.to_h,
35
- request_id: response["x-request-id"]
36
- )
37
- result
38
- end
39
-
40
- # Plan Workflow Spec
41
- # @param yaml_definition [String] Workflow YAML definition
42
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
43
- # @return [Retab::DeclarativePlanResponse]
44
- def plan(
45
- yaml_definition:,
46
- request_options: {}
47
- )
48
- body = {
49
- "yaml_definition" => yaml_definition
50
- }
51
- response = @client.request(
52
- method: :post,
53
- path: "/v1/workflows/spec/plan",
54
- auth: true,
55
- body: body,
56
- request_options: request_options
57
- )
58
- result = Retab::DeclarativePlanResponse.new(response.body)
59
- result.last_response = Retab::Types::ApiResponse.new(
60
- http_status: response.code.to_i,
61
- http_headers: response.each_header.to_h,
62
- request_id: response["x-request-id"]
63
- )
64
- result
65
- end
66
-
67
13
  # Validate Workflow Spec
68
14
  # @param yaml_definition [String] Workflow YAML definition
15
+ # @param project_id [String, nil] Project that should own a workflow created from this spec. Required when applying a spec that creates a new workflow.
69
16
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
70
17
  # @return [Retab::DeclarativeValidationResponse]
71
18
  def validate(
72
19
  yaml_definition:,
20
+ project_id: nil,
73
21
  request_options: {}
74
22
  )
75
23
  body = {
76
- "yaml_definition" => yaml_definition
77
- }
24
+ "yaml_definition" => yaml_definition,
25
+ "project_id" => project_id
26
+ }.compact
78
27
  response = @client.request(
79
28
  method: :post,
80
29
  path: "/v1/workflows/spec/validate",
@@ -101,7 +50,7 @@ module Retab
101
50
  )
102
51
  response = @client.request(
103
52
  method: :get,
104
- path: "/v1/workflows/spec/#{Retab::Util.encode_path(workflow_id)}",
53
+ path: "/v1/workflows/#{Retab::Util.encode_path(workflow_id)}/spec",
105
54
  auth: true,
106
55
  request_options: request_options
107
56
  )
@@ -15,7 +15,8 @@ module Retab
15
15
  target: :target,
16
16
  test_id: :test_id,
17
17
  total_tests: :total_tests,
18
- counts: :counts
18
+ counts: :counts,
19
+ freshness: :freshness
19
20
  }.freeze
20
21
 
21
22
  attr_accessor(
@@ -28,7 +29,8 @@ module Retab
28
29
  :target,
29
30
  :test_id,
30
31
  :total_tests,
31
- :counts
32
+ :counts,
33
+ :freshness
32
34
  )
33
35
 
34
36
  def initialize(json)
@@ -61,6 +63,7 @@ module Retab
61
63
  @test_id = hash[:test_id]
62
64
  @total_tests = hash[:total_tests]
63
65
  @counts = hash[:counts] ? Retab::BlockTestBatchExecutionCounts.new(hash[:counts]) : nil
66
+ @freshness = hash[:freshness] ? Retab::ArtifactFreshness.new(hash[:freshness]) : nil
64
67
  end
65
68
  end
66
69
  end