@nfdi4plants/arctrl 3.1.0 → 3.1.1

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 (89) hide show
  1. package/dist/ts/ts/CWL/CWLTypes.d.ts +162 -45
  2. package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
  3. package/dist/ts/ts/CWL/CWLTypes.js +495 -104
  4. package/dist/ts/ts/CWL/Decode.d.ts +291 -48
  5. package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
  6. package/dist/ts/ts/CWL/Decode.js +911 -568
  7. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +37 -0
  8. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -0
  9. package/dist/ts/ts/CWL/DynamicObjHelpers.js +57 -0
  10. package/dist/ts/ts/CWL/Encode.d.ts +117 -2
  11. package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
  12. package/dist/ts/ts/CWL/Encode.js +399 -163
  13. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +2 -0
  14. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
  15. package/dist/ts/ts/CWL/ExpressionToolDescription.js +7 -0
  16. package/dist/ts/ts/CWL/Inputs.d.ts +65 -14
  17. package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
  18. package/dist/ts/ts/CWL/Inputs.js +194 -51
  19. package/dist/ts/ts/CWL/OperationDescription.d.ts +2 -0
  20. package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
  21. package/dist/ts/ts/CWL/OperationDescription.js +7 -0
  22. package/dist/ts/ts/CWL/Outputs.d.ts +51 -12
  23. package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
  24. package/dist/ts/ts/CWL/Outputs.js +152 -76
  25. package/dist/ts/ts/CWL/ParameterReference.d.ts +4 -1
  26. package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
  27. package/dist/ts/ts/CWL/ParameterReference.js +17 -6
  28. package/dist/ts/ts/CWL/Requirements.d.ts +140 -51
  29. package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
  30. package/dist/ts/ts/CWL/Requirements.js +458 -128
  31. package/dist/ts/ts/CWL/ToolDescription.d.ts +27 -2
  32. package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
  33. package/dist/ts/ts/CWL/ToolDescription.js +74 -4
  34. package/dist/ts/ts/CWL/WorkflowDescription.d.ts +2 -0
  35. package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
  36. package/dist/ts/ts/CWL/WorkflowDescription.js +7 -0
  37. package/dist/ts/ts/CWL/WorkflowSteps.d.ts +50 -19
  38. package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
  39. package/dist/ts/ts/CWL/WorkflowSteps.js +152 -23
  40. package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
  41. package/dist/ts/ts/ContractIO/ContractIO.js +4 -1
  42. package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
  43. package/dist/ts/ts/Conversion/Assay.js +4 -3
  44. package/dist/ts/ts/Conversion/Investigation.js +2 -2
  45. package/dist/ts/ts/Conversion/Person.d.ts +1 -1
  46. package/dist/ts/ts/Conversion/Person.d.ts.map +1 -1
  47. package/dist/ts/ts/Conversion/Person.js +27 -11
  48. package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
  49. package/dist/ts/ts/Conversion/Run.js +3 -2
  50. package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
  51. package/dist/ts/ts/Conversion/ScholarlyArticle.js +2 -1
  52. package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
  53. package/dist/ts/ts/Conversion/Study.js +5 -4
  54. package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
  55. package/dist/ts/ts/Conversion/Workflow.js +13 -12
  56. package/dist/ts/ts/Conversion.d.ts +14 -10
  57. package/dist/ts/ts/Conversion.d.ts.map +1 -1
  58. package/dist/ts/ts/Conversion.js +18 -11
  59. package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
  60. package/dist/ts/ts/Core/ArcTypes.js +18 -0
  61. package/dist/ts/ts/Json.d.ts +2 -2
  62. package/dist/ts/ts/Json.d.ts.map +1 -1
  63. package/dist/ts/ts/Json.js +3 -3
  64. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
  65. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +2 -1
  66. package/dist/ts/ts/Yaml/ValidationPackage.d.ts +1 -1
  67. package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
  68. package/dist/ts/ts/Yaml/ValidationPackage.js +5 -5
  69. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +1 -1
  70. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
  71. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +5 -5
  72. package/dist/ts/ts/Yaml.js +1 -1
  73. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Decode.fs.js +5 -33
  74. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Persil.fs.js +11 -159
  75. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Preprocessing.fs.js +319 -0
  76. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Reader.fs.js +1867 -0
  77. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Regex.fs.js +1 -1
  78. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/RegexActivePatterns.fs.js +2 -2
  79. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Syntax.fs.js +819 -0
  80. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Writer.fs.js +75 -48
  81. package/package.json +1 -1
  82. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.7/FlowToBlock.fs.js +0 -956
  83. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.7/Preprocessing.fs.js +0 -181
  84. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.7/Reader.fs.js +0 -1493
  85. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Encode.fs.js +0 -0
  86. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Escapes.fs.js +0 -0
  87. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Interop/JsInterop.fs.js +0 -0
  88. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/StringBuffer.fs.js +0 -0
  89. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/YAMLiciousTypes.fs.js +0 -0
@@ -1,16 +1,25 @@
1
1
  import { FSharpChoice$2_Choice1Of2, FSharpChoice$2_Choice2Of2 } from '../../node_modules/@fable-org/fable-library-js/Choice.js';
2
+ import { FileInstance, DirectoryInstance, DirentInstance, InputRecordField, InputRecordSchema, InputEnumSchema, InputArraySchema, SchemaDefRequirementType, SoftwarePackage } from './CWLTypes.js';
2
3
  import { map, value, bind, filter } from '../../node_modules/@fable-org/fable-library-js/Option.js';
3
- import { toList, map as map$2, choose as choose$1, fold, delay, append as append$1, singleton as singleton$1, empty as empty$1 } from '../../node_modules/@fable-org/fable-library-js/Seq.js';
4
- import { isEmpty, head, tail, map as map$1, singleton, ofArray, empty, append, ofSeq, choose, exists, cons, filter as filter$1, contains, tryFind, reverse, length } from '../../node_modules/@fable-org/fable-library-js/List.js';
5
- import { YAMLElement_Value, YAMLContent_create_Z1C3A29C9, YAMLElement_Object, YAMLElement_Mapping, ScalarStyle_Block, BlockScalarStyle_Literal, ChompingMode_Clip, ScalarStyle_DoubleQuoted, YAMLElement_Sequence, YAMLElement, Config } from '../fable_modules/YAMLicious.1.0.0-alpha.7/YAMLiciousTypes.fs.js';
4
+ import { toList, choose, fold, map as map$2, delay, append as append$1, singleton as singleton$1, empty as empty$2 } from '../../node_modules/@fable-org/fable-library-js/Seq.js';
5
+ import { isEmpty, head, tail, map as map$1, append, singleton, ofArray, empty as empty$1, ofSeq, length, choose as choose$1, filter as filter$1, contains, tryFind, reverse, cons } from '../../node_modules/@fable-org/fable-library-js/List.js';
6
+ import { YAMLElement_Value, YAMLContent_create_Z1C3A29C9, YAMLElement_Object, YAMLElement_Mapping, YAMLElement, YAMLElement_Sequence, ScalarStyle_Block, BlockScalarStyle_Literal, ChompingMode_Clip, ScalarStyle_DoubleQuoted, Config } from '../fable_modules/YAMLicious.1.0.0-alpha.11/YAMLiciousTypes.fs.js';
7
+ import { equals, defaultOf, int64ToString, isIterable, comparePrimitives, curry2, stringHash } from '../../node_modules/@fable-org/fable-library-js/Util.js';
8
+ import { string, int } from '../fable_modules/YAMLicious.1.0.0-alpha.11/Encode.fs.js';
9
+ import { DynamicObj } from '../fable_modules/DynamicObj.7.1.0/DynamicObj.fs.js';
10
+ import { dynamicPropertiesExcept } from './DynamicObjHelpers.js';
11
+ import { empty, ofSeq as ofSeq$1, ofList, FSharpSet__Contains } from '../../node_modules/@fable-org/fable-library-js/Set.js';
6
12
  import { trimEnd, replace, toText, interpolate, trimStart, join, split } from '../../node_modules/@fable-org/fable-library-js/String.js';
7
- import { string, int, float } from '../fable_modules/YAMLicious.1.0.0-alpha.7/Encode.fs.js';
8
- import { LoadListingEnum_get_toCwlString } from './Requirements.js';
9
- import { int64ToString, stringHash, comparePrimitives } from '../../node_modules/@fable-org/fable-library-js/Util.js';
13
+ import { LoadListingEnum_get_toCwlString, InlineJavascriptRequirementValue, InplaceUpdateRequirementValue, NetworkAccessRequirementValue, WorkReuseRequirementValue, ResourceRequirementInstance, EnvironmentDef, LoadListingRequirementValue, DockerRequirement } from './Requirements.js';
14
+ import { OutputBinding, CWLOutput } from './Outputs.js';
15
+ import { InputBinding, CWLInput } from './Inputs.js';
16
+ import { StepInput, StepOutputParameter, WorkflowStep } from './WorkflowSteps.js';
10
17
  import { WorkflowStepRunOps_tryGetOperation, WorkflowStepRunOps_tryGetExpressionTool, WorkflowStepRunOps_tryGetWorkflow, WorkflowStepRunOps_tryGetTool } from './CWLProcessingUnit.js';
11
- import { toString } from '../../node_modules/@fable-org/fable-library-js/Types.js';
12
- import { write } from '../fable_modules/YAMLicious.1.0.0-alpha.7/Writer.fs.js';
13
- import { ofList, FSharpSet__Contains } from '../../node_modules/@fable-org/fable-library-js/Set.js';
18
+ import { CWLToolDescription } from './ToolDescription.js';
19
+ import { CWLWorkflowDescription } from './WorkflowDescription.js';
20
+ import { CWLExpressionToolDescription } from './ExpressionToolDescription.js';
21
+ import { CWLOperationDescription } from './OperationDescription.js';
22
+ import { write } from '../fable_modules/YAMLicious.1.0.0-alpha.11/Writer.fs.js';
14
23
 
