@nfdi4plants/arctrl 3.0.3 → 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 (107) hide show
  1. package/dist/ts/node_modules/@fable-org/fable-library-js/System.Collections.Generic.js +320 -0
  2. package/dist/ts/ts/ARC.d.ts +3 -3
  3. package/dist/ts/ts/ARC.d.ts.map +1 -1
  4. package/dist/ts/ts/ARC.js +72 -93
  5. package/dist/ts/ts/CWL/CWLTypes.d.ts +162 -45
  6. package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
  7. package/dist/ts/ts/CWL/CWLTypes.js +495 -104
  8. package/dist/ts/ts/CWL/Decode.d.ts +292 -46
  9. package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
  10. package/dist/ts/ts/CWL/Decode.js +951 -563
  11. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +37 -0
  12. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -0
  13. package/dist/ts/ts/CWL/DynamicObjHelpers.js +57 -0
  14. package/dist/ts/ts/CWL/Encode.d.ts +117 -2
  15. package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
  16. package/dist/ts/ts/CWL/Encode.js +447 -193
  17. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +8 -3
  18. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
  19. package/dist/ts/ts/CWL/ExpressionToolDescription.js +20 -4
  20. package/dist/ts/ts/CWL/Inputs.d.ts +65 -14
  21. package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
  22. package/dist/ts/ts/CWL/Inputs.js +194 -51
  23. package/dist/ts/ts/CWL/OperationDescription.d.ts +8 -3
  24. package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
  25. package/dist/ts/ts/CWL/OperationDescription.js +20 -4
  26. package/dist/ts/ts/CWL/Outputs.d.ts +51 -12
  27. package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
  28. package/dist/ts/ts/CWL/Outputs.js +152 -76
  29. package/dist/ts/ts/CWL/ParameterReference.d.ts +4 -1
  30. package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
  31. package/dist/ts/ts/CWL/ParameterReference.js +17 -6
  32. package/dist/ts/ts/CWL/Requirements.d.ts +140 -50
  33. package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
  34. package/dist/ts/ts/CWL/Requirements.js +458 -127
  35. package/dist/ts/ts/CWL/ToolDescription.d.ts +31 -3
  36. package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
  37. package/dist/ts/ts/CWL/ToolDescription.js +83 -4
  38. package/dist/ts/ts/CWL/WorkflowDescription.d.ts +8 -3
  39. package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
  40. package/dist/ts/ts/CWL/WorkflowDescription.js +20 -4
  41. package/dist/ts/ts/CWL/WorkflowSteps.d.ts +50 -19
  42. package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
  43. package/dist/ts/ts/CWL/WorkflowSteps.js +152 -23
  44. package/dist/ts/ts/Contract/Git.d.ts.map +1 -1
  45. package/dist/ts/ts/Contract/Git.js +1 -1
  46. package/dist/ts/ts/ContractIO/ContractIO.d.ts +3 -3
  47. package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
  48. package/dist/ts/ts/ContractIO/ContractIO.js +30 -23
  49. package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
  50. package/dist/ts/ts/Conversion/Assay.js +4 -3
  51. package/dist/ts/ts/Conversion/Investigation.js +2 -2
  52. package/dist/ts/ts/Conversion/Person.d.ts +1 -1
  53. package/dist/ts/ts/Conversion/Person.d.ts.map +1 -1
  54. package/dist/ts/ts/Conversion/Person.js +27 -11
  55. package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
  56. package/dist/ts/ts/Conversion/Run.js +3 -2
  57. package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
  58. package/dist/ts/ts/Conversion/ScholarlyArticle.js +2 -1
  59. package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
  60. package/dist/ts/ts/Conversion/Study.js +5 -4
  61. package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
  62. package/dist/ts/ts/Conversion/Workflow.js +13 -12
  63. package/dist/ts/ts/Conversion.d.ts +14 -10
  64. package/dist/ts/ts/Conversion.d.ts.map +1 -1
  65. package/dist/ts/ts/Conversion.js +18 -11
  66. package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
  67. package/dist/ts/ts/Core/ArcTypes.js +18 -0
  68. package/dist/ts/ts/Core/Datamap.d.ts.map +1 -1
  69. package/dist/ts/ts/Core/Datamap.js +4 -2
  70. package/dist/ts/ts/Core/OntologyAnnotation.d.ts.map +1 -1
  71. package/dist/ts/ts/Core/OntologyAnnotation.js +76 -2
  72. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts +3 -0
  73. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
  74. package/dist/ts/ts/Core/Table/ArcTableAux.js +23 -10
  75. package/dist/ts/ts/Core/Table/ArcTables.d.ts +1 -0
  76. package/dist/ts/ts/Core/Table/ArcTables.d.ts.map +1 -1
  77. package/dist/ts/ts/Core/Table/ArcTables.js +7 -3
  78. package/dist/ts/ts/Json.d.ts +2 -2
  79. package/dist/ts/ts/Json.d.ts.map +1 -1
  80. package/dist/ts/ts/Json.js +3 -3
  81. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
  82. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +2 -1
  83. package/dist/ts/ts/Yaml/ValidationPackage.d.ts +1 -1
  84. package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
  85. package/dist/ts/ts/Yaml/ValidationPackage.js +5 -5
  86. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +1 -1
  87. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
  88. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +5 -5
  89. package/dist/ts/ts/Yaml.js +1 -1
  90. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/Decode.fs.js +96 -24
  91. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/Persil.fs.js +11 -159
  92. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Preprocessing.fs.js +319 -0
  93. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Reader.fs.js +1867 -0
  94. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/Regex.fs.js +1 -1
  95. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/RegexActivePatterns.fs.js +2 -2
  96. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Syntax.fs.js +819 -0
  97. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Writer.fs.js +686 -0
  98. package/package.json +1 -1
  99. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.5/FlowToBlock.fs.js +0 -956
  100. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.5/Preprocessing.fs.js +0 -139
  101. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.5/Reader.fs.js +0 -1314
  102. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.5/Writer.fs.js +0 -391
  103. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/Encode.fs.js +0 -0
  104. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/Escapes.fs.js +0 -0
  105. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/Interop/JsInterop.fs.js +0 -0
  106. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → YAMLicious.1.0.0-alpha.11}/StringBuffer.fs.js +0 -0
  107. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.5 → 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.5/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.5/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.5/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,13 +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
