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.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retab/base_client.rb +9 -2
  3. data/lib/retab/client.rb +8 -0
  4. data/lib/retab/experiment_runs/experiment_run.rb +9 -0
  5. data/lib/retab/files/create_file_blueprint_request.rb +31 -0
  6. data/lib/retab/files/file_blueprint.rb +52 -0
  7. data/lib/retab/files.rb +88 -0
  8. data/lib/retab/multipart.rb +73 -0
  9. data/lib/retab/schemas/generate_schema_request.rb +3 -3
  10. data/lib/retab/schemas/{partial_schema.rb → schema_generation.rb} +12 -3
  11. data/lib/retab/schemas.rb +5 -5
  12. data/lib/retab/secrets/create_secret_request.rb +25 -0
  13. data/lib/retab/secrets/secret.rb +34 -0
  14. data/lib/retab/secrets/secret_list_response.rb +20 -0
  15. data/lib/retab/secrets/secret_response.rb +20 -0
  16. data/lib/retab/secrets/secret_value.rb +28 -0
  17. data/lib/retab/secrets/secret_value_response.rb +20 -0
  18. data/lib/retab/secrets/set_secret_request.rb +20 -0
  19. data/lib/retab/secrets.rb +154 -0
  20. data/lib/retab/tables/create_workflow_table_upload_request.rb +31 -0
  21. data/lib/retab/tables/query_workflow_table_request.rb +72 -0
  22. data/lib/retab/tables/replace_workflow_table_upload_request.rb +25 -0
  23. data/lib/retab/tables/update_workflow_table_request.rb +25 -0
  24. data/lib/retab/tables/workflow_table.rb +58 -0
  25. data/lib/retab/tables/workflow_table_aggregation_request.rb +28 -0
  26. data/lib/retab/tables/workflow_table_column.rb +34 -0
  27. data/lib/retab/tables/workflow_table_distinct_request.rb +20 -0
  28. data/lib/retab/tables/workflow_table_explain.rb +54 -0
  29. data/lib/retab/tables/workflow_table_filter_rule.rb +28 -0
  30. data/lib/retab/tables/workflow_table_list_response.rb +20 -0
  31. data/lib/retab/tables/workflow_table_profile_column.rb +49 -0
  32. data/lib/retab/tables/workflow_table_profile_response.rb +28 -0
  33. data/lib/retab/tables/workflow_table_response.rb +20 -0
  34. data/lib/retab/tables/workflow_table_row.rb +28 -0
  35. data/lib/retab/tables/workflow_table_rows_response.rb +52 -0
  36. data/lib/retab/tables/workflow_table_sample_request.rb +20 -0
  37. data/lib/retab/tables/workflow_table_schema_response.rb +25 -0
  38. data/lib/retab/tables/workflow_table_search_request.rb +25 -0
  39. data/lib/retab/tables/workflow_table_sort_rule.rb +25 -0
  40. data/lib/retab/tables/workflow_table_tail_request.rb +7 -0
  41. data/lib/retab/tables/workflow_table_validation_column_rule.rb +28 -0
  42. data/lib/retab/tables/workflow_table_validation_diagnostic.rb +31 -0
  43. data/lib/retab/tables/workflow_table_validation_request.rb +28 -0
  44. data/lib/retab/tables/workflow_table_validation_response.rb +30 -0
  45. data/lib/retab/tables.rb +361 -0
  46. data/lib/retab/types/artifact_drift_status.rb +15 -0
  47. data/lib/retab/types/artifact_freshness_reasons.rb +16 -0
  48. data/lib/retab/types/artifact_freshness_status.rb +14 -0
  49. data/lib/retab/types/create_file_blueprint_request_mode.rb +13 -0
  50. data/lib/retab/types/declarative_plan_resource_change_type.rb +0 -2
  51. data/lib/retab/types/file_blueprint_mode.rb +9 -0
  52. data/lib/retab/types/file_blueprint_status.rb +9 -0
  53. data/lib/retab/types/schema_generation_status.rb +9 -0
  54. data/lib/retab/types/validate_workflow_block_config_request_config_mode.rb +9 -0
  55. data/lib/retab/types/workflow_authz_status.rb +16 -0
  56. data/lib/retab/types/workflow_block_type.rb +0 -2
  57. data/lib/retab/types/workflow_block_version_type.rb +9 -0
  58. data/lib/retab/types/workflow_capabilities.rb +26 -0
  59. data/lib/retab/types/workflow_config_block_type.rb +9 -0
  60. data/lib/retab/types/workflow_table_aggregation_function.rb +17 -0
  61. data/lib/retab/types/workflow_table_filter_operator.rb +46 -0
  62. data/lib/retab/types/workflow_table_sort_direction.rb +9 -0
  63. data/lib/retab/types/workflow_table_validation_column_rule_type.rb +18 -0
  64. data/lib/retab/types/workflow_table_validation_severity.rb +13 -0
  65. data/lib/retab/workflow_blocks/validate_workflow_block_config_request.rb +25 -0
  66. data/lib/retab/workflow_blocks/validate_workflow_block_config_response.rb +34 -0
  67. data/lib/retab/workflow_blocks/workflow_block.rb +6 -0
  68. data/lib/retab/workflow_blocks/workflow_block_version.rb +64 -0
  69. data/lib/retab/workflow_blocks/workflow_block_version_diff.rb +31 -0
  70. data/lib/retab/workflow_blocks/workflow_version_field_diff.rb +28 -0
  71. data/lib/retab/workflow_blocks.rb +172 -0
  72. data/lib/retab/workflow_edges/workflow_edge_version.rb +49 -0
  73. data/lib/retab/workflow_edges/workflow_edge_version_diff.rb +31 -0
  74. data/lib/retab/workflow_edges.rb +134 -0
  75. data/lib/retab/workflow_experiments/artifact_drift.rb +28 -0
  76. data/lib/retab/workflow_experiments/artifact_freshness.rb +34 -0
  77. data/lib/retab/workflow_experiments/workflow_experiment.rb +8 -2
  78. data/lib/retab/workflow_review_versions.rb +3 -3
  79. data/lib/retab/workflow_reviews.rb +4 -4
  80. data/lib/retab/workflow_runs.rb +1 -1
  81. data/lib/retab/workflow_spec.rb +6 -57
  82. data/lib/retab/workflow_test_runs/workflow_test_run.rb +5 -2
  83. data/lib/retab/workflow_tests/latest_block_test_run_summary.rb +6 -0
  84. data/lib/retab/workflow_tests/workflow_test.rb +6 -0
  85. data/lib/retab/workflows/create_workflow_request.rb +5 -2
  86. data/lib/retab/{workflow_spec → workflows}/declarative_workflow_request.rb +7 -2
  87. data/lib/retab/workflows/workflow.rb +11 -2
  88. data/lib/retab/workflows/workflow_block_position.rb +25 -0
  89. data/lib/retab/workflows/workflow_config_block.rb +46 -0
  90. data/lib/retab/workflows/workflow_config_edge.rb +37 -0
  91. data/lib/retab/workflows/workflow_graph_version.rb +40 -0
  92. data/lib/retab/workflows/workflow_graph_version_diff.rb +43 -0
  93. data/lib/retab/workflows.rb +209 -3
  94. data/lib/retab.rb +2 -0
  95. data/rbi/retab/artifact_drift.rbi +36 -0
  96. data/rbi/retab/artifact_freshness.rbi +48 -0
  97. data/rbi/retab/client.rbi +6 -0
  98. data/rbi/retab/create_file_blueprint_request.rbi +42 -0
  99. data/rbi/retab/create_secret_request.rbi +30 -0
  100. data/rbi/retab/create_upload_response.rbi +2 -2
  101. data/rbi/retab/create_workflow_request.rbi +6 -0
  102. data/rbi/retab/create_workflow_table_upload_request.rbi +42 -0
  103. data/rbi/retab/declarative_workflow_request.rbi +6 -0
  104. data/rbi/retab/experiment_run.rbi +18 -0
  105. data/rbi/retab/file_blueprint.rbi +84 -0
  106. data/rbi/retab/files.rbi +28 -0
  107. data/rbi/retab/generate_schema_request.rbi +2 -2
  108. data/rbi/retab/latest_block_test_run_summary.rbi +12 -0
  109. data/rbi/retab/query_workflow_table_request.rbi +120 -0
  110. data/rbi/retab/replace_workflow_table_upload_request.rbi +30 -0
  111. data/rbi/retab/{partial_schema.rbi → schema_generation.rbi} +19 -1
  112. data/rbi/retab/schemas.rbi +3 -3
  113. data/rbi/retab/secret.rbi +48 -0
  114. data/rbi/retab/secret_list_response.rbi +24 -0
  115. data/rbi/retab/secret_response.rbi +24 -0
  116. data/rbi/retab/secret_value.rbi +36 -0
  117. data/rbi/retab/secret_value_response.rbi +24 -0
  118. data/rbi/retab/secrets.rbi +62 -0
  119. data/rbi/retab/set_secret_request.rbi +24 -0
  120. data/rbi/retab/tables.rbi +129 -0
  121. data/rbi/retab/update_workflow_table_request.rbi +30 -0
  122. data/rbi/retab/validate_workflow_block_config_request.rbi +30 -0
  123. data/rbi/retab/validate_workflow_block_config_response.rbi +48 -0
  124. data/rbi/retab/workflow.rbi +18 -0
  125. data/rbi/retab/workflow_block.rbi +12 -0
  126. data/rbi/retab/workflow_block_position.rbi +30 -0
  127. data/rbi/retab/workflow_block_version.rbi +108 -0
  128. data/rbi/retab/workflow_block_version_diff.rbi +42 -0
  129. data/rbi/retab/workflow_blocks.rbi +49 -0
  130. data/rbi/retab/workflow_config_block.rbi +72 -0
  131. data/rbi/retab/workflow_config_edge.rbi +54 -0
  132. data/rbi/retab/workflow_edge_version.rbi +78 -0
  133. data/rbi/retab/workflow_edge_version_diff.rbi +42 -0
  134. data/rbi/retab/workflow_edges.rbi +38 -0
  135. data/rbi/retab/workflow_experiment.rbi +12 -0
  136. data/rbi/retab/workflow_graph_version.rbi +60 -0
  137. data/rbi/retab/workflow_graph_version_diff.rbi +66 -0
  138. data/rbi/retab/workflow_spec.rbi +2 -17
  139. data/rbi/retab/workflow_table.rbi +96 -0
  140. data/rbi/retab/workflow_table_aggregation_request.rbi +36 -0
  141. data/rbi/retab/workflow_table_column.rbi +48 -0
  142. data/rbi/retab/workflow_table_distinct_request.rbi +24 -0
  143. data/rbi/retab/workflow_table_explain.rbi +84 -0
  144. data/rbi/retab/workflow_table_filter_rule.rbi +36 -0
  145. data/rbi/retab/workflow_table_list_response.rbi +24 -0
  146. data/rbi/retab/workflow_table_profile_column.rbi +78 -0
  147. data/rbi/retab/workflow_table_profile_response.rbi +36 -0
  148. data/rbi/retab/workflow_table_response.rbi +24 -0
  149. data/rbi/retab/workflow_table_row.rbi +36 -0
  150. data/rbi/retab/workflow_table_rows_response.rbi +84 -0
  151. data/rbi/retab/workflow_table_sample_request.rbi +24 -0
  152. data/rbi/retab/workflow_table_schema_response.rbi +30 -0
  153. data/rbi/retab/workflow_table_search_request.rbi +30 -0
  154. data/rbi/retab/workflow_table_sort_rule.rbi +30 -0
  155. data/rbi/retab/workflow_table_tail_request.rbi +24 -0
  156. data/rbi/retab/workflow_table_validation_column_rule.rbi +36 -0
  157. data/rbi/retab/workflow_table_validation_diagnostic.rbi +42 -0
  158. data/rbi/retab/workflow_table_validation_request.rbi +36 -0
  159. data/rbi/retab/workflow_table_validation_response.rbi +36 -0
  160. data/rbi/retab/workflow_test.rbi +12 -0
  161. data/rbi/retab/workflow_test_run.rbi +6 -0
  162. data/rbi/retab/workflow_version_field_diff.rbi +36 -0
  163. data/rbi/retab/workflows.rbi +61 -2
  164. metadata +128 -10
  165. /data/lib/retab/{workflow_spec → workflows}/declarative_apply_response.rb +0 -0
  166. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_change.rb +0 -0
  167. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_field_change.rb +0 -0
  168. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_resource_change.rb +0 -0
  169. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_response.rb +0 -0
  170. /data/lib/retab/{workflow_spec → workflows}/declarative_plan_summary.rb +0 -0
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class CreateFileBlueprintRequestMode
8
+ INSTANT = "instant"
9
+ REASONING = "reasoning"
10
+ ALL = [INSTANT, REASONING].freeze
11
+ end
12
+ end
13
+ end
@@ -17,7 +17,6 @@ module Retab
17
17
  CLASSIFIER = "classifier"
