@nfdi4plants/arctrl 3.2.3 → 3.3.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 (454) hide show
  1. package/dist/ts/index.d.ts +44 -7
  2. package/dist/ts/index.d.ts.map +1 -1
  3. package/dist/ts/index.js +45 -8
  4. package/dist/ts/node_modules/@fable-org/fable-library-ts/Array.js +195 -92
  5. package/dist/ts/node_modules/@fable-org/fable-library-ts/Async.js +251 -30
  6. package/dist/ts/node_modules/@fable-org/fable-library-ts/AsyncBuilder.js +61 -11
  7. package/dist/ts/node_modules/@fable-org/fable-library-ts/BigInt.js +15 -5
  8. package/dist/ts/node_modules/@fable-org/fable-library-ts/BitConverter.js +139 -0
  9. package/dist/ts/node_modules/@fable-org/fable-library-ts/Date.js +1 -1
  10. package/dist/ts/node_modules/@fable-org/fable-library-ts/Decimal.js +68 -12
  11. package/dist/ts/node_modules/@fable-org/fable-library-ts/Double.js +24 -10
  12. package/dist/ts/node_modules/@fable-org/fable-library-ts/FSharp.Core.js +8 -2
  13. package/dist/ts/node_modules/@fable-org/fable-library-ts/Global.js +1 -1
  14. package/dist/ts/node_modules/@fable-org/fable-library-ts/Int32.js +11 -2
  15. package/dist/ts/node_modules/@fable-org/fable-library-ts/List.js +220 -155
  16. package/dist/ts/node_modules/@fable-org/fable-library-ts/Long.js +7 -2
  17. package/dist/ts/node_modules/@fable-org/fable-library-ts/Map.js +46 -39
  18. package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableMap.js +75 -92
  19. package/dist/ts/node_modules/@fable-org/fable-library-ts/MutableSet.js +56 -76
  20. package/dist/ts/node_modules/@fable-org/fable-library-ts/NumberStyles.js +54 -0
  21. package/dist/ts/node_modules/@fable-org/fable-library-ts/Numeric.js +10 -5
  22. package/dist/ts/node_modules/@fable-org/fable-library-ts/Random.js +3 -4
  23. package/dist/ts/node_modules/@fable-org/fable-library-ts/Range.js +4 -3
  24. package/dist/ts/node_modules/@fable-org/fable-library-ts/RegExp.js +2 -2
  25. package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq.js +128 -64
  26. package/dist/ts/node_modules/@fable-org/fable-library-ts/Seq2.js +4 -8
  27. package/dist/ts/node_modules/@fable-org/fable-library-ts/Set.js +64 -57
  28. package/dist/ts/node_modules/@fable-org/fable-library-ts/String.js +68 -21
  29. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Collections.Generic.js +3 -2
  30. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.Text.js +2 -2
  31. package/dist/ts/node_modules/@fable-org/fable-library-ts/System.js +5 -5
  32. package/dist/ts/node_modules/@fable-org/fable-library-ts/Types.js +23 -12
  33. package/dist/ts/node_modules/@fable-org/fable-library-ts/Util.js +88 -49
  34. package/dist/ts/node_modules/@fable-org/fable-library-ts/lib/big.js +121 -74
  35. package/dist/ts/ts/ARC.d.ts +19 -2
  36. package/dist/ts/ts/ARC.d.ts.map +1 -1
  37. package/dist/ts/ts/ARC.js +128 -89
  38. package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts +0 -2
  39. package/dist/ts/ts/CWL/CWLKnownFieldNames.d.ts.map +1 -1
  40. package/dist/ts/ts/CWL/CWLKnownFieldNames.js +1 -7
  41. package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts +46 -27
  42. package/dist/ts/ts/CWL/CWLProcessingUnit.d.ts.map +1 -1
  43. package/dist/ts/ts/CWL/CWLProcessingUnit.js +312 -123
  44. package/dist/ts/ts/CWL/CWLTypes.d.ts +481 -148
  45. package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
  46. package/dist/ts/ts/CWL/CWLTypes.js +887 -201
  47. package/dist/ts/ts/CWL/Decode.d.ts +480 -211
  48. package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
  49. package/dist/ts/ts/CWL/Decode.js +3614 -2462
  50. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +9 -0
  51. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -1
  52. package/dist/ts/ts/CWL/DynamicObjHelpers.js +55 -5
  53. package/dist/ts/ts/CWL/Encode.d.ts +225 -85
  54. package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
  55. package/dist/ts/ts/CWL/Encode.js +1858 -970
  56. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +42 -28
  57. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
  58. package/dist/ts/ts/CWL/ExpressionToolDescription.js +34 -13
  59. package/dist/ts/ts/CWL/HashHelpers.d.ts +38 -0
  60. package/dist/ts/ts/CWL/HashHelpers.d.ts.map +1 -1
  61. package/dist/ts/ts/CWL/HashHelpers.js +255 -6
  62. package/dist/ts/ts/CWL/Inputs.d.ts +127 -56
  63. package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
  64. package/dist/ts/ts/CWL/Inputs.js +107 -16
  65. package/dist/ts/ts/CWL/OperationDescription.d.ts +41 -21
  66. package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
  67. package/dist/ts/ts/CWL/OperationDescription.js +35 -9
  68. package/dist/ts/ts/CWL/Outputs.d.ts +93 -42
  69. package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
  70. package/dist/ts/ts/CWL/Outputs.js +101 -19
  71. package/dist/ts/ts/CWL/ParameterReference.d.ts +11 -8
  72. package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
  73. package/dist/ts/ts/CWL/ParameterReference.js +18 -25
  74. package/dist/ts/ts/CWL/ParameterValue.d.ts +15 -1
  75. package/dist/ts/ts/CWL/ParameterValue.d.ts.map +1 -1
  76. package/dist/ts/ts/CWL/ParameterValue.js +59 -35
  77. package/dist/ts/ts/CWL/Requirements.d.ts +240 -98
  78. package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
  79. package/dist/ts/ts/CWL/Requirements.js +462 -89
  80. package/dist/ts/ts/CWL/ScalarQuoting.d.ts +51 -0
  81. package/dist/ts/ts/CWL/ScalarQuoting.d.ts.map +1 -0
  82. package/dist/ts/ts/CWL/ScalarQuoting.js +250 -0
  83. package/dist/ts/ts/CWL/ToolDescription.d.ts +63 -50
  84. package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
  85. package/dist/ts/ts/CWL/ToolDescription.js +34 -13
  86. package/dist/ts/ts/CWL/WorkflowDescription.d.ts +45 -26
  87. package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
  88. package/dist/ts/ts/CWL/WorkflowDescription.js +38 -11
  89. package/dist/ts/ts/CWL/WorkflowSteps.d.ts +248 -65
  90. package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
  91. package/dist/ts/ts/CWL/WorkflowSteps.js +413 -43
  92. package/dist/ts/ts/CWLRunResolver.d.ts +30 -12
  93. package/dist/ts/ts/CWLRunResolver.d.ts.map +1 -1
  94. package/dist/ts/ts/CWLRunResolver.js +221 -86
  95. package/dist/ts/ts/Contract/ARC.d.ts.map +1 -1
  96. package/dist/ts/ts/Contract/ARC.js +13 -14
  97. package/dist/ts/ts/Contract/ArcAssay.d.ts.map +1 -1
  98. package/dist/ts/ts/Contract/ArcAssay.js +4 -4
  99. package/dist/ts/ts/Contract/ArcInvestigation.d.ts.map +1 -1
  100. package/dist/ts/ts/Contract/ArcInvestigation.js +3 -4
  101. package/dist/ts/ts/Contract/ArcRun.d.ts +12 -2
  102. package/dist/ts/ts/Contract/ArcRun.d.ts.map +1 -1
  103. package/dist/ts/ts/Contract/ArcRun.js +47 -20
  104. package/dist/ts/ts/Contract/ArcStudy.d.ts.map +1 -1
  105. package/dist/ts/ts/Contract/ArcStudy.js +4 -4
  106. package/dist/ts/ts/Contract/ArcWorkflow.d.ts +18 -4
  107. package/dist/ts/ts/Contract/ArcWorkflow.d.ts.map +1 -1
  108. package/dist/ts/ts/Contract/ArcWorkflow.js +55 -17
  109. package/dist/ts/ts/Contract/Datamap.d.ts.map +1 -1
  110. package/dist/ts/ts/Contract/Datamap.js +16 -17
  111. package/dist/ts/ts/Contract/Git.js +1 -1
  112. package/dist/ts/ts/Contract/ValidationPackagesConfig.d.ts.map +1 -1
  113. package/dist/ts/ts/Contract/ValidationPackagesConfig.js +4 -5
  114. package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
  115. package/dist/ts/ts/ContractIO/ContractIO.js +15 -16
  116. package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
  117. package/dist/ts/ts/Conversion/Assay.js +26 -18
  118. package/dist/ts/ts/Conversion/Basic.d.ts +4 -0
  119. package/dist/ts/ts/Conversion/Basic.d.ts.map +1 -1
  120. package/dist/ts/ts/Conversion/Basic.js +55 -31
  121. package/dist/ts/ts/Conversion/ColumnIndex.d.ts.map +1 -1
  122. package/dist/ts/ts/Conversion/ColumnIndex.js +2 -4
  123. package/dist/ts/ts/Conversion/DateTime.d.ts.map +1 -1
  124. package/dist/ts/ts/Conversion/DateTime.js +1 -2
  125. package/dist/ts/ts/Conversion/Investigation.js +11 -11
  126. package/dist/ts/ts/Conversion/Person.js +11 -11
  127. package/dist/ts/ts/Conversion/Process.d.ts.map +1 -1
  128. package/dist/ts/ts/Conversion/Process.js +107 -86
  129. package/dist/ts/ts/Conversion/Run.d.ts +36 -6
  130. package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
  131. package/dist/ts/ts/Conversion/Run.js +320 -136
  132. package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
  133. package/dist/ts/ts/Conversion/ScholarlyArticle.js +75 -9
  134. package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
  135. package/dist/ts/ts/Conversion/Study.js +23 -12
  136. package/dist/ts/ts/Conversion/Table.js +5 -5
  137. package/dist/ts/ts/Conversion/Workflow.d.ts +48 -9
  138. package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
  139. package/dist/ts/ts/Conversion/Workflow.js +655 -163
  140. package/dist/ts/ts/Conversion.js +6 -6
  141. package/dist/ts/ts/Core/ArcTypes.d.ts +73 -28
  142. package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
  143. package/dist/ts/ts/Core/ArcTypes.js +219 -129
  144. package/dist/ts/ts/Core/Comment.d.ts.map +1 -1
  145. package/dist/ts/ts/Core/Comment.js +2 -2
  146. package/dist/ts/ts/Core/CommentList.js +7 -7
  147. package/dist/ts/ts/Core/Conversion.d.ts.map +1 -1
  148. package/dist/ts/ts/Core/Conversion.js +41 -41
  149. package/dist/ts/ts/Core/Data.d.ts.map +1 -1
  150. package/dist/ts/ts/Core/Data.js +14 -11
  151. package/dist/ts/ts/Core/DataContext.d.ts +1 -1
  152. package/dist/ts/ts/Core/DataContext.d.ts.map +1 -1
  153. package/dist/ts/ts/Core/DataContext.js +4 -4
  154. package/dist/ts/ts/Core/DataFile.d.ts +11 -8
  155. package/dist/ts/ts/Core/DataFile.d.ts.map +1 -1
  156. package/dist/ts/ts/Core/DataFile.js +55 -61
  157. package/dist/ts/ts/Core/Datamap.d.ts.map +1 -1
  158. package/dist/ts/ts/Core/Datamap.js +2 -3
  159. package/dist/ts/ts/Core/Helper/Collections.d.ts.map +1 -1
  160. package/dist/ts/ts/Core/Helper/Collections.js +2 -4
  161. package/dist/ts/ts/Core/Helper/Identifier.d.ts.map +1 -1
  162. package/dist/ts/ts/Core/Helper/Identifier.js +12 -15
  163. package/dist/ts/ts/Core/Helper/ORCID.d.ts.map +1 -1
  164. package/dist/ts/ts/Core/Helper/ORCID.js +2 -3
  165. package/dist/ts/ts/Core/Helper/Regex.d.ts.map +1 -1
  166. package/dist/ts/ts/Core/Helper/Regex.js +52 -53
  167. package/dist/ts/ts/Core/Helper/SemVer.d.ts +13 -3
  168. package/dist/ts/ts/Core/Helper/SemVer.d.ts.map +1 -1
  169. package/dist/ts/ts/Core/Helper/SemVer.js +96 -6
  170. package/dist/ts/ts/Core/Helper/Url.d.ts.map +1 -1
  171. package/dist/ts/ts/Core/Helper/Url.js +1 -1
  172. package/dist/ts/ts/Core/OntologyAnnotation.js +22 -22
  173. package/dist/ts/ts/Core/Person.d.ts.map +1 -1
  174. package/dist/ts/ts/Core/Person.js +2 -2
  175. package/dist/ts/ts/Core/Process/ColumnIndex.d.ts.map +1 -1
  176. package/dist/ts/ts/Core/Process/ColumnIndex.js +10 -12
  177. package/dist/ts/ts/Core/Process/Component.d.ts.map +1 -1
  178. package/dist/ts/ts/Core/Process/Component.js +22 -22
  179. package/dist/ts/ts/Core/Process/Factor.d.ts.map +1 -1
  180. package/dist/ts/ts/Core/Process/Factor.js +7 -7
  181. package/dist/ts/ts/Core/Process/FactorValue.d.ts.map +1 -1
  182. package/dist/ts/ts/Core/Process/FactorValue.js +15 -15
  183. package/dist/ts/ts/Core/Process/Material.d.ts.map +1 -1
  184. package/dist/ts/ts/Core/Process/Material.js +2 -2
  185. package/dist/ts/ts/Core/Process/MaterialAttribute.d.ts.map +1 -1
  186. package/dist/ts/ts/Core/Process/MaterialAttribute.js +6 -6
  187. package/dist/ts/ts/Core/Process/MaterialAttributeValue.d.ts.map +1 -1
  188. package/dist/ts/ts/Core/Process/MaterialAttributeValue.js +16 -16
  189. package/dist/ts/ts/Core/Process/Process.js +21 -21
  190. package/dist/ts/ts/Core/Process/ProcessInput.d.ts.map +1 -1
  191. package/dist/ts/ts/Core/Process/ProcessInput.js +2 -2
  192. package/dist/ts/ts/Core/Process/ProcessOutput.d.ts.map +1 -1
  193. package/dist/ts/ts/Core/Process/ProcessOutput.js +2 -2
  194. package/dist/ts/ts/Core/Process/ProcessParameterValue.d.ts.map +1 -1
  195. package/dist/ts/ts/Core/Process/ProcessParameterValue.js +17 -17
  196. package/dist/ts/ts/Core/Process/ProcessSequence.js +4 -4
  197. package/dist/ts/ts/Core/Process/Protocol.d.ts.map +1 -1
  198. package/dist/ts/ts/Core/Process/Protocol.js +9 -9
  199. package/dist/ts/ts/Core/Process/ProtocolParameter.d.ts.map +1 -1
  200. package/dist/ts/ts/Core/Process/ProtocolParameter.js +6 -6
  201. package/dist/ts/ts/Core/Publication.d.ts.map +1 -1
  202. package/dist/ts/ts/Core/Publication.js +3 -3
  203. package/dist/ts/ts/Core/ScalarValue.d.ts.map +1 -1
  204. package/dist/ts/ts/Core/ScalarValue.js +9 -13
  205. package/dist/ts/ts/Core/Table/ArcTable.d.ts.map +1 -1
  206. package/dist/ts/ts/Core/Table/ArcTable.js +18 -18
  207. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts +1 -1
  208. package/dist/ts/ts/Core/Table/ArcTableAux.d.ts.map +1 -1
  209. package/dist/ts/ts/Core/Table/ArcTableAux.js +50 -70
  210. package/dist/ts/ts/Core/Table/ArcTables.js +16 -16
  211. package/dist/ts/ts/Core/Table/CompositeHeader.d.ts.map +1 -1
  212. package/dist/ts/ts/Core/Table/CompositeHeader.js +5 -6
  213. package/dist/ts/ts/Core/Templates.d.ts.map +1 -1
  214. package/dist/ts/ts/Core/Templates.js +2 -2
  215. package/dist/ts/ts/FileSystem/Path.d.ts +13 -2
  216. package/dist/ts/ts/FileSystem/Path.d.ts.map +1 -1
  217. package/dist/ts/ts/FileSystem/Path.js +37 -19
  218. package/dist/ts/ts/Json/Assay.js +22 -22
  219. package/dist/ts/ts/Json/Comment.js +9 -9
  220. package/dist/ts/ts/Json/Data.d.ts.map +1 -1
  221. package/dist/ts/ts/Json/Data.js +11 -11
  222. package/dist/ts/ts/Json/Datamap/DataContext.js +2 -2
  223. package/dist/ts/ts/Json/Decode.d.ts.map +1 -1
  224. package/dist/ts/ts/Json/Decode.js +3 -5
  225. package/dist/ts/ts/Json/Encode.js +2 -2
  226. package/dist/ts/ts/Json/Investigation.d.ts.map +1 -1
  227. package/dist/ts/ts/Json/Investigation.js +20 -20
  228. package/dist/ts/ts/Json/OntologyAnnotation.d.ts.map +1 -1
  229. package/dist/ts/ts/Json/OntologyAnnotation.js +18 -18
  230. package/dist/ts/ts/Json/OntologySourceReference.d.ts.map +1 -1
  231. package/dist/ts/ts/Json/OntologySourceReference.js +9 -9
  232. package/dist/ts/ts/Json/Person.d.ts.map +1 -1
  233. package/dist/ts/ts/Json/Person.js +20 -20
  234. package/dist/ts/ts/Json/Process/AssayMaterials.d.ts.map +1 -1
  235. package/dist/ts/ts/Json/Process/AssayMaterials.js +1 -2
  236. package/dist/ts/ts/Json/Process/Component.d.ts.map +1 -1
  237. package/dist/ts/ts/Json/Process/Component.js +5 -6
  238. package/dist/ts/ts/Json/Process/Factor.d.ts.map +1 -1
  239. package/dist/ts/ts/Json/Process/Factor.js +7 -7
  240. package/dist/ts/ts/Json/Process/FactorValue.d.ts.map +1 -1
  241. package/dist/ts/ts/Json/Process/FactorValue.js +2 -3
  242. package/dist/ts/ts/Json/Process/Material.d.ts.map +1 -1
  243. package/dist/ts/ts/Json/Process/Material.js +9 -10
  244. package/dist/ts/ts/Json/Process/MaterialAttribute.d.ts.map +1 -1
  245. package/dist/ts/ts/Json/Process/MaterialAttribute.js +5 -6
  246. package/dist/ts/ts/Json/Process/MaterialAttributeValue.d.ts.map +1 -1
  247. package/dist/ts/ts/Json/Process/MaterialAttributeValue.js +2 -3
  248. package/dist/ts/ts/Json/Process/Process.d.ts.map +1 -1
  249. package/dist/ts/ts/Json/Process/Process.js +8 -9
  250. package/dist/ts/ts/Json/Process/ProcessParameterValue.d.ts.map +1 -1
  251. package/dist/ts/ts/Json/Process/ProcessParameterValue.js +1 -2
  252. package/dist/ts/ts/Json/Process/Protocol.d.ts.map +1 -1
  253. package/dist/ts/ts/Json/Process/Protocol.js +17 -17
  254. package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts.map +1 -1
  255. package/dist/ts/ts/Json/Process/ProtocolParameter.js +6 -6
  256. package/dist/ts/ts/Json/Process/Sample.d.ts.map +1 -1
  257. package/dist/ts/ts/Json/Process/Sample.js +9 -9
  258. package/dist/ts/ts/Json/Process/Source.d.ts.map +1 -1
  259. package/dist/ts/ts/Json/Process/Source.js +10 -11
  260. package/dist/ts/ts/Json/Process/StudyMaterials.d.ts.map +1 -1
  261. package/dist/ts/ts/Json/Process/StudyMaterials.js +1 -2
  262. package/dist/ts/ts/Json/PropertyValue.d.ts.map +1 -1
  263. package/dist/ts/ts/Json/PropertyValue.js +24 -24
  264. package/dist/ts/ts/Json/Publication.d.ts.map +1 -1
  265. package/dist/ts/ts/Json/Publication.js +10 -10
  266. package/dist/ts/ts/Json/ROCrate/LDContext.js +1 -2
  267. package/dist/ts/ts/Json/ROCrate/LDGraph.js +2 -2
  268. package/dist/ts/ts/Json/ROCrate/LDNode.js +5 -5
  269. package/dist/ts/ts/Json/Run.js +9 -9
  270. package/dist/ts/ts/Json/StringTable.d.ts.map +1 -1
  271. package/dist/ts/ts/Json/StringTable.js +4 -7
  272. package/dist/ts/ts/Json/Study.js +20 -20
  273. package/dist/ts/ts/Json/Table/CellTable.js +1 -2
  274. package/dist/ts/ts/Json/Table/OATable.js +1 -2
  275. package/dist/ts/ts/Json/Workflow.js +9 -9
  276. package/dist/ts/ts/Json.d.ts +121 -1
  277. package/dist/ts/ts/Json.d.ts.map +1 -1
  278. package/dist/ts/ts/Json.js +310 -2
  279. package/dist/ts/ts/JsonIO/Comment.d.ts +15 -0
  280. package/dist/ts/ts/JsonIO/Comment.d.ts.map +1 -0
  281. package/dist/ts/ts/JsonIO/Comment.js +67 -0
  282. package/dist/ts/ts/JsonIO/Data.d.ts +9 -0
  283. package/dist/ts/ts/JsonIO/Data.d.ts.map +1 -0
  284. package/dist/ts/ts/JsonIO/Data.js +49 -0
  285. package/dist/ts/ts/JsonIO/DataFile.d.ts +9 -0
  286. package/dist/ts/ts/JsonIO/DataFile.d.ts.map +1 -0
  287. package/dist/ts/ts/JsonIO/DataFile.js +48 -0
  288. package/dist/ts/ts/JsonIO/LDObject.d.ts +6 -0
  289. package/dist/ts/ts/JsonIO/LDObject.d.ts.map +1 -1
  290. package/dist/ts/ts/JsonIO/LDObject.js +173 -17
  291. package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts +15 -0
  292. package/dist/ts/ts/JsonIO/OntologySourceReference.d.ts.map +1 -0
  293. package/dist/ts/ts/JsonIO/OntologySourceReference.js +67 -0
  294. package/dist/ts/ts/JsonIO/Publication.d.ts +15 -0
  295. package/dist/ts/ts/JsonIO/Publication.d.ts.map +1 -0
  296. package/dist/ts/ts/JsonIO/Publication.js +68 -0
  297. package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts +9 -0
  298. package/dist/ts/ts/JsonIO/Table/ArcTable.d.ts.map +1 -0
  299. package/dist/ts/ts/JsonIO/Table/ArcTable.js +74 -0
  300. package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts +6 -0
  301. package/dist/ts/ts/JsonIO/Table/CompositeCell.d.ts.map +1 -0
  302. package/dist/ts/ts/JsonIO/Table/CompositeCell.js +29 -0
  303. package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts +6 -0
  304. package/dist/ts/ts/JsonIO/Table/CompositeHeader.d.ts.map +1 -0
  305. package/dist/ts/ts/JsonIO/Table/CompositeHeader.js +29 -0
  306. package/dist/ts/ts/JsonIO/Table/IOType.d.ts +6 -0
  307. package/dist/ts/ts/JsonIO/Table/IOType.d.ts.map +1 -0
  308. package/dist/ts/ts/JsonIO/Table/IOType.js +29 -0
  309. package/dist/ts/ts/License.d.ts.map +1 -1
  310. package/dist/ts/ts/License.js +6 -6
  311. package/dist/ts/ts/ROCrate/LDContext.d.ts.map +1 -1
  312. package/dist/ts/ts/ROCrate/LDContext.js +31 -39
  313. package/dist/ts/ts/ROCrate/LDObject.d.ts.map +1 -1
  314. package/dist/ts/ts/ROCrate/LDObject.js +56 -49
  315. package/dist/ts/ts/ROCrate/LDTypes/Comment.js +2 -2
  316. package/dist/ts/ts/ROCrate/LDTypes/ComputationalWorkflow.js +3 -3
  317. package/dist/ts/ts/ROCrate/LDTypes/ComputerLanguage.js +2 -2
  318. package/dist/ts/ts/ROCrate/LDTypes/CreateAction.js +5 -5
  319. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts +1 -0
  320. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.d.ts.map +1 -1
  321. package/dist/ts/ts/ROCrate/LDTypes/CreativeWork.js +3 -0
  322. package/dist/ts/ts/ROCrate/LDTypes/Dataset.d.ts.map +1 -1
  323. package/dist/ts/ts/ROCrate/LDTypes/Dataset.js +22 -17
  324. package/dist/ts/ts/ROCrate/LDTypes/DefinedTerm.js +2 -2
  325. package/dist/ts/ts/ROCrate/LDTypes/File.js +5 -5
  326. package/dist/ts/ts/ROCrate/LDTypes/FormalParameter.js +2 -2
  327. package/dist/ts/ts/ROCrate/LDTypes/LabProcess.js +9 -9
  328. package/dist/ts/ts/ROCrate/LDTypes/LabProtocol.js +4 -4
  329. package/dist/ts/ts/ROCrate/LDTypes/Organization.js +1 -1
  330. package/dist/ts/ts/ROCrate/LDTypes/Person.js +7 -7
  331. package/dist/ts/ts/ROCrate/LDTypes/PostalAddress.js +1 -1
  332. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.d.ts +11 -0
  333. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.d.ts.map +1 -1
  334. package/dist/ts/ts/ROCrate/LDTypes/PropertyValue.js +61 -50
  335. package/dist/ts/ts/ROCrate/LDTypes/Sample.js +3 -3
  336. package/dist/ts/ts/ROCrate/LDTypes/ScholarlyArticle.js +4 -4
  337. package/dist/ts/ts/ROCrate/LDTypes/SoftwareSourceCode.js +3 -3
  338. package/dist/ts/ts/ROCrate/LDTypes/WorkflowInvocation.js +3 -3
  339. package/dist/ts/ts/ROCrate/LDTypes/WorkflowProtocol.js +2 -2
  340. package/dist/ts/ts/ROCrateIO.d.ts +18 -4
  341. package/dist/ts/ts/ROCrateIO.d.ts.map +1 -1
  342. package/dist/ts/ts/ROCrateIO.js +49 -38
  343. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
  344. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.js +9 -10
  345. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.d.ts.map +1 -1
  346. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.js +7 -7
  347. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
  348. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +6 -8
  349. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeHeader.js +20 -20
  350. package/dist/ts/ts/Spreadsheet/ArcAssay.d.ts.map +1 -1
  351. package/dist/ts/ts/Spreadsheet/ArcAssay.js +7 -7
  352. package/dist/ts/ts/Spreadsheet/ArcInvestigation.js +8 -8
  353. package/dist/ts/ts/Spreadsheet/ArcRun.d.ts.map +1 -1
  354. package/dist/ts/ts/Spreadsheet/ArcRun.js +5 -6
  355. package/dist/ts/ts/Spreadsheet/ArcStudy.d.ts.map +1 -1
  356. package/dist/ts/ts/Spreadsheet/ArcStudy.js +3 -3
  357. package/dist/ts/ts/Spreadsheet/ArcWorkflow.d.ts.map +1 -1
  358. package/dist/ts/ts/Spreadsheet/ArcWorkflow.js +5 -6
  359. package/dist/ts/ts/Spreadsheet/CollectionAux.d.ts.map +1 -1
  360. package/dist/ts/ts/Spreadsheet/CollectionAux.js +10 -14
  361. package/dist/ts/ts/Spreadsheet/Datamap.js +1 -2
  362. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapColumn.js +3 -3
  363. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapHeader.js +10 -10
  364. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.d.ts.map +1 -1
  365. package/dist/ts/ts/Spreadsheet/DatamapTable/DatamapTable.js +9 -10
  366. package/dist/ts/ts/Spreadsheet/Metadata/Assays.d.ts.map +1 -1
  367. package/dist/ts/ts/Spreadsheet/Metadata/Assays.js +6 -6
  368. package/dist/ts/ts/Spreadsheet/Metadata/Comment.d.ts.map +1 -1
  369. package/dist/ts/ts/Spreadsheet/Metadata/Comment.js +5 -5
  370. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.d.ts.map +1 -1
  371. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.js +2 -2
  372. package/dist/ts/ts/Spreadsheet/Metadata/Factors.d.ts.map +1 -1
  373. package/dist/ts/ts/Spreadsheet/Metadata/Factors.js +4 -4
  374. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.d.ts.map +1 -1
  375. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.js +3 -3
  376. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.d.ts.map +1 -1
  377. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.js +5 -5
  378. package/dist/ts/ts/Spreadsheet/Metadata/Publication.d.ts.map +1 -1
  379. package/dist/ts/ts/Spreadsheet/Metadata/Publication.js +4 -4
  380. package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts +1 -1
  381. package/dist/ts/ts/Spreadsheet/Metadata/Run.d.ts.map +1 -1
  382. package/dist/ts/ts/Spreadsheet/Metadata/Run.js +7 -7
  383. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
  384. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.js +17 -17
  385. package/dist/ts/ts/Spreadsheet/Metadata/Study.d.ts.map +1 -1
  386. package/dist/ts/ts/Spreadsheet/Metadata/Study.js +8 -8
  387. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.d.ts.map +1 -1
  388. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.js +5 -5
  389. package/dist/ts/ts/WorkflowGraph/Adapters.d.ts +1 -1
  390. package/dist/ts/ts/WorkflowGraph/Adapters.d.ts.map +1 -1
  391. package/dist/ts/ts/WorkflowGraph/Adapters.js +5 -6
  392. package/dist/ts/ts/WorkflowGraph/Builder.d.ts +25 -6
  393. package/dist/ts/ts/WorkflowGraph/Builder.d.ts.map +1 -1
  394. package/dist/ts/ts/WorkflowGraph/Builder.js +264 -138
  395. package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts +6 -0
  396. package/dist/ts/ts/WorkflowGraph/GraphTypes.d.ts.map +1 -1
  397. package/dist/ts/ts/WorkflowGraph/GraphTypes.js +4 -1
  398. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts +8 -5
  399. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
  400. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +27 -10
  401. package/dist/ts/ts/Xlsx.js +3 -3
  402. package/dist/ts/ts/Yaml/ValidationPackage.d.ts +3 -3
  403. package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
  404. package/dist/ts/ts/Yaml/ValidationPackage.js +11 -23
  405. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +3 -3
  406. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
  407. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +11 -23
  408. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/DynamicObj.fs.js +16 -20
  409. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/FableJS.fs.js +1 -1
  410. package/dist/ts/ts/fable_modules/DynamicObj.8.0.0/ReflectionUtils.fs.js +8 -8
  411. package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +1 -2
  412. package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.6.0/Http.fs.js +4 -4
  413. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCell.fs.js +8 -8
  414. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Cells/FsCellsCollection.fs.js +18 -18
  415. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsAddress.fs.js +3 -3
  416. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorkbook.fs.js +1 -1
  417. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/FsWorksheet.fs.js +7 -7
  418. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Value.fs.js +3 -5
  419. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Json/Worksheet.fs.js +7 -7
  420. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Ranges/FsRangeBase.fs.js +1 -2
  421. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.1/Tables/FsTable.fs.js +7 -7
  422. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Cell.fs.js +2 -2
  423. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.1/Table.fs.js +1 -2
  424. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Decode.fs.js +49 -71
  425. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.9.1/Encode.fs.js +1 -1
  426. package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs.js +1 -2
  427. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Compare.fs.js +857 -0
  428. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/CoreSchema.fs.js +725 -0
  429. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Decode.fs.js +1175 -0
  430. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Encode.fs.js +123 -0
  431. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Layout.fs.js +282 -0
  432. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexeme.fs.js +203 -0
  433. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Lexer.fs.js +1502 -0
  434. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Model.fs.js +564 -0
  435. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Node.fs.js +453 -0
  436. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Parser.fs.js +2622 -0
  437. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Reader.fs.js +108 -0
  438. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Source.fs.js +649 -0
  439. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Tag.fs.js +32 -0
  440. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Validate.fs.js +1084 -0
  441. package/dist/ts/ts/fable_modules/YAMLicious.2.0.0/Writer.fs.js +2927 -0
  442. package/package.json +5 -4
  443. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Decode.fs.js +0 -1669
  444. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Encode.fs.js +0 -57
  445. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Escapes.fs.js +0 -320
  446. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Interop/JsInterop.fs.js +0 -10
  447. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Persil.fs.js +0 -414
  448. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Preprocessing.fs.js +0 -319
  449. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Reader.fs.js +0 -1884
  450. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Regex.fs.js +0 -23
  451. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/RegexActivePatterns.fs.js +0 -313
  452. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Syntax.fs.js +0 -840
  453. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/Writer.fs.js +0 -689
  454. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0/YAMLiciousTypes.fs.js +0 -359