- 3 ? !isEmpty(_arg.fields[0]) ? isEmpty(tail(_arg.fields[0])) ? (single = head(_arg.fields[0]), single) : _arg : YAMLElement_Value(YAMLContent_create_Z1C3A29C9("{}")) : _arg));
184
+ 3 ? !isEmpty(_arg.fields[0]) ? head(_arg.fields[0]).tag === /* Value */
185
+ 1 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : head(_arg.fields[0]).tag === /* Alias */
186
+ 7 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : isEmpty(tail(_arg.fields[0])) ? (single = head(_arg.fields[0]), single) : _arg : _arg : _arg));
170
187
  }, pairs));
171
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
+ }
172
233
  function normalizeDocString(doc) {
173
234
  return trimEnd(trimEnd(replace(doc, "\r\n", "\n"), "\n"), "\r");
174
235
  }
@@ -201,8 +262,8 @@ function encodeEnvVarRequirementCompactMap(envs) {
201
262
  }
202
263
  function encodeSoftwareRequirementCompactMap(packages) {
203
264
  const packagesMap = yMap(toList(map$2((package$_1) => {
204
- let package$, matchValue_1, value_6, acc_3, value_3, acc_1;
205
- 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))))])))))];
206
267
  }, packages)));
207
268
  return yMap(ofArray([["class", string("SoftwareRequirement")], ["packages", packagesMap]]));
208
269
  }
@@ -215,16 +276,89 @@ function encodeDoc(doc) {
215
276
  function encodeIntent(intent) {
216
277
  return ["intent", YAMLElement_Sequence(ofSeq(map$2(string, intent)))];
217
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
+ }
218
347
  function encodeCWLType(t) {
219
- let value_4, acc_3, value_2, acc_1;
348
+ let acc_4, acc_2, acc, value_2, acc_1, value_4, acc_3;
220
349
  switch (t.tag) {
221
350
  case /* Directory */
222
351
  1:
223
- 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
+ }
224
358
  case /* Dirent */
225
359
  2: {
226
360
  const d = t.fields[0];
227
- 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)));
228
362
  }
229
363
  case /* String */
230
364
  3:
@@ -252,7 +386,8 @@ function encodeCWLType(t) {
252
386
  return string("null");
253
387
  case /* Union */
254
388
  14: {
255
- const typesList = toList(t.fields[0]);
389
+ const types = t.fields[0];
390
+ const typesList = toList(types);
256
391
  let matchResult, otherType;
257
392
  if (!isEmpty(typesList)) {
258
393
  if (head(typesList).tag === /* Null */
@@ -340,32 +475,57 @@ function encodeCWLType(t) {
340
475
  }
341
476
  }
342
477
  case /* Record */
343
- 12:
344
- return encodeInputRecordSchema(t.fields[0]);
478
+ 12: {
479
+ const recordSchema = t.fields[0];
480
+ return encodeInputRecordSchema(recordSchema);
481
+ }
345
482
  case /* Enum */
346
- 13:
347
- return encodeInputEnumSchema(t.fields[0]);
483
+ 13: {
484
+ const enumSchema = t.fields[0];
485
+ return encodeInputEnumSchema(enumSchema);
486
+ }
348
487
  default:
349
- 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
+ }
350
494
  }
351
495
  }