18
18
  CONDITIONAL = "conditional"
19
19
  API_CALL = "api_call"
20
- REVIEW = "review"
21
20
  FUNCTION = "function"
22
21
  WHILE_LOOP = "while_loop"
23
22
  FOR_EACH = "for_each"
@@ -39,7 +38,6 @@ module Retab
39
38
  CLASSIFIER,
40
39
  CONDITIONAL,
41
40
  API_CALL,
42
- REVIEW,
43
41
  FUNCTION,
44
42
  WHILE_LOOP,
45
43
  FOR_EACH,
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ FileBlueprintMode = CreateFileBlueprintRequestMode
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ FileBlueprintStatus = ClassificationStatus
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ SchemaGenerationStatus = ClassificationStatus
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ ValidateWorkflowBlockConfigRequestConfigMode = UpdateWorkflowBlockRequestConfigMode
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class WorkflowAuthzStatus
8
+ PROVISIONING = "provisioning"
9
+ READY = "ready"
10
+ FAILED = "failed"
11
+ DELETING = "deleting"
12
+ DELETED = "deleted"
13
+ ALL = [PROVISIONING, READY, FAILED, DELETING, DELETED].freeze
14
+ end
15
+ end
16
+ end
@@ -15,7 +15,6 @@ module Retab
15
15
  CLASSIFIER = "classifier"