@@ -1,72 +1,126 @@
1
+ import { toList, isEmpty as isEmpty$1, choose, fold, map as map$1, toArray as toArray$1, delay, append as append$1, singleton as singleton$1, empty as empty$2, collect } from '../../node_modules/@fable-org/fable-library-ts/Seq.js';
2
+ import { InputArraySchema, RawYaml, ListEntry$1, FileInstance, DirectoryInstance, CWLType_Array$, CWLType, InputRecordField, InputRecordSchema, InputEnumSchema, SchemaSaladString, DirentInstance, SoftwarePackage } from './CWLTypes.js';
3
+ import { isEmpty, head, tail, map, empty, forAll, singleton, cons, length, append, choose as choose$1, ofSeq, ofArray, partition, exists, mapIndexed, reverse, skipWhile, filter, contains, tryFind, toArray as toArray$2, last, take, concat } from '../../node_modules/@fable-org/fable-library-ts/List.js';
4
+ import { toArray, value, defaultArg } from '../../node_modules/@fable-org/fable-library-ts/Option.js';
1
5
  import { FSharpChoice$2_Choice1Of2, FSharpChoice$2_Choice2Of2 } from '../../node_modules/@fable-org/fable-library-ts/Choice.js';
2
- import { FileInstance, DirectoryInstance, DirentInstance, InputRecordField, InputRecordSchema, InputEnumSchema, InputArraySchema, SchemaDefRequirementType, SoftwarePackage } from './CWLTypes.js';
3
- import { value, defaultArg, toArray } from '../../node_modules/@fable-org/fable-library-ts/Option.js';
4
- import { toList, choose, fold, map as map$1, delay, append as append$1, singleton as singleton$1, empty as empty$2 } from '../../node_modules/@fable-org/fable-library-ts/Seq.js';
5
- import { isEmpty, head, tail, map, append, singleton, ofArray, empty as empty$1, ofSeq, length, choose as choose$1, filter, contains as contains$1, tryFind, reverse, cons } from '../../node_modules/@fable-org/fable-library-ts/List.js';
6
- import { YAMLElement_Value, YAMLContent_create_Z1C3A29C9, YAMLElement_Object$, YAMLElement_Mapping, YAMLElement, YAMLElement_Sequence, ScalarStyle_Block, BlockScalarStyle, ChompingMode, ScalarStyle, Config } from '../fable_modules/YAMLicious.1.0.0/YAMLiciousTypes.fs.js';
7
- import { equals, defaultOf, int64ToString, isIterable, comparePrimitives, curry2, stringHash } from '../../node_modules/@fable-org/fable-library-ts/Util.js';
8
- import { string, int } from '../fable_modules/YAMLicious.1.0.0/Encode.fs.js';
9
- import { DynamicObj } from '../fable_modules/DynamicObj.8.0.0/DynamicObj.fs.js';
10
6
  import { dynamicPropertiesExcept } from './DynamicObjHelpers.js';
11
- import { empty, ofSeq as ofSeq$1, contains, ofList, FSharpSet__Contains } from '../../node_modules/@fable-org/fable-library-ts/Set.js';
12
- import { trimEnd, replace, interpolate, trimStart, join, split, concat } from '../../node_modules/@fable-org/fable-library-ts/String.js';
13
- import { Operators_IsNull } from '../../node_modules/@fable-org/fable-library-ts/FSharp.Core.js';
14
- import { LoadListingEnum_get_toCwlString, InlineJavascriptRequirementValue, InplaceUpdateRequirementValue, NetworkAccessRequirementValue, WorkReuseRequirementValue, ResourceRequirementInstance, EnvironmentDef, LoadListingRequirementValue, DockerRequirement } from './Requirements.js';
7
+ import { YamlNodeModule_scalar, YamlNodeModule_withScalarValue, YamlNodeModule_item, YamlNodeModule_isMissingValue, YamlNodeModule_flowSequence, YamlNodeModule_sequence, YamlNodeModule_flowMapping, YamlNodeModule_entry, YamlNodeModule_mapping } from '../fable_modules/YAMLicious.2.0.0/Node.fs.js';
8
+ import { ScalarStyle_Block, BlockScalarStyle, ChompingMode, ScalarStyle, CollectionStyle, Separation_NewLine, LineBreak, SequenceItem, YamlNode, YamlNodeKind_Mapping, Collection$1, MappingEntry, YamlNode_$reflection, Trivia_$reflection, YamlNodeKind_Sequence, Trivia_BlankLine } from '../fable_modules/YAMLicious.2.0.0/Model.fs.js';
9
+ import { holdsLineBreakCharacter, textNode, normalizeTree, keepAsText } from './ScalarQuoting.js';
10
+ import { join, replace, interpolate } from '../../node_modules/@fable-org/fable-library-ts/String.js';
11
+ import { equals, stringHash, defaultOf, isIterable, comparePrimitives, curry2 } from '../../node_modules/@fable-org/fable-library-ts/Util.js';
12
+ import { Encode_object, Encode_bool, Encode_float, Encode_int, Encode_int64, Encode_string, Encode_nullValue } from '../fable_modules/YAMLicious.2.0.0/Encode.fs.js';
13
+ import { Decode_entryName } from './Decode.js';
14
+ import { List_distinct } from '../../node_modules/@fable-org/fable-library-ts/Seq2.js';
15
+ import { DynamicObj } from '../fable_modules/DynamicObj.8.0.0/DynamicObj.fs.js';
16
+ import { empty as empty$1, FSharpSet__Contains, ofSeq as ofSeq$1, ofList } from '../../node_modules/@fable-org/fable-library-ts/Set.js';
17
+ import { LoadListingEnum, InlineJavascriptRequirementValue, InplaceUpdateRequirementValue, NetworkAccessRequirementValue, WorkReuseRequirementValue, ResourceRequirementInstance, EnvironmentDef, FileOrDirectory_DirectoryItem, FileOrDirectory_FileItem, LoadListingRequirementValue, DockerRequirement } from './Requirements.js';
15
18
  import { OutputBinding, CWLOutput } from './Outputs.js';
16
- import { item } from '../../node_modules/@fable-org/fable-library-ts/Array.js';
17
- import { CWLParameterValueModule_floatToRoundTripString, CWLParameterValueModule_tryInferType } from './ParameterValue.js';
18
19
  import { InputBinding, CWLInput } from './Inputs.js';
19
20
  import { StepInput, StepOutputParameter, WorkflowStep } from './WorkflowSteps.js';
21
+ import { item, iterateIndexed, copy, mapIndexed as mapIndexed$1 } from '../../node_modules/@fable-org/fable-library-ts/Array.js';
20
22
  import { WorkflowStepRunOps_tryGetOperation, WorkflowStepRunOps_tryGetExpressionTool, WorkflowStepRunOps_tryGetWorkflow, WorkflowStepRunOps_tryGetTool } from './CWLProcessingUnit.js';
21
23
  import { CWLToolDescription } from './ToolDescription.js';
22
24
  import { ArgumentException_$ctor_Z721C83C5 } from '../../node_modules/@fable-org/fable-library-ts/System.js';
23
25
  import { CWLWorkflowDescription } from './WorkflowDescription.js';
24
26
  import { CWLExpressionToolDescription } from './ExpressionToolDescription.js';
25
27
  import { CWLOperationDescription } from './OperationDescription.js';
26
- import { write } from '../fable_modules/YAMLicious.1.0.0/Writer.fs.js';
27
- import { CWLParameterReference } from './ParameterReference.js';
28
+ import { Record } from '../../node_modules/@fable-org/fable-library-ts/Types.js';
29
+ import { record_type, bool_type, array_type, int32_type, list_type } from '../../node_modules/@fable-org/fable-library-ts/Reflection.js';
30
+ import { WriterOptionsModule_defaults, Writer_writeNode, Writer_endsWithKeptLines } from '../fable_modules/YAMLicious.2.0.0/Writer.fs.js';
28
31
 
