@galaxy-tool-util/schema 1.2.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/index.d.ts +32 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +31 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/schema/parsed-tool.d.ts +3 -0
  6. package/dist/schema/parsed-tool.d.ts.map +1 -1
  7. package/dist/user-tool-parse/index.d.ts +12 -0
  8. package/dist/user-tool-parse/index.d.ts.map +1 -0
  9. package/dist/user-tool-parse/index.js +12 -0
  10. package/dist/user-tool-parse/index.js.map +1 -0
  11. package/dist/user-tool-parse/inputs.d.ts +13 -0
  12. package/dist/user-tool-parse/inputs.d.ts.map +1 -0
  13. package/dist/user-tool-parse/inputs.js +565 -0
  14. package/dist/user-tool-parse/inputs.js.map +1 -0
  15. package/dist/user-tool-parse/outputs.d.ts +10 -0
  16. package/dist/user-tool-parse/outputs.d.ts.map +1 -0
  17. package/dist/user-tool-parse/outputs.js +231 -0
  18. package/dist/user-tool-parse/outputs.js.map +1 -0
  19. package/dist/user-tool-parse/parse.d.ts +12 -0
  20. package/dist/user-tool-parse/parse.d.ts.map +1 -0
  21. package/dist/user-tool-parse/parse.js +98 -0
  22. package/dist/user-tool-parse/parse.js.map +1 -0
  23. package/dist/user-tool-source/index.d.ts +3 -0
  24. package/dist/user-tool-source/index.d.ts.map +1 -0
  25. package/dist/user-tool-source/index.js +3 -0
  26. package/dist/user-tool-source/index.js.map +1 -0
  27. package/dist/user-tool-source/schema.generated.d.ts +7298 -0
  28. package/dist/user-tool-source/schema.generated.d.ts.map +1 -0
  29. package/dist/user-tool-source/schema.generated.js +8851 -0
  30. package/dist/user-tool-source/schema.generated.js.map +1 -0
  31. package/dist/user-tool-source/semantic.d.ts +14 -0
  32. package/dist/user-tool-source/semantic.d.ts.map +1 -0
  33. package/dist/user-tool-source/semantic.js +137 -0
  34. package/dist/user-tool-source/semantic.js.map +1 -0
  35. package/dist/user-tool-source/validate.d.ts +37 -0
  36. package/dist/user-tool-source/validate.d.ts.map +1 -0
  37. package/dist/user-tool-source/validate.js +54 -0
  38. package/dist/user-tool-source/validate.js.map +1 -0
  39. package/dist/workflow/draft-checks.d.ts +205 -0
  40. package/dist/workflow/draft-checks.d.ts.map +1 -0
  41. package/dist/workflow/draft-checks.js +1151 -0
  42. package/dist/workflow/draft-checks.js.map +1 -0
  43. package/dist/workflow/index.d.ts +4 -2
  44. package/dist/workflow/index.d.ts.map +1 -1
  45. package/dist/workflow/index.js +4 -2
  46. package/dist/workflow/index.js.map +1 -1
  47. package/dist/workflow/normalized/format2.d.ts +1 -0
  48. package/dist/workflow/normalized/format2.d.ts.map +1 -1
  49. package/dist/workflow/normalized/format2.js +15 -2
  50. package/dist/workflow/normalized/format2.js.map +1 -1
  51. package/dist/workflow/normalized/native.d.ts +1 -1
  52. package/dist/workflow/normalized/toNative.js +29 -4
  53. package/dist/workflow/normalized/toNative.js.map +1 -1
  54. package/dist/workflow/promote-draft.d.ts +53 -0
  55. package/dist/workflow/promote-draft.d.ts.map +1 -0
  56. package/dist/workflow/promote-draft.js +133 -0
  57. package/dist/workflow/promote-draft.js.map +1 -0
  58. package/dist/workflow/raw/gxformat2-draft.d.ts +688 -0
  59. package/dist/workflow/raw/gxformat2-draft.d.ts.map +1 -0
  60. package/dist/workflow/raw/gxformat2-draft.effect.d.ts +4607 -0
  61. package/dist/workflow/raw/gxformat2-draft.effect.d.ts.map +1 -0
  62. package/dist/workflow/raw/gxformat2-draft.effect.js +778 -0
  63. package/dist/workflow/raw/gxformat2-draft.effect.js.map +1 -0
  64. package/dist/workflow/raw/gxformat2-draft.js +20 -0
  65. package/dist/workflow/raw/gxformat2-draft.js.map +1 -0
  66. package/dist/workflow/raw/gxformat2.d.ts +237 -13
  67. package/dist/workflow/raw/gxformat2.d.ts.map +1 -1
  68. package/dist/workflow/raw/gxformat2.effect.d.ts +1375 -177
  69. package/dist/workflow/raw/gxformat2.effect.d.ts.map +1 -1
  70. package/dist/workflow/raw/gxformat2.effect.js +355 -108
  71. package/dist/workflow/raw/gxformat2.effect.js.map +1 -1
  72. package/dist/workflow/raw/gxformat2.js +18 -1
  73. package/dist/workflow/raw/gxformat2.js.map +1 -1
  74. package/dist/workflow/raw/index.d.ts +2 -0
  75. package/dist/workflow/raw/index.d.ts.map +1 -1
  76. package/dist/workflow/raw/index.js +1 -0
  77. package/dist/workflow/raw/index.js.map +1 -1
  78. package/dist/workflow/raw/native.d.ts +51 -2
  79. package/dist/workflow/raw/native.d.ts.map +1 -1
  80. package/dist/workflow/raw/native.effect.d.ts +82 -30
  81. package/dist/workflow/raw/native.effect.d.ts.map +1 -1
  82. package/dist/workflow/raw/native.effect.js +67 -18
  83. package/dist/workflow/raw/native.effect.js.map +1 -1
  84. package/dist/workflow/raw/native.js.map +1 -1
  85. package/dist/workflow/report-models.d.ts +102 -0
  86. package/dist/workflow/report-models.d.ts.map +1 -1
  87. package/dist/workflow/report-models.js +98 -0
  88. package/dist/workflow/report-models.js.map +1 -1
  89. package/dist/workflow/semantic-validators.d.ts +18 -0
  90. package/dist/workflow/semantic-validators.d.ts.map +1 -0
  91. package/dist/workflow/semantic-validators.js +137 -0
  92. package/dist/workflow/semantic-validators.js.map +1 -0
  93. package/dist/workflow/validators.d.ts.map +1 -1
  94. package/dist/workflow/validators.js +7 -2
  95. package/dist/workflow/validators.js.map +1 -1
  96. package/package.json +1 -1