16
16
  CONDITIONAL = "conditional"
17
17
  API_CALL = "api_call"
18
- REVIEW = "review"
19
18
  FUNCTION = "function"
20
19
  WHILE_LOOP = "while_loop"
21
20
  FOR_EACH = "for_each"
@@ -35,7 +34,6 @@ module Retab
35
34
  CLASSIFIER,
36
35
  CONDITIONAL,
37
36
  API_CALL,
38
- REVIEW,
39
37
  FUNCTION,
40
38
  WHILE_LOOP,
41
39
  FOR_EACH,
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ WorkflowBlockVersionType = WorkflowBlockType
8
+ end
9
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class WorkflowCapabilities
8
+ WORKFLOW_VIEW = "workflow:view"
9
+ WORKFLOW_EDIT = "workflow:edit"
10
+ WORKFLOW_RUN = "workflow:run"
11
+ WORKFLOW_DELETE = "workflow:delete"
12
+ WORKFLOW_PUBLISH = "workflow:publish"
13
+ WORKFLOW_REVIEW = "workflow:review"
14
+ WORKFLOW_MANAGE = "workflow:manage"
15
+ ALL = [
16
+ WORKFLOW_VIEW,
17
+ WORKFLOW_EDIT,
18
+ WORKFLOW_RUN,
19
+ WORKFLOW_DELETE,
20
+ WORKFLOW_PUBLISH,
21
+ WORKFLOW_REVIEW,
22
+ WORKFLOW_MANAGE
23
+ ].freeze
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ WorkflowConfigBlockType = WorkflowBlockType
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class WorkflowTableAggregationFunction
8
+ COUNT = "count"
9
+ COUNT_DISTINCT = "count_distinct"
10
+ MIN = "min"
11
+ MAX = "max"
12
+ SUM = "sum"
13
+ AVG = "avg"
14
+ ALL = [COUNT, COUNT_DISTINCT, MIN, MAX, SUM, AVG].freeze
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class WorkflowTableFilterOperator
8
+ EQ = "eq"
9
+ NE = "ne"
10
+ GT = "gt"
11
+ GTE = "gte"
12
+ LT = "lt"
13
+ LTE = "lte"
14
+ CONTAINS = "contains"
15
+ NOT_CONTAINS = "not_contains"
16
+ STARTS_WITH = "starts_with"
17
+ ENDS_WITH = "ends_with"
18
+ IN = "in"
19
+ NOT_IN = "not_in"
20
+ BETWEEN = "between"
21
+ IS_EMPTY = "is_empty"
22
+ IS_NOT_EMPTY = "is_not_empty"
23
+ IS_NULL = "is_null"
24
+ IS_NOT_NULL = "is_not_null"
25
+ ALL = [
26
+ EQ,
27
+ NE,
28
+ GT,
29
+ GTE,
30
+ LT,
31
+ LTE,
32
+ CONTAINS,
33
+ NOT_CONTAINS,
34
+ STARTS_WITH,
35
+ ENDS_WITH,
36
+ IN,
37
+ NOT_IN,
38
+ BETWEEN,
39
+ IS_EMPTY,
40
+ IS_NOT_EMPTY,
41
+ IS_NULL,
42
+ IS_NOT_NULL
43
+ ].freeze
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ WorkflowTableSortDirection = ClassificationsOrder
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class WorkflowTableValidationColumnRuleType
8
+ ARRAY = "array"
9
+ BOOLEAN = "boolean"
10
+ INTEGER = "integer"
11
+ NULL = "null"
12
+ NUMBER = "number"
13
+ OBJECT = "object"
14
+ STRING = "string"
15
+ ALL = [ARRAY, BOOLEAN, INTEGER, NULL, NUMBER, OBJECT, STRING].freeze
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ module Types
7
+ class WorkflowTableValidationSeverity
8
+ ERROR = "error"
9
+ WARNING = "warning"
10
+ ALL = [ERROR, WARNING].freeze
11
+ end
12
+ end
13
+ 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 ValidateWorkflowBlockConfigRequest < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ config: :config,
10
+ config_mode: :config_mode
11
+ }.freeze
12
+
13
+ attr_accessor(
14
+ :config,
15
+ :config_mode
16
+ )
17
+
18
+ def initialize(json)
19
+ super()
20
+ hash = self.class.normalize(json)
21
+ @config = hash[:config] || {}
22
+ @config_mode = hash[:config_mode].nil? ? "replace" : hash[:config_mode]
23
+ end
24
+ end
25
+ 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 ValidateWorkflowBlockConfigResponse < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ ok: :ok,
10
+ workflow_id: :workflow_id,
11
+ block_id: :block_id,
12
+ block_type: :block_type,
13
+ config_hash: :config_hash
14
+ }.freeze
15
+
16
+ attr_accessor(
17
+ :ok,
18
+ :workflow_id,
19
+ :block_id,
20
+ :block_type,
21
+ :config_hash
22
+ )
23
+
24
+ def initialize(json)
25
+ super()
26
+ hash = self.class.normalize(json)
27
+ @ok = hash[:ok].nil? ? true : hash[:ok]
28
+ @workflow_id = hash[:workflow_id]
29
+ @block_id = hash[:block_id]
30
+ @block_type = hash[:block_type]
31
+ @config_hash = hash[:config_hash]
32
+ end
33
+ end
34
+ end
@@ -16,6 +16,8 @@ module Retab
16
16
  height: :height,