32
+ function $007COptionalOf$007C_$007C(t) {
33
+ if (t.tag === /* Union */
34
+ 21) {
35
+ const matchValue = toList(t.fields[0]);
36
+ let matchResult = void 0, otherType = void 0;
37
+ if (!isEmpty(matchValue)) {
38
+ if (head(matchValue).tag === /* Null */
39
+ 17) {
40
+ if (!isEmpty(tail(matchValue))) {
41
+ if (isEmpty(tail(tail(matchValue)))) {
42
+ matchResult = 0;
43
+ otherType = head(tail(matchValue));
44
+ } else {
45
+ matchResult = 1;
46
+ }
47
+ } else {
48
+ matchResult = 1;
49
+ }
50
+ } else {
51
+ matchResult = 1;
52
+ }
53
+ } else {
54
+ matchResult = 1;
55
+ }
56
+ switch (matchResult) {
57
+ case 0:
58
+ return otherType;
59
+ default:
60
+ return void 0;
61
+ }
62
+ } else {
63
+ return void 0;
64
+ }
65
+ }
29
66
  function $007CPrimitiveType$007CComplexType$007C(t) {
30
67
  switch (t.tag) {
31
68
  case /* Directory */
32
69
  1:
33
70
  return FSharpChoice$2_Choice1Of2("Directory");
34
- case /* Dirent */
35
- 2:
36
- return FSharpChoice$2_Choice1Of2("Dirent");
37
71
  case /* String */
38
- 3:
72
+ 2:
39
73
  return FSharpChoice$2_Choice1Of2("string");
40
74
  case /* Int */
41
- 4:
75
+ 3:
42
76
  return FSharpChoice$2_Choice1Of2("int");
43
77
  case /* Long */
44
- 5:
78
+ 4:
45
79
  return FSharpChoice$2_Choice1Of2("long");
46
80
  case /* Float */
47
- 6:
81
+ 5:
48
82
  return FSharpChoice$2_Choice1Of2("float");
49
83
  case /* Double */
50
- 7:
84
+ 6:
51
85
  return FSharpChoice$2_Choice1Of2("double");
52
86
  case /* Boolean */
53
- 8:
87
+ 7:
54
88
  return FSharpChoice$2_Choice1Of2("boolean");
89
+ case /* Any */
90
+ 8:
91
+ return FSharpChoice$2_Choice1Of2("Any");
92
+ case /* Reference */
93
+ 12:
94
+ return FSharpChoice$2_Choice1Of2(t.fields[0]);
55
95
  case /* Null */
56
- 10:
96
+ 17:
57
97
  return FSharpChoice$2_Choice1Of2("null");
58
98
  case /* Stdout */
59
99
  9:
60
100
  return FSharpChoice$2_Choice1Of2("stdout");
101
+ case /* Stderr */
102
+ 10:
103
+ return FSharpChoice$2_Choice1Of2("stderr");
104
+ case /* Stdin */
105
+ 11:
106
+ return FSharpChoice$2_Choice1Of2("stdin");
61
107
  case /* Record */
62
- 12:
108
+ 19:
63
109
  case /* Enum */
64
- 13:
110
+ 20:
65
111
  case /* Union */
112
+ 21:
113
+ case /* ImportedType */
114
+ 13:
115
+ case /* IncludedType */
66
116
  14:
117
+ case /* MixedType */
118
+ 15:
119
+ case /* RawType */
120
+ 16:
67
121
  return FSharpChoice$2_Choice2Of2(void 0);
68
122
  case /* Array */
69
- 11: {
123
+ 18: {
70
124
  const arraySchema = t.fields[0];
71
125
  const matchValue = arraySchema.Items;
72
126
  if ($007CPrimitiveType$007CComplexType$007C(matchValue).tag === /* Choice2Of2 */
@@ -80,8 +134,15 @@ function $007CPrimitiveType$007CComplexType$007C(t) {
80
134
  return FSharpChoice$2_Choice1Of2("File");
81
135
  }
82
136
  }
137
+ function isPlainArray(schema) {
138
+ if (schema.Label == null && schema.Doc == null && schema.Name == null) {
139
+ return isEmpty$1(dynamicPropertiesExcept(InputArraySchema.KnownFieldNames, schema));
140
+ } else {
141
+ return false;
142
+ }
143
+ }
83
144
  function tryGetArrayShorthand(cwlType) {
84
- let matchResult = void 0, name_1 = void 0, arraySchema = void 0;
145
+ let matchResult = void 0, name_1 = void 0, arraySchema_2 = void 0;
85
146
  const activePatternResult = $007CPrimitiveType$007CComplexType$007C(cwlType);
86
147
  if (activePatternResult.tag === /* Choice1Of2 */
87
148
  0) {
@@ -89,16 +150,24 @@ function tryGetArrayShorthand(cwlType) {
89
150
  matchResult = 0;
90
151
  name_1 = activePatternResult.fields[0];
91
152
  } else if (cwlType.tag === /* Array */
92
- 11) {
93
- matchResult = 1;
94
- arraySchema = cwlType.fields[0];
153
+ 18) {
154
+ if (isPlainArray(cwlType.fields[0])) {
155
+ matchResult = 1;
156
+ arraySchema_2 = cwlType.fields[0];
157
+ } else {
158
+ matchResult = 2;
159
+ }
95
160
  } else {
96
161
  matchResult = 2;
97
162
  }
98
163
  } else if (cwlType.tag === /* Array */
99
- 11) {
100
- matchResult = 1;
101
- arraySchema = cwlType.fields[0];
164
+ 18) {
165
+ if (isPlainArray(cwlType.fields[0])) {
166
+ matchResult = 1;
167
+ arraySchema_2 = cwlType.fields[0];
168
+ } else {
169
+ matchResult = 2;
170
+ }
102
171
  } else {
103
172
  matchResult = 2;
104
173
  }
@@ -106,9 +175,9 @@ function tryGetArrayShorthand(cwlType) {
106
175
  case 0:
107
176
  return name_1;
108
177
  case 1: {
109
- const option_1 = tryGetArrayShorthand(arraySchema.Items);
178
+ const option_1 = tryGetArrayShorthand(arraySchema_2.Items);
110
179
  if (option_1 != null) {
111
- return value(option_1) + "[]";
180
+ return option_1 + "[]";
112
181
  } else {
113
182
  return void 0;
114
183
  }
@@ -117,126 +186,298 @@ function tryGetArrayShorthand(cwlType) {
117
186
  return void 0;
118
187
  }
119
188
  }
189
+ function tryGetDocumentArrayShorthand(schema) {
190
+ const matchValue = schema.Items;
191
+ let matchResult = void 0, name_1 = void 0;
192
+ const activePatternResult = $007CPrimitiveType$007CComplexType$007C(matchValue);
193
+ if (activePatternResult.tag === /* Choice1Of2 */
194
+ 0) {
195
+ if (activePatternResult.fields[0] !== "array" && isPlainArray(schema)) {
196
+ matchResult = 0;
197
+ name_1 = activePatternResult.fields[0];
198
+ } else {
199
+ matchResult = 1;
200
+ }
201
+ } else {
202
+ matchResult = 1;
203
+ }
204
+ switch (matchResult) {
205
+ case 0:
206
+ return name_1 + "[]";
207
+ default:
208
+ return void 0;
209
+ }
210
+ }
120
211
  function isComplexType(t_mut) {
121
212
  isComplexType:
122
213
  while (true) {
123
214
  const t = t_mut;
215
+ let matchResult = void 0, otherType = void 0;
124
216
  switch (t.tag) {
125
217
  case /* Record */
126
- 12:
218
+ 19:
127
219
  case /* Enum */
220
+ 20:
221
+ case /* ImportedType */
128
222
  13:
129
- return true;
223
+ case /* IncludedType */
224
+ 14:
225
+ case /* MixedType */
226
+ 15:
227
+ case /* RawType */
228
+ 16: {
229
+ matchResult = 0;
230
+ break;
231
+ }
130
232
  case /* Array */
131
- 11: {
132
- const arraySchema = t.fields[0];
133
- return tryGetArrayShorthand(arraySchema.Items) == null;
233
+ 18: {
234
+ matchResult = 1;
235
+ break;
134
236
  }
135
237
  case /* Union */
136
- 14: {
137
- const typesList = toList(t.fields[0]);
138
- let matchResult = void 0, otherType = void 0;
139
- if (!isEmpty(typesList)) {
140
- if (head(typesList).tag === /* Null */
141
- 10) {
142
- if (!isEmpty(tail(typesList))) {
143
- if (isEmpty(tail(tail(typesList)))) {
144
- matchResult = 0;
145
- otherType = head(tail(typesList));
146
- } else {
147
- matchResult = 1;
148
- }
149
- } else {
150
- matchResult = 1;
151
- }
152
- } else if (!isEmpty(tail(typesList))) {
153
- if (head(tail(typesList)).tag === /* Null */
154
- 10) {
155
- if (isEmpty(tail(tail(typesList)))) {
156
- matchResult = 0;
157
- otherType = head(typesList);
158
- } else {
159
- matchResult = 1;
160
- }
161
- } else {
162
- matchResult = 1;
163
- }
164
- } else {
165
- matchResult = 1;
166
- }
238
+ 21: {
239
+ const activePatternResult = $007COptionalOf$007C_$007C(t);
240
+ if (activePatternResult != null) {
241
+ matchResult = 2;
242
+ otherType = activePatternResult;
167
243
  } else {
168
- matchResult = 1;
244
+ matchResult = 3;
169
245
  }
170
- switch (matchResult) {
171
- case 0: {
172
- t_mut = otherType;
173
- continue isComplexType;
174
- }
175
- default:
176
- return true;
246
+ break;
247
+ }
248
+ default: {
249
+ const activePatternResult_1 = $007COptionalOf$007C_$007C(t);
250
+ if (activePatternResult_1 != null) {
251
+ matchResult = 2;
252
+ otherType = activePatternResult_1;
253
+ } else {
254
+ matchResult = 4;
177
255
  }
178
256
  }
257
+ }
258
+ switch (matchResult) {
259
+ case 0:
260
+ return true;
261
+ case 1:
262
+ return tryGetArrayShorthand(t) == null;
263
+ case 2: {
264
+ t_mut = otherType;
265
+ continue isComplexType;
266
+ }
267
+ case 3:
268
+ return true;
179
269
  default:
180
270
  return false;
181
271
  }
182
272
  break;
183
273
  }
184
274
  }
185
- function yBool(b) {
186
- return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(b ? "true" : "false"));
275
+ function literalBlock(value) {
276
+ return YamlNodeModule_scalar(ScalarStyle_Block(BlockScalarStyle.Literal, ChompingMode.Strip, void 0), value);
187
277
  }
188
- function yFloat(value) {
189
- return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(value.toString()));
278
+ function multiLineScalar(value) {
279
+ if (holdsLineBreakCharacter(value)) {
280
+ return YamlNodeModule_scalar(ScalarStyle.DoubleQuoted, value);
281
+ } else {
282
+ return literalBlock(value);
283
+ }
284
+ }
285
+ function encodeString(value) {
286
+ if (value.indexOf("\n") >= 0) {
287
+ return multiLineScalar(value);
288
+ } else {
289
+ return textNode(value);
290
+ }
190
291
  }
191
- function yMap(pairs) {
192
- return YAMLElement_Object$(map((tupledArg) => {
193
- let _arg = void 0, single = void 0;
194
- return YAMLElement_Mapping(YAMLContent_create_Z1C3A29C9(tupledArg[0]), (_arg = tupledArg[1], _arg.tag === /* Object */
195
- 3 ? !isEmpty(_arg.fields[0]) ? head(_arg.fields[0]).tag === /* Value */
196
- 1 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : head(_arg.fields[0]).tag === /* Alias */
197
- 7 ? isEmpty(tail(_arg.fields[0])) ? _arg : _arg : isEmpty(tail(_arg.fields[0])) ? (single = head(_arg.fields[0]), single) : _arg : _arg : _arg));
198
- }, pairs));
292
+ function encodeSourceText(source, text) {
293
+ if (source == null) {
294
+ return encodeString(text);
295
+ } else {
296
+ const node = source;
297
+ const matchValue = node.Kind;
298
+ switch (matchValue.tag) {
299
+ case /* Scalar */
300
+ 0:
301
+ return keepAsText(YamlNodeModule_withScalarValue(text, node));
302
+ case /* Sequence */
303
+ 2:
304
+ if (join("", map((item) => {
305
+ const matchValue_1 = item.Node.Kind;
306
+ if (matchValue_1.tag === /* Scalar */
307
+ 0) {
308
+ return matchValue_1.fields[0].Value;
309
+ } else {
310
+ return "";
311
+ }
312
+ }, matchValue.fields[0].Items)) === text) {
313
+ return normalizeTree(node);
314
+ } else {
315
+ return encodeString(text);
316
+ }
317
+ default:
318
+ return encodeString(text);
319
+ }
320
+ }
321
+ }
322
+ function startsWithTrivia(node) {
323
+ if (node.Properties.Tag != null ? true : node.Properties.Anchor != null) {
324
+ return false;
325
+ } else {
326
+ const matchValue = node.Kind;
327
+ let matchResult = void 0, collection_2 = void 0, collection_3 = void 0;
328
+ switch (matchValue.tag) {
329
+ case /* Mapping */
330
+ 1: {
331
+ if (equals(matchValue.fields[0].Style, CollectionStyle.Block)) {
332
+ matchResult = 0;
333
+ collection_2 = matchValue.fields[0];
334
+ } else {
335
+ matchResult = 2;
336
+ }
337
+ break;
338
+ }
339
+ case /* Sequence */
340
+ 2: {
341
+ if (equals(matchValue.fields[0].Style, CollectionStyle.Block)) {
342
+ matchResult = 1;
343
+ collection_3 = matchValue.fields[0];
344
+ } else {
345
+ matchResult = 2;
346
+ }
347
+ break;
348
+ }
349
+ default:
350
+ matchResult = 2;
351
+ }
352
+ switch (matchResult) {
353
+ case 0: {
354
+ const matchValue_1 = collection_2.Items;
355
+ if (isEmpty(matchValue_1)) {
356
+ return false;
357
+ } else {
358
+ return !isEmpty(head(matchValue_1).Before);
359
+ }
360
+ }
361
+ case 1: {
362
+ const matchValue_2 = collection_3.Items;
363
+ if (isEmpty(matchValue_2)) {
364
+ return false;
365
+ } else {
366
+ return !isEmpty(head(matchValue_2).Before);
367
+ }
368
+ }
369
+ default:
370
+ return false;
371
+ }
372
+ }
373
+ }
374
+ const lineBreakDash = Separation_NewLine(new LineBreak(void 0, empty()));
375
+ function blockItem(node) {
376
+ const item = YamlNodeModule_item(node);
377
+ if (startsWithTrivia(node)) {
378
+ return new SequenceItem(item.Before, lineBreakDash, item.Node, item.Span);
379
+ } else {
380
+ return item;
381
+ }
382
+ }
383
+ function encodeSequence(items) {
384
+ if (forAll((node) => {
385
+ const matchValue = node.Kind;
386
+ if (matchValue.tag === /* Scalar */
387
+ 0) {
388
+ const scalar = matchValue.fields[0];
389
+ if (scalar.Style.tag === /* Block */
390
+ 3) {
391
+ return false;
392
+ } else if (!(scalar.Value.indexOf("\n") >= 0) && node.TrailingComment == null) {
393
+ return !YamlNodeModule_isMissingValue(node);
394
+ } else {
395
+ return false;
396
+ }
397
+ } else {
398
+ return false;
399
+ }
400
+ }, items)) {
401
+ return YamlNodeModule_flowSequence(map(YamlNodeModule_item, items));
402
+ } else {
403
+ return YamlNodeModule_sequence(map(blockItem, items));
404
+ }
405
+ }
406
+ function encodeObject(pairs) {
407
+ const node = Encode_object(pairs);
408
+ const matchValue = node.Kind;
409
+ if (matchValue.tag === /* Mapping */
410
+ 1) {
411
+ const collection = matchValue.fields[0];
412
+ return new YamlNode(YamlNodeKind_Mapping(new Collection$1(collection.Style, collection.OpeningComment, map((entry) => new MappingEntry(entry.Before, entry.Question, keepAsText(entry.Key), entry.BeforeColon, entry.Colon, entry.Value, entry.Span), collection.Items), collection.End)), node.Properties, node.PropertyLayout, node.TrailingComment, node.Span);
413
+ } else {
414
+ return node;
415
+ }
416
+ }
417
+ function idObject(idKey, valueKey, id, node) {
418
+ let fields;
419
+ const matchValue = node.Kind;
420
+ fields = matchValue.tag === /* Mapping */
421
+ 1 ? map((entry) => [Decode_entryName(entry), entry.Value], matchValue.fields[0].Items) : singleton([valueKey, node]);
422
+ return encodeObject(cons([idKey, textNode(id)], fields));
423
+ }
424
+ function encodeIdMapOrList(idKey, valueKey, entries) {
425
+ const ids = map((tuple) => tuple[0], entries);
426
+ if (length(List_distinct(ids, {
427
+ Equals: (x, y) => x === y,
428
+ GetHashCode: (x) => stringHash(x) | 0
429
+ })) === length(ids)) {
430
+ return encodeObject(entries);
431
+ } else {
432
+ return encodeSequence(map((tupledArg) => idObject(idKey, valueKey, tupledArg[0], tupledArg[1]), entries));
433
+ }
434
+ }
435
+ function rawYamlNode(raw) {
436
+ return normalizeTree(raw.Node);
199
437
  }
200
438
  function encodeDynamicValue(value) {
201
439
  if (equals(value, defaultOf())) {
202
440
  return void 0;
203
441
  } else if (typeof value === "string") {
204
442
  const s = value;
205
- return string(s);
443
+ return encodeString(s);
206
444
  } else if (typeof value === "boolean") {
207
445
  const b = value;
208
- return yBool(b);
446
+ return Encode_bool(b);
209
447
  } else if (typeof value === "number") {
210
448
  const f = value;
211
- return yFloat(f);
449
+ return Encode_float(f);
212
450
  } else if (typeof value === "number") {
213
451
  const i = value | 0;
214
- return int(i);
452
+ return Encode_int(i);
215
453
  } else if (typeof value === "bigint") {
216
454
  const i_1 = value;
217
- return string(int64ToString(i_1));
218
- } else if (value instanceof YAMLElement) {
455
+ return Encode_int64(i_1);
456
+ } else if (value instanceof RawYaml) {
457
+ const raw = value;
458
+ return rawYamlNode(raw);
459
+ } else if (value instanceof YamlNode) {
219
460
  const y = value;
220
- return y;
461
+ return normalizeTree(y);
221
462
  } else if (value instanceof DynamicObj) {
222
463
  const dynObj = value;
223
464
  return encodeDynamicObj(dynObj);
224
465
  } else if (isIterable(value)) {
225
466
  const values = value;
226
- return YAMLElement_Sequence(toList(choose(encodeDynamicValue, values)));
467
+ return encodeSequence(toList(choose(encodeDynamicValue, values)));
227
468
  } else {
228
469
  return void 0;
229
470
  }
230
471
  }
231
472
  function encodeDynamicObj(dynObj) {
232
- return yMap(toList(choose((kvp) => {
473
+ return encodeObject(toList(choose((kvp) => {
233
474
  const option_1 = encodeDynamicValue(kvp[1]);
234
475
  if (option_1 != null) {
235
- return [kvp[0], value(option_1)];
476
+ return [kvp[0], option_1];
236
477
  } else {
237
478
  return void 0;
238
479
  }
239
- }, dynamicPropertiesExcept(empty({
480
+ }, dynamicPropertiesExcept(empty$1({
240
481
  Compare: (x, y) => comparePrimitives(x, y) | 0
241
482
  }), dynObj))));
242
483
  }
@@ -244,62 +485,276 @@ function appendDynamicPropertiesExcept(knownFieldNames, dynObj, acc) {
244
485
  return fold((pairs, pair) => append(pairs, singleton(pair)), acc, choose((kvp) => {
245
486
  const option_1 = encodeDynamicValue(kvp[1]);
246
487
  if (option_1 != null) {
247
- return [kvp[0], value(option_1)];
488
+ return [kvp[0], option_1];
248
489
  } else {
249
490
  return void 0;
250
491
  }
251
492
  }, dynamicPropertiesExcept(knownFieldNames, dynObj)));
252
493
  }
253
494
  function appendDynamicProperties(dynObj, acc) {
254
- return appendDynamicPropertiesExcept(empty({
495
+ return appendDynamicPropertiesExcept(empty$1({
255
496
  Compare: (x, y) => comparePrimitives(x, y) | 0
256
497
  }), dynObj, acc);
257
498
  }
258
499
  function normalizeDocString(doc) {
259
- return trimEnd(trimEnd(replace(doc, "\r\n", "\n"), "\n"), "\r");
500
+ return replace(doc, "\r\n", "\n");
260
501
  }
261
502
  function encodeExpressionScalar(expression) {
262
- const normalized = Operators_IsNull(expression) ? "" : replace(replace(expression, "\r\n", "\n"), "\r", "\n");
263
- return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(normalized, void 0, void 0, void 0, normalized.indexOf("\n") >= 0 ? ScalarStyle_Block(BlockScalarStyle.Literal, ChompingMode.Clip, void 0) : ScalarStyle.DoubleQuoted));
503
+ const normalized = expression == null ? "" : replace(replace(expression, "\r\n", "\n"), "\r", "\n");
504
+ if (normalized.indexOf("\n") >= 0) {
505
+ return multiLineScalar(normalized);
506
+ } else {
507
+ return YamlNodeModule_scalar(ScalarStyle.DoubleQuoted, normalized);
508
+ }
264
509
  }
265
- function encodeSchemaSaladString(value) {
510
+ function directive(key, path) {
511
+ return YamlNodeModule_flowMapping(singleton(YamlNodeModule_entry(Encode_string(key), encodeString(path))));
512
+ }
513
+ function encodeListEntry(encodeValue, entry) {
514
+ switch (entry.tag) {
515
+ case /* Imported */
516
+ 1:
517
+ return directive("$import", entry.fields[0]);
518
+ case /* Mixed */
519
+ 2:
520
+ return entry.fields[0].Node;
521
+ default:
522
+ return encodeValue(entry.fields[0]);
523
+ }
524
+ }
525
+ function encodeIdEntries(idKey, valueKey, whole, entries) {
526
+ let matchResult = void 0, path = void 0;
527
+ if (whole) {
528
+ if (!isEmpty(entries)) {
529
+ if (head(entries).tag === /* Imported */
530
+ 1) {
531
+ if (isEmpty(tail(entries))) {
532
+ matchResult = 0;
533
+ path = head(entries).fields[0];
534
+ } else {
535
+ matchResult = 1;
536
+ }
537
+ } else {
538
+ matchResult = 1;
539
+ }
540
+ } else {
541
+ matchResult = 1;
542
+ }
543
+ } else {
544
+ matchResult = 1;
545
+ }
546
+ switch (matchResult) {
547
+ case 0:
548
+ return directive("$import", path);
549
+ default: {
550
+ const named = choose$1((entry) => ListEntry$1.tryValue(entry), entries);
551
+ if (length(named) === length(entries)) {
552
+ return encodeIdMapOrList(idKey, valueKey, named);
553
+ } else {
554
+ return encodeSequence(map((entry_1) => encodeListEntry((tupledArg) => idObject(idKey, valueKey, tupledArg[0], tupledArg[1]), entry_1), entries));
555
+ }
556
+ }
557
+ }
558
+ }
559
+ function encodeSchemaSaladStringWith(encodeLiteral, value) {
266
560
  switch (value.tag) {
267
561
  case /* Include */
268
562
  1:
269
- return yMap(singleton(["$include", string(value.fields[0])]));
563
+ return directive("$include", value.fields[0]);
270
564
  case /* Import */
271
565
  2:
272
- return yMap(singleton(["$import", string(value.fields[0])]));
566
+ return directive("$import", value.fields[0]);
567
+ case /* Mixin */
568
+ 3:
569
+ return directive("$mixin", value.fields[0]);
570
+ case /* Mixed */
571
+ 4:
572
+ return value.fields[0].Node;
273
573
  default:
274
- return string(value.fields[0]);
574
+ return encodeLiteral(value.fields[0]);
275
575
  }
276
576
  }
277
- function normalizeEnvValueForEncode(envValue) {
278
- if (envValue === "true" ? true : envValue === "false") {
279
- return '"' + envValue + '"';
280
- } else {
281
- return envValue;
577
+ function encodeSchemaSaladString(value) {
578
+ return encodeSchemaSaladStringWith(encodeString, value);
579
+ }
580
+ function encodeSchemaSaladBool(value) {
581
+ switch (value.tag) {
582
+ case /* Imported */
583
+ 1:
584
+ return directive("$import", value.fields[0]);
585
+ case /* Mixed */
586
+ 2:
587
+ return value.fields[0].Node;
588
+ default:
589
+ return Encode_bool(value.fields[0]);
282
590
  }
283
591
  }
284
- function encodeEnvVarRequirementCompactMap(envs) {
285
- const envDefMap = yMap(toList(map$1((env) => [env.EnvName, string(normalizeEnvValueForEncode(env.EnvValue))], envs)));
286
- return yMap(ofArray([["class", string("EnvVarRequirement")], ["envDef", envDefMap]]));
592
+ function encodeFileSize(size) {
593
+ switch (size.tag) {
594
+ case /* Imported */
595
+ 1:
596
+ return directive("$import", size.fields[0]);
597
+ case /* Mixed */
598
+ 2:
599
+ return size.fields[0].Node;
600
+ default:
601
+ return Encode_int64(size.fields[0]);
602
+ }
287
603
  }
288
- function encodeSoftwareRequirementCompactMap(packages) {
289
- const packagesMap = yMap(toList(map$1((package$_1) => {
290
- let package$ = void 0, matchValue = void 0, matchValue_1 = void 0, acc_2 = void 0, value_3 = void 0, acc_1 = void 0, value_6 = void 0, acc_3 = void 0;
291
- return [package$_1.Package, (package$ = package$_1, matchValue = package$.Version, matchValue_1 = package$.Specs, matchValue == null ? matchValue_1 != null ? YAMLElement_Sequence(toList(map$1(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$1(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$1(string, value(value_6))))])))))];
292
- }, packages)));
293
- return yMap(ofArray([["class", string("SoftwareRequirement")], ["packages", packagesMap]]));
604
+ function encodeLoadListing(value) {
605
+ switch (value.tag) {
606
+ case /* IncludedLoadListing */
607
+ 4:
608
+ return directive("$include", value.fields[0]);
609
+ case /* MixedLoadListing */
610
+ 5:
611
+ return value.fields[0].Node;
612
+ case /* NoListing */
613
+ 0:
614
+ case /* ShallowListing */
615
+ 1:
616
+ case /* DeepListing */
617
+ 2:
618
+ return encodeString(LoadListingEnum.toCwlString(value));
619
+ default:
620
+ return directive("$import", value.fields[0]);
621
+ }
622
+ }
623
+ function encodeStringList(whole, entries) {
624
+ const matchValue = toList(entries);
625
+ let matchResult = void 0, single = void 0;
626
+ if (whole) {
627
+ if (!isEmpty(matchValue)) {
628
+ switch (head(matchValue).tag) {
629
+ case /* Import */
630
+ 2: {
631
+ if (isEmpty(tail(matchValue))) {
632
+ matchResult = 0;
633
+ single = head(matchValue);
634
+ } else {
635
+ matchResult = 1;
636
+ }
637
+ break;
638
+ }
639
+ case /* Mixin */
640
+ 3: {
641
+ if (isEmpty(tail(matchValue))) {
642
+ matchResult = 0;
643
+ single = head(matchValue);
644
+ } else {
645
+ matchResult = 1;
646
+ }
647
+ break;
648
+ }
649
+ case /* Mixed */
650
+ 4: {
651
+ if (isEmpty(tail(matchValue))) {
652
+ matchResult = 0;
653
+ single = head(matchValue);
654
+ } else {
655
+ matchResult = 1;
656
+ }
657
+ break;
658
+ }
659
+ default:
660
+ matchResult = 1;
661
+ }
662
+ } else {
663
+ matchResult = 1;
664
+ }
665
+ } else {
666
+ matchResult = 1;
667
+ }
668
+ switch (matchResult) {
669
+ case 0:
670
+ return encodeSchemaSaladString(single);
671
+ default:
672
+ return encodeSequence(ofSeq(map$1(encodeSchemaSaladString, entries)));
673
+ }
674
+ }
675
+ function encodeLabelValue(source, label) {
676
+ if (label.tag === /* Literal */
677
+ 0) {
678
+ return encodeSourceText(source, label.fields[0]);
679
+ } else {
680
+ return encodeSchemaSaladString(label);
681
+ }
294
682
  }
295
683
  function encodeLabel(label) {
296
- return ["label", string(label)];
684
+ return ["label", encodeLabelValue(void 0, label)];
685
+ }
686
+ function encodeDocText(source, doc) {
687
+ return encodeSourceText(source, normalizeDocString(doc));
688
+ }
689
+ function encodeDocWith(encodeText, source, doc) {
690
+ if (doc.tag === /* Parts */
691
+ 1) {
692
+ const parts = doc.fields[0];
693
+ return encodeSequence(ofSeq(map$1(encodeSchemaSaladString, parts)));
694
+ } else if (doc.fields[0].tag === /* Literal */
695
+ 0) {
696
+ const text = doc.fields[0].fields[0];
697
+ return encodeText(source, text);
698
+ } else {
699
+ const directive_1 = doc.fields[0];
700
+ return encodeSchemaSaladString(directive_1);
701
+ }
702
+ }
703
+ function encodeDocValue(source, doc) {
704
+ return encodeDocWith(encodeSourceText, source, doc);
705
+ }
706
+ function encodeProcessDocValue(source, doc) {
707
+ return encodeDocWith(encodeDocText, source, doc);
297
708
  }
298
709
  function encodeDoc(doc) {
299
- return ["doc", string(normalizeDocString(doc))];
710
+ return ["doc", encodeDocValue(void 0, doc)];
711
+ }
712
+ function encodeIntList(whole, codes) {
713
+ const matchValue = toList(codes);
714
+ let matchResult = void 0, path = void 0, raw = void 0;
715
+ if (whole) {
716
+ if (!isEmpty(matchValue)) {
717
+ switch (head(matchValue).tag) {
718
+ case /* Imported */
719
+ 1: {
720
+ if (isEmpty(tail(matchValue))) {
721
+ matchResult = 0;
722
+ path = head(matchValue).fields[0];
723
+ } else {
724
+ matchResult = 2;
725
+ }
726
+ break;
727
+ }
728
+ case /* Mixed */
729
+ 2: {
730
+ if (isEmpty(tail(matchValue))) {
731
+ matchResult = 1;
732
+ raw = head(matchValue).fields[0];
733
+ } else {
734
+ matchResult = 2;
735
+ }
736
+ break;
737
+ }
738
+ default:
739
+ matchResult = 2;
740
+ }
741
+ } else {
742
+ matchResult = 2;
743
+ }
744
+ } else {
745
+ matchResult = 2;
746
+ }
747
+ switch (matchResult) {
748
+ case 0:
749
+ return directive("$import", path);
750
+ case 1:
751
+ return raw.Node;
752
+ default:
753
+ return encodeSequence(ofSeq(map$1((entry) => encodeListEntry(Encode_int, entry), codes)));
754
+ }
300
755
  }
301
- function encodeIntent(intent) {
302
- return ["intent", YAMLElement_Sequence(ofSeq(map$1(string, intent)))];
756
+ function encodeIntent(whole, intent) {
757
+ return ["intent", encodeStringList(whole, intent)];
303
758
  }
304
759
  function encodeFilePairs(discriminatorKey, discriminatorValue, file) {
305
760
  let acc_22;
@@ -313,40 +768,40 @@ function encodeFilePairs(discriminatorKey, discriminatorValue, file) {
313
768
  let acc_6;
314
769
  let acc_4;
315
770
  let acc_2;
316
- const acc = singleton([discriminatorKey, string(discriminatorValue)]);
771
+ const acc = singleton([discriminatorKey, encodeString(discriminatorValue)]);
317
772
  const value_2 = file.Location;
318
773
  const acc_1 = acc;
319
- acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["location", string(value(value_2))]));
774
+ acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["location", encodeSchemaSaladString(value_2)]));
320
775
  const value_5 = file.Path;
321
776
  const acc_3 = acc_2;
322
- acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["path", string(value(value_5))]));
777
+ acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["path", encodeSchemaSaladString(value_5)]));
323
778
  const value_8 = file.Basename;
324
779
  const acc_5 = acc_4;
325
- acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["basename", string(value(value_8))]));
780
+ acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["basename", encodeSchemaSaladString(value_8)]));
326
781
  const value_11 = file.Dirname;
327
782
  const acc_7 = acc_6;
328
- acc_8 = value_11 == null ? acc_7 : append(acc_7, singleton(["dirname", string(value(value_11))]));
783
+ acc_8 = value_11 == null ? acc_7 : append(acc_7, singleton(["dirname", encodeSchemaSaladString(value_11)]));
329
784
  const value_14 = file.Nameroot;
330
785
  const acc_9 = acc_8;
331
- acc_10 = value_14 == null ? acc_9 : append(acc_9, singleton(["nameroot", string(value(value_14))]));
786
+ acc_10 = value_14 == null ? acc_9 : append(acc_9, singleton(["nameroot", encodeSchemaSaladString(value_14)]));
332
787
  const value_17 = file.Nameext;
333
788
  const acc_11 = acc_10;
334
- acc_12 = value_17 == null ? acc_11 : append(acc_11, singleton(["nameext", string(value(value_17))]));
789
+ acc_12 = value_17 == null ? acc_11 : append(acc_11, singleton(["nameext", encodeSchemaSaladString(value_17)]));
335
790
  const value_20 = file.Checksum;
336
791
  const acc_13 = acc_12;
337
- acc_14 = value_20 == null ? acc_13 : append(acc_13, singleton(["checksum", string(value(value_20))]));
792
+ acc_14 = value_20 == null ? acc_13 : append(acc_13, singleton(["checksum", encodeSchemaSaladString(value_20)]));
338
793
  const value_22 = file.Size;
339
794
  const acc_15 = acc_14;
340
- acc_16 = value_22 == null ? acc_15 : append(acc_15, singleton(["size", YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value(value_22))))]));
795
+ acc_16 = value_22 == null ? acc_15 : append(acc_15, singleton(["size", encodeFileSize(value_22)]));
341
796
  const value_24 = file.SecondaryFiles;
342
797
  const acc_17 = acc_16;
343
- acc_18 = value_24 == null ? acc_17 : append(acc_17, singleton(["secondaryFiles", value(value_24)]));
798
+ acc_18 = value_24 == null ? acc_17 : append(acc_17, singleton(["secondaryFiles", rawYamlNode(value_24)]));
344
799
  const value_27 = file.Format;
345
800
  const acc_19 = acc_18;
346
- acc_20 = value_27 == null ? acc_19 : append(acc_19, singleton(["format", string(value(value_27))]));
801
+ acc_20 = value_27 == null ? acc_19 : append(acc_19, singleton(["format", encodeSchemaSaladString(value_27)]));
347
802
  const value_30 = file.Contents;
348
803
  const acc_21 = acc_20;
349
- acc_22 = value_30 == null ? acc_21 : append(acc_21, singleton(["contents", string(value(value_30))]));
804
+ acc_22 = value_30 == null ? acc_21 : append(acc_21, singleton(["contents", encodeSchemaSaladString(value_30)]));
350
805
  return appendDynamicPropertiesExcept(FileInstance.KnownFieldNames, file, acc_22);
351
806
  }
352
807
  function encodeDirectoryPairs(discriminatorKey, discriminatorValue, directory) {
@@ -354,168 +809,287 @@ function encodeDirectoryPairs(discriminatorKey, discriminatorValue, directory) {
354
809
  let acc_6;
355
810
  let acc_4;
356
811
  let acc_2;
357
- const acc = singleton([discriminatorKey, string(discriminatorValue)]);
812
+ const acc = singleton([discriminatorKey, encodeString(discriminatorValue)]);
358
813
  const value_2 = directory.Location;
359
814
  const acc_1 = acc;
360
- acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["location", string(value(value_2))]));
815
+ acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["location", encodeSchemaSaladString(value_2)]));
361
816
  const value_5 = directory.Path;
362
817
  const acc_3 = acc_2;
363
- acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["path", string(value(value_5))]));
818
+ acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["path", encodeSchemaSaladString(value_5)]));
364
819
  const value_8 = directory.Basename;
365
820
  const acc_5 = acc_4;
366
- acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["basename", string(value(value_8))]));
821
+ acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["basename", encodeSchemaSaladString(value_8)]));
367
822
  const value_10 = directory.Listing;
368
823
  const acc_7 = acc_6;
369
- acc_8 = value_10 == null ? acc_7 : append(acc_7, singleton(["listing", value(value_10)]));
824
+ acc_8 = value_10 == null ? acc_7 : append(acc_7, singleton(["listing", rawYamlNode(value_10)]));
370
825
  return appendDynamicPropertiesExcept(DirectoryInstance.KnownFieldNames, directory, acc_8);
371
826
  }
372
827
  function encodeCWLType(t) {
373
- let acc_4 = void 0, acc_2 = void 0, acc = void 0, value_2 = void 0, acc_1 = void 0, value_4 = void 0, acc_3 = void 0;
828
+ return encodeTypeWith(true, t);
829
+ }
830
+ function encodeCWLTypeShorthand(t) {
831
+ return encodeTypeWith(false, t);
832
+ }
833
+ function encodeTypeWith(cwlDocument, t) {
834
+ const arrayShorthand = (schema) => {
835
+ if (cwlDocument) {
836
+ return tryGetDocumentArrayShorthand(schema);
837
+ } else {
838
+ return tryGetArrayShorthand(CWLType_Array$(schema));
839
+ }
840
+ };
841
+ const encodeMember = (t_1) => encodeTypeWith(cwlDocument, t_1);
842
+ let matchResult = void 0, name = void 0, path = void 0, path_1 = void 0, raw = void 0, raw_1 = void 0, otherType = void 0, types = void 0, arraySchema_1 = void 0, recordSchema = void 0, enumSchema = void 0;
374
843
  switch (t.tag) {
375
844
  case /* Directory */
376
- 1:
377
- if (length(encodeDirectoryPairs("type", "Directory", t.fields[0])) > 1) {
378
- const directory_2 = t.fields[0];
379
- return yMap(encodeDirectoryPairs("type", "Directory", directory_2));
380
- } else {
381
- return string("Directory");
382
- }
383
- case /* Dirent */
384
- 2: {
385
- const d = t.fields[0];
386
- 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)));
845
+ 1: {
846
+ matchResult = 1;
847
+ break;
387
848
  }
388
849
  case /* String */
389
- 3:
390
- return string("string");
850
+ 2: {
851
+ matchResult = 2;
852
+ break;
853
+ }
391
854
  case /* Int */
392
- 4:
393
- return string("int");
855
+ 3: {
856
+ matchResult = 3;
857
+ break;
858
+ }
394
859
  case /* Long */
395
- 5:
396
- return string("long");
860
+ 4: {
861
+ matchResult = 4;
862
+ break;
863
+ }
397
864
  case /* Float */
398
- 6:
399
- return string("float");
865
+ 5: {
866
+ matchResult = 5;
867
+ break;
868
+ }
400
869
  case /* Double */
401
- 7:
402
- return string("double");
870
+ 6: {
871
+ matchResult = 6;
872
+ break;
873
+ }
403
874
  case /* Boolean */
404
- 8:
405
- return string("boolean");
875
+ 7: {
876
+ matchResult = 7;
877
+ break;
878
+ }
879
+ case /* Any */
880
+ 8: {
881
+ matchResult = 8;
882
+ break;
883
+ }
884
+ case /* Reference */
885
+ 12: {
886
+ matchResult = 9;
887
+ name = t.fields[0];
888
+ break;
889
+ }
890
+ case /* ImportedType */
891
+ 13: {
892
+ matchResult = 10;
893
+ path = t.fields[0];
894
+ break;
895
+ }
896
+ case /* IncludedType */
897
+ 14: {
898
+ matchResult = 11;
899
+ path_1 = t.fields[0];
900
+ break;
901
+ }
902
+ case /* MixedType */
903
+ 15: {
904
+ matchResult = 12;
905
+ raw = t.fields[0];
906
+ break;
907
+ }
908
+ case /* RawType */
909
+ 16: {
910
+ matchResult = 13;
911
+ raw_1 = t.fields[0];
912
+ break;
913
+ }
406
914
  case /* Stdout */
407
- 9:
408
- return string("stdout");
915
+ 9: {
916
+ matchResult = 14;
917
+ break;
918
+ }
919
+ case /* Stderr */
920
+ 10: {
921
+ matchResult = 15;
922
+ break;
923
+ }
924
+ case /* Stdin */
925
+ 11: {
926
+ matchResult = 16;
927
+ break;
928
+ }
409
929
  case /* Null */
410
- 10:
411
- return string("null");
930
+ 17: {
931
+ matchResult = 17;
932
+ break;
933
+ }
412
934
  case /* Union */
413
- 14: {
414
- const types = t.fields[0];
415
- const typesList = toList(types);
416
- let matchResult = void 0, otherType = void 0;
417
- if (!isEmpty(typesList)) {
418
- if (head(typesList).tag === /* Null */
419
- 10) {
420
- if (!isEmpty(tail(typesList))) {
421
- if (isEmpty(tail(tail(typesList)))) {
422
- matchResult = 0;
423
- otherType = head(tail(typesList));
424
- } else {
425
- matchResult = 1;
426
- }
427
- } else {
428
- matchResult = 1;
429
- }
430
- } else if (!isEmpty(tail(typesList))) {
431
- if (head(tail(typesList)).tag === /* Null */
432
- 10) {
433
- if (isEmpty(tail(tail(typesList)))) {
434
- matchResult = 0;
435
- otherType = head(typesList);
436
- } else {
437
- matchResult = 1;
438
- }
439
- } else {
440
- matchResult = 1;
441
- }
442
- } else {
443
- matchResult = 1;
444
- }
935
+ 21: {
936
+ const activePatternResult = $007COptionalOf$007C_$007C(t);
937
+ if (activePatternResult != null) {
938
+ matchResult = 18;
939
+ otherType = activePatternResult;
445
940
  } else {
446
- matchResult = 1;
447
- }
448
- switch (matchResult) {
449
- case 0:
450
- switch (otherType.tag) {
451
- case /* File */
452
- 0:
453
- return string("File?");
454
- case /* Directory */
455
- 1:
456
- return string("Directory?");
457
- case /* String */
458
- 3:
459
- return string("string?");
460
- case /* Int */
461
- 4:
462
- return string("int?");
463
- case /* Long */
464
- 5:
465
- return string("long?");
466
- case /* Float */
467
- 6:
468
- return string("float?");
469
- case /* Double */
470
- 7:
471
- return string("double?");
472
- case /* Boolean */
473
- 8:
474
- return string("boolean?");
475
- case /* Array */
476
- 11: {
477
- const arraySchema = otherType.fields[0];
478
- const matchValue = tryGetArrayShorthand(arraySchema.Items);
479
- if (matchValue == null) {
480
- return YAMLElement_Sequence(ofArray([string("null"), encodeInputArraySchema(arraySchema)]));
481
- } else {
482
- return string(value(matchValue) + "[]?");
483
- }
484
- }
485
- default:
486
- return YAMLElement_Sequence(map(encodeCWLType, typesList));
487
- }
488
- default:
489
- return YAMLElement_Sequence(map(encodeCWLType, typesList));
941
+ matchResult = 19;
942
+ types = t.fields[0];
490
943
  }
944
+ break;
491
945
  }
492
946
  case /* Array */
493
- 11: {
494
- const arraySchema_1 = t.fields[0];
495
- const matchValue_1 = tryGetArrayShorthand(arraySchema_1.Items);
496
- if (matchValue_1 == null) {
497
- return encodeInputArraySchema(arraySchema_1);
947
+ 18: {
948
+ const activePatternResult_1 = $007COptionalOf$007C_$007C(t);
949
+ if (activePatternResult_1 != null) {
950
+ matchResult = 18;
951
+ otherType = activePatternResult_1;
498
952
  } else {
499
- return string(value(matchValue_1) + "[]");
953
+ matchResult = 20;
954
+ arraySchema_1 = t.fields[0];
500
955
  }
956
+ break;
501
957
  }
502
958
  case /* Record */
503
- 12: {
504
- const recordSchema = t.fields[0];
505
- return encodeInputRecordSchema(recordSchema);
959
+ 19: {
960
+ const activePatternResult_2 = $007COptionalOf$007C_$007C(t);
961
+ if (activePatternResult_2 != null) {
962
+ matchResult = 18;
963
+ otherType = activePatternResult_2;
964
+ } else {
965
+ matchResult = 21;
966
+ recordSchema = t.fields[0];
967
+ }
968
+ break;
506
969
  }
507
970
  case /* Enum */
508
- 13: {
509
- const enumSchema = t.fields[0];
510
- return encodeInputEnumSchema(enumSchema);
971
+ 20: {
972
+ const activePatternResult_3 = $007COptionalOf$007C_$007C(t);
973
+ if (activePatternResult_3 != null) {
974
+ matchResult = 18;
975
+ otherType = activePatternResult_3;
976
+ } else {
977
+ matchResult = 22;
978
+ enumSchema = t.fields[0];
979
+ }
980
+ break;
511
981
  }
512
982
  default:
513
- if (length(encodeFilePairs("type", "File", t.fields[0])) > 1) {
514
- const file_2 = t.fields[0];
515
- return yMap(encodeFilePairs("type", "File", file_2));
983
+ matchResult = 0;
984
+ }
985
+ switch (matchResult) {
986
+ case 0:
987
+ return encodeString("File");
988
+ case 1:
989
+ return encodeString("Directory");
990
+ case 2:
991
+ return encodeString("string");
992
+ case 3:
993
+ return encodeString("int");
994
+ case 4:
995
+ return encodeString("long");
996
+ case 5:
997
+ return encodeString("float");
998
+ case 6:
999
+ return encodeString("double");
1000
+ case 7:
1001
+ return encodeString("boolean");
1002
+ case 8:
1003
+ return encodeString("Any");
1004
+ case 9:
1005
+ return encodeString(name);
1006
+ case 10:
1007
+ return directive("$import", path);
1008
+ case 11:
1009
+ return directive("$include", path_1);
1010
+ case 12:
1011
+ return raw.Node;
1012
+ case 13:
1013
+ return raw_1.Node;
1014
+ case 14:
1015
+ return encodeString("stdout");
1016
+ case 15:
1017
+ return encodeString("stderr");
1018
+ case 16:
1019
+ return encodeString("stdin");
1020
+ case 17:
1021
+ return encodeString("null");
1022
+ case 18:
1023
+ switch (otherType.tag) {
1024
+ case /* File */
1025
+ 0:
1026
+ return encodeString("File?");
1027
+ case /* Directory */
1028
+ 1:
1029
+ return encodeString("Directory?");
1030
+ case /* String */
1031
+ 2:
1032
+ return encodeString("string?");
1033
+ case /* Int */
1034
+ 3:
1035
+ return encodeString("int?");
1036
+ case /* Long */
1037
+ 4:
1038
+ return encodeString("long?");
1039
+ case /* Float */
1040
+ 5:
1041
+ return encodeString("float?");
1042
+ case /* Double */
1043
+ 6:
1044
+ return encodeString("double?");
1045
+ case /* Boolean */
1046
+ 7:
1047
+ return encodeString("boolean?");
1048
+ case /* Any */
1049
+ 8:
1050
+ return encodeString("Any?");
1051
+ case /* Reference */
1052
+ 12:
1053
+ return encodeString(otherType.fields[0] + "?");
1054
+ case /* Array */
1055
+ 18: {
1056
+ const arraySchema = otherType.fields[0];
1057
+ const matchValue = arrayShorthand(arraySchema);
1058
+ if (matchValue == null) {
1059
+ return encodeSequence(ofArray([encodeString("null"), encodeInputArraySchema(arraySchema)]));
1060
+ } else {
1061
+ return encodeString(matchValue + "?");
1062
+ }
1063
+ }
1064
+ default:
1065
+ return encodeSequence(map(encodeMember, ofArray([CWLType.Null, otherType])));
1066
+ }
1067
+ case 19:
1068
+ return encodeSequence(map(encodeMember, toList(types)));
1069
+ case 20: {
1070
+ const matchValue_1 = arrayShorthand(arraySchema_1);
1071
+ if (matchValue_1 == null) {
1072
+ return encodeInputArraySchema(arraySchema_1);
516
1073
  } else {
517
- return string("File");
1074
+ return encodeString(matchValue_1);
518
1075
  }
1076
+ }
1077
+ case 21:
1078
+ return encodeInputRecordSchema(recordSchema);
1079
+ default:
1080
+ return encodeInputEnumSchema(enumSchema);
1081
+ }
1082
+ }
1083
+ function encodeSchemaType(t) {
1084
+ switch (t.tag) {
1085
+ case /* Array */
1086
+ 18:
1087
+ return encodeInputArraySchema(t.fields[0]);
1088
+ case /* Union */
1089
+ 21:
1090
+ return encodeSequence(ofSeq(map$1(encodeSchemaType, t.fields[0])));
1091
+ default:
1092
+ return encodeTypeWith(true, t);
519
1093
  }
520
1094
  }
521
1095
  function encodeInputRecordField(field) {
@@ -523,219 +1097,277 @@ function encodeInputRecordField(field) {
523
1097
  let acc_4;
524
1098
  let acc_2;
525
1099
  const acc = singleton(["type", encodeCWLType(field.Type)]);
526
- const value_2 = field.Doc;
1100
+ let encoder;
1101
+ const source = field.SourceNodes.Doc;
1102
+ encoder = (doc) => encodeDocValue(source, doc);
1103
+ const value_1 = field.Doc;
527
1104
  const acc_1 = acc;
528
- acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["doc", string(value(value_2))]));
529
- const value_5 = field.Label;
1105
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["doc", encoder(value_1)]));
1106
+ let encoder_2;
1107
+ const source_1 = field.SourceNodes.Label;
1108
+ encoder_2 = (label) => encodeLabelValue(source_1, label);
1109
+ const value_3 = field.Label;
530
1110
  const acc_3 = acc_2;
531
- acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["label", string(value(value_5))]));
1111
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["label", encoder_2(value_3)]));
532
1112
  pairs = appendDynamicPropertiesExcept(InputRecordField.KnownFieldNames, field, acc_4);