15
24
  function $007CPrimitiveType$007CComplexType$007C(t) {
16
25
  switch (t.tag) {
@@ -54,7 +63,8 @@ function $007CPrimitiveType$007CComplexType$007C(t) {
54
63
  case /* Array */
55
64
  11: {
56
65
  const arraySchema = t.fields[0];
57
- if ($007CPrimitiveType$007CComplexType$007C(arraySchema.Items).tag === /* Choice2Of2 */
66
+ const matchValue = arraySchema.Items;
67
+ if ($007CPrimitiveType$007CComplexType$007C(matchValue).tag === /* Choice2Of2 */
58
68
  1) {
59
69
  return FSharpChoice$2_Choice2Of2(void 0);
60
70
  } else {
@@ -107,8 +117,10 @@ function isComplexType(t_mut) {
107
117
  13:
108
118
  return true;
109
119
  case /* Array */
110
- 11:
111
- return tryGetArrayShorthand(t.fields[0].Items) == null;
120
+ 11: {
121
+ const arraySchema = t.fields[0];
122
+ return tryGetArrayShorthand(arraySchema.Items) == null;
123
+ }
112
124
  case /* Union */
113
125
  14: {
114
126
  const typesList = toList(t.fields[0]);
@@ -162,15 +174,62 @@ function isComplexType(t_mut) {
162
174
  function yBool(b) {
163
175
  return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(b ? "true" : "false"));
164
176
  }
177
+ function yFloat(value) {
178
+ return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(value.toString()));
179
+ }
165
180
  function yMap(pairs) {
166
181
  return YAMLElement_Object(map$1((tupledArg) => {
167
182
  let _arg, single;
168
183
  return YAMLElement_Mapping(YAMLContent_create_Z1C3A29C9(tupledArg[0]), (_arg = tupledArg[1], _arg.tag === /* Object */
169
184
  3 ? !isEmpty(_arg.fields[0]) ? head(_arg.fields[0]).tag === /* Value */
170
185
  1 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : head(_arg.fields[0]).tag === /* Alias */
171
- 7 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : isEmpty(tail(_arg.fields[0])) ? (single = head(_arg.fields[0]), single) : _arg : YAMLElement_Value(YAMLContent_create_Z1C3A29C9("{}")) : _arg));
186
+ 7 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : isEmpty(tail(_arg.fields[0])) ? (single = head(_arg.fields[0]), single) : _arg : _arg : _arg));
172
187
  }, pairs));
173
188
  }
189
+ function encodeDynamicValue(value) {
190
+ if (equals(value, defaultOf())) {
191
+ return void 0;
192
+ } else if (typeof value === "string") {
193
+ const s = value;
194
+ return string(s);
195
+ } else if (typeof value === "boolean") {
196
+ const b = value;
197
+ return yBool(b);
198
+ } else if (typeof value === "number") {
199
+ const f = value;
200
+ return yFloat(f);
201
+ } else if (typeof value === "number") {
202
+ const i = value | 0;
203
+ return int(i);
204
+ } else if (typeof value === "bigint") {
205
+ const i_1 = value;
206
+ return string(int64ToString(i_1));
207
+ } else if (value instanceof YAMLElement) {
208
+ const y = value;
209
+ return y;
210
+ } else if (value instanceof DynamicObj) {
211
+ const dynObj = value;
212
+ return encodeDynamicObj(dynObj);
213
+ } else if (isIterable(value)) {
214
+ const values = value;
215
+ return YAMLElement_Sequence(toList(choose(encodeDynamicValue, values)));
216
+ } else {
217
+ return void 0;
218
+ }
219
+ }
220
+ function encodeDynamicObj(dynObj) {
221
+ return yMap(toList(choose((kvp) => map((encoded) => [kvp[0], encoded], encodeDynamicValue(kvp[1])), dynamicPropertiesExcept(empty({
222
+ Compare: comparePrimitives
223
+ }), dynObj))));
224
+ }
225
+ function appendDynamicPropertiesExcept(knownFieldNames, dynObj, acc) {
226
+ return fold((pairs, pair) => append(pairs, singleton(pair)), acc, choose((kvp) => map((encoded) => [kvp[0], encoded], encodeDynamicValue(kvp[1])), dynamicPropertiesExcept(knownFieldNames, dynObj)));
227
+ }
228
+ function appendDynamicProperties(dynObj, acc) {
229
+ return appendDynamicPropertiesExcept(empty({
230
+ Compare: comparePrimitives
231
+ }), dynObj, acc);
232
+ }
174
233
  function normalizeDocString(doc) {
175
234
  return trimEnd(trimEnd(replace(doc, "\r\n", "\n"), "\n"), "\r");
176
235
  }
@@ -203,8 +262,8 @@ function encodeEnvVarRequirementCompactMap(envs) {
203
262
  }
204
263
  function encodeSoftwareRequirementCompactMap(packages) {
205
264
  const packagesMap = yMap(toList(map$2((package$_1) => {
206
- let package$, matchValue_1, value_6, acc_3, value_3, acc_1;
207
- return [package$_1.Package, (package$ = package$_1, matchValue_1 = package$.Specs, package$.Version == null ? matchValue_1 != null ? YAMLElement_Sequence(toList(map$2(string, value(matchValue_1)))) : yMap(empty()) : yMap((value_6 = package$.Specs, acc_3 = (value_3 = package$.Version, acc_1 = empty(), value_3 == null ? acc_1 : append(acc_1, singleton(["version", YAMLElement_Sequence(toList(map$2(string, value(value_3))))]))), value_6 == null ? acc_3 : append(acc_3, singleton(["specs", YAMLElement_Sequence(toList(map$2(string, value(value_6))))])))))];
265
+ let package$, matchValue, matchValue_1, acc_2, value_3, acc_1, value_6, acc_3;
266
+ return [package$_1.Package, (package$ = package$_1, matchValue = package$.Version, matchValue_1 = package$.Specs, matchValue == null ? matchValue_1 != null ? YAMLElement_Sequence(toList(map$2(string, value(matchValue_1)))) : yMap(empty$1()) : yMap((acc_2 = (value_3 = package$.Version, acc_1 = empty$1(), value_3 == null ? acc_1 : append(acc_1, singleton(["version", YAMLElement_Sequence(toList(map$2(string, value(value_3))))]))), value_6 = package$.Specs, acc_3 = acc_2, value_6 == null ? acc_3 : append(acc_3, singleton(["specs", YAMLElement_Sequence(toList(map$2(string, value(value_6))))])))))];
208
267
  }, packages)));
209
268
  return yMap(ofArray([["class", string("SoftwareRequirement")], ["packages", packagesMap]]));
210
269
  }
@@ -217,16 +276,89 @@ function encodeDoc(doc) {
217
276
  function encodeIntent(intent) {
218
277
  return ["intent", YAMLElement_Sequence(ofSeq(map$2(string, intent)))];
219
278
  }
279
+ function encodeFilePairs(discriminatorKey, discriminatorValue, file) {
280
+ let acc_22;
281
+ let acc_20;
282
+ let acc_18;
283
+ let acc_16;
284
+ let acc_14;
285
+ let acc_12;
286
+ let acc_10;
287
+ let acc_8;
288
+ let acc_6;
289
+ let acc_4;
290
+ let acc_2;
291
+ const acc = singleton([discriminatorKey, string(discriminatorValue)]);
292
+ const value_2 = file.Location;
293
+ const acc_1 = acc;
294
+ acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["location", string(value(value_2))]));
295
+ const value_5 = file.Path;
296
+ const acc_3 = acc_2;
297
+ acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["path", string(value(value_5))]));
298
+ const value_8 = file.Basename;
299
+ const acc_5 = acc_4;
300
+ acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["basename", string(value(value_8))]));
301
+ const value_11 = file.Dirname;
302
+ const acc_7 = acc_6;
303
+ acc_8 = value_11 == null ? acc_7 : append(acc_7, singleton(["dirname", string(value(value_11))]));
304
+ const value_14 = file.Nameroot;
305
+ const acc_9 = acc_8;
306
+ acc_10 = value_14 == null ? acc_9 : append(acc_9, singleton(["nameroot", string(value(value_14))]));
307
+ const value_17 = file.Nameext;
308
+ const acc_11 = acc_10;
309
+ acc_12 = value_17 == null ? acc_11 : append(acc_11, singleton(["nameext", string(value(value_17))]));
310
+ const value_20 = file.Checksum;
311
+ const acc_13 = acc_12;
312
+ acc_14 = value_20 == null ? acc_13 : append(acc_13, singleton(["checksum", string(value(value_20))]));
313
+ const value_22 = file.Size;
314
+ const acc_15 = acc_14;
315
+ acc_16 = value_22 == null ? acc_15 : append(acc_15, singleton(["size", YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value(value_22))))]));
316
+ const value_24 = file.SecondaryFiles;
317
+ const acc_17 = acc_16;
318
+ acc_18 = value_24 == null ? acc_17 : append(acc_17, singleton(["secondaryFiles", value(value_24)]));
319
+ const value_27 = file.Format;
320
+ const acc_19 = acc_18;
321
+ acc_20 = value_27 == null ? acc_19 : append(acc_19, singleton(["format", string(value(value_27))]));
322
+ const value_30 = file.Contents;
323
+ const acc_21 = acc_20;
324
+ acc_22 = value_30 == null ? acc_21 : append(acc_21, singleton(["contents", string(value(value_30))]));
325
+ return appendDynamicPropertiesExcept(FileInstance.KnownFieldNames, file, acc_22);
326
+ }
327
+ function encodeDirectoryPairs(discriminatorKey, discriminatorValue, directory) {
328
+ let acc_8;
329
+ let acc_6;
330
+ let acc_4;
331
+ let acc_2;
332
+ const acc = singleton([discriminatorKey, string(discriminatorValue)]);
333
+ const value_2 = directory.Location;
334
+ const acc_1 = acc;
335
+ acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["location", string(value(value_2))]));
336
+ const value_5 = directory.Path;
337
+ const acc_3 = acc_2;
338
+ acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["path", string(value(value_5))]));
339
+ const value_8 = directory.Basename;
340
+ const acc_5 = acc_4;
341
+ acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["basename", string(value(value_8))]));
342
+ const value_10 = directory.Listing;
343
+ const acc_7 = acc_6;
344
+ acc_8 = value_10 == null ? acc_7 : append(acc_7, singleton(["listing", value(value_10)]));
345
+ return appendDynamicPropertiesExcept(DirectoryInstance.KnownFieldNames, directory, acc_8);
346
+ }
220
347
  function encodeCWLType(t) {
221
- let value_4, acc_3, value_2, acc_1;
348
+ let acc_4, acc_2, acc, value_2, acc_1, value_4, acc_3;
222
349
  switch (t.tag) {
223
350
  case /* Directory */
224
351
  1:
225
- return string("Directory");
352
+ if (length(encodeDirectoryPairs("type", "Directory", t.fields[0])) > 1) {
353
+ const directory_2 = t.fields[0];
354
+ return yMap(encodeDirectoryPairs("type", "Directory", directory_2));
355
+ } else {
356
+ return string("Directory");
357
+ }
226
358
  case /* Dirent */
227
359
  2: {
228
360
  const d = t.fields[0];
229
- return yMap((value_4 = d.Writable, acc_3 = (value_2 = d.Entryname, acc_1 = singleton(["entry", encodeSchemaSaladString(d.Entry)]), value_2 == null ? acc_1 : append(acc_1, singleton(["entryname", encodeSchemaSaladString(value(value_2))]))), value_4 == null ? acc_3 : append(acc_3, singleton(["writable", yBool(value(value_4))]))));
361
+ return yMap((acc_4 = (acc_2 = (acc = singleton(["entry", encodeSchemaSaladString(d.Entry)]), value_2 = d.Entryname, acc_1 = acc, value_2 == null ? acc_1 : append(acc_1, singleton(["entryname", encodeSchemaSaladString(value(value_2))]))), value_4 = d.Writable, acc_3 = acc_2, value_4 == null ? acc_3 : append(acc_3, singleton(["writable", yBool(value(value_4))]))), appendDynamicPropertiesExcept(DirentInstance.KnownFieldNames, d, acc_4)));
230
362
  }
231
363
  case /* String */
232
364
  3:
@@ -254,7 +386,8 @@ function encodeCWLType(t) {
254
386
  return string("null");
255
387
  case /* Union */
256
388
  14: {
257
- const typesList = toList(t.fields[0]);
389
+ const types = t.fields[0];
390
+ const typesList = toList(types);
258
391
  let matchResult, otherType;
259
392
  if (!isEmpty(typesList)) {
260
393
  if (head(typesList).tag === /* Null */
@@ -342,32 +475,57 @@ function encodeCWLType(t) {
342
475
  }
343
476
  }
344
477
  case /* Record */
345
- 12:
346
- return encodeInputRecordSchema(t.fields[0]);
478
+ 12: {
479
+ const recordSchema = t.fields[0];
480
+ return encodeInputRecordSchema(recordSchema);
481
+ }
347
482
  case /* Enum */
348
- 13:
349
- return encodeInputEnumSchema(t.fields[0]);
483
+ 13: {
484
+ const enumSchema = t.fields[0];
485
+ return encodeInputEnumSchema(enumSchema);
486
+ }
350
487
  default:
351
- return string("File");
488
+ if (length(encodeFilePairs("type", "File", t.fields[0])) > 1) {
489
+ const file_2 = t.fields[0];
490
+ return yMap(encodeFilePairs("type", "File", file_2));
491
+ } else {
492
+ return string("File");
493
+ }
352
494
  }
353
495
  }
354
496
  function encodeInputRecordField(field) {
355
- return [field.Name, yMap(singleton(["type", encodeCWLType(field.Type)]))];
497
+ let pairs;
498
+ let acc_4;
499
+ let acc_2;
500
+ const acc = singleton(["type", encodeCWLType(field.Type)]);
501
+ const value_2 = field.Doc;
502
+ const acc_1 = acc;
503
+ acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["doc", string(value(value_2))]));
504
+ const value_5 = field.Label;
505
+ const acc_3 = acc_2;
506
+ acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["label", string(value(value_5))]));
507
+ pairs = appendDynamicPropertiesExcept(InputRecordField.KnownFieldNames, field, acc_4);
508
+ return [field.Name, yMap(pairs)];
356
509
  }