352
496
  function encodeInputRecordField(field) {
353
- 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)];
354
509
  }
355
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;
356
512
  let fieldsElement;
357
513
  const matchValue = schema.Fields;
358
- fieldsElement = matchValue == null ? yMap(empty()) : yMap(toList(map$2(encodeInputRecordField, value(matchValue))));
359
- 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)));
360
516
  }
361
517
  function encodeInputEnumSchema(schema) {
362
- 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)));
363
521
  }
364
522
  function encodeInputArraySchema(schema) {
365
- 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)));
366
525
  }
367
526
  function encodeOutputBinding(ob) {
368
- 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)));
369
529
  }
370
530
  function encodeStringArrayOrScalar(values) {
371
531
  if (values.length === 1) {
@@ -435,7 +595,8 @@ function encodeCWLOutput(o) {
435
595
  return encodeCWLType(t);
436
596
  case /* Array */
437
597
  11: {
438
- const matchValue = otherType.fields[0].Items;
598
+ const arraySchema = otherType.fields[0];
599
+ const matchValue = arraySchema.Items;
439
600
  switch (matchValue.tag) {
440
601
  case /* File */
441
602
  0:
@@ -504,7 +665,8 @@ function encodeCWLOutput(o) {
504
665
  }
505
666
  }, o.Type_);
506
667
  let pairs;
507
- let value_4;
668
+ let acc_16;
669
+ let value_17;
508
670
  const matchValue_2 = o.OutputSource;
509
671
  let matchResult_1, value$1, values_1;
510
672
  if (matchValue_2 != null) {
@@ -525,25 +687,46 @@ function encodeCWLOutput(o) {
525
687
  }
526
688
  switch (matchResult_1) {
527
689
  case 0: {
528
- value_4 = string(value$1);
690
+ value_17 = string(value$1);
529
691
  break;
530
692
  }
531
693
  case 1: {
532
- value_4 = encodeStringArrayOrScalar(values_1);
694
+ value_17 = encodeStringArrayOrScalar(values_1);
533
695
  break;
534
696
  }
535
697
  default:
536
- value_4 = void 0;
698
+ value_17 = void 0;
537
699
  }
538
- 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;
539
706
  let acc_2;
540
707
  const value_1 = typeElement;
541
- const acc_1 = empty();
708
+ const acc_1 = empty$1();
542
709
  acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["type", value(value_1)]));
543
- const value_3 = o.OutputBinding;
710
+ const value_4 = o.Label;
544
711
  const acc_3 = acc_2;
545
- acc_5 = value_3 == null ? acc_3 : append(acc_3, singleton(["outputBinding", encodeOutputBinding(value(value_3))]));
546
- 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);
547
730
  let matchResult_2, t_1;
548
731
  if (!isEmpty(pairs)) {
549
732
  if (head(pairs)[0] === "type") {
@@ -567,11 +750,19 @@ function encodeCWLOutput(o) {
567
750
  }
568
751
  }
569
752
  function encodeInputBinding(ib) {
570
- let value_9, acc_7, value_7, acc_5, value_4, acc_3, value_2, acc_1;
571
- 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)));
572
755
  }
573
756
  function encodeCWLInput(i) {
574
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;
575
766
  let acc_4;
576
767
  let acc_2;
577
768
  const value$1 = map((t) => {
@@ -633,7 +824,8 @@ function encodeCWLInput(i) {
633
824
  return encodeCWLType(t);
634
825
  case /* Array */
635
826
  11: {
636
- const matchValue = otherType.fields[0].Items;
827
+ const arraySchema = otherType.fields[0];
828
+ const matchValue = arraySchema.Items;
637
829
  switch (matchValue.tag) {
638
830
  case /* File */
639
831
  0:
@@ -701,14 +893,39 @@ function encodeCWLInput(i) {
701
893
  return encodeCWLType(t);
702
894
  }
703
895
  }, i.Type_);
704
- const acc_1 = empty();
896
+ const acc_1 = empty$1();
705
897
  acc_2 = value$1 == null ? acc_1 : append(acc_1, singleton(["type", value(value$1)]));
706
- const value_2 = i.InputBinding;
898
+ const value_3 = i.Label;
707
899
  const acc_3 = acc_2;
708
- acc_4 = value_2 == null ? acc_3 : append(acc_3, singleton(["inputBinding", encodeInputBinding(value(value_2))]));
709
- 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;
710
902
  const acc_5 = acc_4;
711
- 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);
712
929
  let matchResult_1, t_1;
713
930
  if (!isEmpty(pairs)) {
714
931
  if (head(pairs)[0] === "type") {
@@ -732,10 +949,11 @@ function encodeCWLInput(i) {
732
949
  }
733
950
  }
734
951
  function encodeSchemaDefRequirementType(s) {
735
- 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)));
736
954
  }
737
955
  function encodeRequirement(r) {
738
- let 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;
739
957
  switch (r.tag) {
740
958
  case /* SchemaDefRequirement */
741
959
  1: {
@@ -745,68 +963,39 @@ function encodeRequirement(r) {
745
963
  case /* DockerRequirement */
746
964
  2: {
747
965
  const dr = r.fields[0];
748
- return yMap((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))]))));
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)));
749
967
  }