533
- return [field.Name, yMap(pairs)];
1113
+ return [field.Name, encodeObject(pairs)];
534
1114
  }
535
1115
  function encodeInputRecordSchema(schema) {
536
- let acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, acc = void 0, value_2 = void 0, acc_1 = void 0, value_5 = void 0, acc_3 = void 0, value_8 = void 0, acc_5 = void 0;
1116
+ return encodeObject(inputRecordSchemaPairs(schema));
1117
+ }
1118
+ function inputRecordSchemaPairs(schema) {
537
1119
  let fieldsElement;
538
1120
  const matchValue = schema.Fields;
539
- fieldsElement = matchValue == null ? yMap(empty$1()) : yMap(toList(map$1(encodeInputRecordField, value(matchValue))));
540
- 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)));
1121
+ if (matchValue == null) {
1122
+ fieldsElement = encodeObject(empty());
1123
+ } else {
1124
+ const entries = toList(map$1((entry) => ListEntry$1.map(encodeInputRecordField, entry), matchValue));
1125
+ fieldsElement = encodeIdEntries("name", "type", FSharpSet__Contains(schema.SourceNodes.WholeFields, "fields"), entries);
1126
+ }
1127
+ let acc_6;
1128
+ let acc_4;
1129
+ let acc_2;
1130
+ const acc = ofArray([["type", encodeString("record")], ["fields", fieldsElement]]);
1131
+ let encoder;
1132
+ const source_2 = schema.SourceNodes.Label;
1133
+ encoder = (label) => encodeLabelValue(source_2, label);
1134
+ const value_1 = schema.Label;
1135
+ const acc_1 = acc;
1136
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["label", encoder(value_1)]));
1137
+ let encoder_2;
1138
+ const source_3 = schema.SourceNodes.Doc;
1139
+ encoder_2 = (doc) => encodeDocValue(source_3, doc);
1140
+ const value_3 = schema.Doc;
1141
+ const acc_3 = acc_2;
1142
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["doc", encoder_2(value_3)]));
1143
+ const value_6 = schema.Name;
1144
+ const acc_5 = acc_4;
1145
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["name", encodeString(value_6)]));
1146
+ return appendDynamicPropertiesExcept(InputRecordSchema.KnownFieldNames, schema, acc_6);
541
1147
  }
542
1148
  function encodeInputEnumSchema(schema) {
543
- let acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, value_3 = void 0, acc_1 = void 0, value_6 = void 0, acc_3 = void 0, value_9 = void 0, acc_5 = void 0;
544
- const pairs = append(singleton(["type", string("enum")]), singleton(["symbols", YAMLElement_Sequence(ofSeq(map$1(string, schema.Symbols)))]));
545
- 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)));
1149
+ return encodeObject(inputEnumSchemaPairs(schema));
1150
+ }
1151
+ function inputEnumSchemaPairs(schema) {
1152
+ const pairs = ofArray([["type", encodeString("enum")], ["symbols", encodeStringList(FSharpSet__Contains(schema.SourceNodes.WholeFields, "symbols"), schema.Symbols)]]);
1153
+ let acc_6;
1154
+ let acc_4;
1155
+ let acc_2;
1156
+ let encoder;
1157
+ const source = schema.SourceNodes.Label;
1158
+ encoder = (label) => encodeLabelValue(source, label);
1159
+ const value_1 = schema.Label;
1160
+ const acc_1 = pairs;
1161
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["label", encoder(value_1)]));
1162
+ let encoder_2;
1163
+ const source_1 = schema.SourceNodes.Doc;
1164
+ encoder_2 = (doc) => encodeDocValue(source_1, doc);
1165
+ const value_3 = schema.Doc;
1166
+ const acc_3 = acc_2;
1167
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["doc", encoder_2(value_3)]));
1168
+ const value_6 = schema.Name;
1169
+ const acc_5 = acc_4;
1170
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["name", encodeString(value_6)]));
1171
+ return appendDynamicPropertiesExcept(InputEnumSchema.KnownFieldNames, schema, acc_6);
546
1172
  }
547
1173
  function encodeInputArraySchema(schema) {
548
- let acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, acc = void 0, value_2 = void 0, acc_1 = void 0, value_5 = void 0, acc_3 = void 0, value_8 = void 0, acc_5 = void 0;
549
- 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)));
1174
+ return encodeObject(inputArraySchemaPairs(schema));
550
1175
  }
551
- function encodeOutputBinding(ob) {
552
- let acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, acc = void 0, option_1 = void 0, value_1 = void 0, acc_1 = void 0, encoder_1 = void 0, f1 = void 0, value_4 = void 0, acc_3 = void 0, value_7 = void 0, acc_5 = void 0;
553
- return yMap((acc_6 = (acc_4 = (acc_2 = (acc = choose$1((x) => x, singleton((option_1 = ob.Glob, option_1 != null ? ["glob", string(value(option_1))] : void 0))), 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)));
1176
+ function inputArraySchemaPairs(schema) {
1177
+ let acc_6;
1178
+ let acc_4;
1179
+ let acc_2;
1180
+ const acc = ofArray([["type", encodeString("array")], ["items", encodeSchemaType(schema.Items)]]);
1181
+ let encoder;
1182
+ const source = schema.SourceNodes.Label;
1183
+ encoder = (label) => encodeLabelValue(source, label);
1184
+ const value_1 = schema.Label;
1185
+ const acc_1 = acc;
1186
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["label", encoder(value_1)]));
1187
+ let encoder_2;
1188
+ const source_1 = schema.SourceNodes.Doc;
1189
+ encoder_2 = (doc) => encodeDocValue(source_1, doc);
1190
+ const value_3 = schema.Doc;
1191
+ const acc_3 = acc_2;
1192
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["doc", encoder_2(value_3)]));
1193
+ const value_6 = schema.Name;
1194
+ const acc_5 = acc_4;
1195
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["name", encodeString(value_6)]));
1196
+ return appendDynamicPropertiesExcept(InputArraySchema.KnownFieldNames, schema, acc_6);
554
1197
  }
555
- function encodeStringArrayOrScalar(values) {
556
- if (values.length === 1) {
557
- return string(item(0, values));
1198
+ function encodeOutputGlob(glob) {
1199
+ if (glob.tag === /* Multiple */
1200
+ 1) {
1201
+ return encodeSequence(ofSeq(map$1(encodeSchemaSaladString, glob.fields[0])));
558
1202
  } else {
559
- return YAMLElement_Sequence(ofSeq(map$1(string, values)));
1203
+ return encodeSchemaSaladString(glob.fields[0]);
560
1204
  }
561
1205
  }
1206
+ function encodeOutputBinding(ob) {
1207
+ let acc_8 = void 0, acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, value_1 = void 0, acc_1 = void 0, value_4 = void 0, acc_3 = void 0, value_7 = void 0, acc_5 = void 0, value_10 = void 0, acc_7 = void 0;
1208
+ return encodeObject((acc_8 = (acc_6 = (acc_4 = (acc_2 = (value_1 = ob.Glob, acc_1 = empty(), value_1 == null ? acc_1 : append(acc_1, singleton(["glob", encodeOutputGlob(value_1)]))), value_4 = ob.LoadContents, acc_3 = acc_2, value_4 == null ? acc_3 : append(acc_3, singleton(["loadContents", encodeSchemaSaladBool(value_4)]))), value_7 = ob.LoadListing, acc_5 = acc_4, value_7 == null ? acc_5 : append(acc_5, singleton(["loadListing", encodeLoadListing(value_7)]))), value_10 = ob.OutputEval, acc_7 = acc_6, value_10 == null ? acc_7 : append(acc_7, singleton(["outputEval", encodeSchemaSaladString(value_10)]))), appendDynamicPropertiesExcept(OutputBinding.KnownFieldNames, ob, acc_8)));
1209
+ }
562
1210
  function encodeCWLParameterValue(value) {
563
1211
  switch (value.tag) {
564
1212
  case /* String */
565
1213
  1:
566
- return string(value.fields[0]);
1214
+ return encodeString(value.fields[0]);
567
1215
  case /* Int */
568
1216
  2:
569
- return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value.fields[0])));
1217
+ return Encode_int64(value.fields[0]);
570
1218
  case /* Float */
571
1219
  3:
572
- return YAMLElement_Value(YAMLContent_create_Z1C3A29C9(CWLParameterValueModule_floatToRoundTripString(value.fields[0])));
1220
+ return Encode_float(value.fields[0]);
573
1221
  case /* Boolean */
574
1222
  4:
575
- return yBool(value.fields[0]);
1223
+ return Encode_bool(value.fields[0]);
576
1224
  case /* File */
577
1225
  5:
578
- return yMap(encodeFilePairs("class", "File", value.fields[0]));
1226
+ return encodeObject(encodeFilePairs("class", "File", value.fields[0]));
579
1227
  case /* Directory */
580
1228
  6:
581
- return yMap(encodeDirectoryPairs("class", "Directory", value.fields[0]));
1229
+ return encodeObject(encodeDirectoryPairs("class", "Directory", value.fields[0]));
582
1230
  case /* Array */
583
1231
  7:
584
- return YAMLElement_Sequence(toList(map$1(encodeCWLParameterValue, value.fields[0])));
1232
+ return encodeSequence(toList(map$1(encodeCWLParameterValue, value.fields[0])));
585
1233
  case /* Record */
586
1234
  8:
587
- return yMap(toList(map$1((field) => [field.Name, encodeCWLParameterValue(field.Value)], value.fields[0])));
1235
+ return encodeObject(toList(map$1((field) => [field.Name, encodeCWLParameterValue(field.Value)], value.fields[0])));
1236
+ default:
1237
+ return Encode_nullValue;
1238
+ }
1239
+ }
1240
+ function encodePortEntry(name, type_, otherPairs) {
1241
+ let option_3 = void 0;
1242
+ let matchValue;
1243
+ const option_1 = type_;
1244
+ matchValue = option_1 != null ? encodeCWLType(option_1) : void 0;
1245
+ let matchResult = void 0, typeNode = void 0, typeNode_1 = void 0;
1246
+ if (matchValue != null) {
1247
+ if (isEmpty(otherPairs)) {
1248
+ matchResult = 0;
1249
+ typeNode = matchValue;
1250
+ } else {
1251
+ matchResult = 1;
1252
+ typeNode_1 = matchValue;
1253
+ }
1254
+ } else {
1255
+ matchResult = 1;
1256
+ typeNode_1 = matchValue;
1257
+ }
1258
+ switch (matchResult) {
1259
+ case 0:
1260
+ if (typeNode.Kind.tag === /* Mapping */
1261
+ 1) {
1262
+ return [name, encodeObject(singleton(["type", typeNode]))];
1263
+ } else {
1264
+ return [name, typeNode];
1265
+ }
588
1266
  default:
589
- return YAMLElement_Value(YAMLContent_create_Z1C3A29C9("null"));
1267
+ return [name, encodeObject(append(ofArray(toArray((option_3 = typeNode_1, option_3 != null ? ["type", option_3] : void 0))), otherPairs))];
590
1268
  }
591
1269
  }
592
1270
  function encodeCWLOutput(o) {
593
- let t = void 0, typesList = void 0, arraySchema = void 0, matchValue = void 0, arraySchema_1 = void 0, matchValue_1 = void 0, values = void 0;
594
- let typeElement;
595
- const option_1 = o.Type_;
596
- typeElement = option_1 != null ? (t = value(option_1), t.tag === /* Union */
597
- 14 ? (typesList = toList(t.fields[0]), !isEmpty(typesList) ? head(typesList).tag === /* Null */
598
- 10 ? !isEmpty(tail(typesList)) ? isEmpty(tail(tail(typesList))) ? head(tail(typesList)).tag === /* File */
599
- 0 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Directory */
600
- 1 ? encodeCWLType(t) : head(tail(typesList)).tag === /* String */
601
- 3 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Int */
602
- 4 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Long */
603
- 5 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Float */
604
- 6 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Double */
605
- 7 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Boolean */
606
- 8 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Array */
607
- 11 ? (arraySchema = head(tail(typesList)).fields[0], matchValue = arraySchema.Items, matchValue.tag === /* File */
608
- 0 ? encodeCWLType(t) : matchValue.tag === /* Directory */
609
- 1 ? encodeCWLType(t) : matchValue.tag === /* String */
610
- 3 ? encodeCWLType(t) : matchValue.tag === /* Int */
611
- 4 ? encodeCWLType(t) : matchValue.tag === /* Long */
612
- 5 ? encodeCWLType(t) : matchValue.tag === /* Float */
613
- 6 ? encodeCWLType(t) : matchValue.tag === /* Double */
614
- 7 ? encodeCWLType(t) : matchValue.tag === /* Boolean */
615
- 8 ? encodeCWLType(t) : encodeCWLType(t)) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t) : !isEmpty(tail(typesList)) ? head(tail(typesList)).tag === /* Null */
616
- 10 ? isEmpty(tail(tail(typesList))) ? head(typesList).tag === /* File */
617
- 0 ? encodeCWLType(t) : head(typesList).tag === /* Directory */
618
- 1 ? encodeCWLType(t) : head(typesList).tag === /* String */
619
- 3 ? encodeCWLType(t) : head(typesList).tag === /* Int */
620
- 4 ? encodeCWLType(t) : head(typesList).tag === /* Long */
621
- 5 ? encodeCWLType(t) : head(typesList).tag === /* Float */
622
- 6 ? encodeCWLType(t) : head(typesList).tag === /* Double */
623
- 7 ? encodeCWLType(t) : head(typesList).tag === /* Boolean */
624
- 8 ? encodeCWLType(t) : head(typesList).tag === /* Array */
625
- 11 ? (arraySchema = head(typesList).fields[0], matchValue = arraySchema.Items, matchValue.tag === /* File */
626
- 0 ? encodeCWLType(t) : matchValue.tag === /* Directory */
627
- 1 ? encodeCWLType(t) : matchValue.tag === /* String */
628
- 3 ? encodeCWLType(t) : matchValue.tag === /* Int */
629
- 4 ? encodeCWLType(t) : matchValue.tag === /* Long */
630
- 5 ? encodeCWLType(t) : matchValue.tag === /* Float */
631
- 6 ? encodeCWLType(t) : matchValue.tag === /* Double */
632
- 7 ? encodeCWLType(t) : matchValue.tag === /* Boolean */
633
- 8 ? encodeCWLType(t) : encodeCWLType(t)) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t)) : t.tag === /* Array */
634
- 11 ? (arraySchema_1 = t.fields[0], matchValue_1 = arraySchema_1.Items, matchValue_1.tag === /* File */
635
- 0 ? encodeCWLType(t) : matchValue_1.tag === /* Directory */
636
- 1 ? encodeCWLType(t) : matchValue_1.tag === /* Dirent */
637
- 2 ? encodeCWLType(t) : matchValue_1.tag === /* String */
638
- 3 ? encodeCWLType(t) : matchValue_1.tag === /* Int */
639
- 4 ? encodeCWLType(t) : matchValue_1.tag === /* Long */
640
- 5 ? encodeCWLType(t) : matchValue_1.tag === /* Float */
641
- 6 ? encodeCWLType(t) : matchValue_1.tag === /* Double */
642
- 7 ? encodeCWLType(t) : matchValue_1.tag === /* Boolean */
643
- 8 ? encodeCWLType(t) : yMap(singleton(["type", encodeInputArraySchema(arraySchema_1)]))) : t.tag === /* Record */
644
- 12 ? yMap(singleton(["type", encodeInputRecordSchema(t.fields[0])])) : t.tag === /* Enum */
645
- 13 ? yMap(singleton(["type", encodeInputEnumSchema(t.fields[0])])) : encodeCWLType(t)) : void 0;
646
- let pairs;
647
- let acc_16;
648
- let value_17;
649
- const matchValue_2 = o.OutputSource;
650
- let matchResult = void 0, value$1 = void 0, values_1 = void 0;
651
- if (matchValue_2 != null) {
652
- if (value(matchValue_2).tag === /* Multiple */
1271
+ let values = void 0;
1272
+ let otherPairs;
1273
+ let acc_14;
1274
+ let value_16;
1275
+ const matchValue = o.OutputSource;
1276
+ let matchResult = void 0, value = void 0, values_1 = void 0;
1277
+ if (matchValue != null) {
1278
+ if (matchValue.tag === /* Multiple */
653
1279
  1) {
654
- if (values = value(matchValue_2).fields[0], values.length > 0) {
1280
+ if (values = matchValue.fields[0], values.length > 0) {
655
1281
  matchResult = 1;
656
- values_1 = value(matchValue_2).fields[0];
1282
+ values_1 = matchValue.fields[0];
657
1283
  } else {
658
1284
  matchResult = 2;
659
1285
  }
660
1286
  } else {
661
1287
  matchResult = 0;
662
- value$1 = value(matchValue_2).fields[0];
1288
+ value = matchValue.fields[0];
663
1289
  }
664
1290
  } else {
665
1291
  matchResult = 2;
666
1292
  }
667
1293
  switch (matchResult) {
668
1294
  case 0: {
669
- value_17 = string(value$1);
1295
+ value_16 = encodeSchemaSaladString(value);
670
1296
  break;
671
1297
  }
672
1298
  case 1: {
673
- value_17 = encodeStringArrayOrScalar(values_1);
1299
+ value_16 = encodeSequence(ofSeq(map$1(encodeSchemaSaladString, values_1)));
674
1300
  break;
675
1301
  }
676
1302
  default:
677
- value_17 = void 0;
1303
+ value_16 = void 0;
678
1304
  }
679
- let acc_15;
680
- let acc_12;
1305
+ let acc_13;
681
1306
  let acc_10;
682
1307
  let acc_8;
683
1308
  let acc_6;
684
1309
  let acc_4;
685
1310
  let acc_2;
686
- const value_1 = typeElement;
687
- const acc_1 = empty$1();
688
- acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["type", value(value_1)]));
689
- const value_4 = o.Label;
1311
+ let encoder;
1312
+ const source_2 = o.SourceNodes.Label;
1313
+ encoder = (label) => encodeLabelValue(source_2, label);
1314
+ const value_3 = o.Label;
1315
+ const acc_1 = empty();
1316
+ acc_2 = value_3 == null ? acc_1 : append(acc_1, singleton(["label", encoder(value_3)]));
1317
+ const value_5 = o.SecondaryFiles;
690
1318
  const acc_3 = acc_2;
691
- acc_4 = value_4 == null ? acc_3 : append(acc_3, singleton(["label", string(value(value_4))]));
692
- const value_6 = o.SecondaryFiles;
693
- const acc_5 = acc_4;
694
- acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["secondaryFiles", value(value_6)]));
1319
+ acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["secondaryFiles", rawYamlNode(value_5)]));
695
1320
  const value_8 = o.Streamable;
1321
+ const acc_5 = acc_4;
1322
+ acc_6 = value_8 == null ? acc_5 : append(acc_5, singleton(["streamable", encodeSchemaSaladBool(value_8)]));
1323
+ let encoder_4;
1324
+ const source_3 = o.SourceNodes.Doc;
1325
+ encoder_4 = (doc) => encodeDocValue(source_3, doc);
1326
+ const value_10 = o.Doc;
696
1327
  const acc_7 = acc_6;
697
- acc_8 = value_8 == null ? acc_7 : append(acc_7, singleton(["streamable", yBool(value(value_8))]));
698
- const value_11 = o.Doc;
1328
+ acc_8 = value_10 == null ? acc_7 : append(acc_7, singleton(["doc", encoder_4(value_10)]));
1329
+ const value_13 = o.Format;
699
1330
  const acc_9 = acc_8;
700
- acc_10 = value_11 == null ? acc_9 : append(acc_9, singleton(["doc", string(value(value_11))]));
701
- const value_14 = o.Format;
1331
+ acc_10 = value_13 == null ? acc_9 : append(acc_9, singleton(["format", encodeSchemaSaladString(value_13)]));
1332
+ const value_15 = o.OutputBinding;
702
1333
  const acc_11 = acc_10;
703
- acc_12 = value_14 == null ? acc_11 : append(acc_11, singleton(["format", string(value(value_14))]));
704
- const value_16 = o.OutputBinding;
705
- const acc_13 = acc_12;
706
- acc_15 = value_16 == null ? acc_13 : append(acc_13, singleton(["outputBinding", encodeOutputBinding(value(value_16))]));
707
- acc_16 = value_17 == null ? acc_15 : append(acc_15, singleton(["outputSource", value(value_17)]));
708
- pairs = appendDynamicPropertiesExcept(CWLOutput.KnownFieldNames, o, acc_16);
709
- let matchResult_1 = void 0, t_1 = void 0;
710
- if (!isEmpty(pairs)) {
711
- if (head(pairs)[0] === "type") {
712
- if (isEmpty(tail(pairs))) {
713
- matchResult_1 = 0;
714
- t_1 = head(pairs)[1];
715
- } else {
716
- matchResult_1 = 1;
717
- }
718
- } else {
719
- matchResult_1 = 1;
720
- }
721
- } else {
722
- matchResult_1 = 1;
723
- }
724
- switch (matchResult_1) {
725
- case 0:
726
- return [o.Name, t_1];
1334
+ acc_13 = value_15 == null ? acc_11 : append(acc_11, singleton(["outputBinding", encodeListEntry(encodeOutputBinding, value_15)]));
1335
+ acc_14 = value_16 == null ? acc_13 : append(acc_13, singleton(["outputSource", value_16]));
1336
+ otherPairs = appendDynamicPropertiesExcept(CWLOutput.KnownFieldNames, o, acc_14);
1337
+ return encodePortEntry(o.Name, o.Type_, otherPairs);
1338
+ }
1339
+ function encodeBindingPosition(position) {
1340
+ switch (position.tag) {
1341
+ case /* Expression */
1342
+ 1:
1343
+ return encodeString(position.fields[0]);
1344
+ case /* Imported */
1345
+ 2:
1346
+ return directive("$import", position.fields[0]);
1347
+ case /* Included */
1348
+ 3:
1349
+ return directive("$include", position.fields[0]);
1350
+ case /* Mixed */
1351
+ 4:
1352
+ return position.fields[0].Node;
727
1353
  default:
728
- return [o.Name, yMap(pairs)];
1354
+ return Encode_int(position.fields[0]);
729
1355
  }
730
1356
  }
731
1357
  function encodeInputBinding(ib) {
732
- let acc_14 = void 0, acc_12 = void 0, acc_10 = void 0, acc_8 = void 0, acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, value_1 = void 0, acc_1 = void 0, value_4 = void 0, acc_3 = void 0, value_6 = void 0, acc_5 = void 0, value_9 = void 0, acc_7 = void 0, value_11 = void 0, acc_9 = void 0, value_14 = void 0, acc_11 = void 0, value_16 = void 0, acc_13 = void 0;
733
- 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)));
1358
+ let acc_14 = void 0, acc_12 = void 0, acc_10 = void 0, acc_8 = void 0, acc_6 = void 0, acc_4 = void 0, acc_2 = void 0, value_2 = void 0, acc_1 = void 0, value_5 = void 0, acc_3 = void 0, value_7 = void 0, acc_5 = void 0, value_10 = void 0, acc_7 = void 0, value_13 = void 0, acc_9 = void 0, value_16 = void 0, acc_11 = void 0, value_19 = void 0, acc_13 = void 0;
1359
+ return encodeObject((acc_14 = (acc_12 = (acc_10 = (acc_8 = (acc_6 = (acc_4 = (acc_2 = (value_2 = ib.LoadContents, acc_1 = empty(), value_2 == null ? acc_1 : append(acc_1, singleton(["loadContents", encodeSchemaSaladBool(value_2)]))), value_5 = ib.Prefix, acc_3 = acc_2, value_5 == null ? acc_3 : append(acc_3, singleton(["prefix", encodeSchemaSaladString(value_5)]))), value_7 = ib._position, acc_5 = acc_4, value_7 == null ? acc_5 : append(acc_5, singleton(["position", encodeBindingPosition(value_7)]))), value_10 = ib.ItemSeparator, acc_7 = acc_6, value_10 == null ? acc_7 : append(acc_7, singleton(["itemSeparator", encodeSchemaSaladString(value_10)]))), value_13 = ib.Separate, acc_9 = acc_8, value_13 == null ? acc_9 : append(acc_9, singleton(["separate", encodeSchemaSaladBool(value_13)]))), value_16 = ib.ValueFrom, acc_11 = acc_10, value_16 == null ? acc_11 : append(acc_11, singleton(["valueFrom", encodeSchemaSaladString(value_16)]))), value_19 = ib.ShellQuote, acc_13 = acc_12, value_19 == null ? acc_13 : append(acc_13, singleton(["shellQuote", encodeSchemaSaladBool(value_19)]))), appendDynamicPropertiesExcept(InputBinding.KnownFieldNames, ib, acc_14)));
1360
+ }
1361
+ function encodeInputFormat(format) {
1362
+ if (format.tag === /* Multiple */
1363
+ 1) {
1364
+ return encodeSequence(ofSeq(map$1(encodeSchemaSaladString, format.fields[0])));
1365
+ } else {
1366
+ return encodeSchemaSaladString(format.fields[0]);
1367
+ }
734
1368
  }
