@nfdi4plants/arctrl 3.0.0-beta.3 → 3.0.0-beta.5

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 (398) hide show
  1. package/README.md +2 -0
  2. package/dist/ts/index.js +63 -0
  3. package/dist/ts/node_modules/@fable-org/fable-library-js/Array.js +354 -0
  4. package/dist/ts/node_modules/@fable-org/fable-library-js/Async.js +28 -0
  5. package/dist/ts/node_modules/@fable-org/fable-library-js/AsyncBuilder.js +186 -0
  6. package/dist/ts/node_modules/@fable-org/fable-library-js/BigInt.js +8 -0
  7. package/dist/ts/node_modules/@fable-org/fable-library-js/Boolean.js +24 -0
  8. package/dist/ts/node_modules/@fable-org/fable-library-js/Char.js +73 -0
  9. package/dist/ts/node_modules/@fable-org/fable-library-js/CollectionUtil.js +31 -0
  10. package/dist/ts/node_modules/@fable-org/fable-library-js/Date.js +574 -0
  11. package/dist/ts/node_modules/@fable-org/fable-library-js/DateOffset.js +59 -0
  12. package/dist/ts/node_modules/@fable-org/fable-library-js/Decimal.js +65 -0
  13. package/dist/ts/node_modules/@fable-org/fable-library-js/Double.js +30 -0
  14. package/dist/ts/node_modules/@fable-org/fable-library-js/FSharp.Core.js +5 -0
  15. package/dist/ts/node_modules/@fable-org/fable-library-js/Global.js +5 -0
  16. package/dist/ts/node_modules/@fable-org/fable-library-js/Guid.js +48 -0
  17. package/dist/ts/node_modules/@fable-org/fable-library-js/Int32.js +120 -0
  18. package/dist/ts/node_modules/@fable-org/fable-library-js/List.js +680 -0
  19. package/dist/ts/node_modules/@fable-org/fable-library-js/Long.js +40 -0
  20. package/dist/ts/node_modules/@fable-org/fable-library-js/Map.js +655 -0
  21. package/dist/ts/node_modules/@fable-org/fable-library-js/MapUtil.js +105 -0
  22. package/dist/ts/node_modules/@fable-org/fable-library-js/MutableMap.js +320 -0
  23. package/dist/ts/node_modules/@fable-org/fable-library-js/MutableSet.js +204 -0
  24. package/dist/ts/node_modules/@fable-org/fable-library-js/Native.js +10 -0
  25. package/dist/ts/node_modules/@fable-org/fable-library-js/Numeric.js +73 -0
  26. package/dist/ts/node_modules/@fable-org/fable-library-js/Option.js +65 -0
  27. package/dist/ts/node_modules/@fable-org/fable-library-js/Range.js +23 -0
  28. package/dist/ts/node_modules/@fable-org/fable-library-js/Reflection.js +111 -0
  29. package/dist/ts/node_modules/@fable-org/fable-library-js/RegExp.js +114 -0
  30. package/dist/ts/node_modules/@fable-org/fable-library-js/Result.js +36 -0
  31. package/dist/ts/node_modules/@fable-org/fable-library-js/Seq.js +846 -0
  32. package/dist/ts/node_modules/@fable-org/fable-library-js/Seq2.js +65 -0
  33. package/dist/ts/node_modules/@fable-org/fable-library-js/Set.js +1160 -0
  34. package/dist/ts/node_modules/@fable-org/fable-library-js/String.js +364 -0
  35. package/dist/ts/node_modules/@fable-org/fable-library-js/System.Text.js +40 -0
  36. package/dist/ts/node_modules/@fable-org/fable-library-js/Types.js +193 -0
  37. package/dist/ts/node_modules/@fable-org/fable-library-js/Unicode.13.0.0.js +6 -0
  38. package/dist/ts/node_modules/@fable-org/fable-library-js/Uri.js +160 -0
  39. package/dist/ts/node_modules/@fable-org/fable-library-js/Util.js +367 -0
  40. package/dist/ts/node_modules/@fable-org/fable-library-js/lib/big.js +825 -0
  41. package/dist/ts/ts/ARC.js +914 -0
  42. package/dist/ts/ts/Contract/ARC.js +52 -0
  43. package/dist/ts/ts/Contract/ArcAssay.js +80 -0
  44. package/dist/ts/ts/Contract/ArcInvestigation.js +57 -0
  45. package/dist/ts/ts/Contract/ArcRun.js +76 -0
  46. package/dist/ts/ts/Contract/ArcStudy.js +76 -0
  47. package/dist/ts/ts/Contract/ArcWorkflow.js +77 -0
  48. package/dist/ts/ts/Contract/Contract.js +45 -0
  49. package/dist/ts/ts/Contract/Datamap.js +221 -0
  50. package/dist/ts/ts/Contract/Git.js +57 -0
  51. package/dist/ts/ts/Contract/ValidationPackagesConfig.js +57 -0
  52. package/dist/ts/ts/ContractIO/ContractIO.js +202 -0
  53. package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts +1 -1
  54. package/dist/ts/ts/ContractIO/FileSystemHelper.d.ts.map +1 -1
  55. package/dist/ts/ts/ContractIO/FileSystemHelper.js +273 -0
  56. package/dist/ts/ts/Conversion.js +1247 -0
  57. package/dist/ts/ts/Core/ArcTypes.js +3393 -0
  58. package/dist/ts/ts/Core/Comment.js +91 -0
  59. package/dist/ts/ts/Core/CommentList.js +27 -0
  60. package/dist/ts/ts/Core/Conversion.js +923 -0
  61. package/dist/ts/ts/Core/Data.js +179 -0
  62. package/dist/ts/ts/Core/DataContext.js +108 -0
  63. package/dist/ts/ts/Core/DataFile.js +50 -0
  64. package/dist/ts/ts/Core/DataMap.js +53 -0
  65. package/dist/ts/ts/Core/Helper/Collections.js +323 -0
  66. package/dist/ts/ts/Core/Helper/HashCodes.js +35 -0
  67. package/dist/ts/ts/Core/Helper/Identifier.js +96 -0
  68. package/dist/ts/ts/Core/Helper/ORCID.js +34 -0
  69. package/dist/ts/ts/Core/Helper/Regex.js +296 -0
  70. package/dist/ts/ts/Core/Helper/SemVer.js +31 -0
  71. package/dist/ts/ts/Core/Helper/Url.js +32 -0
  72. package/dist/ts/ts/Core/IdentifierSetters.d.ts +3 -1
  73. package/dist/ts/ts/Core/IdentifierSetters.d.ts.map +1 -1
  74. package/dist/ts/ts/Core/IdentifierSetters.js +11 -0
  75. package/dist/ts/ts/Core/OntologyAnnotation.js +207 -0
  76. package/dist/ts/ts/Core/OntologySourceReference.js +84 -0
  77. package/dist/ts/ts/Core/Person.js +183 -0
  78. package/dist/ts/ts/Core/Process/ColumnIndex.js +73 -0
  79. package/dist/ts/ts/Core/Process/Component.js +121 -0
  80. package/dist/ts/ts/Core/Process/Factor.js +104 -0
  81. package/dist/ts/ts/Core/Process/FactorValue.js +68 -0
  82. package/dist/ts/ts/Core/Process/Material.js +49 -0
  83. package/dist/ts/ts/Core/Process/MaterialAttribute.js +30 -0
  84. package/dist/ts/ts/Core/Process/MaterialAttributeValue.js +68 -0
  85. package/dist/ts/ts/Core/Process/MaterialType.js +28 -0
  86. package/dist/ts/ts/Core/Process/Process.js +136 -0
  87. package/dist/ts/ts/Core/Process/ProcessInput.js +207 -0
  88. package/dist/ts/ts/Core/Process/ProcessOutput.js +178 -0
  89. package/dist/ts/ts/Core/Process/ProcessParameterValue.js +135 -0
  90. package/dist/ts/ts/Core/Process/ProcessSequence.js +56 -0
  91. package/dist/ts/ts/Core/Process/Protocol.js +54 -0
  92. package/dist/ts/ts/Core/Process/ProtocolParameter.js +69 -0
  93. package/dist/ts/ts/Core/Process/Sample.js +44 -0
  94. package/dist/ts/ts/Core/Process/Source.js +38 -0
  95. package/dist/ts/ts/Core/Publication.js +108 -0
  96. package/dist/ts/ts/Core/Table/ArcTable.js +889 -0
  97. package/dist/ts/ts/Core/Table/ArcTableAux.js +993 -0
  98. package/dist/ts/ts/Core/Table/ArcTables.js +415 -0
  99. package/dist/ts/ts/Core/Table/CompositeCell.js +334 -0
  100. package/dist/ts/ts/Core/Table/CompositeColumn.js +52 -0
  101. package/dist/ts/ts/Core/Table/CompositeHeader.js +792 -0
  102. package/dist/ts/ts/Core/Template.js +180 -0
  103. package/dist/ts/ts/Core/Templates.js +75 -0
  104. package/dist/ts/ts/Core/URI.js +8 -0
  105. package/dist/ts/ts/Core/Value.js +194 -0
  106. package/dist/ts/ts/CrossAsync.js +20 -0
  107. package/dist/ts/ts/FileSystem/DefaultGitattributes.js +3 -0
  108. package/dist/ts/ts/FileSystem/DefaultGitignore.js +3 -0
  109. package/dist/ts/ts/FileSystem/FileSystem.js +48 -0
  110. package/dist/ts/ts/FileSystem/FileSystemTree.js +339 -0
  111. package/dist/ts/ts/FileSystem/Path.js +36 -0
  112. package/dist/ts/ts/Json/Assay.d.ts +2 -2
  113. package/dist/ts/ts/Json/Assay.js +221 -0
  114. package/dist/ts/ts/Json/Comment.d.ts +1 -1
  115. package/dist/ts/ts/Json/Comment.js +112 -0
  116. package/dist/ts/ts/Json/Data.d.ts +1 -1
  117. package/dist/ts/ts/Json/Data.js +138 -0
  118. package/dist/ts/ts/Json/DataFile.d.ts +1 -1
  119. package/dist/ts/ts/Json/DataFile.js +55 -0
  120. package/dist/ts/ts/Json/DataMap/DataContext.d.ts +1 -1
  121. package/dist/ts/ts/Json/DataMap/DataContext.js +39 -0
  122. package/dist/ts/ts/Json/DataMap/DataMap.d.ts +1 -1
  123. package/dist/ts/ts/Json/DataMap/DataMap.js +27 -0
  124. package/dist/ts/ts/Json/Decode.d.ts +2 -2
  125. package/dist/ts/ts/Json/Decode.js +209 -0
  126. package/dist/ts/ts/Json/Encode.d.ts +1 -1
  127. package/dist/ts/ts/Json/Encode.js +65 -0
  128. package/dist/ts/ts/Json/IDTable.d.ts +1 -1
  129. package/dist/ts/ts/Json/IDTable.js +28 -0
  130. package/dist/ts/ts/Json/Investigation.d.ts +1 -1
  131. package/dist/ts/ts/Json/Investigation.js +229 -0
  132. package/dist/ts/ts/Json/OntologyAnnotation.d.ts +1 -1
  133. package/dist/ts/ts/Json/OntologyAnnotation.js +194 -0
  134. package/dist/ts/ts/Json/OntologySourceReference.d.ts +1 -1
  135. package/dist/ts/ts/Json/OntologySourceReference.js +119 -0
  136. package/dist/ts/ts/Json/Person.d.ts +1 -1
  137. package/dist/ts/ts/Json/Person.js +316 -0
  138. package/dist/ts/ts/Json/Process/AssayMaterials.d.ts +1 -1
  139. package/dist/ts/ts/Json/Process/AssayMaterials.js +21 -0
  140. package/dist/ts/ts/Json/Process/Component.d.ts +6 -4
  141. package/dist/ts/ts/Json/Process/Component.d.ts.map +1 -1
  142. package/dist/ts/ts/Json/Process/Component.js +58 -0
  143. package/dist/ts/ts/Json/Process/Factor.d.ts +1 -1
  144. package/dist/ts/ts/Json/Process/Factor.js +53 -0
  145. package/dist/ts/ts/Json/Process/FactorValue.d.ts +1 -1
  146. package/dist/ts/ts/Json/Process/FactorValue.js +44 -0
  147. package/dist/ts/ts/Json/Process/Material.d.ts +1 -1
  148. package/dist/ts/ts/Json/Process/Material.js +112 -0
  149. package/dist/ts/ts/Json/Process/MaterialAttribute.d.ts +1 -1
  150. package/dist/ts/ts/Json/Process/MaterialAttribute.js +43 -0
  151. package/dist/ts/ts/Json/Process/MaterialAttributeValue.d.ts +1 -1
  152. package/dist/ts/ts/Json/Process/MaterialAttributeValue.js +44 -0
  153. package/dist/ts/ts/Json/Process/MaterialType.d.ts +1 -1
  154. package/dist/ts/ts/Json/Process/MaterialType.js +45 -0
  155. package/dist/ts/ts/Json/Process/Process.d.ts +1 -1
  156. package/dist/ts/ts/Json/Process/Process.js +103 -0
  157. package/dist/ts/ts/Json/Process/ProcessInput.d.ts +1 -1
  158. package/dist/ts/ts/Json/Process/ProcessInput.js +42 -0
  159. package/dist/ts/ts/Json/Process/ProcessOutput.d.ts +1 -1
  160. package/dist/ts/ts/Json/Process/ProcessOutput.js +35 -0
  161. package/dist/ts/ts/Json/Process/ProcessParameterValue.d.ts +1 -1
  162. package/dist/ts/ts/Json/Process/ProcessParameterValue.js +28 -0
  163. package/dist/ts/ts/Json/Process/Protocol.d.ts +1 -1
  164. package/dist/ts/ts/Json/Process/Protocol.js +166 -0
  165. package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts +5 -3
  166. package/dist/ts/ts/Json/Process/ProtocolParameter.d.ts.map +1 -1
  167. package/dist/ts/ts/Json/Process/ProtocolParameter.js +52 -0
  168. package/dist/ts/ts/Json/Process/Sample.d.ts +1 -1
  169. package/dist/ts/ts/Json/Process/Sample.js +165 -0
  170. package/dist/ts/ts/Json/Process/Source.d.ts +1 -1
  171. package/dist/ts/ts/Json/Process/Source.js +133 -0
  172. package/dist/ts/ts/Json/Process/StudyMaterials.d.ts +1 -1
  173. package/dist/ts/ts/Json/Process/StudyMaterials.js +23 -0
  174. package/dist/ts/ts/Json/Process/Value.d.ts +1 -1
  175. package/dist/ts/ts/Json/Process/Value.js +41 -0
  176. package/dist/ts/ts/Json/PropertyValue.d.ts +1 -1
  177. package/dist/ts/ts/Json/PropertyValue.js +280 -0
  178. package/dist/ts/ts/Json/Publication.d.ts +1 -1
  179. package/dist/ts/ts/Json/Publication.js +123 -0
  180. package/dist/ts/ts/Json/ROCrate/LDContext.d.ts +1 -1
  181. package/dist/ts/ts/Json/ROCrate/LDContext.js +115 -0
  182. package/dist/ts/ts/Json/ROCrate/LDGraph.d.ts +1 -1
  183. package/dist/ts/ts/Json/ROCrate/LDGraph.js +83 -0
  184. package/dist/ts/ts/Json/ROCrate/LDNode.d.ts +1 -1
  185. package/dist/ts/ts/Json/ROCrate/LDNode.js +190 -0
  186. package/dist/ts/ts/Json/ROCrate/LDRef.d.ts +1 -1
  187. package/dist/ts/ts/Json/ROCrate/LDRef.js +24 -0
  188. package/dist/ts/ts/Json/ROCrate/LDValue.d.ts +1 -1
  189. package/dist/ts/ts/Json/ROCrate/LDValue.js +63 -0
  190. package/dist/ts/ts/Json/Run.d.ts +11 -0
  191. package/dist/ts/ts/Json/Run.d.ts.map +1 -0
  192. package/dist/ts/ts/Json/Run.js +76 -0
  193. package/dist/ts/ts/Json/StringTable.d.ts +1 -1
  194. package/dist/ts/ts/Json/StringTable.js +66 -0
  195. package/dist/ts/ts/Json/Study.d.ts +1 -1
  196. package/dist/ts/ts/Json/Study.js +326 -0
  197. package/dist/ts/ts/Json/Table/ArcTable.d.ts +1 -1
  198. package/dist/ts/ts/Json/Table/ArcTable.js +210 -0
  199. package/dist/ts/ts/Json/Table/CellTable.d.ts +1 -1
  200. package/dist/ts/ts/Json/Table/CellTable.js +53 -0
  201. package/dist/ts/ts/Json/Table/CompositeCell.d.ts +1 -1
  202. package/dist/ts/ts/Json/Table/CompositeCell.js +106 -0
  203. package/dist/ts/ts/Json/Table/CompositeHeader.d.ts +1 -1
  204. package/dist/ts/ts/Json/Table/CompositeHeader.js +121 -0
  205. package/dist/ts/ts/Json/Table/IOType.d.ts +1 -1
  206. package/dist/ts/ts/Json/Table/IOType.js +15 -0
  207. package/dist/ts/ts/Json/Table/OATable.d.ts +1 -1
  208. package/dist/ts/ts/Json/Table/OATable.js +50 -0
  209. package/dist/ts/ts/Json/Table/Templates.d.ts +1 -1
  210. package/dist/ts/ts/Json/Table/Templates.js +15 -0
  211. package/dist/ts/ts/Json/Workflow.d.ts +11 -0
  212. package/dist/ts/ts/Json/Workflow.d.ts.map +1 -0
  213. package/dist/ts/ts/Json/Workflow.js +93 -0
  214. package/dist/ts/ts/Json/context/rocrate/isa_assay_context.d.ts +1 -1
  215. package/dist/ts/ts/Json/context/rocrate/isa_assay_context.js +61 -0
  216. package/dist/ts/ts/Json/context/rocrate/isa_comment_context.d.ts +1 -1
  217. package/dist/ts/ts/Json/context/rocrate/isa_comment_context.js +29 -0
  218. package/dist/ts/ts/Json/context/rocrate/isa_data_context.d.ts +1 -1
  219. package/dist/ts/ts/Json/context/rocrate/isa_data_context.js +41 -0
  220. package/dist/ts/ts/Json/context/rocrate/isa_investigation_context.d.ts +1 -1
  221. package/dist/ts/ts/Json/context/rocrate/isa_investigation_context.js +69 -0
  222. package/dist/ts/ts/Json/context/rocrate/isa_material_context.d.ts +1 -1
  223. package/dist/ts/ts/Json/context/rocrate/isa_material_context.js +37 -0
  224. package/dist/ts/ts/Json/context/rocrate/isa_ontology_annotation_context.d.ts +1 -1
  225. package/dist/ts/ts/Json/context/rocrate/isa_ontology_annotation_context.js +37 -0
  226. package/dist/ts/ts/Json/context/rocrate/isa_ontology_source_reference_context.d.ts +1 -1
  227. package/dist/ts/ts/Json/context/rocrate/isa_ontology_source_reference_context.js +41 -0
  228. package/dist/ts/ts/Json/context/rocrate/isa_organization_context.d.ts +1 -1
  229. package/dist/ts/ts/Json/context/rocrate/isa_organization_context.js +25 -0
  230. package/dist/ts/ts/Json/context/rocrate/isa_person_context.d.ts +1 -1
  231. package/dist/ts/ts/Json/context/rocrate/isa_person_context.js +86 -0
  232. package/dist/ts/ts/Json/context/rocrate/isa_process_context.d.ts +1 -1
  233. package/dist/ts/ts/Json/context/rocrate/isa_process_context.js +57 -0
  234. package/dist/ts/ts/Json/context/rocrate/isa_protocol_context.d.ts +1 -1
  235. package/dist/ts/ts/Json/context/rocrate/isa_protocol_context.js +61 -0
  236. package/dist/ts/ts/Json/context/rocrate/isa_publication_context.d.ts +1 -1
  237. package/dist/ts/ts/Json/context/rocrate/isa_publication_context.js +45 -0
  238. package/dist/ts/ts/Json/context/rocrate/isa_sample_context.d.ts +1 -1
  239. package/dist/ts/ts/Json/context/rocrate/isa_sample_context.js +33 -0
  240. package/dist/ts/ts/Json/context/rocrate/isa_source_context.d.ts +1 -1
  241. package/dist/ts/ts/Json/context/rocrate/isa_source_context.js +33 -0
  242. package/dist/ts/ts/Json/context/rocrate/isa_study_context.d.ts +1 -1
  243. package/dist/ts/ts/Json/context/rocrate/isa_study_context.js +77 -0
  244. package/dist/ts/ts/Json/context/rocrate/property_value_context.d.ts +1 -1
  245. package/dist/ts/ts/Json/context/rocrate/property_value_context.js +61 -0
  246. package/dist/ts/ts/Json/context/rocrate/rocrate_context.d.ts +1 -1
  247. package/dist/ts/ts/Json.d.ts +21 -1
  248. package/dist/ts/ts/Json.d.ts.map +1 -1
  249. package/dist/ts/ts/Json.js +211 -0
  250. package/dist/ts/ts/JsonIO/Assay.js +77 -0
  251. package/dist/ts/ts/JsonIO/Investigation.js +77 -0
  252. package/dist/ts/ts/JsonIO/LDObject.js +77 -0
  253. package/dist/ts/ts/JsonIO/OntologyAnnotation.js +56 -0
  254. package/dist/ts/ts/JsonIO/Run.d.ts +10 -0
  255. package/dist/ts/ts/JsonIO/Run.d.ts.map +1 -0
  256. package/dist/ts/ts/JsonIO/Run.js +44 -0
  257. package/dist/ts/ts/JsonIO/Study.js +77 -0
  258. package/dist/ts/ts/JsonIO/Table/Compression.d.ts +1 -1
  259. package/dist/ts/ts/JsonIO/Table/Compression.js +39 -0
  260. package/dist/ts/ts/JsonIO/Table/Templates.d.ts +1 -1
  261. package/dist/ts/ts/JsonIO/Table/Templates.js +25 -0
  262. package/dist/ts/ts/JsonIO/Workflow.d.ts +10 -0
  263. package/dist/ts/ts/JsonIO/Workflow.d.ts.map +1 -0
  264. package/dist/ts/ts/JsonIO/Workflow.js +44 -0
  265. package/dist/ts/ts/ROCrate/Generic/Comment.js +103 -0
  266. package/dist/ts/ts/ROCrate/Generic/Dataset.js +624 -0
  267. package/dist/ts/ts/ROCrate/Generic/DefinedTerm.js +103 -0
  268. package/dist/ts/ts/ROCrate/Generic/File.js +184 -0
  269. package/dist/ts/ts/ROCrate/Generic/LabProcess.js +222 -0
  270. package/dist/ts/ts/ROCrate/Generic/LabProtocol.js +257 -0
  271. package/dist/ts/ts/ROCrate/Generic/Organization.js +63 -0
  272. package/dist/ts/ts/ROCrate/Generic/Person.js +377 -0
  273. package/dist/ts/ts/ROCrate/Generic/PostalAddress.js +143 -0
  274. package/dist/ts/ts/ROCrate/Generic/PropertyValue.js +512 -0
  275. package/dist/ts/ts/ROCrate/Generic/Sample.js +131 -0
  276. package/dist/ts/ts/ROCrate/Generic/ScholarlyArticle.js +173 -0
  277. package/dist/ts/ts/ROCrate/Helper.js +7 -0
  278. package/dist/ts/ts/ROCrate/LDContext.js +288 -0
  279. package/dist/ts/ts/ROCrate/LDObject.js +855 -0
  280. package/dist/ts/ts/ROCrate/ROCrateContext.js +39 -0
  281. package/dist/ts/ts/ROCrateIO.d.ts +1 -1
  282. package/dist/ts/ts/ROCrateIO.js +58 -0
  283. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts +2 -2
  284. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.d.ts.map +1 -1
  285. package/dist/ts/ts/Spreadsheet/AnnotationTable/ArcTable.js +149 -0
  286. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeCell.js +63 -0
  287. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts +2 -2
  288. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.d.ts.map +1 -1
  289. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeColumn.js +108 -0
  290. package/dist/ts/ts/Spreadsheet/AnnotationTable/CompositeHeader.js +410 -0
  291. package/dist/ts/ts/Spreadsheet/ArcAssay.d.ts +2 -2
  292. package/dist/ts/ts/Spreadsheet/ArcAssay.d.ts.map +1 -1
  293. package/dist/ts/ts/Spreadsheet/ArcAssay.js +169 -0
  294. package/dist/ts/ts/Spreadsheet/ArcInvestigation.d.ts +2 -2
  295. package/dist/ts/ts/Spreadsheet/ArcInvestigation.d.ts.map +1 -1
  296. package/dist/ts/ts/Spreadsheet/ArcInvestigation.js +316 -0
  297. package/dist/ts/ts/Spreadsheet/ArcRun.d.ts +2 -2
  298. package/dist/ts/ts/Spreadsheet/ArcRun.d.ts.map +1 -1
  299. package/dist/ts/ts/Spreadsheet/ArcRun.js +136 -0
  300. package/dist/ts/ts/Spreadsheet/ArcStudy.d.ts +2 -2
  301. package/dist/ts/ts/Spreadsheet/ArcStudy.d.ts.map +1 -1
  302. package/dist/ts/ts/Spreadsheet/ArcStudy.js +92 -0
  303. package/dist/ts/ts/Spreadsheet/ArcWorkflow.d.ts +2 -2
  304. package/dist/ts/ts/Spreadsheet/ArcWorkflow.d.ts.map +1 -1
  305. package/dist/ts/ts/Spreadsheet/ArcWorkflow.js +125 -0
  306. package/dist/ts/ts/Spreadsheet/CollectionAux.js +34 -0
  307. package/dist/ts/ts/Spreadsheet/DataMap.d.ts +1 -1
  308. package/dist/ts/ts/Spreadsheet/DataMap.d.ts.map +1 -1
  309. package/dist/ts/ts/Spreadsheet/DataMap.js +33 -0
  310. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapColumn.d.ts +2 -2
  311. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapColumn.d.ts.map +1 -1
  312. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapColumn.js +41 -0
  313. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapHeader.d.ts +1 -1
  314. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapHeader.d.ts.map +1 -1
  315. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapHeader.js +418 -0
  316. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapTable.d.ts +3 -3
  317. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapTable.d.ts.map +1 -1
  318. package/dist/ts/ts/Spreadsheet/DataMapTable/DataMapTable.js +85 -0
  319. package/dist/ts/ts/Spreadsheet/Metadata/Assays.js +90 -0
  320. package/dist/ts/ts/Spreadsheet/Metadata/Comment.js +58 -0
  321. package/dist/ts/ts/Spreadsheet/Metadata/Contacts.js +85 -0
  322. package/dist/ts/ts/Spreadsheet/Metadata/Conversions.js +133 -0
  323. package/dist/ts/ts/Spreadsheet/Metadata/DesignDescriptors.js +15 -0
  324. package/dist/ts/ts/Spreadsheet/Metadata/Factors.js +74 -0
  325. package/dist/ts/ts/Spreadsheet/Metadata/OntologyAnnotation.js +58 -0
  326. package/dist/ts/ts/Spreadsheet/Metadata/OntologySourceReference.js +62 -0
  327. package/dist/ts/ts/Spreadsheet/Metadata/Protocols.js +94 -0
  328. package/dist/ts/ts/Spreadsheet/Metadata/Publication.js +81 -0
  329. package/dist/ts/ts/Spreadsheet/Metadata/Run.js +91 -0
  330. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.d.ts +3 -3
  331. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.d.ts.map +1 -1
  332. package/dist/ts/ts/Spreadsheet/Metadata/SparseTable.js +193 -0
  333. package/dist/ts/ts/Spreadsheet/Metadata/Study.js +238 -0
  334. package/dist/ts/ts/Spreadsheet/Metadata/Workflow.js +105 -0
  335. package/dist/ts/ts/Template.Web.js +22 -0
  336. package/dist/ts/ts/ValidationPackages/ValidationPackage.js +53 -0
  337. package/dist/ts/ts/ValidationPackages/ValidationPackagesConfig.js +78 -0
  338. package/dist/ts/ts/WebRequest/WebRequest.Node.js +13 -0
  339. package/dist/ts/ts/WebRequest/WebRequest.js +19 -0
  340. package/dist/ts/ts/Xlsx.d.ts +22 -2
  341. package/dist/ts/ts/Xlsx.d.ts.map +1 -1
  342. package/dist/ts/ts/Xlsx.js +131 -0
  343. package/dist/ts/ts/Yaml/Encode.js +8 -0
  344. package/dist/ts/ts/Yaml/ValidationPackage.js +26 -0
  345. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +40 -0
  346. package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/DynamicObj.fs.js +344 -0
  347. package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/FableJS.fs.js +103 -0
  348. package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/HashCodes.fs.js +19 -0
  349. package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/PropertyHelper.fs.js +17 -0
  350. package/dist/ts/ts/fable_modules/DynamicObj.7.0.1/ReflectionUtils.fs.js +7 -0
  351. package/dist/ts/ts/fable_modules/Fable.Exceljs.1.6.0/ExcelJs.fs.js +5 -0
  352. package/dist/ts/ts/fable_modules/Fable.Fetch.2.6.0/Fetch.fs.js +18 -0
  353. package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +44 -0
  354. package/dist/ts/ts/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +5 -0
  355. package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.5.0/Http.fs.js +142 -0
  356. package/dist/ts/ts/fable_modules/Fable.SimpleHttp.3.5.0/Types.fs.js +76 -0
  357. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Cells/FsCell.fs.js +359 -0
  358. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Cells/FsCellsCollection.fs.js +344 -0
  359. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsAddress.fs.js +154 -0
  360. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsColumn.fs.js +116 -0
  361. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsRow.fs.js +126 -0
  362. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsWorkbook.fs.js +135 -0
  363. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/FsWorksheet.fs.js +422 -0
  364. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/HashCodes.fs.js +5 -0
  365. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Json/Value.fs.js +25 -0
  366. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRange.fs.js +28 -0
  367. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeAddress.fs.js +82 -0
  368. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeBase.fs.js +69 -0
  369. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeColumn.fs.js +42 -0
  370. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Ranges/FsRangeRow.fs.js +29 -0
  371. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Tables/FsTable.fs.js +348 -0
  372. package/dist/ts/ts/fable_modules/FsSpreadsheet.7.0.0-alpha.1/Tables/FsTableField.fs.js +86 -0
  373. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Cell.fs.js +68 -0
  374. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/FsExtensions.fs.js +12 -0
  375. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Table.fs.js +54 -0
  376. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Workbook.fs.js +33 -0
  377. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Worksheet.fs.js +63 -0
  378. package/dist/ts/ts/fable_modules/FsSpreadsheet.Js.7.0.0-alpha.1/Xlsx.fs.js +66 -0
  379. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.7.0/Decode.fs.js +544 -0
  380. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.7.0/Encode.fs.js +31 -0
  381. package/dist/ts/ts/fable_modules/Thoth.Json.Core.0.7.0/Types.fs.js +38 -0
  382. package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.4.1/Decode.fs.js +79 -0
  383. package/dist/ts/ts/fable_modules/Thoth.Json.JavaScript.0.4.1/Encode.fs.js +57 -0
  384. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Decode.fs.js +235 -0
  385. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Encode.fs.js +16 -0
  386. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Persil.fs.js +45 -0
  387. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Preprocessing.fs.js +89 -0
  388. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Reader.fs.js +480 -0
  389. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Regex.fs.js +11 -0
  390. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/RegexActivePatterns.fs.js +212 -0
  391. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/Writer.fs.js +164 -0
  392. package/dist/ts/ts/fable_modules/YAMLicious.0.0.3/YAMLiciousTypes.fs.js +136 -0
  393. package/package.json +10 -7
  394. package/dist/ts/__vite-browser-external-2447137e.js +0 -4
  395. package/dist/ts/__vite-browser-external-b3701507.cjs +0 -1
  396. package/dist/ts/arctrl.cjs.js +0 -5691
  397. package/dist/ts/arctrl.es.js +0 -35562
  398. package/dist/ts/arctrl.umd.js +0 -5691