750
968
  case /* SoftwareRequirement */
751
969
  3: {
752
970
  const pkgs = r.fields[0];
753
971
  return yMap(ofArray([["class", string("SoftwareRequirement")], ["packages", YAMLElement_Sequence(ofSeq(map$2((p) => {
754
- let value_26, acc_18, value_23, acc_16;
755
- return yMap((value_26 = p.Specs, acc_18 = (value_23 = p.Version, acc_16 = append(empty(), singleton(["package", string(p.Package)])), value_23 == null ? acc_16 : append(acc_16, singleton(["version", YAMLElement_Sequence(ofSeq(map$2(string, value(value_23))))]))), value_26 == null ? acc_18 : append(acc_18, singleton(["specs", YAMLElement_Sequence(ofSeq(map$2(string, value(value_26))))]))));
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)));
756
974
  }, pkgs)))]]));
757
975
  }
758
976
  case /* LoadListingRequirement */
759
977
  4: {
760
978
  const loadListing = r.fields[0];
761
- 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)));
762
980
  }
763
981
  case /* InitialWorkDirRequirement */
764
982
  5: {
765
983
  const listing = r.fields[0];
766
- const encodeDynamicObjWithClass = (className, dynObj) => {
767
- const dynamicPairs = toList(choose$1((kvp) => {
768
- const matchValue = kvp[1];
769
- if (typeof matchValue === "string") {
770
- return [kvp[0], string(matchValue)];
771
- } else if (typeof matchValue === "boolean") {
772
- return [kvp[0], yBool(matchValue)];
773
- } else if (typeof matchValue === "number") {
774
- return [kvp[0], int(matchValue)];
775
- } else if (typeof matchValue === "bigint") {
776
- return [kvp[0], string(int64ToString(matchValue))];
777
- } else if (typeof matchValue === "number") {
778
- return [kvp[0], float(matchValue)];
779
- } else if (matchValue instanceof YAMLElement) {
780
- return [kvp[0], matchValue];
781
- } else {
782
- return void 0;
783
- }
784
- }, dynObj.GetProperties(false)));
785
- if (exists((tupledArg) => tupledArg[0] === "class", dynamicPairs)) {
786
- return yMap(dynamicPairs);
787
- } else {
788
- return yMap(cons(["class", string(className)], dynamicPairs));
789
- }
790
- };
791
- return yMap(ofArray([["class", string("InitialWorkDirRequirement")], ["listing", YAMLElement_Sequence(ofSeq(map$2((_arg_1) => {
792
- let value_31, acc_23, value_29, acc_20;
793
- 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) {
794
987
  case /* StringEntry */
795
988
  1:
796
- return encodeSchemaSaladString(_arg_1.fields[0]);
989
+ return encodeSchemaSaladString(_arg.fields[0]);
797
990
  case /* FileEntry */
798
- 2: {
799
- const arg_1 = _arg_1.fields[0];
800
- return encodeDynamicObjWithClass("File", arg_1);
801
- }
991
+ 2:
992
+ return yMap(encodeFilePairs("class", "File", _arg.fields[0]));
802
993
  case /* DirectoryEntry */
803
- 3: {
804
- const arg_3 = _arg_1.fields[0];
805
- return encodeDynamicObjWithClass("Directory", arg_3);
806
- }
994
+ 3:
995
+ return yMap(encodeDirectoryPairs("class", "Directory", _arg.fields[0]));
807
996
  default: {
808
- const d = _arg_1.fields[0];
809
- return yMap((value_31 = d.Writable, acc_23 = append((value_29 = d.Entryname, acc_20 = empty(), value_29 == null ? acc_20 : append(acc_20, singleton(["entryname", encodeSchemaSaladString(value(value_29))]))), singleton(["entry", encodeSchemaSaladString(d.Entry)])), value_31 == null ? acc_23 : append(acc_23, singleton(["writable", yBool(value(value_31))]))));
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)));
810
999
  }
811
1000
  }
812
1001
  }, listing)))]]));