735
1369
  function encodeCWLInput(i) {
736
- let t = void 0, typesList = void 0, arraySchema = void 0, matchValue = void 0, arraySchema_1 = void 0, matchValue_1 = void 0;
737
- let pairs;
738
- let acc_20;
1370
+ let otherPairs;
739
1371
  let acc_18;
740
1372
  let acc_16;
741
1373
  let acc_14;
@@ -745,116 +1377,47 @@ function encodeCWLInput(i) {
745
1377
  let acc_6;
746
1378
  let acc_4;
747
1379
  let acc_2;
748
- let value$1;
749
- const option_1 = i.Type_;
750
- value$1 = option_1 != null ? (t = value(option_1), t.tag === /* Union */
751
- 14 ? (typesList = toList(t.fields[0]), !isEmpty(typesList) ? head(typesList).tag === /* Null */
752
- 10 ? !isEmpty(tail(typesList)) ? isEmpty(tail(tail(typesList))) ? head(tail(typesList)).tag === /* File */
753
- 0 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Directory */
754
- 1 ? encodeCWLType(t) : head(tail(typesList)).tag === /* String */
755
- 3 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Int */
756
- 4 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Long */
757
- 5 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Float */
758
- 6 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Double */
759
- 7 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Boolean */
760
- 8 ? encodeCWLType(t) : head(tail(typesList)).tag === /* Array */
761
- 11 ? (arraySchema = head(tail(typesList)).fields[0], matchValue = arraySchema.Items, matchValue.tag === /* File */
762
- 0 ? encodeCWLType(t) : matchValue.tag === /* Directory */
763
- 1 ? encodeCWLType(t) : matchValue.tag === /* String */
764
- 3 ? encodeCWLType(t) : matchValue.tag === /* Int */
765
- 4 ? encodeCWLType(t) : matchValue.tag === /* Long */
766
- 5 ? encodeCWLType(t) : matchValue.tag === /* Float */
767
- 6 ? encodeCWLType(t) : matchValue.tag === /* Double */
768
- 7 ? encodeCWLType(t) : matchValue.tag === /* Boolean */
769
- 8 ? encodeCWLType(t) : encodeCWLType(t)) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t) : !isEmpty(tail(typesList)) ? head(tail(typesList)).tag === /* Null */
770
- 10 ? isEmpty(tail(tail(typesList))) ? head(typesList).tag === /* File */
771
- 0 ? encodeCWLType(t) : head(typesList).tag === /* Directory */
772
- 1 ? encodeCWLType(t) : head(typesList).tag === /* String */
773
- 3 ? encodeCWLType(t) : head(typesList).tag === /* Int */
774
- 4 ? encodeCWLType(t) : head(typesList).tag === /* Long */
775
- 5 ? encodeCWLType(t) : head(typesList).tag === /* Float */
776
- 6 ? encodeCWLType(t) : head(typesList).tag === /* Double */
777
- 7 ? encodeCWLType(t) : head(typesList).tag === /* Boolean */
778
- 8 ? encodeCWLType(t) : head(typesList).tag === /* Array */
779
- 11 ? (arraySchema = head(typesList).fields[0], matchValue = arraySchema.Items, matchValue.tag === /* File */
780
- 0 ? encodeCWLType(t) : matchValue.tag === /* Directory */
781
- 1 ? encodeCWLType(t) : matchValue.tag === /* String */
782
- 3 ? encodeCWLType(t) : matchValue.tag === /* Int */
783
- 4 ? encodeCWLType(t) : matchValue.tag === /* Long */
784
- 5 ? encodeCWLType(t) : matchValue.tag === /* Float */
785
- 6 ? encodeCWLType(t) : matchValue.tag === /* Double */
786
- 7 ? encodeCWLType(t) : matchValue.tag === /* Boolean */
787
- 8 ? encodeCWLType(t) : encodeCWLType(t)) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t) : encodeCWLType(t)) : t.tag === /* Array */
788
- 11 ? (arraySchema_1 = t.fields[0], matchValue_1 = arraySchema_1.Items, matchValue_1.tag === /* File */
789
- 0 ? encodeCWLType(t) : matchValue_1.tag === /* Directory */
790
- 1 ? encodeCWLType(t) : matchValue_1.tag === /* Dirent */
791
- 2 ? encodeCWLType(t) : matchValue_1.tag === /* String */
792
- 3 ? encodeCWLType(t) : matchValue_1.tag === /* Int */
793
- 4 ? encodeCWLType(t) : matchValue_1.tag === /* Long */
794
- 5 ? encodeCWLType(t) : matchValue_1.tag === /* Float */
795
- 6 ? encodeCWLType(t) : matchValue_1.tag === /* Double */
796
- 7 ? encodeCWLType(t) : matchValue_1.tag === /* Boolean */
797
- 8 ? encodeCWLType(t) : yMap(singleton(["type", encodeInputArraySchema(arraySchema_1)]))) : t.tag === /* Record */
798
- 12 ? yMap(singleton(["type", encodeInputRecordSchema(t.fields[0])])) : t.tag === /* Enum */
799
- 13 ? yMap(singleton(["type", encodeInputEnumSchema(t.fields[0])])) : encodeCWLType(t)) : void 0;
800
- const acc_1 = empty$1();
801
- acc_2 = value$1 == null ? acc_1 : append(acc_1, singleton(["type", value(value$1)]));
802
- const value_3 = i.Label;
1380
+ let encoder;
1381
+ const source = i.SourceNodes.Label;
1382
+ encoder = (label) => encodeLabelValue(source, label);
1383
+ const value_1 = i.Label;
1384
+ const acc_1 = empty();
1385
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["label", encoder(value_1)]));
1386
+ const value_3 = i.SecondaryFiles;
803
1387
  const acc_3 = acc_2;
804
- acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["label", string(value(value_3))]));
805
- const value_5 = i.SecondaryFiles;
1388
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["secondaryFiles", rawYamlNode(value_3)]));
1389
+ const value_6 = i.Streamable;
806
1390
  const acc_5 = acc_4;
807
- acc_6 = value_5 == null ? acc_5 : append(acc_5, singleton(["secondaryFiles", value(value_5)]));
808
- const value_7 = i.Streamable;
1391
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["streamable", encodeSchemaSaladBool(value_6)]));
1392
+ let encoder_4;
1393
+ const source_1 = i.SourceNodes.Doc;
1394
+ encoder_4 = (doc) => encodeDocValue(source_1, doc);
1395
+ const value_8 = i.Doc;
809
1396
  const acc_7 = acc_6;
810
- acc_8 = value_7 == null ? acc_7 : append(acc_7, singleton(["streamable", yBool(value(value_7))]));
811
- const value_10 = i.Doc;
1397
+ acc_8 = value_8 == null ? acc_7 : append(acc_7, singleton(["doc", encoder_4(value_8)]));
1398
+ const value_10 = i.Format;
812
1399
  const acc_9 = acc_8;
813
- acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["doc", string(value(value_10))]));
814
- const value_13 = i.Format;
1400
+ acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["format", encodeInputFormat(value_10)]));
1401
+ const value_13 = i.LoadContents;
815
1402
  const acc_11 = acc_10;
816
- acc_12 = value_13 == null ? acc_11 : append(acc_11, singleton(["format", string(value(value_13))]));
817
- const value_15 = i.LoadContents;
1403
+ acc_12 = value_13 == null ? acc_11 : append(acc_11, singleton(["loadContents", encodeSchemaSaladBool(value_13)]));
1404
+ const value_16 = i.LoadListing;
818
1405
  const acc_13 = acc_12;
819
- acc_14 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", yBool(value(value_15))]));
820
- let encoder_9;
821
- const f1 = LoadListingEnum_get_toCwlString();
822
- encoder_9 = (arg) => string(f1(arg));
823
- const value_18 = i.LoadListing;
1406
+ acc_14 = value_16 == null ? acc_13 : append(acc_13, singleton(["loadListing", encodeLoadListing(value_16)]));
1407
+ const value_18 = i.DefaultValue;
824
1408
  const acc_15 = acc_14;
825
- acc_16 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", encoder_9(value(value_18))]));
826
- const value_20 = i.DefaultValue;
1409
+ acc_16 = value_18 == null ? acc_15 : append(acc_15, singleton(["default", rawYamlNode(value_18)]));
1410
+ const value_20 = i.InputBinding;
827
1411
  const acc_17 = acc_16;
828
- acc_18 = value_20 == null ? acc_17 : append(acc_17, singleton(["default", value(value_20)]));
829
- const value_22 = i.InputBinding;
830
- const acc_19 = acc_18;
831
- acc_20 = value_22 == null ? acc_19 : append(acc_19, singleton(["inputBinding", encodeInputBinding(value(value_22))]));
832
- pairs = appendDynamicPropertiesExcept(CWLInput.KnownFieldNames, i, acc_20);
833
- let matchResult = void 0, t_1 = void 0;
834
- if (!isEmpty(pairs)) {
835
- if (head(pairs)[0] === "type") {
836
- if (isEmpty(tail(pairs))) {
837
- matchResult = 0;
838
- t_1 = head(pairs)[1];
839
- } else {
840
- matchResult = 1;
841
- }
842
- } else {
843
- matchResult = 1;
844
- }
845
- } else {
846
- matchResult = 1;
847
- }
848
- switch (matchResult) {
849
- case 0:
850
- return [i.Name, t_1];
851
- default:
852
- return [i.Name, yMap(pairs)];
853
- }
1412
+ acc_18 = value_20 == null ? acc_17 : append(acc_17, singleton(["inputBinding", encodeListEntry(encodeInputBinding, value_20)]));
1413
+ otherPairs = appendDynamicPropertiesExcept(CWLInput.KnownFieldNames, i, acc_18);
1414
+ return encodePortEntry(i.Name, i.Type_, otherPairs);
854
1415
  }
855
- function encodeSchemaDefRequirementType(s) {
856
- let acc = void 0;
857
- return yMap((acc = ofArray([["name", string(s.Name)], ["type", encodeCWLType(s.Type_)]]), appendDynamicPropertiesExcept(SchemaDefRequirementType.KnownFieldNames, s, acc)));
1416
+ function encodeSchemaDefinition(definition) {
1417
+ const patternInput = partition((tupledArg) => tupledArg[0] === "name", definition.tag === /* Enum */
1418
+ 1 ? inputEnumSchemaPairs(definition.fields[0]) : definition.tag === /* Array */
1419
+ 2 ? inputArraySchemaPairs(definition.fields[0]) : inputRecordSchemaPairs(definition.fields[0]));
1420
+ return encodeObject(append(patternInput[0], patternInput[1]));
858
1421
  }
859
1422
  function encodeRequirement(r) {
860
1423
  let acc_17 = void 0, acc_15 = void 0, acc_13 = void 0, acc_11 = void 0, acc_9 = void 0, acc_7 = void 0, acc_5 = void 0, acc_3 = void 0, value_5 = void 0, acc_4 = void 0, value_8 = void 0, acc_6 = void 0, value_11 = void 0, acc_8 = void 0, value_14 = void 0, acc_10 = void 0, value_17 = void 0, acc_12 = void 0, value_20 = void 0, acc_14 = void 0, value_23 = void 0, acc_16 = void 0, acc_24 = void 0, acc_32 = void 0, acc_33 = void 0, acc_34 = void 0, acc_2 = void 0, value_2 = void 0, option_1 = void 0, entries = void 0, acc_1 = void 0;
@@ -862,74 +1425,121 @@ function encodeRequirement(r) {
862
1425
  case /* SchemaDefRequirement */
863
1426
  1: {
864
1427
  const types = r.fields[0];
865
- return yMap(ofArray([["class", string("SchemaDefRequirement")], ["types", YAMLElement_Sequence(ofSeq(map$1(encodeSchemaDefRequirementType, types)))]]));
1428
+ return encodeObject(ofArray([["class", encodeString("SchemaDefRequirement")], ["types", encodeSequence(ofSeq(map$1((entry) => {
1429
+ switch (entry.tag) {
1430
+ case /* Imported */
1431
+ 1:
1432
+ return directive("$import", entry.fields[0]);
1433
+ case /* Mixed */
1434
+ 2:
1435
+ return entry.fields[0].Node;
1436
+ case /* Raw */
1437
+ 3:
1438
+ return entry.fields[0].Node;
1439
+ default:
1440
+ return encodeSchemaDefinition(entry.fields[0]);
1441
+ }
1442
+ }, types)))]]));
866
1443
  }
867
1444
  case /* DockerRequirement */
868
1445
  2: {
869
1446
  const dr = r.fields[0];
870
- 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$1(string, value(value_23))))]))), appendDynamicPropertiesExcept(DockerRequirement.KnownFieldNames, dr, acc_17)));
1447
+ return encodeObject((acc_17 = (acc_15 = (acc_13 = (acc_11 = (acc_9 = (acc_7 = (acc_5 = (acc_3 = singleton(["class", encodeString("DockerRequirement")]), value_5 = dr.DockerPull, acc_4 = acc_3, value_5 == null ? acc_4 : append(acc_4, singleton(["dockerPull", encodeSchemaSaladString(value_5)]))), value_8 = dr.DockerFile, acc_6 = acc_5, value_8 == null ? acc_6 : append(acc_6, singleton(["dockerFile", encodeSchemaSaladString(value_8)]))), value_11 = dr.DockerImageId, acc_8 = acc_7, value_11 == null ? acc_8 : append(acc_8, singleton(["dockerImageId", encodeSchemaSaladString(value_11)]))), value_14 = dr.DockerLoad, acc_10 = acc_9, value_14 == null ? acc_10 : append(acc_10, singleton(["dockerLoad", encodeSchemaSaladString(value_14)]))), value_17 = dr.DockerImport, acc_12 = acc_11, value_17 == null ? acc_12 : append(acc_12, singleton(["dockerImport", encodeSchemaSaladString(value_17)]))), value_20 = dr.DockerOutputDirectory, acc_14 = acc_13, value_20 == null ? acc_14 : append(acc_14, singleton(["dockerOutputDirectory", encodeSchemaSaladString(value_20)]))), value_23 = dr.DockerRunOptions, acc_16 = acc_15, value_23 == null ? acc_16 : append(acc_16, singleton(["cwltool:dockerRunOptions", encodeSequence(ofSeq(map$1(encodeString, value_23)))]))), appendDynamicPropertiesExcept(DockerRequirement.KnownFieldNames, dr, acc_17)));
871
1448
  }
872
1449
  case /* SoftwareRequirement */
873
1450
  3: {
874
1451
  const pkgs = r.fields[0];
875
- return yMap(ofArray([["class", string("SoftwareRequirement")], ["packages", YAMLElement_Sequence(ofSeq(map$1((p) => {
1452
+ return encodeObject(ofArray([["class", encodeString("SoftwareRequirement")], ["packages", encodeSequence(ofSeq(map$1((entry_1) => encodeListEntry((p) => {
876
1453
  let acc_23 = void 0, acc_21 = void 0, acc_19 = void 0, value_26 = void 0, acc_20 = void 0, value_29 = void 0, acc_22 = void 0;
877
- 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$1(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$1(string, value(value_29))))]))), appendDynamicPropertiesExcept(SoftwarePackage.KnownFieldNames, p, acc_23)));
878
- }, pkgs)))]]));
1454
+ return encodeObject((acc_23 = (acc_21 = (acc_19 = append(empty(), singleton(["package", encodeSchemaSaladString(p.Package)])), value_26 = p.Version, acc_20 = acc_19, value_26 == null ? acc_20 : append(acc_20, singleton(["version", encodeSequence(ofSeq(map$1(encodeSchemaSaladString, value_26)))]))), value_29 = p.Specs, acc_22 = acc_21, value_29 == null ? acc_22 : append(acc_22, singleton(["specs", encodeSequence(ofSeq(map$1(encodeSchemaSaladString, value_29)))]))), appendDynamicPropertiesExcept(SoftwarePackage.KnownFieldNames, p, acc_23)));
1455
+ }, entry_1), pkgs)))]]));
879
1456
  }
880
1457
  case /* LoadListingRequirement */
881
1458
  4: {
882
1459
  const loadListing = r.fields[0];
883
- return yMap((acc_24 = ofArray([["class", string("LoadListingRequirement")], ["loadListing", string(LoadListingEnum_get_toCwlString()(loadListing.LoadListing))]]), appendDynamicPropertiesExcept(LoadListingRequirementValue.KnownFieldNames, loadListing, acc_24)));
1460
+ return encodeObject((acc_24 = ofArray([["class", encodeString("LoadListingRequirement")], ["loadListing", encodeLoadListing(loadListing.LoadListing)]]), appendDynamicPropertiesExcept(LoadListingRequirementValue.KnownFieldNames, loadListing, acc_24)));
884
1461
  }
885
1462
  case /* InitialWorkDirRequirement */
886
1463
  5: {
887
1464
  const listing = r.fields[0];
888
- return yMap(ofArray([["class", string("InitialWorkDirRequirement")], ["listing", YAMLElement_Sequence(ofSeq(map$1((_arg) => {
889
- let acc_30 = void 0, acc_28 = void 0, value_32 = void 0, acc_26 = void 0, value_34 = void 0, acc_29 = void 0;
1465
+ const encodeFileOrDirectory = (_arg) => {
890
1466
  switch (_arg.tag) {
1467
+ case /* DirectoryItem */
1468
+ 1:
1469
+ return encodeObject(encodeDirectoryPairs("class", "Directory", _arg.fields[0]));
1470
+ case /* ImportedItem */
1471
+ 2:
1472
+ return directive("$import", _arg.fields[0]);
1473
+ case /* MixedItem */
1474
+ 3:
1475
+ return _arg.fields[0].Node;
1476
+ case /* RawItem */
1477
+ 4:
1478
+ return _arg.fields[0].Node;
1479
+ default:
1480
+ return encodeObject(encodeFilePairs("class", "File", _arg.fields[0]));
1481
+ }
1482
+ };
1483
+ return encodeObject(ofArray([["class", encodeString("InitialWorkDirRequirement")], ["listing", encodeSequence(ofSeq(map$1((_arg_1) => {
1484
+ let acc_30 = void 0, acc_28 = void 0, value_32 = void 0, acc_26 = void 0, value_35 = void 0, acc_29 = void 0;
1485
+ switch (_arg_1.tag) {
891
1486
  case /* StringEntry */
892
1487
  1:
893
- return encodeSchemaSaladString(_arg.fields[0]);
1488
+ return encodeSchemaSaladString(_arg_1.fields[0]);
894
1489
  case /* FileEntry */
895
1490
  2:
896
- return yMap(encodeFilePairs("class", "File", _arg.fields[0]));
1491
+ return encodeFileOrDirectory(FileOrDirectory_FileItem(_arg_1.fields[0]));
897
1492
  case /* DirectoryEntry */
898
1493
  3:
899
- return yMap(encodeDirectoryPairs("class", "Directory", _arg.fields[0]));
1494
+ return encodeFileOrDirectory(FileOrDirectory_DirectoryItem(_arg_1.fields[0]));
1495
+ case /* NullEntry */
1496
+ 4:
1497
+ return Encode_nullValue;
1498
+ case /* FilesEntry */
1499
+ 5:
1500
+ return encodeSequence(ofSeq(map$1(encodeFileOrDirectory, _arg_1.fields[0])));
1501
+ case /* RawEntry */
1502
+ 6:
1503
+ return _arg_1.fields[0].Node;
900
1504
  default: {
901
- const d = _arg.fields[0];
902
- 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)));
1505
+ const d = _arg_1.fields[0];
1506
+ return encodeObject((acc_30 = (acc_28 = append((value_32 = d.Entryname, acc_26 = empty(), value_32 == null ? acc_26 : append(acc_26, singleton(["entryname", encodeSchemaSaladString(value_32)]))), singleton(["entry", encodeSchemaSaladString(d.Entry)])), value_35 = d.Writable, acc_29 = acc_28, value_35 == null ? acc_29 : append(acc_29, singleton(["writable", encodeSchemaSaladBool(value_35)]))), appendDynamicPropertiesExcept(DirentInstance.KnownFieldNames, d, acc_30)));
903
1507
  }
904
1508
  }
905
1509
  }, listing)))]]));
906
1510
  }
907
- case /* EnvVarRequirement */
1511
+ case /* InitialWorkDirExpressionRequirement */
908
1512
  6: {
1513
+ const expression = r.fields[0];
1514
+ return encodeObject(ofArray([["class", encodeString("InitialWorkDirRequirement")], ["listing", encodeSchemaSaladString(expression)]]));
1515
+ }
1516
+ case /* EnvVarRequirement */
1517
+ 7: {
909
1518
  const envs = r.fields[0];
910
- return yMap(ofArray([["class", string("EnvVarRequirement")], ["envDef", YAMLElement_Sequence(ofSeq(map$1((e) => {
1519
+ return encodeObject(ofArray([["class", encodeString("EnvVarRequirement")], ["envDef", encodeSequence(ofSeq(map$1((entry_2) => encodeListEntry((e) => {
911
1520
  let acc_31 = void 0;
912
- const v_12 = normalizeEnvValueForEncode(e.EnvValue);
913
- return yMap((acc_31 = ofArray([["envName", string(e.EnvName)], ["envValue", string(v_12)]]), appendDynamicPropertiesExcept(EnvironmentDef.KnownFieldNames, e, acc_31)));
914
- }, envs)))]]));
1521
+ return encodeObject((acc_31 = ofArray([["envName", encodeSchemaSaladString(e.EnvName)], ["envValue", encodeSchemaSaladString(e.EnvValue)]]), appendDynamicPropertiesExcept(EnvironmentDef.KnownFieldNames, e, acc_31)));
1522
+ }, entry_2), envs)))]]));
915
1523
  }
916
1524
  case /* ShellCommandRequirement */
917
- 7:
918
- return yMap(singleton(["class", string("ShellCommandRequirement")]));
1525
+ 8:
1526
+ return encodeObject(singleton(["class", encodeString("ShellCommandRequirement")]));
919
1527
  case /* ResourceRequirement */
920
- 8: {
1528
+ 9: {
921
1529
  const rr = r.fields[0];
922
- const tryEncodeScalar = (key, value_35) => {
923
- if (typeof value_35 === "number") {
924
- return [key, yFloat(value_35)];
925
- } else if (typeof value_35 === "number") {
926
- return [key, int(value_35)];
927
- } else if (typeof value_35 === "bigint") {
928
- return [key, YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(value_35)))];
929
- } else if (typeof value_35 === "string") {
930
- return [key, string(value_35)];
931
- } else if (typeof value_35 === "boolean") {
932
- return [key, yBool(value_35)];
1530
+ const tryEncodeScalar = (key, value_36) => {
1531
+ if (typeof value_36 === "number") {
1532
+ return [key, Encode_float(value_36)];
1533
+ } else if (typeof value_36 === "number") {
1534
+ return [key, Encode_int(value_36)];
1535
+ } else if (typeof value_36 === "bigint") {
1536
+ return [key, Encode_int64(value_36)];
1537
+ } else if (typeof value_36 === "string") {
1538
+ return [key, encodeString(value_36)];
1539
+ } else if (value_36 instanceof SchemaSaladString) {
1540
+ return [key, encodeSchemaSaladString(value_36)];
1541
+ } else if (typeof value_36 === "boolean") {
1542
+ return [key, Encode_bool(value_36)];
933
1543
  } else {
934
1544
  return void 0;
935
1545
  }
@@ -949,82 +1559,199 @@ function encodeRequirement(r) {
949
1559
  }, dynamicPropertiesExcept(ofSeq$1(map$1((x) => x, ResourceRequirementInstance.KnownFieldNames), {
950
1560
  Compare: (x_1, y) => comparePrimitives(x_1, y) | 0
951
1561
  }), rr)));
952
- return yMap(append(singleton(["class", string("ResourceRequirement")]), append(knownPairs, dynamicPairs)));
1562
+ return encodeObject(append(singleton(["class", encodeString("ResourceRequirement")]), append(knownPairs, dynamicPairs)));
953
1563
  }
954
1564
  case /* WorkReuseRequirement */
955
- 9: {
1565
+ 10: {
956
1566
  const workReuse = r.fields[0];
957
- return yMap((acc_32 = ofArray([["class", string("WorkReuse")], ["enableReuse", yBool(workReuse.EnableReuse)]]), appendDynamicPropertiesExcept(WorkReuseRequirementValue.KnownFieldNames, workReuse, acc_32)));
1567
+ return encodeObject((acc_32 = ofArray([["class", encodeString("WorkReuse")], ["enableReuse", Encode_bool(workReuse.EnableReuse)]]), appendDynamicPropertiesExcept(WorkReuseRequirementValue.KnownFieldNames, workReuse, acc_32)));
958
1568
  }
959
1569
  case /* WorkReuseExpressionRequirement */
960
- 10: {
961
- const expression = r.fields[0];
962
- return yMap(ofArray([["class", string("WorkReuse")], ["enableReuse", string(expression)]]));
1570
+ 11: {
1571
+ const expression_1 = r.fields[0];
1572
+ return encodeObject(ofArray([["class", encodeString("WorkReuse")], ["enableReuse", encodeSchemaSaladString(expression_1)]]));
963
1573
  }
964
1574
  case /* NetworkAccessRequirement */
965
- 11: {
1575
+ 12: {
966
1576
  const networkAccess = r.fields[0];
967
- return yMap((acc_33 = ofArray([["class", string("NetworkAccess")], ["networkAccess", yBool(networkAccess.NetworkAccess)]]), appendDynamicPropertiesExcept(NetworkAccessRequirementValue.KnownFieldNames, networkAccess, acc_33)));
1577
+ return encodeObject((acc_33 = ofArray([["class", encodeString("NetworkAccess")], ["networkAccess", Encode_bool(networkAccess.NetworkAccess)]]), appendDynamicPropertiesExcept(NetworkAccessRequirementValue.KnownFieldNames, networkAccess, acc_33)));
968
1578
  }
969
1579
  case /* NetworkAccessExpressionRequirement */
970
- 12: {
971
- const expression_1 = r.fields[0];
972
- return yMap(ofArray([["class", string("NetworkAccess")], ["networkAccess", string(expression_1)]]));
1580
+ 13: {
1581
+ const expression_2 = r.fields[0];
1582
+ return encodeObject(ofArray([["class", encodeString("NetworkAccess")], ["networkAccess", encodeSchemaSaladString(expression_2)]]));
973
1583
  }
974
1584
  case /* InplaceUpdateRequirement */
975
- 13: {
1585
+ 14: {
976
1586
  const inplaceUpdate = r.fields[0];
977
- return yMap((acc_34 = ofArray([["class", string("InplaceUpdateRequirement")], ["inplaceUpdate", yBool(inplaceUpdate.InplaceUpdate)]]), appendDynamicPropertiesExcept(InplaceUpdateRequirementValue.KnownFieldNames, inplaceUpdate, acc_34)));
1587
+ return encodeObject((acc_34 = ofArray([["class", encodeString("InplaceUpdateRequirement")], ["inplaceUpdate", encodeSchemaSaladBool(inplaceUpdate.InplaceUpdate)]]), appendDynamicPropertiesExcept(InplaceUpdateRequirementValue.KnownFieldNames, inplaceUpdate, acc_34)));
978
1588
  }
979
1589
  case /* ToolTimeLimitRequirement */
980
- 14: {
1590
+ 15: {
981
1591
  const tl = r.fields[0];
982
1592
  const timelimit = tl.tag === /* ToolTimeLimitExpression */
983
- 1 ? string(tl.fields[0]) : YAMLElement_Value(YAMLContent_create_Z1C3A29C9(int64ToString(tl.fields[0])));
984
- return yMap(ofArray([["class", string("ToolTimeLimit")], ["timelimit", timelimit]]));
1593
+ 1 ? encodeSchemaSaladString(tl.fields[0]) : Encode_int64(tl.fields[0]);
1594
+ return encodeObject(ofArray([["class", encodeString("ToolTimeLimit")], ["timelimit", timelimit]]));
985
1595
  }
986
1596
  case /* SubworkflowFeatureRequirement */
987
- 15:
988
- return yMap(singleton(["class", string("SubworkflowFeatureRequirement")]));
989
- case /* ScatterFeatureRequirement */
990
1597
  16:
991
- return yMap(singleton(["class", string("ScatterFeatureRequirement")]));
992
- case /* MultipleInputFeatureRequirement */
1598
+ return encodeObject(singleton(["class", encodeString("SubworkflowFeatureRequirement")]));
1599
+ case /* ScatterFeatureRequirement */
993
1600
  17:
994
- return yMap(singleton(["class", string("MultipleInputFeatureRequirement")]));
995
- case /* StepInputExpressionRequirement */
1601
+ return encodeObject(singleton(["class", encodeString("ScatterFeatureRequirement")]));
1602
+ case /* MultipleInputFeatureRequirement */
996
1603
  18:
997
- return yMap(singleton(["class", string("StepInputExpressionRequirement")]));
1604
+ return encodeObject(singleton(["class", encodeString("MultipleInputFeatureRequirement")]));
1605
+ case /* StepInputExpressionRequirement */
1606
+ 19:
1607
+ return encodeObject(singleton(["class", encodeString("StepInputExpressionRequirement")]));
1608
+ case /* ImportedRequirement */
1609
+ 20:
1610
+ return directive("$import", r.fields[0]);
1611
+ case /* MixedRequirement */
1612
+ 21:
1613
+ return r.fields[0].Node;
1614
+ case /* RawRequirement */
1615
+ 22:
1616
+ return r.fields[0].Node;
998
1617
  default: {
999
- const value$1 = r.fields[0];
1000
- return yMap((acc_2 = (value_2 = (option_1 = value$1.ExpressionLib, option_1 != null ? (entries = value(option_1), entries.length > 0 ? entries : void 0) : void 0), acc_1 = singleton(["class", string("InlineJavascriptRequirement")]), value_2 == null ? acc_1 : append(acc_1, singleton(["expressionLib", YAMLElement_Sequence(ofSeq(map$1(string, value(value_2))))]))), appendDynamicPropertiesExcept(InlineJavascriptRequirementValue.KnownFieldNames, value$1, acc_2)));
1618
+ const value = r.fields[0];
1619
+ return encodeObject((acc_2 = (value_2 = (option_1 = value.ExpressionLib, option_1 != null ? (entries = option_1, entries.length > 0 ? entries : void 0) : void 0), acc_1 = singleton(["class", encodeString("InlineJavascriptRequirement")]), value_2 == null ? acc_1 : append(acc_1, singleton(["expressionLib", encodeSequence(ofSeq(map$1(encodeSchemaSaladString, value_2)))]))), appendDynamicPropertiesExcept(InlineJavascriptRequirementValue.KnownFieldNames, value, acc_2)));
1001
1620
  }
1002
1621
  }
1003
1622
  }
1004
1623
  function encodeHintEntry(hint) {
1005
- if (hint.tag === /* UnknownHint */
1006
- 1) {
1007
- const unknownHint = hint.fields[0];
1008
- return unknownHint.Raw;
1624
+ switch (hint.tag) {
1625
+ case /* UnknownHint */
1626
+ 1: {
1627
+ const unknownHint = hint.fields[0];
1628
+ return unknownHint.Raw.Node;
1629
+ }
1630
+ case /* ImportedHint */
1631
+ 2:
1632
+ return directive("$import", hint.fields[0]);
1633
+ case /* MixedHint */
1634
+ 3:
1635
+ return hint.fields[0].Node;
1636
+ case /* RawHint */
1637
+ 4:
1638
+ return hint.fields[0].Node;
1639
+ default:
1640
+ return encodeRequirement(hint.fields[0]);
1641
+ }
1642
+ }
1643
+ function encodeEntryList(whole, encodeEntry, importedPath, entries) {
1644
+ const matchValue = toList(entries);
1645
+ let matchResult = void 0, single_1 = void 0;
1646
+ if (whole) {
1647
+ if (!isEmpty(matchValue)) {
1648
+ if (isEmpty(tail(matchValue))) {
1649
+ if (importedPath(head(matchValue)) != null) {
1650
+ matchResult = 0;
1651
+ single_1 = head(matchValue);
1652
+ } else {
1653
+ matchResult = 1;
1654
+ }
1655
+ } else {
1656
+ matchResult = 1;
1657
+ }
1658
+ } else {
1659
+ matchResult = 1;
1660
+ }
1661
+ } else {
1662
+ matchResult = 1;
1663
+ }
1664
+ switch (matchResult) {
1665
+ case 0:
1666
+ return directive("$import", value(importedPath(single_1)));
1667
+ default:
1668
+ return encodeSequence(ofSeq(map$1(encodeEntry, entries)));
1669
+ }
1670
+ }
1671
+ function importedRequirementPath(requirement) {
1672
+ if (requirement.tag === /* ImportedRequirement */
1673
+ 20) {
1674
+ return requirement.fields[0];
1675
+ } else {
1676
+ return void 0;
1677
+ }
1678
+ }
1679
+ function importedHintPath(hint) {
1680
+ if (hint.tag === /* ImportedHint */
1681
+ 2) {
1682
+ return hint.fields[0];
1009
1683
  } else {
1010
- return encodeRequirement(hint.fields[0]);
1684
+ return void 0;
1011
1685
  }
1012
1686
  }
1687
+ function encodeHintsField(sourceNodes, hints) {
1688
+ return encodeEntryList(FSharpSet__Contains(sourceNodes.WholeFields, "hints"), encodeHintEntry, importedHintPath, hints);
1689
+ }
1690
+ function encodeRequirementsField(sourceNodes, requirements) {
1691
+ return encodeEntryList(FSharpSet__Contains(sourceNodes.WholeFields, "requirements"), encodeRequirement, importedRequirementPath, requirements);
1692
+ }
1013
1693
  function encodeSourceArray(sources) {
1014
- if (sources.length === 1) {
1015
- return string(item(0, sources));
1694
+ if (sources.tag === /* Multiple */
1695
+ 1) {
1696
+ return YamlNodeModule_sequence(ofSeq(map$1((s) => YamlNodeModule_item(encodeSchemaSaladString(s)), sources.fields[0])));
1016
1697
  } else {
1017
- return YAMLElement_Sequence(ofSeq(map$1((s) => YAMLElement_Object$(singleton(YAMLElement_Value(YAMLContent_create_Z1C3A29C9(s)))), sources)));
1698
+ return encodeSchemaSaladString(sources.fields[0]);
1699
+ }
1700
+ }
1701
+ function encodeLinkMergeMethod(linkMerge) {
1702
+ switch (linkMerge.tag) {
1703
+ case /* IncludedLinkMerge */
1704
+ 3:
1705
+ return directive("$include", linkMerge.fields[0]);
1706
+ case /* MixedLinkMerge */
1707
+ 4:
1708
+ return linkMerge.fields[0].Node;
1709
+ case /* MergeNested */
1710
+ 0:
1711
+ case /* MergeFlattened */
1712
+ 1:
1713
+ return encodeString(linkMerge.AsCwlString);
1714
+ default:
1715
+ return directive("$import", linkMerge.fields[0]);
1018
1716
  }
1019
1717
  }
1020
- function encodeLinkMergeMethod(linkMerge) {
1021
- return string(linkMerge.AsCwlString);
1022
- }
1023
1718
  function encodePickValueMethod(pickValue) {
1024
- return string(pickValue.AsCwlString);
1719
+ switch (pickValue.tag) {
1720
+ case /* IncludedPickValue */
1721
+ 4:
1722
+ return directive("$include", pickValue.fields[0]);
1723
+ case /* MixedPickValue */
1724
+ 5:
1725
+ return pickValue.fields[0].Node;
1726
+ case /* FirstNonNull */
1727
+ 0:
1728
+ case /* TheOnlyNonNull */
1729
+ 1:
1730
+ case /* AllNonNull */
1731
+ 2:
1732
+ return encodeString(pickValue.AsCwlString);
1733
+ default:
1734
+ return directive("$import", pickValue.fields[0]);
1735
+ }
1025
1736
  }
1026
1737
  function encodeScatterMethod(scatterMethod) {
1027
- return string(scatterMethod.AsCwlString);
1738
+ switch (scatterMethod.tag) {
1739
+ case /* IncludedScatterMethod */
1740
+ 4:
1741
+ return directive("$include", scatterMethod.fields[0]);
1742
+ case /* MixedScatterMethod */
1743
+ 5:
1744
+ return scatterMethod.fields[0].Node;
1745
+ case /* DotProduct */
1746
+ 0:
1747
+ case /* NestedCrossProduct */
1748
+ 1:
1749
+ case /* FlatCrossProduct */
1750
+ 2:
1751
+ return encodeString(scatterMethod.AsCwlString);
1752
+ default:
1753
+ return directive("$import", scatterMethod.fields[0]);
1754
+ }
1028
1755
  }
1029
1756
  function encodeStepInput(si) {
1030
1757
  let pairs;
@@ -1038,38 +1765,45 @@ function encodeStepInput(si) {
1038
1765
  let acc_4;
1039
1766
  let acc_2;
1040
1767
  const value_1 = si.Source;
1041
- const acc_1 = empty$1();
1042
- acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["source", encodeSourceArray(value(value_1))]));
1768
+ const acc_1 = empty();
1769
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["source", encodeSourceArray(value_1)]));
1043
1770
  const value_3 = si.DefaultValue;
1044
1771
  const acc_3 = acc_2;
1045
- acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["default", value(value_3)]));
1772
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["default", rawYamlNode(value_3)]));
1046
1773
  const value_6 = si.ValueFrom;
1047
1774
  const acc_5 = acc_4;
1048
- acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["valueFrom", string(value(value_6))]));
1775
+ acc_6 = value_6 == null ? acc_5 : append(acc_5, singleton(["valueFrom", encodeSchemaSaladString(value_6)]));
1049
1776
  const value_8 = si.LinkMerge;
1050
1777
  const acc_7 = acc_6;
1051
- acc_8 = value_8 == null ? acc_7 : append(acc_7, singleton(["linkMerge", encodeLinkMergeMethod(value(value_8))]));
1778
+ acc_8 = value_8 == null ? acc_7 : append(acc_7, singleton(["linkMerge", encodeLinkMergeMethod(value_8)]));
1052
1779
  const value_10 = si.PickValue;
1053
1780
  const acc_9 = acc_8;
1054
- acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["pickValue", encodePickValueMethod(value(value_10))]));
1055
- const value_13 = si.Doc;
1781
+ acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["pickValue", encodePickValueMethod(value_10)]));
1782
+ let encoder_5;
1783
+ const source = si.SourceNodes.Doc;
1784
+ encoder_5 = (doc) => encodeDocValue(source, doc);
1785
+ const value_12 = si.Doc;
1056
1786
  const acc_11 = acc_10;
