retab 0.1.5 → 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.
- checksums.yaml +4 -4
- data/lib/retab/base_client.rb +9 -2
- data/lib/retab/client.rb +8 -0
- data/lib/retab/experiment_runs/experiment_run.rb +9 -0
- data/lib/retab/files/create_file_blueprint_request.rb +31 -0
- data/lib/retab/files/file_blueprint.rb +52 -0
- data/lib/retab/files.rb +88 -0
- data/lib/retab/multipart.rb +73 -0
- data/lib/retab/schemas/generate_schema_request.rb +3 -3
- data/lib/retab/schemas/{partial_schema.rb → schema_generation.rb} +12 -3
- data/lib/retab/schemas.rb +5 -5
- data/lib/retab/secrets/create_secret_request.rb +25 -0
- data/lib/retab/secrets/secret.rb +34 -0
- data/lib/retab/secrets/secret_list_response.rb +20 -0
- data/lib/retab/secrets/secret_response.rb +20 -0
- data/lib/retab/secrets/secret_value.rb +28 -0
- data/lib/retab/secrets/secret_value_response.rb +20 -0
- data/lib/retab/secrets/set_secret_request.rb +20 -0
- data/lib/retab/secrets.rb +154 -0
- data/lib/retab/tables/create_workflow_table_upload_request.rb +31 -0
- data/lib/retab/tables/query_workflow_table_request.rb +72 -0
- data/lib/retab/tables/replace_workflow_table_upload_request.rb +25 -0
- data/lib/retab/tables/update_workflow_table_request.rb +25 -0
- data/lib/retab/tables/workflow_table.rb +58 -0
- data/lib/retab/tables/workflow_table_aggregation_request.rb +28 -0
- data/lib/retab/tables/workflow_table_column.rb +34 -0
- data/lib/retab/tables/workflow_table_distinct_request.rb +20 -0
- data/lib/retab/tables/workflow_table_explain.rb +54 -0
- data/lib/retab/tables/workflow_table_filter_rule.rb +28 -0
- data/lib/retab/tables/workflow_table_list_response.rb +20 -0
- data/lib/retab/tables/workflow_table_profile_column.rb +49 -0
- data/lib/retab/tables/workflow_table_profile_response.rb +28 -0
- data/lib/retab/tables/workflow_table_response.rb +20 -0
- data/lib/retab/tables/workflow_table_row.rb +28 -0
- data/lib/retab/tables/workflow_table_rows_response.rb +52 -0
- data/lib/retab/tables/workflow_table_sample_request.rb +20 -0
- data/lib/retab/tables/workflow_table_schema_response.rb +25 -0
- data/lib/retab/tables/workflow_table_search_request.rb +25 -0
- data/lib/retab/tables/workflow_table_sort_rule.rb +25 -0
- data/lib/retab/tables/workflow_table_tail_request.rb +7 -0
- data/lib/retab/tables/workflow_table_validation_column_rule.rb +28 -0
- data/lib/retab/tables/workflow_table_validation_diagnostic.rb +31 -0
- data/lib/retab/tables/workflow_table_validation_request.rb +28 -0
- data/lib/retab/tables/workflow_table_validation_response.rb +30 -0
- data/lib/retab/tables.rb +361 -0
- data/lib/retab/types/artifact_drift_status.rb +15 -0
- data/lib/retab/types/artifact_freshness_reasons.rb +16 -0
- data/lib/retab/types/artifact_freshness_status.rb +14 -0
- data/lib/retab/types/create_file_blueprint_request_mode.rb +13 -0
- data/lib/retab/types/declarative_plan_resource_change_type.rb +0 -2
- data/lib/retab/types/file_blueprint_mode.rb +9 -0
- data/lib/retab/types/file_blueprint_status.rb +9 -0
- data/lib/retab/types/schema_generation_status.rb +9 -0
- data/lib/retab/types/validate_workflow_block_config_request_config_mode.rb +9 -0
- data/lib/retab/types/workflow_authz_status.rb +16 -0
- data/lib/retab/types/workflow_block_type.rb +0 -2
- data/lib/retab/types/workflow_block_version_type.rb +9 -0
- data/lib/retab/types/workflow_capabilities.rb +26 -0
- data/lib/retab/types/workflow_config_block_type.rb +9 -0
- data/lib/retab/types/workflow_table_aggregation_function.rb +17 -0
- data/lib/retab/types/workflow_table_filter_operator.rb +46 -0
- data/lib/retab/types/workflow_table_sort_direction.rb +9 -0
- data/lib/retab/types/workflow_table_validation_column_rule_type.rb +18 -0
- data/lib/retab/types/workflow_table_validation_severity.rb +13 -0
- data/lib/retab/workflow_blocks/validate_workflow_block_config_request.rb +25 -0
- data/lib/retab/workflow_blocks/validate_workflow_block_config_response.rb +34 -0
- data/lib/retab/workflow_blocks/workflow_block.rb +6 -0
- data/lib/retab/workflow_blocks/workflow_block_version.rb +64 -0
- data/lib/retab/workflow_blocks/workflow_block_version_diff.rb +31 -0
- data/lib/retab/workflow_blocks/workflow_version_field_diff.rb +28 -0
- data/lib/retab/workflow_blocks.rb +172 -0
- data/lib/retab/workflow_edges/workflow_edge_version.rb +49 -0
- data/lib/retab/workflow_edges/workflow_edge_version_diff.rb +31 -0
- data/lib/retab/workflow_edges.rb +134 -0
- data/lib/retab/workflow_experiments/artifact_drift.rb +28 -0
- data/lib/retab/workflow_experiments/artifact_freshness.rb +34 -0
- data/lib/retab/workflow_experiments/workflow_experiment.rb +8 -2
- data/lib/retab/workflow_review_versions.rb +3 -3
- data/lib/retab/workflow_reviews.rb +4 -4
- data/lib/retab/workflow_runs.rb +1 -1
- data/lib/retab/workflow_spec.rb +6 -57
- data/lib/retab/workflow_test_runs/workflow_test_run.rb +5 -2
- data/lib/retab/workflow_tests/latest_block_test_run_summary.rb +6 -0
- data/lib/retab/workflow_tests/workflow_test.rb +6 -0
- data/lib/retab/workflows/create_workflow_request.rb +5 -2
- data/lib/retab/{workflow_spec → workflows}/declarative_workflow_request.rb +7 -2
- data/lib/retab/workflows/workflow.rb +11 -2
- data/lib/retab/workflows/workflow_block_position.rb +25 -0
- data/lib/retab/workflows/workflow_config_block.rb +46 -0
- data/lib/retab/workflows/workflow_config_edge.rb +37 -0
- data/lib/retab/workflows/workflow_graph_version.rb +40 -0
- data/lib/retab/workflows/workflow_graph_version_diff.rb +43 -0
- data/lib/retab/workflows.rb +209 -3
- data/lib/retab.rb +2 -0
- data/rbi/retab/artifact_drift.rbi +36 -0
- data/rbi/retab/artifact_freshness.rbi +48 -0
- data/rbi/retab/client.rbi +6 -0
- data/rbi/retab/create_file_blueprint_request.rbi +42 -0
- data/rbi/retab/create_secret_request.rbi +30 -0
- data/rbi/retab/create_upload_response.rbi +2 -2
- data/rbi/retab/create_workflow_request.rbi +6 -0
- data/rbi/retab/create_workflow_table_upload_request.rbi +42 -0
- data/rbi/retab/declarative_workflow_request.rbi +6 -0
- data/rbi/retab/experiment_run.rbi +18 -0
- data/rbi/retab/file_blueprint.rbi +84 -0
- data/rbi/retab/files.rbi +28 -0
- data/rbi/retab/generate_schema_request.rbi +2 -2
- data/rbi/retab/latest_block_test_run_summary.rbi +12 -0
- data/rbi/retab/query_workflow_table_request.rbi +120 -0
- data/rbi/retab/replace_workflow_table_upload_request.rbi +30 -0
- data/rbi/retab/{partial_schema.rbi → schema_generation.rbi} +19 -1
- data/rbi/retab/schemas.rbi +3 -3
- data/rbi/retab/secret.rbi +48 -0
- data/rbi/retab/secret_list_response.rbi +24 -0
- data/rbi/retab/secret_response.rbi +24 -0
- data/rbi/retab/secret_value.rbi +36 -0
- data/rbi/retab/secret_value_response.rbi +24 -0
- data/rbi/retab/secrets.rbi +62 -0
- data/rbi/retab/set_secret_request.rbi +24 -0
- data/rbi/retab/tables.rbi +129 -0
- data/rbi/retab/update_workflow_table_request.rbi +30 -0
- data/rbi/retab/validate_workflow_block_config_request.rbi +30 -0
- data/rbi/retab/validate_workflow_block_config_response.rbi +48 -0
- data/rbi/retab/workflow.rbi +18 -0
- data/rbi/retab/workflow_block.rbi +12 -0
- data/rbi/retab/workflow_block_position.rbi +30 -0
- data/rbi/retab/workflow_block_version.rbi +108 -0
- data/rbi/retab/workflow_block_version_diff.rbi +42 -0
- data/rbi/retab/workflow_blocks.rbi +49 -0
- data/rbi/retab/workflow_config_block.rbi +72 -0
- data/rbi/retab/workflow_config_edge.rbi +54 -0
- data/rbi/retab/workflow_edge_version.rbi +78 -0
- data/rbi/retab/workflow_edge_version_diff.rbi +42 -0
- data/rbi/retab/workflow_edges.rbi +38 -0
- data/rbi/retab/workflow_experiment.rbi +12 -0
- data/rbi/retab/workflow_graph_version.rbi +60 -0
- data/rbi/retab/workflow_graph_version_diff.rbi +66 -0
- data/rbi/retab/workflow_spec.rbi +2 -17
- data/rbi/retab/workflow_table.rbi +96 -0
- data/rbi/retab/workflow_table_aggregation_request.rbi +36 -0
- data/rbi/retab/workflow_table_column.rbi +48 -0
- data/rbi/retab/workflow_table_distinct_request.rbi +24 -0
- data/rbi/retab/workflow_table_explain.rbi +84 -0
- data/rbi/retab/workflow_table_filter_rule.rbi +36 -0
- data/rbi/retab/workflow_table_list_response.rbi +24 -0
- data/rbi/retab/workflow_table_profile_column.rbi +78 -0
- data/rbi/retab/workflow_table_profile_response.rbi +36 -0
- data/rbi/retab/workflow_table_response.rbi +24 -0
- data/rbi/retab/workflow_table_row.rbi +36 -0
- data/rbi/retab/workflow_table_rows_response.rbi +84 -0
- data/rbi/retab/workflow_table_sample_request.rbi +24 -0
- data/rbi/retab/workflow_table_schema_response.rbi +30 -0
- data/rbi/retab/workflow_table_search_request.rbi +30 -0
- data/rbi/retab/workflow_table_sort_rule.rbi +30 -0
- data/rbi/retab/workflow_table_tail_request.rbi +24 -0
- data/rbi/retab/workflow_table_validation_column_rule.rbi +36 -0
- data/rbi/retab/workflow_table_validation_diagnostic.rbi +42 -0
- data/rbi/retab/workflow_table_validation_request.rbi +36 -0
- data/rbi/retab/workflow_table_validation_response.rbi +36 -0
- data/rbi/retab/workflow_test.rbi +12 -0
- data/rbi/retab/workflow_test_run.rbi +6 -0
- data/rbi/retab/workflow_version_field_diff.rbi +36 -0
- data/rbi/retab/workflows.rbi +61 -2
- metadata +128 -10
- /data/lib/retab/{workflow_spec → workflows}/declarative_apply_response.rb +0 -0
- /data/lib/retab/{workflow_spec → workflows}/declarative_plan_change.rb +0 -0
- /data/lib/retab/{workflow_spec → workflows}/declarative_plan_field_change.rb +0 -0
- /data/lib/retab/{workflow_spec → workflows}/declarative_plan_resource_change.rb +0 -0
- /data/lib/retab/{workflow_spec → workflows}/declarative_plan_response.rb +0 -0
- /data/lib/retab/{workflow_spec → workflows}/declarative_plan_summary.rb +0 -0
|
@@ -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
|
data/lib/retab/workflow_edges.rb
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
data/lib/retab/workflow_runs.rb
CHANGED
|
@@ -108,7 +108,7 @@ module Retab
|
|
|
108
108
|
)
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
-
# Create Workflow Run
|
|
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.
|
data/lib/retab/workflow_spec.rb
CHANGED
|
@@ -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
|
|
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
|
|
@@ -14,6 +14,8 @@ module Retab
|
|
|
14
14
|
duration_ms: :duration_ms,
|
|
15
15
|
workflow_draft_fingerprint: :workflow_draft_fingerprint,
|
|
16
16
|
block_config_fingerprint: :block_config_fingerprint,
|
|
17
|
+
validity_fingerprint: :validity_fingerprint,
|
|
18
|
+
handle_inputs_fingerprint: :handle_inputs_fingerprint,
|
|
17
19
|
assertions_passed: :assertions_passed,
|
|
18
20
|
assertions_failed: :assertions_failed,
|
|
19
21
|
blocked_assertions: :blocked_assertions
|
|
@@ -28,6 +30,8 @@ module Retab
|
|
|
28
30
|
:duration_ms,
|
|
29
31
|
:workflow_draft_fingerprint,
|
|
30
32
|
:block_config_fingerprint,
|
|
33
|
+
:validity_fingerprint,
|
|
34
|
+
:handle_inputs_fingerprint,
|
|
31
35
|
:assertions_passed,
|
|
32
36
|
:assertions_failed,
|
|
33
37
|
:blocked_assertions
|
|
@@ -44,6 +48,8 @@ module Retab
|
|
|
44
48
|
@duration_ms = hash[:duration_ms]
|
|
45
49
|
@workflow_draft_fingerprint = hash[:workflow_draft_fingerprint]
|
|
46
50
|
@block_config_fingerprint = hash[:block_config_fingerprint]
|
|
51
|
+
@validity_fingerprint = hash[:validity_fingerprint]
|
|
52
|
+
@handle_inputs_fingerprint = hash[:handle_inputs_fingerprint]
|
|
47
53
|
@assertions_passed = hash[:assertions_passed]
|
|
48
54
|
@assertions_failed = hash[:assertions_failed]
|
|
49
55
|
@blocked_assertions = hash[:blocked_assertions]
|
|
@@ -16,6 +16,8 @@ module Retab
|
|
|
16
16
|
assertion_drift_status: :assertion_drift_status,
|
|
17
17
|
schema_drift: :schema_drift,
|
|
18
18
|
schema_drift_detail: :schema_drift_detail,
|
|
19
|
+
freshness: :freshness,
|
|
20
|
+
drift: :drift,
|
|
19
21
|
validation_status: :validation_status,
|
|
20
22
|
validation_issues: :validation_issues,
|
|
21
23
|
latest_run_summary: :latest_run_summary,
|
|
@@ -36,6 +38,8 @@ module Retab
|
|
|
36
38
|
:assertion_drift_status,
|
|
37
39
|
:schema_drift,
|
|
38
40
|
:schema_drift_detail,
|
|
41
|
+
:freshness,
|
|
42
|
+
:drift,
|
|
39
43
|
:validation_status,
|
|
40
44
|
:validation_issues,
|
|
41
45
|
:latest_run_summary,
|
|
@@ -67,6 +71,8 @@ module Retab
|
|
|
67
71
|
@assertion_drift_status = hash[:assertion_drift_status]
|
|
68
72
|
@schema_drift = hash[:schema_drift].nil? ? "unknown" : hash[:schema_drift]
|
|
69
73
|
@schema_drift_detail = hash[:schema_drift_detail]
|
|
74
|
+
@freshness = hash[:freshness] ? Retab::ArtifactFreshness.new(hash[:freshness]) : nil
|
|
75
|
+
@drift = hash[:drift] ? Retab::ArtifactDrift.new(hash[:drift]) : nil
|
|
70
76
|
@validation_status = hash[:validation_status].nil? ? "valid" : hash[:validation_status]
|
|
71
77
|
@validation_issues = (hash[:validation_issues] || [])
|
|
72
78
|
@latest_run_summary = hash[:latest_run_summary] ? Retab::LatestBlockTestRunSummary.new(hash[:latest_run_summary]) : nil
|
|
@@ -7,12 +7,14 @@ module Retab
|
|
|
7
7
|
|
|
8
8
|
HASH_ATTRS = {
|
|
9
9
|
name: :name,
|
|
10
|
-
description: :description
|
|
10
|
+
description: :description,
|
|
11
|
+
project_id: :project_id
|
|
11
12
|
}.freeze
|
|
12
13
|
|
|
13
14
|
attr_accessor(
|
|
14
15
|
:name,
|
|
15
|
-
:description
|
|
16
|
+
:description,
|
|
17
|
+
:project_id
|
|
16
18
|
)
|
|
17
19
|
|
|
18
20
|
def initialize(json)
|
|
@@ -20,6 +22,7 @@ module Retab
|
|
|
20
22
|
hash = self.class.normalize(json)
|
|
21
23
|
@name = hash[:name].nil? ? "Untitled Workflow" : hash[:name]
|
|
22
24
|
@description = hash[:description].nil? ? "" : hash[:description]
|
|
25
|
+
@project_id = hash[:project_id]
|
|
23
26
|
end
|
|
24
27
|
end
|
|
25
28
|
end
|
|
@@ -6,15 +6,20 @@ module Retab
|
|
|
6
6
|
class DeclarativeWorkflowRequest < Retab::Types::BaseModel
|
|
7
7
|
|
|
8
8
|
HASH_ATTRS = {
|
|
9
|
-
yaml_definition: :yaml_definition
|
|
9
|
+
yaml_definition: :yaml_definition,
|
|
10
|
+
project_id: :project_id
|
|
10
11
|
}.freeze
|
|
11
12
|
|
|
12
|
-
attr_accessor
|
|
13
|
+
attr_accessor(
|
|
14
|
+
:yaml_definition,
|
|
15
|
+
:project_id
|
|
16
|
+
)
|
|
13
17
|
|
|
14
18
|
def initialize(json)
|
|
15
19
|
super()
|
|
16
20
|
hash = self.class.normalize(json)
|
|
17
21
|
@yaml_definition = hash[:yaml_definition]
|
|
22
|
+
@project_id = hash[:project_id]
|
|
18
23
|
end
|
|
19
24
|
end
|
|
20
25
|
end
|
|
@@ -9,18 +9,24 @@ module Retab
|
|
|
9
9
|
id: :id,
|
|
10
10
|
name: :name,
|
|
11
11
|
description: :description,
|
|
12
|
+
project_id: :project_id,
|
|
12
13
|
published: :published,
|
|
13
14
|
created_at: :created_at,
|
|
14
|
-
updated_at: :updated_at
|
|
15
|
+
updated_at: :updated_at,
|
|
16
|
+
capabilities: :capabilities,
|
|
17
|
+
authz_status: :authz_status
|
|
15
18
|
}.freeze
|
|
16
19
|
|
|
17
20
|
attr_accessor(
|
|
18
21
|
:id,
|
|
19
22
|
:name,
|
|
20
23
|
:description,
|
|
24
|
+
:project_id,
|
|
21
25
|
:published,
|
|
22
26
|
:created_at,
|
|
23
|
-
:updated_at
|
|
27
|
+
:updated_at,
|
|
28
|
+
:capabilities,
|
|
29
|
+
:authz_status
|
|
24
30
|
)
|
|
25
31
|
|
|
26
32
|
def initialize(json)
|
|
@@ -29,9 +35,12 @@ module Retab
|
|
|
29
35
|
@id = hash[:id]
|
|
30
36
|
@name = hash[:name].nil? ? "Untitled Workflow" : hash[:name]
|
|
31
37
|
@description = hash[:description].nil? ? "" : hash[:description]
|
|
38
|
+
@project_id = hash[:project_id]
|
|
32
39
|
@published = hash[:published] ? Retab::WorkflowPublished.new(hash[:published]) : nil
|
|
33
40
|
@created_at = hash[:created_at]
|
|
34
41
|
@updated_at = hash[:updated_at]
|
|
42
|
+
@capabilities = (hash[:capabilities] || [])
|
|
43
|
+
@authz_status = hash[:authz_status]
|
|
35
44
|
end
|
|
36
45
|
end
|
|
37
46
|
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 WorkflowBlockPosition < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
x: :x,
|
|
10
|
+
y: :y
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
attr_accessor(
|
|
14
|
+
:x,
|
|
15
|
+
:y
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def initialize(json)
|
|
19
|
+
super()
|
|
20
|
+
hash = self.class.normalize(json)
|
|
21
|
+
@x = hash[:x]
|
|
22
|
+
@y = hash[:y]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|