357
510
  function encodeInputRecordSchema(schema) {
511
+ let acc_6, acc_4, acc_2, acc, value_2, acc_1, value_5, acc_3, value_8, acc_5;
358
512
  let fieldsElement;
359
513
  const matchValue = schema.Fields;
360
- fieldsElement = matchValue == null ? yMap(empty()) : yMap(toList(map$2(encodeInputRecordField, value(matchValue))));
361
- return yMap(ofArray([["type", string("record")], ["fields", fieldsElement]]));
514
+ fieldsElement = matchValue == null ? yMap(empty$1()) : yMap(toList(map$2(encodeInputRecordField, value(matchValue))));
515
+ return yMap((acc_6 = (acc_4 = (acc_2 = (acc = ofArray([["type", string("record")], ["fields", fieldsElement]]), value_2 = schema.Label, acc_1 = acc, value_2 == null ? acc_1 : append(acc_1, singleton(["label", string(value(value_2))]))), value_5 = schema.Doc, acc_3 = acc_2, value_5 == null ? acc_3 : append(acc_3, singleton(["doc", string(value(value_5))]))), value_8 = schema.Name, acc_5 = acc_4, value_8 == null ? acc_5 : append(acc_5, singleton(["name", string(value(value_8))]))), appendDynamicPropertiesExcept(InputRecordSchema.KnownFieldNames, schema, acc_6)));
362
516
  }
363
517
  function encodeInputEnumSchema(schema) {
364
- return yMap(append(singleton(["type", string("enum")]), singleton(["symbols", YAMLElement_Sequence(ofSeq(map$2(string, schema.Symbols)))])));
518
+ let acc_6, acc_4, acc_2, value_3, acc_1, value_6, acc_3, value_9, acc_5;
519
+ const pairs = append(singleton(["type", string("enum")]), singleton(["symbols", YAMLElement_Sequence(ofSeq(map$2(string, schema.Symbols)))]));
520
+ return yMap((acc_6 = (acc_4 = (acc_2 = (value_3 = schema.Label, acc_1 = pairs, value_3 == null ? acc_1 : append(acc_1, singleton(["label", string(value(value_3))]))), value_6 = schema.Doc, acc_3 = acc_2, value_6 == null ? acc_3 : append(acc_3, singleton(["doc", string(value(value_6))]))), value_9 = schema.Name, acc_5 = acc_4, value_9 == null ? acc_5 : append(acc_5, singleton(["name", string(value(value_9))]))), appendDynamicPropertiesExcept(InputEnumSchema.KnownFieldNames, schema, acc_6)));
365
521
  }
366
522
  function encodeInputArraySchema(schema) {
367
- return yMap(ofArray([["type", string("array")], ["items", encodeCWLType(schema.Items)]]));
523
+ let acc_6, acc_4, acc_2, acc, value_2, acc_1, value_5, acc_3, value_8, acc_5;
524
+ return yMap((acc_6 = (acc_4 = (acc_2 = (acc = ofArray([["type", string("array")], ["items", encodeCWLType(schema.Items)]]), value_2 = schema.Label, acc_1 = acc, value_2 == null ? acc_1 : append(acc_1, singleton(["label", string(value(value_2))]))), value_5 = schema.Doc, acc_3 = acc_2, value_5 == null ? acc_3 : append(acc_3, singleton(["doc", string(value(value_5))]))), value_8 = schema.Name, acc_5 = acc_4, value_8 == null ? acc_5 : append(acc_5, singleton(["name", string(value(value_8))]))), appendDynamicPropertiesExcept(InputArraySchema.KnownFieldNames, schema, acc_6)));
368
525
  }
369
526
  function encodeOutputBinding(ob) {
370
- return yMap(choose((x) => x, singleton(map((g) => ["glob", string(g)], ob.Glob))));
527
+ let acc_6, acc_4, acc_2, acc, value_1, acc_1, encoder_1, f1, value_4, acc_3, value_7, acc_5;
528
+ return yMap((acc_6 = (acc_4 = (acc_2 = (acc = choose$1((x) => x, singleton(map((g) => ["glob", string(g)], ob.Glob))), value_1 = ob.LoadContents, acc_1 = acc, value_1 == null ? acc_1 : append(acc_1, singleton(["loadContents", yBool(value(value_1))]))), encoder_1 = (f1 = LoadListingEnum_get_toCwlString(), (arg) => string(f1(arg))), value_4 = ob.LoadListing, acc_3 = acc_2, value_4 == null ? acc_3 : append(acc_3, singleton(["loadListing", encoder_1(value(value_4))]))), value_7 = ob.OutputEval, acc_5 = acc_4, value_7 == null ? acc_5 : append(acc_5, singleton(["outputEval", string(value(value_7))]))), appendDynamicPropertiesExcept(OutputBinding.KnownFieldNames, ob, acc_6)));
371
529
  }