1057
- acc_12 = value_13 == null ? acc_11 : append(acc_11, singleton(["doc", string(value(value_13))]));
1787
+ acc_12 = value_12 == null ? acc_11 : append(acc_11, singleton(["doc", encoder_5(value_12)]));
1058
1788
  const value_15 = si.LoadContents;
1059
1789
  const acc_13 = acc_12;
1060
- acc_14 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", yBool(value(value_15))]));
1790
+ acc_14 = value_15 == null ? acc_13 : append(acc_13, singleton(["loadContents", encodeSchemaSaladBool(value_15)]));
1061
1791
  const value_18 = si.LoadListing;
1062
1792
  const acc_15 = acc_14;
1063
- acc_16 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", string(value(value_18))]));
1064
- const value_21 = si.Label;
1793
+ acc_16 = value_18 == null ? acc_15 : append(acc_15, singleton(["loadListing", encodeLoadListing(value_18)]));
1794
+ let encoder_9;
1795
+ const source_1 = si.SourceNodes.Label;
1796
+ encoder_9 = (label) => encodeLabelValue(source_1, label);
1797
+ const value_20 = si.Label;
1065
1798
  const acc_17 = acc_16;
1066
- acc_18 = value_21 == null ? acc_17 : append(acc_17, singleton(["label", string(value(value_21))]));
1799
+ acc_18 = value_20 == null ? acc_17 : append(acc_17, singleton(["label", encoder_9(value_20)]));
1067
1800
  pairs = appendDynamicPropertiesExcept(StepInput.KnownFieldNames, si, acc_18);
1068
1801
  let matchResult = void 0, s_1 = void 0;
1069
1802
  if (!isEmpty(pairs)) {
1070
1803
  if (head(pairs)[0] === "source") {
1071
1804
  if (isEmpty(tail(pairs))) {
1072
- if (si.DefaultValue == null && si.ValueFrom == null && si.LinkMerge == null && si.PickValue == null && si.Doc == null && si.LoadContents == null && si.LoadListing == null && si.Label == null) {
1805
+ if (!(head(pairs)[1].Kind.tag === /* Mapping */
1806
+ 1) && si.DefaultValue == null && si.ValueFrom == null && si.LinkMerge == null && si.PickValue == null && si.Doc == null && si.LoadContents == null && si.LoadListing == null && si.Label == null) {
1073
1807
  matchResult = 0;
1074
1808
  s_1 = head(pairs)[1];
1075
1809
  } else {
@@ -1088,115 +1822,166 @@ function encodeStepInput(si) {
1088
1822
  case 0:
1089
1823
  return [si.Id, s_1];
1090
1824
  default:
1091
- return [si.Id, yMap(pairs)];
1825
+ return [si.Id, encodeObject(pairs)];
1092
1826
  }
1093
1827
  }
1094
- function encodeStepInputs(inputs) {
1095
- return yMap(toList(map$1(encodeStepInput, inputs)));
1828
+ function encodeStepInputs(whole, inputs) {
1829
+ return encodeIdEntries("id", "source", whole, toList(map$1((entry) => ListEntry$1.map(encodeStepInput, entry), inputs)));
1096
1830
  }
1097
1831
  function encodeStepOutputParameter(so) {
1098
1832
  let acc = void 0;
1099
- return yMap((acc = singleton(["id", string(so.Id)]), appendDynamicPropertiesExcept(StepOutputParameter.KnownFieldNames, so, acc)));
1100
- }
1101
- function encodeStepOutputs(outputs) {
1102
- return YAMLElement_Sequence(ofSeq(map$1((output) => {
1103
- if (output.tag === /* StepOutputRecord */
1104
- 1) {
1105
- return encodeStepOutputParameter(output.fields[0]);
1833
+ return encodeObject((acc = singleton(["id", encodeString(so.Id)]), appendDynamicPropertiesExcept(StepOutputParameter.KnownFieldNames, so, acc)));
1834
+ }
1835
+ function encodeStepOutputs(whole, outputs) {
1836
+ const matchValue = toList(outputs);
1837
+ let matchResult = void 0, path = void 0;
1838
+ if (whole) {
1839
+ if (!isEmpty(matchValue)) {
1840
+ if (head(matchValue).tag === /* StepOutputImport */
1841
+ 3) {
1842
+ if (isEmpty(tail(matchValue))) {
1843
+ matchResult = 0;
1844
+ path = head(matchValue).fields[0];
1845
+ } else {
1846
+ matchResult = 1;
1847
+ }
1848
+ } else {
1849
+ matchResult = 1;
1850
+ }
1106
1851
  } else {
1107
- return string(output.fields[0]);
1852
+ matchResult = 1;
1108
1853
  }
1109
- }, outputs)));
1854
+ } else {
1855
+ matchResult = 1;
1856
+ }
1857
+ switch (matchResult) {
1858
+ case 0:
1859
+ return directive("$import", path);
1860
+ default:
1861
+ return encodeSequence(ofSeq(map$1((output) => {
1862
+ switch (output.tag) {
1863
+ case /* StepOutputRecord */
1864
+ 1:
1865
+ return encodeStepOutputParameter(output.fields[0]);
1866
+ case /* StepOutputInclude */
1867
+ 2:
1868
+ return directive("$include", output.fields[0]);
1869
+ case /* StepOutputImport */
1870
+ 3:
1871
+ return directive("$import", output.fields[0]);
1872
+ case /* StepOutputMixed */
1873
+ 4:
1874
+ return output.fields[0].Node;
1875
+ default:
1876
+ return encodeString(output.fields[0]);
1877
+ }
1878
+ }, outputs)));
1879
+ }
1110
1880
  }
1111
1881
  function encodeScatter(scatter) {
1112
1882
  if (scatter.length === 1) {
1113
- return string(item(0, scatter));
1883
+ return encodeSchemaSaladString(item(0, scatter));
1114
1884
  } else {
1115
- return YAMLElement_Sequence(ofSeq(map$1(string, scatter)));
1885
+ return encodeSequence(ofSeq(map$1(encodeSchemaSaladString, scatter)));
1116
1886
  }
1117
1887
  }
1118
- function encodeWorkflowStepRun(run) {
1888
+ function encodeRunWithin(ancestors, run) {
1119
1889
  switch (run.tag) {
1890
+ case /* RunImport */
1891
+ 1:
1892
+ return directive("$import", run.fields[0]);
1893
+ case /* RunMixed */
1894
+ 2:
1895
+ return run.fields[0].Node;
1896
+ case /* RunRaw */
1897
+ 3:
1898
+ return run.fields[0].Node;
1120
1899
  case /* RunCommandLineTool */
1121
- 1: {
1900
+ 4: {
1122
1901
  const toolObj = run.fields[0];
1123
1902
  const matchValue = WorkflowStepRunOps_tryGetTool(run);
1124
1903
  if (matchValue == null) {
1125
1904
  throw ArgumentException_$ctor_Z721C83C5(`RunCommandLineTool must contain CWLToolDescription but got ${interpolate("%A%P()", [toolObj])}`);
1126
1905
  } else {
1127
- return encodeToolDescriptionElement(value(matchValue));
1906
+ return encodeToolDescriptionElement(matchValue);
1128
1907
  }
1129
1908
  }
1130
1909
  case /* RunWorkflow */
1131
- 2: {
1910
+ 5: {
1132
1911
  const workflowObj = run.fields[0];
1133
1912
  const matchValue_1 = WorkflowStepRunOps_tryGetWorkflow(run);
1134
1913
  if (matchValue_1 == null) {
1135
1914
  throw ArgumentException_$ctor_Z721C83C5(`RunWorkflow must contain CWLWorkflowDescription but got ${interpolate("%A%P()", [workflowObj])}`);
1136
1915
  } else {
1137
- return encodeWorkflowDescriptionElement(value(matchValue_1));
1916
+ return encodeWorkflowWithin(ancestors, matchValue_1);
1138
1917
  }
1139
1918
  }
1140
1919
  case /* RunExpressionTool */
1141
- 3: {
1920
+ 6: {
1142
1921
  const expressionToolObj = run.fields[0];
1143
1922
  const matchValue_2 = WorkflowStepRunOps_tryGetExpressionTool(run);
1144
1923
  if (matchValue_2 == null) {
1145
1924
  throw ArgumentException_$ctor_Z721C83C5(`RunExpressionTool must contain CWLExpressionToolDescription but got ${interpolate("%A%P()", [expressionToolObj])}`);
1146
1925
  } else {
1147
- return encodeExpressionToolDescriptionElement(value(matchValue_2));
1926
+ return encodeExpressionToolDescriptionElement(matchValue_2);
1148
1927
  }
1149
1928
  }
1150
1929
  case /* RunOperation */
1151
- 4: {
1930
+ 7: {
1152
1931
  const operationObj = run.fields[0];
1153
1932
  const matchValue_3 = WorkflowStepRunOps_tryGetOperation(run);
1154
1933
  if (matchValue_3 == null) {
1155
1934
  throw ArgumentException_$ctor_Z721C83C5(`RunOperation must contain CWLOperationDescription but got ${interpolate("%A%P()", [operationObj])}`);
1156
1935
  } else {
1157
- return encodeOperationDescriptionElement(value(matchValue_3));
1936
+ return encodeOperationDescriptionElement(matchValue_3);
1158
1937
  }
1159
1938
  }
1160
1939
  default:
1161
- return string(run.fields[0]);
1940
+ return encodeString(run.fields[0]);
1162
1941
  }
1163
1942
  }
1164
1943
  function encodeToolDescriptionElement(td) {
1165
- let intent = void 0, h = void 0, r = void 0, bc = void 0, matchValue_3 = void 0, i = void 0, i_1 = void 0;
1944
+ let intent = void 0, h = void 0, r = void 0, bc = void 0, acc_20 = void 0, acc_18 = void 0, acc_16 = void 0, acc_14 = void 0, acc_12 = void 0, acc_10 = void 0, value_6 = void 0, acc_9 = void 0, value_9 = void 0, acc_11 = void 0, value_12 = void 0, acc_13 = void 0, value_15 = void 0, acc_15 = void 0, encoder_8 = void 0, whole_1 = void 0, value_17 = void 0, acc_17 = void 0, encoder_10 = void 0, whole_2 = void 0, value_19 = void 0, acc_19 = void 0, encoder_12 = void 0, whole_3 = void 0, value_21 = void 0, acc_21 = void 0, entries = void 0, entries_1 = void 0;
1166
1945
  let basePairs;
1167
1946
  let acc_6;
1168
1947
  let acc_4;
1169
1948
  let acc_2;
1170
- const acc = ofArray([["cwlVersion", string(td.CWLVersion)], ["class", string("CommandLineTool")]]);
1949
+ const acc = ofArray([["cwlVersion", encodeString(td.CWLVersion)], ["class", encodeString("CommandLineTool")]]);
1171
1950
  let pairOpt_1;
1172
1951
  const option_1 = td.Id;
1173
- pairOpt_1 = option_1 != null ? ["id", string(value(option_1))] : void 0;
1952
+ pairOpt_1 = option_1 != null ? ["id", encodeString(option_1)] : void 0;
1174
1953
  const acc_1 = acc;
1175
- acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1176
- let pairOpt_3;
1177
- const option_3 = td.Label;
1178
- pairOpt_3 = option_3 != null ? encodeLabel(value(option_3)) : void 0;
1954
+ acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(pairOpt_1));
1955
+ let encoder;
1956
+ const source = td.SourceNodes.Label;
1957
+ encoder = (label) => encodeLabelValue(source, label);
1958
+ const value_1 = td.Label;
1179
1959
  const acc_3 = acc_2;
1180
- acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1181
- let pairOpt_5;
1182
- const option_5 = td.Doc;
1183
- pairOpt_5 = option_5 != null ? encodeDoc(value(option_5)) : void 0;
1960
+ acc_4 = value_1 == null ? acc_3 : append(acc_3, singleton(["label", encoder(value_1)]));
1961
+ let encoder_2;
1962
+ const source_1 = td.SourceNodes.Doc;
1963
+ encoder_2 = (doc) => encodeProcessDocValue(source_1, doc);
1964
+ const value_3 = td.Doc;
1184
1965
  const acc_5 = acc_4;
1185
- acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1186
- let pairOpt_7;
1187
- let option_9;
1188
- const option_7 = td.Intent;
1189
- option_9 = option_7 != null ? (intent = value(option_7), intent.length > 0) ? option_7 : void 0 : void 0;
1190
- pairOpt_7 = option_9 != null ? encodeIntent(value(option_9)) : void 0;
1966
+ acc_6 = value_3 == null ? acc_5 : append(acc_5, singleton(["doc", encoder_2(value_3)]));
1967
+ let pairOpt_3;
1968
+ let option_4;
1969
+ const option_3 = td.Intent;
1970
+ option_4 = option_3 != null ? (intent = option_3, intent.length > 0) ? option_3 : void 0 : void 0;
1971
+ let mapping_2;
1972
+ const whole = FSharpSet__Contains(td.SourceNodes.WholeFields, "intent");
1973
+ mapping_2 = (intent_1) => encodeIntent(whole, intent_1);
1974
+ const option_5 = option_4;
1975
+ pairOpt_3 = option_5 != null ? mapping_2(option_5) : void 0;
1191
1976
  const acc_7 = acc_6;
1192
- basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
1977
+ basePairs = pairOpt_3 == null ? acc_7 : append(acc_7, singleton(pairOpt_3));
1193
1978
  let withHints;
1194
1979
  const matchValue = td.Hints;
1195
1980
  let matchResult = void 0, h_1 = void 0;
1196
1981
  if (matchValue != null) {
1197
- if (h = value(matchValue), h.length > 0) {
1982
+ if (h = matchValue, h.length > 0) {
1198
1983
  matchResult = 0;
1199
- h_1 = value(matchValue);
1984
+ h_1 = matchValue;
1200
1985
  } else {
1201
1986
  matchResult = 1;
1202
1987
  }
@@ -1205,7 +1990,7 @@ function encodeToolDescriptionElement(td) {
1205
1990
  }
1206
1991
  switch (matchResult) {
1207
1992
  case 0: {
1208
- withHints = append(basePairs, singleton(["hints", YAMLElement_Sequence(ofSeq(map$1(encodeHintEntry, h_1)))]));
1993
+ withHints = append(basePairs, singleton(["hints", encodeHintsField(td.SourceNodes, h_1)]));
1209
1994
  break;
1210
1995
  }
1211
1996
  default:
@@ -1215,9 +2000,9 @@ function encodeToolDescriptionElement(td) {
1215
2000
  const matchValue_1 = td.Requirements;
1216
2001
  let matchResult_1 = void 0, r_1 = void 0;
1217
2002
  if (matchValue_1 != null) {
1218
- if (r = value(matchValue_1), r.length > 0) {
2003
+ if (r = matchValue_1, r.length > 0) {
1219
2004
  matchResult_1 = 0;
1220
- r_1 = value(matchValue_1);
2005
+ r_1 = matchValue_1;
1221
2006
  } else {
1222
2007
  matchResult_1 = 1;
1223
2008
  }
@@ -1226,7 +2011,7 @@ function encodeToolDescriptionElement(td) {
1226
2011
  }
1227
2012
  switch (matchResult_1) {
1228
2013
  case 0: {
1229
- withRequirements = append(withHints, singleton(["requirements", YAMLElement_Sequence(ofSeq(map$1(encodeRequirement, r_1)))]));
2014
+ withRequirements = append(withHints, singleton(["requirements", encodeRequirementsField(td.SourceNodes, r_1)]));
1230
2015
  break;
1231
2016
  }
1232
2017
  default:
@@ -1236,9 +2021,9 @@ function encodeToolDescriptionElement(td) {
1236
2021
  const matchValue_2 = td.BaseCommand;
1237
2022
  let matchResult_2 = void 0, bc_1 = void 0;
1238
2023
  if (matchValue_2 != null) {
1239
- if (bc = value(matchValue_2), bc.length > 0) {
2024
+ if (bc = matchValue_2, bc.length > 0) {
1240
2025
  matchResult_2 = 0;
1241
- bc_1 = value(matchValue_2);
2026
+ bc_1 = matchValue_2;
1242
2027
  } else {
1243
2028
  matchResult_2 = 1;
1244
2029
  }
@@ -1247,82 +2032,60 @@ function encodeToolDescriptionElement(td) {
1247
2032
  }
1248
2033
  switch (matchResult_2) {
1249
2034
  case 0: {
1250
- withBaseCommand = append(withRequirements, singleton(["baseCommand", YAMLElement_Sequence(ofSeq(map$1(string, bc_1)))]));
2035
+ withBaseCommand = append(withRequirements, singleton(["baseCommand", encodeSequence(ofSeq(map$1(encodeSchemaSaladString, bc_1)))]));
1251
2036
  break;
1252
2037
  }
1253
2038
  default:
1254
2039
  withBaseCommand = withRequirements;
1255
2040
  }
1256
- let withCommandFields;
1257
- let acc_20;
1258
- let acc_18;
1259
- let acc_16;
1260
- let acc_14;
1261
- let acc_12;
1262
- let acc_10;
1263
- const value_2 = td.Arguments;
1264
- const acc_9 = withBaseCommand;
1265
- acc_10 = value_2 == null ? acc_9 : append(acc_9, singleton(["arguments", value(value_2)]));
1266
- const value_5 = td.Stdin;
1267
- const acc_11 = acc_10;
1268
- acc_12 = value_5 == null ? acc_11 : append(acc_11, singleton(["stdin", string(value(value_5))]));
1269
- const value_8 = td.Stderr;
1270
- const acc_13 = acc_12;
1271
- acc_14 = value_8 == null ? acc_13 : append(acc_13, singleton(["stderr", string(value(value_8))]));
1272
- const value_11 = td.Stdout;
1273
- const acc_15 = acc_14;
1274
- acc_16 = value_11 == null ? acc_15 : append(acc_15, singleton(["stdout", string(value(value_11))]));
1275
- const value_14 = td.SuccessCodes;
1276
- const acc_17 = acc_16;
1277
- acc_18 = value_14 == null ? acc_17 : append(acc_17, singleton(["successCodes", YAMLElement_Sequence(ofSeq(map$1(int, value(value_14))))]));
1278
- const value_17 = td.TemporaryFailCodes;
1279
- const acc_19 = acc_18;
1280
- acc_20 = value_17 == null ? acc_19 : append(acc_19, singleton(["temporaryFailCodes", YAMLElement_Sequence(ofSeq(map$1(int, value(value_17))))]));
1281
- const value_20 = td.PermanentFailCodes;
1282
- const acc_21 = acc_20;
1283
- withCommandFields = value_20 == null ? acc_21 : append(acc_21, singleton(["permanentFailCodes", YAMLElement_Sequence(ofSeq(map$1(int, value(value_20))))]));
1284
- 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$1(encodeCWLInput, i_1)))]))) : withCommandFields : withCommandFields), singleton(["outputs", yMap(toList(map$1(encodeCWLOutput, td.Outputs)))]));
2041
+ const withOutputs = append(append((acc_20 = (acc_18 = (acc_16 = (acc_14 = (acc_12 = (acc_10 = (value_6 = td.Arguments, acc_9 = withBaseCommand, value_6 == null ? acc_9 : append(acc_9, singleton(["arguments", rawYamlNode(value_6)]))), value_9 = td.Stdin, acc_11 = acc_10, value_9 == null ? acc_11 : append(acc_11, singleton(["stdin", encodeSchemaSaladString(value_9)]))), value_12 = td.Stderr, acc_13 = acc_12, value_12 == null ? acc_13 : append(acc_13, singleton(["stderr", encodeSchemaSaladString(value_12)]))), value_15 = td.Stdout, acc_15 = acc_14, value_15 == null ? acc_15 : append(acc_15, singleton(["stdout", encodeSchemaSaladString(value_15)]))), encoder_8 = (whole_1 = FSharpSet__Contains(td.SourceNodes.WholeFields, "successCodes"), (codes) => encodeIntList(whole_1, codes)), value_17 = td.SuccessCodes, acc_17 = acc_16, value_17 == null ? acc_17 : append(acc_17, singleton(["successCodes", encoder_8(value_17)]))), encoder_10 = (whole_2 = FSharpSet__Contains(td.SourceNodes.WholeFields, "temporaryFailCodes"), (codes_1) => encodeIntList(whole_2, codes_1)), value_19 = td.TemporaryFailCodes, acc_19 = acc_18, value_19 == null ? acc_19 : append(acc_19, singleton(["temporaryFailCodes", encoder_10(value_19)]))), encoder_12 = (whole_3 = FSharpSet__Contains(td.SourceNodes.WholeFields, "permanentFailCodes"), (codes_2) => encodeIntList(whole_3, codes_2)), value_21 = td.PermanentFailCodes, acc_21 = acc_20, value_21 == null ? acc_21 : append(acc_21, singleton(["permanentFailCodes", encoder_12(value_21)]))), singleton(["inputs", (entries = toList(map$1((entry) => ListEntry$1.map(encodeCWLInput, entry), defaultArg(td.Inputs, []))), encodeIdEntries("id", "type", FSharpSet__Contains(td.SourceNodes.WholeFields, "inputs"), entries))])), singleton(["outputs", (entries_1 = toList(map$1((entry_1) => ListEntry$1.map(encodeCWLOutput, entry_1), td.Outputs)), encodeIdEntries("id", "type", FSharpSet__Contains(td.SourceNodes.WholeFields, "outputs"), entries_1))]));
1285
2042
  let withMetadata;
1286
- const matchValue_4 = td.Metadata;
1287
- withMetadata = matchValue_4 == null ? withOutputs : appendDynamicProperties(value(matchValue_4), withOutputs);
1288
- return yMap(appendDynamicPropertiesExcept(CWLToolDescription.KnownFieldNames, td, withMetadata));
2043
+ const matchValue_3 = td.Metadata;
2044
+ withMetadata = matchValue_3 == null ? withOutputs : appendDynamicProperties(matchValue_3, withOutputs);
2045
+ return encodeObject(appendDynamicPropertiesExcept(CWLToolDescription.KnownFieldNames, td, withMetadata));
1289
2046
  }
1290
2047
  function encodeExpressionToolDescriptionElement(et) {
1291
- let intent = void 0, h = void 0, r = void 0, matchValue_2 = void 0, i = void 0, i_1 = void 0;
2048
+ let intent = void 0, h = void 0, matchValue_1 = void 0, r = void 0, r_1 = void 0, entries = void 0, entries_1 = void 0;
1292
2049
  let basePairs;
1293
2050
  let acc_6;
1294
2051
  let acc_4;
1295
2052
  let acc_2;
1296
- const acc = ofArray([["cwlVersion", string(et.CWLVersion)], ["class", string("ExpressionTool")]]);
2053
+ const acc = ofArray([["cwlVersion", encodeString(et.CWLVersion)], ["class", encodeString("ExpressionTool")]]);
1297
2054
  let pairOpt_1;
1298
2055
  const option_1 = et.Id;
1299
- pairOpt_1 = option_1 != null ? ["id", string(value(option_1))] : void 0;
2056
+ pairOpt_1 = option_1 != null ? ["id", encodeString(option_1)] : void 0;
1300
2057
  const acc_1 = acc;
1301
- acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1302
- let pairOpt_3;
1303
- const option_3 = et.Label;
1304
- pairOpt_3 = option_3 != null ? encodeLabel(value(option_3)) : void 0;
2058
+ acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(pairOpt_1));
2059
+ let encoder;
2060
+ const source = et.SourceNodes.Label;
2061
+ encoder = (label) => encodeLabelValue(source, label);
2062
+ const value_1 = et.Label;
1305
2063
  const acc_3 = acc_2;
1306
- acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1307
- let pairOpt_5;
1308
- const option_5 = et.Doc;
1309
- pairOpt_5 = option_5 != null ? encodeDoc(value(option_5)) : void 0;
2064
+ acc_4 = value_1 == null ? acc_3 : append(acc_3, singleton(["label", encoder(value_1)]));
2065
+ let encoder_2;
2066
+ const source_1 = et.SourceNodes.Doc;
2067
+ encoder_2 = (doc) => encodeProcessDocValue(source_1, doc);
2068
+ const value_3 = et.Doc;
1310
2069
  const acc_5 = acc_4;
1311
- acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1312
- let pairOpt_7;
1313
- let option_9;
1314
- const option_7 = et.Intent;
1315
- option_9 = option_7 != null ? (intent = value(option_7), intent.length > 0) ? option_7 : void 0 : void 0;
1316
- pairOpt_7 = option_9 != null ? encodeIntent(value(option_9)) : void 0;
2070
+ acc_6 = value_3 == null ? acc_5 : append(acc_5, singleton(["doc", encoder_2(value_3)]));
2071
+ let pairOpt_3;
2072
+ let option_4;
2073
+ const option_3 = et.Intent;
2074
+ option_4 = option_3 != null ? (intent = option_3, intent.length > 0) ? option_3 : void 0 : void 0;
2075
+ let mapping_2;
2076
+ const whole = FSharpSet__Contains(et.SourceNodes.WholeFields, "intent");
2077
+ mapping_2 = (intent_1) => encodeIntent(whole, intent_1);
2078
+ const option_5 = option_4;
2079
+ pairOpt_3 = option_5 != null ? mapping_2(option_5) : void 0;
1317
2080
  const acc_7 = acc_6;
1318
- basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
2081
+ basePairs = pairOpt_3 == null ? acc_7 : append(acc_7, singleton(pairOpt_3));
1319
2082
  let withHints;
1320
2083
  const matchValue = et.Hints;
1321
2084
  let matchResult = void 0, h_1 = void 0;
1322
2085
  if (matchValue != null) {
1323
- if (h = value(matchValue), h.length > 0) {
2086
+ if (h = matchValue, h.length > 0) {
1324
2087
  matchResult = 0;
1325
- h_1 = value(matchValue);
2088
+ h_1 = matchValue;
1326
2089
  } else {
1327
2090
  matchResult = 1;
1328
2091
  }
@@ -1331,75 +2094,60 @@ function encodeExpressionToolDescriptionElement(et) {
1331
2094
  }
1332
2095
  switch (matchResult) {
1333
2096
  case 0: {
1334
- withHints = append(basePairs, singleton(["hints", YAMLElement_Sequence(ofSeq(map$1(encodeHintEntry, h_1)))]));
2097
+ withHints = append(basePairs, singleton(["hints", encodeHintsField(et.SourceNodes, h_1)]));
1335
2098
  break;
1336
2099
  }
1337
2100
  default:
1338
2101
  withHints = basePairs;
1339
2102
  }
1340
- let withRequirements;
1341
- const matchValue_1 = et.Requirements;
1342
- let matchResult_1 = void 0, r_1 = void 0;
1343
- if (matchValue_1 != null) {
1344
- if (r = value(matchValue_1), r.length > 0) {
1345
- matchResult_1 = 0;
1346
- r_1 = value(matchValue_1);
1347
- } else {
1348
- matchResult_1 = 1;
1349
- }
1350
- } else {
1351
- matchResult_1 = 1;
1352
- }
1353
- switch (matchResult_1) {
1354
- case 0: {
1355
- withRequirements = append(withHints, singleton(["requirements", YAMLElement_Sequence(ofSeq(map$1(encodeRequirement, r_1)))]));
1356
- break;
1357
- }
1358
- default:
1359
- withRequirements = withHints;
1360
- }
1361
- 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$1(encodeCWLInput, i_1)))]))) : withRequirements : withRequirements), singleton(["outputs", yMap(toList(map$1(encodeCWLOutput, et.Outputs)))])), singleton(["expression", encodeExpressionScalar(et.Expression)]));
2103
+ const withExpression = append(append(append((matchValue_1 = et.Requirements, matchValue_1 != null ? (r = matchValue_1, r.length > 0) ? (r_1 = matchValue_1, append(withHints, singleton(["requirements", encodeRequirementsField(et.SourceNodes, r_1)]))) : withHints : withHints), singleton(["inputs", (entries = toList(map$1((entry) => ListEntry$1.map(encodeCWLInput, entry), defaultArg(et.Inputs, []))), encodeIdEntries("id", "type", FSharpSet__Contains(et.SourceNodes.WholeFields, "inputs"), entries))])), singleton(["outputs", (entries_1 = toList(map$1((entry_1) => ListEntry$1.map(encodeCWLOutput, entry_1), et.Outputs)), encodeIdEntries("id", "type", FSharpSet__Contains(et.SourceNodes.WholeFields, "outputs"), entries_1))])), singleton(["expression", encodeSchemaSaladStringWith(encodeExpressionScalar, et.Expression)]));
1362
2104
  let withMetadata;
1363
- const matchValue_3 = et.Metadata;
1364
- withMetadata = matchValue_3 == null ? withExpression : appendDynamicProperties(value(matchValue_3), withExpression);
1365
- return yMap(appendDynamicPropertiesExcept(CWLExpressionToolDescription.KnownFieldNames, et, withMetadata));
2105
+ const matchValue_2 = et.Metadata;
2106
+ withMetadata = matchValue_2 == null ? withExpression : appendDynamicProperties(matchValue_2, withExpression);
2107
+ return encodeObject(appendDynamicPropertiesExcept(CWLExpressionToolDescription.KnownFieldNames, et, withMetadata));
1366
2108
  }
1367
2109
  function encodeOperationDescriptionElement(op) {
1368
- let intent = void 0, h = void 0, matchValue_1 = void 0, r = void 0, r_1 = void 0;
2110
+ let intent = void 0, h = void 0, matchValue_1 = void 0, r = void 0, r_1 = void 0, entries = void 0, entries_1 = void 0;
1369
2111
  let basePairs;
1370
2112
  let acc_6;
1371
2113
  let acc_4;
1372
2114
  let acc_2;
1373
- const acc = ofArray([["cwlVersion", string(op.CWLVersion)], ["class", string("Operation")]]);
2115
+ const acc = ofArray([["cwlVersion", encodeString(op.CWLVersion)], ["class", encodeString("Operation")]]);
1374
2116
  let pairOpt_1;
1375
2117
  const option_1 = op.Id;
1376
- pairOpt_1 = option_1 != null ? ["id", string(value(option_1))] : void 0;
2118
+ pairOpt_1 = option_1 != null ? ["id", encodeString(option_1)] : void 0;
1377
2119
  const acc_1 = acc;
1378
- acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1379
- let pairOpt_3;
1380
- const option_3 = op.Label;
1381
- pairOpt_3 = option_3 != null ? encodeLabel(value(option_3)) : void 0;
2120
+ acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(pairOpt_1));
2121
+ let encoder;
2122
+ const source = op.SourceNodes.Label;
2123
+ encoder = (label) => encodeLabelValue(source, label);
2124
+ const value_1 = op.Label;
1382
2125
  const acc_3 = acc_2;
1383
- acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1384
- let pairOpt_5;
1385
- const option_5 = op.Doc;
1386
- pairOpt_5 = option_5 != null ? encodeDoc(value(option_5)) : void 0;
2126
+ acc_4 = value_1 == null ? acc_3 : append(acc_3, singleton(["label", encoder(value_1)]));
2127
+ let encoder_2;
2128
+ const source_1 = op.SourceNodes.Doc;
2129
+ encoder_2 = (doc) => encodeProcessDocValue(source_1, doc);
2130
+ const value_3 = op.Doc;
1387
2131
  const acc_5 = acc_4;
1388
- acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1389
- let pairOpt_7;
1390
- let option_9;
1391
- const option_7 = op.Intent;
1392
- option_9 = option_7 != null ? (intent = value(option_7), intent.length > 0) ? option_7 : void 0 : void 0;
1393
- pairOpt_7 = option_9 != null ? encodeIntent(value(option_9)) : void 0;
2132
+ acc_6 = value_3 == null ? acc_5 : append(acc_5, singleton(["doc", encoder_2(value_3)]));
2133
+ let pairOpt_3;
2134
+ let option_4;
2135
+ const option_3 = op.Intent;
2136
+ option_4 = option_3 != null ? (intent = option_3, intent.length > 0) ? option_3 : void 0 : void 0;
2137
+ let mapping_2;
2138
+ const whole = FSharpSet__Contains(op.SourceNodes.WholeFields, "intent");
2139
+ mapping_2 = (intent_1) => encodeIntent(whole, intent_1);
2140
+ const option_5 = option_4;
2141
+ pairOpt_3 = option_5 != null ? mapping_2(option_5) : void 0;
1394
2142
  const acc_7 = acc_6;
1395
- basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
2143
+ basePairs = pairOpt_3 == null ? acc_7 : append(acc_7, singleton(pairOpt_3));
1396
2144
  let withHints;
1397
2145
  const matchValue = op.Hints;
1398
2146
  let matchResult = void 0, h_1 = void 0;
1399
2147
  if (matchValue != null) {
1400
- if (h = value(matchValue), h.length > 0) {
2148
+ if (h = matchValue, h.length > 0) {
1401
2149
  matchResult = 0;
1402
- h_1 = value(matchValue);
2150
+ h_1 = matchValue;
1403
2151
  } else {
1404
2152
  matchResult = 1;
1405
2153
  }
@@ -1408,54 +2156,63 @@ function encodeOperationDescriptionElement(op) {
1408
2156
  }
1409
2157
  switch (matchResult) {
1410
2158
  case 0: {
1411
- withHints = append(basePairs, singleton(["hints", YAMLElement_Sequence(ofSeq(map$1(encodeHintEntry, h_1)))]));
2159
+ withHints = append(basePairs, singleton(["hints", encodeHintsField(op.SourceNodes, h_1)]));
1412
2160
  break;
1413
2161
  }
1414
2162
  default:
1415
2163
  withHints = basePairs;
1416
2164
  }
1417
- 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$1(encodeRequirement, r_1)))]))) : withHints : withHints), singleton(["inputs", yMap(toList(map$1(encodeCWLInput, op.Inputs)))])), singleton(["outputs", yMap(toList(map$1(encodeCWLOutput, op.Outputs)))]));
2165
+ const withOutputs = append(append((matchValue_1 = op.Requirements, matchValue_1 != null ? (r = matchValue_1, r.length > 0) ? (r_1 = matchValue_1, append(withHints, singleton(["requirements", encodeRequirementsField(op.SourceNodes, r_1)]))) : withHints : withHints), singleton(["inputs", (entries = toList(map$1((entry) => ListEntry$1.map(encodeCWLInput, entry), op.Inputs)), encodeIdEntries("id", "type", FSharpSet__Contains(op.SourceNodes.WholeFields, "inputs"), entries))])), singleton(["outputs", (entries_1 = toList(map$1((entry_1) => ListEntry$1.map(encodeCWLOutput, entry_1), op.Outputs)), encodeIdEntries("id", "type", FSharpSet__Contains(op.SourceNodes.WholeFields, "outputs"), entries_1))]));
1418
2166
  let withMetadata;