@@ -815,8 +1004,9 @@ function encodeRequirement(r) {
815
1004
  6: {
816
1005
  const envs = r.fields[0];
817
1006
  return yMap(ofArray([["class", string("EnvVarRequirement")], ["envDef", YAMLElement_Sequence(ofSeq(map$2((e) => {
818
- const v_11 = normalizeEnvValueForEncode(e.EnvValue);
819
- return yMap(ofArray([["envName", string(e.EnvName)], ["envValue", string(v_11)]]));
1007
+ let acc_31;
1008
+ const v_12 = normalizeEnvValueForEncode(e.EnvValue);
1009
+ return yMap((acc_31 = ofArray([["envName", string(e.EnvName)], ["envValue", string(v_12)]]), appendDynamicPropertiesExcept(EnvironmentDef.KnownFieldNames, e, acc_31)));
820
1010
  }, envs)))]]));
821
1011
  }
822
1012
  case /* ShellCommandRequirement */
@@ -825,31 +1015,34 @@ function encodeRequirement(r) {
825
1015
  case /* ResourceRequirement */
826
1016
  8: {
827
1017
  const rr = r.fields[0];
828
- const tryEncodeScalar = (key, value_32) => {
829
- if (typeof value_32 === "number") {
830
- return [key, int(value_32)];
831
- } else if (typeof value_32 === "bigint") {
832
- return [key, YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value_32)))];
833
- } else if (typeof value_32 === "number") {
834
- return [key, float(value_32)];
835
- } else if (typeof value_32 === "string") {
836
- return [key, string(value_32)];
837
- } else if (typeof value_32 === "boolean") {
838
- return [key, yBool(value_32)];
1018
+ const tryEncodeScalar = (key, value_35) => {
1019
+ if (typeof value_35 === "number") {
1020
+ return [key, yFloat(value_35)];
1021
+ } else if (typeof value_35 === "number") {
1022
+ return [key, int(value_35)];
1023
+ } else if (typeof value_35 === "bigint") {
1024
+ return [key, YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value_35)))];
1025
+ } else if (typeof value_35 === "string") {
1026
+ return [key, string(value_35)];
1027
+ } else if (typeof value_35 === "boolean") {
1028
+ return [key, yBool(value_35)];
839
1029
  } else {
840
1030
  return void 0;
841
1031
  }
842
1032
  };
843
- const dynamicPairs_1 = toList(choose$1((kvp_1) => {
844
- const matchValue_1 = kvp_1[1];
845
- return tryEncodeScalar(kvp_1[0], matchValue_1);
846
- }, rr.GetProperties(false)));
847
- 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)));
848
1041
  }
849
1042
  case /* WorkReuseRequirement */
850
1043
  9: {
851
1044
  const workReuse = r.fields[0];
852
- 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)));
853
1046
  }
854
1047
  case /* WorkReuseExpressionRequirement */
855
1048
  10: {
@@ -859,7 +1052,7 @@ function encodeRequirement(r) {
859
1052
  case /* NetworkAccessRequirement */
860
1053
  11: {
861
1054
  const networkAccess = r.fields[0];
862
- 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)));
863
1056
  }
864
1057
  case /* NetworkAccessExpressionRequirement */
865
1058
  12: {
@@ -869,7 +1062,7 @@ function encodeRequirement(r) {
869
1062
  case /* InplaceUpdateRequirement */
870
1063
  13: {
871
1064
  const inplaceUpdate = r.fields[0];
872
- 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)));
873
1066
  }
874
1067
  case /* ToolTimeLimitRequirement */