372
530
  function encodeStringArrayOrScalar(values) {
373
531
  if (values.length === 1) {
@@ -437,7 +595,8 @@ function encodeCWLOutput(o) {
437
595
  return encodeCWLType(t);
438
596
  case /* Array */
439
597
  11: {
440
- const matchValue = otherType.fields[0].Items;
598
+ const arraySchema = otherType.fields[0];
599
+ const matchValue = arraySchema.Items;
441
600
  switch (matchValue.tag) {
442
601
  case /* File */
443
602
  0:
@@ -506,7 +665,8 @@ function encodeCWLOutput(o) {
506
665
  }
507
666
  }, o.Type_);
508
667
  let pairs;
509
- let value_4;
668
+ let acc_16;
669
+ let value_17;
510
670
  const matchValue_2 = o.OutputSource;
511
671
  let matchResult_1, value$1, values_1;
512
672
  if (matchValue_2 != null) {
@@ -527,25 +687,46 @@ function encodeCWLOutput(o) {
527
687
  }
528
688
  switch (matchResult_1) {
529
689
  case 0: {
530
- value_4 = string(value$1);
690
+ value_17 = string(value$1);
531
691
  break;
532
692
  }
533
693
  case 1: {
534
- value_4 = encodeStringArrayOrScalar(values_1);
694
+ value_17 = encodeStringArrayOrScalar(values_1);
535
695
  break;
536
696
  }
537
697
  default:
538
- value_4 = void 0;
698
+ value_17 = void 0;
539
699
  }
540
- let acc_5;
700
+ let acc_15;
701
+ let acc_12;
702
+ let acc_10;
703
+ let acc_8;
704
+ let acc_6;
705
+ let acc_4;
541
706
  let acc_2;
542
707
  const value_1 = typeElement;
543
- const acc_1 = empty();
708
+ const acc_1 = empty$1();
544
709
  acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["type", value(value_1)]));
545
- const value_3 = o.OutputBinding;
710
+ const value_4 = o.Label;
546
711
  const acc_3 = acc_2;
547
- acc_5 = value_3 == null ? acc_3 : append(acc_3, singleton(["outputBinding", encodeOutputBinding(value(value_3))]));
548
- pairs = value_4 == null ? acc_5 : append(acc_5, singleton(["outputSource", value(value_4)]));
712
+ acc_4 = value_4 == null ? acc_3 : append(acc_3, singleton(["label", string(value(value_4))]));
713
+ const value_6 = o.SecondaryFiles;
714
+ const acc_5 = acc_4;
715
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["secondaryFiles", value(value_6)]));
716
+ const value_8 = o.Streamable;
717
+ const acc_7 = acc_6;
718
+ acc_8 = value_8 == null ? acc_7 : append(acc_7, singleton(["streamable", yBool(value(value_8))]));
719
+ const value_11 = o.Doc;
720
+ const acc_9 = acc_8;
721
+ acc_10 = value_11 == null ? acc_9 : append(acc_9, singleton(["doc", string(value(value_11))]));
722
+ const value_14 = o.Format;
723
+ const acc_11 = acc_10;
724
+ acc_12 = value_14 == null ? acc_11 : append(acc_11, singleton(["format", string(value(value_14))]));
725
+ const value_16 = o.OutputBinding;
726
+ const acc_13 = acc_12;
727
+ acc_15 = value_16 == null ? acc_13 : append(acc_13, singleton(["outputBinding", encodeOutputBinding(value(value_16))]));
728
+ acc_16 = value_17 == null ? acc_15 : append(acc_15, singleton(["outputSource", value(value_17)]));
729
+ pairs = appendDynamicPropertiesExcept(CWLOutput.KnownFieldNames, o, acc_16);
549
730
  let matchResult_2, t_1;