17
17
  config: :config,
18
18
  parent_id: :parent_id,
19
+ declarative_path: :declarative_path,
20
+ declarative_source_block_id: :declarative_source_block_id,
19
21
  updated_at: :updated_at,
20
22
  resolved_schemas: :resolved_schemas
21
23
  }.freeze
@@ -31,6 +33,8 @@ module Retab
31
33
  :height,
32
34
  :config,
33
35
  :parent_id,
36
+ :declarative_path,
37
+ :declarative_source_block_id,
34
38
  :updated_at,
35
39
  :resolved_schemas
36
40
  )
@@ -48,6 +52,8 @@ module Retab
48
52
  @height = hash[:height]
49
53
  @config = hash[:config] || {}
50
54
  @parent_id = hash[:parent_id]
55
+ @declarative_path = hash[:declarative_path]
56
+ @declarative_source_block_id = hash[:declarative_source_block_id]
51
57
  @updated_at = hash[:updated_at]
52
58
  @resolved_schemas = hash[:resolved_schemas] || {}
53
59
  end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class WorkflowBlockVersion < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ id: :id,
10
+ block_id: :block_id,
11
+ workflow_id: :workflow_id,
12
+ workflow_version_id: :workflow_version_id,
13
+ type: :type,
14
+ label: :label,
15
+ position_x: :position_x,
16
+ position_y: :position_y,
17
+ width: :width,
18
+ height: :height,
19
+ parent_id: :parent_id,
20
+ config: :config,
21
+ resolved_schemas: :resolved_schemas,
22
+ config_hash: :config_hash,
23
+ created_at: :created_at
24
+ }.freeze
25
+
26
+ attr_accessor(
27
+ :id,
28
+ :block_id,
29
+ :workflow_id,
30
+ :workflow_version_id,
31
+ :type,
32
+ :label,
33
+ :position_x,
34
+ :position_y,
35
+ :width,
36
+ :height,
37
+ :parent_id,
38
+ :config,
39
+ :resolved_schemas,
40
+ :config_hash,
41
+ :created_at
42
+ )
43
+
44
+ def initialize(json)
45
+ super()
46
+ hash = self.class.normalize(json)
47
+ @id = hash[:id]
48
+ @block_id = hash[:block_id]
49
+ @workflow_id = hash[:workflow_id]
50
+ @workflow_version_id = hash[:workflow_version_id]
51
+ @type = hash[:type]
52
+ @label = hash[:label].nil? ? "" : hash[:label]
53
+ @position_x = hash[:position_x]
54
+ @position_y = hash[:position_y]
55
+ @width = hash[:width]
56
+ @height = hash[:height]
57
+ @parent_id = hash[:parent_id]
58
+ @config = hash[:config] || {}
59
+ @resolved_schemas = hash[:resolved_schemas] || {}
60
+ @config_hash = hash[:config_hash].nil? ? "" : hash[:config_hash]
61
+ @created_at = hash[:created_at]
62
+ end
63
+ end
64
+ 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 WorkflowBlockVersionDiff < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ from_block_version_id: :from_block_version_id,
10
+ to_block_version_id: :to_block_version_id,
11
+ block_id: :block_id,
12
+ changes: :changes
13
+ }.freeze
14
+
15
+ attr_accessor(
16
+ :from_block_version_id,
17
+ :to_block_version_id,
18
+ :block_id,
19
+ :changes
20
+ )
21
+
22
+ def initialize(json)
23
+ super()
24
+ hash = self.class.normalize(json)
25
+ @from_block_version_id = hash[:from_block_version_id]
26
+ @to_block_version_id = hash[:to_block_version_id]
27
+ @block_id = hash[:block_id]
28
+ @changes = (hash[:changes] || []).map { |item| item ? Retab::WorkflowVersionFieldDiff.new(item) : nil }
29
+ end
30
+ end
31
+ 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 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.
@@ -219,5 +353,43 @@ module Retab
219
353
  )