875
1068
  14: {
@@ -890,20 +1083,23 @@ function encodeRequirement(r) {
890
1083
  case /* StepInputExpressionRequirement */
891
1084
  18:
892
1085
  return yMap(singleton(["class", string("StepInputExpressionRequirement")]));
893
- default:
894
- return yMap((value_2 = bind((entries) => {
1086
+ default: {
1087
+ const value$1 = r.fields[0];
1088
+ return yMap((acc_2 = (value_2 = bind((entries) => {
895
1089
  if (entries.length > 0) {
896
1090
  return entries;
897
1091
  } else {
898
1092
  return void 0;
899
1093
  }
900
- }, 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
+ }
901
1096
  }
902
1097
  }
903
1098
  function encodeHintEntry(hint) {
904
1099
  if (hint.tag === /* UnknownHint */
905
1100
  1) {
906
- return hint.fields[0].Raw;
1101
+ const unknownHint = hint.fields[0];
1102
+ return unknownHint.Raw;
907
1103
  } else {
908
1104
  return encodeRequirement(hint.fields[0]);
909
1105
  }
@@ -926,33 +1122,43 @@ function encodeScatterMethod(scatterMethod) {
926
1122
  }
927
1123
  function encodeStepInput(si) {
928
1124
  let pairs;
929
- const value_21 = si.Label;
930
- let acc_17;
931
- const value_18 = si.LoadListing;
932
- let acc_15;
933
- const value_15 = si.LoadContents;
934
- let acc_13;
935
- const value_13 = si.Doc;
936
- let acc_11;
937
- const value_10 = si.PickValue;
938
- let acc_9;
939
- const value_8 = si.LinkMerge;
940
- let acc_7;
941
- const value_6 = si.ValueFrom;
942
- let acc_5;
943
- const value_3 = si.DefaultValue;
944
- 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;
945
1134
  const value_1 = si.Source;
946
- const acc_1 = empty();
947
- acc_3 = value_1 == null ? acc_1 : append(acc_1, singleton(["source", encodeSourceArray(value(value_1))]));
948
- acc_5 = value_3 == null ? acc_3 : append(acc_3, singleton(["default", value(value_3)]));
949
- acc_7 = value_6 == null ? acc_5 : append(acc_5, singleton(["valueFrom", string(value(value_6))]));
950
- acc_9 = value_8 == null ? acc_7 : append(acc_7, singleton(["linkMerge", encodeLinkMergeMethod(value(value_8))]));
951
- acc_11 = value_10 == null ? acc_9 : append(acc_9, singleton(["pickValue", encodePickValueMethod(value(value_10))]));
952
- acc_13 = value_13 == null ? acc_11 : append(acc_11, singleton(["doc", string(value(value_13))]));
953
- acc_15 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", yBool(value(value_15))]));
954
- acc_17 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", string(value(value_18))]));
955
- 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);
956
1162
  let matchResult, s_1;
957
1163
  if (!isEmpty(pairs)) {
958
1164
  if (head(pairs)[0] === "source") {
@@ -983,7 +1189,8 @@ function encodeStepInputs(inputs) {
983
1189
  return yMap(toList(map$2(encodeStepInput, inputs)));
984
1190
  }
985
1191
  function encodeStepOutputParameter(so) {
986
- return yMap(singleton(["id", string(so.Id)]));
1192
+ let acc;
1193
+ return yMap((acc = singleton(["id", string(so.Id)]), appendDynamicPropertiesExcept(StepOutputParameter.KnownFieldNames, so, acc)));
987
1194
  }
988
1195
  function encodeStepOutputs(outputs) {
989
1196
  return YAMLElement_Sequence(ofSeq(map$2((output) => {
@@ -1049,20 +1256,24 @@ function encodeWorkflowStepRun(run) {
1049
1256
  }
1050
1257
  }
1051
1258
  function encodeToolDescriptionElement(td) {
1052
- let h, r, bc, matchValue_3, i, i_1, matchValue_4, md;
1259
+ let h, r, bc, matchValue_3, i, i_1;
1053
1260
  let basePairs;
1261
+ let acc_6;
1054
1262
  let acc_4;
1055
1263
  let acc_2;
1056
1264
  const acc = ofArray([["cwlVersion", string(td.CWLVersion)], ["class", string("CommandLineTool")]]);
1057
- const pairOpt_1 = map(encodeLabel, td.Label);
1265
+ const pairOpt_1 = map((id) => ["id", string(id)], td.Id);
1058
1266
  const acc_1 = acc;
1059
1267
  acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1060
- const pairOpt_3 = map(encodeDoc, td.Doc);
1268
+ const pairOpt_3 = map(encodeLabel, td.Label);
1061
1269
  const acc_3 = acc_2;
1062
1270
  acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1063
- const pairOpt_5 = map(encodeIntent, filter((intent) => intent.length > 0, td.Intent));
1271
+ const pairOpt_5 = map(encodeDoc, td.Doc);
1064
1272
  const acc_5 = acc_4;
1065
- basePairs = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1273
+ acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1274
+ const pairOpt_7 = map(encodeIntent, filter((intent) => intent.length > 0, td.Intent));
1275
+ const acc_7 = acc_6;
1276
+ basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
1066
1277
  let withHints;
1067
1278
  const matchValue = td.Hints;
1068
1279
  let matchResult, h_1;
@@ -1126,27 +1337,59 @@ function encodeToolDescriptionElement(td) {
1126
1337
  default:
1127
1338
  withBaseCommand = withRequirements;
1128
1339
  }
1129
- 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)))]));
1130
- return yMap((matchValue_4 = td.Metadata, matchValue_4 == null ? withOutputs : (md = value(matchValue_4), fold((acc_6, kvp) => {
1131
- let matchValue_5;
1132
- return append(acc_6, 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])))]));
1133
- }, 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));
1134
1373
  }
1135
1374
  function encodeExpressionToolDescriptionElement(et) {
1136
- let h, r, matchValue_2, i, i_1, matchValue_3, md;
1375
+ let h, r, matchValue_2, i, i_1;
1137
1376
  let basePairs;
1377
+ let acc_6;
1138
1378
  let acc_4;
1139
1379
  let acc_2;
1140
1380
  const acc = ofArray([["cwlVersion", string(et.CWLVersion)], ["class", string("ExpressionTool")]]);
1141
- const pairOpt_1 = map(encodeLabel, et.Label);
1381
+ const pairOpt_1 = map((id) => ["id", string(id)], et.Id);
1142
1382
  const acc_1 = acc;
1143
1383
  acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1144
- const pairOpt_3 = map(encodeDoc, et.Doc);
1384
+ const pairOpt_3 = map(encodeLabel, et.Label);
1145
1385
  const acc_3 = acc_2;
1146
1386
  acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1147
- const pairOpt_5 = map(encodeIntent, filter((intent) => intent.length > 0, et.Intent));
1387
+ const pairOpt_5 = map(encodeDoc, et.Doc);
1148
1388
  const acc_5 = acc_4;
1149
- basePairs = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1389
+ acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1390
+ const pairOpt_7 = map(encodeIntent, filter((intent) => intent.length > 0, et.Intent));
1391
+ const acc_7 = acc_6;
1392
+ basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
1150
1393
  let withHints;
1151
1394
  const matchValue = et.Hints;
1152
1395
  let matchResult, h_1;
@@ -1190,26 +1433,30 @@ function encodeExpressionToolDescriptionElement(et) {
1190
1433
  withRequirements = withHints;
1191
1434
  }
1192
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)]));
1193
- return yMap((matchValue_3 = et.Metadata, matchValue_3 == null ? withExpression : (md = value(matchValue_3), fold((acc_6, kvp) => {
1194
- let matchValue_4;
1195
- return append(acc_6, 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])))]));
1196
- }, 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));
1197
1440
  }