550
731
  if (!isEmpty(pairs)) {
551
732
  if (head(pairs)[0] === "type") {
@@ -569,11 +750,19 @@ function encodeCWLOutput(o) {
569
750
  }
570
751
  }
571
752
  function encodeInputBinding(ib) {
572
- let value_9, acc_7, value_7, acc_5, value_4, acc_3, value_2, acc_1;
573
- return yMap((value_9 = ib.Separate, acc_7 = (value_7 = ib.ItemSeparator, acc_5 = (value_4 = ib.Position, acc_3 = (value_2 = ib.Prefix, acc_1 = empty(), value_2 == null ? acc_1 : append(acc_1, singleton(["prefix", string(value(value_2))]))), value_4 == null ? acc_3 : append(acc_3, singleton(["position", int(value(value_4))]))), value_7 == null ? acc_5 : append(acc_5, singleton(["itemSeparator", string(value(value_7))]))), value_9 == null ? acc_7 : append(acc_7, singleton(["separate", yBool(value(value_9))]))));
753
+ let acc_14, acc_12, acc_10, acc_8, acc_6, acc_4, acc_2, value_1, acc_1, value_4, acc_3, value_6, acc_5, value_9, acc_7, value_11, acc_9, value_14, acc_11, value_16, acc_13;
754
+ return yMap((acc_14 = (acc_12 = (acc_10 = (acc_8 = (acc_6 = (acc_4 = (acc_2 = (value_1 = ib.LoadContents, acc_1 = empty$1(), value_1 == null ? acc_1 : append(acc_1, singleton(["loadContents", yBool(value(value_1))]))), value_4 = ib.Prefix, acc_3 = acc_2, value_4 == null ? acc_3 : append(acc_3, singleton(["prefix", string(value(value_4))]))), value_6 = ib._position, acc_5 = acc_4, value_6 == null ? acc_5 : append(acc_5, singleton(["position", int(value(value_6))]))), value_9 = ib.ItemSeparator, acc_7 = acc_6, value_9 == null ? acc_7 : append(acc_7, singleton(["itemSeparator", string(value(value_9))]))), value_11 = ib.Separate, acc_9 = acc_8, value_11 == null ? acc_9 : append(acc_9, singleton(["separate", yBool(value(value_11))]))), value_14 = ib.ValueFrom, acc_11 = acc_10, value_14 == null ? acc_11 : append(acc_11, singleton(["valueFrom", string(value(value_14))]))), value_16 = ib.ShellQuote, acc_13 = acc_12, value_16 == null ? acc_13 : append(acc_13, singleton(["shellQuote", yBool(value(value_16))]))), appendDynamicPropertiesExcept(InputBinding.KnownFieldNames, ib, acc_14)));
574
755
  }
575
756
  function encodeCWLInput(i) {
576
757
  let pairs;
758
+ let acc_20;
759
+ let acc_18;
760
+ let acc_16;
761
+ let acc_14;
762
+ let acc_12;
763
+ let acc_10;
764
+ let acc_8;
765
+ let acc_6;
577
766
  let acc_4;
578
767
  let acc_2;
579
768
  const value$1 = map((t) => {
@@ -635,7 +824,8 @@ function encodeCWLInput(i) {
635
824
  return encodeCWLType(t);
636
825
  case /* Array */
637
826
  11: {
638
- const matchValue = otherType.fields[0].Items;
827
+ const arraySchema = otherType.fields[0];
828
+ const matchValue = arraySchema.Items;
639
829
  switch (matchValue.tag) {
640
830
  case /* File */
641
831
  0:
@@ -703,14 +893,39 @@ function encodeCWLInput(i) {
703
893
  return encodeCWLType(t);
704
894
  }
705
895
  }, i.Type_);
706
- const acc_1 = empty();
896
+ const acc_1 = empty$1();
707
897
  acc_2 = value$1 == null ? acc_1 : append(acc_1, singleton(["type", value(value$1)]));
708
- const value_2 = i.InputBinding;
898
+ const value_3 = i.Label;
709
899
  const acc_3 = acc_2;
710
- acc_4 = value_2 == null ? acc_3 : append(acc_3, singleton(["inputBinding", encodeInputBinding(value(value_2))]));
711
- const value_4 = i.Optional;
900
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["label", string(value(value_3))]));
901
+ const value_5 = i.SecondaryFiles;
712
902
  const acc_5 = acc_4;
713
- pairs = value_4 == null ? acc_5 : append(acc_5, singleton(["optional", yBool(value(value_4))]));
903
+ acc_6 = value_5 == null ? acc_5 : append(acc_5, singleton(["secondaryFiles", value(value_5)]));
904
+ const value_7 = i.Streamable;
905
+ const acc_7 = acc_6;
906
+ acc_8 = value_7 == null ? acc_7 : append(acc_7, singleton(["streamable", yBool(value(value_7))]));
907
+ const value_10 = i.Doc;
908
+ const acc_9 = acc_8;
909
+ acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["doc", string(value(value_10))]));
910
+ const value_13 = i.Format;
911
+ const acc_11 = acc_10;
912
+ acc_12 = value_13 == null ? acc_11 : append(acc_11, singleton(["format", string(value(value_13))]));
913
+ const value_15 = i.LoadContents;
914
+ const acc_13 = acc_12;
915
+ acc_14 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", yBool(value(value_15))]));
916
+ let encoder_9;
917
+ const f1 = LoadListingEnum_get_toCwlString();
918
+ encoder_9 = (arg) => string(f1(arg));
919
+ const value_18 = i.LoadListing;
920
+ const acc_15 = acc_14;
921
+ acc_16 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", encoder_9(value(value_18))]));
922
+ const value_20 = i.DefaultValue;
923
+ const acc_17 = acc_16;
924
+ acc_18 = value_20 == null ? acc_17 : append(acc_17, singleton(["default", value(value_20)]));
925
+ const value_22 = i.InputBinding;
926
+ const acc_19 = acc_18;
927
+ acc_20 = value_22 == null ? acc_19 : append(acc_19, singleton(["inputBinding", encodeInputBinding(value(value_22))]));
928
+ pairs = appendDynamicPropertiesExcept(CWLInput.KnownFieldNames, i, acc_20);
714
929
  let matchResult_1, t_1;
715
930
  if (!isEmpty(pairs)) {
716
931
  if (head(pairs)[0] === "type") {
@@ -734,10 +949,11 @@ function encodeCWLInput(i) {
734
949
  }
735
950
  }
736
951
  function encodeSchemaDefRequirementType(s) {
737
- return yMap(ofArray([["name", string(s.Name)], ["type", encodeCWLType(s.Type_)]]));
952
+ let acc;
953
+ return yMap((acc = ofArray([["name", string(s.Name)], ["type", encodeCWLType(s.Type_)]]), appendDynamicPropertiesExcept(SchemaDefRequirementType.KnownFieldNames, s, acc)));
738
954
  }
739
955
  function encodeRequirement(r) {
740
- let value_23, acc_15, value_20, acc_13, value_17, acc_11, value_14, acc_9, value_11, acc_7, value_8, acc_5, value_5, acc_3, value_2, acc_1;
956
+ let acc_17, acc_15, acc_13, acc_11, acc_9, acc_7, acc_5, acc_3, value_5, acc_4, value_8, acc_6, value_11, acc_8, value_14, acc_10, value_17, acc_12, value_20, acc_14, value_23, acc_16, acc_24, acc_32, acc_33, acc_34, acc_2, value_2, acc_1;
741
957
  switch (r.tag) {
742
958
  case /* SchemaDefRequirement */
743
959
  1: {
@@ -747,68 +963,39 @@ function encodeRequirement(r) {
747
963
  case /* DockerRequirement */
748
964
  2: {
749
965
  const dr = r.fields[0];
750
- return yMap((value_23 = dr.DockerRunOptions, acc_15 = (value_20 = dr.DockerOutputDirectory, acc_13 = (value_17 = dr.DockerImport, acc_11 = (value_14 = dr.DockerLoad, acc_9 = (value_11 = dr.DockerImageId, acc_7 = (value_8 = dr.DockerFile, acc_5 = (value_5 = dr.DockerPull, acc_3 = singleton(["class", string("DockerRequirement")]), value_5 == null ? acc_3 : append(acc_3, singleton(["dockerPull", string(value(value_5))]))), value_8 == null ? acc_5 : append(acc_5, singleton(["dockerFile", encodeSchemaSaladString(value(value_8))]))), value_11 == null ? acc_7 : append(acc_7, singleton(["dockerImageId", string(value(value_11))]))), value_14 == null ? acc_9 : append(acc_9, singleton(["dockerLoad", string(value(value_14))]))), value_17 == null ? acc_11 : append(acc_11, singleton(["dockerImport", string(value(value_17))]))), value_20 == null ? acc_13 : append(acc_13, singleton(["dockerOutputDirectory", string(value(value_20))]))), value_23 == null ? acc_15 : append(acc_15, singleton(["cwltool:dockerRunOptions", YAMLElement_Sequence(ofSeq(map$2(string, value(value_23))))]))));
966
+ return yMap((acc_17 = (acc_15 = (acc_13 = (acc_11 = (acc_9 = (acc_7 = (acc_5 = (acc_3 = singleton(["class", string("DockerRequirement")]), value_5 = dr.DockerPull, acc_4 = acc_3, value_5 == null ? acc_4 : append(acc_4, singleton(["dockerPull", string(value(value_5))]))), value_8 = dr.DockerFile, acc_6 = acc_5, value_8 == null ? acc_6 : append(acc_6, singleton(["dockerFile", encodeSchemaSaladString(value(value_8))]))), value_11 = dr.DockerImageId, acc_8 = acc_7, value_11 == null ? acc_8 : append(acc_8, singleton(["dockerImageId", string(value(value_11))]))), value_14 = dr.DockerLoad, acc_10 = acc_9, value_14 == null ? acc_10 : append(acc_10, singleton(["dockerLoad", string(value(value_14))]))), value_17 = dr.DockerImport, acc_12 = acc_11, value_17 == null ? acc_12 : append(acc_12, singleton(["dockerImport", string(value(value_17))]))), value_20 = dr.DockerOutputDirectory, acc_14 = acc_13, value_20 == null ? acc_14 : append(acc_14, singleton(["dockerOutputDirectory", string(value(value_20))]))), value_23 = dr.DockerRunOptions, acc_16 = acc_15, value_23 == null ? acc_16 : append(acc_16, singleton(["cwltool:dockerRunOptions", YAMLElement_Sequence(ofSeq(map$2(string, value(value_23))))]))), appendDynamicPropertiesExcept(DockerRequirement.KnownFieldNames, dr, acc_17)));
751
967
  }
752
968
  case /* SoftwareRequirement */
753
969
  3: {
754
970
  const pkgs = r.fields[0];
755
971
  return yMap(ofArray([["class", string("SoftwareRequirement")], ["packages", YAMLElement_Sequence(ofSeq(map$2((p) => {
756
- let value_29, acc_20, value_26, acc_18;
757
- return yMap((value_29 = p.Specs, acc_20 = (value_26 = p.Version, acc_18 = append(empty(), singleton(["package", string(p.Package)])), value_26 == null ? acc_18 : append(acc_18, singleton(["version", YAMLElement_Sequence(ofSeq(map$2(string, value(value_26))))]))), value_29 == null ? acc_20 : append(acc_20, singleton(["specs", YAMLElement_Sequence(ofSeq(map$2(string, value(value_29))))]))));
972
+ let acc_23, acc_21, acc_19, value_26, acc_20, value_29, acc_22;
973
+ return yMap((acc_23 = (acc_21 = (acc_19 = append(empty$1(), singleton(["package", string(p.Package)])), value_26 = p.Version, acc_20 = acc_19, value_26 == null ? acc_20 : append(acc_20, singleton(["version", YAMLElement_Sequence(ofSeq(map$2(string, value(value_26))))]))), value_29 = p.Specs, acc_22 = acc_21, value_29 == null ? acc_22 : append(acc_22, singleton(["specs", YAMLElement_Sequence(ofSeq(map$2(string, value(value_29))))]))), appendDynamicPropertiesExcept(SoftwarePackage.KnownFieldNames, p, acc_23)));
758
974
  }, pkgs)))]]));
759
975
  }
760
976
  case /* LoadListingRequirement */
761
977
  4: {
762
978
  const loadListing = r.fields[0];
763
- return yMap(ofArray([["class", string("LoadListingRequirement")], ["loadListing", string(LoadListingEnum_get_toCwlString()(loadListing.LoadListing))]]));
979
+ return yMap((acc_24 = ofArray([["class", string("LoadListingRequirement")], ["loadListing", string(LoadListingEnum_get_toCwlString()(loadListing.LoadListing))]]), appendDynamicPropertiesExcept(LoadListingRequirementValue.KnownFieldNames, loadListing, acc_24)));
764
980
  }
765
981
  case /* InitialWorkDirRequirement */
766
982
  5: {
767
983
  const listing = r.fields[0];
768
- const encodeDynamicObjWithClass = (className, dynObj) => {
769
- const dynamicPairs = toList(choose$1((kvp) => {
770
- const matchValue = kvp[1];
771
- if (typeof matchValue === "string") {
772
- return [kvp[0], string(matchValue)];
773
- } else if (typeof matchValue === "boolean") {
774
- return [kvp[0], yBool(matchValue)];
775
- } else if (typeof matchValue === "number") {
776
- return [kvp[0], int(matchValue)];
777
- } else if (typeof matchValue === "bigint") {
778
- return [kvp[0], string(int64ToString(matchValue))];
779
- } else if (typeof matchValue === "number") {
780
- return [kvp[0], float(matchValue)];
781
- } else if (matchValue instanceof YAMLElement) {
782
- return [kvp[0], matchValue];
783
- } else {
784
- return void 0;
785
- }
786
- }, dynObj.GetProperties(false)));
787
- if (exists((tupledArg) => tupledArg[0] === "class", dynamicPairs)) {
788
- return yMap(dynamicPairs);
789
- } else {
790
- return yMap(cons(["class", string(className)], dynamicPairs));
791
- }
792
- };
793
- return yMap(ofArray([["class", string("InitialWorkDirRequirement")], ["listing", YAMLElement_Sequence(ofSeq(map$2((_arg_1) => {
794
- let value_34, acc_25, value_32, acc_22;
795
- switch (_arg_1.tag) {
984
+ return yMap(ofArray([["class", string("InitialWorkDirRequirement")], ["listing", YAMLElement_Sequence(ofSeq(map$2((_arg) => {
985
+ let acc_30, acc_28, value_32, acc_26, value_34, acc_29;
986
+ switch (_arg.tag) {
796
987
  case /* StringEntry */
797
988
  1:
798
- return encodeSchemaSaladString(_arg_1.fields[0]);
989
+ return encodeSchemaSaladString(_arg.fields[0]);
799
990
  case /* FileEntry */
800
- 2: {
801
- const arg_1 = _arg_1.fields[0];
802
- return encodeDynamicObjWithClass("File", arg_1);
803
- }
991
+ 2:
992
+ return yMap(encodeFilePairs("class", "File", _arg.fields[0]));
804
993
  case /* DirectoryEntry */
805
- 3: {
806
- const arg_3 = _arg_1.fields[0];
807
- return encodeDynamicObjWithClass("Directory", arg_3);
808
- }
994
+ 3:
995
+ return yMap(encodeDirectoryPairs("class", "Directory", _arg.fields[0]));
809
996
  default: {
810
- const d = _arg_1.fields[0];
811
- return yMap((value_34 = d.Writable, acc_25 = append((value_32 = d.Entryname, acc_22 = empty(), value_32 == null ? acc_22 : append(acc_22, singleton(["entryname", encodeSchemaSaladString(value(value_32))]))), singleton(["entry", encodeSchemaSaladString(d.Entry)])), value_34 == null ? acc_25 : append(acc_25, singleton(["writable", yBool(value(value_34))]))));
997
+ const d = _arg.fields[0];
998
+ return yMap((acc_30 = (acc_28 = append((value_32 = d.Entryname, acc_26 = empty$1(), value_32 == null ? acc_26 : append(acc_26, singleton(["entryname", encodeSchemaSaladString(value(value_32))]))), singleton(["entry", encodeSchemaSaladString(d.Entry)])), value_34 = d.Writable, acc_29 = acc_28, value_34 == null ? acc_29 : append(acc_29, singleton(["writable", yBool(value(value_34))]))), appendDynamicPropertiesExcept(DirentInstance.KnownFieldNames, d, acc_30)));
812
999
  }
813
1000
  }
814
1001
  }, listing)))]]));
@@ -817,8 +1004,9 @@ function encodeRequirement(r) {
817
1004
  6: {
818
1005
  const envs = r.fields[0];
819
1006
  return yMap(ofArray([["class", string("EnvVarRequirement")], ["envDef", YAMLElement_Sequence(ofSeq(map$2((e) => {
1007
+ let acc_31;
820
1008
  const v_12 = normalizeEnvValueForEncode(e.EnvValue);
821
- return yMap(ofArray([["envName", string(e.EnvName)], ["envValue", string(v_12)]]));
1009
+ return yMap((acc_31 = ofArray([["envName", string(e.EnvName)], ["envValue", string(v_12)]]), appendDynamicPropertiesExcept(EnvironmentDef.KnownFieldNames, e, acc_31)));
822
1010
  }, envs)))]]));
823
1011
  }
824
1012
  case /* ShellCommandRequirement */
@@ -829,11 +1017,11 @@ function encodeRequirement(r) {
829
1017
  const rr = r.fields[0];
830
1018
  const tryEncodeScalar = (key, value_35) => {
831
1019
  if (typeof value_35 === "number") {
1020
+ return [key, yFloat(value_35)];
1021
+ } else if (typeof value_35 === "number") {
832
1022
  return [key, int(value_35)];
833
1023
  } else if (typeof value_35 === "bigint") {
834
1024
  return [key, YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value_35)))];
835
- } else if (typeof value_35 === "number") {
836
- return [key, float(value_35)];
837
1025
  } else if (typeof value_35 === "string") {
838
1026
  return [key, string(value_35)];
839
1027
  } else if (typeof value_35 === "boolean") {
@@ -842,16 +1030,19 @@ function encodeRequirement(r) {
842
1030
  return void 0;
843
1031
  }
844
1032
  };
845
- const dynamicPairs_1 = toList(choose$1((kvp_1) => {
846
- const matchValue_1 = kvp_1[1];
847
- return tryEncodeScalar(kvp_1[0], matchValue_1);
848
- }, rr.GetProperties(false)));
849
- return yMap(append(singleton(["class", string("ResourceRequirement")]), dynamicPairs_1));
1033
+ const knownPairs = choose$1((tupledArg) => bind(curry2(tryEncodeScalar)(tupledArg[0]), tupledArg[1]), rr.KnownFieldValues);
1034
+ const dynamicPairs = toList(choose((kvp) => {
1035
+ const matchValue = kvp[1];
1036
+ return tryEncodeScalar(kvp[0], matchValue);
1037
+ }, dynamicPropertiesExcept(ofSeq$1(map$2((x) => x, ResourceRequirementInstance.KnownFieldNames), {
1038
+ Compare: comparePrimitives
1039
+ }), rr)));
1040
+ return yMap(append(singleton(["class", string("ResourceRequirement")]), append(knownPairs, dynamicPairs)));
850
1041
  }
851
1042
  case /* WorkReuseRequirement */
852
1043
  9: {
853
1044
  const workReuse = r.fields[0];
854
- return yMap(ofArray([["class", string("WorkReuse")], ["enableReuse", yBool(workReuse.EnableReuse)]]));
1045
+ return yMap((acc_32 = ofArray([["class", string("WorkReuse")], ["enableReuse", yBool(workReuse.EnableReuse)]]), appendDynamicPropertiesExcept(WorkReuseRequirementValue.KnownFieldNames, workReuse, acc_32)));
855
1046
  }
856
1047
  case /* WorkReuseExpressionRequirement */
857
1048
  10: {
@@ -861,7 +1052,7 @@ function encodeRequirement(r) {
861
1052
  case /* NetworkAccessRequirement */
862
1053
  11: {
863
1054
  const networkAccess = r.fields[0];
864
- return yMap(ofArray([["class", string("NetworkAccess")], ["networkAccess", yBool(networkAccess.NetworkAccess)]]));
1055
+ return yMap((acc_33 = ofArray([["class", string("NetworkAccess")], ["networkAccess", yBool(networkAccess.NetworkAccess)]]), appendDynamicPropertiesExcept(NetworkAccessRequirementValue.KnownFieldNames, networkAccess, acc_33)));
865
1056
  }
866
1057
  case /* NetworkAccessExpressionRequirement */
867
1058
  12: {
@@ -871,7 +1062,7 @@ function encodeRequirement(r) {
871
1062
  case /* InplaceUpdateRequirement */
872
1063
  13: {
873
1064
  const inplaceUpdate = r.fields[0];
874
- return yMap(ofArray([["class", string("InplaceUpdateRequirement")], ["inplaceUpdate", yBool(inplaceUpdate.InplaceUpdate)]]));
1065
+ return yMap((acc_34 = ofArray([["class", string("InplaceUpdateRequirement")], ["inplaceUpdate", yBool(inplaceUpdate.InplaceUpdate)]]), appendDynamicPropertiesExcept(InplaceUpdateRequirementValue.KnownFieldNames, inplaceUpdate, acc_34)));
875
1066
  }
876
1067
  case /* ToolTimeLimitRequirement */
877
1068
  14: {
@@ -892,20 +1083,23 @@ function encodeRequirement(r) {
892
1083
  case /* StepInputExpressionRequirement */
893
1084
  18:
894
1085
  return yMap(singleton(["class", string("StepInputExpressionRequirement")]));
895
- default:
896
- return yMap((value_2 = bind((entries) => {
1086
+ default: {
1087
+ const value$1 = r.fields[0];
1088
+ return yMap((acc_2 = (value_2 = bind((entries) => {
897
1089
  if (entries.length > 0) {
898
1090
  return entries;
899
1091
  } else {
900
1092
  return void 0;
901
1093
  }
902
- }, r.fields[0].ExpressionLib), acc_1 = singleton(["class", string("InlineJavascriptRequirement")]), value_2 == null ? acc_1 : append(acc_1, singleton(["expressionLib", YAMLElement_Sequence(ofSeq(map$2(string, value(value_2))))]))));
1094
+ }, value$1.ExpressionLib), acc_1 = singleton(["class", string("InlineJavascriptRequirement")]), value_2 == null ? acc_1 : append(acc_1, singleton(["expressionLib", YAMLElement_Sequence(ofSeq(map$2(string, value(value_2))))]))), appendDynamicPropertiesExcept(InlineJavascriptRequirementValue.KnownFieldNames, value$1, acc_2)));
1095
+ }
903
1096
  }
904
1097
  }
905
1098
  function encodeHintEntry(hint) {
906
1099
  if (hint.tag === /* UnknownHint */
907
1100
  1) {
908
- return hint.fields[0].Raw;
1101
+ const unknownHint = hint.fields[0];
1102
+ return unknownHint.Raw;
909
1103
  } else {
910
1104
  return encodeRequirement(hint.fields[0]);
911
1105
  }
@@ -928,33 +1122,43 @@ function encodeScatterMethod(scatterMethod) {
928
1122
  }
929
1123
  function encodeStepInput(si) {
930
1124
  let pairs;
931
- const value_21 = si.Label;
932
- let acc_17;
933
- const value_18 = si.LoadListing;
934
- let acc_15;
935
- const value_15 = si.LoadContents;
936
- let acc_13;
937
- const value_13 = si.Doc;
938
- let acc_11;
939
- const value_10 = si.PickValue;
940
- let acc_9;
941
- const value_8 = si.LinkMerge;
942
- let acc_7;
943
- const value_6 = si.ValueFrom;
944
- let acc_5;
945
- const value_3 = si.DefaultValue;
946
- let acc_3;
1125
+ let acc_18;
1126
+ let acc_16;
1127
+ let acc_14;
1128
+ let acc_12;
1129
+ let acc_10;
1130
+ let acc_8;
1131
+ let acc_6;
1132
+ let acc_4;
1133
+ let acc_2;
947
1134
  const value_1 = si.Source;
948
- const acc_1 = empty();
949
- acc_3 = value_1 == null ? acc_1 : append(acc_1, singleton(["source", encodeSourceArray(value(value_1))]));
950
- acc_5 = value_3 == null ? acc_3 : append(acc_3, singleton(["default", value(value_3)]));
951
- acc_7 = value_6 == null ? acc_5 : append(acc_5, singleton(["valueFrom", string(value(value_6))]));
952
- acc_9 = value_8 == null ? acc_7 : append(acc_7, singleton(["linkMerge", encodeLinkMergeMethod(value(value_8))]));
953
- acc_11 = value_10 == null ? acc_9 : append(acc_9, singleton(["pickValue", encodePickValueMethod(value(value_10))]));
954
- acc_13 = value_13 == null ? acc_11 : append(acc_11, singleton(["doc", string(value(value_13))]));
955
- acc_15 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", yBool(value(value_15))]));
956
- acc_17 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", string(value(value_18))]));
957
- pairs = value_21 == null ? acc_17 : append(acc_17, singleton(["label", string(value(value_21))]));
1135
+ const acc_1 = empty$1();
1136
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["source", encodeSourceArray(value(value_1))]));
1137
+ const value_3 = si.DefaultValue;
1138
+ const acc_3 = acc_2;
1139
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["default", value(value_3)]));
1140
+ const value_6 = si.ValueFrom;
1141
+ const acc_5 = acc_4;
1142
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["valueFrom", string(value(value_6))]));
1143
+ const value_8 = si.LinkMerge;
1144
+ const acc_7 = acc_6;
1145
+ acc_8 = value_8 == null ? acc_7 : append(acc_7, singleton(["linkMerge", encodeLinkMergeMethod(value(value_8))]));
1146
+ const value_10 = si.PickValue;
1147
+ const acc_9 = acc_8;
1148
+ acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["pickValue", encodePickValueMethod(value(value_10))]));
1149
+ const value_13 = si.Doc;
1150
+ const acc_11 = acc_10;
1151
+ acc_12 = value_13 == null ? acc_11 : append(acc_11, singleton(["doc", string(value(value_13))]));
1152
+ const value_15 = si.LoadContents;
1153
+ const acc_13 = acc_12;
1154
+ acc_14 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", yBool(value(value_15))]));
1155
+ const value_18 = si.LoadListing;
1156
+ const acc_15 = acc_14;
1157
+ acc_16 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", string(value(value_18))]));
1158
+ const value_21 = si.Label;
1159
+ const acc_17 = acc_16;
1160
+ acc_18 = value_21 == null ? acc_17 : append(acc_17, singleton(["label", string(value(value_21))]));
1161
+ pairs = appendDynamicPropertiesExcept(StepInput.KnownFieldNames, si, acc_18);
958
1162
  let matchResult, s_1;
959
1163
  if (!isEmpty(pairs)) {
960
1164
  if (head(pairs)[0] === "source") {
@@ -985,7 +1189,8 @@ function encodeStepInputs(inputs) {
985
1189
  return yMap(toList(map$2(encodeStepInput, inputs)));
986
1190
  }
987
1191
  function encodeStepOutputParameter(so) {
988
- return yMap(singleton(["id", string(so.Id)]));
1192
+ let acc;
1193
+ return yMap((acc = singleton(["id", string(so.Id)]), appendDynamicPropertiesExcept(StepOutputParameter.KnownFieldNames, so, acc)));
989
1194
  }
990
1195
  function encodeStepOutputs(outputs) {
991
1196
  return YAMLElement_Sequence(ofSeq(map$2((output) => {
@@ -1051,7 +1256,7 @@ function encodeWorkflowStepRun(run) {
1051
1256
  }
1052
1257
  }
1053
1258
  function encodeToolDescriptionElement(td) {
1054
- let h, r, bc, matchValue_3, i, i_1, matchValue_4, md;
1259
+ let h, r, bc, matchValue_3, i, i_1;
1055
1260
  let basePairs;
1056
1261
  let acc_6;
1057
1262
  let acc_4;
@@ -1132,14 +1337,42 @@ function encodeToolDescriptionElement(td) {
1132
1337
  default:
1133
1338
  withBaseCommand = withRequirements;
1134
1339
  }
1135
- const withOutputs = append((matchValue_3 = td.Inputs, matchValue_3 != null ? (i = value(matchValue_3), i.length > 0) ? (i_1 = value(matchValue_3), append(withBaseCommand, singleton(["inputs", yMap(toList(map$2(encodeCWLInput, i_1)))]))) : withBaseCommand : withBaseCommand), singleton(["outputs", yMap(toList(map$2(encodeCWLOutput, td.Outputs)))]));
1136
- return yMap((matchValue_4 = td.Metadata, matchValue_4 == null ? withOutputs : (md = value(matchValue_4), fold((acc_8, kvp) => {
1137
- let matchValue_5;
1138
- return append(acc_8, singleton([kvp[0], (matchValue_5 = kvp[1], typeof matchValue_5 === "string" ? string(matchValue_5) : typeof matchValue_5 === "boolean" ? yBool(matchValue_5) : typeof matchValue_5 === "number" ? int(matchValue_5) : typeof matchValue_5 === "number" ? float(matchValue_5) : matchValue_5 instanceof YAMLElement ? matchValue_5 : string(toString(kvp[1])))]));
1139
- }, withOutputs, md.GetProperties(false)))));
1340
+ let withCommandFields;
1341
+ let acc_20;
1342
+ let acc_18;
1343
+ let acc_16;
1344
+ let acc_14;
1345
+ let acc_12;
1346
+ let acc_10;
1347
+ const value_2 = td.Arguments;
1348
+ const acc_9 = withBaseCommand;
1349
+ acc_10 = value_2 == null ? acc_9 : append(acc_9, singleton(["arguments", value(value_2)]));
1350
+ const value_5 = td.Stdin;
1351
+ const acc_11 = acc_10;
1352
+ acc_12 = value_5 == null ? acc_11 : append(acc_11, singleton(["stdin", string(value(value_5))]));
1353
+ const value_8 = td.Stderr;
1354
+ const acc_13 = acc_12;
1355
+ acc_14 = value_8 == null ? acc_13 : append(acc_13, singleton(["stderr", string(value(value_8))]));
1356
+ const value_11 = td.Stdout;
1357
+ const acc_15 = acc_14;
1358
+ acc_16 = value_11 == null ? acc_15 : append(acc_15, singleton(["stdout", string(value(value_11))]));
1359
+ const value_14 = td.SuccessCodes;
1360
+ const acc_17 = acc_16;
1361
+ acc_18 = value_14 == null ? acc_17 : append(acc_17, singleton(["successCodes", YAMLElement_Sequence(ofSeq(map$2(int, value(value_14))))]));
1362
+ const value_17 = td.TemporaryFailCodes;
1363
+ const acc_19 = acc_18;
1364
+ acc_20 = value_17 == null ? acc_19 : append(acc_19, singleton(["temporaryFailCodes", YAMLElement_Sequence(ofSeq(map$2(int, value(value_17))))]));
1365
+ const value_20 = td.PermanentFailCodes;
1366
+ const acc_21 = acc_20;
1367
+ withCommandFields = value_20 == null ? acc_21 : append(acc_21, singleton(["permanentFailCodes", YAMLElement_Sequence(ofSeq(map$2(int, value(value_20))))]));
1368
+ const withOutputs = append((matchValue_3 = td.Inputs, matchValue_3 != null ? (i = value(matchValue_3), i.length > 0) ? (i_1 = value(matchValue_3), append(withCommandFields, singleton(["inputs", yMap(toList(map$2(encodeCWLInput, i_1)))]))) : withCommandFields : withCommandFields), singleton(["outputs", yMap(toList(map$2(encodeCWLOutput, td.Outputs)))]));
1369
+ let withMetadata;
1370
+ const matchValue_4 = td.Metadata;
1371
+ withMetadata = matchValue_4 == null ? withOutputs : appendDynamicProperties(value(matchValue_4), withOutputs);
1372
+ return yMap(appendDynamicPropertiesExcept(CWLToolDescription.KnownFieldNames, td, withMetadata));
1140
1373
  }
1141
1374
  function encodeExpressionToolDescriptionElement(et) {
1142
- let h, r, matchValue_2, i, i_1, matchValue_3, md;
1375
+ let h, r, matchValue_2, i, i_1;
1143
1376
  let basePairs;
1144
1377
  let acc_6;
1145
1378
  let acc_4;
@@ -1200,13 +1433,13 @@ function encodeExpressionToolDescriptionElement(et) {
1200
1433
  withRequirements = withHints;
1201
1434
  }
1202
1435
  const withExpression = append(append((matchValue_2 = et.Inputs, matchValue_2 != null ? (i = value(matchValue_2), i.length > 0) ? (i_1 = value(matchValue_2), append(withRequirements, singleton(["inputs", yMap(toList(map$2(encodeCWLInput, i_1)))]))) : withRequirements : withRequirements), singleton(["outputs", yMap(toList(map$2(encodeCWLOutput, et.Outputs)))])), singleton(["expression", encodeExpressionScalar(et.Expression)]));
1203
- return yMap((matchValue_3 = et.Metadata, matchValue_3 == null ? withExpression : (md = value(matchValue_3), fold((acc_8, kvp) => {
1204
- let matchValue_4;
1205
- return append(acc_8, singleton([kvp[0], (matchValue_4 = kvp[1], typeof matchValue_4 === "string" ? string(matchValue_4) : typeof matchValue_4 === "boolean" ? yBool(matchValue_4) : typeof matchValue_4 === "number" ? int(matchValue_4) : typeof matchValue_4 === "number" ? float(matchValue_4) : matchValue_4 instanceof YAMLElement ? matchValue_4 : string(toString(kvp[1])))]));
1206
- }, withExpression, md.GetProperties(false)))));
1436
+ let withMetadata;
1437
+ const matchValue_3 = et.Metadata;
1438
+ withMetadata = matchValue_3 == null ? withExpression : appendDynamicProperties(value(matchValue_3), withExpression);
1439
+ return yMap(appendDynamicPropertiesExcept(CWLExpressionToolDescription.KnownFieldNames, et, withMetadata));
1207
1440
  }
1208
1441
  function encodeOperationDescriptionElement(op) {
1209
- let h, matchValue_1, r, r_1, matchValue_2, md;
1442
+ let h, matchValue_1, r, r_1;
1210
1443
  let basePairs;
1211
1444
  let acc_6;
1212
1445
  let acc_4;
@@ -1246,13 +1479,13 @@ function encodeOperationDescriptionElement(op) {
1246
1479
  withHints = basePairs;
1247
1480
  }
1248
1481
  const withOutputs = append(append((matchValue_1 = op.Requirements, matchValue_1 != null ? (r = value(matchValue_1), r.length > 0) ? (r_1 = value(matchValue_1), append(withHints, singleton(["requirements", YAMLElement_Sequence(ofSeq(map$2(encodeRequirement, r_1)))]))) : withHints : withHints), singleton(["inputs", yMap(toList(map$2(encodeCWLInput, op.Inputs)))])), singleton(["outputs", yMap(toList(map$2(encodeCWLOutput, op.Outputs)))]));
1249
- return yMap((matchValue_2 = op.Metadata, matchValue_2 == null ? withOutputs : (md = value(matchValue_2), fold((acc_8, kvp) => {
1250
- let matchValue_3;
1251
- return append(acc_8, singleton([kvp[0], (matchValue_3 = kvp[1], typeof matchValue_3 === "string" ? string(matchValue_3) : typeof matchValue_3 === "boolean" ? yBool(matchValue_3) : typeof matchValue_3 === "number" ? int(matchValue_3) : typeof matchValue_3 === "number" ? float(matchValue_3) : matchValue_3 instanceof YAMLElement ? matchValue_3 : string(toString(kvp[1])))]));
1252
- }, withOutputs, md.GetProperties(false)))));
1482
+ let withMetadata;
1483
+ const matchValue_2 = op.Metadata;
1484
+ withMetadata = matchValue_2 == null ? withOutputs : appendDynamicProperties(value(matchValue_2), withOutputs);
1485
+ return yMap(appendDynamicPropertiesExcept(CWLOperationDescription.KnownFieldNames, op, withMetadata));
1253
1486
  }
1254
1487
  function encodeWorkflowDescriptionElement(wd) {
1255
- let h, matchValue_1, r, r_1, matchValue_2, md;
1488
+ let h, matchValue_1, r, r_1;
1256
1489
  let basePairs;
1257
1490
  let acc_6;
1258
1491
  let acc_4;
@@ -1292,14 +1525,15 @@ function encodeWorkflowDescriptionElement(wd) {
1292
1525
  withHints = basePairs;
1293
1526
  }
1294
1527
  const withOutputs = append(append(append((matchValue_1 = wd.Requirements, matchValue_1 != null ? (r = value(matchValue_1), r.length > 0) ? (r_1 = value(matchValue_1), append(withHints, singleton(["requirements", YAMLElement_Sequence(ofSeq(map$2(encodeRequirement, r_1)))]))) : withHints : withHints), singleton(["inputs", yMap(toList(map$2(encodeCWLInput, wd.Inputs)))])), singleton(["steps", yMap(toList(map$2(encodeWorkflowStep, wd.Steps)))])), singleton(["outputs", yMap(toList(map$2(encodeCWLOutput, wd.Outputs)))]));
1295
- return yMap((matchValue_2 = wd.Metadata, matchValue_2 == null ? withOutputs : (md = value(matchValue_2), fold((acc_8, kvp) => {
1296
- let matchValue_3;
1297
- return append(acc_8, singleton([kvp[0], (matchValue_3 = kvp[1], typeof matchValue_3 === "string" ? string(matchValue_3) : typeof matchValue_3 === "boolean" ? yBool(matchValue_3) : typeof matchValue_3 === "number" ? int(matchValue_3) : typeof matchValue_3 === "number" ? float(matchValue_3) : matchValue_3 instanceof YAMLElement ? matchValue_3 : string(toString(kvp[1])))]));
1298
- }, withOutputs, md.GetProperties(false)))));
1528
+ let withMetadata;
1529
+ const matchValue_2 = wd.Metadata;
1530
+ withMetadata = matchValue_2 == null ? withOutputs : appendDynamicProperties(value(matchValue_2), withOutputs);
1531
+ return yMap(appendDynamicPropertiesExcept(CWLWorkflowDescription.KnownFieldNames, wd, withMetadata));
1299
1532
  }
1300
1533
  function encodeWorkflowStep(ws) {
1301
1534
  let h, r;
1302
1535
  let basePairs;
1536
+ let acc_10;
1303
1537
  let acc_8;
1304
1538
  let acc_6;
1305
1539
  let acc_4;
@@ -1319,7 +1553,8 @@ function encodeWorkflowStep(ws) {
1319
1553
  acc_8 = value_9 == null ? acc_7 : append(acc_7, singleton(["scatterMethod", encodeScatterMethod(value(value_9))]));
1320
1554
  const value_12 = ws.When_;
1321
1555
  const acc_9 = acc_8;
1322
- basePairs = value_12 == null ? acc_9 : append(acc_9, singleton(["when", string(value(value_12))]));
1556
+ acc_10 = value_12 == null ? acc_9 : append(acc_9, singleton(["when", string(value(value_12))]));
1557
+ basePairs = appendDynamicPropertiesExcept(WorkflowStep.KnownFieldNames, ws, acc_10);
1323
1558
  let withHints;
1324
1559
  const matchValue = ws.Hints;
1325
1560
  let matchResult, h_1;
@@ -1370,7 +1605,7 @@ function writeYaml(element) {
1370
1605
  function getObjectPairs(element) {
1371
1606
  if (element.tag === /* Object */
1372
1607
  3) {
1373
- return choose((_arg) => {
1608
+ return choose$1((_arg) => {
1374
1609
  if (_arg.tag === /* Mapping */
1375
1610
  0) {
1376
1611
  return [_arg.fields[0].Value, _arg.fields[1]];
@@ -1379,7 +1614,7 @@ function getObjectPairs(element) {
1379
1614
  }
1380
1615
  }, element.fields[0]);
1381
1616
  } else {
1382
- return empty();
1617
+ return empty$1();
1383
1618
  }
1384
1619
  }
1385
1620
  function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
@@ -1389,7 +1624,7 @@ function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
1389
1624
  Equals: (x, y) => x === y,
1390
1625
  GetHashCode: stringHash
1391
1626
  }), pairs_2);
1392
- const knownSections = choose((sectionKey) => map(singleton, tryFind((tupledArg_1) => tupledArg_1[0] === sectionKey, pairs_2)), orderedSectionKeys);
1627
+ const knownSections = choose$1((sectionKey) => map(singleton, tryFind((tupledArg_1) => tupledArg_1[0] === sectionKey, pairs_2)), orderedSectionKeys);
1393
1628
  const reservedKeys = ofList(append(baseKeys, orderedSectionKeys), {
1394
1629
  Compare: comparePrimitives
1395
1630
  });
@@ -1434,7 +1669,7 @@ function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
1434
1669
  break;
1435
1670
  }
1436
1671
  };
1437
- return join("\r\n", merge(empty(), ofArray(split(join("\r\n\r\n", toList(delay(() => append$1(length(basePairs) > 0 ? singleton$1(section(basePairs)) : empty$1(), delay(() => append$1(map$1(section, knownSections), delay(() => length(metadataPairs) > 0 ? singleton$1(section(metadataPairs)) : empty$1()))))))), ["\r\n"], void 0, 0))));
1672
+ return join("\r\n", merge(empty$1(), ofArray(split(join("\r\n\r\n", toList(delay(() => append$1(length(basePairs) > 0 ? singleton$1(section(basePairs)) : empty$2(), delay(() => append$1(map$1(section, knownSections), delay(() => length(metadataPairs) > 0 ? singleton$1(section(metadataPairs)) : empty$2()))))))), ["\r\n"], void 0, 0))));
1438
1673
  }
1439
1674
  function encodeToolDescription(td) {
1440
1675
  return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "baseCommand", "inputs", "outputs"]), encodeToolDescriptionElement(td));
@@ -1487,7 +1722,8 @@ function encodeCWLTypeYaml(t) {
1487
1722
  }
1488
1723
  }
1489
1724
  function encodeInputRecordFieldYaml(field) {
1490
- return `{name: ${field.Name}, type: ${encodeCWLTypeYaml(field.Type)}}`;
1725
+ const typeYaml = encodeCWLTypeYaml(field.Type);
1726
+ return `{name: ${field.Name}, type: ${typeYaml}}`;
1491
1727
  }
1492
1728
  function encodeInputRecordSchemaYaml(schema) {
1493
1729
  let fs;
@@ -1528,4 +1764,4 @@ function cwlTypeToYamlString(t) {
1528
1764
  return encodeCWLTypeYaml(t);
1529
1765
  }
1530
1766
 
1531
- export { $007CPrimitiveType$007CComplexType$007C, cwlTypeToYamlString, encodeCWLInput, encodeCWLOutput, encodeCWLType, encodeCWLTypeYaml, encodeDoc, encodeEnvVarRequirementCompactMap, encodeExpressionScalar, encodeExpressionToolDescription, encodeExpressionToolDescriptionElement, encodeHintEntry, encodeInputArraySchema, encodeInputArraySchemaYaml, encodeInputBinding, encodeInputEnumSchema, encodeInputEnumSchemaYaml, encodeInputRecordField, encodeInputRecordFieldYaml, encodeInputRecordSchema, encodeInputRecordSchemaYaml, encodeIntent, encodeLabel, encodeLinkMergeMethod, encodeOperationDescription, encodeOperationDescriptionElement, encodeOutputBinding, encodePickValueMethod, encodeProcessingUnit, encodeRequirement, encodeScatter, encodeScatterMethod, encodeSchemaDefRequirementType, encodeSchemaSaladString, encodeSoftwareRequirementCompactMap, encodeSourceArray, encodeStepInput, encodeStepInputs, encodeStepOutputParameter, encodeStepOutputs, encodeStringArrayOrScalar, encodeToolDescription, encodeToolDescriptionElement, encodeWorkflowDescription, encodeWorkflowDescriptionElement, encodeWorkflowStep, encodeWorkflowStepRun, getObjectPairs, isComplexType, normalizeDocString, normalizeEnvValueForEncode, renderTopLevelElement, tryGetArrayShorthand, writeYaml, yBool, yMap };
1767
+ export { $007CPrimitiveType$007CComplexType$007C, appendDynamicProperties, appendDynamicPropertiesExcept, cwlTypeToYamlString, encodeCWLInput, encodeCWLOutput, encodeCWLType, encodeCWLTypeYaml, encodeDirectoryPairs, encodeDoc, encodeDynamicObj, encodeDynamicValue, encodeEnvVarRequirementCompactMap, encodeExpressionScalar, encodeExpressionToolDescription, encodeExpressionToolDescriptionElement, encodeFilePairs, encodeHintEntry, encodeInputArraySchema, encodeInputArraySchemaYaml, encodeInputBinding, encodeInputEnumSchema, encodeInputEnumSchemaYaml, encodeInputRecordField, encodeInputRecordFieldYaml, encodeInputRecordSchema, encodeInputRecordSchemaYaml, encodeIntent, encodeLabel, encodeLinkMergeMethod, encodeOperationDescription, encodeOperationDescriptionElement, encodeOutputBinding, encodePickValueMethod, encodeProcessingUnit, encodeRequirement, encodeScatter, encodeScatterMethod, encodeSchemaDefRequirementType, encodeSchemaSaladString, encodeSoftwareRequirementCompactMap, encodeSourceArray, encodeStepInput, encodeStepInputs, encodeStepOutputParameter, encodeStepOutputs, encodeStringArrayOrScalar, encodeToolDescription, encodeToolDescriptionElement, encodeWorkflowDescription, encodeWorkflowDescriptionElement, encodeWorkflowStep, encodeWorkflowStepRun, getObjectPairs, isComplexType, normalizeDocString, normalizeEnvValueForEncode, renderTopLevelElement, tryGetArrayShorthand, writeYaml, yBool, yFloat, yMap };