220
354
  nil
221
355
  end
356
+
357
+ # Validate Block Config
358
+ # @param block_id [String]
359
+ # @param config [Hash{String => Object}] Assembled block config to validate.
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.
361
+ # @param workflow_id [String, nil] Workflow ID to disambiguate legacy duplicate block IDs. Omit for normal server-generated block IDs.
362
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
363
+ # @return [Retab::ValidateWorkflowBlockConfigResponse]
364
+ def create_block_validate_config(
365
+ block_id:,
366
+ config:,
367
+ config_mode: nil,
368
+ workflow_id: nil,
369
+ request_options: {}
370
+ )
371
+ params = {
372
+ "workflow_id" => workflow_id
373
+ }.compact
374
+ body = {
375
+ "config" => config,
376
+ "config_mode" => config_mode
377
+ }.compact
378
+ response = @client.request(
379
+ method: :post,
380
+ path: "/v1/workflows/blocks/#{Retab::Util.encode_path(block_id)}/validate-config",
381
+ auth: true,
382
+ params: params,
383
+ body: body,
384
+ request_options: request_options
385
+ )
386
+ result = Retab::ValidateWorkflowBlockConfigResponse.new(response.body)
387
+ result.last_response = Retab::Types::ApiResponse.new(
388
+ http_status: response.code.to_i,
389
+ http_headers: response.each_header.to_h,
390
+ request_id: response["x-request-id"]
391
+ )
392
+ result
393
+ end
222
394
  end
223
395
  end