@@ -0,0 +1,778 @@
1
+ // Auto-generated by schema-salad-plus-pydantic — do not edit.
2
+ import { Schema } from "effect";
3
+ /**
4
+ * Salad data types are based on Avro schema declarations. Refer to the
5
+ [Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for
6
+ detailed information.
7
+
8
+ null: no value
9
+ boolean: a binary value
10
+ int: 32-bit signed integer
11
+ long: 64-bit signed integer
12
+ float: single precision (32-bit) IEEE 754 floating-point number
13
+ double: double precision (64-bit) IEEE 754 floating-point number
14
+ string: Unicode character sequence
15
+ */
16
+ export const PrimitiveTypeSchema = Schema.Literal("null", "boolean", "int", "long", "float", "double", "string");
17
+ /**
18
+ * Extends primitive types with the native Galaxy concepts such as datasets and collections.
19
+ Normalized gxformat2 workflow input declaration spellings are ``data``, ``collection``, ``string``, ``int``, ``float``, and ``boolean``. Other spellings are accepted as compatibility aliases on import but normalized gxformat2 output emits the normalized spellings.
20
+ data: one Galaxy dataset input. Native Galaxy ``data_input`` converts to this spelling.
21
+ File: accepted alias for ``data``, but normalized gxformat2 output emits ``data``. Note: workflow **test job** YAML uses ``type: File`` to mean 'stage this file as test input data', which is a separate concept from workflow input declaration.
22
+ collection: one Galaxy dataset collection input. Native Galaxy ``data_collection_input`` converts to this spelling.
23
+ string: normalized gxformat2 spelling for native Galaxy text workflow parameters.
24
+ text: accepted alias for ``string`` because native Galaxy parameter state and Galaxy tool XML terminology use ``text``.
25
+ int: normalized gxformat2 spelling for native Galaxy integer workflow parameters.
26
+ integer: accepted alias for ``int`` because native Galaxy parameter state and Galaxy tool XML terminology use ``integer``.
27
+ */
28
+ export const GalaxyTypeSchema = Schema.Literal("null", "boolean", "int", "long", "float", "double", "string", "integer", "text", "File", "data", "collection");
29
+ /**
30
+ * Module types used by Galaxy steps. Galaxy's native format allows additional types such as data_input, data_input_collection, and parameter_type
31
+ but these should be represented as ``inputs`` in Format2.
32
+
33
+ tool: Run a tool.
34
+ subworkflow: Run a subworkflow.
35
+ pause: Pause computation on this branch of workflow until user allows it to continue.
36
+ pick_value: Select the first non-null value from multiple inputs. Used to merge branches of conditional or optional workflow paths.
37
+ */
38
+ export const WorkflowStepTypeSchema = Schema.Literal("tool", "subworkflow", "pause", "pick_value");
39
+ export const DocumentedSchema = Schema.Struct({
40
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
41
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
42
+ });
43
+ /**
44
+ * Define an enumerated type.
45
+ */
46
+ export const EnumSchemaSchema = Schema.Struct({
47
+ /** Defines the set of valid symbols. */
48
+ symbols: Schema.Array(Schema.String),
49
+ /** Must be `enum` */
50
+ type: Schema.Literal("enum"),
51
+ });
52
+ export const RecordSchemaSchema = Schema.Struct({
53
+ /** Defines the fields of the record. */
54
+ fields: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.suspend(() => RecordFieldSchema).annotations({
55
+ identifier: "RecordFieldSchema",
56
+ })))),
57
+ /** Must be `record` */
58
+ type: Schema.Literal("record"),
59
+ });
60
+ export const ArraySchemaSchema = Schema.Struct({
61
+ /** Defines the type of the array elements. */
62
+ items: Schema.Union(PrimitiveTypeSchema, RecordSchemaSchema, EnumSchemaSchema, Schema.suspend(() => ArraySchemaSchema).annotations({
63
+ identifier: "ArraySchemaSchema",
64
+ }), Schema.String, Schema.Array(Schema.Union(PrimitiveTypeSchema, RecordSchemaSchema, EnumSchemaSchema, Schema.suspend(() => ArraySchemaSchema).annotations({
65
+ identifier: "ArraySchemaSchema",
66
+ }), Schema.String))),
67
+ /** Must be `array` */
68
+ type: Schema.Literal("array"),
69
+ });
70
+ /**
71
+ * A field of a record.
72
+ */
73
+ export const RecordFieldSchema = Schema.Struct({
74
+ ...DocumentedSchema.fields,
75
+ /** The name of the field */
76
+ name: Schema.String,
77
+ /** The field type */
78
+ type: Schema.Union(PrimitiveTypeSchema, RecordSchemaSchema, EnumSchemaSchema, ArraySchemaSchema, Schema.String, Schema.Array(Schema.Union(PrimitiveTypeSchema, RecordSchemaSchema, EnumSchemaSchema, ArraySchemaSchema, Schema.String))),
79
+ });
80
+ export const LabeledSchema = Schema.Struct({
81
+ /** A short, human-readable label of this object. */
82
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
83
+ });
84
+ export const IdentifiedSchema = Schema.Struct({
85
+ /** The unique identifier for this object. */
86
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
87
+ });
88
+ /**
89
+ * Define an input or output parameter to a process.
90
+ */
91
+ export const ParameterSchema = Schema.Struct({
92
+ ...LabeledSchema.fields,
93
+ ...DocumentedSchema.fields,
94
+ ...IdentifiedSchema.fields,
95
+ });
96
+ export const InputParameterSchema = Schema.Struct({
97
+ ...ParameterSchema.fields,
98
+ /** The unique identifier for this object. */
99
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
100
+ /** A short, human-readable label of this object. */
101
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
102
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
103
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
104
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
105
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
106
+ });
107
+ export const OutputParameterSchema = Schema.Struct({
108
+ ...ParameterSchema.fields,
109
+ /** The unique identifier for this object. */
110
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
111
+ /** A short, human-readable label of this object. */
112
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
113
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
114
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
115
+ });
116
+ /**
117
+ * Describe an output parameter of a workflow. The parameter must be
118
+ connected to one parameter defined in the workflow that
119
+ will provide the value of the output parameter. It is legal to
120
+ connect a WorkflowInputParameter to a WorkflowOutputParameter.
121
+ */
122
+ export const WorkflowOutputParameterSchema = Schema.Struct({
123
+ ...OutputParameterSchema.fields,
124
+ /** The unique identifier for this object. */
125
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
126
+ /** A short, human-readable label of this object. */
127
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
128
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
129
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
130
+ /** Specifies workflow parameter that supply the value of to the output parameter. */
131
+ outputSource: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
132
+ /** Specify valid types of data that may be assigned to this parameter. */
133
+ type: Schema.optional(Schema.Union(Schema.Null, GalaxyTypeSchema)),
134
+ });
135
+ /**
136
+ * This field specifies the location of the step's node when rendered in the workflow editor.
137
+ */
138
+ export const StepPositionSchema = Schema.Struct({
139
+ /** Relative vertical position of the step's node when rendered in the workflow editor. */
140
+ top: Schema.Number,
141
+ /** Relative horizontal position of the step's node when rendered in the workflow editor. */
142
+ left: Schema.Number,
143
+ });
144
+ export const HasStepPositionSchema = Schema.Struct({
145
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
146
+ });
147
+ export const BaseInputParameterSchema = Schema.Struct({
148
+ ...InputParameterSchema.fields,
149
+ ...HasStepPositionSchema.fields,
150
+ /** The unique identifier for this object. */
151
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
152
+ /** A short, human-readable label of this object. */
153
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
154
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
155
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
156
+ /** Controls whether Galaxy allows invocation of the workflow without a user-supplied value for this input. If ``true``, the input may be omitted at invocation time. ``optional`` and ``default`` are in... */
157
+ optional: Schema.optional(Schema.Union(Schema.Boolean, Schema.Null)),
158
+ });
159
+ /**
160
+ * A boolean input parameter for a Galaxy workflow.
161
+ */
162
+ export const WorkflowBooleanParameterSchema = Schema.Struct({
163
+ ...BaseInputParameterSchema.fields,
164
+ /** The unique identifier for this object. */
165
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
166
+ /** A short, human-readable label of this object. */
167
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
168
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
169
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
170
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
171
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
172
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
173
+ /** Must be ``boolean``. */
174
+ type: Schema.Literal("boolean"),
175
+ });
176
+ export const BaseDataParameterSchema = Schema.Struct({
177
+ ...BaseInputParameterSchema.fields,
178
+ /** The unique identifier for this object. */
179
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
180
+ /** A short, human-readable label of this object. */
181
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
182
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
183
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
184
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
185
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
186
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
187
+ /** Specify datatype extensions for valid input datasets. */
188
+ format: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.String))),
189
+ });
190
+ /**
191
+ * A data input parameter for a Galaxy workflow. Represents one Galaxy dataset.
192
+ Normalized gxformat2 output uses ``type: data``. ``type: File`` is accepted as
193
+ an alias, but should not be confused with workflow test job syntax where
194
+ ``type: File`` means stage a file as test input data.
195
+ */
196
+ export const WorkflowDataParameterSchema = Schema.Struct({
197
+ ...BaseDataParameterSchema.fields,
198
+ /** The unique identifier for this object. */
199
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
200
+ /** A short, human-readable label of this object. */
201
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
202
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
203
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
204
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
205
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
206
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
207
+ /** Controls whether Galaxy allows invocation of the workflow without a user-supplied value for this input. If ``true``, the input may be omitted at invocation time. ``optional`` and ``default`` are in... */
208
+ optional: Schema.optional(Schema.Union(Schema.Boolean, Schema.Null)),
209
+ /** Specify valid types of data that may be assigned to this parameter. */
210
+ type: Schema.optional(Schema.Union(Schema.Literal("data", "File"), Schema.Null)),
211
+ });
212
+ /**
213
+ * Describes one field of a `record` collection input.
214
+ Used in `fields` on a `collection_type` containing `record` (e.g.
215
+ `record`, `list:record`, `sample_sheet:record`). Mirrors a subset of
216
+ the CWL `InputRecordSchema` shape that Galaxy persists on
217
+ `DatasetCollection.fields`.
218
+ */
219
+ export const RecordFieldDefinitionSchema = Schema.Struct({
220
+ /** Field name. Must equal the corresponding element identifier in the materialized record collection. */
221
+ name: Schema.String,
222
+ /** Field value type. A subset of the CWL primitive types: `File`, `null`, `boolean`, `int`, `float`, `string`. May be a list to express a union (e.g. `["File", "null"]` for an optional file). */
223
+ type: Schema.Union(Schema.Literal("File", "null", "boolean", "int", "float", "string"), Schema.Array(Schema.Literal("File", "null", "boolean", "int", "float", "string"))),
224
+ /** Optional Galaxy datatype hint for `File`-typed fields. */
225
+ format: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
226
+ });
227
+ /**
228
+ * Describes one column of a sample-sheet collection input.
229
+ Used in `column_definitions` on a `collection_type: sample_sheet[:<type>]`
230
+ workflow input.
231
+ */
232
+ export const SampleSheetColumnDefinitionSchema = Schema.Struct({
233
+ /** Column name. Must not contain special characters (matches `^[\w\-_ \?]*$`). */
234
+ name: Schema.String,
235
+ /** Optional human-readable column description. */
236
+ description: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
237
+ /** Value type for this column. One of `string`, `int`, `float`, `boolean`, or `element_identifier`. Mirrors Galaxy's runtime `SampleSheetColumnType`. */
238
+ type: Schema.Literal("string", "int", "float", "boolean", "element_identifier"),
239
+ /** If true, rows may omit a value for this column. */
240
+ optional: Schema.Boolean,
241
+ /** Default value used when a row omits this column. Type must be compatible with `type` - validated by the pydantic post-validator. */
242
+ default_value: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Number, Schema.Boolean)),
243
+ /** Galaxy-style parameter validators. Modelled as opaque records here - full validator schema lives in galaxy.tool_util_models. */
244
+ validators: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Unknown))),
245
+ /** Closed set of permitted values for this column. Item type must be compatible with the column `type` (post-validated). */
246
+ restrictions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, Schema.Number, Schema.Number, Schema.Boolean)))),
247
+ /** Open suggestion list for this column. */
248
+ suggestions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, Schema.Number, Schema.Number, Schema.Boolean)))),
249
+ });
250
+ /**
251
+ * A collection input parameter for a Galaxy workflow - represents a dataset collection.
252
+ */
253
+ export const WorkflowCollectionParameterSchema = Schema.Struct({
254
+ ...BaseDataParameterSchema.fields,
255
+ /** The unique identifier for this object. */
256
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
257
+ /** A short, human-readable label of this object. */
258
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
259
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
260
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
261
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
262
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
263
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
264
+ /** Controls whether Galaxy allows invocation of the workflow without a user-supplied value for this input. If ``true``, the input may be omitted at invocation time. ``optional`` and ``default`` are in... */
265
+ optional: Schema.optional(Schema.Union(Schema.Boolean, Schema.Null)),
266
+ /** Must be ``collection``. */
267
+ type: Schema.Literal("collection"),
268
+ /** Collection type (defaults to `list` if `type` is `collection`). Nested collection types are separated with colons, e.g. `list:list:paired`. */
269
+ collection_type: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
270
+ /** Column schema for sample-sheet collection inputs. Only meaningful when `collection_type` begins with `sample_sheet` - cross-field validation is applied in the pydantic post-validator. */
271
+ column_definitions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(SampleSheetColumnDefinitionSchema))),
272
+ /** Field schema for `record` collection inputs. Only meaningful when `collection_type` contains `record` (e.g. `record`, `list:record`, `sample_sheet:record`). */
273
+ fields: Schema.optional(Schema.Union(Schema.Null, Schema.Array(RecordFieldDefinitionSchema))),
274
+ });
275
+ export const MinMaxSchema = Schema.Struct({
276
+ /** Minimum allowed value (inclusive). */
277
+ min: Schema.optional(Schema.Union(Schema.Number, Schema.Null)),
278
+ /** Maximum allowed value (inclusive). */
279
+ max: Schema.optional(Schema.Union(Schema.Number, Schema.Null)),
280
+ });
281
+ /**
282
+ * A float input parameter for a Galaxy workflow.
283
+ */
284
+ export const WorkflowFloatParameterSchema = Schema.Struct({
285
+ ...BaseInputParameterSchema.fields,
286
+ ...MinMaxSchema.fields,
287
+ /** The unique identifier for this object. */
288
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
289
+ /** A short, human-readable label of this object. */
290
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
291
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
292
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
293
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
294
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
295
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
296
+ /** Must be ``float``. */
297
+ type: Schema.Literal("float"),
298
+ });
299
+ /**
300
+ * A `{value, label}` option used in `restrictions` or `suggestions` on a
301
+ text workflow parameter. Plain strings are also accepted in those
302
+ arrays as shorthand for `{value: <str>, label: <str>}`.
303
+ */
304
+ export const WorkflowTextOptionSchema = Schema.Struct({
305
+ /** Machine value submitted to the connected tool input. */
306
+ value: Schema.String,
307
+ /** Human label shown in Galaxy. Defaults to `value` when omitted. */
308
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
309
+ });
310
+ /**
311
+ * A scalar text workflow parameter. Normalized gxformat2 output uses
312
+ ``type: string``. ``type: text`` is accepted for compatibility with native
313
+ Galaxy parameter state and Galaxy tool XML terminology.
314
+ */
315
+ export const WorkflowTextParameterSchema = Schema.Struct({
316
+ ...BaseInputParameterSchema.fields,
317
+ /** The unique identifier for this object. */
318
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
319
+ /** A short, human-readable label of this object. */
320
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
321
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
322
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
323
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
324
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
325
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
326
+ /** Must be ``text`` or ``string``. */
327
+ type: Schema.Literal("text", "string"),
328
+ /** Closed set of permitted values. When present, Galaxy renders the runtime input as a select. Items may be plain strings or `{value, label}` records. */
329
+ restrictions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, WorkflowTextOptionSchema)))),
330
+ /** Open suggestion list. Galaxy still treats the input as text but offers these as suggestions. */
331
+ suggestions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, WorkflowTextOptionSchema)))),
332
+ /** Ask Galaxy to derive valid choices from connected tool or subworkflow select inputs at runtime. Falls back to free text when derivation fails. */
333
+ restrictOnConnections: Schema.optional(Schema.Union(Schema.Null, Schema.Boolean)),
334
+ });
335
+ /**
336
+ * A scalar integer workflow parameter. Normalized gxformat2 output uses
337
+ ``type: int``. ``type: integer`` is accepted for compatibility with native
338
+ Galaxy parameter state and Galaxy tool XML terminology.
339
+ */
340
+ export const WorkflowIntegerParameterSchema = Schema.Struct({
341
+ ...BaseInputParameterSchema.fields,
342
+ ...MinMaxSchema.fields,
343
+ /** The unique identifier for this object. */
344
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
345
+ /** A short, human-readable label of this object. */
346
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
347
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
348
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
349
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
350
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
351
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
352
+ /** Must be ``integer`` or ``int``. */
353
+ type: Schema.Literal("integer", "int"),
354
+ });
355
+ /**
356
+ * The base executable type in CWL is the `Process` object defined by the
357
+ document. Note that the `Process` object is abstract and cannot be
358
+ directly executed.
359
+ */
360
+ export const ProcessSchema = Schema.Struct({
361
+ ...IdentifiedSchema.fields,
362
+ ...LabeledSchema.fields,
363
+ ...DocumentedSchema.fields,
364
+ /** Defines the input parameters of the process. The process is ready to run when all required input parameters are associated with concrete values. Input parameters include a schema for each paramet... */
365
+ inputs: Schema.Union(Schema.Array(Schema.Union(WorkflowDataParameterSchema, WorkflowCollectionParameterSchema, WorkflowIntegerParameterSchema, WorkflowFloatParameterSchema, WorkflowTextParameterSchema, WorkflowBooleanParameterSchema)), Schema.Record({
366
+ key: Schema.String,
367
+ value: Schema.Union(WorkflowDataParameterSchema, WorkflowCollectionParameterSchema, WorkflowIntegerParameterSchema, WorkflowFloatParameterSchema, WorkflowTextParameterSchema, WorkflowBooleanParameterSchema, Schema.String),
368
+ }), Schema.Record({ key: Schema.String, value: Schema.Unknown })),
369
+ /** Defines the parameters representing the output of the process. May be used to generate and/or validate the output object. */
370
+ outputs: Schema.Union(Schema.Array(WorkflowOutputParameterSchema), Schema.Record({
371
+ key: Schema.String,
372
+ value: Schema.Union(WorkflowOutputParameterSchema, Schema.String),
373
+ }), Schema.Record({ key: Schema.String, value: Schema.Unknown })),
374
+ });
375
+ export const HasUUIDSchema = Schema.Struct({
376
+ /** UUID uniquely representing this element. */
377
+ uuid: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
378
+ });
379
+ export const HasStepErrorsSchema = Schema.Struct({
380
+ /** During Galaxy export there may be some problem validating the tool state, tool used, etc.. that will be indicated by this field. The Galaxy user should be warned of these problems before the workfl... */
381
+ errors: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
382
+ });
383
+ export const ToolShedRepositorySchema = Schema.Struct({
384
+ /** The name of the tool shed repository this tool can be found in. */
385
+ name: Schema.String,
386
+ /** The revision of the tool shed repository this tool can be found in. */
387
+ changeset_revision: Schema.String,
388
+ /** The owner of the tool shed repository this tool can be found in. */
389
+ owner: Schema.String,
390
+ /** The URI of the tool shed containing the repository this tool can be found in - typically this should be toolshed.g2.bx.psu.edu. */
391
+ tool_shed: Schema.String,
392
+ });
393
+ export const ReferencesToolSchema = Schema.Struct({
394
+ /** The tool ID used to run this step of the workflow (e.g. 'cat1' or 'toolshed.g2.bx.psu.edu/repos/nml/collapse_collections/collapse_dataset/4.0'). */
395
+ tool_id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
396
+ /** The Galaxy Tool Shed repository that should be installed in order to use this tool. */
397
+ tool_shed_repository: Schema.optional(Schema.Union(Schema.Null, ToolShedRepositorySchema)),
398
+ /** The tool version corresponding used to run this step of the workflow. For tool shed installed tools, the ID generally uniquely specifies a version and this field is optional. */
399
+ tool_version: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
400
+ });
401
+ /**
402
+ * An input parameter to a Galaxy workflow. This is the catch-all type used
403
+ by the Schema Salad codegen. The pydantic layer uses a discriminated union
404
+ of the specific parameter types instead.
405
+ */
406
+ export const WorkflowInputParameterSchema = Schema.Struct({
407
+ ...BaseDataParameterSchema.fields,
408
+ ...MinMaxSchema.fields,
409
+ /** The unique identifier for this object. */
410
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
411
+ /** A short, human-readable label of this object. */
412
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
413
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
414
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
415
+ /** The default value to use for this parameter if the parameter is missing from the input object, or if the value of the parameter in the input object is `null`. Default values are applied before eva... */
416
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
417
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
418
+ /** Controls whether Galaxy allows invocation of the workflow without a user-supplied value for this input. If ``true``, the input may be omitted at invocation time. ``optional`` and ``default`` are in... */
419
+ optional: Schema.optional(Schema.Union(Schema.Boolean, Schema.Null)),
420
+ /** Specify valid types of data that may be assigned to this parameter. */
421
+ type: Schema.optional(Schema.Union(GalaxyTypeSchema, Schema.Null, Schema.Array(GalaxyTypeSchema))),
422
+ /** Collection type (defaults to `list` if `type` is `collection`). Nested collection types are separated with colons, e.g. `list:list:paired`. */
423
+ collection_type: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
424
+ /** Column schema for sample-sheet collection inputs. Only meaningful when `collection_type` begins with `sample_sheet`. */
425
+ column_definitions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(SampleSheetColumnDefinitionSchema))),
426
+ /** Field schema for `record` collection inputs. Only meaningful when `collection_type` contains `record`. */
427
+ fields: Schema.optional(Schema.Union(Schema.Null, Schema.Array(RecordFieldDefinitionSchema))),
428
+ /** Closed set of permitted values for text-typed inputs. See `WorkflowTextParameter.restrictions`. */
429
+ restrictions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, WorkflowTextOptionSchema)))),
430
+ /** Open suggestion list for text-typed inputs. */
431
+ suggestions: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, WorkflowTextOptionSchema)))),
432
+ /** For text-typed inputs - derive runtime choices from connected tool/subworkflow select inputs. */
433
+ restrictOnConnections: Schema.optional(Schema.Union(Schema.Null, Schema.Boolean)),
434
+ });
435
+ /**
436
+ * Associate an output parameter of the underlying process with a workflow
437
+ parameter. The workflow parameter (given in the `id` field) be may be used
438
+ as a `source` to connect with input parameters of other workflow steps, or
439
+ with an output parameter of the process.
440
+
441
+ A unique identifier for this workflow output parameter. This is
442
+ the identifier to use in the `source` field of `WorkflowStepInput`
443
+ to connect the output value to downstream parameters.
444
+ */
445
+ export const WorkflowStepOutputSchema = Schema.Struct({
446
+ ...IdentifiedSchema.fields,
447
+ add_tags: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.String))),
448
+ change_datatype: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
449
+ delete_intermediate_datasets: Schema.optional(Schema.Union(Schema.Null, Schema.Boolean)),
450
+ hide: Schema.optional(Schema.Union(Schema.Null, Schema.Boolean)),
451
+ remove_tags: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.String))),
452
+ rename: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
453
+ set_columns: Schema.optional(Schema.Union(Schema.Record({ key: Schema.String, value: Schema.Unknown }), Schema.Null)),
454
+ });
455
+ /**
456
+ * Base fields shared by all creator types, corresponding to schema.org
457
+ Thing properties common to both Person and Organization.
458
+ */
459
+ export const BaseCreatorSchema = Schema.Struct({
460
+ /** Full name of the person or organization. */
461
+ name: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
462
+ /** Persistent identifier, typically an ORCID URL (e.g. ``https://orcid.org/0000-0001-2345-6789``) or bare ORCID. */
463
+ identifier: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
464
+ /** Website or profile URL. */
465
+ url: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
466
+ /** Email address. May include a ``mailto:`` prefix. */
467
+ email: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
468
+ /** URL to an image or avatar. */
469
+ image: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
470
+ /** Physical or mailing address. */
471
+ address: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
472
+ /** An alternate name or alias. */
473
+ alternateName: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
474
+ /** Telephone number. */
475
+ telephone: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
476
+ /** Fax number. */
477
+ faxNumber: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
478
+ });
479
+ /**
480
+ * An organization that created or contributed to the workflow.
481
+ Corresponds to a `schema.org Organization <https://schema.org/Organization>`_.
482
+ */
483
+ export const CreatorOrganizationSchema = Schema.Struct({
484
+ ...BaseCreatorSchema.fields,
485
+ /** Creator type discriminator (``Organization``). */
486
+ class: Schema.Literal("Organization"),
487
+ });
488
+ /**
489
+ * Base fields shared by all comment types.
490
+ */
491
+ export const BaseCommentSchema = Schema.Struct({
492
+ /** Position of the comment on the editor canvas as ``[x, y]`` coordinates. */
493
+ position: Schema.optional(Schema.Union(Schema.Array(Schema.Number), Schema.Null)),
494
+ /** Size of the comment as ``[width, height]``. */
495
+ size: Schema.optional(Schema.Union(Schema.Array(Schema.Number), Schema.Null)),
496
+ /** Display color of the comment (e.g. ``"none"``, ``"blue"``). */
497
+ color: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
498
+ /** Optional label for referencing this comment from frame ``contains_comments`` fields or for use as a map key when comments are represented as a mapping. */
499
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
500
+ });
501
+ /**
502
+ * A plain text annotation in the workflow editor.
503
+ */
504
+ export const TextCommentSchema = Schema.Struct({
505
+ ...BaseCommentSchema.fields,
506
+ /** Comment type (``text``). */
507
+ type: Schema.Literal("text"),
508
+ /** The text content. */
509
+ text: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
510
+ /** Whether the text is displayed in bold. */
511
+ bold: Schema.optional(Schema.Union(Schema.Null, Schema.Boolean)),
512
+ /** Whether the text is displayed in italic. */
513
+ italic: Schema.optional(Schema.Union(Schema.Null, Schema.Boolean)),
514
+ /** Font size of the text. */
515
+ text_size: Schema.optional(Schema.Union(Schema.Null, Schema.Number)),
516
+ });
517
+ /**
518
+ * A freehand drawn line on the editor canvas.
519
+ */
520
+ export const FreehandCommentSchema = Schema.Struct({
521
+ ...BaseCommentSchema.fields,
522
+ /** Comment type (``freehand``). */
523
+ type: Schema.Literal("freehand"),
524
+ /** Line thickness. */
525
+ thickness: Schema.optional(Schema.Union(Schema.Null, Schema.Number)),
526
+ /** Array of ``[x, y]`` coordinate pairs defining the freehand line path. */
527
+ line: Schema.optional(Schema.Union(Schema.Array(Schema.Array(Schema.Number)), Schema.Null)),
528
+ });
529
+ /**
530
+ * A person who created or contributed to the workflow.
531
+ Corresponds to a `schema.org Person <https://schema.org/Person>`_.
532
+ */
533
+ export const CreatorPersonSchema = Schema.Struct({
534
+ ...BaseCreatorSchema.fields,
535
+ /** Creator type discriminator (``Person``). */
536
+ class: Schema.Literal("Person"),
537
+ /** Given (first) name. */
538
+ givenName: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
539
+ /** Family (last) name. */
540
+ familyName: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
541
+ /** Honorific prefix (e.g. ``Dr``, ``Prof``). */
542
+ honorificPrefix: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
543
+ /** Honorific suffix (e.g. ``M.D.``, ``PhD``). */
544
+ honorificSuffix: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
545
+ /** Job title or role. */
546
+ jobTitle: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
547
+ });
548
+ /**
549
+ * Definition of an invocation report for this workflow. Currently the only
550
+ field is 'markdown'.
551
+ */
552
+ export const ReportSchema = Schema.Struct({
553
+ /** Galaxy flavored Markdown to define an invocation report. */
554
+ markdown: Schema.String,
555
+ });
556
+ /**
557
+ * A rectangular grouping box that visually contains steps and other comments.
558
+ */
559
+ export const FrameCommentSchema = Schema.Struct({
560
+ ...BaseCommentSchema.fields,
561
+ /** Comment type (``frame``). */
562
+ type: Schema.Literal("frame"),
563
+ /** Title displayed on the frame header. */
564
+ title: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
565
+ /** Step labels or indices contained within this frame. */
566
+ contains_steps: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, Schema.Number)))),
567
+ /** Comment labels or indices contained within this frame. */
568
+ contains_comments: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.Union(Schema.String, Schema.Number)))),
569
+ });
570
+ /**
571
+ * A Markdown-rendered annotation in the workflow editor.
572
+ */
573
+ export const MarkdownCommentSchema = Schema.Struct({
574
+ ...BaseCommentSchema.fields,
575
+ /** Comment type (``markdown``). */
576
+ type: Schema.Literal("markdown"),
577
+ /** Markdown content. */
578
+ text: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
579
+ });
580
+ /**
581
+ * A Galaxy workflow description. This record corresponds to the description of a workflow that should be executable
582
+ on a Galaxy server that includes the contained tool definitions.
583
+
584
+ The workflows API or the user interface of Galaxy instances that are of version 19.09 or newer should be able to
585
+ import a document defining this record.
586
+
587
+ ## A note about `label` field.
588
+
589
+ This is the name of the workflow in the Galaxy user interface. This is the mechanism that
590
+ users will primarily identify the workflow using. Legacy support - this may also be called 'name' and Galaxy will
591
+ consume the workflow document fine and treat this attribute correctly - however in order to validate against this
592
+ workflow definition schema the attribute should be called `label`.
593
+ */
594
+ export const GalaxyWorkflowSchema = Schema.Struct({
595
+ ...ProcessSchema.fields,
596
+ ...HasUUIDSchema.fields,
597
+ /** The unique identifier for this object. */
598
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
599
+ class: Schema.Literal("GalaxyWorkflow"),
600
+ /** A short, human-readable label of this object. */
601
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
602
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
603
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
604
+ /** The individual steps that make up the workflow. Each step is executed when all of its input data links are fulfilled. */
605
+ steps: Schema.Union(Schema.Array(Schema.suspend(() => WorkflowStepSchema).annotations({
606
+ identifier: "WorkflowStepSchema",
607
+ })), Schema.Record({
608
+ key: Schema.String,
609
+ value: Schema.suspend(() => WorkflowStepSchema).annotations({
610
+ identifier: "WorkflowStepSchema",
611
+ }),
612
+ })),
613
+ /** Workflow invocation report template. */
614
+ report: Schema.optional(Schema.Union(Schema.Null, ReportSchema)),
615
+ /** Tags for the workflow. */
616
+ tags: Schema.optional(Schema.Union(Schema.Array(Schema.String), Schema.Null)),
617
+ /** Visual annotations for the workflow editor canvas. Comments are non-functional and do not affect workflow execution. May be specified as a list or as a mapping keyed by label. */
618
+ comments: Schema.optional(Schema.Union(Schema.Array(Schema.Union(TextCommentSchema, MarkdownCommentSchema, FrameCommentSchema, FreehandCommentSchema)), Schema.Record({
619
+ key: Schema.String,
620
+ value: Schema.Union(TextCommentSchema, MarkdownCommentSchema, FrameCommentSchema, FreehandCommentSchema),
621
+ }), Schema.Null)),
622
+ /** Workflow creators. Can be schema.org Person (https://schema.org/Person) or Organization (https://schema.org/Organization) entities. */
623
+ creator: Schema.optional(Schema.Union(Schema.Array(Schema.Union(CreatorPersonSchema, CreatorOrganizationSchema)), Schema.Null)),
624
+ /** Must be a valid license listed at https://spdx.org/licenses/ */
625
+ license: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
626
+ /** If listed should correspond to the release of the workflow in its source reposiory. */
627
+ release: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
628
+ });
629
+ export const SinkSchema = Schema.Struct({
630
+ /** Specifies one or more workflow parameters that will provide input to the underlying step parameter. */
631
+ source: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
632
+ });
633
+ /**
634
+ * TODO:
635
+ */
636
+ export const WorkflowStepInputSchema = Schema.Struct({
637
+ ...IdentifiedSchema.fields,
638
+ ...SinkSchema.fields,
639
+ ...LabeledSchema.fields,
640
+ /** The default value for this parameter to use if either there is no `source` field, or the value produced by the `source` is `null`. The default must be applied prior to scattering or evaluating `va... */
641
+ default: Schema.optional(Schema.Union(Schema.Null, Schema.Unknown)),
642
+ });
643
+ /**
644
+ * This represents a non-input step a Galaxy Workflow.
645
+
646
+ # A note about `state` and `tool_state` fields.
647
+
648
+ Only one or the other should be specified. These are two ways to represent the "state"
649
+ of a tool at this workflow step. Both are essentially maps from parameter names to
650
+ parameter values.
651
+
652
+ `tool_state` is much more low-level and expects a flat dictionary with each value a JSON
653
+ dump. Nested tool structures such as conditionals and repeats should have all their values
654
+ in the JSON dumped string. In general `tool_state` may be present in workflows exported from
655
+ Galaxy but shouldn't be written by humans.
656
+
657
+ `state` can contained a typed map. Repeat values can be represented as YAML arrays. An alternative
658
+ to representing `state` this way is defining inputs with default values.
659
+ */
660
+ export const WorkflowStepSchema = Schema.Struct({
661
+ ...IdentifiedSchema.fields,
662
+ ...LabeledSchema.fields,
663
+ ...DocumentedSchema.fields,
664
+ ...HasStepPositionSchema.fields,
665
+ ...ReferencesToolSchema.fields,
666
+ ...HasStepErrorsSchema.fields,
667
+ ...HasUUIDSchema.fields,
668
+ /** Defines the input parameters of the workflow step. The process is ready to run when all required input parameters are associated with concrete values. Input parameters include a schema for each p... */
669
+ in: Schema.optional(Schema.Union(Schema.Array(WorkflowStepInputSchema), Schema.Record({
670
+ key: Schema.String,
671
+ value: Schema.Union(WorkflowStepInputSchema, Schema.String, Schema.Array(Schema.String)),
672
+ }), Schema.Null)),
673
+ /** Defines the parameters representing the output of the process. May be used to generate and/or validate the output object. This can also be called 'outputs' for legacy reasons - but the resulting ... */
674
+ out: Schema.optional(Schema.Union(Schema.Array(Schema.Union(WorkflowStepOutputSchema, Schema.String)), Schema.Record({
675
+ key: Schema.String,
676
+ value: Schema.Union(WorkflowStepOutputSchema, Schema.String),
677
+ }), Schema.Null)),
678
+ /** Structured tool state. */
679
+ state: Schema.optional(Schema.Union(Schema.Record({ key: Schema.String, value: Schema.Unknown }), Schema.Null)),
680
+ /** Unstructured tool state. */
681
+ tool_state: Schema.optional(Schema.Union(Schema.String, Schema.Record({ key: Schema.String, value: Schema.Unknown }), Schema.Null)),
682
+ /** Optional dict of post-job actions keyed by ``{ActionType}{OutputName}`` compound strings. Same shape as the native ``post_job_actions`` field; each value is a record with ``action_type``, ``output... */
683
+ post_job_actions: Schema.optional(Schema.Union(Schema.Record({ key: Schema.String, value: Schema.Unknown }), Schema.Null)),
684
+ /** Workflow step module's type (defaults to 'tool'). */
685
+ type: Schema.optional(Schema.Union(Schema.Null, WorkflowStepTypeSchema)),
686
+ /** Specifies a subworkflow to run. May be an inline workflow definition, a URL string, or an @import reference dict. */
687
+ run: Schema.optional(Schema.Union(GalaxyWorkflowSchema, Schema.String, Schema.Record({ key: Schema.String, value: Schema.Unknown }), Schema.Null)),
688
+ runtime_inputs: Schema.optional(Schema.Union(Schema.Null, Schema.Array(Schema.String))),
689
+ /** If defined, only run the step when the expression evaluates to `true`. If `false` the step is skipped. A skipped step produces a `null` on each output. Expression should be an ecma5.1 expression. */
690
+ when: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
691
+ });
692
+ /**
693
+ * A workflow step in a draft Galaxy workflow. This extends the normal
694
+ gxformat2 workflow step shape with draft-only planning fields used while
695
+ wrapper selection, parameter binding, and wrapper port names are still
696
+ unresolved.
697
+ */
698
+ export const DraftWorkflowStepSchema = Schema.Struct({
699
+ ...WorkflowStepSchema.fields,
700
+ /** The unique identifier for this object. */
701
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
702
+ /** A short, human-readable label of this object. */
703
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
704
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
705
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
706
+ position: Schema.optional(Schema.Union(Schema.Null, StepPositionSchema)),
707
+ /** The tool ID used to run this step of the workflow (e.g. 'cat1' or 'toolshed.g2.bx.psu.edu/repos/nml/collapse_collections/collapse_dataset/4.0'). */
708
+ tool_id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
709
+ /** The Galaxy Tool Shed repository that should be installed in order to use this tool. */
710
+ tool_shed_repository: Schema.optional(Schema.Union(Schema.Null, ToolShedRepositorySchema)),
711
+ /** The tool version corresponding used to run this step of the workflow. For tool shed installed tools, the ID generally uniquely specifies a version and this field is optional. */
712
+ tool_version: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
713
+ /** During Galaxy export there may be some problem validating the tool state, tool used, etc.. that will be indicated by this field. The Galaxy user should be warned of these problems before the workfl... */
714
+ errors: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
715
+ /** UUID uniquely representing this element. */
716
+ uuid: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
717
+ /** Draft-only free-text parameter binding intent for this step. This field must be removed before the workflow is treated as runnable gxformat2. */
718
+ _plan_state: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
719
+ /** Draft-only free-text wrapper selection context for this step, such as source command details, conda packages, containers, environment variables, and pre/postconditions. This field must be removed b... */
720
+ _plan_context: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
721
+ /** Draft-only free-text wrapper input-port mapping intent for this step. This field must be removed before the workflow is treated as runnable gxformat2. */
722
+ _plan_in: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
723
+ /** Draft-only free-text wrapper output-surface intent for this step. This field must be removed before the workflow is treated as runnable gxformat2. */
724
+ _plan_out: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
725
+ });
726
+ /**
727
+ * A draft Galaxy workflow description. A draft workflow has concrete workflow
728
+ topology but may contain draft-only wrapper-tier TODO sentinels and
729
+ per-step ``_plan_*`` fields. It is not a runnable gxformat2 workflow until
730
+ all TODO sentinels and planning fields have been resolved and stripped.
731
+ */
732
+ export const GalaxyWorkflowDraftSchema = Schema.Struct({
733
+ ...ProcessSchema.fields,
734
+ ...HasUUIDSchema.fields,
735
+ /** The unique identifier for this object. */
736
+ id: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
737
+ class: Schema.Literal("GalaxyWorkflowDraft"),
738
+ /** A short, human-readable label of this object. */
739
+ label: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
740
+ /** A documentation string for this object, or an array of strings which should be concatenated. */
741
+ doc: Schema.optional(Schema.Union(Schema.Null, Schema.String, Schema.Array(Schema.String))),
742
+ /** The individual steps that make up the workflow. Each step is executed when all of its input data links are fulfilled. */
743
+ steps: Schema.Union(Schema.Array(DraftWorkflowStepSchema), Schema.Record({ key: Schema.String, value: DraftWorkflowStepSchema })),
744
+ /** Workflow invocation report template. */
745
+ report: Schema.optional(Schema.Union(Schema.Null, ReportSchema)),
746
+ /** Tags for the workflow. */
747
+ tags: Schema.optional(Schema.Union(Schema.Array(Schema.String), Schema.Null)),
748
+ /** Visual annotations for the workflow editor canvas. Comments are non-functional and do not affect workflow execution. May be specified as a list or as a mapping keyed by label. */
749
+ comments: Schema.optional(Schema.Union(Schema.Array(Schema.Union(TextCommentSchema, MarkdownCommentSchema, FrameCommentSchema, FreehandCommentSchema)), Schema.Record({
750
+ key: Schema.String,
751
+ value: Schema.Union(TextCommentSchema, MarkdownCommentSchema, FrameCommentSchema, FreehandCommentSchema),
752
+ }), Schema.Null)),
753
+ /** Workflow creators. Can be schema.org Person (https://schema.org/Person) or Organization entities. */
754
+ creator: Schema.optional(Schema.Union(Schema.Array(Schema.Union(CreatorPersonSchema, CreatorOrganizationSchema)), Schema.Null)),
755
+ /** Must be a valid license listed at https://spdx.org/licenses/ */
756
+ license: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
757
+ /** If listed should correspond to the release of the workflow in its source reposiory. */
758
+ release: Schema.optional(Schema.Union(Schema.Null, Schema.String)),
759
+ });
760
+ export function isWorkflowDataParameter(v) {
761
+ return v?.type === "data" || v?.type === "File";
762
+ }
763
+ export function isWorkflowCollectionParameter(v) {
764
+ return v?.type === "collection";
765
+ }
766
+ export function isWorkflowIntegerParameter(v) {
767
+ return v?.type === "integer" || v?.type === "int";
768
+ }
769
+ export function isWorkflowTextParameter(v) {
770
+ return v?.type === "text" || v?.type === "string";
771
+ }
772
+ export function isWorkflowFloatParameter(v) {
773
+ return v?.type === "float";
774
+ }
775
+ export function isWorkflowBooleanParameter(v) {
776
+ return v?.type === "boolean";
777
+ }
778
+ //# sourceMappingURL=gxformat2-draft.effect.js.map