1198
1441
  function encodeOperationDescriptionElement(op) {
1199
- let h, matchValue_1, r, r_1, matchValue_2, md;
1442
+ let h, matchValue_1, r, r_1;
1200
1443
  let basePairs;
1444
+ let acc_6;
1201
1445
  let acc_4;
1202
1446
  let acc_2;
1203
1447
  const acc = ofArray([["cwlVersion", string(op.CWLVersion)], ["class", string("Operation")]]);
1204
- const pairOpt_1 = map(encodeLabel, op.Label);
1448
+ const pairOpt_1 = map((id) => ["id", string(id)], op.Id);
1205
1449
  const acc_1 = acc;
1206
1450
  acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1207
- const pairOpt_3 = map(encodeDoc, op.Doc);
1451
+ const pairOpt_3 = map(encodeLabel, op.Label);
1208
1452
  const acc_3 = acc_2;
1209
1453
  acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1210
- const pairOpt_5 = map(encodeIntent, filter((intent) => intent.length > 0, op.Intent));
1454
+ const pairOpt_5 = map(encodeDoc, op.Doc);
1211
1455
  const acc_5 = acc_4;
1212
- basePairs = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1456
+ acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1457
+ const pairOpt_7 = map(encodeIntent, filter((intent) => intent.length > 0, op.Intent));
1458
+ const acc_7 = acc_6;
1459
+ basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
1213
1460
  let withHints;
1214
1461
  const matchValue = op.Hints;
1215
1462
  let matchResult, h_1;
@@ -1232,26 +1479,30 @@ function encodeOperationDescriptionElement(op) {
1232
1479
  withHints = basePairs;
1233
1480
  }
1234
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)))]));
1235
- return yMap((matchValue_2 = op.Metadata, matchValue_2 == null ? withOutputs : (md = value(matchValue_2), fold((acc_6, kvp) => {
1236
- let matchValue_3;
1237
- return append(acc_6, 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])))]));
1238
- }, 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));
1239
1486
  }
1240
1487
  function encodeWorkflowDescriptionElement(wd) {
1241
- let h, matchValue_1, r, r_1, matchValue_2, md;
1488
+ let h, matchValue_1, r, r_1;
1242
1489
  let basePairs;
1490
+ let acc_6;
1243
1491
  let acc_4;
1244
1492
  let acc_2;
1245
1493
  const acc = ofArray([["cwlVersion", string(wd.CWLVersion)], ["class", string("Workflow")]]);
1246
- const pairOpt_1 = map(encodeLabel, wd.Label);
1494
+ const pairOpt_1 = map((id) => ["id", string(id)], wd.Id);
1247
1495
  const acc_1 = acc;
1248
1496
  acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1249
- const pairOpt_3 = map(encodeDoc, wd.Doc);
1497
+ const pairOpt_3 = map(encodeLabel, wd.Label);
1250
1498
  const acc_3 = acc_2;
1251
1499
  acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1252
- const pairOpt_5 = map(encodeIntent, filter((intent) => intent.length > 0, wd.Intent));
1500
+ const pairOpt_5 = map(encodeDoc, wd.Doc);
1253
1501
  const acc_5 = acc_4;
1254
- basePairs = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1502
+ acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1503
+ const pairOpt_7 = map(encodeIntent, filter((intent) => intent.length > 0, wd.Intent));
1504
+ const acc_7 = acc_6;
1505
+ basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
1255
1506
  let withHints;
1256
1507
  const matchValue = wd.Hints;
1257
1508
  let matchResult, h_1;
@@ -1274,14 +1525,15 @@ function encodeWorkflowDescriptionElement(wd) {
1274
1525
  withHints = basePairs;
1275
1526
  }
1276
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)))]));
1277
- return yMap((matchValue_2 = wd.Metadata, matchValue_2 == null ? withOutputs : (md = value(matchValue_2), fold((acc_6, kvp) => {
1278
- let matchValue_3;
1279
- return append(acc_6, 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])))]));
1280
- }, 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));
1281
1532
  }