1419
2167
  const matchValue_2 = op.Metadata;
1420
- withMetadata = matchValue_2 == null ? withOutputs : appendDynamicProperties(value(matchValue_2), withOutputs);
1421
- return yMap(appendDynamicPropertiesExcept(CWLOperationDescription.KnownFieldNames, op, withMetadata));
2168
+ withMetadata = matchValue_2 == null ? withOutputs : appendDynamicProperties(matchValue_2, withOutputs);
2169
+ return encodeObject(appendDynamicPropertiesExcept(CWLOperationDescription.KnownFieldNames, op, withMetadata));
1422
2170
  }
1423
- function encodeWorkflowDescriptionElement(wd) {
1424
- let intent = void 0, h = void 0, matchValue_1 = void 0, r = void 0, r_1 = void 0;
2171
+ function encodeWorkflowWithin(ancestors, wd) {
2172
+ let intent = void 0, h = void 0, matchValue_1 = void 0, r = void 0, r_1 = void 0, entries = void 0, entries_1 = void 0;
2173
+ if (exists((ancestor) => ancestor === wd, ancestors)) {
2174
+ throw ArgumentException_$ctor_Z721C83C5("A step of the workflow holds the workflow itself as its inline run, so the workflow has no text of finite length.");
2175
+ }
1425
2176
  let basePairs;
1426
2177
  let acc_6;
1427
2178
  let acc_4;
1428
2179
  let acc_2;
1429
- const acc = ofArray([["cwlVersion", string(wd.CWLVersion)], ["class", string("Workflow")]]);
2180
+ const acc = ofArray([["cwlVersion", encodeString(wd.CWLVersion)], ["class", encodeString("Workflow")]]);
1430
2181
  let pairOpt_1;
1431
2182
  const option_1 = wd.Id;
1432
- pairOpt_1 = option_1 != null ? ["id", string(value(option_1))] : void 0;
2183
+ pairOpt_1 = option_1 != null ? ["id", encodeString(option_1)] : void 0;
1433
2184
  const acc_1 = acc;
1434
- acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(value(pairOpt_1)));
1435
- let pairOpt_3;
1436
- const option_3 = wd.Label;
1437
- pairOpt_3 = option_3 != null ? encodeLabel(value(option_3)) : void 0;
2185
+ acc_2 = pairOpt_1 == null ? acc_1 : append(acc_1, singleton(pairOpt_1));
2186
+ let encoder;
2187
+ const source = wd.SourceNodes.Label;
2188
+ encoder = (label) => encodeLabelValue(source, label);
2189
+ const value_1 = wd.Label;
1438
2190
  const acc_3 = acc_2;
1439
- acc_4 = pairOpt_3 == null ? acc_3 : append(acc_3, singleton(value(pairOpt_3)));
1440
- let pairOpt_5;
1441
- const option_5 = wd.Doc;
1442
- pairOpt_5 = option_5 != null ? encodeDoc(value(option_5)) : void 0;
2191
+ acc_4 = value_1 == null ? acc_3 : append(acc_3, singleton(["label", encoder(value_1)]));
2192
+ let encoder_2;
2193
+ const source_1 = wd.SourceNodes.Doc;
2194
+ encoder_2 = (doc) => encodeProcessDocValue(source_1, doc);
2195
+ const value_3 = wd.Doc;
1443
2196
  const acc_5 = acc_4;
1444
- acc_6 = pairOpt_5 == null ? acc_5 : append(acc_5, singleton(value(pairOpt_5)));
1445
- let pairOpt_7;
1446
- let option_9;
1447
- const option_7 = wd.Intent;
1448
- option_9 = option_7 != null ? (intent = value(option_7), intent.length > 0) ? option_7 : void 0 : void 0;
1449
- pairOpt_7 = option_9 != null ? encodeIntent(value(option_9)) : void 0;
2197
+ acc_6 = value_3 == null ? acc_5 : append(acc_5, singleton(["doc", encoder_2(value_3)]));
2198
+ let pairOpt_3;
2199
+ let option_4;
2200
+ const option_3 = wd.Intent;
2201
+ option_4 = option_3 != null ? (intent = option_3, intent.length > 0) ? option_3 : void 0 : void 0;
2202
+ let mapping_2;
2203
+ const whole = FSharpSet__Contains(wd.SourceNodes.WholeFields, "intent");
2204
+ mapping_2 = (intent_1) => encodeIntent(whole, intent_1);
2205
+ const option_5 = option_4;
2206
+ pairOpt_3 = option_5 != null ? mapping_2(option_5) : void 0;
1450
2207
  const acc_7 = acc_6;
1451
- basePairs = pairOpt_7 == null ? acc_7 : append(acc_7, singleton(value(pairOpt_7)));
2208
+ basePairs = pairOpt_3 == null ? acc_7 : append(acc_7, singleton(pairOpt_3));
1452
2209
  let withHints;
1453
2210
  const matchValue = wd.Hints;
1454
2211
  let matchResult = void 0, h_1 = void 0;
1455
2212
  if (matchValue != null) {
1456
- if (h = value(matchValue), h.length > 0) {
2213
+ if (h = matchValue, h.length > 0) {
1457
2214
  matchResult = 0;
1458
- h_1 = value(matchValue);
2215
+ h_1 = matchValue;
1459
2216
  } else {
1460
2217
  matchResult = 1;
1461
2218
  }
@@ -1464,19 +2221,53 @@ function encodeWorkflowDescriptionElement(wd) {
1464
2221
  }
1465
2222
  switch (matchResult) {
1466
2223
  case 0: {
1467
- withHints = append(basePairs, singleton(["hints", YAMLElement_Sequence(ofSeq(map$1(encodeHintEntry, h_1)))]));
2224
+ withHints = append(basePairs, singleton(["hints", encodeHintsField(wd.SourceNodes, h_1)]));
1468
2225
  break;
1469
2226
  }
1470
2227
  default:
1471
2228
  withHints = basePairs;
1472
2229
  }
1473
- 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$1(encodeRequirement, r_1)))]))) : withHints : withHints), singleton(["inputs", yMap(toList(map$1(encodeCWLInput, wd.Inputs)))])), singleton(["steps", yMap(toList(map$1(encodeWorkflowStep, wd.Steps)))])), singleton(["outputs", yMap(toList(map$1(encodeCWLOutput, wd.Outputs)))]));
2230
+ const withOutputs = append(append(append((matchValue_1 = wd.Requirements, matchValue_1 != null ? (r = matchValue_1, r.length > 0) ? (r_1 = matchValue_1, append(withHints, singleton(["requirements", encodeRequirementsField(wd.SourceNodes, r_1)]))) : withHints : withHints), singleton(["inputs", (entries = toList(map$1((entry) => ListEntry$1.map(encodeCWLInput, entry), wd.Inputs)), encodeIdEntries("id", "type", FSharpSet__Contains(wd.SourceNodes.WholeFields, "inputs"), entries))])), singleton(["steps", encodeStepsWithin(cons(wd, ancestors), FSharpSet__Contains(wd.SourceNodes.WholeFields, "steps"), wd.Steps)])), singleton(["outputs", (entries_1 = toList(map$1((entry_1) => ListEntry$1.map(encodeCWLOutput, entry_1), wd.Outputs)), encodeIdEntries("id", "type", FSharpSet__Contains(wd.SourceNodes.WholeFields, "outputs"), entries_1))]));
1474
2231
  let withMetadata;
1475
2232
  const matchValue_2 = wd.Metadata;
1476
- withMetadata = matchValue_2 == null ? withOutputs : appendDynamicProperties(value(matchValue_2), withOutputs);
1477
- return yMap(appendDynamicPropertiesExcept(CWLWorkflowDescription.KnownFieldNames, wd, withMetadata));
2233
+ withMetadata = matchValue_2 == null ? withOutputs : appendDynamicProperties(matchValue_2, withOutputs);
2234
+ return encodeObject(appendDynamicPropertiesExcept(CWLWorkflowDescription.KnownFieldNames, wd, withMetadata));
2235
+ }
2236
+ function encodeStepsWithin(ancestors, whole, steps) {
2237
+ const encoded = toList(map$1((entry) => ListEntry$1.map((ws) => encodeStepWithin(ancestors, ws), entry), steps));
2238
+ if (exists((entry_1) => {
2239
+ let matchResult = void 0;
2240
+ if (entry_1.tag === /* Value */
2241
+ 0) {
2242
+ if (entry_1.fields[0][0] == null) {
2243
+ matchResult = 0;
2244
+ } else {
2245
+ matchResult = 1;
2246
+ }
2247
+ } else {
2248
+ matchResult = 1;
2249
+ }
2250
+ switch (matchResult) {
2251
+ case 0:
2252
+ return true;
2253
+ default:
2254
+ return false;
2255
+ }
2256
+ }, encoded)) {
2257
+ return encodeSequence(map((entry_2) => encodeListEntry((tupledArg) => {
2258
+ const id = tupledArg[0];
2259
+ const node = tupledArg[1];
2260
+ if (id == null) {
2261
+ return node;
2262
+ } else {
2263
+ return idObject("id", "run", id, node);
2264
+ }
2265
+ }, entry_2), encoded));
2266
+ } else {
2267
+ return encodeIdEntries("id", "run", whole, map((entry_3) => ListEntry$1.map((tupledArg_1) => [value(tupledArg_1[0]), tupledArg_1[1]], entry_3), encoded));
2268
+ }
1478
2269
  }