@@ -0,0 +1,914 @@
1
+ import { FileSystem } from './FileSystem/FileSystem.js';
2
+ import { unwrap, defaultArg, value, bind } from '../node_modules/@fable-org/fable-library-js/Option.js';
3
+ import { ArcInvestigation, ArcWorkflow__get_Identifier, ArcWorkflow__get_DataMap, ArcWorkflow__set_DataMap_51F1E59E, ArcWorkflow__set_StaticHash_Z524259A4, ArcWorkflow__GetLightHashCode, ArcWorkflow__Copy_6FCE9E49, ArcWorkflow__get_StaticHash } from './Core/ArcTypes.js';
4
+ import { fullFillContractBatchAsync } from './ContractIO/ContractIO.js';
5
+ import { FSharpResult$2_Error, FSharpResult$2_Ok } from '../node_modules/@fable-org/fable-library-js/Result.js';
6
+ import { Contract } from './Contract/Contract.js';
7
+ import { PromiseBuilder__Run_212F1D4B, PromiseBuilder__Delay_62FBFDE1 } from './fable_modules/Fable.Promise.3.2.0/Promise.fs.js';
8
+ import { promise } from './fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js';
9
+ import { getAllFilePathsAsync } from './ContractIO/FileSystemHelper.js';
10
+ import { contains, toArray, delay, iterate, tryFind, find, toList, append as append$1, singleton, empty, map as map$1, collect } from '../node_modules/@fable-org/fable-library-js/Seq.js';
11
+ import { stringHash, curry2, safeHash, getEnumerator, disposeSafe, comparePrimitives, defaultOf, equals } from '../node_modules/@fable-org/fable-library-js/Util.js';
12
+ import { getAssayFolderPath, getStudyFolderPath } from './FileSystem/Path.js';
13
+ import { ARCtrl_ArcAssay__ArcAssay_tryFromReadContract_Static_7570923F, ARCtrl_ArcAssay__ArcAssay_ToDeleteContract, ARCtrl_ArcAssay__ArcAssay_ToCreateContract_6FCE9E49, ARCtrl_ArcAssay__ArcAssay_ToUpdateContract } from './Contract/ArcAssay.js';
14
+ import { ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract, ARCtrl_ArcInvestigation__ArcInvestigation_tryFromReadContract_Static_7570923F } from './Contract/ArcInvestigation.js';
15
+ import { ARCtrl_ArcStudy__ArcStudy_tryFromReadContract_Static_7570923F, ARCtrl_ArcStudy__ArcStudy_ToUpdateContract, ARCtrl_ArcStudy__ArcStudy_ToCreateContract_6FCE9E49 } from './Contract/ArcStudy.js';
16
+ import { map, choose, fold, concat, contains as contains$1, append, equalsWith, item, tryPick } from '../node_modules/@fable-org/fable-library-js/Array.js';
17
+ import { replace, toText, printf, toFail, join } from '../node_modules/@fable-org/fable-library-js/String.js';
18
+ import { createMissingIdentifier, Study_fileNameFromIdentifier, Study_datamapFileNameFromIdentifier, Assay_fileNameFromIdentifier, Assay_datamapFileNameFromIdentifier, Workflow_fileNameFromIdentifier, Workflow_datamapFileNameFromIdentifier, Run_fileNameFromIdentifier, Run_datamapFileNameFromIdentifier } from './Core/Helper/Identifier.js';
19
+ import { ofSeq, unionMany, FSharpSet__Contains, contains as contains$2 } from '../node_modules/@fable-org/fable-library-js/Set.js';
20
+ import { ResizeArray_map, ResizeArray_iter } from './Core/Helper/Collections.js';
21
+ import { DataMap__set_StaticHash_Z524259A4, DataMap__get_DataContexts, DataMap__get_StaticHash } from './Core/DataMap.js';
22
+ import { FileSystemTree_Folder, FileSystemTree } from './FileSystem/FileSystemTree.js';
23
+ import { tryISAReadContractFromPath } from './Contract/ARC.js';
24
+ import { setInvestigationIdentifier } from './Core/IdentifierSetters.js';
25
+ import { ArcTables } from './Core/Table/ArcTables.js';
26
+ import { addToDict } from '../node_modules/@fable-org/fable-library-js/MapUtil.js';
27
+ import { ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF } from './Spreadsheet/ArcInvestigation.js';
28
+ import { ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522 } from './Spreadsheet/ArcStudy.js';
29
+ import { toFsWorkbook } from './Spreadsheet/DataMap.js';
30
+ import { ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F } from './Spreadsheet/ArcAssay.js';
31
+ import { ARCtrl_ArcWorkflow__ArcWorkflow_toFsWorkbook_Static_Z1C75CB0E } from './Spreadsheet/ArcWorkflow.js';
32
+ import { ARCtrl_ArcRun__ArcRun_toFsWorkbook_Static_Z3EFAF6F8 } from './Spreadsheet/ArcRun.js';
33
+ import { Dictionary_tryGet } from './fable_modules/FsSpreadsheet.7.0.0-alpha.1/Cells/FsCellsCollection.fs.js';
34
+ import { ARCtrl_DataMap__DataMap_tryFromReadContractForAssay_Static, ARCtrl_DataMap__DataMap_tryFromReadContractForStudy_Static, ARCtrl_DataMap__DataMap_tryFromReadContractForWorkflow_Static, ARCtrl_DataMap__DataMap_tryFromReadContractForRun_Static, ARCtrl_DataMap__DataMap_ToUpdateContractForStudy_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForStudy_Z721C83C5, ARCtrl_DataMap__DataMap_ToUpdateContractForAssay_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForAssay_Z721C83C5, ARCtrl_DataMap__DataMap_ToUpdateContractForWorkflow_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForWorkflow_Z721C83C5, ARCtrl_DataMap__DataMap_ToUpdateContractForRun_Z721C83C5, ARCtrl_DataMap__DataMap_ToCreateContractForRun_Z721C83C5 } from './Contract/Datamap.js';
35
+ import { ARCtrl_ArcWorkflow__ArcWorkflow_tryFromReadContract_Static_7570923F, ARCtrl_ArcWorkflow__ArcWorkflow_ToCreateContract_6FCE9E49, ARCtrl_ArcWorkflow__ArcWorkflow_ToUpdateContract } from './Contract/ArcWorkflow.js';
36
+ import { ARCtrl_ArcRun__ArcRun_tryFromReadContract_Static_7570923F, ARCtrl_ArcRun__ArcRun_ToCreateContract_6FCE9E49, ARCtrl_ArcRun__ArcRun_ToUpdateContract } from './Contract/ArcRun.js';
37
+ import { Clone_createCloneContract_5000466F, gitignoreContract, gitattributesContract, Init_createInitContract_6DFDD678, Init_createAddRemoteContract_Z721C83C5 } from './Contract/Git.js';
38
+ import { ofSeq as ofSeq$1 } from '../node_modules/@fable-org/fable-library-js/Map.js';
39
+ import { fromString } from './fable_modules/Thoth.Json.JavaScript.0.4.1/Decode.fs.js';
40
+ import { ROCrate_get_decoderDeprecated, ROCrate_get_decoder, ROCrate_encoder_B568605 } from './ROCrateIO.js';
41
+ import { toString } from './fable_modules/Thoth.Json.JavaScript.0.4.1/Encode.fs.js';
42
+ import { defaultSpaces } from './Json/Encode.js';
43
+ import { ValidationPackagesConfigHelper_ConfigFilePath, ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toCreateContract_Static_724DAE55, ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toDeleteContract_Static_724DAE55, ValidationPackagesConfigHelper_ReadContract, ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_tryFromReadContract_Static_7570923F } from './Contract/ValidationPackagesConfig.js';
44
+ import { FSharpRef } from '../node_modules/@fable-org/fable-library-js/Types.js';
45
+
46
+ class ARC extends ArcInvestigation {
47
+ constructor(identifier, title, description, submissionDate, publicReleaseDate, ontologySourceReferences, publications, contacts, assays, studies, workflows, runs, registeredStudyIdentifiers, comments, remarks, cwl, fs) {
48
+ super(identifier, unwrap(title), unwrap(description), unwrap(submissionDate), unwrap(publicReleaseDate), unwrap(ontologySourceReferences), unwrap(publications), unwrap(contacts), unwrap(assays), unwrap(studies), unwrap(workflows), unwrap(runs), unwrap(registeredStudyIdentifiers), unwrap(comments), unwrap(remarks));
49
+ let fs_1;
50
+ const this$ = new FSharpRef(defaultOf());
51
+ this$.contents = this;
52
+ this._cwl = cwl;
53
+ this._fs = (fs_1 = defaultArg(fs, FileSystem.create({
54
+ tree: FileSystemTree_Folder("", [])
55
+ })), ARCAux_updateFSByISA(this$.contents, fs_1));
56
+ this["init@90"] = 1;
57
+ }
58
+ get FileSystem() {
59
+ const this$ = this;
60
+ return this$._fs;
61
+ }
62
+ set FileSystem(fs) {
63
+ const this$ = this;
64
+ this$._fs = fs;
65
+ }
66
+ static fromArcInvestigation(isa, cwl, fs) {
67
+ return new ARC(isa.Identifier, unwrap(isa.Title), unwrap(isa.Description), unwrap(isa.SubmissionDate), unwrap(isa.PublicReleaseDate), isa.OntologySourceReferences, isa.Publications, isa.Contacts, isa.Assays, isa.Studies, isa.Workflows, isa.Runs, isa.RegisteredStudyIdentifiers, isa.Comments, isa.Remarks, cwl, unwrap(fs));
68
+ }
69
+ TryWriteAsync(arcPath) {
70
+ const this$ = this;
71
+ return fullFillContractBatchAsync(arcPath, this$.GetWriteContracts());
72
+ }
73
+ TryUpdateAsync(arcPath) {
74
+ const this$ = this;
75
+ return fullFillContractBatchAsync(arcPath, this$.GetUpdateContracts());
76
+ }
77
+ static tryLoadAsync(arcPath) {
78
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => getAllFilePathsAsync(arcPath).then((_arg) => {
79
+ const arc = ARC.fromFilePaths(toArray(_arg));
80
+ const contracts = arc.GetReadContracts();
81
+ return fullFillContractBatchAsync(arcPath, contracts).then((_arg_1) => {
82
+ const fulFilledContracts = _arg_1;
83
+ if (fulFilledContracts.tag === /* Error */
84
+ 1) {
85
+ const e = fulFilledContracts.fields[0];
86
+ return Promise.resolve(FSharpResult$2_Error(e));
87
+ } else {
88
+ const c = fulFilledContracts.fields[0];
89
+ arc.SetISAFromContracts(c);
90
+ return Promise.resolve(FSharpResult$2_Ok(arc));
91
+ }
92
+ });
93
+ })));
94
+ }
95
+ GetAssayRemoveContracts(assayIdentifier) {
96
+ const this$ = this;
97
+ if (!contains(assayIdentifier, this$.AssayIdentifiers, {
98
+ Equals: (x, y) => x === y,
99
+ GetHashCode: stringHash
100
+ })) {
101
+ throw new Error("ARC does not contain assay with given name");
102
+ }
103
+ const assay = this$.GetAssay(assayIdentifier);
104
+ const studies = assay.StudiesRegisteredIn;
105
+ super.RemoveAssay(assayIdentifier);
106
+ const paths = this$.FileSystem.Tree.ToFilePaths();
107
+ const assayFolderPath = getAssayFolderPath(assayIdentifier);
108
+ const filteredPaths = paths.filter((p) => !p.startsWith(assayFolderPath));
109
+ this$.SetFilePaths(filteredPaths);
110
+ return toArray(delay(() => append$1(singleton(ARCtrl_ArcAssay__ArcAssay_ToDeleteContract(assay)), delay(() => append$1(singleton(ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(this$)), delay(() => map$1(ARCtrl_ArcStudy__ArcStudy_ToUpdateContract, studies)))))));
111
+ }
112
+ TryRemoveAssayAsync(arcPath, assayIdentifier) {
113
+ const this$ = this;
114
+ return fullFillContractBatchAsync(arcPath, this$.GetAssayRemoveContracts(assayIdentifier));
115
+ }
116
+ GetAssayRenameContracts(oldAssayIdentifier, newAssayIdentifier) {
117
+ const this$ = this;
118
+ if (!contains(oldAssayIdentifier, this$.AssayIdentifiers, {
119
+ Equals: (x, y) => x === y,
120
+ GetHashCode: stringHash
121
+ })) {
122
+ throw new Error("ARC does not contain assay with given name");
123
+ }
124
+ super.RenameAssay(oldAssayIdentifier, newAssayIdentifier);
125
+ const paths = this$.FileSystem.Tree.ToFilePaths();
126
+ const oldAssayFolderPath = getAssayFolderPath(oldAssayIdentifier);
127
+ const newAssayFolderPath = getAssayFolderPath(newAssayIdentifier);
128
+ const renamedPaths = map((p) => replace(p, oldAssayFolderPath, newAssayFolderPath), paths);
129
+ this$.SetFilePaths(renamedPaths);
130
+ return toArray(delay(() => append$1(singleton(Contract.createRename(oldAssayFolderPath, newAssayFolderPath)), delay(() => this$.GetUpdateContracts()))));
131
+ }
132
+ TryRenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier) {
133
+ const this$ = this;
134
+ return fullFillContractBatchAsync(arcPath, this$.GetAssayRenameContracts(oldAssayIdentifier, newAssayIdentifier));
135
+ }
136
+ GetStudyRemoveContracts(studyIdentifier) {
137
+ const this$ = this;
138
+ super.RemoveStudy(studyIdentifier);
139
+ const paths = this$.FileSystem.Tree.ToFilePaths();
140
+ const studyFolderPath = getStudyFolderPath(studyIdentifier);
141
+ const filteredPaths = paths.filter((p) => !p.startsWith(studyFolderPath));
142
+ this$.SetFilePaths(filteredPaths);
143
+ return [Contract.createDelete(studyFolderPath), ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(this$)];
144
+ }
145
+ TryRemoveStudyAsync(arcPath, studyIdentifier) {
146
+ const this$ = this;
147
+ return fullFillContractBatchAsync(arcPath, this$.GetStudyRemoveContracts(studyIdentifier));
148
+ }
149
+ GetStudyRenameContracts(oldStudyIdentifier, newStudyIdentifier) {
150
+ const this$ = this;
151
+ if (!contains(oldStudyIdentifier, this$.StudyIdentifiers, {
152
+ Equals: (x, y) => x === y,
153
+ GetHashCode: stringHash
154
+ })) {
155
+ throw new Error("ARC does not contain study with given name");
156
+ }
157
+ super.RenameStudy(oldStudyIdentifier, newStudyIdentifier);
158
+ const paths = this$.FileSystem.Tree.ToFilePaths();
159
+ const oldStudyFolderPath = getStudyFolderPath(oldStudyIdentifier);
160
+ const newStudyFolderPath = getStudyFolderPath(newStudyIdentifier);
161
+ const renamedPaths = map((p) => replace(p, oldStudyFolderPath, newStudyFolderPath), paths);
162
+ this$.SetFilePaths(renamedPaths);
163
+ return toArray(delay(() => append$1(singleton(Contract.createRename(oldStudyFolderPath, newStudyFolderPath)), delay(() => this$.GetUpdateContracts()))));
164
+ }
165
+ TryRenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier) {
166
+ const this$ = this;
167
+ return fullFillContractBatchAsync(arcPath, this$.GetStudyRenameContracts(oldStudyIdentifier, newStudyIdentifier));
168
+ }
169
+ WriteAsync(arcPath) {
170
+ const this$ = this;
171
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => this$.TryWriteAsync(arcPath).then((_arg) => {
172
+ const result = _arg;
173
+ if (result.tag === /* Error */
174
+ 1) {
175
+ const appended = join("\n", map((e) => e, result.fields[0]));
176
+ toFail(printf("Could not write ARC, failed with the following errors %s"))(appended);
177
+ return Promise.resolve();
178
+ } else {
179
+ return Promise.resolve();
180
+ }
181
+ })));
182
+ }
183
+ UpdateAsync(arcPath) {
184
+ const this$ = this;
185
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => this$.TryUpdateAsync(arcPath).then((_arg) => {
186
+ const result = _arg;
187
+ if (result.tag === /* Error */
188
+ 1) {
189
+ const appended = join("\n", map((e) => e, result.fields[0]));
190
+ toFail(printf("Could not update ARC, failed with the following errors %s"))(appended);
191
+ return Promise.resolve();
192
+ } else {
193
+ return Promise.resolve();
194
+ }
195
+ })));
196
+ }
197
+ RemoveAssayAsync(arcPath, assayIdentifier) {
198
+ const this$ = this;
199
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => this$.TryRemoveAssayAsync(arcPath, assayIdentifier).then((_arg) => {
200
+ const result = _arg;
201
+ if (result.tag === /* Error */
202
+ 1) {
203
+ const appended = join("\n", map((e) => e, result.fields[0]));
204
+ toFail(printf("Could not remove assay, failed with the following errors %s"))(appended);
205
+ return Promise.resolve();
206
+ } else {
207
+ return Promise.resolve();
208
+ }
209
+ })));
210
+ }
211
+ RenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier) {
212
+ const this$ = this;
213
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => this$.TryRenameAssayAsync(arcPath, oldAssayIdentifier, newAssayIdentifier).then((_arg) => {
214
+ const result = _arg;
215
+ if (result.tag === /* Error */
216
+ 1) {
217
+ const appended = join("\n", map((e) => e, result.fields[0]));
218
+ toFail(printf("Could not rename assay, failed with the following errors %s"))(appended);
219
+ return Promise.resolve();
220
+ } else {
221
+ return Promise.resolve();
222
+ }
223
+ })));
224
+ }
225
+ RemoveStudyAsync(arcPath, studyIdentifier) {
226
+ const this$ = this;
227
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => this$.TryRemoveStudyAsync(arcPath, studyIdentifier).then((_arg) => {
228
+ const result = _arg;
229
+ if (result.tag === /* Error */
230
+ 1) {
231
+ const appended = join("\n", map((e) => e, result.fields[0]));
232
+ toFail(printf("Could not remove study, failed with the following errors %s"))(appended);
233
+ return Promise.resolve();
234
+ } else {
235
+ return Promise.resolve();
236
+ }
237
+ })));
238
+ }
239
+ RenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier) {
240
+ const this$ = this;
241
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => this$.TryRenameStudyAsync(arcPath, oldStudyIdentifier, newStudyIdentifier).then((_arg) => {
242
+ const result = _arg;
243
+ if (result.tag === /* Error */
244
+ 1) {
245
+ const appended = join("\n", map((e) => e, result.fields[0]));
246
+ toFail(printf("Could not rename study, failed with the following errors %s"))(appended);
247
+ return Promise.resolve();
248
+ } else {
249
+ return Promise.resolve();
250
+ }
251
+ })));
252
+ }
253
+ static loadAsync(arcPath) {
254
+ return PromiseBuilder__Run_212F1D4B(promise, PromiseBuilder__Delay_62FBFDE1(promise, () => ARC.tryLoadAsync(arcPath).then((_arg) => {
255
+ const result = _arg;
256
+ if (result.tag === /* Error */
257
+ 1) {
258
+ const appended = join("\n", map((e) => e, result.fields[0]));
259
+ toFail(printf("Could not load ARC, failed with the following errors %s"))(appended);
260
+ return Promise.resolve(new ARC(createMissingIdentifier()));
261
+ } else {
262
+ const arc = result.fields[0];
263
+ return Promise.resolve(arc);
264
+ }
265
+ })));
266
+ }
267
+ MakeDataFilesAbsolute() {
268
+ const this$ = this;
269
+ const filesPaths = ofSeq(this$.FileSystem.Tree.ToFilePaths(), {
270
+ Compare: comparePrimitives
271
+ });
272
+ const checkExistenceFromRoot = (p) => contains$2(p, filesPaths);
273
+ const updateColumnOption = (dataNameFunction, col) => {
274
+ let col_1;
275
+ let matchResult, col_2;
276
+ if (col != null) {
277
+ if (col_1 = value(col), col_1.Header.IsDataColumn) {
278
+ matchResult = 0;
279
+ col_2 = value(col);
280
+ } else {
281
+ matchResult = 1;
282
+ }
283
+ } else {
284
+ matchResult = 1;
285
+ }
286
+ switch (matchResult) {
287
+ case 0: {
288
+ ResizeArray_iter((c) => {
289
+ if (c.AsData.FilePath != null) {
290
+ const newFilePath = dataNameFunction(c.AsData);
291
+ c.AsData.FilePath = newFilePath;
292
+ }
293
+ }, col_2.Cells);
294
+ break;
295
+ }
296
+ }
297
+ };
298
+ const updateTable = (dataNameFunction_1, t) => {
299
+ updateColumnOption(dataNameFunction_1, t.TryGetInputColumn());
300
+ updateColumnOption(dataNameFunction_1, t.TryGetOutputColumn());
301
+ };
302
+ const updateDataMap = (dataNameFunction_2, dm) => {
303
+ iterate((c_1) => {
304
+ if (c_1.FilePath != null) {
305
+ const newFilePath_1 = dataNameFunction_2(c_1);
306
+ c_1.FilePath = newFilePath_1;
307
+ }
308
+ }, DataMap__get_DataContexts(dm));
309
+ };
310
+ iterate((s) => {
311
+ const f_1 = (d) => d.GetAbsolutePathForStudy(s.Identifier, checkExistenceFromRoot);
312
+ const source_1 = s.Tables;
313
+ iterate(curry2(updateTable)(f_1), source_1);
314
+ if (s.DataMap != null) {
315
+ updateDataMap(f_1, value(s.DataMap));
316
+ }
317
+ }, this$.Studies);
318
+ iterate((a_1) => {
319
+ const f_2 = (d_1) => d_1.GetAbsolutePathForAssay(a_1.Identifier, checkExistenceFromRoot);
320
+ const source_3 = a_1.Tables;
321
+ iterate(curry2(updateTable)(f_2), source_3);
322
+ if (a_1.DataMap != null) {
323
+ updateDataMap(f_2, value(a_1.DataMap));
324
+ }
325
+ }, this$.Assays);
326
+ }
327
+ static fromFilePaths(filePaths) {
328
+ const fs = FileSystem.fromFilePaths(filePaths);
329
+ return new ARC(createMissingIdentifier(), void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, fs);
330
+ }
331
+ SetFilePaths(filePaths) {
332
+ const this$ = this;
333
+ const tree = FileSystemTree.fromFilePaths(filePaths);
334
+ this$._fs = new FileSystem(tree, this$._fs.History);
335
+ }
336
+ GetReadContracts() {
337
+ const this$ = this;
338
+ return choose(tryISAReadContractFromPath, this$._fs.Tree.ToFilePaths());
339
+ }
340
+ SetISAFromContracts(contracts) {
341
+ const this$ = this;
342
+ const investigation = ARCAux_getArcInvestigationFromContracts(contracts);
343
+ setInvestigationIdentifier(investigation.Identifier, this$);
344
+ this$.Title = investigation.Title;
345
+ this$.Description = investigation.Description;
346
+ this$.SubmissionDate = investigation.SubmissionDate;
347
+ this$.PublicReleaseDate = investigation.PublicReleaseDate;
348
+ this$.OntologySourceReferences = investigation.OntologySourceReferences;
349
+ this$.Publications = investigation.Publications;
350
+ this$.Contacts = investigation.Contacts;
351
+ this$.Comments = investigation.Comments;
352
+ this$.Remarks = investigation.Remarks;
353
+ this$.RegisteredStudyIdentifiers = investigation.RegisteredStudyIdentifiers;
354
+ const studies = map((tuple) => tuple[0], ARCAux_getArcStudiesFromContracts(contracts));
355
+ const assays = ARCAux_getArcAssaysFromContracts(contracts);
356
+ const workflows = ARCAux_getArcWorkflowsFromContracts(contracts);
357
+ const runs = ARCAux_getArcRunsFromContracts(contracts);
358
+ const array_2 = this$.AssayIdentifiers;
359
+ array_2.forEach((ai) => {
360
+ if (!assays.some((a) => a.Identifier === ai)) {
361
+ this$.DeleteAssay(ai);
362
+ }
363
+ });
364
+ const array_4 = this$.StudyIdentifiers;
365
+ array_4.forEach((si) => {
366
+ if (!studies.some((s) => s.Identifier === si)) {
367
+ this$.DeleteStudy(si);
368
+ }
369
+ });
370
+ studies.forEach((study) => {
371
+ const registeredStudyOpt = tryFind((s_1) => s_1.Identifier === study.Identifier, this$.Studies);
372
+ if (registeredStudyOpt == null) {
373
+ this$.AddStudy(study);
374
+ } else {
375
+ const registeredStudy = value(registeredStudyOpt);
376
+ registeredStudy.UpdateReferenceByStudyFile(study, true);
377
+ }
378
+ const datamap = ARCAux_getStudyDataMapFromContracts(study.Identifier, contracts);
379
+ if (study.DataMap == null) {
380
+ study.DataMap = datamap;
381
+ }
382
+ study.StaticHash = study.GetLightHashCode() | 0;
383
+ });
384
+ assays.forEach((assay) => {
385
+ const registeredAssayOpt = tryFind((a_1) => a_1.Identifier === assay.Identifier, this$.Assays);
386
+ if (registeredAssayOpt == null) {
387
+ this$.AddAssay(assay);
388
+ } else {
389
+ const registeredAssay = value(registeredAssayOpt);
390
+ registeredAssay.UpdateReferenceByAssayFile(assay, true);
391
+ }
392
+ const assay_1 = find((a_2) => a_2.Identifier === assay.Identifier, this$.Assays);
393
+ let updatedTables;
394
+ const array_6 = assay_1.StudiesRegisteredIn;
395
+ updatedTables = fold((tables, study_1) => ArcTables.updateReferenceTablesBySheets(new ArcTables(study_1.Tables), tables, false), new ArcTables(assay_1.Tables), array_6);
396
+ const datamap_1 = ARCAux_getAssayDataMapFromContracts(assay_1.Identifier, contracts);
397
+ if (assay_1.DataMap == null) {
398
+ assay_1.DataMap = datamap_1;
399
+ }
400
+ assay_1.Tables = updatedTables.Tables;
401
+ });
402
+ workflows.forEach((workflow) => {
403
+ const datamap_2 = ARCAux_getWorkflowDataMapFromContracts(ArcWorkflow__get_Identifier(workflow), contracts);
404
+ if (ArcWorkflow__get_DataMap(workflow) == null) {
405
+ ArcWorkflow__set_DataMap_51F1E59E(workflow, datamap_2);
406
+ }
407
+ this$.AddWorkflow(workflow);
408
+ ArcWorkflow__set_StaticHash_Z524259A4(workflow, ArcWorkflow__GetLightHashCode(workflow));
409
+ });
410
+ runs.forEach((run) => {
411
+ const datamap_3 = ARCAux_getRunDataMapFromContracts(run.Identifier, contracts);
412
+ if (run.DataMap == null) {
413
+ run.DataMap = datamap_3;
414
+ }
415
+ this$.AddRun(run);
416
+ run.StaticHash = run.GetLightHashCode() | 0;
417
+ });
418
+ iterate((a_3) => {
419
+ a_3.StaticHash = a_3.GetLightHashCode() | 0;
420
+ }, this$.Assays);
421
+ iterate((s_2) => {
422
+ s_2.StaticHash = s_2.GetLightHashCode() | 0;
423
+ }, this$.Studies);
424
+ this$.StaticHash = this$.GetLightHashCode() | 0;
425
+ }
426
+ UpdateFileSystem() {
427
+ const this$ = this;
428
+ const newFS = ARCAux_updateFSByISA(this$, this$._fs);
429
+ this$._fs = newFS;
430
+ }
431
+ GetWriteContracts(skipUpdateFS) {
432
+ const this$ = this;
433
+ if (!defaultArg(skipUpdateFS, false)) {
434
+ this$.UpdateFileSystem();
435
+ }
436
+ const workbooks = /* @__PURE__ */ new Map([]);
437
+ addToDict(workbooks, "isa.investigation.xlsx", ["ISA_Investigation", ARCtrl_ArcInvestigation__ArcInvestigation_toFsWorkbook_Static_Z720BD3FF(this$)]);
438
+ this$.StaticHash = this$.GetLightHashCode() | 0;
439
+ iterate((s) => {
440
+ s.StaticHash = s.GetLightHashCode() | 0;
441
+ addToDict(workbooks, Study_fileNameFromIdentifier(s.Identifier), ["ISA_Study", ARCtrl_ArcStudy__ArcStudy_toFsWorkbook_Static_Z4CEFA522(s)]);
442
+ if (s.DataMap != null) {
443
+ const dm = value(s.DataMap);
444
+ DataMap__set_StaticHash_Z524259A4(dm, safeHash(dm));
445
+ addToDict(workbooks, Study_datamapFileNameFromIdentifier(s.Identifier), ["ISA_Datamap", toFsWorkbook(dm)]);
446
+ }
447
+ }, this$.Studies);
448
+ iterate((a) => {
449
+ a.StaticHash = a.GetLightHashCode() | 0;
450
+ addToDict(workbooks, Assay_fileNameFromIdentifier(a.Identifier), ["ISA_Assay", ARCtrl_ArcAssay__ArcAssay_toFsWorkbook_Static_Z2508BE4F(a)]);
451
+ if (a.DataMap != null) {
452
+ const dm_1 = value(a.DataMap);
453
+ DataMap__set_StaticHash_Z524259A4(dm_1, safeHash(dm_1));
454
+ addToDict(workbooks, Assay_datamapFileNameFromIdentifier(a.Identifier), ["ISA_Datamap", toFsWorkbook(dm_1)]);
455
+ }
456
+ }, this$.Assays);
457
+ iterate((w) => {
458
+ ArcWorkflow__set_StaticHash_Z524259A4(w, ArcWorkflow__GetLightHashCode(w));
459
+ addToDict(workbooks, Workflow_fileNameFromIdentifier(ArcWorkflow__get_Identifier(w)), ["ISA_Workflow", ARCtrl_ArcWorkflow__ArcWorkflow_toFsWorkbook_Static_Z1C75CB0E(w)]);
460
+ if (ArcWorkflow__get_DataMap(w) != null) {
461
+ const dm_2 = value(ArcWorkflow__get_DataMap(w));
462
+ DataMap__set_StaticHash_Z524259A4(dm_2, safeHash(dm_2));
463
+ addToDict(workbooks, Workflow_datamapFileNameFromIdentifier(ArcWorkflow__get_Identifier(w)), ["ISA_Datamap", toFsWorkbook(dm_2)]);
464
+ }
465
+ }, this$.Workflows);
466
+ iterate((r) => {
467
+ r.StaticHash = r.GetLightHashCode() | 0;
468
+ addToDict(workbooks, Run_fileNameFromIdentifier(r.Identifier), ["ISA_Run", ARCtrl_ArcRun__ArcRun_toFsWorkbook_Static_Z3EFAF6F8(r)]);
469
+ if (r.DataMap != null) {
470
+ const dm_3 = value(r.DataMap);
471
+ DataMap__set_StaticHash_Z524259A4(dm_3, safeHash(dm_3));
472
+ addToDict(workbooks, Run_datamapFileNameFromIdentifier(r.Identifier), ["ISA_Datamap", toFsWorkbook(dm_3)]);
473
+ }
474
+ }, this$.Runs);
475
+ return map((fp) => {
476
+ const matchValue = Dictionary_tryGet(fp, workbooks);
477
+ if (matchValue == null) {
478
+ return Contract.createCreate(fp, "PlainText");
479
+ } else {
480
+ const wb = value(matchValue)[1];
481
+ const dto = value(matchValue)[0];
482
+ return Contract.createCreate(fp, dto, wb);
483
+ }
484
+ }, this$._fs.Tree.ToFilePaths(true));
485
+ }
486
+ GetUpdateContracts(skipUpdateFS) {
487
+ const this$ = this;
488
+ if (this$.StaticHash === 0) {
489
+ this$.StaticHash = this$.GetLightHashCode() | 0;
490
+ return this$.GetWriteContracts(unwrap(skipUpdateFS));
491
+ } else {
492
+ return toArray(delay(() => {
493
+ const hash = this$.GetLightHashCode() | 0;
494
+ return append$1(this$.StaticHash !== hash ? singleton(ARCtrl_ArcInvestigation__ArcInvestigation_ToUpdateContract(this$)) : empty(), delay(() => {
495
+ this$.StaticHash = hash | 0;
496
+ return append$1(collect((s) => {
497
+ const hash_1 = s.GetLightHashCode() | 0;
498
+ return append$1(s.StaticHash === 0 ? ARCtrl_ArcStudy__ArcStudy_ToCreateContract_6FCE9E49(s, true) : s.StaticHash !== hash_1 ? singleton(ARCtrl_ArcStudy__ArcStudy_ToUpdateContract(s)) : empty(), delay(() => {
499
+ let dm_1;
500
+ s.StaticHash = hash_1 | 0;
501
+ const matchValue = s.DataMap;
502
+ let matchResult, dm_2, dm_3;
503
+ if (matchValue != null) {
504
+ if (DataMap__get_StaticHash(value(matchValue)) === 0) {
505
+ matchResult = 0;
506
+ dm_2 = value(matchValue);
507
+ } else if (dm_1 = value(matchValue), DataMap__get_StaticHash(dm_1) !== safeHash(dm_1)) {
508
+ matchResult = 1;
509
+ dm_3 = value(matchValue);
510
+ } else {
511
+ matchResult = 2;
512
+ }
513
+ } else {
514
+ matchResult = 2;
515
+ }
516
+ switch (matchResult) {
517
+ case 0:
518
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToCreateContractForStudy_Z721C83C5(dm_2, s.Identifier)), delay(() => {
519
+ DataMap__set_StaticHash_Z524259A4(dm_2, safeHash(dm_2));
520
+ return empty();
521
+ }));
522
+ case 1:
523
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToUpdateContractForStudy_Z721C83C5(dm_3, s.Identifier)), delay(() => {
524
+ DataMap__set_StaticHash_Z524259A4(dm_3, safeHash(dm_3));
525
+ return empty();
526
+ }));
527
+ default: {
528
+ return empty();
529
+ }
530
+ }
531
+ }));
532
+ }, this$.Studies), delay(() => append$1(collect((a) => {
533
+ const hash_2 = a.GetLightHashCode() | 0;
534
+ return append$1(a.StaticHash === 0 ? ARCtrl_ArcAssay__ArcAssay_ToCreateContract_6FCE9E49(a, true) : a.StaticHash !== hash_2 ? singleton(ARCtrl_ArcAssay__ArcAssay_ToUpdateContract(a)) : empty(), delay(() => {
535
+ let dm_5;
536
+ a.StaticHash = hash_2 | 0;
537
+ const matchValue_1 = a.DataMap;
538
+ let matchResult_1, dm_6, dm_7;
539
+ if (matchValue_1 != null) {
540
+ if (DataMap__get_StaticHash(value(matchValue_1)) === 0) {
541
+ matchResult_1 = 0;
542
+ dm_6 = value(matchValue_1);
543
+ } else if (dm_5 = value(matchValue_1), DataMap__get_StaticHash(dm_5) !== safeHash(dm_5)) {
544
+ matchResult_1 = 1;
545
+ dm_7 = value(matchValue_1);
546
+ } else {
547
+ matchResult_1 = 2;
548
+ }
549
+ } else {
550
+ matchResult_1 = 2;
551
+ }
552
+ switch (matchResult_1) {
553
+ case 0:
554
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToCreateContractForAssay_Z721C83C5(dm_6, a.Identifier)), delay(() => {
555
+ DataMap__set_StaticHash_Z524259A4(dm_6, safeHash(dm_6));
556
+ return empty();
557
+ }));
558
+ case 1:
559
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToUpdateContractForAssay_Z721C83C5(dm_7, a.Identifier)), delay(() => {
560
+ DataMap__set_StaticHash_Z524259A4(dm_7, safeHash(dm_7));
561
+ return empty();
562
+ }));
563
+ default: {
564
+ return empty();
565
+ }
566
+ }
567
+ }));
568
+ }, this$.Assays), delay(() => append$1(collect((w) => {
569
+ const hash_3 = ArcWorkflow__GetLightHashCode(w) | 0;
570
+ return append$1(ArcWorkflow__get_StaticHash(w) === 0 ? ARCtrl_ArcWorkflow__ArcWorkflow_ToCreateContract_6FCE9E49(w, true) : ArcWorkflow__get_StaticHash(w) !== hash_3 ? singleton(ARCtrl_ArcWorkflow__ArcWorkflow_ToUpdateContract(w)) : empty(), delay(() => {
571
+ let dm_9;
572
+ ArcWorkflow__set_StaticHash_Z524259A4(w, hash_3);
573
+ const matchValue_2 = ArcWorkflow__get_DataMap(w);
574
+ let matchResult_2, dm_10, dm_11;
575
+ if (matchValue_2 != null) {
576
+ if (DataMap__get_StaticHash(value(matchValue_2)) === 0) {
577
+ matchResult_2 = 0;
578
+ dm_10 = value(matchValue_2);
579
+ } else if (dm_9 = value(matchValue_2), DataMap__get_StaticHash(dm_9) !== safeHash(dm_9)) {
580
+ matchResult_2 = 1;
581
+ dm_11 = value(matchValue_2);
582
+ } else {
583
+ matchResult_2 = 2;
584
+ }
585
+ } else {
586
+ matchResult_2 = 2;
587
+ }
588
+ switch (matchResult_2) {
589
+ case 0:
590
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToCreateContractForWorkflow_Z721C83C5(dm_10, ArcWorkflow__get_Identifier(w))), delay(() => {
591
+ DataMap__set_StaticHash_Z524259A4(dm_10, safeHash(dm_10));
592
+ return empty();
593
+ }));
594
+ case 1:
595
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToUpdateContractForWorkflow_Z721C83C5(dm_11, ArcWorkflow__get_Identifier(w))), delay(() => {
596
+ DataMap__set_StaticHash_Z524259A4(dm_11, safeHash(dm_11));
597
+ return empty();
598
+ }));
599
+ default: {
600
+ return empty();
601
+ }
602
+ }
603
+ }));
604
+ }, this$.Workflows), delay(() => collect((r) => {
605
+ const hash_4 = r.GetLightHashCode() | 0;
606
+ return append$1(r.StaticHash === 0 ? ARCtrl_ArcRun__ArcRun_ToCreateContract_6FCE9E49(r, true) : r.StaticHash !== hash_4 ? singleton(ARCtrl_ArcRun__ArcRun_ToUpdateContract(r)) : empty(), delay(() => {
607
+ let dm_13;
608
+ r.StaticHash = hash_4 | 0;
609
+ const matchValue_3 = r.DataMap;
610
+ let matchResult_3, dm_14, dm_15;
611
+ if (matchValue_3 != null) {
612
+ if (DataMap__get_StaticHash(value(matchValue_3)) === 0) {
613
+ matchResult_3 = 0;
614
+ dm_14 = value(matchValue_3);
615
+ } else if (dm_13 = value(matchValue_3), DataMap__get_StaticHash(dm_13) !== safeHash(dm_13)) {
616
+ matchResult_3 = 1;
617
+ dm_15 = value(matchValue_3);
618
+ } else {
619
+ matchResult_3 = 2;
620
+ }
621
+ } else {
622
+ matchResult_3 = 2;
623
+ }
624
+ switch (matchResult_3) {
625
+ case 0:
626
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToCreateContractForRun_Z721C83C5(dm_14, r.Identifier)), delay(() => {
627
+ DataMap__set_StaticHash_Z524259A4(dm_14, safeHash(dm_14));
628
+ return empty();
629
+ }));
630
+ case 1:
631
+ return append$1(singleton(ARCtrl_DataMap__DataMap_ToUpdateContractForRun_Z721C83C5(dm_15, r.Identifier)), delay(() => {
632
+ DataMap__set_StaticHash_Z524259A4(dm_15, safeHash(dm_15));
633
+ return empty();
634
+ }));
635
+ default: {
636
+ return empty();
637
+ }
638
+ }
639
+ }));
640
+ }, this$.Runs)))))));
641
+ }));
642
+ }));
643
+ }
644
+ }
645
+ GetGitInitContracts(branch, repositoryAddress, defaultGitignore, defaultGitattributes) {
646
+ const defaultGitignore_1 = defaultArg(defaultGitignore, false);
647
+ const defaultGitattributes_1 = defaultArg(defaultGitattributes, false);
648
+ return toArray(delay(() => append$1(singleton(Init_createInitContract_6DFDD678(unwrap(branch))), delay(() => append$1(defaultGitignore_1 ? singleton(gitignoreContract) : empty(), delay(() => append$1(defaultGitattributes_1 ? singleton(gitattributesContract) : empty(), delay(() => repositoryAddress != null ? singleton(Init_createAddRemoteContract_Z721C83C5(value(repositoryAddress))) : empty()))))))));
649
+ }
650
+ static getCloneContract(remoteUrl, merge, branch, token, nolfs) {
651
+ return Clone_createCloneContract_5000466F(remoteUrl, unwrap(merge), unwrap(branch), unwrap(token), unwrap(nolfs));
652
+ }
653
+ Copy() {
654
+ const this$ = this;
655
+ const nextAssays = [];
656
+ const nextStudies = [];
657
+ const nextWorkflows = [];
658
+ const nextRuns = [];
659
+ let enumerator = getEnumerator(this$.Assays);
660
+ try {
661
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
662
+ const assay = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
663
+ const copy = assay.Copy();
664
+ void nextAssays.push(copy);
665
+ }
666
+ } finally {
667
+ disposeSafe(enumerator);
668
+ }
669
+ let enumerator_1 = getEnumerator(this$.Studies);
670
+ try {
671
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
672
+ const study = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
673
+ const copy_1 = study.Copy();
674
+ void nextStudies.push(copy_1);
675
+ }
676
+ } finally {
677
+ disposeSafe(enumerator_1);
678
+ }
679
+ let enumerator_2 = getEnumerator(this$.Workflows);
680
+ try {
681
+ while (enumerator_2["System.Collections.IEnumerator.MoveNext"]()) {
682
+ const workflow = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
683
+ void nextWorkflows.push(ArcWorkflow__Copy_6FCE9E49(workflow));
684
+ }
685
+ } finally {
686
+ disposeSafe(enumerator_2);
687
+ }
688
+ let enumerator_3 = getEnumerator(this$.Runs);
689
+ try {
690
+ while (enumerator_3["System.Collections.IEnumerator.MoveNext"]()) {
691
+ const run = enumerator_3["System.Collections.Generic.IEnumerator`1.get_Current"]();
692
+ const copy_3 = run.Copy();
693
+ void nextRuns.push(copy_3);
694
+ }
695
+ } finally {
696
+ disposeSafe(enumerator_3);
697
+ }
698
+ const nextComments = ResizeArray_map((c) => c.Copy(), this$.Comments);
699
+ const nextRemarks = ResizeArray_map((c_1) => c_1.Copy(), this$.Remarks);
700
+ const nextContacts = ResizeArray_map((c_2) => c_2.Copy(), this$.Contacts);
701
+ const nextPublications = ResizeArray_map((c_3) => c_3.Copy(), this$.Publications);
702
+ const nextOntologySourceReferences = ResizeArray_map((c_4) => c_4.Copy(), this$.OntologySourceReferences);
703
+ const nextStudyIdentifiers = Array.from(this$.RegisteredStudyIdentifiers);
704
+ const fsCopy = this$._fs.Copy();
705
+ return new ARC(this$.Identifier, unwrap(this$.Title), unwrap(this$.Description), unwrap(this$.SubmissionDate), unwrap(this$.PublicReleaseDate), nextOntologySourceReferences, nextPublications, nextContacts, nextAssays, nextStudies, nextWorkflows, nextRuns, nextStudyIdentifiers, nextComments, nextRemarks, this$._cwl, fsCopy);
706
+ }
707
+ GetRegisteredPayload(IgnoreHidden) {
708
+ let tree, paths, array_3;
709
+ const this$ = this;
710
+ const copy = this$.Copy();
711
+ const registeredStudies = copy.Studies.slice();
712
+ const registeredAssays = concat(map((s) => s.RegisteredAssays.slice(), registeredStudies));
713
+ const includeFiles = unionMany([ofSeq(["isa.investigation.xlsx", "README.md"], {
714
+ Compare: comparePrimitives
715
+ }), unionMany(map((s_1) => {
716
+ const studyFoldername = `${"studies"}/${s_1.Identifier}`;
717
+ return ofSeq(toList(delay(() => append$1(singleton(`${studyFoldername}/${"isa.study.xlsx"}`), delay(() => append$1(singleton(`${studyFoldername}/${"README.md"}`), delay(() => collect((table) => collect((kv) => {
718
+ const textValue = kv[1].ToFreeTextCell().AsFreeText;
719
+ return append$1(singleton(textValue), delay(() => append$1(singleton(`${studyFoldername}/${"resources"}/${textValue}`), delay(() => singleton(`${studyFoldername}/${"protocols"}/${textValue}`)))));
720
+ }, table.Values), s_1.Tables))))))), {
721
+ Compare: comparePrimitives
722
+ });
723
+ }, registeredStudies), {
724
+ Compare: comparePrimitives
725
+ }), unionMany(map((a) => {
726
+ const assayFoldername = `${"assays"}/${a.Identifier}`;
727
+ return ofSeq(toList(delay(() => append$1(singleton(`${assayFoldername}/${"isa.assay.xlsx"}`), delay(() => append$1(singleton(`${assayFoldername}/${"README.md"}`), delay(() => collect((table_1) => collect((kv_1) => {
728
+ const textValue_1 = kv_1[1].ToFreeTextCell().AsFreeText;
729
+ return append$1(singleton(textValue_1), delay(() => append$1(singleton(`${assayFoldername}/${"dataset"}/${textValue_1}`), delay(() => singleton(`${assayFoldername}/${"protocols"}/${textValue_1}`)))));
730
+ }, table_1.Values), a.Tables))))))), {
731
+ Compare: comparePrimitives
732
+ });
733
+ }, registeredAssays), {
734
+ Compare: comparePrimitives
735
+ })], {
736
+ Compare: comparePrimitives
737
+ });
738
+ const ignoreHidden = defaultArg(IgnoreHidden, true);
739
+ const fsCopy = this$._fs.Copy();
740
+ return defaultArg(bind((tree_1) => {
741
+ if (ignoreHidden) {
742
+ return FileSystemTree.filterFolders((n_1) => !n_1.startsWith("."))(tree_1);
743
+ } else {
744
+ return tree_1;
745
+ }
746
+ }, (tree = (paths = (array_3 = FileSystemTree.toFilePaths()(fsCopy.Tree), array_3.filter((p) => {
747
+ if (p.startsWith("workflows") ? true : p.startsWith("runs")) {
748
+ return true;
749
+ } else {
750
+ return FSharpSet__Contains(includeFiles, p);
751
+ }
752
+ })), FileSystemTree.fromFilePaths(paths)), ignoreHidden ? FileSystemTree.filterFiles((n) => !n.startsWith("."))(tree) : tree)), FileSystemTree.fromFilePaths([]));
753
+ }
754
+ GetAdditionalPayload(IgnoreHidden) {
755
+ let tree, paths, array;
756
+ const this$ = this;
757
+ const ignoreHidden = defaultArg(IgnoreHidden, true);
758
+ const registeredPayload = ofSeq(FileSystemTree.toFilePaths()(this$.GetRegisteredPayload()), {
759
+ Compare: comparePrimitives
760
+ });
761
+ return defaultArg(bind((tree_1) => {
762
+ if (ignoreHidden) {
763
+ return FileSystemTree.filterFolders((n_1) => !n_1.startsWith("."))(tree_1);
764
+ } else {
765
+ return tree_1;
766
+ }
767
+ }, (tree = (paths = (array = FileSystemTree.toFilePaths()(this$._fs.Copy().Tree), array.filter((p) => !FSharpSet__Contains(registeredPayload, p))), FileSystemTree.fromFilePaths(paths)), ignoreHidden ? FileSystemTree.filterFiles((n) => !n.startsWith("."))(tree) : tree)), FileSystemTree.fromFilePaths([]));
768
+ }
769
+ static get DefaultContracts() {
770
+ return ofSeq$1([[".gitignore", gitignoreContract], [".gitattributes", gitattributesContract]], {
771
+ Compare: comparePrimitives
772
+ });
773
+ }
774
+ static fromDeprecatedROCrateJsonString(s) {
775
+ let arg;
776
+ try {
777
+ const s_1 = replace(s, "bio:additionalProperty", "sdo:additionalProperty");
778
+ let isa;
779
+ const matchValue = fromString(ROCrate_get_decoderDeprecated(), s_1);
780
+ if (matchValue.tag === /* Error */
781
+ 1) {
782
+ throw new Error((arg = matchValue.fields[0], toText(printf("Error decoding string: %O"))(arg)));
783
+ } else {
784
+ isa = matchValue.fields[0];
785
+ }
786
+ return ARC.fromArcInvestigation(isa);
787
+ } catch (ex) {
788
+ const arg_1 = ex.message;
789
+ return toFail(printf("Could not parse deprecated ARC-RO-Crate metadata: \n%s"))(arg_1);
790
+ }
791
+ }
792
+ static fromROCrateJsonString(s) {
793
+ let arg;
794
+ try {
795
+ let patternInput;
796
+ const matchValue = fromString(ROCrate_get_decoder(), s);
797
+ if (matchValue.tag === /* Error */
798
+ 1) {
799
+ throw new Error((arg = matchValue.fields[0], toText(printf("Error decoding string: %O"))(arg)));
800
+ } else {
801
+ patternInput = matchValue.fields[0];
802
+ }
803
+ let fileSystem;
804
+ const paths = Array.from(patternInput[1]);
805
+ fileSystem = FileSystem.fromFilePaths(paths);
806
+ return ARC.fromArcInvestigation(patternInput[0], void 0, fileSystem);
807
+ } catch (ex) {
808
+ const arg_1 = ex.message;
809
+ return toFail(printf("Could not parse ARC-RO-Crate metadata: \n%s"))(arg_1);
810
+ }
811
+ }
812
+ ToROCrateJsonString(spaces) {
813
+ const this$ = this;
814
+ this$.MakeDataFilesAbsolute();
815
+ const value = ROCrate_encoder_B568605(this$, void 0, this$._fs);
816
+ return toString(defaultSpaces(spaces), value);
817
+ }
818
+ static toROCrateJsonString(spaces) {
819
+ return (obj) => obj.ToROCrateJsonString(unwrap(spaces));
820
+ }
821
+ GetValidationPackagesConfigWriteContract(vpc) {
822
+ const this$ = this;
823
+ const paths = this$.FileSystem.Tree.ToFilePaths();
824
+ if (!contains$1(ValidationPackagesConfigHelper_ConfigFilePath, paths, {
825
+ Equals: (x, y) => x === y,
826
+ GetHashCode: stringHash
827
+ })) {
828
+ const filePaths = append([ValidationPackagesConfigHelper_ConfigFilePath], paths);
829
+ this$.SetFilePaths(filePaths);
830
+ }
831
+ return ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toCreateContract_Static_724DAE55(vpc);
832
+ }
833
+ GetValidationPackagesConfigDeleteContract(vpc) {
834
+ const this$ = this;
835
+ const paths = this$.FileSystem.Tree.ToFilePaths();
836
+ if (contains$1(ValidationPackagesConfigHelper_ConfigFilePath, paths, {
837
+ Equals: (x, y) => x === y,
838
+ GetHashCode: stringHash
839
+ })) {
840
+ const filePaths = paths.filter((p) => !(p === ValidationPackagesConfigHelper_ConfigFilePath));
841
+ this$.SetFilePaths(filePaths);
842
+ }
843
+ return ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_toDeleteContract_Static_724DAE55();
844
+ }
845
+ GetValidationPackagesConfigReadContract() {
846
+ return ValidationPackagesConfigHelper_ReadContract;
847
+ }
848
+ GetValidationPackagesConfigFromReadContract(contract) {
849
+ return ARCtrl_ValidationPackages_ValidationPackagesConfig__ValidationPackagesConfig_tryFromReadContract_Static_7570923F(contract);
850
+ }
851
+ ToFilePaths(removeRoot, skipUpdateFS) {
852
+ const this$ = this;
853
+ if (!defaultArg(skipUpdateFS, false)) {
854
+ this$.UpdateFileSystem();
855
+ }
856
+ return this$.FileSystem.Tree.ToFilePaths(unwrap(removeRoot));
857
+ }
858
+ }
859
+ function ARCAux_getArcAssaysFromContracts(contracts) {
860
+ return choose(ARCtrl_ArcAssay__ArcAssay_tryFromReadContract_Static_7570923F, contracts);
861
+ }
862
+ function ARCAux_getArcStudiesFromContracts(contracts) {
863
+ return choose(ARCtrl_ArcStudy__ArcStudy_tryFromReadContract_Static_7570923F, contracts);
864
+ }
865
+ function ARCAux_getArcWorkflowsFromContracts(contracts) {
866
+ return choose(ARCtrl_ArcWorkflow__ArcWorkflow_tryFromReadContract_Static_7570923F, contracts);
867
+ }
868
+ function ARCAux_getArcRunsFromContracts(contracts) {
869
+ return choose(ARCtrl_ArcRun__ArcRun_tryFromReadContract_Static_7570923F, contracts);
870
+ }
871
+ function ARCAux_getAssayDataMapFromContracts(assayIdentifier, contracts) {
872
+ return tryPick((c) => ARCtrl_DataMap__DataMap_tryFromReadContractForAssay_Static(assayIdentifier, c), contracts);
873
+ }
874
+ function ARCAux_getStudyDataMapFromContracts(studyIdentifier, contracts) {
875
+ return tryPick((c) => ARCtrl_DataMap__DataMap_tryFromReadContractForStudy_Static(studyIdentifier, c), contracts);
876
+ }
877
+ function ARCAux_getWorkflowDataMapFromContracts(workflowIdentifier, contracts) {
878
+ return tryPick((c) => ARCtrl_DataMap__DataMap_tryFromReadContractForWorkflow_Static(workflowIdentifier, c), contracts);
879
+ }
880
+ function ARCAux_getRunDataMapFromContracts(runIdentifier, contracts) {
881
+ return tryPick((c) => ARCtrl_DataMap__DataMap_tryFromReadContractForRun_Static(runIdentifier, c), contracts);
882
+ }
883
+ function ARCAux_getArcInvestigationFromContracts(contracts) {
884
+ const matchValue = choose(ARCtrl_ArcInvestigation__ArcInvestigation_tryFromReadContract_Static_7570923F, contracts);
885
+ if (!equalsWith(equals, matchValue, defaultOf()) && matchValue.length === 1) {
886
+ return item(0, matchValue);
887
+ } else {
888
+ const arg = matchValue.length | 0;
889
+ return toFail(printf("Could not find investigation in contracts. Expected exactly one investigation, but found %d."))(arg);
890
+ }
891
+ }
892
+ function ARCAux_updateFSByISA(isa, fs) {
893
+ let assaysFolder;
894
+ const assays = map((a) => FileSystemTree.createAssayFolder(a.Identifier, a.DataMap != null), toArray(isa.Assays));
895
+ assaysFolder = FileSystemTree.createAssaysFolder(assays);
896
+ let studiesFolder;
897
+ const studies = map((s) => FileSystemTree.createStudyFolder(s.Identifier, s.DataMap != null), toArray(isa.Studies));
898
+ studiesFolder = FileSystemTree.createStudiesFolder(studies);
899
+ let workflowsFolder;
900
+ const workflows = map((w) => FileSystemTree.createWorkflowFolder(ArcWorkflow__get_Identifier(w), ArcWorkflow__get_DataMap(w) != null), toArray(isa.Workflows));
901
+ workflowsFolder = FileSystemTree.createWorkflowsFolder(workflows);
902
+ let runsFolder;
903
+ const runs = map((r) => FileSystemTree.createRunFolder(r.Identifier, r.DataMap != null), toArray(isa.Runs));
904
+ runsFolder = FileSystemTree.createRunsFolder(runs);
905
+ const investigation = FileSystemTree.createInvestigationFile();
906
+ let tree_1;
907
+ const tree = FileSystemTree.createRootFolder([investigation, assaysFolder, studiesFolder, workflowsFolder, runsFolder]);
908
+ tree_1 = FileSystem.create({
909
+ tree
910
+ });
911
+ return fs.Union(tree_1);
912
+ }
913
+
914
+ export { ARC, ARCAux_getArcAssaysFromContracts, ARCAux_getArcInvestigationFromContracts, ARCAux_getArcRunsFromContracts, ARCAux_getArcStudiesFromContracts, ARCAux_getArcWorkflowsFromContracts, ARCAux_getAssayDataMapFromContracts, ARCAux_getRunDataMapFromContracts, ARCAux_getStudyDataMapFromContracts, ARCAux_getWorkflowDataMapFromContracts, ARCAux_updateFSByISA };