1282
1533
  function encodeWorkflowStep(ws) {
1283
1534
  let h, r;
1284
1535
  let basePairs;
1536
+ let acc_10;
1285
1537
  let acc_8;
1286
1538
  let acc_6;
1287
1539
  let acc_4;
@@ -1301,7 +1553,8 @@ function encodeWorkflowStep(ws) {
1301
1553
  acc_8 = value_9 == null ? acc_7 : append(acc_7, singleton(["scatterMethod", encodeScatterMethod(value(value_9))]));
1302
1554
  const value_12 = ws.When_;
1303
1555
  const acc_9 = acc_8;
1304
- 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);
1305
1558
  let withHints;
1306
1559
  const matchValue = ws.Hints;
1307
1560
  let matchResult, h_1;
@@ -1352,7 +1605,7 @@ function writeYaml(element) {
1352
1605
  function getObjectPairs(element) {
1353
1606
  if (element.tag === /* Object */
1354
1607
  3) {
1355
- return choose((_arg) => {
1608
+ return choose$1((_arg) => {
1356
1609
  if (_arg.tag === /* Mapping */
1357
1610
  0) {
1358
1611
  return [_arg.fields[0].Value, _arg.fields[1]];
@@ -1361,7 +1614,7 @@ function getObjectPairs(element) {
1361
1614
  }
1362
1615
  }, element.fields[0]);
1363
1616
  } else {
1364
- return empty();
1617
+ return empty$1();
1365
1618
  }
1366
1619
  }
1367
1620
  function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
@@ -1371,7 +1624,7 @@ function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
1371
1624
  Equals: (x, y) => x === y,
1372
1625
  GetHashCode: stringHash
1373
1626
  }), pairs_2);
1374
- 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);
1375
1628
  const reservedKeys = ofList(append(baseKeys, orderedSectionKeys), {
1376
1629
  Compare: comparePrimitives
1377
1630
  });
@@ -1416,19 +1669,19 @@ function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
1416
1669
  break;
1417
1670
  }
1418
1671
  };
1419
- 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))));
1420
1673
  }
1421
1674
  function encodeToolDescription(td) {
1422
- return renderTopLevelElement(ofArray(["cwlVersion", "class", "label", "doc", "intent"]), ofArray(["hints", "requirements", "baseCommand", "inputs", "outputs"]), encodeToolDescriptionElement(td));
1675
+ return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "baseCommand", "inputs", "outputs"]), encodeToolDescriptionElement(td));
1423
1676
  }
1424
1677
  function encodeWorkflowDescription(wd) {
1425
- return renderTopLevelElement(ofArray(["cwlVersion", "class", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "steps", "outputs"]), encodeWorkflowDescriptionElement(wd));
1678
+ return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "steps", "outputs"]), encodeWorkflowDescriptionElement(wd));
1426
1679
  }
1427
1680
  function encodeExpressionToolDescription(et) {
1428
- return renderTopLevelElement(ofArray(["cwlVersion", "class", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "outputs", "expression"]), encodeExpressionToolDescriptionElement(et));
1681
+ return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "outputs", "expression"]), encodeExpressionToolDescriptionElement(et));
1429
1682
  }
1430
1683
  function encodeOperationDescription(op) {
1431
- return renderTopLevelElement(ofArray(["cwlVersion", "class", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "outputs"]), encodeOperationDescriptionElement(op));
1684
+ return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "outputs"]), encodeOperationDescriptionElement(op));
1432
1685
  }
1433
1686
  function encodeProcessingUnit(pu) {
1434
1687
  switch (pu.tag) {
@@ -1469,7 +1722,8 @@ function encodeCWLTypeYaml(t) {
1469
1722
  }
1470
1723
  }
1471
1724
  function encodeInputRecordFieldYaml(field) {
1472
- return `{name: ${field.Name}, type: ${encodeCWLTypeYaml(field.Type)}}`;
1725
+ const typeYaml = encodeCWLTypeYaml(field.Type);
1726
+ return `{name: ${field.Name}, type: ${typeYaml}}`;
1473
1727
  }
1474
1728
  function encodeInputRecordSchemaYaml(schema) {
1475
1729
  let fs;
@@ -1510,4 +1764,4 @@ function cwlTypeToYamlString(t) {
1510
1764
  return encodeCWLTypeYaml(t);
1511
1765
  }
1512
1766
 
1513
- 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 };