1479
- function encodeWorkflowStep(ws) {
2270
+ function encodeStepWithin(ancestors, ws) {
1480
2271
  let h = void 0, r = void 0;
1481
2272
  let basePairs;
1482
2273
  let acc_10;
@@ -1484,30 +2275,36 @@ function encodeWorkflowStep(ws) {
1484
2275
  let acc_6;
1485
2276
  let acc_4;
1486
2277
  let acc_2;
1487
- const acc = ofArray([["run", encodeWorkflowStepRun(ws.Run)], ["in", encodeStepInputs(ws.In)], ["out", encodeStepOutputs(ws.Out)]]);
1488
- const value_2 = ws.Label;
2278
+ const acc = ofArray([["run", encodeRunWithin(ancestors, ws.Run)], ["in", encodeStepInputs(FSharpSet__Contains(ws.SourceNodes.WholeFields, "in"), ws.In)], ["out", encodeStepOutputs(FSharpSet__Contains(ws.SourceNodes.WholeFields, "out"), ws.Out)]]);
2279
+ let encoder;
2280
+ const source = ws.SourceNodes.Label;
2281
+ encoder = (label) => encodeLabelValue(source, label);
2282
+ const value_1 = ws.Label;
1489
2283
  const acc_1 = acc;
1490
- acc_2 = value_2 == null ? acc_1 : append(acc_1, singleton(["label", string(value(value_2))]));
1491
- const value_5 = ws.Doc;
2284
+ acc_2 = value_1 == null ? acc_1 : append(acc_1, singleton(["label", encoder(value_1)]));
2285
+ let encoder_2;
2286
+ const source_1 = ws.SourceNodes.Doc;
2287
+ encoder_2 = (doc) => encodeDocValue(source_1, doc);
2288
+ const value_3 = ws.Doc;
1492
2289
  const acc_3 = acc_2;
1493
- acc_4 = value_5 == null ? acc_3 : append(acc_3, singleton(["doc", string(value(value_5))]));
1494
- const value_7 = ws.Scatter;
2290
+ acc_4 = value_3 == null ? acc_3 : append(acc_3, singleton(["doc", encoder_2(value_3)]));
2291
+ const value_5 = ws.Scatter;
1495
2292
  const acc_5 = acc_4;
1496
- acc_6 = value_7 == null ? acc_5 : append(acc_5, singleton(["scatter", encodeScatter(value(value_7))]));
1497
- const value_9 = ws.ScatterMethod;
2293
+ acc_6 = value_5 == null ? acc_5 : append(acc_5, singleton(["scatter", encodeScatter(value_5)]));
2294
+ const value_7 = ws.ScatterMethod;
1498
2295
  const acc_7 = acc_6;
1499
- acc_8 = value_9 == null ? acc_7 : append(acc_7, singleton(["scatterMethod", encodeScatterMethod(value(value_9))]));
1500
- const value_12 = ws.When_;
2296
+ acc_8 = value_7 == null ? acc_7 : append(acc_7, singleton(["scatterMethod", encodeScatterMethod(value_7)]));
2297
+ const value_10 = ws.When_;
1501
2298
  const acc_9 = acc_8;
1502
- acc_10 = value_12 == null ? acc_9 : append(acc_9, singleton(["when", string(value(value_12))]));
2299
+ acc_10 = value_10 == null ? acc_9 : append(acc_9, singleton(["when", encodeSchemaSaladString(value_10)]));
1503
2300
  basePairs = appendDynamicPropertiesExcept(WorkflowStep.KnownFieldNames, ws, acc_10);
1504
2301
  let withHints;
1505
2302
  const matchValue = ws.Hints;
1506
2303
  let matchResult = void 0, h_1 = void 0;
1507
2304
  if (matchValue != null) {
1508
- if (h = value(matchValue), h.length > 0) {
2305
+ if (h = matchValue, h.length > 0) {
1509
2306
  matchResult = 0;
1510
- h_1 = value(matchValue);
2307
+ h_1 = matchValue;
1511
2308
  } else {
1512
2309
  matchResult = 1;
1513
2310
  }
@@ -1516,7 +2313,7 @@ function encodeWorkflowStep(ws) {
1516
2313
  }
1517
2314
  switch (matchResult) {
1518
2315
  case 0: {
1519
- withHints = append(basePairs, singleton(["hints", YAMLElement_Sequence(ofSeq(map$1(encodeHintEntry, h_1)))]));
2316
+ withHints = append(basePairs, singleton(["hints", encodeHintsField(ws.SourceNodes, h_1)]));
1520
2317
  break;
1521
2318
  }
1522
2319
  default:
@@ -1526,9 +2323,9 @@ function encodeWorkflowStep(ws) {
1526
2323
  const matchValue_1 = ws.Requirements;
1527
2324
  let matchResult_1 = void 0, r_1 = void 0;
1528
2325
  if (matchValue_1 != null) {
1529
- if (r = value(matchValue_1), r.length > 0) {
2326
+ if (r = matchValue_1, r.length > 0) {
1530
2327
  matchResult_1 = 0;
1531
- r_1 = value(matchValue_1);
2328
+ r_1 = matchValue_1;
1532
2329
  } else {
1533
2330
  matchResult_1 = 1;
1534
2331
  }
@@ -1537,126 +2334,233 @@ function encodeWorkflowStep(ws) {
1537
2334
  }
1538
2335
  switch (matchResult_1) {
1539
2336
  case 0: {
1540
- withReq = append(withHints, singleton(["requirements", YAMLElement_Sequence(ofSeq(map$1(encodeRequirement, r_1)))]));
2337
+ withReq = append(withHints, singleton(["requirements", encodeRequirementsField(ws.SourceNodes, r_1)]));
1541
2338
  break;
1542
2339
  }
1543
2340
  default:
1544
2341
  withReq = withHints;
1545
2342
  }
1546
- return [ws.Id, yMap(withReq)];
2343
+ return [ws.Id, encodeObject(withReq)];
1547
2344
  }
1548
- function writeYaml(element) {
1549
- return write(element, (c) => new Config(2, c.Level));
2345
+ function encodeWorkflowStepRun(run) {
2346
+ return encodeRunWithin(empty(), run);
1550
2347
  }
1551
- function encodeCWLParameterReference(reference) {
1552
- let option_1 = void 0;
1553
- const encodedValue = defaultArg((option_1 = reference.Value, option_1 != null ? encodeCWLParameterValue(value(option_1)) : void 0), YAMLElement_Sequence(empty$1()));
1554
- const dynamicPairs = toList(choose((property) => {
1555
- const option_4 = encodeDynamicValue(property[1]);
1556
- if (option_4 != null) {
1557
- return [property[0], value(option_4)];
1558
- } else {
1559
- return void 0;
2348
+ function encodeWorkflowDescriptionElement(wd) {
2349
+ return encodeWorkflowWithin(empty(), wd);
2350
+ }
2351
+ function encodeWorkflowSteps(whole, steps) {
2352
+ return encodeStepsWithin(empty(), whole, steps);
2353
+ }
2354
+ function encodeWorkflowStep(ws) {
2355
+ return encodeStepWithin(empty(), ws);
2356
+ }
2357
+ class OpenBlock extends Record {
2358
+ constructor(Source, IsLast, Children, Before, Rebuilt, Next) {
2359
+ super();
2360
+ this.Source = Source;
2361
+ this.IsLast = IsLast;
2362
+ this.Children = Children;
2363
+ this.Before = Before;
2364
+ this.Rebuilt = Rebuilt;
2365
+ this.Next = Next | 0;
2366
+ }
2367
+ }
2368
+ function OpenBlock_$reflection() {
2369
+ return record_type("ARCtrl.CWL.Encode.OpenBlock", [], OpenBlock, () => [["Source", YamlNode_$reflection()], ["IsLast", bool_type], ["Children", array_type(YamlNode_$reflection())], ["Before", array_type(list_type(Trivia_$reflection()))], ["Rebuilt", array_type(YamlNode_$reflection())], ["Next", int32_type]]);
2370
+ }
2371
+ function isBlockWithItems(node) {
2372
+ const matchValue = node.Kind;
2373
+ switch (matchValue.tag) {
2374
+ case /* Mapping */
2375
+ 1: {
2376
+ const collection = matchValue.fields[0];
2377
+ if (equals(collection.Style, CollectionStyle.Block)) {
2378
+ return !isEmpty(collection.Items);
2379
+ } else {
2380
+ return false;
2381
+ }
1560
2382
  }
1561
- }, dynamicPropertiesExcept(CWLParameterReference.KnownFieldNames, reference)));
1562
- let inferredType;
1563
- const option_6 = reference.Value;
1564
- inferredType = option_6 != null ? CWLParameterValueModule_tryInferType(value(option_6)) : void 0;
1565
- let explicitTypePair;
1566
- const matchValue = reference.Type;
1567
- let matchResult = void 0, type__1 = void 0;
1568
- if (matchValue != null) {
1569
- if (!equals(inferredType, value(matchValue))) {
1570
- matchResult = 0;
1571
- type__1 = value(matchValue);
1572
- } else {
1573
- matchResult = 1;
2383
+ case /* Sequence */
2384
+ 2: {
2385
+ const collection_1 = matchValue.fields[0];
2386
+ if (equals(collection_1.Style, CollectionStyle.Block)) {
2387
+ return !isEmpty(collection_1.Items);
2388
+ } else {
2389
+ return false;
2390
+ }
1574
2391
  }
1575
- } else {
1576
- matchResult = 1;
2392
+ default:
2393
+ return false;
1577
2394
  }
1578
- switch (matchResult) {
1579
- case 0: {
1580
- explicitTypePair = ["type", encodeCWLType(type__1)];
1581
- break;
2395
+ }
2396
+ function childrenOf(node) {
2397
+ const matchValue = node.Kind;
2398
+ switch (matchValue.tag) {
2399
+ case /* Mapping */
2400
+ 1: {
2401
+ const collection = matchValue.fields[0];
2402
+ return [toArray$1(delay(() => map$1((entry) => entry.Value, collection.Items))), toArray$1(delay(() => map$1((entry_1) => entry_1.Before, collection.Items)))];
2403
+ }
2404
+ case /* Sequence */
2405
+ 2: {
2406
+ const collection_1 = matchValue.fields[0];
2407
+ return [toArray$1(delay(() => map$1((item) => item.Node, collection_1.Items))), toArray$1(delay(() => map$1((item_1) => item_1.Before, collection_1.Items)))];
1582
2408
  }
1583
2409
  default:
1584
- explicitTypePair = void 0;
2410
+ return [[], []];
1585
2411
  }
1586
- let encodedReference;
1587
- let matchResult_1 = void 0, overflow_1 = void 0, typePair = void 0, value_5 = void 0;
1588
- if (explicitTypePair == null) {
1589
- if (isEmpty(dynamicPairs)) {
1590
- matchResult_1 = 0;
1591
- } else if (encodedValue.tag === /* Object */
1592
- 3) {
1593
- matchResult_1 = 1;
1594
- } else {
1595
- matchResult_1 = 2;
1596
- overflow_1 = dynamicPairs;
1597
- typePair = explicitTypePair;
1598
- value_5 = encodedValue;
1599
- }
1600
- } else {
1601
- matchResult_1 = 2;
1602
- overflow_1 = dynamicPairs;
1603
- typePair = explicitTypePair;
1604
- value_5 = encodedValue;
2412
+ }
2413
+ function endOf(node) {
2414
+ const matchValue = node.Kind;
2415
+ switch (matchValue.tag) {
2416
+ case /* Mapping */
2417
+ 1:
2418
+ return matchValue.fields[0].End;
2419
+ case /* Sequence */
2420
+ 2:
2421
+ return matchValue.fields[0].End;
2422
+ default:
2423
+ return empty();
1605
2424
  }
1606
- switch (matchResult_1) {
1607
- case 0: {
1608
- encodedReference = encodedValue;
1609
- break;
2425
+ }
2426
+ function rebuildBlock(node, before, children, collectionEnd) {
2427
+ const matchValue = node.Kind;
2428
+ switch (matchValue.tag) {
2429
+ case /* Mapping */
2430
+ 1: {
2431
+ const collection = matchValue.fields[0];
2432
+ return new YamlNode(YamlNodeKind_Mapping(new Collection$1(collection.Style, collection.OpeningComment, mapIndexed((index, entry) => new MappingEntry(item(index, before), entry.Question, entry.Key, entry.BeforeColon, entry.Colon, item(index, children), entry.Span), collection.Items), collectionEnd)), node.Properties, node.PropertyLayout, node.TrailingComment, node.Span);
1610
2433
  }
1611
- case 1: {
1612
- const valuePairs = choose$1((_arg) => {
1613
- if (_arg.tag === /* Mapping */
1614
- 0) {
1615
- return [_arg.fields[0].Value, _arg.fields[1]];
2434
+ case /* Sequence */
2435
+ 2: {
2436
+ const collection_1 = matchValue.fields[0];
2437
+ return new YamlNode(YamlNodeKind_Sequence(new Collection$1(collection_1.Style, collection_1.OpeningComment, mapIndexed((index_1, item$1) => {
2438
+ let dash;
2439
+ const matchValue_1 = item$1.Dash;
2440
+ let matchResult = void 0, other = void 0;
2441
+ if (matchValue_1 != null) {
2442
+ if (matchValue_1.tag === /* Inline */
2443
+ 0) {
2444
+ if (startsWithTrivia(item(index_1, children))) {
2445
+ matchResult = 0;
2446
+ } else {
2447
+ matchResult = 1;
2448
+ other = matchValue_1;
2449
+ }
2450
+ } else {
2451
+ matchResult = 1;
2452
+ other = matchValue_1;
2453
+ }
1616
2454
  } else {
1617
- return void 0;
2455
+ matchResult = 1;
2456
+ other = matchValue_1;
1618
2457
  }
1619
- }, encodedValue.fields[0]);
1620
- const valueKeys = ofSeq$1(map$1((tuple) => tuple[0], valuePairs), {
1621
- Compare: (x, y) => comparePrimitives(x, y) | 0
1622
- });
1623
- encodedReference = yMap(append(valuePairs, filter((tupledArg) => !contains(tupledArg[0], valueKeys), dynamicPairs)));
1624
- break;
2458
+ switch (matchResult) {
2459
+ case 0: {
2460
+ dash = lineBreakDash;
2461
+ break;
2462
+ }
2463
+ default:
2464
+ dash = other;
2465
+ }
2466
+ return new SequenceItem(item(index_1, before), dash, item(index_1, children), item$1.Span);
2467
+ }, collection_1.Items), collectionEnd)), node.Properties, node.PropertyLayout, node.TrailingComment, node.Span);
1625
2468
  }
1626
2469
  default:
1627
- encodedReference = yMap(toList(delay(() => append$1(ofArray(toArray(typePair)), delay(() => append$1(singleton$1(["value", value_5]), delay(() => overflow_1)))))));
2470
+ return node;
1628
2471
  }
1629
- return [reference.Key, encodedReference];
1630
2472
  }
1631
- function encodeYAMLParameterFile(references) {
1632
- return writeYaml(yMap(toList(map$1(encodeCWLParameterReference, references))));
2473
+ function hasMisplacedEnd(rootIsLast, root) {
2474
+ const pending = [];
2475
+ void pending.push([root, rootIsLast]);
2476
+ let found = false;
2477
+ while (!found && pending.length > 0) {
2478
+ const patternInput = item(pending.length - 1, pending);
2479
+ const node = patternInput[0];
2480
+ const isLast = patternInput[1];
2481
+ pending.splice(pending.length - 1, 1);
2482
+ if (isBlockWithItems(node)) {
2483
+ if (!isLast && !isEmpty(endOf(node))) {
2484
+ found = true;
2485
+ } else {
2486
+ const children = childrenOf(node)[0];
2487
+ iterateIndexed((index, child) => {
2488
+ void pending.push([child, isLast && index === children.length - 1]);
2489
+ }, children);
2490
+ }
2491
+ }
2492
+ }
2493
+ return found;
1633
2494
  }
1634
- function getObjectPairs(element) {
1635
- if (element.tag === /* Object */
1636
- 3) {
1637
- return choose$1((_arg) => {
1638
- if (_arg.tag === /* Mapping */
2495
+ function moveEndTrivia(rootIsLast, root) {
2496
+ if (!hasMisplacedEnd(rootIsLast, root)) {
2497
+ return root;
2498
+ } else {
2499
+ const unfinished = [];
2500
+ let result = root;
2501
+ const enter = (node, isLast) => {
2502
+ const patternInput = childrenOf(node);
2503
+ const children = patternInput[0];
2504
+ void unfinished.push(new OpenBlock(node, isLast, children, copy(patternInput[1]), copy(children), 0));
2505
+ };
2506
+ const isBlankLine = (line) => {
2507
+ if (line.tag === /* FullLineComment */
1639
2508
  0) {
1640
- return [_arg.fields[0].Value, _arg.fields[1]];
2509
+ return false;
1641
2510
  } else {
1642
- return void 0;
2511
+ return true;
1643
2512
  }
1644
- }, element.fields[0]);
1645
- } else {
1646
- return empty$1();
2513
+ };
2514
+ enter(root, rootIsLast);
2515
+ while (unfinished.length > 0) {
2516
+ let trivia = void 0, moved = void 0, last = void 0;
2517
+ const top = item(unfinished.length - 1, unfinished);
2518
+ if (top.Next < top.Children.length) {
2519
+ const index = top.Next | 0;
2520
+ top.Next = index + 1 | 0;
2521
+ const child = item(index, top.Children);
2522
+ if (isBlockWithItems(child)) {
2523
+ enter(child, top.IsLast && index === top.Children.length - 1);
2524
+ }
2525
+ } else {
2526
+ unfinished.splice(unfinished.length - 1, 1);
2527
+ const rebuilt = rebuildBlock(top.Source, top.Before, top.Rebuilt, (trivia = endOf(top.Source), (top.IsLast ? true : isEmpty(trivia)) ? trivia : (moved = reverse(skipWhile(isBlankLine, reverse(skipWhile(isBlankLine, trivia)))), last = top.Before.length - 1 | 0, top.Before[last] = append(item(last, top.Before), moved), empty())));
2528
+ if (unfinished.length === 0) {
2529
+ result = rebuilt;
2530
+ } else {
2531
+ const parent = item(unfinished.length - 1, unfinished);
2532
+ parent.Rebuilt[parent.Next - 1] = rebuilt;
2533
+ }
2534
+ }
2535
+ }
2536
+ return result;
1647
2537
  }
1648
2538
  }
2539
+ const writerOptions = WriterOptionsModule_defaults;
2540
+ function writeYaml(element) {
2541
+ return Writer_writeNode(writerOptions, moveEndTrivia(true, element));
2542
+ }
2543
+ function encodeCWLParameterReference(reference) {
2544
+ let option_1 = void 0;
2545
+ const encodedValue = defaultArg((option_1 = reference.Value, option_1 != null ? encodeCWLParameterValue(option_1) : void 0), encodeSequence(empty()));
2546
+ return [reference.Key, encodedValue];
2547
+ }
2548
+ function encodeYAMLParameterFile(references) {
2549
+ return writeYaml(encodeObject(toList(map$1(encodeCWLParameterReference, references))));
2550
+ }
1649
2551
  function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
1650
- const section = (pairs) => trimEnd(replace(writeYaml(yMap(pairs)), "\r\n", "\n"), "\n");
1651
- const pairs_2 = getObjectPairs(element);
1652
- const basePairs = filter((tupledArg) => contains$1(tupledArg[0], baseKeys, {
2552
+ let entries;
2553
+ const matchValue = element.Kind;
2554
+ entries = matchValue.tag === /* Mapping */
2555
+ 1 ? map((entry) => [Decode_entryName(entry), entry], matchValue.fields[0].Items) : empty();
2556
+ const basePairs = filter((tupledArg) => contains(tupledArg[0], baseKeys, {
1653
2557
  Equals: (x, y) => x === y,
1654
2558
  GetHashCode: (x) => stringHash(x) | 0
1655
- }), pairs_2);
2559
+ }), entries);
1656
2560
  const knownSections = choose$1((sectionKey) => {
1657
- const option_1 = tryFind((tupledArg_1) => tupledArg_1[0] === sectionKey, pairs_2);
2561
+ const option_1 = tryFind((tupledArg_1) => tupledArg_1[0] === sectionKey, entries);
1658
2562
  if (option_1 != null) {
1659
- return singleton(value(option_1));
2563
+ return singleton(option_1);
1660
2564
  } else {
1661
2565
  return void 0;
1662
2566
  }
@@ -1664,48 +2568,41 @@ function renderTopLevelElement(baseKeys, orderedSectionKeys, element) {
1664
2568
  const reservedKeys = ofList(append(baseKeys, orderedSectionKeys), {
1665
2569
  Compare: (x_1, y_1) => comparePrimitives(x_1, y_1) | 0
1666
2570
  });
1667
- const metadataPairs = filter((tupledArg_2) => !FSharpSet__Contains(reservedKeys, tupledArg_2[0]), pairs_2);
1668
- const merge = (acc_mut, remaining_mut) => {
1669
- merge:
1670
- while (true) {
1671
- const acc = acc_mut, remaining = remaining_mut;
1672
- let matchResult = void 0, a_1 = void 0, b_1 = void 0, rest_1 = void 0, l = void 0, rest_2 = void 0;
1673
- if (isEmpty(remaining)) {
1674
- matchResult = 2;
1675
- } else if (!isEmpty(tail(remaining))) {
1676
- if (head(remaining).trim() === "-" && trimStart(head(tail(remaining))).indexOf(":") >= 0) {
1677
- matchResult = 0;
1678
- a_1 = head(remaining);
1679
- b_1 = head(tail(remaining));
1680
- rest_1 = tail(tail(remaining));
1681
- } else {
1682
- matchResult = 1;
1683
- l = head(remaining);
1684
- rest_2 = tail(remaining);
1685
- }
1686
- } else {
1687
- matchResult = 1;
1688
- l = head(remaining);
1689
- rest_2 = tail(remaining);
1690
- }
1691
- switch (matchResult) {
1692
- case 0: {
1693
- acc_mut = cons(a_1 + " " + b_1.trim(), acc);
1694
- remaining_mut = rest_1;
1695
- continue merge;
1696
- }
1697
- case 1: {
1698
- acc_mut = cons(l, acc);
1699
- remaining_mut = rest_2;
1700
- continue merge;
1701
- }
1702
- default:
1703
- return reverse(acc);
1704
- }
1705
- break;
2571
+ const metadataPairs = filter((tupledArg_2) => !FSharpSet__Contains(reservedKeys, tupledArg_2[0]), entries);
2572
+ const sections = toArray$2(map((list_5) => map((tuple) => tuple[1], list_5), toList(delay(() => append$1(length(basePairs) > 0 ? singleton$1(basePairs) : empty$2(), delay(() => append$1(knownSections, delay(() => length(metadataPairs) > 0 ? singleton$1(metadataPairs) : empty$2()))))))));
2573
+ const sections_1 = mapIndexed$1((index, section) => {
2574
+ if (index < sections.length - 1) {
2575
+ const last$1 = last(section);
2576
+ return append(take(length(section) - 1, section), singleton(new MappingEntry(last$1.Before, last$1.Question, last$1.Key, last$1.BeforeColon, last$1.Colon, moveEndTrivia(false, last$1.Value), last$1.Span)));
2577
+ } else {
2578
+ return section;
2579
+ }
2580
+ }, sections);
2581
+ const separated = concat(mapIndexed$1((index_1, section_1) => {
2582
+ let matchResult = void 0, first_1 = void 0, rest_1 = void 0;
2583
+ if (!isEmpty(section_1)) {
2584
+ if (index_1 > 0 && !Writer_endsWithKeptLines(writerOptions, last(item(index_1 - 1, sections_1)).Value)) {
2585
+ matchResult = 0;
2586
+ first_1 = head(section_1);
2587
+ rest_1 = tail(section_1);
2588
+ } else {
2589
+ matchResult = 1;
1706
2590
  }
1707
- };
1708
- 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(section, knownSections), delay(() => length(metadataPairs) > 0 ? singleton$1(section(metadataPairs)) : empty$2()))))))), ["\r\n"], void 0, 0))));
2591
+ } else {
2592
+ matchResult = 1;
2593
+ }
2594
+ switch (matchResult) {
2595
+ case 0:
2596
+ return cons(new MappingEntry(cons(Trivia_BlankLine(void 0), first_1.Before), first_1.Question, first_1.Key, first_1.BeforeColon, first_1.Colon, first_1.Value, first_1.Span), rest_1);
2597
+ default:
2598
+ return section_1;
2599
+ }
2600
+ }, sections_1));
2601
+ if (isEmpty(separated)) {
2602
+ return "";
2603
+ } else {
2604
+ return writeYaml(YamlNodeModule_mapping(separated));
2605
+ }
1709
2606
  }
1710
2607
  function encodeToolDescription(td) {
1711
2608
  return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "baseCommand", "inputs", "outputs"]), encodeToolDescriptionElement(td));
@@ -1719,6 +2616,24 @@ function encodeExpressionToolDescription(et) {
1719
2616
  function encodeOperationDescription(op) {
1720
2617
  return renderTopLevelElement(ofArray(["cwlVersion", "class", "id", "label", "doc", "intent"]), ofArray(["hints", "requirements", "inputs", "outputs"]), encodeOperationDescriptionElement(op));
1721
2618
  }
2619
+ function encodeProcessingUnitElement(pu) {
2620
+ switch (pu.tag) {
2621
+ case /* Workflow */
2622
+ 1:
2623
+ return encodeWorkflowDescriptionElement(pu.fields[0]);
2624
+ case /* ExpressionTool */
2625
+ 2:
2626
+ return encodeExpressionToolDescriptionElement(pu.fields[0]);
2627
+ case /* Operation */
2628
+ 3:
2629
+ return encodeOperationDescriptionElement(pu.fields[0]);
2630
+ case /* RawProcess */
2631
+ 4:
2632
+ return rawYamlNode(pu.fields[0]);
2633
+ default:
2634
+ return encodeToolDescriptionElement(pu.fields[0]);
2635
+ }
2636
+ }
1722
2637
  function encodeProcessingUnit(pu) {
1723
2638
  switch (pu.tag) {
1724
2639
  case /* Workflow */
@@ -1730,71 +2645,44 @@ function encodeProcessingUnit(pu) {
1730
2645
  case /* Operation */
1731
2646
  3:
1732
2647
  return encodeOperationDescription(pu.fields[0]);
2648
+ case /* RawProcess */
2649
+ 4:
2650
+ return writeYaml(pu.fields[0].Node);
1733
2651
  default:
1734
2652
  return encodeToolDescription(pu.fields[0]);
1735
2653
  }
1736
2654
  }
1737
- function encodeCWLTypeYaml(t) {
2655
+ function encodeCWLTypeFlow(t) {
2656
+ const flowObject = (pairs) => YamlNodeModule_flowMapping(toList(delay(() => collect((matchValue) => singleton$1(YamlNodeModule_entry(textNode(matchValue[0]), matchValue[1])), pairs))));
2657
+ const flowList = (nodes) => YamlNodeModule_flowSequence(map(YamlNodeModule_item, nodes));
1738
2658
  switch (t.tag) {
1739
2659
  case /* Union */
1740
- 14:
1741
- return "[" + join(", ", map$1(encodeCWLTypeYaml, t.fields[0])) + "]";
2660
+ 21:
2661
+ return flowList(toList(map$1(encodeCWLTypeFlow, t.fields[0])));
1742
2662
  case /* Array */
1743
- 11:
1744
- return encodeInputArraySchemaYaml(t.fields[0]);
1745
- case /* Record */
1746
- 12:
1747
- return encodeInputRecordSchemaYaml(t.fields[0]);
1748
- case /* Enum */
1749
- 13:
1750
- return encodeInputEnumSchemaYaml(t.fields[0]);
1751
- case /* Null */
1752
- 10:
1753
- return '"null"';
1754
- default: {
1755
- const yamlForm = writeYaml(encodeCWLType(t));
1756
- return yamlForm.trim();
2663
+ 18: {
2664
+ const arraySchema = t.fields[0];
2665
+ return flowObject(ofArray([["type", Encode_string("array")], ["items", encodeCWLTypeFlow(arraySchema.Items)]]));
1757
2666
  }
1758
- }
1759
- }
1760
- function encodeInputRecordFieldYaml(field) {
1761
- const typeYaml = encodeCWLTypeYaml(field.Type);
1762
- return `{name: ${field.Name}, type: ${typeYaml}}`;
1763
- }
1764
- function encodeInputRecordSchemaYaml(schema) {
1765
- let fs = void 0;
1766
- let fieldsYaml;
1767
- const matchValue = schema.Fields;
1768
- let matchResult = void 0, fs_1 = void 0;
1769
- if (matchValue != null) {
1770
- if (fs = value(matchValue), fs.length > 0) {
1771
- matchResult = 0;
1772
- fs_1 = value(matchValue);
1773
- } else {
1774
- matchResult = 1;
2667
+ case /* Record */
2668
+ 19: {
2669
+ const recordSchema = t.fields[0];
2670
+ let fields;
2671
+ const matchValue_1 = recordSchema.Fields;
2672
+ fields = matchValue_1 == null ? empty() : toList(map$1((entry) => encodeListEntry((field) => flowObject(ofArray([["name", textNode(field.Name)], ["type", encodeCWLTypeFlow(field.Type)]])), entry), matchValue_1));
2673
+ return flowObject(ofArray([["type", Encode_string("record")], ["fields", flowList(fields)]]));
1775
2674
  }
1776
- } else {
1777
- matchResult = 1;
1778
- }
1779
- switch (matchResult) {
1780
- case 0: {
1781
- fieldsYaml = join(", ", map$1(encodeInputRecordFieldYaml, fs_1));
1782
- break;
2675
+ case /* Enum */
2676
+ 20: {
2677
+ const enumSchema = t.fields[0];
2678
+ return flowObject(ofArray([["type", Encode_string("enum")], ["symbols", flowList(toList(map$1((value_1) => encodeSchemaSaladStringWith(textNode, value_1), enumSchema.Symbols)))]]));
1783
2679
  }
1784
2680
  default:
1785
- fieldsYaml = "";
1786
- }
1787
- if (fieldsYaml === "") {
1788
- return "{type: record, fields: []}";
1789
- } else {
1790
- return concat("{type: record, fields: [", fieldsYaml, "]}");
2681
+ return encodeCWLType(t);
1791
2682
  }
1792
2683
  }
1793
- function encodeInputEnumSchemaYaml(schema) {
1794
- return concat("{type: enum, symbols: [", join(", ", schema.Symbols), "]}");
1795
- }
1796
- function encodeInputArraySchemaYaml(schema) {
1797
- return concat("{type: array, items: ", encodeCWLTypeYaml(schema.Items), "}");
2684
+ function encodeCWLTypeYaml(t) {
2685
+ return writeYaml(encodeCWLTypeFlow(t)).trim();
1798
2686
  }
1799
2687
  function cwlTypeToYamlString(t) {
1800
2688
  return encodeCWLTypeYaml(t);
@@ -1804,4 +2692,4 @@ function formatCWLType(type_) {
1804
2692
  return s.trim();
1805
2693
  }
1806
2694
 
1807
- export { $007CPrimitiveType$007CComplexType$007C, appendDynamicProperties, appendDynamicPropertiesExcept, cwlTypeToYamlString, encodeCWLInput, encodeCWLOutput, encodeCWLParameterReference, encodeCWLParameterValue, 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, encodeYAMLParameterFile, formatCWLType, getObjectPairs, isComplexType, normalizeDocString, normalizeEnvValueForEncode, renderTopLevelElement, tryGetArrayShorthand, writeYaml, yBool, yFloat, yMap };
2695
+ export { $007COptionalOf$007C_$007C, $007CPrimitiveType$007CComplexType$007C, appendDynamicProperties, appendDynamicPropertiesExcept, cwlTypeToYamlString, directive, encodeBindingPosition, encodeCWLInput, encodeCWLOutput, encodeCWLParameterReference, encodeCWLParameterValue, encodeCWLType, encodeCWLTypeFlow, encodeCWLTypeShorthand, encodeCWLTypeYaml, encodeDirectoryPairs, encodeDoc, encodeDocText, encodeDocValue, encodeDynamicObj, encodeDynamicValue, encodeExpressionScalar, encodeExpressionToolDescription, encodeExpressionToolDescriptionElement, encodeFilePairs, encodeFileSize, encodeHintEntry, encodeIdEntries, encodeIdMapOrList, encodeInputArraySchema, encodeInputBinding, encodeInputEnumSchema, encodeInputFormat, encodeInputRecordField, encodeInputRecordSchema, encodeIntList, encodeIntent, encodeLabel, encodeLabelValue, encodeLinkMergeMethod, encodeListEntry, encodeLoadListing, encodeObject, encodeOperationDescription, encodeOperationDescriptionElement, encodeOutputBinding, encodeOutputGlob, encodePickValueMethod, encodeProcessDocValue, encodeProcessingUnit, encodeProcessingUnitElement, encodeRequirement, encodeScatter, encodeScatterMethod, encodeSchemaDefinition, encodeSchemaSaladBool, encodeSchemaSaladString, encodeSchemaSaladStringWith, encodeSchemaType, encodeSequence, encodeSourceArray, encodeSourceText, encodeStepInput, encodeStepInputs, encodeStepOutputParameter, encodeStepOutputs, encodeString, encodeStringList, encodeToolDescription, encodeToolDescriptionElement, encodeTypeWith, encodeWorkflowDescription, encodeWorkflowDescriptionElement, encodeWorkflowStep, encodeWorkflowStepRun, encodeWorkflowSteps, encodeYAMLParameterFile, formatCWLType, inputArraySchemaPairs, inputEnumSchemaPairs, inputRecordSchemaPairs, isComplexType, normalizeDocString, rawYamlNode, renderTopLevelElement, tryGetArrayShorthand, writeYaml };