From 2630dc83874a95892e3897cb7952173ff4efd834 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Thu, 9 Dec 2021 14:33:45 +0100 Subject: [PATCH 01/19] Add generated code --- .gitignore | 106 ++++ LICENSE copy | 201 ++++++++ package.json | 34 ++ src/arraySchema.ts | 140 ++++++ src/commandInputArraySchema.ts | 255 ++++++++++ src/commandInputEnumSchema.ts | 259 ++++++++++ src/commandInputParameter.ts | 466 ++++++++++++++++++ src/commandInputRecordField.ts | 434 +++++++++++++++++ src/commandInputRecordSchema.ts | 257 ++++++++++ src/commandInputSchema.ts | 9 + src/commandLineBindable.ts | 119 +++++ src/commandLineBinding.ts | 343 +++++++++++++ src/commandLineTool.ts | 650 +++++++++++++++++++++++++ src/commandOutputArraySchema.ts | 230 +++++++++ src/commandOutputBinding.ts | 278 +++++++++++ src/commandOutputEnumSchema.ts | 234 +++++++++ src/commandOutputParameter.ts | 365 ++++++++++++++ src/commandOutputRecordField.ts | 366 ++++++++++++++ src/commandOutputRecordSchema.ts | 232 +++++++++ src/directory.ts | 321 ++++++++++++ src/dirent.ts | 242 +++++++++ src/dockerRequirement.ts | 333 +++++++++++++ src/documented.ts | 9 + src/enumSchema.ts | 147 ++++++ src/envVarRequirement.ts | 148 ++++++ src/environmentDef.ts | 145 ++++++ src/expressionTool.ts | 434 +++++++++++++++++ src/expressionToolOutputParameter.ts | 338 +++++++++++++ src/fieldBase.ts | 9 + src/file.ts | 586 ++++++++++++++++++++++ src/iOSchema.ts | 9 + src/identified.ts | 9 + src/index.ts | 82 ++++ src/initialWorkDirRequirement.ts | 171 +++++++ src/inlineJavascriptRequirement.ts | 154 ++++++ src/inplaceUpdateRequirement.ts | 172 +++++++ src/inputArraySchema.ts | 230 +++++++++ src/inputBinding.ts | 122 +++++ src/inputEnumSchema.ts | 234 +++++++++ src/inputFormat.ts | 9 + src/inputParameter.ts | 9 + src/inputRecordField.ts | 409 ++++++++++++++++ src/inputRecordSchema.ts | 232 +++++++++ src/inputSchema.ts | 9 + src/labeled.ts | 9 + src/loadContents.ts | 9 + src/loadListingRequirement.ts | 146 ++++++ src/multipleInputFeatureRequirement.ts | 125 +++++ src/networkAccess.ts | 157 ++++++ src/operation.ts | 408 ++++++++++++++++ src/operationInputParameter.ts | 440 +++++++++++++++++ src/operationOutputParameter.ts | 341 +++++++++++++ src/outputArraySchema.ts | 230 +++++++++ src/outputEnumSchema.ts | 234 +++++++++ src/outputFormat.ts | 9 + src/outputParameter.ts | 9 + src/outputRecordField.ts | 339 +++++++++++++ src/outputRecordSchema.ts | 232 +++++++++ src/outputSchema.ts | 9 + src/parameter.ts | 12 + src/process.ts | 15 + src/processRequirement.ts | 17 + src/recordField.ts | 186 +++++++ src/recordSchema.ts | 142 ++++++ src/resourceRequirement.ts | 406 +++++++++++++++ src/scatterFeatureRequirement.ts | 125 +++++ src/schemaDefRequirement.ts | 158 ++++++ src/secondaryFileSchema.ts | 210 ++++++++ src/shellCommandRequirement.ts | 130 +++++ src/sink.ts | 9 + src/softwarePackage.ts | 217 +++++++++ src/softwareRequirement.ts | 148 ++++++ src/stepInputExpressionRequirement.ts | 125 +++++ src/subworkflowFeatureRequirement.ts | 125 +++++ src/test/anyLoader.spec.ts | 23 + src/test/data/hellofield.yml | 5 + src/test/data/test.txt | 1 + src/test/fetcher.spec.ts | 78 +++ src/test/idMap.spec.ts | 44 ++ src/test/typeguards.spec.ts | 98 ++++ src/toolTimeLimit.ts | 155 ++++++ src/util/dict.ts | 3 + src/util/fetcher.ts | 63 +++ src/util/internal.ts | 100 ++++ src/util/loaderInstances.ts | 361 ++++++++++++++ src/util/loaders/anyLoader.ts | 10 + src/util/loaders/arrayLoader.ts | 36 ++ src/util/loaders/enumLoader.ts | 17 + src/util/loaders/expressionLoader.ts | 11 + src/util/loaders/idMapLoader.ts | 38 ++ src/util/loaders/loader.ts | 102 ++++ src/util/loaders/primitiveLoader.ts | 16 + src/util/loaders/recordLoader.ts | 15 + src/util/loaders/rootloader.ts | 70 +++ src/util/loaders/secondaryDSLLoader.ts | 68 +++ src/util/loaders/typeDSLLoader.ts | 62 +++ src/util/loaders/unionLoader.ts | 23 + src/util/loaders/uriLoader.ts | 32 ++ src/util/loadingOptions.ts | 56 +++ src/util/saveable.ts | 96 ++++ src/util/typeguards.ts | 25 + src/util/validationException.ts | 56 +++ src/util/vocabs.ts | 268 ++++++++++ src/workReuse.ts | 151 ++++++ src/workflow.ts | 479 ++++++++++++++++++ src/workflowInputParameter.ts | 464 ++++++++++++++++++ src/workflowOutputParameter.ts | 431 ++++++++++++++++ src/workflowStep.ts | 489 +++++++++++++++++++ src/workflowStepInput.ts | 496 +++++++++++++++++++ src/workflowStepOutput.ts | 144 ++++++ tsconfig.json | 17 + 111 files changed, 18866 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE copy create mode 100644 package.json create mode 100644 src/arraySchema.ts create mode 100644 src/commandInputArraySchema.ts create mode 100644 src/commandInputEnumSchema.ts create mode 100644 src/commandInputParameter.ts create mode 100644 src/commandInputRecordField.ts create mode 100644 src/commandInputRecordSchema.ts create mode 100644 src/commandInputSchema.ts create mode 100644 src/commandLineBindable.ts create mode 100644 src/commandLineBinding.ts create mode 100644 src/commandLineTool.ts create mode 100644 src/commandOutputArraySchema.ts create mode 100644 src/commandOutputBinding.ts create mode 100644 src/commandOutputEnumSchema.ts create mode 100644 src/commandOutputParameter.ts create mode 100644 src/commandOutputRecordField.ts create mode 100644 src/commandOutputRecordSchema.ts create mode 100644 src/directory.ts create mode 100644 src/dirent.ts create mode 100644 src/dockerRequirement.ts create mode 100644 src/documented.ts create mode 100644 src/enumSchema.ts create mode 100644 src/envVarRequirement.ts create mode 100644 src/environmentDef.ts create mode 100644 src/expressionTool.ts create mode 100644 src/expressionToolOutputParameter.ts create mode 100644 src/fieldBase.ts create mode 100644 src/file.ts create mode 100644 src/iOSchema.ts create mode 100644 src/identified.ts create mode 100644 src/index.ts create mode 100644 src/initialWorkDirRequirement.ts create mode 100644 src/inlineJavascriptRequirement.ts create mode 100644 src/inplaceUpdateRequirement.ts create mode 100644 src/inputArraySchema.ts create mode 100644 src/inputBinding.ts create mode 100644 src/inputEnumSchema.ts create mode 100644 src/inputFormat.ts create mode 100644 src/inputParameter.ts create mode 100644 src/inputRecordField.ts create mode 100644 src/inputRecordSchema.ts create mode 100644 src/inputSchema.ts create mode 100644 src/labeled.ts create mode 100644 src/loadContents.ts create mode 100644 src/loadListingRequirement.ts create mode 100644 src/multipleInputFeatureRequirement.ts create mode 100644 src/networkAccess.ts create mode 100644 src/operation.ts create mode 100644 src/operationInputParameter.ts create mode 100644 src/operationOutputParameter.ts create mode 100644 src/outputArraySchema.ts create mode 100644 src/outputEnumSchema.ts create mode 100644 src/outputFormat.ts create mode 100644 src/outputParameter.ts create mode 100644 src/outputRecordField.ts create mode 100644 src/outputRecordSchema.ts create mode 100644 src/outputSchema.ts create mode 100644 src/parameter.ts create mode 100644 src/process.ts create mode 100644 src/processRequirement.ts create mode 100644 src/recordField.ts create mode 100644 src/recordSchema.ts create mode 100644 src/resourceRequirement.ts create mode 100644 src/scatterFeatureRequirement.ts create mode 100644 src/schemaDefRequirement.ts create mode 100644 src/secondaryFileSchema.ts create mode 100644 src/shellCommandRequirement.ts create mode 100644 src/sink.ts create mode 100644 src/softwarePackage.ts create mode 100644 src/softwareRequirement.ts create mode 100644 src/stepInputExpressionRequirement.ts create mode 100644 src/subworkflowFeatureRequirement.ts create mode 100644 src/test/anyLoader.spec.ts create mode 100644 src/test/data/hellofield.yml create mode 100644 src/test/data/test.txt create mode 100644 src/test/fetcher.spec.ts create mode 100644 src/test/idMap.spec.ts create mode 100644 src/test/typeguards.spec.ts create mode 100644 src/toolTimeLimit.ts create mode 100644 src/util/dict.ts create mode 100644 src/util/fetcher.ts create mode 100644 src/util/internal.ts create mode 100644 src/util/loaderInstances.ts create mode 100644 src/util/loaders/anyLoader.ts create mode 100644 src/util/loaders/arrayLoader.ts create mode 100644 src/util/loaders/enumLoader.ts create mode 100644 src/util/loaders/expressionLoader.ts create mode 100644 src/util/loaders/idMapLoader.ts create mode 100644 src/util/loaders/loader.ts create mode 100644 src/util/loaders/primitiveLoader.ts create mode 100644 src/util/loaders/recordLoader.ts create mode 100644 src/util/loaders/rootloader.ts create mode 100644 src/util/loaders/secondaryDSLLoader.ts create mode 100644 src/util/loaders/typeDSLLoader.ts create mode 100644 src/util/loaders/unionLoader.ts create mode 100644 src/util/loaders/uriLoader.ts create mode 100644 src/util/loadingOptions.ts create mode 100644 src/util/saveable.ts create mode 100644 src/util/typeguards.ts create mode 100644 src/util/validationException.ts create mode 100644 src/util/vocabs.ts create mode 100644 src/workReuse.ts create mode 100644 src/workflow.ts create mode 100644 src/workflowInputParameter.ts create mode 100644 src/workflowOutputParameter.ts create mode 100644 src/workflowStep.ts create mode 100644 src/workflowStepInput.ts create mode 100644 src/workflowStepOutput.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b15b8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,106 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +built/ \ No newline at end of file diff --git a/LICENSE copy b/LICENSE copy new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE copy @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/package.json b/package.json new file mode 100644 index 0000000..ecc2010 --- /dev/null +++ b/package.json @@ -0,0 +1,34 @@ +{ + "name": "test", + "version": "0.0.1-SNAPSHOT", + "description": "This project contains TypeScript objects and utilities auto-generated by Schema Salad for parsing documents corresponding to the https://w3id.org/cwl/cwl# schema.", + "main": "index.js", + "scripts": { + "test": "nyc --reporter=lcov mocha --require ts-node/register src/test/**/*.ts" + }, + "license": "Apache License, Version 2.0", + "devDependencies": { + "@types/chai": "^4.2.22", + "@types/chai-as-promised": "^7.1.4", + "@types/js-yaml": "^4.0.4", + "@types/mocha": "^9.0.0", + "@types/node": "^16.11.6", + "@types/node-fetch": "^2.5.12", + "@types/sinon": "^10.0.6", + "@types/uuid": "^8.3.3", + "chai": "^4.3.4", + "chai-as-promised": "^7.1.1", + "mocha": "^9.1.3", + "nyc": "^15.1.0", + "sinon": "^12.0.1", + "ts-node": "^10.4.0", + "typescript": "^4.4.4", + "codecov.io": "^0.1.6" + }, + "dependencies": { + "js-yaml": "^4.1.0", + "node-fetch": "^2.6.6", + "uri-js": "^4.4.1", + "uuid": "^8.3.2" + } +} diff --git a/src/arraySchema.ts b/src/arraySchema.ts new file mode 100644 index 0000000..5aeb941 --- /dev/null +++ b/src/arraySchema.ts @@ -0,0 +1,140 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/salad#ArraySchema + */ +export class ArraySchema extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Defines the type of the array elements. + */ + items: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + + /** + * Must be `array` + */ + type: string + + + constructor ({extensionFields, loadingOptions, items, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array, type: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.items = items + this.type = type + } + + /** + * Used to construct instances of {@link ArraySchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ArraySchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let items + try { + items = await loadField(_doc.items, LoaderInstances.typedslunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `items` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`items\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ArraySchema'", errors) + } + + const schema = new ArraySchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + items: items, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.items != null) { + r.items = save(this.items, false, baseUrl, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['items','type']) +} diff --git a/src/commandInputArraySchema.ts b/src/commandInputArraySchema.ts new file mode 100644 index 0000000..db94fe7 --- /dev/null +++ b/src/commandInputArraySchema.ts @@ -0,0 +1,255 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputArraySchema + */ +export class CommandInputArraySchema extends Saveable implements Internal.InputArraySchema, Internal.CommandInputSchema, Internal.CommandLineBindable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding: undefined | Internal.CommandLineBinding + + + constructor ({extensionFields, loadingOptions, name, items, type, label, doc, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.items = items + this.type = type + this.label = label + this.doc = doc + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link CommandInputArraySchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandInputArraySchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let items + try { + items = await loadField(_doc.items, LoaderInstances.typedslunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `items` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\`,\`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandInputArraySchema'", errors) + } + + const schema = new CommandInputArraySchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + items: items, + type: type, + label: label, + doc: doc, + name: name, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.items != null) { + r.items = save(this.items, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['items','type','label','doc','name','inputBinding']) +} diff --git a/src/commandInputEnumSchema.ts b/src/commandInputEnumSchema.ts new file mode 100644 index 0000000..5585d8d --- /dev/null +++ b/src/commandInputEnumSchema.ts @@ -0,0 +1,259 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputEnumSchema + */ +export class CommandInputEnumSchema extends Saveable implements Internal.InputEnumSchema, Internal.CommandInputSchema, Internal.CommandLineBindable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding: undefined | Internal.CommandLineBinding + + + constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.symbols = symbols + this.type = type + this.label = label + this.doc = doc + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link CommandInputEnumSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandInputEnumSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let symbols + try { + symbols = await loadField(_doc.symbols, LoaderInstances.uriarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `symbols` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\`,\`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandInputEnumSchema'", errors) + } + + const schema = new CommandInputEnumSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + symbols: symbols, + type: type, + label: label, + doc: doc, + name: name, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.symbols != null) { + const u = saveRelativeUri(this.symbols, this.name, true, + relativeUris, undefined) + if (u != null) { + r.symbols = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['symbols','type','label','doc','name','inputBinding']) +} diff --git a/src/commandInputParameter.ts b/src/commandInputParameter.ts new file mode 100644 index 0000000..992aa7f --- /dev/null +++ b/src/commandInputParameter.ts @@ -0,0 +1,466 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputParameter + * + * An input parameter for a CommandLineTool. + */ +export class CommandInputParameter extends Saveable implements Internal.InputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_: undefined | any + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + + /** + * Describes how to turns the input parameters of a process into + * command line arguments. + * + */ + inputBinding: undefined | Internal.CommandLineBinding + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, default_: undefined | any, type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array, inputBinding: undefined | Internal.CommandLineBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.loadContents = loadContents + this.loadListing = loadListing + this.default_ = default_ + this.type = type + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link CommandInputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandInputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + let default_ + if ('default' in _doc) { + try { + default_ = await loadField(_doc.default, LoaderInstances.unionOfundefinedtypeOranyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `default` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`loadContents\`,\`loadListing\`,\`default\`,\`type\`,\`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandInputParameter'", errors) + } + + const schema = new CommandInputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + loadContents: loadContents, + loadListing: loadListing, + default_: default_, + type: type, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, this.id, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, this.id, relativeUris) + } + + if (this.default_ != null) { + r.default = save(this.default_, false, this.id, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','loadContents','loadListing','default','type','inputBinding']) +} diff --git a/src/commandInputRecordField.ts b/src/commandInputRecordField.ts new file mode 100644 index 0000000..9560b9c --- /dev/null +++ b/src/commandInputRecordField.ts @@ -0,0 +1,434 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputRecordField + */ +export class CommandInputRecordField extends Saveable implements Internal.InputRecordField, Internal.CommandLineBindable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding: undefined | Internal.CommandLineBinding + + + constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.doc = doc + this.type = type + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.format = format + this.loadContents = loadContents + this.loadListing = loadListing + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link CommandInputRecordField }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandInputRecordField } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uristrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + throw new ValidationException("Missing name") + } + } else { + baseuri = name as string + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\`,\`loadContents\`,\`loadListing\`,\`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandInputRecordField'", errors) + } + + const schema = new CommandInputRecordField({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + doc: doc, + name: name, + type: type, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + format: format, + loadContents: loadContents, + loadListing: loadListing, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.name, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.name, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.name, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, this.name, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, this.name, relativeUris) + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['doc','name','type','label','secondaryFiles','streamable','format','loadContents','loadListing','inputBinding']) +} diff --git a/src/commandInputRecordSchema.ts b/src/commandInputRecordSchema.ts new file mode 100644 index 0000000..f0d3400 --- /dev/null +++ b/src/commandInputRecordSchema.ts @@ -0,0 +1,257 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputRecordSchema + */ +export class CommandInputRecordSchema extends Saveable implements Internal.InputRecordSchema, Internal.CommandInputSchema, Internal.CommandLineBindable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the fields of the record. + */ + fields: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding: undefined | Internal.CommandLineBinding + + + constructor ({extensionFields, loadingOptions, name, fields, type, label, doc, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.fields = fields + this.type = type + this.label = label + this.doc = doc + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link CommandInputRecordSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandInputRecordSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let fields + if ('fields' in _doc) { + try { + fields = await loadField(_doc.fields, LoaderInstances.idmapfieldsunionOfundefinedtypeOrarrayOfCommandInputRecordFieldLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `fields` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\`,\`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandInputRecordSchema'", errors) + } + + const schema = new CommandInputRecordSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + fields: fields, + type: type, + label: label, + doc: doc, + name: name, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.fields != null) { + r.fields = save(this.fields, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['fields','type','label','doc','name','inputBinding']) +} diff --git a/src/commandInputSchema.ts b/src/commandInputSchema.ts new file mode 100644 index 0000000..dc9b874 --- /dev/null +++ b/src/commandInputSchema.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputSchema + */ +export interface CommandInputSchema { } + \ No newline at end of file diff --git a/src/commandLineBindable.ts b/src/commandLineBindable.ts new file mode 100644 index 0000000..b419b9f --- /dev/null +++ b/src/commandLineBindable.ts @@ -0,0 +1,119 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandLineBindable + */ +export class CommandLineBindable extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding: undefined | Internal.CommandLineBinding + + + constructor ({extensionFields, loadingOptions, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, inputBinding: undefined | Internal.CommandLineBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link CommandLineBindable }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandLineBindable } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandLineBindable'", errors) + } + + const schema = new CommandLineBindable({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['inputBinding']) +} diff --git a/src/commandLineBinding.ts b/src/commandLineBinding.ts new file mode 100644 index 0000000..e3b81f7 --- /dev/null +++ b/src/commandLineBinding.ts @@ -0,0 +1,343 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandLineBinding + * + * + * When listed under `inputBinding` in the input schema, the term + * "value" refers to the the corresponding value in the input object. For + * binding objects listed in `CommandLineTool.arguments`, the term "value" + * refers to the effective value after evaluating `valueFrom`. + * + * The binding behavior when building the command line depends on the data + * type of the value. If there is a mismatch between the type described by + * the input schema and the effective value, such as resulting from an + * expression evaluation, an implementation must use the data type of the + * effective value. + * + * - **string**: Add `prefix` and the string to the command line. + * + * - **number**: Add `prefix` and decimal representation to command line. + * + * - **boolean**: If true, add `prefix` to the command line. If false, add + * nothing. + * + * - **File**: Add `prefix` and the value of + * [`File.path`](#File) to the command line. + * + * - **Directory**: Add `prefix` and the value of + * [`Directory.path`](#Directory) to the command line. + * + * - **array**: If `itemSeparator` is specified, add `prefix` and the join + * the array into a single string with `itemSeparator` separating the + * items. Otherwise first add `prefix`, then recursively process + * individual elements. + * If the array is empty, it does not add anything to command line. + * + * - **object**: Add `prefix` only, and recursively add object fields for + * which `inputBinding` is specified. + * + * - **null**: Add nothing. + * + */ +export class CommandLineBinding extends Saveable implements Internal.InputBinding { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Use of `loadContents` in `InputBinding` is deprecated. + * Preserved for v1.0 backwards compatability. Will be removed in + * CWL v2.0. Use `InputParameter.loadContents` instead. + * + */ + loadContents: undefined | boolean + + /** + * The sorting key. Default position is 0. If a [CWL Parameter Reference](#Parameter_references) + * or [CWL Expression](#Expressions_(Optional)) is used and if the + * inputBinding is associated with an input parameter, then the value of + * `self` will be the value of the input parameter. Input parameter + * defaults (as specified by the `InputParameter.default` field) must be + * applied before evaluating the expression. Expressions must return a + * single value of type int or a null. + * + */ + position: undefined | number | string + + /** + * Command line prefix to add before the value. + */ + prefix: undefined | string + + /** + * If true (default), then the prefix and value must be added as separate + * command line arguments; if false, prefix and value must be concatenated + * into a single command line argument. + * + */ + separate: undefined | boolean + + /** + * Join the array elements into a single string with the elements + * separated by by `itemSeparator`. + * + */ + itemSeparator: undefined | string + + /** + * If `valueFrom` is a constant string value, use this as the value and + * apply the binding rules above. + * + * If `valueFrom` is an expression, evaluate the expression to yield the + * actual value to use to build the command line and apply the binding + * rules above. If the inputBinding is associated with an input + * parameter, the value of `self` in the expression will be the value of + * the input parameter. Input parameter defaults (as specified by the + * `InputParameter.default` field) must be applied before evaluating the + * expression. + * + * If the value of the associated input parameter is `null`, `valueFrom` is + * not evaluated and nothing is added to the command line. + * + * When a binding is part of the `CommandLineTool.arguments` field, + * the `valueFrom` field is required. + * + */ + valueFrom: undefined | string + + /** + * If `ShellCommandRequirement` is in the requirements for the current command, + * this controls whether the value is quoted on the command line (default is true). + * Use `shellQuote: false` to inject metacharacters for operations such as pipes. + * + * If `shellQuote` is true or not provided, the implementation must not + * permit interpretation of any shell metacharacters or directives. + * + */ + shellQuote: undefined | boolean + + + constructor ({extensionFields, loadingOptions, loadContents, position, prefix, separate, itemSeparator, valueFrom, shellQuote} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, loadContents: undefined | boolean, position: undefined | number | string, prefix: undefined | string, separate: undefined | boolean, itemSeparator: undefined | string, valueFrom: undefined | string, shellQuote: undefined | boolean,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.loadContents = loadContents + this.position = position + this.prefix = prefix + this.separate = separate + this.itemSeparator = itemSeparator + this.valueFrom = valueFrom + this.shellQuote = shellQuote + } + + /** + * Used to construct instances of {@link CommandLineBinding }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandLineBinding } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let position + if ('position' in _doc) { + try { + position = await loadField(_doc.position, LoaderInstances.unionOfundefinedtypeOrinttypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `position` field is not valid because: ', [e]) + ) + } + } + } + + let prefix + if ('prefix' in _doc) { + try { + prefix = await loadField(_doc.prefix, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `prefix` field is not valid because: ', [e]) + ) + } + } + } + + let separate + if ('separate' in _doc) { + try { + separate = await loadField(_doc.separate, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `separate` field is not valid because: ', [e]) + ) + } + } + } + + let itemSeparator + if ('itemSeparator' in _doc) { + try { + itemSeparator = await loadField(_doc.itemSeparator, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `itemSeparator` field is not valid because: ', [e]) + ) + } + } + } + + let valueFrom + if ('valueFrom' in _doc) { + try { + valueFrom = await loadField(_doc.valueFrom, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `valueFrom` field is not valid because: ', [e]) + ) + } + } + } + + let shellQuote + if ('shellQuote' in _doc) { + try { + shellQuote = await loadField(_doc.shellQuote, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `shellQuote` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`loadContents\`,\`position\`,\`prefix\`,\`separate\`,\`itemSeparator\`,\`valueFrom\`,\`shellQuote\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandLineBinding'", errors) + } + + const schema = new CommandLineBinding({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + loadContents: loadContents, + position: position, + prefix: prefix, + separate: separate, + itemSeparator: itemSeparator, + valueFrom: valueFrom, + shellQuote: shellQuote + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, baseUrl, relativeUris) + } + + if (this.position != null) { + r.position = save(this.position, false, baseUrl, relativeUris) + } + + if (this.prefix != null) { + r.prefix = save(this.prefix, false, baseUrl, relativeUris) + } + + if (this.separate != null) { + r.separate = save(this.separate, false, baseUrl, relativeUris) + } + + if (this.itemSeparator != null) { + r.itemSeparator = save(this.itemSeparator, false, baseUrl, relativeUris) + } + + if (this.valueFrom != null) { + r.valueFrom = save(this.valueFrom, false, baseUrl, relativeUris) + } + + if (this.shellQuote != null) { + r.shellQuote = save(this.shellQuote, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['loadContents','position','prefix','separate','itemSeparator','valueFrom','shellQuote']) +} diff --git a/src/commandLineTool.ts b/src/commandLineTool.ts new file mode 100644 index 0000000..830745c --- /dev/null +++ b/src/commandLineTool.ts @@ -0,0 +1,650 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandLineTool + * + * This defines the schema of the CWL Command Line Tool Description document. + * + */ +export class CommandLineTool extends Saveable implements Internal.Process { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent: undefined | Array + + /** + * Specifies the program to execute. If an array, the first element of + * the array is the command to execute, and subsequent elements are + * mandatory command line arguments. The elements in `baseCommand` must + * appear before any command line bindings from `inputBinding` or + * `arguments`. + * + * If `baseCommand` is not provided or is an empty array, the first + * element of the command line produced after processing `inputBinding` or + * `arguments` must be used as the program to execute. + * + * If the program includes a path separator character it must + * be an absolute path, otherwise it is an error. If the program does not + * include a path separator, search the `$PATH` variable in the runtime + * environment of the workflow runner find the absolute path of the + * executable. + * + */ + baseCommand: undefined | string | Array + + /** + * Command line bindings which are not directly associated with input + * parameters. If the value is a string, it is used as a string literal + * argument. If it is an Expression, the result of the evaluation is used + * as an argument. + * + */ + arguments_: undefined | Array + + /** + * A path to a file whose contents must be piped into the command's + * standard input stream. + * + */ + stdin: undefined | string + + /** + * Capture the command's standard error stream to a file written to + * the designated output directory. + * + * If `stderr` is a string, it specifies the file name to use. + * + * If `stderr` is an expression, the expression is evaluated and must + * return a string with the file name to use to capture stderr. If the + * return value is not a string, or the resulting path contains illegal + * characters (such as the path separator `/`) it is an error. + * + */ + stderr: undefined | string + + /** + * Capture the command's standard output stream to a file written to + * the designated output directory. + * + * If `stdout` is a string, it specifies the file name to use. + * + * If `stdout` is an expression, the expression is evaluated and must + * return a string with the file name to use to capture stdout. If the + * return value is not a string, or the resulting path contains illegal + * characters (such as the path separator `/`) it is an error. + * + */ + stdout: undefined | string + + /** + * Exit codes that indicate the process completed successfully. + * + * If not specified, only exit code 0 is considered success. + * + */ + successCodes: undefined | Array + + /** + * Exit codes that indicate the process failed due to a possibly + * temporary condition, where executing the process with the same + * runtime environment and inputs may produce different results. + * + * If not specified, no exit codes are considered temporary failure. + * + */ + temporaryFailCodes: undefined | Array + + /** + * Exit codes that indicate the process failed due to a permanent logic error, where executing the process with the same runtime environment and same inputs is expected to always fail. + * If not specified, all exit codes except 0 are considered permanent failure. + */ + permanentFailCodes: undefined | Array + + + constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, baseCommand, arguments_, stdin, stderr, stdout, successCodes, temporaryFailCodes, permanentFailCodes} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string, baseCommand: undefined | string | Array, arguments_: undefined | Array, stdin: undefined | string, stderr: undefined | string, stdout: undefined | string, successCodes: undefined | Array, temporaryFailCodes: undefined | Array, permanentFailCodes: undefined | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.class_ = class_ + this.label = label + this.doc = doc + this.inputs = inputs + this.outputs = outputs + this.requirements = requirements + this.hints = hints + this.cwlVersion = cwlVersion + this.intent = intent + this.baseCommand = baseCommand + this.arguments_ = arguments_ + this.stdin = stdin + this.stderr = stderr + this.stdout = stdout + this.successCodes = successCodes + this.temporaryFailCodes = temporaryFailCodes + this.permanentFailCodes = permanentFailCodes + } + + /** + * Used to construct instances of {@link CommandLineTool }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandLineTool } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriCommandLineTool_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputs + try { + inputs = await loadField(_doc.inputs, LoaderInstances.idmapinputsarrayOfCommandInputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputs` field is not valid because: ', [e]) + ) + } + } + + let outputs + try { + outputs = await loadField(_doc.outputs, LoaderInstances.idmapoutputsarrayOfCommandOutputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputs` field is not valid because: ', [e]) + ) + } + } + + let requirements + if ('requirements' in _doc) { + try { + requirements = await loadField(_doc.requirements, LoaderInstances.idmaprequirementsunionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `requirements` field is not valid because: ', [e]) + ) + } + } + } + + let hints + if ('hints' in _doc) { + try { + hints = await loadField(_doc.hints, LoaderInstances.idmaphintsunionOfundefinedtypeOrarrayOfanyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `hints` field is not valid because: ', [e]) + ) + } + } + } + + let cwlVersion + if ('cwlVersion' in _doc) { + try { + cwlVersion = await loadField(_doc.cwlVersion, LoaderInstances.uriunionOfundefinedtypeOrCWLVersionLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `cwlVersion` field is not valid because: ', [e]) + ) + } + } + } + + let intent + if ('intent' in _doc) { + try { + intent = await loadField(_doc.intent, LoaderInstances.uriunionOfundefinedtypeOrarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `intent` field is not valid because: ', [e]) + ) + } + } + } + + let baseCommand + if ('baseCommand' in _doc) { + try { + baseCommand = await loadField(_doc.baseCommand, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `baseCommand` field is not valid because: ', [e]) + ) + } + } + } + + let arguments_ + if ('arguments' in _doc) { + try { + arguments_ = await loadField(_doc.arguments, LoaderInstances.unionOfundefinedtypeOrarrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `arguments` field is not valid because: ', [e]) + ) + } + } + } + + let stdin + if ('stdin' in _doc) { + try { + stdin = await loadField(_doc.stdin, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `stdin` field is not valid because: ', [e]) + ) + } + } + } + + let stderr + if ('stderr' in _doc) { + try { + stderr = await loadField(_doc.stderr, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `stderr` field is not valid because: ', [e]) + ) + } + } + } + + let stdout + if ('stdout' in _doc) { + try { + stdout = await loadField(_doc.stdout, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `stdout` field is not valid because: ', [e]) + ) + } + } + } + + let successCodes + if ('successCodes' in _doc) { + try { + successCodes = await loadField(_doc.successCodes, LoaderInstances.unionOfundefinedtypeOrarrayOfinttype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `successCodes` field is not valid because: ', [e]) + ) + } + } + } + + let temporaryFailCodes + if ('temporaryFailCodes' in _doc) { + try { + temporaryFailCodes = await loadField(_doc.temporaryFailCodes, LoaderInstances.unionOfundefinedtypeOrarrayOfinttype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `temporaryFailCodes` field is not valid because: ', [e]) + ) + } + } + } + + let permanentFailCodes + if ('permanentFailCodes' in _doc) { + try { + permanentFailCodes = await loadField(_doc.permanentFailCodes, LoaderInstances.unionOfundefinedtypeOrarrayOfinttype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `permanentFailCodes` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\`,\`baseCommand\`,\`arguments\`,\`stdin\`,\`stderr\`,\`stdout\`,\`successCodes\`,\`temporaryFailCodes\`,\`permanentFailCodes\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandLineTool'", errors) + } + + const schema = new CommandLineTool({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id, + label: label, + doc: doc, + inputs: inputs, + outputs: outputs, + requirements: requirements, + hints: hints, + cwlVersion: cwlVersion, + intent: intent, + class_: class_, + baseCommand: baseCommand, + arguments_: arguments_, + stdin: stdin, + stderr: stderr, + stdout: stdout, + successCodes: successCodes, + temporaryFailCodes: temporaryFailCodes, + permanentFailCodes: permanentFailCodes + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, this.id, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.inputs != null) { + r.inputs = save(this.inputs, false, this.id, relativeUris) + } + + if (this.outputs != null) { + r.outputs = save(this.outputs, false, this.id, relativeUris) + } + + if (this.requirements != null) { + r.requirements = save(this.requirements, false, this.id, relativeUris) + } + + if (this.hints != null) { + r.hints = save(this.hints, false, this.id, relativeUris) + } + + if (this.cwlVersion != null) { + const u = saveRelativeUri(this.cwlVersion, this.id, false, + relativeUris, undefined) + if (u != null) { + r.cwlVersion = u + } + } + + if (this.intent != null) { + const u = saveRelativeUri(this.intent, this.id, true, + relativeUris, undefined) + if (u != null) { + r.intent = u + } + } + + if (this.baseCommand != null) { + r.baseCommand = save(this.baseCommand, false, this.id, relativeUris) + } + + if (this.arguments_ != null) { + r.arguments = save(this.arguments_, false, this.id, relativeUris) + } + + if (this.stdin != null) { + r.stdin = save(this.stdin, false, this.id, relativeUris) + } + + if (this.stderr != null) { + r.stderr = save(this.stderr, false, this.id, relativeUris) + } + + if (this.stdout != null) { + r.stdout = save(this.stdout, false, this.id, relativeUris) + } + + if (this.successCodes != null) { + r.successCodes = save(this.successCodes, false, this.id, relativeUris) + } + + if (this.temporaryFailCodes != null) { + r.temporaryFailCodes = save(this.temporaryFailCodes, false, this.id, relativeUris) + } + + if (this.permanentFailCodes != null) { + r.permanentFailCodes = save(this.permanentFailCodes, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id','label','doc','inputs','outputs','requirements','hints','cwlVersion','intent','class','baseCommand','arguments','stdin','stderr','stdout','successCodes','temporaryFailCodes','permanentFailCodes']) +} diff --git a/src/commandOutputArraySchema.ts b/src/commandOutputArraySchema.ts new file mode 100644 index 0000000..5b7e9a1 --- /dev/null +++ b/src/commandOutputArraySchema.ts @@ -0,0 +1,230 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputArraySchema + */ +export class CommandOutputArraySchema extends Saveable implements Internal.OutputArraySchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, items, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.items = items + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link CommandOutputArraySchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandOutputArraySchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let items + try { + items = await loadField(_doc.items, LoaderInstances.typedslunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `items` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputArraySchema'", errors) + } + + const schema = new CommandOutputArraySchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + items: items, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.items != null) { + r.items = save(this.items, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['items','type','label','doc','name']) +} diff --git a/src/commandOutputBinding.ts b/src/commandOutputBinding.ts new file mode 100644 index 0000000..b9cc234 --- /dev/null +++ b/src/commandOutputBinding.ts @@ -0,0 +1,278 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputBinding + * + * Describes how to generate an output parameter based on the files produced + * by a CommandLineTool. + * + * The output parameter value is generated by applying these operations in the + * following order: + * + * - glob + * - loadContents + * - outputEval + * - secondaryFiles + * + */ +export class CommandOutputBinding extends Saveable implements Internal.LoadContents { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + /** + * Find files or directories relative to the output directory, using POSIX + * glob(3) pathname matching. If an array is provided, find files or + * directories that match any pattern in the array. If an expression is + * provided, the expression must return a string or an array of strings, + * which will then be evaluated as one or more glob patterns. Must only + * match and return files/directories which actually exist. + * + * If the value of glob is a relative path pattern (does not + * begin with a slash '/') then it is resolved relative to the + * output directory. If the value of the glob is an absolute + * path pattern (it does begin with a slash '/') then it must + * refer to a path within the output directory. It is an error + * if any glob resolves to a path outside the output directory. + * Specifically this means globs that resolve to paths outside the output + * directory are illegal. + * + * A glob may match a path within the output directory which is + * actually a symlink to another file. In this case, the + * expected behavior is for the resulting File/Directory object to take the + * `basename` (and corresponding `nameroot` and `nameext`) of the + * symlink. The `location` of the File/Directory is implementation + * dependent, but logically the File/Directory should have the same content + * as the symlink target. Platforms may stage output files/directories to + * cloud storage that lack the concept of a symlink. In + * this case file content and directories may be duplicated, or (to avoid + * duplication) the File/Directory `location` may refer to the symlink + * target. + * + * It is an error if a symlink in the output directory (or any + * symlink in a chain of links) refers to any file or directory + * that is not under an input or output directory. + * + * Implementations may shut down a container before globbing + * output, so globs and expressions must not assume access to the + * container filesystem except for declared input and output. + * + */ + glob: undefined | string | Array + + /** + * Evaluate an expression to generate the output value. If + * `glob` was specified, the value of `self` must be an array + * containing file objects that were matched. If no files were + * matched, `self` must be a zero length array; if a single file + * was matched, the value of `self` is an array of a single + * element. The exit code of the process is + * available in the expression as `runtime.exitCode`. + * + * Additionally if `loadContents` is true, the file must be a + * UTF-8 text file 64 KiB or smaller, and the implementation must + * read the entire contents of the file (or file array) and place + * it in the `contents` field of the File object for use in + * `outputEval`. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + * If a tool needs to return a large amount of structured data to + * the workflow, loading the output object from `cwl.output.json` + * bypasses `outputEval` and is not subject to the 64 KiB + * `loadContents` limit. + * + */ + outputEval: undefined | string + + + constructor ({extensionFields, loadingOptions, loadContents, loadListing, glob, outputEval} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, loadContents: undefined | boolean, loadListing: undefined | string, glob: undefined | string | Array, outputEval: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.loadContents = loadContents + this.loadListing = loadListing + this.glob = glob + this.outputEval = outputEval + } + + /** + * Used to construct instances of {@link CommandOutputBinding }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandOutputBinding } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + let glob + if ('glob' in _doc) { + try { + glob = await loadField(_doc.glob, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoaderOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `glob` field is not valid because: ', [e]) + ) + } + } + } + + let outputEval + if ('outputEval' in _doc) { + try { + outputEval = await loadField(_doc.outputEval, LoaderInstances.unionOfundefinedtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputEval` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`loadContents\`,\`loadListing\`,\`glob\`,\`outputEval\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputBinding'", errors) + } + + const schema = new CommandOutputBinding({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + loadContents: loadContents, + loadListing: loadListing, + glob: glob, + outputEval: outputEval + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, baseUrl, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, baseUrl, relativeUris) + } + + if (this.glob != null) { + r.glob = save(this.glob, false, baseUrl, relativeUris) + } + + if (this.outputEval != null) { + r.outputEval = save(this.outputEval, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['loadContents','loadListing','glob','outputEval']) +} diff --git a/src/commandOutputEnumSchema.ts b/src/commandOutputEnumSchema.ts new file mode 100644 index 0000000..830d33c --- /dev/null +++ b/src/commandOutputEnumSchema.ts @@ -0,0 +1,234 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputEnumSchema + */ +export class CommandOutputEnumSchema extends Saveable implements Internal.OutputEnumSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.symbols = symbols + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link CommandOutputEnumSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandOutputEnumSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let symbols + try { + symbols = await loadField(_doc.symbols, LoaderInstances.uriarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `symbols` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputEnumSchema'", errors) + } + + const schema = new CommandOutputEnumSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + symbols: symbols, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.symbols != null) { + const u = saveRelativeUri(this.symbols, this.name, true, + relativeUris, undefined) + if (u != null) { + r.symbols = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['symbols','type','label','doc','name']) +} diff --git a/src/commandOutputParameter.ts b/src/commandOutputParameter.ts new file mode 100644 index 0000000..7b13b21 --- /dev/null +++ b/src/commandOutputParameter.ts @@ -0,0 +1,365 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputParameter + * + * An output parameter for a CommandLineTool. + */ +export class CommandOutputParameter extends Saveable implements Internal.OutputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + + /** + * Describes how to generate this output object based on the files produced by a CommandLineTool + */ + outputBinding: undefined | Internal.CommandOutputBinding + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, type, outputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array, outputBinding: undefined | Internal.CommandOutputBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.type = type + this.outputBinding = outputBinding + } + + /** + * Used to construct instances of {@link CommandOutputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandOutputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let outputBinding + if ('outputBinding' in _doc) { + try { + outputBinding = await loadField(_doc.outputBinding, LoaderInstances.unionOfundefinedtypeOrCommandOutputBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`type\`,\`outputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputParameter'", errors) + } + + const schema = new CommandOutputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + type: type, + outputBinding: outputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (this.outputBinding != null) { + r.outputBinding = save(this.outputBinding, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','type','outputBinding']) +} diff --git a/src/commandOutputRecordField.ts b/src/commandOutputRecordField.ts new file mode 100644 index 0000000..e58a524 --- /dev/null +++ b/src/commandOutputRecordField.ts @@ -0,0 +1,366 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputRecordField + */ +export class CommandOutputRecordField extends Saveable implements Internal.OutputRecordField { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format: undefined | string + + /** + * Describes how to generate this output object based on the files + * produced by a CommandLineTool + * + */ + outputBinding: undefined | Internal.CommandOutputBinding + + + constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format, outputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string, outputBinding: undefined | Internal.CommandOutputBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.doc = doc + this.type = type + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.format = format + this.outputBinding = outputBinding + } + + /** + * Used to construct instances of {@link CommandOutputRecordField }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandOutputRecordField } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uristrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + throw new ValidationException("Missing name") + } + } else { + baseuri = name as string + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let outputBinding + if ('outputBinding' in _doc) { + try { + outputBinding = await loadField(_doc.outputBinding, LoaderInstances.unionOfundefinedtypeOrCommandOutputBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\`,\`outputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputRecordField'", errors) + } + + const schema = new CommandOutputRecordField({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + doc: doc, + name: name, + type: type, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + format: format, + outputBinding: outputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.name, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.name, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.name, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.outputBinding != null) { + r.outputBinding = save(this.outputBinding, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['doc','name','type','label','secondaryFiles','streamable','format','outputBinding']) +} diff --git a/src/commandOutputRecordSchema.ts b/src/commandOutputRecordSchema.ts new file mode 100644 index 0000000..eb124a1 --- /dev/null +++ b/src/commandOutputRecordSchema.ts @@ -0,0 +1,232 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputRecordSchema + */ +export class CommandOutputRecordSchema extends Saveable implements Internal.OutputRecordSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the fields of the record. + */ + fields: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, fields, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.fields = fields + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link CommandOutputRecordSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link CommandOutputRecordSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let fields + if ('fields' in _doc) { + try { + fields = await loadField(_doc.fields, LoaderInstances.idmapfieldsunionOfundefinedtypeOrarrayOfCommandOutputRecordFieldLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `fields` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputRecordSchema'", errors) + } + + const schema = new CommandOutputRecordSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + fields: fields, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.fields != null) { + r.fields = save(this.fields, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['fields','type','label','doc','name']) +} diff --git a/src/directory.ts b/src/directory.ts new file mode 100644 index 0000000..65ec6ef --- /dev/null +++ b/src/directory.ts @@ -0,0 +1,321 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#Directory + * + * Represents a directory to present to a command line tool. + * + * Directories are represented as objects with `class` of `Directory`. Directory objects have + * a number of properties that provide metadata about the directory. + * + * The `location` property of a Directory is a URI that uniquely identifies + * the directory. Implementations must support the file:// URI scheme and may + * support other schemes such as http://. Alternately to `location`, + * implementations must also accept the `path` property on Directory, which + * must be a filesystem path available on the same host as the CWL runner (for + * inputs) or the runtime environment of a command line tool execution (for + * command line tool outputs). + * + * A Directory object may have a `listing` field. This is a list of File and + * Directory objects that are contained in the Directory. For each entry in + * `listing`, the `basename` property defines the name of the File or + * Subdirectory when staged to disk. If `listing` is not provided, the + * implementation must have some way of fetching the Directory listing at + * runtime based on the `location` field. + * + * If a Directory does not have `location`, it is a Directory literal. A + * Directory literal must provide `listing`. Directory literals must be + * created on disk at runtime as needed. + * + * The resources in a Directory literal do not need to have any implied + * relationship in their `location`. For example, a Directory listing may + * contain two files located on different hosts. It is the responsibility of + * the runtime to ensure that those files are staged to disk appropriately. + * Secondary files associated with files in `listing` must also be staged to + * the same Directory. + * + * When executing a CommandLineTool, Directories must be recursively staged + * first and have local values of `path` assigend. + * + * Directory objects in CommandLineTool output must provide either a + * `location` URI or a `path` property in the context of the tool execution + * runtime (local to the compute node, or within the executing container). + * + * An ExpressionTool may forward file references from input to output by using + * the same value for `location`. + * + * Name conflicts (the same `basename` appearing multiple times in `listing` + * or in any entry in `secondaryFiles` in the listing) is a fatal error. + * + */ +export class Directory extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Must be `Directory` to indicate this object describes a Directory. + */ + class_: string + + /** + * An IRI that identifies the directory resource. This may be a relative + * reference, in which case it must be resolved using the base IRI of the + * document. The location may refer to a local or remote resource. If + * the `listing` field is not set, the implementation must use the + * location IRI to retrieve directory listing. If an implementation is + * unable to retrieve the directory listing stored at a remote resource (due to + * unsupported protocol, access denied, or other issue) it must signal an + * error. + * + * If the `location` field is not provided, the `listing` field must be + * provided. The implementation must assign a unique identifier for + * the `location` field. + * + * If the `path` field is provided but the `location` field is not, an + * implementation may assign the value of the `path` field to `location`, + * then follow the rules above. + * + */ + location: undefined | string + + /** + * The local path where the Directory is made available prior to executing a + * CommandLineTool. This must be set by the implementation. This field + * must not be used in any other context. The command line tool being + * executed must be able to to access the directory at `path` using the POSIX + * `opendir(2)` syscall. + * + * If the `path` contains [POSIX shell metacharacters](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) + * (`|`,`&`, `;`, `<`, `>`, `(`,`)`, `$`,`` ` ``, `\`, `"`, `'`, + * ``, ``, and ``) or characters + * [not allowed](http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml) + * for [Internationalized Domain Names for Applications](https://tools.ietf.org/html/rfc6452) + * then implementations may terminate the process with a + * `permanentFailure`. + * + */ + path: undefined | string + + /** + * The base name of the directory, that is, the name of the file without any + * leading directory path. The base name must not contain a slash `/`. + * + * If not provided, the implementation must set this field based on the + * `location` field by taking the final path component after parsing + * `location` as an IRI. If `basename` is provided, it is not required to + * match the value from `location`. + * + * When this file is made available to a CommandLineTool, it must be named + * with `basename`, i.e. the final component of the `path` field must match + * `basename`. + * + */ + basename: undefined | string + + /** + * List of files or subdirectories contained in this directory. The name + * of each file or subdirectory is determined by the `basename` field of + * each `File` or `Directory` object. It is an error if a `File` shares a + * `basename` with any other entry in `listing`. If two or more + * `Directory` object share the same `basename`, this must be treated as + * equivalent to a single subdirectory with the listings recursively + * merged. + * + */ + listing: undefined | Array + + + constructor ({extensionFields, loadingOptions, class_, location, path, basename, listing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, location: undefined | string, path: undefined | string, basename: undefined | string, listing: undefined | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.location = location + this.path = path + this.basename = basename + this.listing = listing + } + + /** + * Used to construct instances of {@link Directory }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link Directory } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriDirectory_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let location + if ('location' in _doc) { + try { + location = await loadField(_doc.location, LoaderInstances.uriunionOfundefinedtypeOrstrtypeFalseFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `location` field is not valid because: ', [e]) + ) + } + } + } + + let path + if ('path' in _doc) { + try { + path = await loadField(_doc.path, LoaderInstances.uriunionOfundefinedtypeOrstrtypeFalseFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `path` field is not valid because: ', [e]) + ) + } + } + } + + let basename + if ('basename' in _doc) { + try { + basename = await loadField(_doc.basename, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `basename` field is not valid because: ', [e]) + ) + } + } + } + + let listing + if ('listing' in _doc) { + try { + listing = await loadField(_doc.listing, LoaderInstances.unionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `listing` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`location\`,\`path\`,\`basename\`,\`listing\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'Directory'", errors) + } + + const schema = new Directory({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + location: location, + path: path, + basename: basename, + listing: listing + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.location != null) { + const u = saveRelativeUri(this.location, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.location = u + } + } + + if (this.path != null) { + const u = saveRelativeUri(this.path, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.path = u + } + } + + if (this.basename != null) { + r.basename = save(this.basename, false, baseUrl, relativeUris) + } + + if (this.listing != null) { + r.listing = save(this.listing, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','location','path','basename','listing']) +} diff --git a/src/dirent.ts b/src/dirent.ts new file mode 100644 index 0000000..13c8498 --- /dev/null +++ b/src/dirent.ts @@ -0,0 +1,242 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#Dirent + * + * Define a file or subdirectory that must be staged to a particular + * place prior to executing the command line tool. May be the result + * of executing an expression, such as building a configuration file + * from a template. + * + * Usually files are staged within the [designated output directory](#Runtime_environment). + * However, under certain circumstances, files may be staged at + * arbitrary locations, see discussion for `entryname`. + * + */ +export class Dirent extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The "target" name of the file or subdirectory. If `entry` is + * a File or Directory, the `entryname` field overrides the value + * of `basename` of the File or Directory object. + * + * * Required when `entry` evaluates to file contents only + * * Optional when `entry` evaluates to a File or Directory object with a `basename` + * * Invalid when `entry` evaluates to an array of File or Directory objects. + * + * If `entryname` is a relative path, it specifies a name within + * the designated output directory. A relative path starting + * with `../` or that resolves to location above the designated output directory is an error. + * + * If `entryname` is an absolute path (starts with a slash `/`) + * it is an error unless the following conditions are met: + * + * * `DockerRequirement` is present in `requirements` + * * The program is will run inside a software container + * where, from the perspective of the program, the root + * filesystem is not shared with any other user or + * running program. + * + * In this case, and the above conditions are met, then + * `entryname` may specify the absolute path within the container + * where the file or directory must be placed. + * + */ + entryname: undefined | string + + /** + * If the value is a string literal or an expression which evaluates to a + * string, a new text file must be created with the string as the file contents. + * + * If the value is an expression that evaluates to a `File` or + * `Directory` object, or an array of `File` or `Directory` + * objects, this indicates the referenced file or directory + * should be added to the designated output directory prior to + * executing the tool. + * + * If the value is an expression that evaluates to `null`, + * nothing is added to the designated output directory, the entry + * has no effect. + * + * If the value is an expression that evaluates to some other + * array, number, or object not consisting of `File` or + * `Directory` objects, a new file must be created with the value + * serialized to JSON text as the file contents. The JSON + * serialization behavior should match the behavior of string + * interpolation of [Parameter + * references](#Parameter_references). + * + */ + entry: string + + /** + * If true, the File or Directory (or array of Files or + * Directories) declared in `entry` must be writable by the tool. + * + * Changes to the file or directory must be isolated and not + * visible by any other CommandLineTool process. This may be + * implemented by making a copy of the original file or + * directory. + * + * Disruptive changes to the referenced file or directory must not + * be allowed unless `InplaceUpdateRequirement.inplaceUpdate` is true. + * + * Default false (files and directories read-only by default). + * + * A directory marked as `writable: true` implies that all files and + * subdirectories are recursively writable as well. + * + * If `writable` is false, the file may be made available using a + * bind mount or file system link to avoid unnecessary copying of + * the input file. Command line tools may receive an error on + * attempting to rename or delete files or directories that are + * not explicitly marked as writable. + * + */ + writable: undefined | boolean + + + constructor ({extensionFields, loadingOptions, entryname, entry, writable} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, entryname: undefined | string, entry: string, writable: undefined | boolean,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.entryname = entryname + this.entry = entry + this.writable = writable + } + + /** + * Used to construct instances of {@link Dirent }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link Dirent } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let entryname + if ('entryname' in _doc) { + try { + entryname = await loadField(_doc.entryname, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `entryname` field is not valid because: ', [e]) + ) + } + } + } + + let entry + try { + entry = await loadField(_doc.entry, LoaderInstances.unionOfstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `entry` field is not valid because: ', [e]) + ) + } + } + + let writable + if ('writable' in _doc) { + try { + writable = await loadField(_doc.writable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `writable` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`entryname\`,\`entry\`,\`writable\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'Dirent'", errors) + } + + const schema = new Dirent({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + entryname: entryname, + entry: entry, + writable: writable + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.entryname != null) { + r.entryname = save(this.entryname, false, baseUrl, relativeUris) + } + + if (this.entry != null) { + r.entry = save(this.entry, false, baseUrl, relativeUris) + } + + if (this.writable != null) { + r.writable = save(this.writable, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['entryname','entry','writable']) +} diff --git a/src/dockerRequirement.ts b/src/dockerRequirement.ts new file mode 100644 index 0000000..62cdd43 --- /dev/null +++ b/src/dockerRequirement.ts @@ -0,0 +1,333 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#DockerRequirement + * + * Indicates that a workflow component should be run in a + * [Docker](http://docker.com) or Docker-compatible (such as + * [Singularity](https://www.sylabs.io/) and [udocker](https://github.com/indigo-dc/udocker)) container environment and + * specifies how to fetch or build the image. + * + * If a CommandLineTool lists `DockerRequirement` under + * `hints` (or `requirements`), it may (or must) be run in the specified Docker + * container. + * + * The platform must first acquire or install the correct Docker image as + * specified by `dockerPull`, `dockerImport`, `dockerLoad` or `dockerFile`. + * + * The platform must execute the tool in the container using `docker run` with + * the appropriate Docker image and tool command line. + * + * The workflow platform may provide input files and the designated output + * directory through the use of volume bind mounts. The platform should rewrite + * file paths in the input object to correspond to the Docker bind mounted + * locations. That is, the platform should rewrite values in the parameter context + * such as `runtime.outdir`, `runtime.tmpdir` and others to be valid paths + * within the container. The platform must ensure that `runtime.outdir` and + * `runtime.tmpdir` are distinct directories. + * + * When running a tool contained in Docker, the workflow platform must not + * assume anything about the contents of the Docker container, such as the + * presence or absence of specific software, except to assume that the + * generated command line represents a valid command within the runtime + * environment of the container. + * + * A container image may specify an + * [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) + * and/or + * [CMD](https://docs.docker.com/engine/reference/builder/#cmd). + * Command line arguments will be appended after all elements of + * ENTRYPOINT, and will override all elements specified using CMD (in + * other words, CMD is only used when the CommandLineTool definition + * produces an empty command line). + * + * Use of implicit ENTRYPOINT or CMD are discouraged due to reproducibility + * concerns of the implicit hidden execution point (For further discussion, see + * [https://doi.org/10.12688/f1000research.15140.1](https://doi.org/10.12688/f1000research.15140.1)). Portable + * CommandLineTool wrappers in which use of a container is optional must not rely on ENTRYPOINT or CMD. + * CommandLineTools which do rely on ENTRYPOINT or CMD must list `DockerRequirement` in the + * `requirements` section. + * + * ## Interaction with other requirements + * + * If [EnvVarRequirement](#EnvVarRequirement) is specified alongside a + * DockerRequirement, the environment variables must be provided to Docker + * using `--env` or `--env-file` and interact with the container's preexisting + * environment as defined by Docker. + * + */ +export class DockerRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'DockerRequirement' + */ + class_: string + + /** + * Specify a Docker image to retrieve using `docker pull`. Can contain the + * immutable digest to ensure an exact container is used: + * `dockerPull: ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2` + * + */ + dockerPull: undefined | string + + /** + * Specify a HTTP URL from which to download a Docker image using `docker load`. + */ + dockerLoad: undefined | string + + /** + * Supply the contents of a Dockerfile which will be built using `docker build`. + */ + dockerFile: undefined | string + + /** + * Provide HTTP URL to download and gunzip a Docker images using `docker import. + */ + dockerImport: undefined | string + + /** + * The image id that will be used for `docker run`. May be a + * human-readable image name or the image identifier hash. May be skipped + * if `dockerPull` is specified, in which case the `dockerPull` image id + * must be used. + * + */ + dockerImageId: undefined | string + + /** + * Set the designated output directory to a specific location inside the + * Docker container. + * + */ + dockerOutputDirectory: undefined | string + + + constructor ({extensionFields, loadingOptions, class_, dockerPull, dockerLoad, dockerFile, dockerImport, dockerImageId, dockerOutputDirectory} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, dockerPull: undefined | string, dockerLoad: undefined | string, dockerFile: undefined | string, dockerImport: undefined | string, dockerImageId: undefined | string, dockerOutputDirectory: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.dockerPull = dockerPull + this.dockerLoad = dockerLoad + this.dockerFile = dockerFile + this.dockerImport = dockerImport + this.dockerImageId = dockerImageId + this.dockerOutputDirectory = dockerOutputDirectory + } + + /** + * Used to construct instances of {@link DockerRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link DockerRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriDockerRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let dockerPull + if ('dockerPull' in _doc) { + try { + dockerPull = await loadField(_doc.dockerPull, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dockerPull` field is not valid because: ', [e]) + ) + } + } + } + + let dockerLoad + if ('dockerLoad' in _doc) { + try { + dockerLoad = await loadField(_doc.dockerLoad, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dockerLoad` field is not valid because: ', [e]) + ) + } + } + } + + let dockerFile + if ('dockerFile' in _doc) { + try { + dockerFile = await loadField(_doc.dockerFile, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dockerFile` field is not valid because: ', [e]) + ) + } + } + } + + let dockerImport + if ('dockerImport' in _doc) { + try { + dockerImport = await loadField(_doc.dockerImport, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dockerImport` field is not valid because: ', [e]) + ) + } + } + } + + let dockerImageId + if ('dockerImageId' in _doc) { + try { + dockerImageId = await loadField(_doc.dockerImageId, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dockerImageId` field is not valid because: ', [e]) + ) + } + } + } + + let dockerOutputDirectory + if ('dockerOutputDirectory' in _doc) { + try { + dockerOutputDirectory = await loadField(_doc.dockerOutputDirectory, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dockerOutputDirectory` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`dockerPull\`,\`dockerLoad\`,\`dockerFile\`,\`dockerImport\`,\`dockerImageId\`,\`dockerOutputDirectory\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'DockerRequirement'", errors) + } + + const schema = new DockerRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + dockerPull: dockerPull, + dockerLoad: dockerLoad, + dockerFile: dockerFile, + dockerImport: dockerImport, + dockerImageId: dockerImageId, + dockerOutputDirectory: dockerOutputDirectory + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.dockerPull != null) { + r.dockerPull = save(this.dockerPull, false, baseUrl, relativeUris) + } + + if (this.dockerLoad != null) { + r.dockerLoad = save(this.dockerLoad, false, baseUrl, relativeUris) + } + + if (this.dockerFile != null) { + r.dockerFile = save(this.dockerFile, false, baseUrl, relativeUris) + } + + if (this.dockerImport != null) { + r.dockerImport = save(this.dockerImport, false, baseUrl, relativeUris) + } + + if (this.dockerImageId != null) { + r.dockerImageId = save(this.dockerImageId, false, baseUrl, relativeUris) + } + + if (this.dockerOutputDirectory != null) { + r.dockerOutputDirectory = save(this.dockerOutputDirectory, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','dockerPull','dockerLoad','dockerFile','dockerImport','dockerImageId','dockerOutputDirectory']) +} diff --git a/src/documented.ts b/src/documented.ts new file mode 100644 index 0000000..eef14fe --- /dev/null +++ b/src/documented.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/salad#Documented + */ +export interface Documented { } + \ No newline at end of file diff --git a/src/enumSchema.ts b/src/enumSchema.ts new file mode 100644 index 0000000..b8156d0 --- /dev/null +++ b/src/enumSchema.ts @@ -0,0 +1,147 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/salad#EnumSchema + * + * Define an enumerated type. + * + */ +export class EnumSchema extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + + constructor ({extensionFields, loadingOptions, symbols, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.symbols = symbols + this.type = type + } + + /** + * Used to construct instances of {@link EnumSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link EnumSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let symbols + try { + symbols = await loadField(_doc.symbols, LoaderInstances.uriarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `symbols` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`symbols\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'EnumSchema'", errors) + } + + const schema = new EnumSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + symbols: symbols, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.symbols != null) { + const u = saveRelativeUri(this.symbols, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.symbols = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['symbols','type']) +} diff --git a/src/envVarRequirement.ts b/src/envVarRequirement.ts new file mode 100644 index 0000000..2e1347c --- /dev/null +++ b/src/envVarRequirement.ts @@ -0,0 +1,148 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#EnvVarRequirement + * + * Define a list of environment variables which will be set in the + * execution environment of the tool. See `EnvironmentDef` for details. + * + */ +export class EnvVarRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'EnvVarRequirement' + */ + class_: string + + /** + * The list of environment variables. + */ + envDef: Array + + + constructor ({extensionFields, loadingOptions, class_, envDef} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, envDef: Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.envDef = envDef + } + + /** + * Used to construct instances of {@link EnvVarRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link EnvVarRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriEnvVarRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let envDef + try { + envDef = await loadField(_doc.envDef, LoaderInstances.idmapenvDefarrayOfEnvironmentDefLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `envDef` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`envDef\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'EnvVarRequirement'", errors) + } + + const schema = new EnvVarRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + envDef: envDef + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.envDef != null) { + r.envDef = save(this.envDef, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','envDef']) +} diff --git a/src/environmentDef.ts b/src/environmentDef.ts new file mode 100644 index 0000000..17d97d4 --- /dev/null +++ b/src/environmentDef.ts @@ -0,0 +1,145 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#EnvironmentDef + * + * Define an environment variable that will be set in the runtime environment + * by the workflow platform when executing the command line tool. May be the + * result of executing an expression, such as getting a parameter from input. + * + */ +export class EnvironmentDef extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The environment variable name + */ + envName: string + + /** + * The environment variable value + */ + envValue: string + + + constructor ({extensionFields, loadingOptions, envName, envValue} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, envName: string, envValue: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.envName = envName + this.envValue = envValue + } + + /** + * Used to construct instances of {@link EnvironmentDef }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link EnvironmentDef } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let envName + try { + envName = await loadField(_doc.envName, LoaderInstances.strtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `envName` field is not valid because: ', [e]) + ) + } + } + + let envValue + try { + envValue = await loadField(_doc.envValue, LoaderInstances.unionOfstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `envValue` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`envName\`,\`envValue\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'EnvironmentDef'", errors) + } + + const schema = new EnvironmentDef({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + envName: envName, + envValue: envValue + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.envName != null) { + r.envName = save(this.envName, false, baseUrl, relativeUris) + } + + if (this.envValue != null) { + r.envValue = save(this.envValue, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['envName','envValue']) +} diff --git a/src/expressionTool.ts b/src/expressionTool.ts new file mode 100644 index 0000000..bfa9833 --- /dev/null +++ b/src/expressionTool.ts @@ -0,0 +1,434 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#ExpressionTool + * + * An ExpressionTool is a type of Process object that can be run by itself + * or as a Workflow step. It executes a pure Javascript expression that has + * access to the same input parameters as a workflow. It is meant to be used + * sparingly as a way to isolate complex Javascript expressions that need to + * operate on input data and produce some result; perhaps just a + * rearrangement of the inputs. No Docker software container is required + * or allowed. + * + */ +export class ExpressionTool extends Saveable implements Internal.Process { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent: undefined | Array + + /** + * The expression to execute. The expression must return a plain + * Javascript object which matches the output parameters of the + * ExpressionTool. + * + */ + expression: string + + + constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, expression} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string, expression: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.class_ = class_ + this.label = label + this.doc = doc + this.inputs = inputs + this.outputs = outputs + this.requirements = requirements + this.hints = hints + this.cwlVersion = cwlVersion + this.intent = intent + this.expression = expression + } + + /** + * Used to construct instances of {@link ExpressionTool }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ExpressionTool } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriExpressionTool_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputs + try { + inputs = await loadField(_doc.inputs, LoaderInstances.idmapinputsarrayOfWorkflowInputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputs` field is not valid because: ', [e]) + ) + } + } + + let outputs + try { + outputs = await loadField(_doc.outputs, LoaderInstances.idmapoutputsarrayOfExpressionToolOutputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputs` field is not valid because: ', [e]) + ) + } + } + + let requirements + if ('requirements' in _doc) { + try { + requirements = await loadField(_doc.requirements, LoaderInstances.idmaprequirementsunionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `requirements` field is not valid because: ', [e]) + ) + } + } + } + + let hints + if ('hints' in _doc) { + try { + hints = await loadField(_doc.hints, LoaderInstances.idmaphintsunionOfundefinedtypeOrarrayOfanyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `hints` field is not valid because: ', [e]) + ) + } + } + } + + let cwlVersion + if ('cwlVersion' in _doc) { + try { + cwlVersion = await loadField(_doc.cwlVersion, LoaderInstances.uriunionOfundefinedtypeOrCWLVersionLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `cwlVersion` field is not valid because: ', [e]) + ) + } + } + } + + let intent + if ('intent' in _doc) { + try { + intent = await loadField(_doc.intent, LoaderInstances.uriunionOfundefinedtypeOrarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `intent` field is not valid because: ', [e]) + ) + } + } + } + + let expression + try { + expression = await loadField(_doc.expression, LoaderInstances.ExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `expression` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\`,\`expression\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ExpressionTool'", errors) + } + + const schema = new ExpressionTool({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id, + label: label, + doc: doc, + inputs: inputs, + outputs: outputs, + requirements: requirements, + hints: hints, + cwlVersion: cwlVersion, + intent: intent, + class_: class_, + expression: expression + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, this.id, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.inputs != null) { + r.inputs = save(this.inputs, false, this.id, relativeUris) + } + + if (this.outputs != null) { + r.outputs = save(this.outputs, false, this.id, relativeUris) + } + + if (this.requirements != null) { + r.requirements = save(this.requirements, false, this.id, relativeUris) + } + + if (this.hints != null) { + r.hints = save(this.hints, false, this.id, relativeUris) + } + + if (this.cwlVersion != null) { + const u = saveRelativeUri(this.cwlVersion, this.id, false, + relativeUris, undefined) + if (u != null) { + r.cwlVersion = u + } + } + + if (this.intent != null) { + const u = saveRelativeUri(this.intent, this.id, true, + relativeUris, undefined) + if (u != null) { + r.intent = u + } + } + + if (this.expression != null) { + r.expression = save(this.expression, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id','label','doc','inputs','outputs','requirements','hints','cwlVersion','intent','class','expression']) +} diff --git a/src/expressionToolOutputParameter.ts b/src/expressionToolOutputParameter.ts new file mode 100644 index 0000000..fd725b3 --- /dev/null +++ b/src/expressionToolOutputParameter.ts @@ -0,0 +1,338 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#ExpressionToolOutputParameter + */ +export class ExpressionToolOutputParameter extends Saveable implements Internal.OutputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.type = type + } + + /** + * Used to construct instances of {@link ExpressionToolOutputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ExpressionToolOutputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ExpressionToolOutputParameter'", errors) + } + + const schema = new ExpressionToolOutputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','type']) +} diff --git a/src/fieldBase.ts b/src/fieldBase.ts new file mode 100644 index 0000000..c4a8748 --- /dev/null +++ b/src/fieldBase.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#FieldBase + */ +export interface FieldBase extends Internal.Labeled { } + \ No newline at end of file diff --git a/src/file.ts b/src/file.ts new file mode 100644 index 0000000..64d18e0 --- /dev/null +++ b/src/file.ts @@ -0,0 +1,586 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#File + * + * Represents a file (or group of files when `secondaryFiles` is provided) that + * will be accessible by tools using standard POSIX file system call API such as + * open(2) and read(2). + * + * Files are represented as objects with `class` of `File`. File objects have + * a number of properties that provide metadata about the file. + * + * The `location` property of a File is a URI that uniquely identifies the + * file. Implementations must support the file:// URI scheme and may support + * other schemes such as http://. The value of `location` may also be a + * relative reference, in which case it must be resolved relative to the URI + * of the document it appears in. Alternately to `location`, implementations + * must also accept the `path` property on File, which must be a filesystem + * path available on the same host as the CWL runner (for inputs) or the + * runtime environment of a command line tool execution (for command line tool + * outputs). + * + * If no `location` or `path` is specified, a file object must specify + * `contents` with the UTF-8 text content of the file. This is a "file + * literal". File literals do not correspond to external resources, but are + * created on disk with `contents` with when needed for a executing a tool. + * Where appropriate, expressions can return file literals to define new files + * on a runtime. The maximum size of `contents` is 64 kilobytes. + * + * The `basename` property defines the filename on disk where the file is + * staged. This may differ from the resource name. If not provided, + * `basename` must be computed from the last path part of `location` and made + * available to expressions. + * + * The `secondaryFiles` property is a list of File or Directory objects that + * must be staged in the same directory as the primary file. It is an error + * for file names to be duplicated in `secondaryFiles`. + * + * The `size` property is the size in bytes of the File. It must be computed + * from the resource and made available to expressions. The `checksum` field + * contains a cryptographic hash of the file content for use it verifying file + * contents. Implementations may, at user option, enable or disable + * computation of the `checksum` field for performance or other reasons. + * However, the ability to compute output checksums is required to pass the + * CWL conformance test suite. + * + * When executing a CommandLineTool, the files and secondary files may be + * staged to an arbitrary directory, but must use the value of `basename` for + * the filename. The `path` property must be file path in the context of the + * tool execution runtime (local to the compute node, or within the executing + * container). All computed properties should be available to expressions. + * File literals also must be staged and `path` must be set. + * + * When collecting CommandLineTool outputs, `glob` matching returns file paths + * (with the `path` property) and the derived properties. This can all be + * modified by `outputEval`. Alternately, if the file `cwl.output.json` is + * present in the output, `outputBinding` is ignored. + * + * File objects in the output must provide either a `location` URI or a `path` + * property in the context of the tool execution runtime (local to the compute + * node, or within the executing container). + * + * When evaluating an ExpressionTool, file objects must be referenced via + * `location` (the expression tool does not have access to files on disk so + * `path` is meaningless) or as file literals. It is legal to return a file + * object with an existing `location` but a different `basename`. The + * `loadContents` field of ExpressionTool inputs behaves the same as on + * CommandLineTool inputs, however it is not meaningful on the outputs. + * + * An ExpressionTool may forward file references from input to output by using + * the same value for `location`. + * + */ +export class File extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Must be `File` to indicate this object describes a file. + */ + class_: string + + /** + * An IRI that identifies the file resource. This may be a relative + * reference, in which case it must be resolved using the base IRI of the + * document. The location may refer to a local or remote resource; the + * implementation must use the IRI to retrieve file content. If an + * implementation is unable to retrieve the file content stored at a + * remote resource (due to unsupported protocol, access denied, or other + * issue) it must signal an error. + * + * If the `location` field is not provided, the `contents` field must be + * provided. The implementation must assign a unique identifier for + * the `location` field. + * + * If the `path` field is provided but the `location` field is not, an + * implementation may assign the value of the `path` field to `location`, + * then follow the rules above. + * + */ + location: undefined | string + + /** + * The local host path where the File is available when a CommandLineTool is + * executed. This field must be set by the implementation. The final + * path component must match the value of `basename`. This field + * must not be used in any other context. The command line tool being + * executed must be able to to access the file at `path` using the POSIX + * `open(2)` syscall. + * + * As a special case, if the `path` field is provided but the `location` + * field is not, an implementation may assign the value of the `path` + * field to `location`, and remove the `path` field. + * + * If the `path` contains [POSIX shell metacharacters](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) + * (`|`,`&`, `;`, `<`, `>`, `(`,`)`, `$`,`` ` ``, `\`, `"`, `'`, + * ``, ``, and ``) or characters + * [not allowed](http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml) + * for [Internationalized Domain Names for Applications](https://tools.ietf.org/html/rfc6452) + * then implementations may terminate the process with a + * `permanentFailure`. + * + */ + path: undefined | string + + /** + * The base name of the file, that is, the name of the file without any + * leading directory path. The base name must not contain a slash `/`. + * + * If not provided, the implementation must set this field based on the + * `location` field by taking the final path component after parsing + * `location` as an IRI. If `basename` is provided, it is not required to + * match the value from `location`. + * + * When this file is made available to a CommandLineTool, it must be named + * with `basename`, i.e. the final component of the `path` field must match + * `basename`. + * + */ + basename: undefined | string + + /** + * The name of the directory containing file, that is, the path leading up + * to the final slash in the path such that `dirname + '/' + basename == + * path`. + * + * The implementation must set this field based on the value of `path` + * prior to evaluating parameter references or expressions in a + * CommandLineTool document. This field must not be used in any other + * context. + * + */ + dirname: undefined | string + + /** + * The basename root such that `nameroot + nameext == basename`, and + * `nameext` is empty or begins with a period and contains at most one + * period. For the purposess of path splitting leading periods on the + * basename are ignored; a basename of `.cshrc` will have a nameroot of + * `.cshrc`. + * + * The implementation must set this field automatically based on the value + * of `basename` prior to evaluating parameter references or expressions. + * + */ + nameroot: undefined | string + + /** + * The basename extension such that `nameroot + nameext == basename`, and + * `nameext` is empty or begins with a period and contains at most one + * period. Leading periods on the basename are ignored; a basename of + * `.cshrc` will have an empty `nameext`. + * + * The implementation must set this field automatically based on the value + * of `basename` prior to evaluating parameter references or expressions. + * + */ + nameext: undefined | string + + /** + * Optional hash code for validating file integrity. Currently must be in the form + * "sha1$ + hexadecimal string" using the SHA-1 algorithm. + * + */ + checksum: undefined | string + + /** + * Optional file size (in bytes) + */ + size: undefined | number + + /** + * A list of additional files or directories that are associated with the + * primary file and must be transferred alongside the primary file. + * Examples include indexes of the primary file, or external references + * which must be included when loading primary document. A file object + * listed in `secondaryFiles` may itself include `secondaryFiles` for + * which the same rules apply. + * + */ + secondaryFiles: undefined | Array + + /** + * The format of the file: this must be an IRI of a concept node that + * represents the file format, preferrably defined within an ontology. + * If no ontology is available, file formats may be tested by exact match. + * + * Reasoning about format compatability must be done by checking that an + * input file format is the same, `owl:equivalentClass` or + * `rdfs:subClassOf` the format required by the input parameter. + * `owl:equivalentClass` is transitive with `rdfs:subClassOf`, e.g. if + * ` owl:equivalentClass ` and ` owl:subclassOf ` then infer + * ` owl:subclassOf `. + * + * File format ontologies may be provided in the "$schemas" metadata at the + * root of the document. If no ontologies are specified in `$schemas`, the + * runtime may perform exact file format matches. + * + */ + format: undefined | string + + /** + * File contents literal. + * + * If neither `location` nor `path` is provided, `contents` must be + * non-null. The implementation must assign a unique identifier for the + * `location` field. When the file is staged as input to CommandLineTool, + * the value of `contents` must be written to a file. + * + * If `contents` is set as a result of an Javascript expression, + * an `entry` in `InitialWorkDirRequirement`, or read in from + * `cwl.output.json`, there is no specified upper limit on the + * size of `contents`. Implementations may have practical limits + * on the size of `contents` based on memory and storage + * available to the workflow runner or other factors. + * + * If the `loadContents` field of an `InputParameter` or + * `OutputParameter` is true, and the input or output File object + * `location` is valid, the file must be a UTF-8 text file 64 KiB + * or smaller, and the implementation must read the entire + * contents of the file and place it in the `contents` field. If + * the size of the file is greater than 64 KiB, the + * implementation must raise a fatal error. + * + */ + contents: undefined | string + + + constructor ({extensionFields, loadingOptions, class_, location, path, basename, dirname, nameroot, nameext, checksum, size, secondaryFiles, format, contents} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, location: undefined | string, path: undefined | string, basename: undefined | string, dirname: undefined | string, nameroot: undefined | string, nameext: undefined | string, checksum: undefined | string, size: undefined | number, secondaryFiles: undefined | Array, format: undefined | string, contents: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.location = location + this.path = path + this.basename = basename + this.dirname = dirname + this.nameroot = nameroot + this.nameext = nameext + this.checksum = checksum + this.size = size + this.secondaryFiles = secondaryFiles + this.format = format + this.contents = contents + } + + /** + * Used to construct instances of {@link File }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link File } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriFile_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let location + if ('location' in _doc) { + try { + location = await loadField(_doc.location, LoaderInstances.uriunionOfundefinedtypeOrstrtypeFalseFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `location` field is not valid because: ', [e]) + ) + } + } + } + + let path + if ('path' in _doc) { + try { + path = await loadField(_doc.path, LoaderInstances.uriunionOfundefinedtypeOrstrtypeFalseFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `path` field is not valid because: ', [e]) + ) + } + } + } + + let basename + if ('basename' in _doc) { + try { + basename = await loadField(_doc.basename, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `basename` field is not valid because: ', [e]) + ) + } + } + } + + let dirname + if ('dirname' in _doc) { + try { + dirname = await loadField(_doc.dirname, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `dirname` field is not valid because: ', [e]) + ) + } + } + } + + let nameroot + if ('nameroot' in _doc) { + try { + nameroot = await loadField(_doc.nameroot, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `nameroot` field is not valid because: ', [e]) + ) + } + } + } + + let nameext + if ('nameext' in _doc) { + try { + nameext = await loadField(_doc.nameext, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `nameext` field is not valid because: ', [e]) + ) + } + } + } + + let checksum + if ('checksum' in _doc) { + try { + checksum = await loadField(_doc.checksum, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `checksum` field is not valid because: ', [e]) + ) + } + } + } + + let size + if ('size' in _doc) { + try { + size = await loadField(_doc.size, LoaderInstances.unionOfundefinedtypeOrinttype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `size` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let contents + if ('contents' in _doc) { + try { + contents = await loadField(_doc.contents, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `contents` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`location\`,\`path\`,\`basename\`,\`dirname\`,\`nameroot\`,\`nameext\`,\`checksum\`,\`size\`,\`secondaryFiles\`,\`format\`,\`contents\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'File'", errors) + } + + const schema = new File({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + location: location, + path: path, + basename: basename, + dirname: dirname, + nameroot: nameroot, + nameext: nameext, + checksum: checksum, + size: size, + secondaryFiles: secondaryFiles, + format: format, + contents: contents + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.location != null) { + const u = saveRelativeUri(this.location, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.location = u + } + } + + if (this.path != null) { + const u = saveRelativeUri(this.path, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.path = u + } + } + + if (this.basename != null) { + r.basename = save(this.basename, false, baseUrl, relativeUris) + } + + if (this.dirname != null) { + r.dirname = save(this.dirname, false, baseUrl, relativeUris) + } + + if (this.nameroot != null) { + r.nameroot = save(this.nameroot, false, baseUrl, relativeUris) + } + + if (this.nameext != null) { + r.nameext = save(this.nameext, false, baseUrl, relativeUris) + } + + if (this.checksum != null) { + r.checksum = save(this.checksum, false, baseUrl, relativeUris) + } + + if (this.size != null) { + r.size = save(this.size, false, baseUrl, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, baseUrl, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.contents != null) { + r.contents = save(this.contents, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','location','path','basename','dirname','nameroot','nameext','checksum','size','secondaryFiles','format','contents']) +} diff --git a/src/iOSchema.ts b/src/iOSchema.ts new file mode 100644 index 0000000..52c3d2a --- /dev/null +++ b/src/iOSchema.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#IOSchema + */ +export interface IOSchema extends Internal.Labeled, Internal.Documented { } + \ No newline at end of file diff --git a/src/identified.ts b/src/identified.ts new file mode 100644 index 0000000..ad7a771 --- /dev/null +++ b/src/identified.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Identified + */ +export interface Identified { } + \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..3e74a02 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,82 @@ +export { + loadDocument, + loadDocumentByString, + Documented, + RecordField, + RecordSchema, + EnumSchema, + ArraySchema, + File, + Directory, + Labeled, + Identified, + LoadContents, + FieldBase, + InputFormat, + OutputFormat, + Parameter, + InputBinding, + IOSchema, + InputSchema, + OutputSchema, + InputRecordField, + InputRecordSchema, + InputEnumSchema, + InputArraySchema, + OutputRecordField, + OutputRecordSchema, + OutputEnumSchema, + OutputArraySchema, + InputParameter, + OutputParameter, + ProcessRequirement, + Process, + InlineJavascriptRequirement, + CommandInputSchema, + SchemaDefRequirement, + SecondaryFileSchema, + LoadListingRequirement, + EnvironmentDef, + CommandLineBinding, + CommandOutputBinding, + CommandLineBindable, + CommandInputRecordField, + CommandInputRecordSchema, + CommandInputEnumSchema, + CommandInputArraySchema, + CommandOutputRecordField, + CommandOutputRecordSchema, + CommandOutputEnumSchema, + CommandOutputArraySchema, + CommandInputParameter, + CommandOutputParameter, + CommandLineTool, + DockerRequirement, + SoftwareRequirement, + SoftwarePackage, + Dirent, + InitialWorkDirRequirement, + EnvVarRequirement, + ShellCommandRequirement, + ResourceRequirement, + WorkReuse, + NetworkAccess, + InplaceUpdateRequirement, + ToolTimeLimit, + ExpressionToolOutputParameter, + WorkflowInputParameter, + ExpressionTool, + WorkflowOutputParameter, + Sink, + WorkflowStepInput, + WorkflowStepOutput, + WorkflowStep, + Workflow, + SubworkflowFeatureRequirement, + ScatterFeatureRequirement, + MultipleInputFeatureRequirement, + StepInputExpressionRequirement, + OperationInputParameter, + OperationOutputParameter, + Operation +} from './util/internal' \ No newline at end of file diff --git a/src/initialWorkDirRequirement.ts b/src/initialWorkDirRequirement.ts new file mode 100644 index 0000000..0501e8d --- /dev/null +++ b/src/initialWorkDirRequirement.ts @@ -0,0 +1,171 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InitialWorkDirRequirement + * + * Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool. + * Normally files are staged within the designated output directory. However, when running inside containers, files may be staged at arbitrary locations, see discussion for `Dirent.entryname`. Together with `DockerRequirement.dockerOutputDirectory` this it possible to control the locations of both input and output files when running in containers. + */ +export class InitialWorkDirRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * InitialWorkDirRequirement + */ + class_: string + + /** + * The list of files or subdirectories that must be staged prior + * to executing the command line tool. + * + * Return type of each expression must validate as `["null", + * File, Directory, Dirent, {type: array, items: [File, + * Directory]}]`. + * + * Each `File` or `Directory` that is returned by an Expression + * must be added to the designated output directory prior to + * executing the tool. + * + * Each `Dirent` record that is listed or returned by an + * expression specifies a file to be created or staged in the + * designated output directory prior to executing the tool. + * + * Expressions may return null, in which case they have no effect. + * + * Files or Directories which are listed in the input parameters + * and appear in the `InitialWorkDirRequirement` listing must + * have their `path` set to their staged location. If the same + * File or Directory appears more than once in the + * `InitialWorkDirRequirement` listing, the implementation must + * choose exactly one value for `path`; how this value is chosen + * is undefined. + * + */ + listing: string | Array> + + + constructor ({extensionFields, loadingOptions, class_, listing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, listing: string | Array>,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.listing = listing + } + + /** + * Used to construct instances of {@link InitialWorkDirRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InitialWorkDirRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriInitialWorkDirRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let listing + try { + listing = await loadField(_doc.listing, LoaderInstances.unionOfExpressionLoaderOrarrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `listing` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`listing\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InitialWorkDirRequirement'", errors) + } + + const schema = new InitialWorkDirRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + listing: listing + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.listing != null) { + r.listing = save(this.listing, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','listing']) +} diff --git a/src/inlineJavascriptRequirement.ts b/src/inlineJavascriptRequirement.ts new file mode 100644 index 0000000..42a5743 --- /dev/null +++ b/src/inlineJavascriptRequirement.ts @@ -0,0 +1,154 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InlineJavascriptRequirement + * + * Indicates that the workflow platform must support inline Javascript expressions. + * If this requirement is not present, the workflow platform must not perform expression + * interpolatation. + * + */ +export class InlineJavascriptRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'InlineJavascriptRequirement' + */ + class_: string + + /** + * Additional code fragments that will also be inserted + * before executing the expression code. Allows for function definitions that may + * be called from CWL expressions. + * + */ + expressionLib: undefined | Array + + + constructor ({extensionFields, loadingOptions, class_, expressionLib} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, expressionLib: undefined | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.expressionLib = expressionLib + } + + /** + * Used to construct instances of {@link InlineJavascriptRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InlineJavascriptRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriInlineJavascriptRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let expressionLib + if ('expressionLib' in _doc) { + try { + expressionLib = await loadField(_doc.expressionLib, LoaderInstances.unionOfundefinedtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `expressionLib` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`expressionLib\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InlineJavascriptRequirement'", errors) + } + + const schema = new InlineJavascriptRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + expressionLib: expressionLib + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.expressionLib != null) { + r.expressionLib = save(this.expressionLib, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','expressionLib']) +} diff --git a/src/inplaceUpdateRequirement.ts b/src/inplaceUpdateRequirement.ts new file mode 100644 index 0000000..bd7afd9 --- /dev/null +++ b/src/inplaceUpdateRequirement.ts @@ -0,0 +1,172 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InplaceUpdateRequirement + * + * + * If `inplaceUpdate` is true, then an implementation supporting this + * feature may permit tools to directly update files with `writable: + * true` in InitialWorkDirRequirement. That is, as an optimization, + * files may be destructively modified in place as opposed to copied + * and updated. + * + * An implementation must ensure that only one workflow step may + * access a writable file at a time. It is an error if a file which + * is writable by one workflow step file is accessed (for reading or + * writing) by any other workflow step running independently. + * However, a file which has been updated in a previous completed + * step may be used as input to multiple steps, provided it is + * read-only in every step. + * + * Workflow steps which modify a file must produce the modified file + * as output. Downstream steps which futher process the file must + * use the output of previous steps, and not refer to a common input + * (this is necessary for both ordering and correctness). + * + * Workflow authors should provide this in the `hints` section. The + * intent of this feature is that workflows produce the same results + * whether or not InplaceUpdateRequirement is supported by the + * implementation, and this feature is primarily available as an + * optimization for particular environments. + * + * Users and implementers should be aware that workflows that + * destructively modify inputs may not be repeatable or reproducible. + * In particular, enabling this feature implies that WorkReuse should + * not be enabled. + * + */ +export class InplaceUpdateRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'InplaceUpdateRequirement' + */ + class_: string + inplaceUpdate: boolean + + + constructor ({extensionFields, loadingOptions, class_, inplaceUpdate} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, inplaceUpdate: boolean,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.inplaceUpdate = inplaceUpdate + } + + /** + * Used to construct instances of {@link InplaceUpdateRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InplaceUpdateRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriInplaceUpdateRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let inplaceUpdate + try { + inplaceUpdate = await loadField(_doc.inplaceUpdate, LoaderInstances.booltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inplaceUpdate` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`inplaceUpdate\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InplaceUpdateRequirement'", errors) + } + + const schema = new InplaceUpdateRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + inplaceUpdate: inplaceUpdate + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.inplaceUpdate != null) { + r.inplaceUpdate = save(this.inplaceUpdate, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','inplaceUpdate']) +} diff --git a/src/inputArraySchema.ts b/src/inputArraySchema.ts new file mode 100644 index 0000000..a1a6e61 --- /dev/null +++ b/src/inputArraySchema.ts @@ -0,0 +1,230 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputArraySchema + */ +export class InputArraySchema extends Saveable implements Internal.ArraySchema, Internal.InputSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, items, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.items = items + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link InputArraySchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InputArraySchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let items + try { + items = await loadField(_doc.items, LoaderInstances.typedslunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `items` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InputArraySchema'", errors) + } + + const schema = new InputArraySchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + items: items, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.items != null) { + r.items = save(this.items, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['items','type','label','doc','name']) +} diff --git a/src/inputBinding.ts b/src/inputBinding.ts new file mode 100644 index 0000000..d89e7ea --- /dev/null +++ b/src/inputBinding.ts @@ -0,0 +1,122 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputBinding + */ +export class InputBinding extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Use of `loadContents` in `InputBinding` is deprecated. + * Preserved for v1.0 backwards compatability. Will be removed in + * CWL v2.0. Use `InputParameter.loadContents` instead. + * + */ + loadContents: undefined | boolean + + + constructor ({extensionFields, loadingOptions, loadContents} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, loadContents: undefined | boolean,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.loadContents = loadContents + } + + /** + * Used to construct instances of {@link InputBinding }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InputBinding } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`loadContents\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InputBinding'", errors) + } + + const schema = new InputBinding({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + loadContents: loadContents + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['loadContents']) +} diff --git a/src/inputEnumSchema.ts b/src/inputEnumSchema.ts new file mode 100644 index 0000000..f797030 --- /dev/null +++ b/src/inputEnumSchema.ts @@ -0,0 +1,234 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputEnumSchema + */ +export class InputEnumSchema extends Saveable implements Internal.EnumSchema, Internal.InputSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.symbols = symbols + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link InputEnumSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InputEnumSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let symbols + try { + symbols = await loadField(_doc.symbols, LoaderInstances.uriarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `symbols` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InputEnumSchema'", errors) + } + + const schema = new InputEnumSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + symbols: symbols, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.symbols != null) { + const u = saveRelativeUri(this.symbols, this.name, true, + relativeUris, undefined) + if (u != null) { + r.symbols = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['symbols','type','label','doc','name']) +} diff --git a/src/inputFormat.ts b/src/inputFormat.ts new file mode 100644 index 0000000..61e81c1 --- /dev/null +++ b/src/inputFormat.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputFormat + */ +export interface InputFormat { } + \ No newline at end of file diff --git a/src/inputParameter.ts b/src/inputParameter.ts new file mode 100644 index 0000000..a74afee --- /dev/null +++ b/src/inputParameter.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputParameter + */ +export interface InputParameter extends Internal.Parameter, Internal.InputFormat, Internal.LoadContents { } + \ No newline at end of file diff --git a/src/inputRecordField.ts b/src/inputRecordField.ts new file mode 100644 index 0000000..b72dbf7 --- /dev/null +++ b/src/inputRecordField.ts @@ -0,0 +1,409 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputRecordField + */ +export class InputRecordField extends Saveable implements Internal.RecordField, Internal.FieldBase, Internal.InputFormat, Internal.LoadContents { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + + constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.doc = doc + this.type = type + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.format = format + this.loadContents = loadContents + this.loadListing = loadListing + } + + /** + * Used to construct instances of {@link InputRecordField }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InputRecordField } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uristrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + throw new ValidationException("Missing name") + } + } else { + baseuri = name as string + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\`,\`loadContents\`,\`loadListing\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InputRecordField'", errors) + } + + const schema = new InputRecordField({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + doc: doc, + name: name, + type: type, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + format: format, + loadContents: loadContents, + loadListing: loadListing + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.name, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.name, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.name, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, this.name, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['doc','name','type','label','secondaryFiles','streamable','format','loadContents','loadListing']) +} diff --git a/src/inputRecordSchema.ts b/src/inputRecordSchema.ts new file mode 100644 index 0000000..53ea118 --- /dev/null +++ b/src/inputRecordSchema.ts @@ -0,0 +1,232 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputRecordSchema + */ +export class InputRecordSchema extends Saveable implements Internal.RecordSchema, Internal.InputSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the fields of the record. + */ + fields: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, fields, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.fields = fields + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link InputRecordSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link InputRecordSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let fields + if ('fields' in _doc) { + try { + fields = await loadField(_doc.fields, LoaderInstances.idmapfieldsunionOfundefinedtypeOrarrayOfInputRecordFieldLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `fields` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'InputRecordSchema'", errors) + } + + const schema = new InputRecordSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + fields: fields, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.fields != null) { + r.fields = save(this.fields, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['fields','type','label','doc','name']) +} diff --git a/src/inputSchema.ts b/src/inputSchema.ts new file mode 100644 index 0000000..4b16eb1 --- /dev/null +++ b/src/inputSchema.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputSchema + */ +export interface InputSchema extends Internal.IOSchema { } + \ No newline at end of file diff --git a/src/labeled.ts b/src/labeled.ts new file mode 100644 index 0000000..75eb9df --- /dev/null +++ b/src/labeled.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Labeled + */ +export interface Labeled { } + \ No newline at end of file diff --git a/src/loadContents.ts b/src/loadContents.ts new file mode 100644 index 0000000..4e0bf94 --- /dev/null +++ b/src/loadContents.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#LoadContents + */ +export interface LoadContents { } + \ No newline at end of file diff --git a/src/loadListingRequirement.ts b/src/loadListingRequirement.ts new file mode 100644 index 0000000..1ef42c2 --- /dev/null +++ b/src/loadListingRequirement.ts @@ -0,0 +1,146 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#LoadListingRequirement + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + */ +export class LoadListingRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'LoadListingRequirement' + */ + class_: string + loadListing: undefined | string + + + constructor ({extensionFields, loadingOptions, class_, loadListing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, loadListing: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.loadListing = loadListing + } + + /** + * Used to construct instances of {@link LoadListingRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link LoadListingRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriLoadListingRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`loadListing\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'LoadListingRequirement'", errors) + } + + const schema = new LoadListingRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + loadListing: loadListing + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','loadListing']) +} diff --git a/src/multipleInputFeatureRequirement.ts b/src/multipleInputFeatureRequirement.ts new file mode 100644 index 0000000..edfefd6 --- /dev/null +++ b/src/multipleInputFeatureRequirement.ts @@ -0,0 +1,125 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement + * + * Indicates that the workflow platform must support multiple inbound data links + * listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). + * + */ +export class MultipleInputFeatureRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'MultipleInputFeatureRequirement' + */ + class_: string + + + constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + } + + /** + * Used to construct instances of {@link MultipleInputFeatureRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link MultipleInputFeatureRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriMultipleInputFeatureRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'MultipleInputFeatureRequirement'", errors) + } + + const schema = new MultipleInputFeatureRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_ + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class']) +} diff --git a/src/networkAccess.ts b/src/networkAccess.ts new file mode 100644 index 0000000..a1539d8 --- /dev/null +++ b/src/networkAccess.ts @@ -0,0 +1,157 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#NetworkAccess + * + * Indicate whether a process requires outgoing IPv4/IPv6 network + * access. Choice of IPv4 or IPv6 is implementation and site + * specific, correct tools must support both. + * + * If `networkAccess` is false or not specified, tools must not + * assume network access, except for localhost (the loopback device). + * + * If `networkAccess` is true, the tool must be able to make outgoing + * connections to network resources. Resources may be on a private + * subnet or the public Internet. However, implementations and sites + * may apply their own security policies to restrict what is + * accessible by the tool. + * + * Enabling network access does not imply a publically routable IP + * address or the ability to accept inbound connections. + * + */ +export class NetworkAccess extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'NetworkAccess' + */ + class_: string + networkAccess: boolean | string + + + constructor ({extensionFields, loadingOptions, class_, networkAccess} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, networkAccess: boolean | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.networkAccess = networkAccess + } + + /** + * Used to construct instances of {@link NetworkAccess }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link NetworkAccess } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriNetworkAccess_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let networkAccess + try { + networkAccess = await loadField(_doc.networkAccess, LoaderInstances.unionOfbooltypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `networkAccess` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`networkAccess\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'NetworkAccess'", errors) + } + + const schema = new NetworkAccess({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + networkAccess: networkAccess + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.networkAccess != null) { + r.networkAccess = save(this.networkAccess, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','networkAccess']) +} diff --git a/src/operation.ts b/src/operation.ts new file mode 100644 index 0000000..6c3c7c2 --- /dev/null +++ b/src/operation.ts @@ -0,0 +1,408 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#Operation + * + * This record describes an abstract operation. It is a potential + * step of a workflow that has not yet been bound to a concrete + * implementation. It specifies an input and output signature, but + * does not provide enough information to be executed. An + * implementation (or other tooling) may provide a means of binding + * an Operation to a concrete process (such as Workflow, + * CommandLineTool, or ExpressionTool) with a compatible signature. + * + */ +export class Operation extends Saveable implements Internal.Process { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent: undefined | Array + + + constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.class_ = class_ + this.label = label + this.doc = doc + this.inputs = inputs + this.outputs = outputs + this.requirements = requirements + this.hints = hints + this.cwlVersion = cwlVersion + this.intent = intent + } + + /** + * Used to construct instances of {@link Operation }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link Operation } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriOperation_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputs + try { + inputs = await loadField(_doc.inputs, LoaderInstances.idmapinputsarrayOfOperationInputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputs` field is not valid because: ', [e]) + ) + } + } + + let outputs + try { + outputs = await loadField(_doc.outputs, LoaderInstances.idmapoutputsarrayOfOperationOutputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputs` field is not valid because: ', [e]) + ) + } + } + + let requirements + if ('requirements' in _doc) { + try { + requirements = await loadField(_doc.requirements, LoaderInstances.idmaprequirementsunionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `requirements` field is not valid because: ', [e]) + ) + } + } + } + + let hints + if ('hints' in _doc) { + try { + hints = await loadField(_doc.hints, LoaderInstances.idmaphintsunionOfundefinedtypeOrarrayOfanyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `hints` field is not valid because: ', [e]) + ) + } + } + } + + let cwlVersion + if ('cwlVersion' in _doc) { + try { + cwlVersion = await loadField(_doc.cwlVersion, LoaderInstances.uriunionOfundefinedtypeOrCWLVersionLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `cwlVersion` field is not valid because: ', [e]) + ) + } + } + } + + let intent + if ('intent' in _doc) { + try { + intent = await loadField(_doc.intent, LoaderInstances.uriunionOfundefinedtypeOrarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `intent` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'Operation'", errors) + } + + const schema = new Operation({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id, + label: label, + doc: doc, + inputs: inputs, + outputs: outputs, + requirements: requirements, + hints: hints, + cwlVersion: cwlVersion, + intent: intent, + class_: class_ + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, this.id, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.inputs != null) { + r.inputs = save(this.inputs, false, this.id, relativeUris) + } + + if (this.outputs != null) { + r.outputs = save(this.outputs, false, this.id, relativeUris) + } + + if (this.requirements != null) { + r.requirements = save(this.requirements, false, this.id, relativeUris) + } + + if (this.hints != null) { + r.hints = save(this.hints, false, this.id, relativeUris) + } + + if (this.cwlVersion != null) { + const u = saveRelativeUri(this.cwlVersion, this.id, false, + relativeUris, undefined) + if (u != null) { + r.cwlVersion = u + } + } + + if (this.intent != null) { + const u = saveRelativeUri(this.intent, this.id, true, + relativeUris, undefined) + if (u != null) { + r.intent = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id','label','doc','inputs','outputs','requirements','hints','cwlVersion','intent','class']) +} diff --git a/src/operationInputParameter.ts b/src/operationInputParameter.ts new file mode 100644 index 0000000..1ed30fc --- /dev/null +++ b/src/operationInputParameter.ts @@ -0,0 +1,440 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#OperationInputParameter + * + * Describe an input parameter of an operation. + * + */ +export class OperationInputParameter extends Saveable implements Internal.InputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_: undefined | any + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, default_: undefined | any, type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.loadContents = loadContents + this.loadListing = loadListing + this.default_ = default_ + this.type = type + } + + /** + * Used to construct instances of {@link OperationInputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link OperationInputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + let default_ + if ('default' in _doc) { + try { + default_ = await loadField(_doc.default, LoaderInstances.unionOfundefinedtypeOranyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `default` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`loadContents\`,\`loadListing\`,\`default\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'OperationInputParameter'", errors) + } + + const schema = new OperationInputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + loadContents: loadContents, + loadListing: loadListing, + default_: default_, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, this.id, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, this.id, relativeUris) + } + + if (this.default_ != null) { + r.default = save(this.default_, false, this.id, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','loadContents','loadListing','default','type']) +} diff --git a/src/operationOutputParameter.ts b/src/operationOutputParameter.ts new file mode 100644 index 0000000..7e2f882 --- /dev/null +++ b/src/operationOutputParameter.ts @@ -0,0 +1,341 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#OperationOutputParameter + * + * Describe an output parameter of an operation. + * + */ +export class OperationOutputParameter extends Saveable implements Internal.OutputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.type = type + } + + /** + * Used to construct instances of {@link OperationOutputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link OperationOutputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'OperationOutputParameter'", errors) + } + + const schema = new OperationOutputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','type']) +} diff --git a/src/outputArraySchema.ts b/src/outputArraySchema.ts new file mode 100644 index 0000000..d3a5676 --- /dev/null +++ b/src/outputArraySchema.ts @@ -0,0 +1,230 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputArraySchema + */ +export class OutputArraySchema extends Saveable implements Internal.ArraySchema, Internal.OutputSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, items, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.items = items + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link OutputArraySchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link OutputArraySchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let items + try { + items = await loadField(_doc.items, LoaderInstances.typedslunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `items` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'OutputArraySchema'", errors) + } + + const schema = new OutputArraySchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + items: items, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.items != null) { + r.items = save(this.items, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['items','type','label','doc','name']) +} diff --git a/src/outputEnumSchema.ts b/src/outputEnumSchema.ts new file mode 100644 index 0000000..d2ee07e --- /dev/null +++ b/src/outputEnumSchema.ts @@ -0,0 +1,234 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputEnumSchema + */ +export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, Internal.OutputSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.symbols = symbols + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link OutputEnumSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link OutputEnumSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let symbols + try { + symbols = await loadField(_doc.symbols, LoaderInstances.uriarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `symbols` field is not valid because: ', [e]) + ) + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'OutputEnumSchema'", errors) + } + + const schema = new OutputEnumSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + symbols: symbols, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.symbols != null) { + const u = saveRelativeUri(this.symbols, this.name, true, + relativeUris, undefined) + if (u != null) { + r.symbols = u + } + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['symbols','type','label','doc','name']) +} diff --git a/src/outputFormat.ts b/src/outputFormat.ts new file mode 100644 index 0000000..930a277 --- /dev/null +++ b/src/outputFormat.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputFormat + */ +export interface OutputFormat { } + \ No newline at end of file diff --git a/src/outputParameter.ts b/src/outputParameter.ts new file mode 100644 index 0000000..3d8b5c8 --- /dev/null +++ b/src/outputParameter.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputParameter + */ +export interface OutputParameter extends Internal.Parameter, Internal.OutputFormat { } + \ No newline at end of file diff --git a/src/outputRecordField.ts b/src/outputRecordField.ts new file mode 100644 index 0000000..2eb685b --- /dev/null +++ b/src/outputRecordField.ts @@ -0,0 +1,339 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputRecordField + */ +export class OutputRecordField extends Saveable implements Internal.RecordField, Internal.FieldBase, Internal.OutputFormat { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format: undefined | string + + + constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.doc = doc + this.type = type + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.format = format + } + + /** + * Used to construct instances of {@link OutputRecordField }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link OutputRecordField } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uristrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + throw new ValidationException("Missing name") + } + } else { + baseuri = name as string + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'OutputRecordField'", errors) + } + + const schema = new OutputRecordField({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + doc: doc, + name: name, + type: type, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + format: format + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.name, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.name, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.name, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['doc','name','type','label','secondaryFiles','streamable','format']) +} diff --git a/src/outputRecordSchema.ts b/src/outputRecordSchema.ts new file mode 100644 index 0000000..0178c52 --- /dev/null +++ b/src/outputRecordSchema.ts @@ -0,0 +1,232 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputRecordSchema + */ +export class OutputRecordSchema extends Saveable implements Internal.RecordSchema, Internal.OutputSchema { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The identifier for this type + */ + name: undefined | string + + /** + * Defines the fields of the record. + */ + fields: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + + constructor ({extensionFields, loadingOptions, name, fields, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.fields = fields + this.type = type + this.label = label + this.doc = doc + } + + /** + * Used to construct instances of {@link OutputRecordSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link OutputRecordSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + name = "_" + uuidv4() + } + } else { + baseuri = name as string + } + + let fields + if ('fields' in _doc) { + try { + fields = await loadField(_doc.fields, LoaderInstances.idmapfieldsunionOfundefinedtypeOrarrayOfOutputRecordFieldLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `fields` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'OutputRecordSchema'", errors) + } + + const schema = new OutputRecordSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + fields: fields, + type: type, + label: label, + doc: doc, + name: name + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.fields != null) { + r.fields = save(this.fields, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.name, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['fields','type','label','doc','name']) +} diff --git a/src/outputSchema.ts b/src/outputSchema.ts new file mode 100644 index 0000000..2941d11 --- /dev/null +++ b/src/outputSchema.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputSchema + */ +export interface OutputSchema extends Internal.IOSchema { } + \ No newline at end of file diff --git a/src/parameter.ts b/src/parameter.ts new file mode 100644 index 0000000..54f8804 --- /dev/null +++ b/src/parameter.ts @@ -0,0 +1,12 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Parameter + * + * Define an input or output parameter to a process. + * + */ +export interface Parameter extends Internal.FieldBase, Internal.Documented, Internal.Identified { } + \ No newline at end of file diff --git a/src/process.ts b/src/process.ts new file mode 100644 index 0000000..e9b51ae --- /dev/null +++ b/src/process.ts @@ -0,0 +1,15 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Process + * + * + * The base executable type in CWL is the `Process` object defined by the + * document. Note that the `Process` object is abstract and cannot be + * directly executed. + * + */ +export interface Process extends Internal.Identified, Internal.Labeled, Internal.Documented { } + \ No newline at end of file diff --git a/src/processRequirement.ts b/src/processRequirement.ts new file mode 100644 index 0000000..c30061e --- /dev/null +++ b/src/processRequirement.ts @@ -0,0 +1,17 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ProcessRequirement + * + * A process requirement declares a prerequisite that may or must be fulfilled + * before executing a process. See [`Process.hints`](#process) and + * [`Process.requirements`](#process). + * + * Process requirements are the primary mechanism for specifying extensions to + * the CWL core specification. + * + */ +export interface ProcessRequirement { } + \ No newline at end of file diff --git a/src/recordField.ts b/src/recordField.ts new file mode 100644 index 0000000..86d990a --- /dev/null +++ b/src/recordField.ts @@ -0,0 +1,186 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/salad#RecordField + * + * A field of a record. + */ +export class RecordField extends Saveable implements Internal.Documented { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + + + constructor ({extensionFields, loadingOptions, name, doc, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.name = name + this.doc = doc + this.type = type + } + + /** + * Used to construct instances of {@link RecordField }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link RecordField } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let name + if ('name' in _doc) { + try { + name = await loadField(_doc.name, LoaderInstances.uristrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `name` field is not valid because: ', [e]) + ) + } + } + } + + const originalnameIsUndefined = (name === undefined) + if (originalnameIsUndefined ) { + if (docRoot != null) { + name = docRoot + } else { + throw new ValidationException("Missing name") + } + } else { + baseuri = name as string + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`doc\`,\`name\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'RecordField'", errors) + } + + const schema = new RecordField({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + doc: doc, + name: name, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.name != null) { + const u = saveRelativeUri(this.name, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.name = u + } + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.name, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.name, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['doc','name','type']) +} diff --git a/src/recordSchema.ts b/src/recordSchema.ts new file mode 100644 index 0000000..3bcbb1a --- /dev/null +++ b/src/recordSchema.ts @@ -0,0 +1,142 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/salad#RecordSchema + */ +export class RecordSchema extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Defines the fields of the record. + */ + fields: undefined | Array + + /** + * Must be `record` + */ + type: string + + + constructor ({extensionFields, loadingOptions, fields, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.fields = fields + this.type = type + } + + /** + * Used to construct instances of {@link RecordSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link RecordSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let fields + if ('fields' in _doc) { + try { + fields = await loadField(_doc.fields, LoaderInstances.idmapfieldsunionOfundefinedtypeOrarrayOfRecordFieldLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `fields` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`fields\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'RecordSchema'", errors) + } + + const schema = new RecordSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + fields: fields, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.fields != null) { + r.fields = save(this.fields, false, baseUrl, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['fields','type']) +} diff --git a/src/resourceRequirement.ts b/src/resourceRequirement.ts new file mode 100644 index 0000000..edb9644 --- /dev/null +++ b/src/resourceRequirement.ts @@ -0,0 +1,406 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#ResourceRequirement + * + * Specify basic hardware resource requirements. + * + * "min" is the minimum amount of a resource that must be reserved to + * schedule a job. If "min" cannot be satisfied, the job should not + * be run. + * + * "max" is the maximum amount of a resource that the job shall be + * allocated. If a node has sufficient resources, multiple jobs may + * be scheduled on a single node provided each job's "max" resource + * requirements are met. If a job attempts to exceed its resource + * allocation, an implementation may deny additional resources, which + * may result in job failure. + * + * If both "min" and "max" are specified, an implementation may + * choose to allocate any amount between "min" and "max", with the + * actual allocation provided in the `runtime` object. + * + * If "min" is specified but "max" is not, then "max" == "min" + * If "max" is specified by "min" is not, then "min" == "max". + * + * It is an error if max < min. + * + * It is an error if the value of any of these fields is negative. + * + * If neither "min" nor "max" is specified for a resource, use the default values below. + * + */ +export class ResourceRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'ResourceRequirement' + */ + class_: string + + /** + * Minimum reserved number of CPU cores (default is 1). + * + * May be a fractional value to indicate to a scheduling + * algorithm that one core can be allocated to multiple + * jobs. For example, a value of 0.25 indicates that up to 4 + * jobs may run in parallel on 1 core. A value of 1.25 means + * that up to 3 jobs can run on a 4 core system (4/1.25 ≈ 3). + * + * Processes can only share a core allocation if the sum of each + * of their `ramMax`, `tmpdirMax`, and `outdirMax` requests also + * do not exceed the capacity of the node. + * + * Processes sharing a core must have the same level of isolation + * (typically a container or VM) that they would normally. + * + * The reported number of CPU cores reserved for the process, + * which is available to expressions on the CommandLineTool as + * `runtime.cores`, must be a non-zero integer, and may be + * calculated by rounding up the cores request to the next whole + * number. + * + * Scheduling systems may allocate fractional CPU resources by + * setting quotas or scheduling weights. Scheduling systems that + * do not support fractional CPUs may round up the request to the + * next whole number. + * + */ + coresMin: undefined | number | string + + /** + * Maximum reserved number of CPU cores. + * + * See `coresMin` for discussion about fractional CPU requests. + * + */ + coresMax: undefined | number | string + + /** + * Minimum reserved RAM in mebibytes (2**20) (default is 256) + * + * May be a fractional value. If so, the actual RAM request must + * be rounded up to the next whole number. The reported amount of + * RAM reserved for the process, which is available to + * expressions on the CommandLineTool as `runtime.ram`, must be a + * non-zero integer. + * + */ + ramMin: undefined | number | string + + /** + * Maximum reserved RAM in mebibytes (2**20) + * + * See `ramMin` for discussion about fractional RAM requests. + * + */ + ramMax: undefined | number | string + + /** + * Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) (default is 1024) + * + * May be a fractional value. If so, the actual storage request + * must be rounded up to the next whole number. The reported + * amount of storage reserved for the process, which is available + * to expressions on the CommandLineTool as `runtime.tmpdirSize`, + * must be a non-zero integer. + * + */ + tmpdirMin: undefined | number | string + + /** + * Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) + * + * See `tmpdirMin` for discussion about fractional storage requests. + * + */ + tmpdirMax: undefined | number | string + + /** + * Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) (default is 1024) + * + * May be a fractional value. If so, the actual storage request + * must be rounded up to the next whole number. The reported + * amount of storage reserved for the process, which is available + * to expressions on the CommandLineTool as `runtime.outdirSize`, + * must be a non-zero integer. + * + */ + outdirMin: undefined | number | string + + /** + * Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) + * + * See `outdirMin` for discussion about fractional storage requests. + * + */ + outdirMax: undefined | number | string + + + constructor ({extensionFields, loadingOptions, class_, coresMin, coresMax, ramMin, ramMax, tmpdirMin, tmpdirMax, outdirMin, outdirMax} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, coresMin: undefined | number | string, coresMax: undefined | number | string, ramMin: undefined | number | string, ramMax: undefined | number | string, tmpdirMin: undefined | number | string, tmpdirMax: undefined | number | string, outdirMin: undefined | number | string, outdirMax: undefined | number | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.coresMin = coresMin + this.coresMax = coresMax + this.ramMin = ramMin + this.ramMax = ramMax + this.tmpdirMin = tmpdirMin + this.tmpdirMax = tmpdirMax + this.outdirMin = outdirMin + this.outdirMax = outdirMax + } + + /** + * Used to construct instances of {@link ResourceRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ResourceRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriResourceRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let coresMin + if ('coresMin' in _doc) { + try { + coresMin = await loadField(_doc.coresMin, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `coresMin` field is not valid because: ', [e]) + ) + } + } + } + + let coresMax + if ('coresMax' in _doc) { + try { + coresMax = await loadField(_doc.coresMax, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `coresMax` field is not valid because: ', [e]) + ) + } + } + } + + let ramMin + if ('ramMin' in _doc) { + try { + ramMin = await loadField(_doc.ramMin, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `ramMin` field is not valid because: ', [e]) + ) + } + } + } + + let ramMax + if ('ramMax' in _doc) { + try { + ramMax = await loadField(_doc.ramMax, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `ramMax` field is not valid because: ', [e]) + ) + } + } + } + + let tmpdirMin + if ('tmpdirMin' in _doc) { + try { + tmpdirMin = await loadField(_doc.tmpdirMin, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `tmpdirMin` field is not valid because: ', [e]) + ) + } + } + } + + let tmpdirMax + if ('tmpdirMax' in _doc) { + try { + tmpdirMax = await loadField(_doc.tmpdirMax, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `tmpdirMax` field is not valid because: ', [e]) + ) + } + } + } + + let outdirMin + if ('outdirMin' in _doc) { + try { + outdirMin = await loadField(_doc.outdirMin, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outdirMin` field is not valid because: ', [e]) + ) + } + } + } + + let outdirMax + if ('outdirMax' in _doc) { + try { + outdirMax = await loadField(_doc.outdirMax, LoaderInstances.unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outdirMax` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`coresMin\`,\`coresMax\`,\`ramMin\`,\`ramMax\`,\`tmpdirMin\`,\`tmpdirMax\`,\`outdirMin\`,\`outdirMax\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ResourceRequirement'", errors) + } + + const schema = new ResourceRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + coresMin: coresMin, + coresMax: coresMax, + ramMin: ramMin, + ramMax: ramMax, + tmpdirMin: tmpdirMin, + tmpdirMax: tmpdirMax, + outdirMin: outdirMin, + outdirMax: outdirMax + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.coresMin != null) { + r.coresMin = save(this.coresMin, false, baseUrl, relativeUris) + } + + if (this.coresMax != null) { + r.coresMax = save(this.coresMax, false, baseUrl, relativeUris) + } + + if (this.ramMin != null) { + r.ramMin = save(this.ramMin, false, baseUrl, relativeUris) + } + + if (this.ramMax != null) { + r.ramMax = save(this.ramMax, false, baseUrl, relativeUris) + } + + if (this.tmpdirMin != null) { + r.tmpdirMin = save(this.tmpdirMin, false, baseUrl, relativeUris) + } + + if (this.tmpdirMax != null) { + r.tmpdirMax = save(this.tmpdirMax, false, baseUrl, relativeUris) + } + + if (this.outdirMin != null) { + r.outdirMin = save(this.outdirMin, false, baseUrl, relativeUris) + } + + if (this.outdirMax != null) { + r.outdirMax = save(this.outdirMax, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','coresMin','coresMax','ramMin','ramMax','tmpdirMin','tmpdirMax','outdirMin','outdirMax']) +} diff --git a/src/scatterFeatureRequirement.ts b/src/scatterFeatureRequirement.ts new file mode 100644 index 0000000..190bc59 --- /dev/null +++ b/src/scatterFeatureRequirement.ts @@ -0,0 +1,125 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#ScatterFeatureRequirement + * + * Indicates that the workflow platform must support the `scatter` and + * `scatterMethod` fields of [WorkflowStep](#WorkflowStep). + * + */ +export class ScatterFeatureRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'ScatterFeatureRequirement' + */ + class_: string + + + constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + } + + /** + * Used to construct instances of {@link ScatterFeatureRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ScatterFeatureRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriScatterFeatureRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ScatterFeatureRequirement'", errors) + } + + const schema = new ScatterFeatureRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_ + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class']) +} diff --git a/src/schemaDefRequirement.ts b/src/schemaDefRequirement.ts new file mode 100644 index 0000000..b89f289 --- /dev/null +++ b/src/schemaDefRequirement.ts @@ -0,0 +1,158 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#SchemaDefRequirement + * + * This field consists of an array of type definitions which must be used when + * interpreting the `inputs` and `outputs` fields. When a `type` field + * contains a IRI, the implementation must check if the type is defined in + * `schemaDefs` and use that definition. If the type is not found in + * `schemaDefs`, it is an error. The entries in `schemaDefs` must be + * processed in the order listed such that later schema definitions may refer + * to earlier schema definitions. + * + * - **Type definitions are allowed for `enum` and `record` types only.** + * - Type definitions may be shared by defining them in a file and then + * `$include`-ing them in the `types` field. + * - A file can contain a list of type definitions + * + */ +export class SchemaDefRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'SchemaDefRequirement' + */ + class_: string + + /** + * The list of type definitions. + */ + types: Array + + + constructor ({extensionFields, loadingOptions, class_, types} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, types: Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.types = types + } + + /** + * Used to construct instances of {@link SchemaDefRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link SchemaDefRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriSchemaDefRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let types + try { + types = await loadField(_doc.types, LoaderInstances.arrayOfunionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `types` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`types\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'SchemaDefRequirement'", errors) + } + + const schema = new SchemaDefRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + types: types + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.types != null) { + r.types = save(this.types, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','types']) +} diff --git a/src/secondaryFileSchema.ts b/src/secondaryFileSchema.ts new file mode 100644 index 0000000..b9ba4be --- /dev/null +++ b/src/secondaryFileSchema.ts @@ -0,0 +1,210 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#SecondaryFileSchema + * + * Secondary files are specified using the following micro-DSL for secondary files: + * + * * If the value is a string, it is transformed to an object with two fields + * `pattern` and `required` + * * By default, the value of `required` is `null` + * (this indicates default behavior, which may be based on the context) + * * If the value ends with a question mark `?` the question mark is + * stripped off and the value of the field `required` is set to `False` + * * The remaining value is assigned to the field `pattern` + * + * For implementation details and examples, please see + * [this section](SchemaSalad.html#Domain_Specific_Language_for_secondary_files) + * in the Schema Salad specification. + * + */ +export class SecondaryFileSchema extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Provides a pattern or expression specifying files or directories that + * should be included alongside the primary file. + * + * If the value is an expression, the value of `self` in the + * expression must be the primary input or output File object to + * which this binding applies. The `basename`, `nameroot` and + * `nameext` fields must be present in `self`. For + * `CommandLineTool` inputs the `location` field must also be + * present. For `CommandLineTool` outputs the `path` field must + * also be present. If secondary files were included on an input + * File object as part of the Process invocation, they must also + * be present in `secondaryFiles` on `self`. + * + * The expression must return either: a filename string relative + * to the path to the primary File, a File or Directory object + * (`class: File` or `class: Directory`) with either `location` + * (for inputs) or `path` (for outputs) and `basename` fields + * set, or an array consisting of strings or File or Directory + * objects as previously described. + * + * It is legal to use `location` from a File or Directory object + * passed in as input, including `location` from secondary files + * on `self`. If an expression returns a File object with the + * same `location` but a different `basename` as a secondary file + * that was passed in, the expression result takes precedence. + * Setting the basename with an expression this way affects the + * `path` where the secondary file will be staged to in the + * CommandLineTool. + * + * The expression may return "null" in which case there is no + * secondary file from that expression. + * + * To work on non-filename-preserving storage systems, portable + * tool descriptions should treat `location` as an opaque + * identifier and avoid constructing new values from `location`, + * but should construct relative references using `basename` or + * `nameroot` instead, or propagate `location` from defined inputs. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + pattern: string + + /** + * An implementation must not fail workflow execution if `required` is + * set to `false` and the expected secondary file does not exist. + * Default value for `required` field is `true` for secondary files on + * input and `false` for secondary files on output. + * + */ + required: undefined | boolean | string + + + constructor ({extensionFields, loadingOptions, pattern, required} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, pattern: string, required: undefined | boolean | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.pattern = pattern + this.required = required + } + + /** + * Used to construct instances of {@link SecondaryFileSchema }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link SecondaryFileSchema } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let pattern + try { + pattern = await loadField(_doc.pattern, LoaderInstances.unionOfstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `pattern` field is not valid because: ', [e]) + ) + } + } + + let required + if ('required' in _doc) { + try { + required = await loadField(_doc.required, LoaderInstances.unionOfundefinedtypeOrbooltypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `required` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`pattern\`,\`required\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'SecondaryFileSchema'", errors) + } + + const schema = new SecondaryFileSchema({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + pattern: pattern, + required: required + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.pattern != null) { + r.pattern = save(this.pattern, false, baseUrl, relativeUris) + } + + if (this.required != null) { + r.required = save(this.required, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['pattern','required']) +} diff --git a/src/shellCommandRequirement.ts b/src/shellCommandRequirement.ts new file mode 100644 index 0000000..4a07c35 --- /dev/null +++ b/src/shellCommandRequirement.ts @@ -0,0 +1,130 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#ShellCommandRequirement + * + * Modify the behavior of CommandLineTool to generate a single string + * containing a shell command line. Each item in the argument list must be + * joined into a string separated by single spaces and quoted to prevent + * intepretation by the shell, unless `CommandLineBinding` for that argument + * contains `shellQuote: false`. If `shellQuote: false` is specified, the + * argument is joined into the command string without quoting, which allows + * the use of shell metacharacters such as `|` for pipes. + * + */ +export class ShellCommandRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'ShellCommandRequirement' + */ + class_: string + + + constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + } + + /** + * Used to construct instances of {@link ShellCommandRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ShellCommandRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriShellCommandRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ShellCommandRequirement'", errors) + } + + const schema = new ShellCommandRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_ + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class']) +} diff --git a/src/sink.ts b/src/sink.ts new file mode 100644 index 0000000..9cdbb37 --- /dev/null +++ b/src/sink.ts @@ -0,0 +1,9 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Sink + */ +export interface Sink { } + \ No newline at end of file diff --git a/src/softwarePackage.ts b/src/softwarePackage.ts new file mode 100644 index 0000000..dfc2f32 --- /dev/null +++ b/src/softwarePackage.ts @@ -0,0 +1,217 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#SoftwarePackage + */ +export class SoftwarePackage extends Saveable { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The name of the software to be made available. If the name is + * common, inconsistent, or otherwise ambiguous it should be combined with + * one or more identifiers in the `specs` field. + * + */ + package_: string + + /** + * The (optional) versions of the software that are known to be + * compatible. + * + */ + version: undefined | Array + + /** + * One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s + * identifying resources for installing or enabling the software named in + * the `package` field. Implementations may provide resolvers which map + * these software identifer IRIs to some configuration action; or they can + * use only the name from the `package` field on a best effort basis. + * + * For example, the IRI https://packages.debian.org/bowtie could + * be resolved with `apt-get install bowtie`. The IRI + * https://anaconda.org/bioconda/bowtie could be resolved with `conda + * install -c bioconda bowtie`. + * + * IRIs can also be system independent and used to map to a specific + * software installation or selection mechanism. + * Using [RRID](https://www.identifiers.org/rrid/) as an example: + * https://identifiers.org/rrid/RRID:SCR_005476 + * could be fulfilled using the above mentioned Debian or bioconda + * package, a local installation managed by [Environment Modules](http://modules.sourceforge.net/), + * or any other mechanism the platform chooses. IRIs can also be from + * identifer sources that are discipline specific yet still system + * independent. As an example, the equivalent [ELIXIR Tools and Data + * Service Registry](https://bio.tools) IRI to the previous RRID example is + * https://bio.tools/tool/bowtie2/version/2.2.8. + * If supported by a given registry, implementations are encouraged to + * query these system independent sofware identifier IRIs directly for + * links to packaging systems. + * + * A site specific IRI can be listed as well. For example, an academic + * computing cluster using Environment Modules could list the IRI + * `https://hpc.example.edu/modules/bowtie-tbb/1.22` to indicate that + * `module load bowtie-tbb/1.1.2` should be executed to make available + * `bowtie` version 1.1.2 compiled with the TBB library prior to running + * the accompanying Workflow or CommandLineTool. Note that the example IRI + * is specific to a particular institution and computing environment as + * the Environment Modules system does not have a common namespace or + * standardized naming convention. + * + * This last example is the least portable and should only be used if + * mechanisms based off of the `package` field or more generic IRIs are + * unavailable or unsuitable. While harmless to other sites, site specific + * software IRIs should be left out of shared CWL descriptions to avoid + * clutter. + * + */ + specs: undefined | Array + + + constructor ({extensionFields, loadingOptions, package_, version, specs} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, package_: string, version: undefined | Array, specs: undefined | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.package_ = package_ + this.version = version + this.specs = specs + } + + /** + * Used to construct instances of {@link SoftwarePackage }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link SoftwarePackage } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let package_ + try { + package_ = await loadField(_doc.package, LoaderInstances.strtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `package` field is not valid because: ', [e]) + ) + } + } + + let version + if ('version' in _doc) { + try { + version = await loadField(_doc.version, LoaderInstances.unionOfundefinedtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `version` field is not valid because: ', [e]) + ) + } + } + } + + let specs + if ('specs' in _doc) { + try { + specs = await loadField(_doc.specs, LoaderInstances.uriunionOfundefinedtypeOrarrayOfstrtypeFalseFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `specs` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`package\`,\`version\`,\`specs\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'SoftwarePackage'", errors) + } + + const schema = new SoftwarePackage({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + package_: package_, + version: version, + specs: specs + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.package_ != null) { + r.package = save(this.package_, false, baseUrl, relativeUris) + } + + if (this.version != null) { + r.version = save(this.version, false, baseUrl, relativeUris) + } + + if (this.specs != null) { + const u = saveRelativeUri(this.specs, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.specs = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['package','version','specs']) +} diff --git a/src/softwareRequirement.ts b/src/softwareRequirement.ts new file mode 100644 index 0000000..7bec1f6 --- /dev/null +++ b/src/softwareRequirement.ts @@ -0,0 +1,148 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#SoftwareRequirement + * + * A list of software packages that should be configured in the environment of + * the defined process. + * + */ +export class SoftwareRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'SoftwareRequirement' + */ + class_: string + + /** + * The list of software to be configured. + */ + packages: Array + + + constructor ({extensionFields, loadingOptions, class_, packages} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, packages: Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.packages = packages + } + + /** + * Used to construct instances of {@link SoftwareRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link SoftwareRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriSoftwareRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let packages + try { + packages = await loadField(_doc.packages, LoaderInstances.idmappackagesarrayOfSoftwarePackageLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `packages` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`packages\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'SoftwareRequirement'", errors) + } + + const schema = new SoftwareRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + packages: packages + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.packages != null) { + r.packages = save(this.packages, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','packages']) +} diff --git a/src/stepInputExpressionRequirement.ts b/src/stepInputExpressionRequirement.ts new file mode 100644 index 0000000..45fe874 --- /dev/null +++ b/src/stepInputExpressionRequirement.ts @@ -0,0 +1,125 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#StepInputExpressionRequirement + * + * Indicate that the workflow platform must support the `valueFrom` field + * of [WorkflowStepInput](#WorkflowStepInput). + * + */ +export class StepInputExpressionRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'StepInputExpressionRequirement' + */ + class_: string + + + constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + } + + /** + * Used to construct instances of {@link StepInputExpressionRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link StepInputExpressionRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriStepInputExpressionRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'StepInputExpressionRequirement'", errors) + } + + const schema = new StepInputExpressionRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_ + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class']) +} diff --git a/src/subworkflowFeatureRequirement.ts b/src/subworkflowFeatureRequirement.ts new file mode 100644 index 0000000..d84b5a9 --- /dev/null +++ b/src/subworkflowFeatureRequirement.ts @@ -0,0 +1,125 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement + * + * Indicates that the workflow platform must support nested workflows in + * the `run` field of [WorkflowStep](#WorkflowStep). + * + */ +export class SubworkflowFeatureRequirement extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'SubworkflowFeatureRequirement' + */ + class_: string + + + constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + } + + /** + * Used to construct instances of {@link SubworkflowFeatureRequirement }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link SubworkflowFeatureRequirement } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriSubworkflowFeatureRequirement_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'SubworkflowFeatureRequirement'", errors) + } + + const schema = new SubworkflowFeatureRequirement({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_ + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class']) +} diff --git a/src/test/anyLoader.spec.ts b/src/test/anyLoader.spec.ts new file mode 100644 index 0000000..daab58c --- /dev/null +++ b/src/test/anyLoader.spec.ts @@ -0,0 +1,23 @@ +import chai from 'chai' +import chaiAsPromised from 'chai-as-promised' + +import { _AnyLoader, LoadingOptions } from '../util/internal' + +chai.use(chaiAsPromised) +const assert = chai.assert + +const loader = new _AnyLoader() + +describe('Test AnyLoader', () => { + it('Should load the documents', async () => { + assert.deepEqual(await loader.load({}, '', new LoadingOptions({})), {}) + assert.equal(await loader.load(2, '', new LoadingOptions({})), 2) + assert.equal(await loader.load('2', '', new LoadingOptions({})), '2') + assert.deepEqual(await loader.load([2], '', new LoadingOptions({})), [2]) + }) + + it('Should throw an exception on null-like input', async () => { + await assert.isRejected(loader.load(undefined, '', new LoadingOptions({})), 'Expected non-null') + await assert.isRejected(loader.load(null, '', new LoadingOptions({})), 'Expected non-null') + }) +}) diff --git a/src/test/data/hellofield.yml b/src/test/data/hellofield.yml new file mode 100644 index 0000000..84a3829 --- /dev/null +++ b/src/test/data/hellofield.yml @@ -0,0 +1,5 @@ +{ +"name": "hello", +"doc": {"$include": "test.txt"}, +"type": "string" +} \ No newline at end of file diff --git a/src/test/data/test.txt b/src/test/data/test.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/src/test/data/test.txt @@ -0,0 +1 @@ +test diff --git a/src/test/fetcher.spec.ts b/src/test/fetcher.spec.ts new file mode 100644 index 0000000..291eb83 --- /dev/null +++ b/src/test/fetcher.spec.ts @@ -0,0 +1,78 @@ +import { assert } from 'chai' +import { DefaultFetcher, ValidationException } from '../util/internal' +import sinon from 'sinon' +import * as fetchModule from 'node-fetch' +import { Response } from 'node-fetch' +import path from 'path' +import URL from 'url' + +describe('Test Fetcher', () => { + const fet = new DefaultFetcher() + describe('Test fetchText()', () => { + afterEach(function () { + sinon.restore() + }) + + it('Should fetch text from http urls', async () => { + sinon.stub(fetchModule, 'default').returns(new Promise((resolve) => resolve(new Response('test', { status: 200 })))) + assert.equal(await fet.fetchText('http://www.example.com'), 'test') + }) + + it('Should fetch text from https urls', async () => { + sinon.stub(fetchModule, 'default').returns(new Promise((resolve) => resolve(new Response('test', { status: 200 })))) + assert.equal(await fet.fetchText('https://www.example.com'), 'test') + }) + + it('Should fetch text from files', async () => { + const filepath = URL.pathToFileURL(path.resolve('./src/test/data/test.txt')).toString() + assert.equal(await fet.fetchText(filepath), 'test\n') + }) + + it('Throw a 404 exception', async () => { + sinon.stub(fetchModule, 'default').returns(new Promise((resolve) => resolve(new Response('test', { status: 404 })))) + let err + try { + await fet.fetchText('https://www.example.com') + } catch (e) { + err = e + } + assert.exists(err) + assert.isTrue(err instanceof ValidationException) + assert.equal((err as ValidationException).message, 'Error fetching https://www.example.com: HTTP Error Response: 404 Not Found') + }) + + it('Throw an invalid schema exception', async () => { + let err + try { + await fet.fetchText('invalidscheme://www.example.com') + } catch (e) { + err = e + } + assert.exists(err) + assert.isTrue(err instanceof ValidationException) + assert.equal((err as ValidationException).message, 'Unsupported scheme invalidscheme in url: invalidscheme://www.example.com') + }) + }) + + describe('Test urlJoin()', () => { + it('Should correctly join urls', async () => { + assert.equal(fet.urljoin('http://example.com/base', 'one'), 'http://example.com/one') + assert.equal(fet.urljoin('http://example.com/base', 'two'), 'http://example.com/two') + assert.equal(fet.urljoin('http://example.com/base', '#three'), 'http://example.com/base#three') + assert.equal(fet.urljoin('http://example.com/base', 'four#five'), 'http://example.com/four#five') + assert.equal(fet.urljoin('http://example.com/base', '_:five'), '_:five') + }) + + it('Should throw a remote exploit exception', async () => { + let err + try { + fet.urljoin('http://example.com/base', 'file:///test/test.txt') + } catch (e) { + err = e + } + assert.exists(err) + assert.isTrue(err instanceof ValidationException) + assert.equal((err as ValidationException).message, 'Not resolving potential remote exploit file:///test/test.txt from base http://example.com/base') + }) + }) +}) diff --git a/src/test/idMap.spec.ts b/src/test/idMap.spec.ts new file mode 100644 index 0000000..42c0645 --- /dev/null +++ b/src/test/idMap.spec.ts @@ -0,0 +1,44 @@ +import { assert } from 'chai' +import { _IdMapLoader, Loader, LoadingOptions, ValidationException } from '../util/internal' + +class TestLoader implements Loader { + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string | undefined): Promise { + return doc + } +} +const testLoader = new TestLoader() + +describe('Test IdMapLoader', () => { + describe('load', () => { + it('should load the document', async () => { + const loader = new _IdMapLoader(testLoader, 'key', 'value') + const doc = { + shaggy: { + value: 'scooby' + }, + fred: 'daphne', + velma: ['fred', 'candy'] + } + assert.deepEqual(await loader.load(doc, '', new LoadingOptions({})), [ + { value: 'daphne', key: 'fred' }, + { value: 'scooby', key: 'shaggy' }, + { value: ['fred', 'candy'], key: 'velma' } + ]) + }) + it('should throw a ValidationException with the message "No mapPredicate"', async () => { + const loader = new _IdMapLoader(testLoader, 'key') + const doc = { + fred: 'daphne' + } + let err + try { + await loader.load(doc, '', new LoadingOptions({})) + } catch (e) { + err = e + } + assert.exists(err) + assert.isTrue(err instanceof ValidationException) + assert.equal((err as ValidationException).message, 'No mapPredicate') + }) + }) +}) diff --git a/src/test/typeguards.spec.ts b/src/test/typeguards.spec.ts new file mode 100644 index 0000000..45554bf --- /dev/null +++ b/src/test/typeguards.spec.ts @@ -0,0 +1,98 @@ +import { assert } from 'chai' +import { TypeGuards } from '../util/internal' + +describe('Test Typeguards', () => { + describe('Int', () => { + it('Should return true', () => { + assert.equal(TypeGuards.Int(2), true) + assert.equal(TypeGuards.Int(0), true) + }) + + it('Should return false', () => { + assert.equal(TypeGuards.Int(2.2), false) + assert.equal(TypeGuards.Int('2.2'), false) + assert.equal(TypeGuards.Int([2]), false) + assert.equal(TypeGuards.Int({}), false) + assert.equal(TypeGuards.Int(null), false) + assert.equal(TypeGuards.Int(undefined), false) + }) + }) + describe('Float', () => { + it('Should return true', () => { + assert.equal(TypeGuards.Float(2.0), true) + assert.equal(TypeGuards.Float(2), true) + assert.equal(TypeGuards.Float(0), true) + }) + + it('Should return false', () => { + assert.equal(TypeGuards.Float([2]), false) + assert.equal(TypeGuards.Float('2.2'), false) + assert.equal(TypeGuards.Float({}), false) + assert.equal(TypeGuards.Float(null), false) + assert.equal(TypeGuards.Float(undefined), false) + }) + }) + + describe('Bool', () => { + it('Should return true', () => { + assert.equal(TypeGuards.Bool(true), true) + assert.equal(TypeGuards.Bool(false), true) + }) + + it('Should return false', () => { + assert.equal(TypeGuards.Bool([1]), false) + assert.equal(TypeGuards.Bool('1'), false) + assert.equal(TypeGuards.Bool(1), false) + assert.equal(TypeGuards.Bool({}), false) + assert.equal(TypeGuards.Bool(null), false) + assert.equal(TypeGuards.Bool(undefined), false) + }) + }) + + describe('String', () => { + it('Should return true', () => { + assert.equal(TypeGuards.String('2.2'), true) + assert.equal(TypeGuards.String(''), true) + assert.equal(TypeGuards.String('test'), true) + }) + + it('Should return false', () => { + assert.equal(TypeGuards.String([2]), false) + assert.equal(TypeGuards.String(2), false) + assert.equal(TypeGuards.String({}), false) + assert.equal(TypeGuards.String(null), false) + assert.equal(TypeGuards.String(undefined), false) + }) + }) + + describe('Undefined', () => { + it('Should return true', () => { + assert.equal(TypeGuards.Undefined(undefined), true) + }) + + it('Should return false', () => { + assert.equal(TypeGuards.Undefined([1]), false) + assert.equal(TypeGuards.Undefined('1'), false) + assert.equal(TypeGuards.Undefined(1), false) + assert.equal(TypeGuards.Undefined(1.1), false) + assert.equal(TypeGuards.Undefined({}), false) + assert.equal(TypeGuards.Undefined(null), false) + }) + }) + + describe('Dictionary', () => { + it('Should return true', () => { + assert.equal(TypeGuards.isDictionary({}), true) + assert.equal(TypeGuards.isDictionary({ test: 'test' }), true) + }) + + it('Should return false', () => { + assert.equal(TypeGuards.isDictionary([]), false) + assert.equal(TypeGuards.isDictionary('1'), false) + assert.equal(TypeGuards.isDictionary(1), false) + assert.equal(TypeGuards.isDictionary(1.1), false) + assert.equal(TypeGuards.isDictionary(undefined), false) + assert.equal(TypeGuards.isDictionary(null), false) + }) + }) +}) diff --git a/src/toolTimeLimit.ts b/src/toolTimeLimit.ts new file mode 100644 index 0000000..c02b337 --- /dev/null +++ b/src/toolTimeLimit.ts @@ -0,0 +1,155 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#ToolTimeLimit + * + * Set an upper limit on the execution time of a CommandLineTool. + * A CommandLineTool whose execution duration exceeds the time + * limit may be preemptively terminated and considered failed. + * May also be used by batch systems to make scheduling decisions. + * The execution duration excludes external operations, such as + * staging of files, pulling a docker image etc, and only counts + * wall-time for the execution of the command line itself. + * + */ +export class ToolTimeLimit extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'ToolTimeLimit' + */ + class_: string + + /** + * The time limit, in seconds. A time limit of zero means no + * time limit. Negative time limits are an error. + * + */ + timelimit: number | string + + + constructor ({extensionFields, loadingOptions, class_, timelimit} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, timelimit: number | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.timelimit = timelimit + } + + /** + * Used to construct instances of {@link ToolTimeLimit }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link ToolTimeLimit } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriToolTimeLimit_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let timelimit + try { + timelimit = await loadField(_doc.timelimit, LoaderInstances.unionOfinttypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `timelimit` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`timelimit\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'ToolTimeLimit'", errors) + } + + const schema = new ToolTimeLimit({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + timelimit: timelimit + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.timelimit != null) { + r.timelimit = save(this.timelimit, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','timelimit']) +} diff --git a/src/util/dict.ts b/src/util/dict.ts new file mode 100644 index 0000000..a3c2999 --- /dev/null +++ b/src/util/dict.ts @@ -0,0 +1,3 @@ +export interface Dictionary { + [key: string]: T +} diff --git a/src/util/fetcher.ts b/src/util/fetcher.ts new file mode 100644 index 0000000..73eb3cc --- /dev/null +++ b/src/util/fetcher.ts @@ -0,0 +1,63 @@ +import { ValidationException } from './internal' +import fetch from 'node-fetch' +import * as fs from 'fs' +import * as URI from 'uri-js' + +// Code implemented after https://github.com/common-workflow-language/schema_salad/blob/main/schema_salad/fetcher.py +export abstract class Fetcher { + abstract fetchText (url: string, contentTypes?: string[]): Promise + abstract checkExists (url: string): boolean + abstract urljoin (baseUrl: string, url: string): string + + static schemes = ['file', 'http', 'https', 'mailto'] +} + +export class DefaultFetcher extends Fetcher { + async fetchText (urlString: string): Promise { + // TODO: cache + const split = URI.parse(urlString) + const scheme = split.scheme ?? '' + if (Fetcher.schemes.includes(scheme)) { + if (['http', 'https'].includes(scheme)) { + try { + // TODO: content types + const result = await fetch(new URL(urlString)) + if (!result.ok) { + throw Error(`HTTP Error Response: ${result.status} ${result.statusText}`) + } + return await result.text() + } catch (e) { + if (e instanceof Error) { + throw new ValidationException(`Error fetching ${urlString}: ${e.message}`) + } + } + } else if (scheme === 'file') { + try { + return fs.readFileSync(split.path ?? '', { encoding: 'utf8' }) + } catch (e) { + if (e instanceof Error) { + throw new ValidationException(`Error reading file ${urlString}: ${e.message}`) + } + } + } + } + throw new ValidationException(`Unsupported scheme ${scheme} in url: ${urlString}`) + } + + checkExists (url: string): boolean { + throw new Error('Not implemented.') + } + + urljoin (baseUrlString: string, urlString: string): string { + if (urlString.startsWith('_:')) { + return urlString + } + const baseUrl = URI.parse(baseUrlString) + const url = URI.parse(urlString) + if (baseUrl.scheme != null && baseUrl.scheme !== 'file' && url.scheme === 'file') { + throw new ValidationException(`Not resolving potential remote exploit ${urlString} from base ${baseUrlString}`) + } + // TODO: Windows specific join? + return new URL(urlString, baseUrlString).toString() + } +} diff --git a/src/util/internal.ts b/src/util/internal.ts new file mode 100644 index 0000000..be74205 --- /dev/null +++ b/src/util/internal.ts @@ -0,0 +1,100 @@ +// Internal modules pattern to deal with circular dependencies +export * from './dict' +export * as TypeGuards from './typeguards' +export * from './loaders/arrayLoader' +export * from './saveable' +export * from './loaders/enumLoader' +export * from './loaders/expressionLoader' +export * from './fetcher' +export * from './loaders/idMapLoader' +export * from './loaders/loader' +export * from './loadingOptions' +export * from './loaders/anyLoader' +export * from './loaders/primitiveLoader' +export * from './loaders/recordLoader' +export * from './loaders/rootloader' +export * from './loaders/typeDSLLoader' +export * from './loaders/secondaryDSLLoader' +export * from './loaders/unionLoader' +export * from './loaders/uriLoader' +export * from './validationException' +export * from './vocabs' +export * from '../documented' +export * from '../recordField' +export * from '../recordSchema' +export * from '../enumSchema' +export * from '../arraySchema' +export * from '../file' +export * from '../directory' +export * from '../labeled' +export * from '../identified' +export * from '../loadContents' +export * from '../fieldBase' +export * from '../inputFormat' +export * from '../outputFormat' +export * from '../parameter' +export * from '../inputBinding' +export * from '../iOSchema' +export * from '../inputSchema' +export * from '../outputSchema' +export * from '../inputRecordField' +export * from '../inputRecordSchema' +export * from '../inputEnumSchema' +export * from '../inputArraySchema' +export * from '../outputRecordField' +export * from '../outputRecordSchema' +export * from '../outputEnumSchema' +export * from '../outputArraySchema' +export * from '../inputParameter' +export * from '../outputParameter' +export * from '../processRequirement' +export * from '../process' +export * from '../inlineJavascriptRequirement' +export * from '../commandInputSchema' +export * from '../schemaDefRequirement' +export * from '../secondaryFileSchema' +export * from '../loadListingRequirement' +export * from '../environmentDef' +export * from '../commandLineBinding' +export * from '../commandOutputBinding' +export * from '../commandLineBindable' +export * from '../commandInputRecordField' +export * from '../commandInputRecordSchema' +export * from '../commandInputEnumSchema' +export * from '../commandInputArraySchema' +export * from '../commandOutputRecordField' +export * from '../commandOutputRecordSchema' +export * from '../commandOutputEnumSchema' +export * from '../commandOutputArraySchema' +export * from '../commandInputParameter' +export * from '../commandOutputParameter' +export * from '../commandLineTool' +export * from '../dockerRequirement' +export * from '../softwareRequirement' +export * from '../softwarePackage' +export * from '../dirent' +export * from '../initialWorkDirRequirement' +export * from '../envVarRequirement' +export * from '../shellCommandRequirement' +export * from '../resourceRequirement' +export * from '../workReuse' +export * from '../networkAccess' +export * from '../inplaceUpdateRequirement' +export * from '../toolTimeLimit' +export * from '../expressionToolOutputParameter' +export * from '../workflowInputParameter' +export * from '../expressionTool' +export * from '../workflowOutputParameter' +export * from '../sink' +export * from '../workflowStepInput' +export * from '../workflowStepOutput' +export * from '../workflowStep' +export * from '../workflow' +export * from '../subworkflowFeatureRequirement' +export * from '../scatterFeatureRequirement' +export * from '../multipleInputFeatureRequirement' +export * from '../stepInputExpressionRequirement' +export * from '../operationInputParameter' +export * from '../operationOutputParameter' +export * from '../operation' +export * as LoaderInstances from './loaderInstances' diff --git a/src/util/loaderInstances.ts b/src/util/loaderInstances.ts new file mode 100644 index 0000000..8372905 --- /dev/null +++ b/src/util/loaderInstances.ts @@ -0,0 +1,361 @@ +import { + _AnyLoader, + _ExpressionLoader, + _PrimitiveLoader, + _UnionLoader, + _RecordLoader, + _URILoader, + _ArrayLoader, + _EnumLoader, + _IdMapLoader, + _TypeDSLLoader, + _SecondaryDSLLoader, + TypeGuards, + Documented, + RecordField, + RecordSchema, + EnumSchema, + ArraySchema, + File, + Directory, + Labeled, + Identified, + LoadContents, + FieldBase, + InputFormat, + OutputFormat, + Parameter, + InputBinding, + IOSchema, + InputSchema, + OutputSchema, + InputRecordField, + InputRecordSchema, + InputEnumSchema, + InputArraySchema, + OutputRecordField, + OutputRecordSchema, + OutputEnumSchema, + OutputArraySchema, + InputParameter, + OutputParameter, + ProcessRequirement, + Process, + InlineJavascriptRequirement, + CommandInputSchema, + SchemaDefRequirement, + SecondaryFileSchema, + LoadListingRequirement, + EnvironmentDef, + CommandLineBinding, + CommandOutputBinding, + CommandLineBindable, + CommandInputRecordField, + CommandInputRecordSchema, + CommandInputEnumSchema, + CommandInputArraySchema, + CommandOutputRecordField, + CommandOutputRecordSchema, + CommandOutputEnumSchema, + CommandOutputArraySchema, + CommandInputParameter, + CommandOutputParameter, + CommandLineTool, + DockerRequirement, + SoftwareRequirement, + SoftwarePackage, + Dirent, + InitialWorkDirRequirement, + EnvVarRequirement, + ShellCommandRequirement, + ResourceRequirement, + WorkReuse, + NetworkAccess, + InplaceUpdateRequirement, + ToolTimeLimit, + ExpressionToolOutputParameter, + WorkflowInputParameter, + ExpressionTool, + WorkflowOutputParameter, + Sink, + WorkflowStepInput, + WorkflowStepOutput, + WorkflowStep, + Workflow, + SubworkflowFeatureRequirement, + ScatterFeatureRequirement, + MultipleInputFeatureRequirement, + StepInputExpressionRequirement, + OperationInputParameter, + OperationOutputParameter, + Operation +} from './internal' + +export const strtype = new _PrimitiveLoader(TypeGuards.String); +export const inttype = new _PrimitiveLoader(TypeGuards.Int); +export const floattype = new _PrimitiveLoader(TypeGuards.Float); +export const booltype = new _PrimitiveLoader(TypeGuards.Bool); +export const undefinedtype = new _PrimitiveLoader(TypeGuards.Undefined); +export const anyType = new _AnyLoader(); +export const PrimitiveTypeLoader = new _EnumLoader(["null", "boolean", "int", "long", "float", "double", "string"]); +export const AnyLoader = new _EnumLoader(["Any"]); +export const RecordFieldLoader = new _RecordLoader(RecordField.fromDoc); +export const RecordSchemaLoader = new _RecordLoader(RecordSchema.fromDoc); +export const EnumSchemaLoader = new _RecordLoader(EnumSchema.fromDoc); +export const ArraySchemaLoader = new _RecordLoader(ArraySchema.fromDoc); +export const CWLVersionLoader = new _EnumLoader(["draft-2", "draft-3.dev1", "draft-3.dev2", "draft-3.dev3", "draft-3.dev4", "draft-3.dev5", "draft-3", "draft-4.dev1", "draft-4.dev2", "draft-4.dev3", "v1.0.dev4", "v1.0", "v1.1.0-dev1", "v1.1", "v1.2.0-dev1", "v1.2.0-dev2", "v1.2.0-dev3", "v1.2.0-dev4", "v1.2.0-dev5", "v1.2"]); +export const CWLTypeLoader = new _EnumLoader(["File", "Directory"]); +export const FileLoader = new _RecordLoader(File.fromDoc); +export const DirectoryLoader = new _RecordLoader(Directory.fromDoc); +export const LoadListingEnumLoader = new _EnumLoader(["no_listing", "shallow_listing", "deep_listing"]); +export const ExpressionLoader = new _ExpressionLoader(); +export const InputBindingLoader = new _RecordLoader(InputBinding.fromDoc); +export const InputRecordFieldLoader = new _RecordLoader(InputRecordField.fromDoc); +export const InputRecordSchemaLoader = new _RecordLoader(InputRecordSchema.fromDoc); +export const InputEnumSchemaLoader = new _RecordLoader(InputEnumSchema.fromDoc); +export const InputArraySchemaLoader = new _RecordLoader(InputArraySchema.fromDoc); +export const OutputRecordFieldLoader = new _RecordLoader(OutputRecordField.fromDoc); +export const OutputRecordSchemaLoader = new _RecordLoader(OutputRecordSchema.fromDoc); +export const OutputEnumSchemaLoader = new _RecordLoader(OutputEnumSchema.fromDoc); +export const OutputArraySchemaLoader = new _RecordLoader(OutputArraySchema.fromDoc); +export const InlineJavascriptRequirementLoader = new _RecordLoader(InlineJavascriptRequirement.fromDoc); +export const SchemaDefRequirementLoader = new _RecordLoader(SchemaDefRequirement.fromDoc); +export const SecondaryFileSchemaLoader = new _RecordLoader(SecondaryFileSchema.fromDoc); +export const LoadListingRequirementLoader = new _RecordLoader(LoadListingRequirement.fromDoc); +export const EnvironmentDefLoader = new _RecordLoader(EnvironmentDef.fromDoc); +export const CommandLineBindingLoader = new _RecordLoader(CommandLineBinding.fromDoc); +export const CommandOutputBindingLoader = new _RecordLoader(CommandOutputBinding.fromDoc); +export const CommandLineBindableLoader = new _RecordLoader(CommandLineBindable.fromDoc); +export const CommandInputRecordFieldLoader = new _RecordLoader(CommandInputRecordField.fromDoc); +export const CommandInputRecordSchemaLoader = new _RecordLoader(CommandInputRecordSchema.fromDoc); +export const CommandInputEnumSchemaLoader = new _RecordLoader(CommandInputEnumSchema.fromDoc); +export const CommandInputArraySchemaLoader = new _RecordLoader(CommandInputArraySchema.fromDoc); +export const CommandOutputRecordFieldLoader = new _RecordLoader(CommandOutputRecordField.fromDoc); +export const CommandOutputRecordSchemaLoader = new _RecordLoader(CommandOutputRecordSchema.fromDoc); +export const CommandOutputEnumSchemaLoader = new _RecordLoader(CommandOutputEnumSchema.fromDoc); +export const CommandOutputArraySchemaLoader = new _RecordLoader(CommandOutputArraySchema.fromDoc); +export const CommandInputParameterLoader = new _RecordLoader(CommandInputParameter.fromDoc); +export const CommandOutputParameterLoader = new _RecordLoader(CommandOutputParameter.fromDoc); +export const stdinLoader = new _EnumLoader(["stdin"]); +export const stdoutLoader = new _EnumLoader(["stdout"]); +export const stderrLoader = new _EnumLoader(["stderr"]); +export const CommandLineToolLoader = new _RecordLoader(CommandLineTool.fromDoc); +export const DockerRequirementLoader = new _RecordLoader(DockerRequirement.fromDoc); +export const SoftwareRequirementLoader = new _RecordLoader(SoftwareRequirement.fromDoc); +export const SoftwarePackageLoader = new _RecordLoader(SoftwarePackage.fromDoc); +export const DirentLoader = new _RecordLoader(Dirent.fromDoc); +export const InitialWorkDirRequirementLoader = new _RecordLoader(InitialWorkDirRequirement.fromDoc); +export const EnvVarRequirementLoader = new _RecordLoader(EnvVarRequirement.fromDoc); +export const ShellCommandRequirementLoader = new _RecordLoader(ShellCommandRequirement.fromDoc); +export const ResourceRequirementLoader = new _RecordLoader(ResourceRequirement.fromDoc); +export const WorkReuseLoader = new _RecordLoader(WorkReuse.fromDoc); +export const NetworkAccessLoader = new _RecordLoader(NetworkAccess.fromDoc); +export const InplaceUpdateRequirementLoader = new _RecordLoader(InplaceUpdateRequirement.fromDoc); +export const ToolTimeLimitLoader = new _RecordLoader(ToolTimeLimit.fromDoc); +export const ExpressionToolOutputParameterLoader = new _RecordLoader(ExpressionToolOutputParameter.fromDoc); +export const WorkflowInputParameterLoader = new _RecordLoader(WorkflowInputParameter.fromDoc); +export const ExpressionToolLoader = new _RecordLoader(ExpressionTool.fromDoc); +export const LinkMergeMethodLoader = new _EnumLoader(["merge_nested", "merge_flattened"]); +export const PickValueMethodLoader = new _EnumLoader(["first_non_null", "the_only_non_null", "all_non_null"]); +export const WorkflowOutputParameterLoader = new _RecordLoader(WorkflowOutputParameter.fromDoc); +export const WorkflowStepInputLoader = new _RecordLoader(WorkflowStepInput.fromDoc); +export const WorkflowStepOutputLoader = new _RecordLoader(WorkflowStepOutput.fromDoc); +export const ScatterMethodLoader = new _EnumLoader(["dotproduct", "nested_crossproduct", "flat_crossproduct"]); +export const WorkflowStepLoader = new _RecordLoader(WorkflowStep.fromDoc); +export const WorkflowLoader = new _RecordLoader(Workflow.fromDoc); +export const SubworkflowFeatureRequirementLoader = new _RecordLoader(SubworkflowFeatureRequirement.fromDoc); +export const ScatterFeatureRequirementLoader = new _RecordLoader(ScatterFeatureRequirement.fromDoc); +export const MultipleInputFeatureRequirementLoader = new _RecordLoader(MultipleInputFeatureRequirement.fromDoc); +export const StepInputExpressionRequirementLoader = new _RecordLoader(StepInputExpressionRequirement.fromDoc); +export const OperationInputParameterLoader = new _RecordLoader(OperationInputParameter.fromDoc); +export const OperationOutputParameterLoader = new _RecordLoader(OperationOutputParameter.fromDoc); +export const OperationLoader = new _RecordLoader(Operation.fromDoc); +export const arrayOfstrtype = new _ArrayLoader([strtype]); +export const unionOfundefinedtypeOrstrtypeOrarrayOfstrtype = new _UnionLoader([undefinedtype, strtype, arrayOfstrtype]); +export const uristrtypeTrueFalseNone = new _URILoader(strtype, true, false, undefined); +export const unionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype = new _UnionLoader([PrimitiveTypeLoader, RecordSchemaLoader, EnumSchemaLoader, ArraySchemaLoader, strtype]); +export const arrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype = new _ArrayLoader([unionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype]); +export const unionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype = new _UnionLoader([PrimitiveTypeLoader, RecordSchemaLoader, EnumSchemaLoader, ArraySchemaLoader, strtype, arrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype]); +export const typedslunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype, 2); +export const arrayOfRecordFieldLoader = new _ArrayLoader([RecordFieldLoader]); +export const unionOfundefinedtypeOrarrayOfRecordFieldLoader = new _UnionLoader([undefinedtype, arrayOfRecordFieldLoader]); +export const idmapfieldsunionOfundefinedtypeOrarrayOfRecordFieldLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfRecordFieldLoader, 'name', 'type'); +export const enum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader = new _EnumLoader(["record"]); +export const typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2 = new _TypeDSLLoader(enum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader, 2); +export const uriarrayOfstrtypeTrueFalseNone = new _URILoader(arrayOfstrtype, true, false, undefined); +export const enum_d961d79c225752b9fadb617367615ab176b47d77Loader = new _EnumLoader(["enum"]); +export const typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2 = new _TypeDSLLoader(enum_d961d79c225752b9fadb617367615ab176b47d77Loader, 2); +export const enum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader = new _EnumLoader(["array"]); +export const typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2 = new _TypeDSLLoader(enum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader, 2); +export const File_classLoader = new _EnumLoader(["File"]); +export const uriFile_classLoaderFalseTrueNone = new _URILoader(File_classLoader, false, true, undefined); +export const unionOfundefinedtypeOrstrtype = new _UnionLoader([undefinedtype, strtype]); +export const uriunionOfundefinedtypeOrstrtypeFalseFalseNone = new _URILoader(unionOfundefinedtypeOrstrtype, false, false, undefined); +export const unionOfundefinedtypeOrinttype = new _UnionLoader([undefinedtype, inttype]); +export const unionOfFileLoaderOrDirectoryLoader = new _UnionLoader([FileLoader, DirectoryLoader]); +export const arrayOfunionOfFileLoaderOrDirectoryLoader = new _ArrayLoader([unionOfFileLoaderOrDirectoryLoader]); +export const unionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _UnionLoader([undefinedtype, arrayOfunionOfFileLoaderOrDirectoryLoader]); +export const secondaryfilesdslunionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _SecondaryDSLLoader(unionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader); +export const uriunionOfundefinedtypeOrstrtypeTrueFalseNone = new _URILoader(unionOfundefinedtypeOrstrtype, true, false, undefined); +export const Directory_classLoader = new _EnumLoader(["Directory"]); +export const uriDirectory_classLoaderFalseTrueNone = new _URILoader(Directory_classLoader, false, true, undefined); +export const unionOfundefinedtypeOrbooltype = new _UnionLoader([undefinedtype, booltype]); +export const unionOfundefinedtypeOrLoadListingEnumLoader = new _UnionLoader([undefinedtype, LoadListingEnumLoader]); +export const arrayOfSecondaryFileSchemaLoader = new _ArrayLoader([SecondaryFileSchemaLoader]); +export const unionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader = new _UnionLoader([undefinedtype, SecondaryFileSchemaLoader, arrayOfSecondaryFileSchemaLoader]); +export const secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader = new _SecondaryDSLLoader(unionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader); +export const unionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoader = new _UnionLoader([undefinedtype, strtype, arrayOfstrtype, ExpressionLoader]); +export const uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoaderTrueFalseNone = new _URILoader(unionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoader, true, false, undefined); +export const unionOfundefinedtypeOrstrtypeOrExpressionLoader = new _UnionLoader([undefinedtype, strtype, ExpressionLoader]); +export const uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone = new _URILoader(unionOfundefinedtypeOrstrtypeOrExpressionLoader, true, false, undefined); +export const unionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, InputRecordSchemaLoader, InputEnumSchemaLoader, InputArraySchemaLoader, strtype]); +export const arrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype = new _ArrayLoader([unionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype]); +export const unionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, InputRecordSchemaLoader, InputEnumSchemaLoader, InputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype]); +export const typedslunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype, 2); +export const arrayOfInputRecordFieldLoader = new _ArrayLoader([InputRecordFieldLoader]); +export const unionOfundefinedtypeOrarrayOfInputRecordFieldLoader = new _UnionLoader([undefinedtype, arrayOfInputRecordFieldLoader]); +export const idmapfieldsunionOfundefinedtypeOrarrayOfInputRecordFieldLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfInputRecordFieldLoader, 'name', 'type'); +export const unionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, OutputRecordSchemaLoader, OutputEnumSchemaLoader, OutputArraySchemaLoader, strtype]); +export const arrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype = new _ArrayLoader([unionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype]); +export const unionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, OutputRecordSchemaLoader, OutputEnumSchemaLoader, OutputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype]); +export const typedslunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype, 2); +export const arrayOfOutputRecordFieldLoader = new _ArrayLoader([OutputRecordFieldLoader]); +export const unionOfundefinedtypeOrarrayOfOutputRecordFieldLoader = new _UnionLoader([undefinedtype, arrayOfOutputRecordFieldLoader]); +export const idmapfieldsunionOfundefinedtypeOrarrayOfOutputRecordFieldLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfOutputRecordFieldLoader, 'name', 'type'); +export const unionOfundefinedtypeOranyType = new _UnionLoader([undefinedtype, anyType]); +export const unionOfCommandInputParameterLoaderOrWorkflowInputParameterLoaderOrOperationInputParameterLoader = new _UnionLoader([CommandInputParameterLoader, WorkflowInputParameterLoader, OperationInputParameterLoader]); +export const arrayOfunionOfCommandInputParameterLoaderOrWorkflowInputParameterLoaderOrOperationInputParameterLoader = new _ArrayLoader([unionOfCommandInputParameterLoaderOrWorkflowInputParameterLoaderOrOperationInputParameterLoader]); +export const idmapinputsarrayOfunionOfCommandInputParameterLoaderOrWorkflowInputParameterLoaderOrOperationInputParameterLoader = new _IdMapLoader(arrayOfunionOfCommandInputParameterLoaderOrWorkflowInputParameterLoaderOrOperationInputParameterLoader, 'id', 'type'); +export const unionOfCommandOutputParameterLoaderOrExpressionToolOutputParameterLoaderOrWorkflowOutputParameterLoaderOrOperationOutputParameterLoader = new _UnionLoader([CommandOutputParameterLoader, ExpressionToolOutputParameterLoader, WorkflowOutputParameterLoader, OperationOutputParameterLoader]); +export const arrayOfunionOfCommandOutputParameterLoaderOrExpressionToolOutputParameterLoaderOrWorkflowOutputParameterLoaderOrOperationOutputParameterLoader = new _ArrayLoader([unionOfCommandOutputParameterLoaderOrExpressionToolOutputParameterLoaderOrWorkflowOutputParameterLoaderOrOperationOutputParameterLoader]); +export const idmapoutputsarrayOfunionOfCommandOutputParameterLoaderOrExpressionToolOutputParameterLoaderOrWorkflowOutputParameterLoaderOrOperationOutputParameterLoader = new _IdMapLoader(arrayOfunionOfCommandOutputParameterLoaderOrExpressionToolOutputParameterLoaderOrWorkflowOutputParameterLoaderOrOperationOutputParameterLoader, 'id', 'type'); +export const unionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader = new _UnionLoader([InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, LoadListingRequirementLoader, DockerRequirementLoader, SoftwareRequirementLoader, InitialWorkDirRequirementLoader, EnvVarRequirementLoader, ShellCommandRequirementLoader, ResourceRequirementLoader, WorkReuseLoader, NetworkAccessLoader, InplaceUpdateRequirementLoader, ToolTimeLimitLoader, SubworkflowFeatureRequirementLoader, ScatterFeatureRequirementLoader, MultipleInputFeatureRequirementLoader, StepInputExpressionRequirementLoader]); +export const arrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader = new _ArrayLoader([unionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader]); +export const unionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader = new _UnionLoader([undefinedtype, arrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader]); +export const idmaprequirementsunionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader, 'class', 'None'); +export const arrayOfanyType = new _ArrayLoader([anyType]); +export const unionOfundefinedtypeOrarrayOfanyType = new _UnionLoader([undefinedtype, arrayOfanyType]); +export const idmaphintsunionOfundefinedtypeOrarrayOfanyType = new _IdMapLoader(unionOfundefinedtypeOrarrayOfanyType, 'class', 'None'); +export const unionOfundefinedtypeOrCWLVersionLoader = new _UnionLoader([undefinedtype, CWLVersionLoader]); +export const uriunionOfundefinedtypeOrCWLVersionLoaderFalseTrueNone = new _URILoader(unionOfundefinedtypeOrCWLVersionLoader, false, true, undefined); +export const unionOfundefinedtypeOrarrayOfstrtype = new _UnionLoader([undefinedtype, arrayOfstrtype]); +export const uriunionOfundefinedtypeOrarrayOfstrtypeTrueFalseNone = new _URILoader(unionOfundefinedtypeOrarrayOfstrtype, true, false, undefined); +export const InlineJavascriptRequirement_classLoader = new _EnumLoader(["InlineJavascriptRequirement"]); +export const uriInlineJavascriptRequirement_classLoaderFalseTrueNone = new _URILoader(InlineJavascriptRequirement_classLoader, false, true, undefined); +export const SchemaDefRequirement_classLoader = new _EnumLoader(["SchemaDefRequirement"]); +export const uriSchemaDefRequirement_classLoaderFalseTrueNone = new _URILoader(SchemaDefRequirement_classLoader, false, true, undefined); +export const unionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader = new _UnionLoader([CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader]); +export const arrayOfunionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader = new _ArrayLoader([unionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader]); +export const unionOfstrtypeOrExpressionLoader = new _UnionLoader([strtype, ExpressionLoader]); +export const unionOfundefinedtypeOrbooltypeOrExpressionLoader = new _UnionLoader([undefinedtype, booltype, ExpressionLoader]); +export const LoadListingRequirement_classLoader = new _EnumLoader(["LoadListingRequirement"]); +export const uriLoadListingRequirement_classLoaderFalseTrueNone = new _URILoader(LoadListingRequirement_classLoader, false, true, undefined); +export const unionOfundefinedtypeOrinttypeOrExpressionLoader = new _UnionLoader([undefinedtype, inttype, ExpressionLoader]); +export const unionOfundefinedtypeOrstrtypeOrExpressionLoaderOrarrayOfstrtype = new _UnionLoader([undefinedtype, strtype, ExpressionLoader, arrayOfstrtype]); +export const unionOfundefinedtypeOrExpressionLoader = new _UnionLoader([undefinedtype, ExpressionLoader]); +export const unionOfundefinedtypeOrCommandLineBindingLoader = new _UnionLoader([undefinedtype, CommandLineBindingLoader]); +export const unionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, strtype]); +export const arrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype = new _ArrayLoader([unionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype]); +export const unionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype]); +export const typedslunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype, 2); +export const arrayOfCommandInputRecordFieldLoader = new _ArrayLoader([CommandInputRecordFieldLoader]); +export const unionOfundefinedtypeOrarrayOfCommandInputRecordFieldLoader = new _UnionLoader([undefinedtype, arrayOfCommandInputRecordFieldLoader]); +export const idmapfieldsunionOfundefinedtypeOrarrayOfCommandInputRecordFieldLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfCommandInputRecordFieldLoader, 'name', 'type'); +export const unionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, CommandOutputRecordSchemaLoader, CommandOutputEnumSchemaLoader, CommandOutputArraySchemaLoader, strtype]); +export const arrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype = new _ArrayLoader([unionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype]); +export const unionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, CommandOutputRecordSchemaLoader, CommandOutputEnumSchemaLoader, CommandOutputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype]); +export const typedslunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype, 2); +export const unionOfundefinedtypeOrCommandOutputBindingLoader = new _UnionLoader([undefinedtype, CommandOutputBindingLoader]); +export const arrayOfCommandOutputRecordFieldLoader = new _ArrayLoader([CommandOutputRecordFieldLoader]); +export const unionOfundefinedtypeOrarrayOfCommandOutputRecordFieldLoader = new _UnionLoader([undefinedtype, arrayOfCommandOutputRecordFieldLoader]); +export const idmapfieldsunionOfundefinedtypeOrarrayOfCommandOutputRecordFieldLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfCommandOutputRecordFieldLoader, 'name', 'type'); +export const unionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, stdinLoader, CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype]); +export const typedslunionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype, 2); +export const unionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, stdoutLoader, stderrLoader, CommandOutputRecordSchemaLoader, CommandOutputEnumSchemaLoader, CommandOutputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype]); +export const typedslunionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype, 2); +export const CommandLineTool_classLoader = new _EnumLoader(["CommandLineTool"]); +export const uriCommandLineTool_classLoaderFalseTrueNone = new _URILoader(CommandLineTool_classLoader, false, true, undefined); +export const arrayOfCommandInputParameterLoader = new _ArrayLoader([CommandInputParameterLoader]); +export const idmapinputsarrayOfCommandInputParameterLoader = new _IdMapLoader(arrayOfCommandInputParameterLoader, 'id', 'type'); +export const arrayOfCommandOutputParameterLoader = new _ArrayLoader([CommandOutputParameterLoader]); +export const idmapoutputsarrayOfCommandOutputParameterLoader = new _IdMapLoader(arrayOfCommandOutputParameterLoader, 'id', 'type'); +export const unionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader = new _UnionLoader([strtype, ExpressionLoader, CommandLineBindingLoader]); +export const arrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader = new _ArrayLoader([unionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader]); +export const unionOfundefinedtypeOrarrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader = new _UnionLoader([undefinedtype, arrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader]); +export const arrayOfinttype = new _ArrayLoader([inttype]); +export const unionOfundefinedtypeOrarrayOfinttype = new _UnionLoader([undefinedtype, arrayOfinttype]); +export const DockerRequirement_classLoader = new _EnumLoader(["DockerRequirement"]); +export const uriDockerRequirement_classLoaderFalseTrueNone = new _URILoader(DockerRequirement_classLoader, false, true, undefined); +export const SoftwareRequirement_classLoader = new _EnumLoader(["SoftwareRequirement"]); +export const uriSoftwareRequirement_classLoaderFalseTrueNone = new _URILoader(SoftwareRequirement_classLoader, false, true, undefined); +export const arrayOfSoftwarePackageLoader = new _ArrayLoader([SoftwarePackageLoader]); +export const idmappackagesarrayOfSoftwarePackageLoader = new _IdMapLoader(arrayOfSoftwarePackageLoader, 'package', 'specs'); +export const uriunionOfundefinedtypeOrarrayOfstrtypeFalseFalseNone = new _URILoader(unionOfundefinedtypeOrarrayOfstrtype, false, false, undefined); +export const InitialWorkDirRequirement_classLoader = new _EnumLoader(["InitialWorkDirRequirement"]); +export const uriInitialWorkDirRequirement_classLoaderFalseTrueNone = new _URILoader(InitialWorkDirRequirement_classLoader, false, true, undefined); +export const unionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _UnionLoader([undefinedtype, DirentLoader, ExpressionLoader, FileLoader, DirectoryLoader, arrayOfunionOfFileLoaderOrDirectoryLoader]); +export const arrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _ArrayLoader([unionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader]); +export const unionOfExpressionLoaderOrarrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _UnionLoader([ExpressionLoader, arrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader]); +export const EnvVarRequirement_classLoader = new _EnumLoader(["EnvVarRequirement"]); +export const uriEnvVarRequirement_classLoaderFalseTrueNone = new _URILoader(EnvVarRequirement_classLoader, false, true, undefined); +export const arrayOfEnvironmentDefLoader = new _ArrayLoader([EnvironmentDefLoader]); +export const idmapenvDefarrayOfEnvironmentDefLoader = new _IdMapLoader(arrayOfEnvironmentDefLoader, 'envName', 'envValue'); +export const ShellCommandRequirement_classLoader = new _EnumLoader(["ShellCommandRequirement"]); +export const uriShellCommandRequirement_classLoaderFalseTrueNone = new _URILoader(ShellCommandRequirement_classLoader, false, true, undefined); +export const ResourceRequirement_classLoader = new _EnumLoader(["ResourceRequirement"]); +export const uriResourceRequirement_classLoaderFalseTrueNone = new _URILoader(ResourceRequirement_classLoader, false, true, undefined); +export const unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader = new _UnionLoader([undefinedtype, inttype, floattype, ExpressionLoader]); +export const WorkReuse_classLoader = new _EnumLoader(["WorkReuse"]); +export const uriWorkReuse_classLoaderFalseTrueNone = new _URILoader(WorkReuse_classLoader, false, true, undefined); +export const unionOfbooltypeOrExpressionLoader = new _UnionLoader([booltype, ExpressionLoader]); +export const NetworkAccess_classLoader = new _EnumLoader(["NetworkAccess"]); +export const uriNetworkAccess_classLoaderFalseTrueNone = new _URILoader(NetworkAccess_classLoader, false, true, undefined); +export const InplaceUpdateRequirement_classLoader = new _EnumLoader(["InplaceUpdateRequirement"]); +export const uriInplaceUpdateRequirement_classLoaderFalseTrueNone = new _URILoader(InplaceUpdateRequirement_classLoader, false, true, undefined); +export const ToolTimeLimit_classLoader = new _EnumLoader(["ToolTimeLimit"]); +export const uriToolTimeLimit_classLoaderFalseTrueNone = new _URILoader(ToolTimeLimit_classLoader, false, true, undefined); +export const unionOfinttypeOrExpressionLoader = new _UnionLoader([inttype, ExpressionLoader]); +export const unionOfundefinedtypeOrInputBindingLoader = new _UnionLoader([undefinedtype, InputBindingLoader]); +export const ExpressionTool_classLoader = new _EnumLoader(["ExpressionTool"]); +export const uriExpressionTool_classLoaderFalseTrueNone = new _URILoader(ExpressionTool_classLoader, false, true, undefined); +export const arrayOfWorkflowInputParameterLoader = new _ArrayLoader([WorkflowInputParameterLoader]); +export const idmapinputsarrayOfWorkflowInputParameterLoader = new _IdMapLoader(arrayOfWorkflowInputParameterLoader, 'id', 'type'); +export const arrayOfExpressionToolOutputParameterLoader = new _ArrayLoader([ExpressionToolOutputParameterLoader]); +export const idmapoutputsarrayOfExpressionToolOutputParameterLoader = new _IdMapLoader(arrayOfExpressionToolOutputParameterLoader, 'id', 'type'); +export const uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeFalseFalse0 = new _URILoader(unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, false, false, 0); +export const unionOfundefinedtypeOrLinkMergeMethodLoader = new _UnionLoader([undefinedtype, LinkMergeMethodLoader]); +export const unionOfundefinedtypeOrPickValueMethodLoader = new _UnionLoader([undefinedtype, PickValueMethodLoader]); +export const uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeFalseFalse2 = new _URILoader(unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, false, false, 2); +export const arrayOfWorkflowStepInputLoader = new _ArrayLoader([WorkflowStepInputLoader]); +export const idmapin_arrayOfWorkflowStepInputLoader = new _IdMapLoader(arrayOfWorkflowStepInputLoader, 'id', 'source'); +export const unionOfstrtypeOrWorkflowStepOutputLoader = new _UnionLoader([strtype, WorkflowStepOutputLoader]); +export const arrayOfunionOfstrtypeOrWorkflowStepOutputLoader = new _ArrayLoader([unionOfstrtypeOrWorkflowStepOutputLoader]); +export const unionOfarrayOfunionOfstrtypeOrWorkflowStepOutputLoader = new _UnionLoader([arrayOfunionOfstrtypeOrWorkflowStepOutputLoader]); +export const uriunionOfarrayOfunionOfstrtypeOrWorkflowStepOutputLoaderTrueFalseNone = new _URILoader(unionOfarrayOfunionOfstrtypeOrWorkflowStepOutputLoader, true, false, undefined); +export const unionOfstrtypeOrCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader = new _UnionLoader([strtype, CommandLineToolLoader, ExpressionToolLoader, WorkflowLoader, OperationLoader]); +export const unionOfundefinedtypeOrScatterMethodLoader = new _UnionLoader([undefinedtype, ScatterMethodLoader]); +export const uriunionOfundefinedtypeOrScatterMethodLoaderFalseTrueNone = new _URILoader(unionOfundefinedtypeOrScatterMethodLoader, false, true, undefined); +export const Workflow_classLoader = new _EnumLoader(["Workflow"]); +export const uriWorkflow_classLoaderFalseTrueNone = new _URILoader(Workflow_classLoader, false, true, undefined); +export const arrayOfWorkflowOutputParameterLoader = new _ArrayLoader([WorkflowOutputParameterLoader]); +export const idmapoutputsarrayOfWorkflowOutputParameterLoader = new _IdMapLoader(arrayOfWorkflowOutputParameterLoader, 'id', 'type'); +export const arrayOfWorkflowStepLoader = new _ArrayLoader([WorkflowStepLoader]); +export const unionOfarrayOfWorkflowStepLoader = new _UnionLoader([arrayOfWorkflowStepLoader]); +export const idmapstepsunionOfarrayOfWorkflowStepLoader = new _IdMapLoader(unionOfarrayOfWorkflowStepLoader, 'id', 'None'); +export const SubworkflowFeatureRequirement_classLoader = new _EnumLoader(["SubworkflowFeatureRequirement"]); +export const uriSubworkflowFeatureRequirement_classLoaderFalseTrueNone = new _URILoader(SubworkflowFeatureRequirement_classLoader, false, true, undefined); +export const ScatterFeatureRequirement_classLoader = new _EnumLoader(["ScatterFeatureRequirement"]); +export const uriScatterFeatureRequirement_classLoaderFalseTrueNone = new _URILoader(ScatterFeatureRequirement_classLoader, false, true, undefined); +export const MultipleInputFeatureRequirement_classLoader = new _EnumLoader(["MultipleInputFeatureRequirement"]); +export const uriMultipleInputFeatureRequirement_classLoaderFalseTrueNone = new _URILoader(MultipleInputFeatureRequirement_classLoader, false, true, undefined); +export const StepInputExpressionRequirement_classLoader = new _EnumLoader(["StepInputExpressionRequirement"]); +export const uriStepInputExpressionRequirement_classLoaderFalseTrueNone = new _URILoader(StepInputExpressionRequirement_classLoader, false, true, undefined); +export const Operation_classLoader = new _EnumLoader(["Operation"]); +export const uriOperation_classLoaderFalseTrueNone = new _URILoader(Operation_classLoader, false, true, undefined); +export const arrayOfOperationInputParameterLoader = new _ArrayLoader([OperationInputParameterLoader]); +export const idmapinputsarrayOfOperationInputParameterLoader = new _IdMapLoader(arrayOfOperationInputParameterLoader, 'id', 'type'); +export const arrayOfOperationOutputParameterLoader = new _ArrayLoader([OperationOutputParameterLoader]); +export const idmapoutputsarrayOfOperationOutputParameterLoader = new _IdMapLoader(arrayOfOperationOutputParameterLoader, 'id', 'type'); +export const unionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader = new _UnionLoader([CommandLineToolLoader, ExpressionToolLoader, WorkflowLoader, OperationLoader]); +export const arrayOfunionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader = new _ArrayLoader([unionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader]); +export const unionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoaderOrarrayOfunionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader = new _UnionLoader([CommandLineToolLoader, ExpressionToolLoader, WorkflowLoader, OperationLoader, arrayOfunionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader]); diff --git a/src/util/loaders/anyLoader.ts b/src/util/loaders/anyLoader.ts new file mode 100644 index 0000000..f2ab23a --- /dev/null +++ b/src/util/loaders/anyLoader.ts @@ -0,0 +1,10 @@ +import { Loader, LoadingOptions, ValidationException } from '../internal' + +export class _AnyLoader implements Loader { + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string | undefined): Promise { + if (doc != null) { + return doc + } + throw new ValidationException('Expected non-null') + } +} diff --git a/src/util/loaders/arrayLoader.ts b/src/util/loaders/arrayLoader.ts new file mode 100644 index 0000000..68c5be0 --- /dev/null +++ b/src/util/loaders/arrayLoader.ts @@ -0,0 +1,36 @@ +import { Loader, loadField, LoadingOptions, _UnionLoader, ValidationException } from '../internal' + +export class _ArrayLoader implements Loader { + items: Loader[] + + constructor (items: Loader[]) { + this.items = items + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (!Array.isArray(doc)) { + throw new ValidationException('Expected a list') + } + let r: any[] = [] + const errors: ValidationException[] = [] + for (var val of doc) { + try { + const lf = await loadField(val, new _UnionLoader([this, ...this.items]), baseuri, loadingOptions) + if (Array.isArray(lf)) { + r = r.concat(lf) + } else { + r.push(lf) + } + } catch (e) { + if (e instanceof ValidationException) { + errors.push(e) + } + } + } + + if (errors.length > 0) { + throw new ValidationException('', errors) + } + return r + } +} diff --git a/src/util/loaders/enumLoader.ts b/src/util/loaders/enumLoader.ts new file mode 100644 index 0000000..59b54bf --- /dev/null +++ b/src/util/loaders/enumLoader.ts @@ -0,0 +1,17 @@ +import { Loader, LoadingOptions, ValidationException } from '../internal' + +export class _EnumLoader implements Loader { + symbols: string[] + + constructor (symbols: string[]) { + this.symbols = symbols + } + + async load (doc: string, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (this.symbols.includes(doc)) { + return doc + } else { + throw new ValidationException(`Expected one of ${this.symbols.toString()}`) + } + } +} diff --git a/src/util/loaders/expressionLoader.ts b/src/util/loaders/expressionLoader.ts new file mode 100644 index 0000000..71865a5 --- /dev/null +++ b/src/util/loaders/expressionLoader.ts @@ -0,0 +1,11 @@ +import { Loader, LoadingOptions, ValidationException } from '../internal' + +export class _ExpressionLoader implements Loader { + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (typeof doc !== 'string') { + throw new ValidationException('Expected a str') + } + return doc + } +} diff --git a/src/util/loaders/idMapLoader.ts b/src/util/loaders/idMapLoader.ts new file mode 100644 index 0000000..aee7c1f --- /dev/null +++ b/src/util/loaders/idMapLoader.ts @@ -0,0 +1,38 @@ +import { Dictionary, TypeGuards, Loader, LoadingOptions, ValidationException } from '../internal' + +export class _IdMapLoader implements Loader { + inner: Loader + mapSubject: string + mapPredicate?: string + + constructor (inner: Loader, mapSubject: string, mapPredicate?: string) { + this.inner = inner + this.mapSubject = mapSubject + this.mapPredicate = mapPredicate + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (TypeGuards.isDictionary(doc)) { + const r: any[] = [] + for (var k of Object.keys(doc).sort(undefined)) { + const val = doc[k] + if (TypeGuards.isDictionary(val)) { + const v2 = Object.assign({}, val) + v2[this.mapSubject] = k + r.push(v2) + } else { + if (this.mapPredicate != null) { + const v3: Dictionary = {} + v3[this.mapPredicate] = val + v3[this.mapSubject] = k + r.push(v3) + } else { + throw new ValidationException('No mapPredicate') + } + } + } + doc = r + } + return await this.inner.load(doc, baseuri, loadingOptions) + } +} diff --git a/src/util/loaders/loader.ts b/src/util/loaders/loader.ts new file mode 100644 index 0000000..1827b8b --- /dev/null +++ b/src/util/loaders/loader.ts @@ -0,0 +1,102 @@ +import { LoadingOptions, documentLoadByUrl, TypeGuards, ValidationException } from '../internal' +import * as URI from 'uri-js' + +export interface Loader { + load: (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string) => Promise +} + +export async function loadField (val: any, fieldType: Loader, baseuri: string, loadingOptions: LoadingOptions): Promise { + if (TypeGuards.isDictionary(val)) { + if ('$import' in val) { + if (loadingOptions.fileUri == null) { + throw Error('Cannot load $import without fileuri') + } + return await documentLoadByUrl(fieldType, loadingOptions.fetcher.urljoin(loadingOptions.fileUri, val.$import), loadingOptions) + } else if ('$include' in val) { + if (loadingOptions.fileUri == null) { + throw Error('Cannot load $import without fileuri') + } + val = await loadingOptions.fetcher.fetchText(loadingOptions.fetcher.urljoin(loadingOptions.fileUri, val.$include)) + } + } + return await fieldType.load(val, baseuri, loadingOptions) +} + +export function expandUrl (url: string, baseUrl: string, loadingOptions: LoadingOptions, scopedId = false, vocabTerm = false, scopedRef?: number): string { + if (['@id', '@type'].includes(url)) { + return url + } + + if (vocabTerm && url in loadingOptions.vocab) { + return url + } + + if (loadingOptions.vocab != null && url.includes(':')) { + const prefix = url.split(':')[0] + if (prefix in loadingOptions.vocab) { + url = loadingOptions.vocab[prefix] + url.slice(prefix.length + 1) + } + } + + const split = URI.parse(url) + if ((split.scheme != null && ['http', 'https', 'file'].includes(split.scheme)) || url.startsWith('$(') || url.startsWith('${')) { + throw Error('not implemented') + } else if (scopedId && split.fragment === undefined) { + const splitbase = URI.parse(baseUrl) + let frg = '' + if (splitbase.fragment != null) { + frg = splitbase.fragment + '/' + (split.path ?? '') + } else { + frg = split.path ?? '' + } + const pt = splitbase.path ?? '/' + const parts = { + scheme: splitbase.scheme, + userinfo: undefined, + host: splitbase.host, + port: undefined, + path: pt, + query: splitbase.query, + fragment: frg, + reference: undefined, + error: undefined + } + + url = URI.serialize(parts) + } else if (scopedRef != null && split.fragment === undefined) { + const splitbase = URI.parse(baseUrl) + const sp = splitbase.fragment?.split('/') ?? [] + let n = scopedRef + while (n > 0 && sp?.length > 0) { + sp.pop() + n -= 1 + } + sp.push(url) + const parts = { + scheme: splitbase.scheme, + userinfo: undefined, + host: splitbase.host, + port: undefined, + path: splitbase.path, + query: splitbase.query, + fragment: sp.join('/'), + reference: undefined, + error: undefined + } + url = URI.serialize(parts) + } else { + url = loadingOptions.fetcher.urljoin(baseUrl, url) + } + + if (vocabTerm) { + const split = URI.parse(url) + if (split.scheme !== undefined) { + if (url in loadingOptions.rvocab) { + return loadingOptions.rvocab[url] + } else { + throw new ValidationException(`Term '${url}' not in vocabulary`) + } + } + } + return url +} diff --git a/src/util/loaders/primitiveLoader.ts b/src/util/loaders/primitiveLoader.ts new file mode 100644 index 0000000..a49c847 --- /dev/null +++ b/src/util/loaders/primitiveLoader.ts @@ -0,0 +1,16 @@ +import { Loader, LoadingOptions, ValidationException } from '../internal' + +export class _PrimitiveLoader implements Loader { + typeGuard: (val: any) => boolean + + constructor (tp: (val: any) => boolean) { + this.typeGuard = tp + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (!this.typeGuard(doc)) { + throw new ValidationException(`Expected a ${this.typeGuard.name} but got ${(typeof doc)}`) + } + return doc + } +} diff --git a/src/util/loaders/recordLoader.ts b/src/util/loaders/recordLoader.ts new file mode 100644 index 0000000..47e46cb --- /dev/null +++ b/src/util/loaders/recordLoader.ts @@ -0,0 +1,15 @@ +import { Saveable, Loader, LoadingOptions, TypeGuards, ValidationException } from '../internal' + +export class _RecordLoader implements Loader { + creatorFunc: (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string) => Promise + constructor (createrFunc: (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string) => Promise) { + this.creatorFunc = createrFunc + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (!TypeGuards.isDictionary(doc)) { + throw new ValidationException('Expected a dict') + } + return await this.creatorFunc(doc, baseuri, loadingOptions, docRoot) + } +} diff --git a/src/util/loaders/rootloader.ts b/src/util/loaders/rootloader.ts new file mode 100644 index 0000000..62e55e3 --- /dev/null +++ b/src/util/loaders/rootloader.ts @@ -0,0 +1,70 @@ +import { LoadingOptions, Loader, TypeGuards, LoaderInstances } from '../internal' +import * as Internal from '../internal' +import * as yaml from 'js-yaml' +import * as URL from 'url' + +export async function documentLoad (loader: Loader, doc: unknown, baseuri: string, loadingOptions: LoadingOptions): Promise { + if (typeof doc === 'string') { + return await documentLoadByUrl(loader, loadingOptions.fetcher.urljoin(baseuri, doc), loadingOptions) + } + + if (Array.isArray(doc)) { + return await loader.load(doc, baseuri, loadingOptions) + } + + if (TypeGuards.isDictionary(doc)) { + if (doc != null) { + if ('$namespaces' in doc || '$schemas' in doc) { + loadingOptions = new LoadingOptions({ copyFrom: loadingOptions, namespaces: doc.$namespaces ?? undefined, schemas: doc.$schemas ?? undefined }) + delete doc.$schemas + delete doc.$namespaces + } + + if ('$base' in doc) { + baseuri = doc.$base + } + + if ('$graph' in doc) { + return await loader.load(doc.$graph, baseuri, loadingOptions) + } else { + return await loader.load(doc, baseuri, loadingOptions) + } + } + } + + throw new Error('Reached unexpected path') +} + +export async function documentLoadByUrl (loader: Loader, url: string, loadingOptions: LoadingOptions): Promise { + if (url in loadingOptions.idx) { + return await documentLoad(loader, loadingOptions.idx[url], url, loadingOptions) + } + const text = await loadingOptions.fetcher.fetchText(url) + const result = yaml.load(text) + loadingOptions.idx[url] = result + loadingOptions = new LoadingOptions({ copyFrom: loadingOptions, fileUri: url }) + return await documentLoad(loader, result, url, loadingOptions) +} + +export async function loadDocument (doc: any, baseuri?: string, loadingOptions?: LoadingOptions): Promise> { + if (baseuri == null) { + baseuri = URL.pathToFileURL(process.cwd() + '/').toString() + } + + if (loadingOptions == null) { + loadingOptions = new LoadingOptions({}) + } + + return await documentLoad(LoaderInstances.unionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoaderOrarrayOfunionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader, doc, baseuri, loadingOptions) +} + +export async function loadDocumentByString (doc: string, uri: string, loadingOptions?: LoadingOptions): Promise> { + const result = yaml.load(doc) + + if (loadingOptions == null) { + loadingOptions = new LoadingOptions({ fileUri: uri }) + } + loadingOptions.idx[uri] = result + + return await documentLoad(LoaderInstances.unionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoaderOrarrayOfunionOfCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader, result, uri, loadingOptions) +} diff --git a/src/util/loaders/secondaryDSLLoader.ts b/src/util/loaders/secondaryDSLLoader.ts new file mode 100644 index 0000000..7061a2d --- /dev/null +++ b/src/util/loaders/secondaryDSLLoader.ts @@ -0,0 +1,68 @@ +import { Loader, LoadingOptions, Dictionary, TypeGuards } from '../internal' +import { ValidationException } from '../validationException' + +export class _SecondaryDSLLoader implements Loader { + inner: Loader + + constructor (inner: Loader) { + this.inner = inner + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + const r: Array> = [] + if (Array.isArray(doc)) { + for (const d of doc) { + if (typeof d === 'string') { + if (d.endsWith('?')) { + r.push({ pattern: d.slice(0, -1), required: false }) + } else { + r.push({ pattern: d }) + } + } else if (TypeGuards.isDictionary(d)) { + const newDict: Dictionary = {} + if ('pattern' in d) { + newDict.pattern = d.pattern + delete d.pattern + } else { + throw new ValidationException(`Missing pattern in secondaryFiles specification entry: ${JSON.stringify(d)}`) + } + if ('required' in d) { + newDict.required = d.required + delete d.required + } + if (Object.keys(d).length > 0) { + throw new ValidationException(`Unallowed values in secondaryFiles specification entry: ${JSON.stringify(d)}`) + } + r.push(newDict) + } else { + throw new ValidationException('Expected a string or sequence of (strings or mappings).') + } + } + } else if (TypeGuards.isDictionary(doc)) { + const newDict: Dictionary = {} + if ('pattern' in doc) { + newDict.pattern = doc.pattern + delete doc.pattern + } else { + throw new ValidationException(`Missing pattern in secondaryFiles specification entry: ${JSON.stringify(doc)}`) + } + if ('required' in doc) { + newDict.required = doc.required + delete doc.required + } + if (Object.keys(doc).length > 0) { + throw new ValidationException(`Unallowed values in secondaryFiles specification entry: ${JSON.stringify(doc)}`) + } + r.push(newDict) + } else if (typeof doc === 'string') { + if (doc.endsWith('?')) { + r.push({ pattern: doc.slice(0, -1), required: false }) + } else { + r.push({ pattern: doc }) + } + } else { + throw new ValidationException('Expected str or sequence of str') + } + return await this.inner.load(r, baseuri, loadingOptions, docRoot) + } +} diff --git a/src/util/loaders/typeDSLLoader.ts b/src/util/loaders/typeDSLLoader.ts new file mode 100644 index 0000000..505eb22 --- /dev/null +++ b/src/util/loaders/typeDSLLoader.ts @@ -0,0 +1,62 @@ +import { Dictionary, expandUrl, Loader, LoadingOptions } from '../internal' + +export class _TypeDSLLoader implements Loader { + typeDSLRegex = /^([^[?]+)(\[\])?(\?)?$/ + inner: Loader + refScope?: number + + constructor (inner: Loader, refScope?: number) { + this.inner = inner + this.refScope = refScope + } + + resolve (doc: string, baseuri: string, loadingOptions: LoadingOptions): Array | string> | Dictionary | string { + const m = this.typeDSLRegex.exec(doc) + if (m != null) { + const group1 = m[1] + if (group1 == null) { + throw Error() + } + + const first = expandUrl(group1, baseuri, loadingOptions, false, true, this.refScope) + var second + var third + if (m[2] != null) { + second = { type: 'array', items: first } + } + if (m[3] != null) { + third = ['null', second ?? first] + } + return third ?? second ?? first + } + return doc + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (Array.isArray(doc)) { + const r: any[] = [] + for (const d of doc) { + if (typeof d === 'string') { + const resolved = this.resolve(d, baseuri, loadingOptions) + if (Array.isArray(resolved)) { + for (const i of resolved) { + if (!r.includes(i)) { + r.push(i) + } + } + } else { + if (!r.includes(resolved)) { + r.push(resolved) + } + } + } else { + r.push(d) + } + } + doc = r + } else if (typeof doc === 'string') { + doc = this.resolve(doc, baseuri, loadingOptions) + } + return await this.inner.load(doc, baseuri, loadingOptions) + } +} diff --git a/src/util/loaders/unionLoader.ts b/src/util/loaders/unionLoader.ts new file mode 100644 index 0000000..56c9bb0 --- /dev/null +++ b/src/util/loaders/unionLoader.ts @@ -0,0 +1,23 @@ +import { Loader, LoadingOptions, Saveable, ValidationException } from '../internal' + +export class _UnionLoader implements Loader { + alternates: Loader[] + + constructor (alternates: Loader[]) { + this.alternates = alternates + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + const errors: ValidationException[] = [] + for (const t of this.alternates) { + try { + return await t.load(doc, baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push(new ValidationException(`tried ${t.constructor.name} but`, [e])) + } + } + } + throw new ValidationException('', errors).withBullet('-') + } +} diff --git a/src/util/loaders/uriLoader.ts b/src/util/loaders/uriLoader.ts new file mode 100644 index 0000000..2fb9660 --- /dev/null +++ b/src/util/loaders/uriLoader.ts @@ -0,0 +1,32 @@ +import { expandUrl, Loader, LoadingOptions } from '../internal' + +export class _URILoader implements Loader { + inner: Loader + scopedID: boolean + vocabTerm: boolean + scopedRef?: number + + constructor (inner: Loader, scopedID: boolean, vocabTerm: boolean, scopedRef?: number) { + this.inner = inner + this.scopedID = scopedID + this.vocabTerm = vocabTerm + this.scopedRef = scopedRef + } + + async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + if (Array.isArray(doc)) { + const newDoc: any[] = [] + for (const val of doc) { + if (typeof val === 'string') { + newDoc.push(expandUrl(val, baseuri, loadingOptions, this.scopedID, this.vocabTerm, this.scopedRef)) + } else { + newDoc.push(val) + } + } + doc = newDoc + } else if (typeof doc === 'string') { + doc = expandUrl(doc, baseuri, loadingOptions, this.scopedID, this.vocabTerm, this.scopedRef) + } + return await this.inner.load(doc, baseuri, loadingOptions) + } +} diff --git a/src/util/loadingOptions.ts b/src/util/loadingOptions.ts new file mode 100644 index 0000000..bb24b00 --- /dev/null +++ b/src/util/loadingOptions.ts @@ -0,0 +1,56 @@ +import { Dictionary, DefaultFetcher, Fetcher, RVOCAB, VOCAB } from './internal' + +export class LoadingOptions { + fetcher: Fetcher + idx: Dictionary + fileUri?: string + namespaces?: Dictionary + schemas?: Dictionary + copyFrom?: LoadingOptions + originalDoc: any + vocab: Dictionary + rvocab: Dictionary + + constructor ({ fileUri, namespaces, schemas, originalDoc, copyFrom, fetcher }: {fileUri?: string, namespaces?: Dictionary, schemas?: Dictionary, originalDoc?: any, copyFrom?: LoadingOptions, fetcher?: Fetcher}) { + this.idx = {} + this.fileUri = fileUri + this.namespaces = namespaces + this.schemas = schemas + this.originalDoc = originalDoc + + if (copyFrom != null) { + this.idx = copyFrom.idx + if (fetcher === undefined) { + this.fetcher = copyFrom.fetcher + } + if (fileUri === undefined) { + this.fileUri = copyFrom.fileUri + } + if (namespaces === undefined) { + this.namespaces = copyFrom.namespaces + } + if (schemas === undefined) { + this.schemas = copyFrom.schemas + } + } + + if (fetcher != null) { + this.fetcher = fetcher + } else { + this.fetcher = new DefaultFetcher() + } + + this.vocab = VOCAB + this.rvocab = RVOCAB + + if (namespaces != null) { + this.vocab = { ...this.vocab } + this.rvocab = { ...this.rvocab } + for (const key in namespaces) { + const value = namespaces[key] + this.vocab[key] = value + this.rvocab[value] = key + } + } + } +} diff --git a/src/util/saveable.ts b/src/util/saveable.ts new file mode 100644 index 0000000..16d80db --- /dev/null +++ b/src/util/saveable.ts @@ -0,0 +1,96 @@ +import { LoadingOptions, Dictionary, TypeGuards } from './internal' +import * as URI from 'uri-js' +import path from 'path' + +// eslint-disable-next-line @typescript-eslint/no-extraneous-class +export abstract class Saveable { + static async fromDoc (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { + throw new Error('Not Implemented') + } + abstract save (top: boolean, baseUrl: string, relativeUris: boolean): Dictionary +} + +export function save (val: any, top: boolean = true, baseUrl: string = '', relativeUris: boolean = true): any { + if (val instanceof Saveable) { + return val.save(top, baseUrl, relativeUris) + } + + if (Array.isArray(val)) { + const r = [] + for (const v of val) { + r.push(save(v, false, baseUrl, relativeUris)) + } + return r + } + + if (TypeGuards.isDictionary(val)) { + const newDict: Dictionary = {} + for (const key in val) { + newDict[key] = save(val[key], false, baseUrl, relativeUris) + } + return newDict + } + + return val +} + +export function saveRelativeUri (uri: any, baseUrl: string='', scopedId: boolean, relativeUris: boolean, refScope?: number): any { + if (relativeUris == null || uri === baseUrl) { + return uri + } + if (Array.isArray(uri)) { + const r = [] + for (const v of uri) { + r.push(saveRelativeUri(v, baseUrl, scopedId, relativeUris, refScope)) + } + return r + } else if (typeof uri === 'string') { + const uriSplit = URI.parse(uri) + const baseSplit = URI.parse(baseUrl) + if (uriSplit.path == null || baseSplit.path == null) { + throw new Error('uri or baseurl need to contain a path.') + } + if (uriSplit.scheme === baseSplit.scheme && uriSplit.host === baseSplit.host) { + if (uriSplit.path !== baseSplit.path) { + let p = path.relative(path.dirname(baseSplit.path), uriSplit.path) + if (uriSplit.fragment != null) { + p = p + '#' + uriSplit.fragment + } + return p + } + + if (baseSplit.fragment == null) { + baseSplit.fragment = '' + } + let basefrag = baseSplit.fragment + '/' + if (refScope != null) { + const sp = basefrag.split('/') + let i = 0 + while (i < refScope) { + sp.pop() + i += 1 + } + basefrag = sp.join('/') + } + if (uriSplit.fragment == null) { + uriSplit.fragment = '' + } + if (uriSplit.fragment.startsWith(basefrag)) { + return uriSplit.fragment.slice(basefrag.length) + } else { + return uriSplit.fragment + } + } else { + return save(uri, false, baseUrl) + } + } +} + +export function prefixUrl (url: string, namespaces: Dictionary): string { + for (const k in namespaces) { + if (url.startsWith(namespaces.k)) { + return k + ':' + url.slice(namespaces.k.length) + } + } + return url +} diff --git a/src/util/typeguards.ts b/src/util/typeguards.ts new file mode 100644 index 0000000..fc27217 --- /dev/null +++ b/src/util/typeguards.ts @@ -0,0 +1,25 @@ +import { Dictionary } from './internal' + +export function Int (doc: any): boolean { + return typeof doc === 'number' && Number.isInteger(doc) +} + +export function Float (doc: any): boolean { + return typeof doc === 'number' +} + +export function Bool (doc: any): boolean { + return typeof doc === 'boolean' +} + +export function String (doc: any): boolean { + return typeof doc === 'string' +} + +export function Undefined (doc: any): boolean { + return typeof doc === 'undefined' +} + +export function isDictionary (doc: any): doc is Dictionary { + return (doc != null && typeof doc === 'object' && !Array.isArray(doc)) +} diff --git a/src/util/validationException.ts b/src/util/validationException.ts new file mode 100644 index 0000000..639bf54 --- /dev/null +++ b/src/util/validationException.ts @@ -0,0 +1,56 @@ +export class ValidationException extends Error { + static indentPerLevel = 2 + + children: ValidationException[] + bullet: string = '' + + constructor (message: string); + constructor (message: string, _children: ValidationException[]); + constructor (message: string, _children = new Array()) { + super(message) + Object.setPrototypeOf(this, new.target.prototype) + const children = new Array() + for (const child of _children) { + children.push(...child.simplify()) + } + this.children = children + } + + withBullet (bullet: string): ValidationException { + this.bullet = bullet + return this + } + + simplify (): ValidationException[] { + if (this.toString().length > 0) { + return new Array(this) + } + return this.children + } + + summary (level: number): string { + const spaces = new Array(level * ValidationException.indentPerLevel).join(' ') + return spaces + this.bullet + this.message + } + + prettyStr (level = 0): string { + const parts = new Array() + let nextLevel = level + + if (this.message != null && this.message.length > 0) { + parts.push(this.summary(level)) + nextLevel++ + } + + for (const child of this.children) { + parts.push(child.prettyStr(nextLevel)) + } + + const ret = parts.join('\n') + return ret + } + + override toString (): string { + return this.prettyStr() + } +} diff --git a/src/util/vocabs.ts b/src/util/vocabs.ts new file mode 100644 index 0000000..ea4244d --- /dev/null +++ b/src/util/vocabs.ts @@ -0,0 +1,268 @@ +export const VOCAB = { + 'Any': 'https://w3id.org/cwl/salad#Any', + 'ArraySchema': 'https://w3id.org/cwl/salad#ArraySchema', + 'CWLType': 'https://w3id.org/cwl/cwl#CWLType', + 'CWLVersion': 'https://w3id.org/cwl/cwl#CWLVersion', + 'CommandInputArraySchema': 'https://w3id.org/cwl/cwl#CommandInputArraySchema', + 'CommandInputEnumSchema': 'https://w3id.org/cwl/cwl#CommandInputEnumSchema', + 'CommandInputParameter': 'https://w3id.org/cwl/cwl#CommandInputParameter', + 'CommandInputRecordField': 'https://w3id.org/cwl/cwl#CommandInputRecordField', + 'CommandInputRecordSchema': 'https://w3id.org/cwl/cwl#CommandInputRecordSchema', + 'CommandInputSchema': 'https://w3id.org/cwl/cwl#CommandInputSchema', + 'CommandLineBindable': 'https://w3id.org/cwl/cwl#CommandLineBindable', + 'CommandLineBinding': 'https://w3id.org/cwl/cwl#CommandLineBinding', + 'CommandLineTool': 'https://w3id.org/cwl/cwl#CommandLineTool', + 'CommandOutputArraySchema': 'https://w3id.org/cwl/cwl#CommandOutputArraySchema', + 'CommandOutputBinding': 'https://w3id.org/cwl/cwl#CommandOutputBinding', + 'CommandOutputEnumSchema': 'https://w3id.org/cwl/cwl#CommandOutputEnumSchema', + 'CommandOutputParameter': 'https://w3id.org/cwl/cwl#CommandOutputParameter', + 'CommandOutputRecordField': 'https://w3id.org/cwl/cwl#CommandOutputRecordField', + 'CommandOutputRecordSchema': 'https://w3id.org/cwl/cwl#CommandOutputRecordSchema', + 'Directory': 'https://w3id.org/cwl/cwl#Directory', + 'Dirent': 'https://w3id.org/cwl/cwl#Dirent', + 'DockerRequirement': 'https://w3id.org/cwl/cwl#DockerRequirement', + 'Documented': 'https://w3id.org/cwl/salad#Documented', + 'EnumSchema': 'https://w3id.org/cwl/salad#EnumSchema', + 'EnvVarRequirement': 'https://w3id.org/cwl/cwl#EnvVarRequirement', + 'EnvironmentDef': 'https://w3id.org/cwl/cwl#EnvironmentDef', + 'Expression': 'https://w3id.org/cwl/cwl#Expression', + 'ExpressionPlaceholder': 'https://w3id.org/cwl/cwl#ExpressionPlaceholder', + 'ExpressionTool': 'https://w3id.org/cwl/cwl#ExpressionTool', + 'ExpressionToolOutputParameter': 'https://w3id.org/cwl/cwl#ExpressionToolOutputParameter', + 'FieldBase': 'https://w3id.org/cwl/cwl#FieldBase', + 'File': 'https://w3id.org/cwl/cwl#File', + 'IOSchema': 'https://w3id.org/cwl/cwl#IOSchema', + 'Identified': 'https://w3id.org/cwl/cwl#Identified', + 'InitialWorkDirRequirement': 'https://w3id.org/cwl/cwl#InitialWorkDirRequirement', + 'InlineJavascriptRequirement': 'https://w3id.org/cwl/cwl#InlineJavascriptRequirement', + 'InplaceUpdateRequirement': 'https://w3id.org/cwl/cwl#InplaceUpdateRequirement', + 'InputArraySchema': 'https://w3id.org/cwl/cwl#InputArraySchema', + 'InputBinding': 'https://w3id.org/cwl/cwl#InputBinding', + 'InputEnumSchema': 'https://w3id.org/cwl/cwl#InputEnumSchema', + 'InputFormat': 'https://w3id.org/cwl/cwl#InputFormat', + 'InputParameter': 'https://w3id.org/cwl/cwl#InputParameter', + 'InputRecordField': 'https://w3id.org/cwl/cwl#InputRecordField', + 'InputRecordSchema': 'https://w3id.org/cwl/cwl#InputRecordSchema', + 'InputSchema': 'https://w3id.org/cwl/cwl#InputSchema', + 'Labeled': 'https://w3id.org/cwl/cwl#Labeled', + 'LinkMergeMethod': 'https://w3id.org/cwl/cwl#LinkMergeMethod', + 'LoadContents': 'https://w3id.org/cwl/cwl#LoadContents', + 'LoadListingEnum': 'https://w3id.org/cwl/cwl#LoadListingEnum', + 'LoadListingRequirement': 'https://w3id.org/cwl/cwl#LoadListingRequirement', + 'MultipleInputFeatureRequirement': 'https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement', + 'NetworkAccess': 'https://w3id.org/cwl/cwl#NetworkAccess', + 'Operation': 'https://w3id.org/cwl/cwl#Operation', + 'OperationInputParameter': 'https://w3id.org/cwl/cwl#OperationInputParameter', + 'OperationOutputParameter': 'https://w3id.org/cwl/cwl#OperationOutputParameter', + 'OutputArraySchema': 'https://w3id.org/cwl/cwl#OutputArraySchema', + 'OutputEnumSchema': 'https://w3id.org/cwl/cwl#OutputEnumSchema', + 'OutputFormat': 'https://w3id.org/cwl/cwl#OutputFormat', + 'OutputParameter': 'https://w3id.org/cwl/cwl#OutputParameter', + 'OutputRecordField': 'https://w3id.org/cwl/cwl#OutputRecordField', + 'OutputRecordSchema': 'https://w3id.org/cwl/cwl#OutputRecordSchema', + 'OutputSchema': 'https://w3id.org/cwl/cwl#OutputSchema', + 'Parameter': 'https://w3id.org/cwl/cwl#Parameter', + 'PickValueMethod': 'https://w3id.org/cwl/cwl#PickValueMethod', + 'PrimitiveType': 'https://w3id.org/cwl/salad#PrimitiveType', + 'Process': 'https://w3id.org/cwl/cwl#Process', + 'ProcessRequirement': 'https://w3id.org/cwl/cwl#ProcessRequirement', + 'RecordField': 'https://w3id.org/cwl/salad#RecordField', + 'RecordSchema': 'https://w3id.org/cwl/salad#RecordSchema', + 'ResourceRequirement': 'https://w3id.org/cwl/cwl#ResourceRequirement', + 'ScatterFeatureRequirement': 'https://w3id.org/cwl/cwl#ScatterFeatureRequirement', + 'ScatterMethod': 'https://w3id.org/cwl/cwl#ScatterMethod', + 'SchemaDefRequirement': 'https://w3id.org/cwl/cwl#SchemaDefRequirement', + 'SecondaryFileSchema': 'https://w3id.org/cwl/cwl#SecondaryFileSchema', + 'ShellCommandRequirement': 'https://w3id.org/cwl/cwl#ShellCommandRequirement', + 'Sink': 'https://w3id.org/cwl/cwl#Sink', + 'SoftwarePackage': 'https://w3id.org/cwl/cwl#SoftwarePackage', + 'SoftwareRequirement': 'https://w3id.org/cwl/cwl#SoftwareRequirement', + 'StepInputExpressionRequirement': 'https://w3id.org/cwl/cwl#StepInputExpressionRequirement', + 'SubworkflowFeatureRequirement': 'https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement', + 'ToolTimeLimit': 'https://w3id.org/cwl/cwl#ToolTimeLimit', + 'WorkReuse': 'https://w3id.org/cwl/cwl#WorkReuse', + 'Workflow': 'https://w3id.org/cwl/cwl#Workflow', + 'WorkflowInputParameter': 'https://w3id.org/cwl/cwl#WorkflowInputParameter', + 'WorkflowOutputParameter': 'https://w3id.org/cwl/cwl#WorkflowOutputParameter', + 'WorkflowStep': 'https://w3id.org/cwl/cwl#WorkflowStep', + 'WorkflowStepInput': 'https://w3id.org/cwl/cwl#WorkflowStepInput', + 'WorkflowStepOutput': 'https://w3id.org/cwl/cwl#WorkflowStepOutput', + 'all_non_null': 'https://w3id.org/cwl/cwl#PickValueMethod/all_non_null', + 'array': 'https://w3id.org/cwl/salad#array', + 'boolean': 'http://www.w3.org/2001/XMLSchema#boolean', + 'deep_listing': 'https://w3id.org/cwl/cwl#LoadListingEnum/deep_listing', + 'dotproduct': 'https://w3id.org/cwl/cwl#ScatterMethod/dotproduct', + 'double': 'http://www.w3.org/2001/XMLSchema#double', + 'draft-2': 'https://w3id.org/cwl/cwl#draft-2', + 'draft-3': 'https://w3id.org/cwl/cwl#draft-3', + 'draft-3.dev1': 'https://w3id.org/cwl/cwl#draft-3.dev1', + 'draft-3.dev2': 'https://w3id.org/cwl/cwl#draft-3.dev2', + 'draft-3.dev3': 'https://w3id.org/cwl/cwl#draft-3.dev3', + 'draft-3.dev4': 'https://w3id.org/cwl/cwl#draft-3.dev4', + 'draft-3.dev5': 'https://w3id.org/cwl/cwl#draft-3.dev5', + 'draft-4.dev1': 'https://w3id.org/cwl/cwl#draft-4.dev1', + 'draft-4.dev2': 'https://w3id.org/cwl/cwl#draft-4.dev2', + 'draft-4.dev3': 'https://w3id.org/cwl/cwl#draft-4.dev3', + 'enum': 'https://w3id.org/cwl/salad#enum', + 'first_non_null': 'https://w3id.org/cwl/cwl#PickValueMethod/first_non_null', + 'flat_crossproduct': 'https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct', + 'float': 'http://www.w3.org/2001/XMLSchema#float', + 'int': 'http://www.w3.org/2001/XMLSchema#int', + 'long': 'http://www.w3.org/2001/XMLSchema#long', + 'merge_flattened': 'https://w3id.org/cwl/cwl#LinkMergeMethod/merge_flattened', + 'merge_nested': 'https://w3id.org/cwl/cwl#LinkMergeMethod/merge_nested', + 'nested_crossproduct': 'https://w3id.org/cwl/cwl#ScatterMethod/nested_crossproduct', + 'no_listing': 'https://w3id.org/cwl/cwl#LoadListingEnum/no_listing', + 'null': 'https://w3id.org/cwl/salad#null', + 'record': 'https://w3id.org/cwl/salad#record', + 'shallow_listing': 'https://w3id.org/cwl/cwl#LoadListingEnum/shallow_listing', + 'stderr': 'https://w3id.org/cwl/cwl#stderr', + 'stdin': 'https://w3id.org/cwl/cwl#stdin', + 'stdout': 'https://w3id.org/cwl/cwl#stdout', + 'string': 'http://www.w3.org/2001/XMLSchema#string', + 'the_only_non_null': 'https://w3id.org/cwl/cwl#PickValueMethod/the_only_non_null', + 'v1.0': 'https://w3id.org/cwl/cwl#v1.0', + 'v1.0.dev4': 'https://w3id.org/cwl/cwl#v1.0.dev4', + 'v1.1': 'https://w3id.org/cwl/cwl#v1.1', + 'v1.1.0-dev1': 'https://w3id.org/cwl/cwl#v1.1.0-dev1', + 'v1.2': 'https://w3id.org/cwl/cwl#v1.2', + 'v1.2.0-dev1': 'https://w3id.org/cwl/cwl#v1.2.0-dev1', + 'v1.2.0-dev2': 'https://w3id.org/cwl/cwl#v1.2.0-dev2', + 'v1.2.0-dev3': 'https://w3id.org/cwl/cwl#v1.2.0-dev3', + 'v1.2.0-dev4': 'https://w3id.org/cwl/cwl#v1.2.0-dev4', + 'v1.2.0-dev5': 'https://w3id.org/cwl/cwl#v1.2.0-dev5' +} +export const RVOCAB = { + 'https://w3id.org/cwl/salad#Any': 'Any', + 'https://w3id.org/cwl/salad#ArraySchema': 'ArraySchema', + 'https://w3id.org/cwl/cwl#CWLType': 'CWLType', + 'https://w3id.org/cwl/cwl#CWLVersion': 'CWLVersion', + 'https://w3id.org/cwl/cwl#CommandInputArraySchema': 'CommandInputArraySchema', + 'https://w3id.org/cwl/cwl#CommandInputEnumSchema': 'CommandInputEnumSchema', + 'https://w3id.org/cwl/cwl#CommandInputParameter': 'CommandInputParameter', + 'https://w3id.org/cwl/cwl#CommandInputRecordField': 'CommandInputRecordField', + 'https://w3id.org/cwl/cwl#CommandInputRecordSchema': 'CommandInputRecordSchema', + 'https://w3id.org/cwl/cwl#CommandInputSchema': 'CommandInputSchema', + 'https://w3id.org/cwl/cwl#CommandLineBindable': 'CommandLineBindable', + 'https://w3id.org/cwl/cwl#CommandLineBinding': 'CommandLineBinding', + 'https://w3id.org/cwl/cwl#CommandLineTool': 'CommandLineTool', + 'https://w3id.org/cwl/cwl#CommandOutputArraySchema': 'CommandOutputArraySchema', + 'https://w3id.org/cwl/cwl#CommandOutputBinding': 'CommandOutputBinding', + 'https://w3id.org/cwl/cwl#CommandOutputEnumSchema': 'CommandOutputEnumSchema', + 'https://w3id.org/cwl/cwl#CommandOutputParameter': 'CommandOutputParameter', + 'https://w3id.org/cwl/cwl#CommandOutputRecordField': 'CommandOutputRecordField', + 'https://w3id.org/cwl/cwl#CommandOutputRecordSchema': 'CommandOutputRecordSchema', + 'https://w3id.org/cwl/cwl#Directory': 'Directory', + 'https://w3id.org/cwl/cwl#Dirent': 'Dirent', + 'https://w3id.org/cwl/cwl#DockerRequirement': 'DockerRequirement', + 'https://w3id.org/cwl/salad#Documented': 'Documented', + 'https://w3id.org/cwl/salad#EnumSchema': 'EnumSchema', + 'https://w3id.org/cwl/cwl#EnvVarRequirement': 'EnvVarRequirement', + 'https://w3id.org/cwl/cwl#EnvironmentDef': 'EnvironmentDef', + 'https://w3id.org/cwl/cwl#Expression': 'Expression', + 'https://w3id.org/cwl/cwl#ExpressionPlaceholder': 'ExpressionPlaceholder', + 'https://w3id.org/cwl/cwl#ExpressionTool': 'ExpressionTool', + 'https://w3id.org/cwl/cwl#ExpressionToolOutputParameter': 'ExpressionToolOutputParameter', + 'https://w3id.org/cwl/cwl#FieldBase': 'FieldBase', + 'https://w3id.org/cwl/cwl#File': 'File', + 'https://w3id.org/cwl/cwl#IOSchema': 'IOSchema', + 'https://w3id.org/cwl/cwl#Identified': 'Identified', + 'https://w3id.org/cwl/cwl#InitialWorkDirRequirement': 'InitialWorkDirRequirement', + 'https://w3id.org/cwl/cwl#InlineJavascriptRequirement': 'InlineJavascriptRequirement', + 'https://w3id.org/cwl/cwl#InplaceUpdateRequirement': 'InplaceUpdateRequirement', + 'https://w3id.org/cwl/cwl#InputArraySchema': 'InputArraySchema', + 'https://w3id.org/cwl/cwl#InputBinding': 'InputBinding', + 'https://w3id.org/cwl/cwl#InputEnumSchema': 'InputEnumSchema', + 'https://w3id.org/cwl/cwl#InputFormat': 'InputFormat', + 'https://w3id.org/cwl/cwl#InputParameter': 'InputParameter', + 'https://w3id.org/cwl/cwl#InputRecordField': 'InputRecordField', + 'https://w3id.org/cwl/cwl#InputRecordSchema': 'InputRecordSchema', + 'https://w3id.org/cwl/cwl#InputSchema': 'InputSchema', + 'https://w3id.org/cwl/cwl#Labeled': 'Labeled', + 'https://w3id.org/cwl/cwl#LinkMergeMethod': 'LinkMergeMethod', + 'https://w3id.org/cwl/cwl#LoadContents': 'LoadContents', + 'https://w3id.org/cwl/cwl#LoadListingEnum': 'LoadListingEnum', + 'https://w3id.org/cwl/cwl#LoadListingRequirement': 'LoadListingRequirement', + 'https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement': 'MultipleInputFeatureRequirement', + 'https://w3id.org/cwl/cwl#NetworkAccess': 'NetworkAccess', + 'https://w3id.org/cwl/cwl#Operation': 'Operation', + 'https://w3id.org/cwl/cwl#OperationInputParameter': 'OperationInputParameter', + 'https://w3id.org/cwl/cwl#OperationOutputParameter': 'OperationOutputParameter', + 'https://w3id.org/cwl/cwl#OutputArraySchema': 'OutputArraySchema', + 'https://w3id.org/cwl/cwl#OutputEnumSchema': 'OutputEnumSchema', + 'https://w3id.org/cwl/cwl#OutputFormat': 'OutputFormat', + 'https://w3id.org/cwl/cwl#OutputParameter': 'OutputParameter', + 'https://w3id.org/cwl/cwl#OutputRecordField': 'OutputRecordField', + 'https://w3id.org/cwl/cwl#OutputRecordSchema': 'OutputRecordSchema', + 'https://w3id.org/cwl/cwl#OutputSchema': 'OutputSchema', + 'https://w3id.org/cwl/cwl#Parameter': 'Parameter', + 'https://w3id.org/cwl/cwl#PickValueMethod': 'PickValueMethod', + 'https://w3id.org/cwl/salad#PrimitiveType': 'PrimitiveType', + 'https://w3id.org/cwl/cwl#Process': 'Process', + 'https://w3id.org/cwl/cwl#ProcessRequirement': 'ProcessRequirement', + 'https://w3id.org/cwl/salad#RecordField': 'RecordField', + 'https://w3id.org/cwl/salad#RecordSchema': 'RecordSchema', + 'https://w3id.org/cwl/cwl#ResourceRequirement': 'ResourceRequirement', + 'https://w3id.org/cwl/cwl#ScatterFeatureRequirement': 'ScatterFeatureRequirement', + 'https://w3id.org/cwl/cwl#ScatterMethod': 'ScatterMethod', + 'https://w3id.org/cwl/cwl#SchemaDefRequirement': 'SchemaDefRequirement', + 'https://w3id.org/cwl/cwl#SecondaryFileSchema': 'SecondaryFileSchema', + 'https://w3id.org/cwl/cwl#ShellCommandRequirement': 'ShellCommandRequirement', + 'https://w3id.org/cwl/cwl#Sink': 'Sink', + 'https://w3id.org/cwl/cwl#SoftwarePackage': 'SoftwarePackage', + 'https://w3id.org/cwl/cwl#SoftwareRequirement': 'SoftwareRequirement', + 'https://w3id.org/cwl/cwl#StepInputExpressionRequirement': 'StepInputExpressionRequirement', + 'https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement': 'SubworkflowFeatureRequirement', + 'https://w3id.org/cwl/cwl#ToolTimeLimit': 'ToolTimeLimit', + 'https://w3id.org/cwl/cwl#WorkReuse': 'WorkReuse', + 'https://w3id.org/cwl/cwl#Workflow': 'Workflow', + 'https://w3id.org/cwl/cwl#WorkflowInputParameter': 'WorkflowInputParameter', + 'https://w3id.org/cwl/cwl#WorkflowOutputParameter': 'WorkflowOutputParameter', + 'https://w3id.org/cwl/cwl#WorkflowStep': 'WorkflowStep', + 'https://w3id.org/cwl/cwl#WorkflowStepInput': 'WorkflowStepInput', + 'https://w3id.org/cwl/cwl#WorkflowStepOutput': 'WorkflowStepOutput', + 'https://w3id.org/cwl/cwl#PickValueMethod/all_non_null': 'all_non_null', + 'https://w3id.org/cwl/salad#array': 'array', + 'http://www.w3.org/2001/XMLSchema#boolean': 'boolean', + 'https://w3id.org/cwl/cwl#LoadListingEnum/deep_listing': 'deep_listing', + 'https://w3id.org/cwl/cwl#ScatterMethod/dotproduct': 'dotproduct', + 'http://www.w3.org/2001/XMLSchema#double': 'double', + 'https://w3id.org/cwl/cwl#draft-2': 'draft-2', + 'https://w3id.org/cwl/cwl#draft-3': 'draft-3', + 'https://w3id.org/cwl/cwl#draft-3.dev1': 'draft-3.dev1', + 'https://w3id.org/cwl/cwl#draft-3.dev2': 'draft-3.dev2', + 'https://w3id.org/cwl/cwl#draft-3.dev3': 'draft-3.dev3', + 'https://w3id.org/cwl/cwl#draft-3.dev4': 'draft-3.dev4', + 'https://w3id.org/cwl/cwl#draft-3.dev5': 'draft-3.dev5', + 'https://w3id.org/cwl/cwl#draft-4.dev1': 'draft-4.dev1', + 'https://w3id.org/cwl/cwl#draft-4.dev2': 'draft-4.dev2', + 'https://w3id.org/cwl/cwl#draft-4.dev3': 'draft-4.dev3', + 'https://w3id.org/cwl/salad#enum': 'enum', + 'https://w3id.org/cwl/cwl#PickValueMethod/first_non_null': 'first_non_null', + 'https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct': 'flat_crossproduct', + 'http://www.w3.org/2001/XMLSchema#float': 'float', + 'http://www.w3.org/2001/XMLSchema#int': 'int', + 'http://www.w3.org/2001/XMLSchema#long': 'long', + 'https://w3id.org/cwl/cwl#LinkMergeMethod/merge_flattened': 'merge_flattened', + 'https://w3id.org/cwl/cwl#LinkMergeMethod/merge_nested': 'merge_nested', + 'https://w3id.org/cwl/cwl#ScatterMethod/nested_crossproduct': 'nested_crossproduct', + 'https://w3id.org/cwl/cwl#LoadListingEnum/no_listing': 'no_listing', + 'https://w3id.org/cwl/salad#null': 'null', + 'https://w3id.org/cwl/salad#record': 'record', + 'https://w3id.org/cwl/cwl#LoadListingEnum/shallow_listing': 'shallow_listing', + 'https://w3id.org/cwl/cwl#stderr': 'stderr', + 'https://w3id.org/cwl/cwl#stdin': 'stdin', + 'https://w3id.org/cwl/cwl#stdout': 'stdout', + 'http://www.w3.org/2001/XMLSchema#string': 'string', + 'https://w3id.org/cwl/cwl#PickValueMethod/the_only_non_null': 'the_only_non_null', + 'https://w3id.org/cwl/cwl#v1.0': 'v1.0', + 'https://w3id.org/cwl/cwl#v1.0.dev4': 'v1.0.dev4', + 'https://w3id.org/cwl/cwl#v1.1': 'v1.1', + 'https://w3id.org/cwl/cwl#v1.1.0-dev1': 'v1.1.0-dev1', + 'https://w3id.org/cwl/cwl#v1.2': 'v1.2', + 'https://w3id.org/cwl/cwl#v1.2.0-dev1': 'v1.2.0-dev1', + 'https://w3id.org/cwl/cwl#v1.2.0-dev2': 'v1.2.0-dev2', + 'https://w3id.org/cwl/cwl#v1.2.0-dev3': 'v1.2.0-dev3', + 'https://w3id.org/cwl/cwl#v1.2.0-dev4': 'v1.2.0-dev4', + 'https://w3id.org/cwl/cwl#v1.2.0-dev5': 'v1.2.0-dev5' +} diff --git a/src/workReuse.ts b/src/workReuse.ts new file mode 100644 index 0000000..c7270a2 --- /dev/null +++ b/src/workReuse.ts @@ -0,0 +1,151 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkReuse + * + * For implementations that support reusing output from past work (on + * the assumption that same code and same input produce same + * results), control whether to enable or disable the reuse behavior + * for a particular tool or step (to accomodate situations where that + * assumption is incorrect). A reused step is not executed but + * instead returns the same output as the original execution. + * + * If `WorkReuse` is not specified, correct tools should assume it + * is enabled by default. + * + */ +export class WorkReuse extends Saveable implements Internal.ProcessRequirement { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * Always 'WorkReuse' + */ + class_: string + enableReuse: boolean | string + + + constructor ({extensionFields, loadingOptions, class_, enableReuse} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, enableReuse: boolean | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.class_ = class_ + this.enableReuse = enableReuse + } + + /** + * Used to construct instances of {@link WorkReuse }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link WorkReuse } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriWorkReuse_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let enableReuse + try { + enableReuse = await loadField(_doc.enableReuse, LoaderInstances.unionOfbooltypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `enableReuse` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`class\`,\`enableReuse\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'WorkReuse'", errors) + } + + const schema = new WorkReuse({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + class_: class_, + enableReuse: enableReuse + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, baseUrl, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.enableReuse != null) { + r.enableReuse = save(this.enableReuse, false, baseUrl, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['class','enableReuse']) +} diff --git a/src/workflow.ts b/src/workflow.ts new file mode 100644 index 0000000..4af0288 --- /dev/null +++ b/src/workflow.ts @@ -0,0 +1,479 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#Workflow + * + * A workflow describes a set of **steps** and the **dependencies** between + * those steps. When a step produces output that will be consumed by a + * second step, the first step is a dependency of the second step. + * + * When there is a dependency, the workflow engine must execute the preceding + * step and wait for it to successfully produce output before executing the + * dependent step. If two steps are defined in the workflow graph that + * are not directly or indirectly dependent, these steps are **independent**, + * and may execute in any order or execute concurrently. A workflow is + * complete when all steps have been executed. + * + * Dependencies between parameters are expressed using the `source` + * field on [workflow step input parameters](#WorkflowStepInput) and + * `outputSource` field on [workflow output + * parameters](#WorkflowOutputParameter). + * + * The `source` field on each workflow step input parameter expresses + * the data links that contribute to the value of the step input + * parameter (the "sink"). A workflow step can only begin execution + * when every data link connected to a step has been fulfilled. + * + * The `outputSource` field on each workflow step input parameter + * expresses the data links that contribute to the value of the + * workflow output parameter (the "sink"). Workflow execution cannot + * complete successfully until every data link connected to an output + * parameter has been fulfilled. + * + * ## Workflow success and failure + * + * A completed step must result in one of `success`, `temporaryFailure` or + * `permanentFailure` states. An implementation may choose to retry a step + * execution which resulted in `temporaryFailure`. An implementation may + * choose to either continue running other steps of a workflow, or terminate + * immediately upon `permanentFailure`. + * + * * If any step of a workflow execution results in `permanentFailure`, then + * the workflow status is `permanentFailure`. + * + * * If one or more steps result in `temporaryFailure` and all other steps + * complete `success` or are not executed, then the workflow status is + * `temporaryFailure`. + * + * * If all workflow steps are executed and complete with `success`, then the + * workflow status is `success`. + * + * # Extensions + * + * [ScatterFeatureRequirement](#ScatterFeatureRequirement) and + * [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) are + * available as standard [extensions](#Extensions_and_Metadata) to core + * workflow semantics. + * + */ +export class Workflow extends Saveable implements Internal.Process { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent: undefined | Array + + /** + * The individual steps that make up the workflow. Each step is executed when all of its + * input data links are fufilled. An implementation may choose to execute + * the steps in a different order than listed and/or execute steps + * concurrently, provided that dependencies between steps are met. + * + */ + steps: Array + + + constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, steps} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string, steps: Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.class_ = class_ + this.label = label + this.doc = doc + this.inputs = inputs + this.outputs = outputs + this.requirements = requirements + this.hints = hints + this.cwlVersion = cwlVersion + this.intent = intent + this.steps = steps + } + + /** + * Used to construct instances of {@link Workflow }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link Workflow } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let class_ + try { + class_ = await loadField(_doc.class, LoaderInstances.uriWorkflow_classLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `class` field is not valid because: ', [e]) + ) + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let inputs + try { + inputs = await loadField(_doc.inputs, LoaderInstances.idmapinputsarrayOfWorkflowInputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputs` field is not valid because: ', [e]) + ) + } + } + + let outputs + try { + outputs = await loadField(_doc.outputs, LoaderInstances.idmapoutputsarrayOfWorkflowOutputParameterLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputs` field is not valid because: ', [e]) + ) + } + } + + let requirements + if ('requirements' in _doc) { + try { + requirements = await loadField(_doc.requirements, LoaderInstances.idmaprequirementsunionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `requirements` field is not valid because: ', [e]) + ) + } + } + } + + let hints + if ('hints' in _doc) { + try { + hints = await loadField(_doc.hints, LoaderInstances.idmaphintsunionOfundefinedtypeOrarrayOfanyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `hints` field is not valid because: ', [e]) + ) + } + } + } + + let cwlVersion + if ('cwlVersion' in _doc) { + try { + cwlVersion = await loadField(_doc.cwlVersion, LoaderInstances.uriunionOfundefinedtypeOrCWLVersionLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `cwlVersion` field is not valid because: ', [e]) + ) + } + } + } + + let intent + if ('intent' in _doc) { + try { + intent = await loadField(_doc.intent, LoaderInstances.uriunionOfundefinedtypeOrarrayOfstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `intent` field is not valid because: ', [e]) + ) + } + } + } + + let steps + try { + steps = await loadField(_doc.steps, LoaderInstances.idmapstepsunionOfarrayOfWorkflowStepLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `steps` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\`,\`steps\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'Workflow'", errors) + } + + const schema = new Workflow({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id, + label: label, + doc: doc, + inputs: inputs, + outputs: outputs, + requirements: requirements, + hints: hints, + cwlVersion: cwlVersion, + intent: intent, + class_: class_, + steps: steps + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.class_ != null) { + const u = saveRelativeUri(this.class_, this.id, false, + relativeUris, undefined) + if (u != null) { + r.class = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.inputs != null) { + r.inputs = save(this.inputs, false, this.id, relativeUris) + } + + if (this.outputs != null) { + r.outputs = save(this.outputs, false, this.id, relativeUris) + } + + if (this.requirements != null) { + r.requirements = save(this.requirements, false, this.id, relativeUris) + } + + if (this.hints != null) { + r.hints = save(this.hints, false, this.id, relativeUris) + } + + if (this.cwlVersion != null) { + const u = saveRelativeUri(this.cwlVersion, this.id, false, + relativeUris, undefined) + if (u != null) { + r.cwlVersion = u + } + } + + if (this.intent != null) { + const u = saveRelativeUri(this.intent, this.id, true, + relativeUris, undefined) + if (u != null) { + r.intent = u + } + } + + if (this.steps != null) { + r.steps = save(this.steps, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id','label','doc','inputs','outputs','requirements','hints','cwlVersion','intent','class','steps']) +} diff --git a/src/workflowInputParameter.ts b/src/workflowInputParameter.ts new file mode 100644 index 0000000..e95fe16 --- /dev/null +++ b/src/workflowInputParameter.ts @@ -0,0 +1,464 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkflowInputParameter + */ +export class WorkflowInputParameter extends Saveable implements Internal.InputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_: undefined | any + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + /** + * Deprecated. Preserved for v1.0 backwards compatability. Will be removed in + * CWL v2.0. Use `WorkflowInputParameter.loadContents` instead. + * + */ + inputBinding: undefined | Internal.InputBinding + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, default_: undefined | any, type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array, inputBinding: undefined | Internal.InputBinding,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.loadContents = loadContents + this.loadListing = loadListing + this.default_ = default_ + this.type = type + this.inputBinding = inputBinding + } + + /** + * Used to construct instances of {@link WorkflowInputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link WorkflowInputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + let default_ + if ('default' in _doc) { + try { + default_ = await loadField(_doc.default, LoaderInstances.unionOfundefinedtypeOranyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `default` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrInputRecordSchemaLoaderOrInputEnumSchemaLoaderOrInputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + let inputBinding + if ('inputBinding' in _doc) { + try { + inputBinding = await loadField(_doc.inputBinding, LoaderInstances.unionOfundefinedtypeOrInputBindingLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `inputBinding` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`loadContents\`,\`loadListing\`,\`default\`,\`type\`,\`inputBinding\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'WorkflowInputParameter'", errors) + } + + const schema = new WorkflowInputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + loadContents: loadContents, + loadListing: loadListing, + default_: default_, + type: type, + inputBinding: inputBinding + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, this.id, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, this.id, relativeUris) + } + + if (this.default_ != null) { + r.default = save(this.default_, false, this.id, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (this.inputBinding != null) { + r.inputBinding = save(this.inputBinding, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','loadContents','loadListing','default','type','inputBinding']) +} diff --git a/src/workflowOutputParameter.ts b/src/workflowOutputParameter.ts new file mode 100644 index 0000000..7449424 --- /dev/null +++ b/src/workflowOutputParameter.ts @@ -0,0 +1,431 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkflowOutputParameter + * + * Describe an output parameter of a workflow. The parameter must be + * connected to one or more parameters defined in the workflow that + * will provide the value of the output parameter. It is legal to + * connect a WorkflowInputParameter to a WorkflowOutputParameter. + * + * See [WorkflowStepInput](#WorkflowStepInput) for discussion of + * `linkMerge` and `pickValue`. + * + */ +export class WorkflowOutputParameter extends Saveable implements Internal.OutputParameter { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format: undefined | string + + /** + * Specifies one or more workflow parameters that supply the value of to + * the output parameter. + * + */ + outputSource: undefined | string | Array + + /** + * The method to use to merge multiple sources into a single array. + * If not specified, the default method is "merge_nested". + * + */ + linkMerge: undefined | string + + /** + * The method to use to choose non-null elements among multiple sources. + * + */ + pickValue: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + + constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, outputSource, linkMerge, pickValue, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, outputSource: undefined | string | Array, linkMerge: undefined | string, pickValue: undefined | string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.secondaryFiles = secondaryFiles + this.streamable = streamable + this.doc = doc + this.format = format + this.outputSource = outputSource + this.linkMerge = linkMerge + this.pickValue = pickValue + this.type = type + } + + /** + * Used to construct instances of {@link WorkflowOutputParameter }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link WorkflowOutputParameter } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let secondaryFiles + if ('secondaryFiles' in _doc) { + try { + secondaryFiles = await loadField(_doc.secondaryFiles, LoaderInstances.secondaryfilesdslunionOfundefinedtypeOrSecondaryFileSchemaLoaderOrarrayOfSecondaryFileSchemaLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) + ) + } + } + } + + let streamable + if ('streamable' in _doc) { + try { + streamable = await loadField(_doc.streamable, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `streamable` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let format + if ('format' in _doc) { + try { + format = await loadField(_doc.format, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrExpressionLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `format` field is not valid because: ', [e]) + ) + } + } + } + + let outputSource + if ('outputSource' in _doc) { + try { + outputSource = await loadField(_doc.outputSource, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeFalseFalse0, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `outputSource` field is not valid because: ', [e]) + ) + } + } + } + + let linkMerge + if ('linkMerge' in _doc) { + try { + linkMerge = await loadField(_doc.linkMerge, LoaderInstances.unionOfundefinedtypeOrLinkMergeMethodLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `linkMerge` field is not valid because: ', [e]) + ) + } + } + } + + let pickValue + if ('pickValue' in _doc) { + try { + pickValue = await loadField(_doc.pickValue, LoaderInstances.unionOfundefinedtypeOrPickValueMethodLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `pickValue` field is not valid because: ', [e]) + ) + } + } + } + + let type + try { + type = await loadField(_doc.type, LoaderInstances.typedslunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrOutputRecordSchemaLoaderOrOutputEnumSchemaLoaderOrOutputArraySchemaLoaderOrstrtype2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `type` field is not valid because: ', [e]) + ) + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`outputSource\`,\`linkMerge\`,\`pickValue\`,\`type\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'WorkflowOutputParameter'", errors) + } + + const schema = new WorkflowOutputParameter({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + label: label, + secondaryFiles: secondaryFiles, + streamable: streamable, + doc: doc, + id: id, + format: format, + outputSource: outputSource, + linkMerge: linkMerge, + pickValue: pickValue, + type: type + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.secondaryFiles != null) { + r.secondaryFiles = save(this.secondaryFiles, false, this.id, relativeUris) + } + + if (this.streamable != null) { + r.streamable = save(this.streamable, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.format != null) { + const u = saveRelativeUri(this.format, this.id, true, + relativeUris, undefined) + if (u != null) { + r.format = u + } + } + + if (this.outputSource != null) { + const u = saveRelativeUri(this.outputSource, this.id, false, + relativeUris, 0) + if (u != null) { + r.outputSource = u + } + } + + if (this.linkMerge != null) { + r.linkMerge = save(this.linkMerge, false, this.id, relativeUris) + } + + if (this.pickValue != null) { + r.pickValue = save(this.pickValue, false, this.id, relativeUris) + } + + if (this.type != null) { + r.type = save(this.type, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['label','secondaryFiles','streamable','doc','id','format','outputSource','linkMerge','pickValue','type']) +} diff --git a/src/workflowStep.ts b/src/workflowStep.ts new file mode 100644 index 0000000..b17a725 --- /dev/null +++ b/src/workflowStep.ts @@ -0,0 +1,489 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkflowStep + * + * A workflow step is an executable element of a workflow. It specifies the + * underlying process implementation (such as `CommandLineTool` or another + * `Workflow`) in the `run` field and connects the input and output parameters + * of the underlying process to workflow parameters. + * + * # Scatter/gather + * + * To use scatter/gather, + * [ScatterFeatureRequirement](#ScatterFeatureRequirement) must be specified + * in the workflow or workflow step requirements. + * + * A "scatter" operation specifies that the associated workflow step or + * subworkflow should execute separately over a list of input elements. Each + * job making up a scatter operation is independent and may be executed + * concurrently. + * + * The `scatter` field specifies one or more input parameters which will be + * scattered. An input parameter may be listed more than once. The declared + * type of each input parameter is implicitly becomes an array of items of the + * input parameter type. If a parameter is listed more than once, it becomes + * a nested array. As a result, upstream parameters which are connected to + * scattered parameters must be arrays. + * + * All output parameter types are also implicitly wrapped in arrays. Each job + * in the scatter results in an entry in the output array. + * + * If any scattered parameter runtime value is an empty array, all outputs are + * set to empty arrays and no work is done for the step, according to + * applicable scattering rules. + * + * If `scatter` declares more than one input parameter, `scatterMethod` + * describes how to decompose the input into a discrete set of jobs. + * + * * **dotproduct** specifies that each of the input arrays are aligned and one + * element taken from each array to construct each job. It is an error + * if all input arrays are not the same length. + * + * * **nested_crossproduct** specifies the Cartesian product of the inputs, + * producing a job for every combination of the scattered inputs. The + * output must be nested arrays for each level of scattering, in the + * order that the input arrays are listed in the `scatter` field. + * + * * **flat_crossproduct** specifies the Cartesian product of the inputs, + * producing a job for every combination of the scattered inputs. The + * output arrays must be flattened to a single level, but otherwise listed in the + * order that the input arrays are listed in the `scatter` field. + * + * # Conditional execution (Optional) + * + * Conditional execution makes execution of a step conditional on an + * expression. A step that is not executed is "skipped". A skipped + * step produces `null` for all output parameters. + * + * The condition is evaluated after `scatter`, using the input object + * of each individual scatter job. This means over a set of scatter + * jobs, some may be executed and some may be skipped. When the + * results are gathered, skipped steps must be `null` in the output + * arrays. + * + * The `when` field controls conditional execution. This is an + * expression that must be evaluated with `inputs` bound to the step + * input object (or individual scatter job), and returns a boolean + * value. It is an error if this expression returns a value other + * than `true` or `false`. + * + * Conditionals in CWL are an optional feature and are not required + * to be implemented by all consumers of CWL documents. An + * implementation that does not support conditionals must return a + * fatal error when attempting execute a workflow that uses + * conditional constructs the implementation does not support. + * + * # Subworkflows + * + * To specify a nested workflow as part of a workflow step, + * [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) must be + * specified in the workflow or workflow step requirements. + * + * It is a fatal error if a workflow directly or indirectly invokes itself as + * a subworkflow (recursive workflows are not allowed). + * + */ +export class WorkflowStep extends Saveable implements Internal.Identified, Internal.Labeled, Internal.Documented { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc: undefined | string | Array + + /** + * Defines the input parameters of the workflow step. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used build a user + * interface for constructing the input object. + * + */ + in_: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + out: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this workflow step. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this workflow step. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints: undefined | Array + + /** + * Specifies the process to run. + * + */ + run: string | Internal.CommandLineTool | Internal.ExpressionTool | Internal.Workflow | Internal.Operation + + /** + * If defined, only run the step when the expression evaluates to + * `true`. If `false` the step is skipped. A skipped step + * produces a `null` on each output. + * + */ + when: undefined | string + scatter: undefined | string | Array + + /** + * Required if `scatter` is an array of more than one element. + * + */ + scatterMethod: undefined | string + + + constructor ({extensionFields, loadingOptions, id, label, doc, in_, out, requirements, hints, run, when, scatter, scatterMethod} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, in_: Array, out: Array, requirements: undefined | Array, hints: undefined | Array, run: string | Internal.CommandLineTool | Internal.ExpressionTool | Internal.Workflow | Internal.Operation, when: undefined | string, scatter: undefined | string | Array, scatterMethod: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.label = label + this.doc = doc + this.in_ = in_ + this.out = out + this.requirements = requirements + this.hints = hints + this.run = run + this.when = when + this.scatter = scatter + this.scatterMethod = scatterMethod + } + + /** + * Used to construct instances of {@link WorkflowStep }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link WorkflowStep } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let doc + if ('doc' in _doc) { + try { + doc = await loadField(_doc.doc, LoaderInstances.unionOfundefinedtypeOrstrtypeOrarrayOfstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `doc` field is not valid because: ', [e]) + ) + } + } + } + + let in_ + try { + in_ = await loadField(_doc.in, LoaderInstances.idmapin_arrayOfWorkflowStepInputLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `in` field is not valid because: ', [e]) + ) + } + } + + let out + try { + out = await loadField(_doc.out, LoaderInstances.uriunionOfarrayOfunionOfstrtypeOrWorkflowStepOutputLoaderTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `out` field is not valid because: ', [e]) + ) + } + } + + let requirements + if ('requirements' in _doc) { + try { + requirements = await loadField(_doc.requirements, LoaderInstances.idmaprequirementsunionOfundefinedtypeOrarrayOfunionOfInlineJavascriptRequirementLoaderOrSchemaDefRequirementLoaderOrLoadListingRequirementLoaderOrDockerRequirementLoaderOrSoftwareRequirementLoaderOrInitialWorkDirRequirementLoaderOrEnvVarRequirementLoaderOrShellCommandRequirementLoaderOrResourceRequirementLoaderOrWorkReuseLoaderOrNetworkAccessLoaderOrInplaceUpdateRequirementLoaderOrToolTimeLimitLoaderOrSubworkflowFeatureRequirementLoaderOrScatterFeatureRequirementLoaderOrMultipleInputFeatureRequirementLoaderOrStepInputExpressionRequirementLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `requirements` field is not valid because: ', [e]) + ) + } + } + } + + let hints + if ('hints' in _doc) { + try { + hints = await loadField(_doc.hints, LoaderInstances.idmaphintsunionOfundefinedtypeOrarrayOfanyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `hints` field is not valid because: ', [e]) + ) + } + } + } + + let run + try { + run = await loadField(_doc.run, LoaderInstances.unionOfstrtypeOrCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `run` field is not valid because: ', [e]) + ) + } + } + + let when + if ('when' in _doc) { + try { + when = await loadField(_doc.when, LoaderInstances.unionOfundefinedtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `when` field is not valid because: ', [e]) + ) + } + } + } + + let scatter + if ('scatter' in _doc) { + try { + scatter = await loadField(_doc.scatter, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeFalseFalse0, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `scatter` field is not valid because: ', [e]) + ) + } + } + } + + let scatterMethod + if ('scatterMethod' in _doc) { + try { + scatterMethod = await loadField(_doc.scatterMethod, LoaderInstances.uriunionOfundefinedtypeOrScatterMethodLoaderFalseTrueNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `scatterMethod` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\`,\`label\`,\`doc\`,\`in\`,\`out\`,\`requirements\`,\`hints\`,\`run\`,\`when\`,\`scatter\`,\`scatterMethod\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'WorkflowStep'", errors) + } + + const schema = new WorkflowStep({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id, + label: label, + doc: doc, + in_: in_, + out: out, + requirements: requirements, + hints: hints, + run: run, + when: when, + scatter: scatter, + scatterMethod: scatterMethod + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.doc != null) { + r.doc = save(this.doc, false, this.id, relativeUris) + } + + if (this.in_ != null) { + r.in = save(this.in_, false, this.id, relativeUris) + } + + if (this.out != null) { + const u = saveRelativeUri(this.out, this.id, true, + relativeUris, undefined) + if (u != null) { + r.out = u + } + } + + if (this.requirements != null) { + r.requirements = save(this.requirements, false, this.id, relativeUris) + } + + if (this.hints != null) { + r.hints = save(this.hints, false, this.id, relativeUris) + } + + if (this.run != null) { + r.run = save(this.run, false, this.id, relativeUris) + } + + if (this.when != null) { + r.when = save(this.when, false, this.id, relativeUris) + } + + if (this.scatter != null) { + const u = saveRelativeUri(this.scatter, this.id, false, + relativeUris, 0) + if (u != null) { + r.scatter = u + } + } + + if (this.scatterMethod != null) { + const u = saveRelativeUri(this.scatterMethod, this.id, false, + relativeUris, undefined) + if (u != null) { + r.scatterMethod = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id','label','doc','in','out','requirements','hints','run','when','scatter','scatterMethod']) +} diff --git a/src/workflowStepInput.ts b/src/workflowStepInput.ts new file mode 100644 index 0000000..6d9dd0e --- /dev/null +++ b/src/workflowStepInput.ts @@ -0,0 +1,496 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkflowStepInput + * + * The input of a workflow step connects an upstream parameter (from the + * workflow inputs, or the outputs of other workflows steps) with the input + * parameters of the process specified by the `run` field. Only input parameters + * declared by the target process will be passed through at runtime to the process + * though additonal parameters may be specified (for use within `valueFrom` + * expressions for instance) - unconnected or unused parameters do not represent an + * error condition. + * + * # Input object + * + * A WorkflowStepInput object must contain an `id` field in the form + * `#fieldname` or `#prefix/fieldname`. When the `id` field contains a slash + * `/` the field name consists of the characters following the final slash + * (the prefix portion may contain one or more slashes to indicate scope). + * This defines a field of the workflow step input object with the value of + * the `source` parameter(s). + * + * # Merging multiple inbound data links + * + * To merge multiple inbound data links, + * [MultipleInputFeatureRequirement](#MultipleInputFeatureRequirement) must be specified + * in the workflow or workflow step requirements. + * + * If the sink parameter is an array, or named in a [workflow + * scatter](#WorkflowStep) operation, there may be multiple inbound + * data links listed in the `source` field. The values from the + * input links are merged depending on the method specified in the + * `linkMerge` field. If both `linkMerge` and `pickValue` are null + * or not specified, and there is more than one element in the + * `source` array, the default method is "merge_nested". + * + * If both `linkMerge` and `pickValue` are null or not specified, and + * there is only a single element in the `source`, then the input + * parameter takes the scalar value from the single input link (it is + * *not* wrapped in a single-list). + * + * * **merge_nested** + * + * The input must be an array consisting of exactly one entry for each + * input link. If "merge_nested" is specified with a single link, the value + * from the link must be wrapped in a single-item list. + * + * * **merge_flattened** + * + * 1. The source and sink parameters must be compatible types, or the source + * type must be compatible with single element from the "items" type of + * the destination array parameter. + * 2. Source parameters which are arrays are concatenated. + * Source parameters which are single element types are appended as + * single elements. + * + * # Picking non-null values among inbound data links + * + * If present, `pickValue` specifies how to picking non-null values among inbound data links. + * + * `pickValue` is evaluated + * 1. Once all source values from upstream step or parameters are available. + * 2. After `linkMerge`. + * 3. Before `scatter` or `valueFrom`. + * + * This is specifically intended to be useful in combination with + * [conditional execution](#WorkflowStep), where several upstream + * steps may be connected to a single input (`source` is a list), and + * skipped steps produce null values. + * + * Static type checkers should check for type consistency after infering what the type + * will be after `pickValue` is applied, just as they do currently for `linkMerge`. + * + * * **first_non_null** + * + * For the first level of a list input, pick the first non-null element. The result is a scalar. + * It is an error if there is no non-null element. Examples: + * * `[null, x, null, y] -> x` + * * `[null, [null], null, y] -> [null]` + * * `[null, null, null] -> Runtime Error` + * + * *Intended use case*: If-else pattern where the + * value comes either from a conditional step or from a default or + * fallback value. The conditional step(s) should be placed first in + * the list. + * + * * **the_only_non_null** + * + * For the first level of a list input, pick the single non-null element. The result is a scalar. + * It is an error if there is more than one non-null element. Examples: + * + * * `[null, x, null] -> x` + * * `[null, x, null, y] -> Runtime Error` + * * `[null, [null], null] -> [null]` + * * `[null, null, null] -> Runtime Error` + * + * *Intended use case*: Switch type patterns where developer considers + * more than one active code path as a workflow error + * (possibly indicating an error in writing `when` condition expressions). + * + * * **all_non_null** + * + * For the first level of a list input, pick all non-null values. + * The result is a list, which may be empty. Examples: + * + * * `[null, x, null] -> [x]` + * * `[x, null, y] -> [x, y]` + * * `[null, [x], [null]] -> [[x], [null]]` + * * `[null, null, null] -> []` + * + * *Intended use case*: It is valid to have more than one source, but + * sources are conditional, so null sources (from skipped steps) + * should be filtered out. + * + */ +export class WorkflowStepInput extends Saveable implements Internal.Identified, Internal.Sink, Internal.LoadContents, Internal.Labeled { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + /** + * Specifies one or more workflow parameters that will provide input to + * the underlying step parameter. + * + */ + source: undefined | string | Array + + /** + * The method to use to merge multiple inbound links into a single array. + * If not specified, the default method is "merge_nested". + * + */ + linkMerge: undefined | string + + /** + * The method to use to choose non-null elements among multiple sources. + * + */ + pickValue: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing: undefined | string + + /** + * A short, human-readable label of this object. + */ + label: undefined | string + + /** + * The default value for this parameter to use if either there is no + * `source` field, or the value produced by the `source` is `null`. The + * default must be applied prior to scattering or evaluating `valueFrom`. + * + */ + default_: undefined | any + + /** + * To use valueFrom, [StepInputExpressionRequirement](#StepInputExpressionRequirement) must + * be specified in the workflow or workflow step requirements. + * + * If `valueFrom` is a constant string value, use this as the value for + * this input parameter. + * + * If `valueFrom` is a parameter reference or expression, it must be + * evaluated to yield the actual value to be assiged to the input field. + * + * The `self` value in the parameter reference or expression must be + * 1. `null` if there is no `source` field + * 2. the value of the parameter(s) specified in the `source` field when this + * workflow input parameter **is not** specified in this workflow step's `scatter` field. + * 3. an element of the parameter specified in the `source` field when this workflow input + * parameter **is** specified in this workflow step's `scatter` field. + * + * The value of `inputs` in the parameter reference or expression must be + * the input object to the workflow step after assigning the `source` + * values, applying `default`, and then scattering. The order of + * evaluating `valueFrom` among step input parameters is undefined and the + * result of evaluating `valueFrom` on a parameter must not be visible to + * evaluation of `valueFrom` on other parameters. + * + */ + valueFrom: undefined | string + + + constructor ({extensionFields, loadingOptions, id, source, linkMerge, pickValue, loadContents, loadListing, label, default_, valueFrom} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, source: undefined | string | Array, linkMerge: undefined | string, pickValue: undefined | string, loadContents: undefined | boolean, loadListing: undefined | string, label: undefined | string, default_: undefined | any, valueFrom: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + this.source = source + this.linkMerge = linkMerge + this.pickValue = pickValue + this.loadContents = loadContents + this.loadListing = loadListing + this.label = label + this.default_ = default_ + this.valueFrom = valueFrom + } + + /** + * Used to construct instances of {@link WorkflowStepInput }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link WorkflowStepInput } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + let source + if ('source' in _doc) { + try { + source = await loadField(_doc.source, LoaderInstances.uriunionOfundefinedtypeOrstrtypeOrarrayOfstrtypeFalseFalse2, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `source` field is not valid because: ', [e]) + ) + } + } + } + + let linkMerge + if ('linkMerge' in _doc) { + try { + linkMerge = await loadField(_doc.linkMerge, LoaderInstances.unionOfundefinedtypeOrLinkMergeMethodLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `linkMerge` field is not valid because: ', [e]) + ) + } + } + } + + let pickValue + if ('pickValue' in _doc) { + try { + pickValue = await loadField(_doc.pickValue, LoaderInstances.unionOfundefinedtypeOrPickValueMethodLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `pickValue` field is not valid because: ', [e]) + ) + } + } + } + + let loadContents + if ('loadContents' in _doc) { + try { + loadContents = await loadField(_doc.loadContents, LoaderInstances.unionOfundefinedtypeOrbooltype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadContents` field is not valid because: ', [e]) + ) + } + } + } + + let loadListing + if ('loadListing' in _doc) { + try { + loadListing = await loadField(_doc.loadListing, LoaderInstances.unionOfundefinedtypeOrLoadListingEnumLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `loadListing` field is not valid because: ', [e]) + ) + } + } + } + + let label + if ('label' in _doc) { + try { + label = await loadField(_doc.label, LoaderInstances.unionOfundefinedtypeOrstrtype, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `label` field is not valid because: ', [e]) + ) + } + } + } + + let default_ + if ('default' in _doc) { + try { + default_ = await loadField(_doc.default, LoaderInstances.unionOfundefinedtypeOranyType, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `default` field is not valid because: ', [e]) + ) + } + } + } + + let valueFrom + if ('valueFrom' in _doc) { + try { + valueFrom = await loadField(_doc.valueFrom, LoaderInstances.unionOfundefinedtypeOrstrtypeOrExpressionLoader, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `valueFrom` field is not valid because: ', [e]) + ) + } + } + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\`,\`source\`,\`linkMerge\`,\`pickValue\`,\`loadContents\`,\`loadListing\`,\`label\`,\`default\`,\`valueFrom\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'WorkflowStepInput'", errors) + } + + const schema = new WorkflowStepInput({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id, + source: source, + linkMerge: linkMerge, + pickValue: pickValue, + loadContents: loadContents, + loadListing: loadListing, + label: label, + default_: default_, + valueFrom: valueFrom + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (this.source != null) { + const u = saveRelativeUri(this.source, this.id, false, + relativeUris, 2) + if (u != null) { + r.source = u + } + } + + if (this.linkMerge != null) { + r.linkMerge = save(this.linkMerge, false, this.id, relativeUris) + } + + if (this.pickValue != null) { + r.pickValue = save(this.pickValue, false, this.id, relativeUris) + } + + if (this.loadContents != null) { + r.loadContents = save(this.loadContents, false, this.id, relativeUris) + } + + if (this.loadListing != null) { + r.loadListing = save(this.loadListing, false, this.id, relativeUris) + } + + if (this.label != null) { + r.label = save(this.label, false, this.id, relativeUris) + } + + if (this.default_ != null) { + r.default = save(this.default_, false, this.id, relativeUris) + } + + if (this.valueFrom != null) { + r.valueFrom = save(this.valueFrom, false, this.id, relativeUris) + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id','source','linkMerge','pickValue','loadContents','loadListing','label','default','valueFrom']) +} diff --git a/src/workflowStepOutput.ts b/src/workflowStepOutput.ts new file mode 100644 index 0000000..2880653 --- /dev/null +++ b/src/workflowStepOutput.ts @@ -0,0 +1,144 @@ + +import { + Dictionary, + expandUrl, + loadField, + LoaderInstances, + LoadingOptions, + Saveable, + ValidationException, + prefixUrl, + save, + saveRelativeUri +} from './util/internal' +import { v4 as uuidv4 } from 'uuid' +import * as Internal from './util/internal' + + +/** + * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkflowStepOutput + * + * Associate an output parameter of the underlying process with a workflow + * parameter. The workflow parameter (given in the `id` field) be may be used + * as a `source` to connect with input parameters of other workflow steps, or + * with an output parameter of the process. + * + * A unique identifier for this workflow output parameter. This is + * the identifier to use in the `source` field of `WorkflowStepInput` + * to connect the output value to downstream parameters. + * + */ +export class WorkflowStepOutput extends Saveable implements Internal.Identified { + loadingOptions: LoadingOptions + extensionFields?: Dictionary + + /** + * The unique identifier for this object. + */ + id: undefined | string + + + constructor ({extensionFields, loadingOptions, id} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string,}) { + super() + this.extensionFields = extensionFields ?? {} + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + this.id = id + } + + /** + * Used to construct instances of {@link WorkflowStepOutput }. + * + * @param __doc Document fragment to load this record object from. + * @param baseuri Base URI to generate child document IDs against. + * @param loadingOptions Context for loading URIs and populating objects. + * @param docRoot ID at this position in the document (if available) + * @returns An instance of {@link WorkflowStepOutput } + * @throws {@link ValidationException} If the document fragment is not a + * {@link Dictionary} or validation of fields fails. + */ + static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, + docRoot?: string): Promise { + const _doc = Object.assign({}, __doc) + const errors: ValidationException[] = [] + + let id + if ('id' in _doc) { + try { + id = await loadField(_doc.id, LoaderInstances.uriunionOfundefinedtypeOrstrtypeTrueFalseNone, + baseuri, loadingOptions) + } catch (e) { + if (e instanceof ValidationException) { + errors.push( + new ValidationException('the `id` field is not valid because: ', [e]) + ) + } + } + } + + const originalidIsUndefined = (id === undefined) + if (originalidIsUndefined ) { + if (docRoot != null) { + id = docRoot + } else { + id = "_" + uuidv4() + } + } else { + baseuri = id as string + } + + const extensionFields: Dictionary = {} + for (const [key, value] of _doc) { + if (!this.attr.has(key)) { + if ((key as string).includes(':')) { + const ex = expandUrl(key, '', loadingOptions, false, false) + extensionFields[ex] = value + } else { + errors.push( + new ValidationException(`invalid field ${key as string}, \ + expected one of: \`id\``) + ) + break + } + } + } + + if (errors.length > 0) { + throw new ValidationException("Trying 'WorkflowStepOutput'", errors) + } + + const schema = new WorkflowStepOutput({ + extensionFields: extensionFields, + loadingOptions: loadingOptions, + id: id + }) + return schema + } + + save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true) + : Dictionary { + const r: Dictionary = {} + for (const ef in this.extensionFields) { + r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef + } + + if (this.id != null) { + const u = saveRelativeUri(this.id, baseUrl, true, + relativeUris, undefined) + if (u != null) { + r.id = u + } + } + + if (top) { + if (this.loadingOptions.namespaces != null) { + r.$namespaces = this.loadingOptions.namespaces + } + if (this.loadingOptions.schemas != null) { + r.$schemas = this.loadingOptions.schemas + } + } + return r + } + + static attr: Set = new Set(['id']) +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c689a3c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "target": "es5", + "module": "commonjs", + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + "forceConsistentCasingInFileNames": true, + "strict": true, + "declaration": true, + "noImplicitOverride": true, + "sourceMap": true + }, + "include": ["./src/**/*"], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file From b55af9e1dae18d7304491521b2edb080abcc2c46 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 10:25:34 +0100 Subject: [PATCH 02/19] Change package name to cwl-ts-auto --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ecc2010..5b4817e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "test", + "name": "cwl-ts-auto", "version": "0.0.1-SNAPSHOT", "description": "This project contains TypeScript objects and utilities auto-generated by Schema Salad for parsing documents corresponding to the https://w3id.org/cwl/cwl# schema.", "main": "index.js", From ba67f97756d39b21b4785f8c3b4bfe03e6f6ab3d Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 10:25:51 +0100 Subject: [PATCH 03/19] Change typescript target to es6 --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index c689a3c..7fbb2e4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "./dist", - "target": "es5", + "target": "es6", "module": "commonjs", "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ "forceConsistentCasingInFileNames": true, From 44813fa1bb57410f9d9e6c225aa731d3d75943f6 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 10:26:57 +0100 Subject: [PATCH 04/19] Add some example tests --- src/test/data/examples/valid-binding-test.cwl | 32 +++ src/test/data/examples/valid-bwa-mem-tool.cwl | 61 +++++ src/test/data/examples/valid-tmap-tool.cwl | 257 ++++++++++++++++++ src/test/exampleTest.ts | 28 ++ 4 files changed, 378 insertions(+) create mode 100755 src/test/data/examples/valid-binding-test.cwl create mode 100755 src/test/data/examples/valid-bwa-mem-tool.cwl create mode 100755 src/test/data/examples/valid-tmap-tool.cwl create mode 100644 src/test/exampleTest.ts diff --git a/src/test/data/examples/valid-binding-test.cwl b/src/test/data/examples/valid-binding-test.cwl new file mode 100755 index 0000000..dc51ed1 --- /dev/null +++ b/src/test/data/examples/valid-binding-test.cwl @@ -0,0 +1,32 @@ +#!/usr/bin/env cwl-runner + +class: CommandLineTool +cwlVersion: v1.2 +hints: + - class: DockerRequirement + dockerPull: docker.io/python:3-slim +inputs: + - id: reference + type: File + inputBinding: { position: 2 } + + - id: reads + type: + type: array + items: File + inputBinding: { prefix: "-YYY" } + inputBinding: { position: 3, prefix: "-XXX" } + + - id: "#args.py" + type: File + default: + class: File + location: args.py + inputBinding: + position: -1 + +outputs: + args: string[] + +baseCommand: python +arguments: ["bwa", "mem"] diff --git a/src/test/data/examples/valid-bwa-mem-tool.cwl b/src/test/data/examples/valid-bwa-mem-tool.cwl new file mode 100755 index 0000000..26deb38 --- /dev/null +++ b/src/test/data/examples/valid-bwa-mem-tool.cwl @@ -0,0 +1,61 @@ +#!/usr/bin/env cwl-runner + +cwlVersion: v1.2 + +class: CommandLineTool + +hints: + - class: ResourceRequirement + coresMin: 2 + - class: DockerRequirement + dockerPull: docker.io/python:3-slim + +inputs: + - id: reference + type: File + inputBinding: { position: 2 } + + - id: reads + type: + type: array + items: File + inputBinding: { position: 3 } + + - id: minimum_seed_length + type: int + inputBinding: { position: 1, prefix: -m } + + - id: min_std_max_min + type: { type: array, items: int } + inputBinding: + position: 1 + prefix: -I + itemSeparator: "," + + - id: args.py + type: File + default: + class: File + location: args.py + inputBinding: + position: -1 + +outputs: + - id: sam + type: ["null", File] + outputBinding: { glob: output.sam } + - id: args + type: + type: array + items: string + +baseCommand: python + +arguments: + - bwa + - mem + - valueFrom: $(runtime.cores) + position: 1 + prefix: -t + +stdout: output.sam diff --git a/src/test/data/examples/valid-tmap-tool.cwl b/src/test/data/examples/valid-tmap-tool.cwl new file mode 100755 index 0000000..58f7539 --- /dev/null +++ b/src/test/data/examples/valid-tmap-tool.cwl @@ -0,0 +1,257 @@ +#!/usr/bin/env cwl-runner +{ + "cwlVersion": "v1.2", + + "class": "CommandLineTool", + "hints": [ + { + "class": "DockerRequirement", + "dockerPull": "python:2-slim" + } + ], + "inputs": [ + { + "id": "reads", + "type": "File" + }, + { + "id": "stages", + "inputBinding": { + "position": 1 + }, + "type": { + "type": "array", + "items": "#Stage" + } + }, + { + id: "#args.py", + type: File, + default: { + class: File, + location: args.py + }, + inputBinding: { + position: -1 + } + } + ], + "outputs": [ + { + "id": "sam", + "outputBinding": { + "glob": "output.sam" + }, + "type": ["null", "File"] + }, + {"id": "args", "type": "string[]"} + ], + "requirements": [ + {"class": "SchemaDefRequirement", + "types": [ + { + "fields": [ + { + "inputBinding": { + "position": 0 + }, + "name": "algo", + "type": { + "type": "enum", + "name": "JustMap1", + "symbols": ["map1"] + } + }, + { + "name": "maxSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--max-seq-length", + "position": 2 + } + }, + { + "name": "minSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--min-seq-length", + "position": 2 + } + }, + { + "inputBinding": { + "position": 2, + "prefix": "--seed-length" + }, + "name": "seedLength", + "type": ["null", "int"] + } + ], + "name": "Map1", + "type": "record" + }, + { + "fields": [ + { + "inputBinding": { + "position": 0 + }, + "name": "algo", + "type": { + "type": "enum", + "name": "JustMap2", + "symbols": ["map2"] + } + }, + { + "name": "maxSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--max-seq-length", + "position": 2 + } + }, + { + "name": "minSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--min-seq-length", + "position": 2 + } + }, + { + "inputBinding": { + "position": 2, + "prefix": "--max-seed-hits" + }, + "name": "maxSeedHits", + "type": ["null", "int"] + } + ], + "name": "Map2", + "type": "record" + }, + { + "fields": [ + { + "inputBinding": { + "position": 0 + }, + "name": "algo", + "type": { + "type": "enum", + "name": "JustMap3", + "symbols": ["map3"] + } + }, + { + "name": "maxSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--max-seq-length", + "position": 2 + } + }, + { + "name": "minSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--min-seq-length", + "position": 2 + } + }, + { + "inputBinding": { + "position": 2, + "prefix": "--fwd-search" + }, + "name": "fwdSearch", + "type": ["null", "boolean"] + } + ], + "name": "Map3", + "type": "record" + }, + { + "fields": [ + { + "inputBinding": { + "position": 0 + }, + "name": "algo", + "type": { + "type": "enum", + "name": "JustMap4", + "symbols": ["map4"] + } + }, + { + "name": "maxSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--max-seq-length", + "position": 2 + } + }, + { + "name": "minSeqLen", + "type": ["null", "int"], + "inputBinding": { + "prefix": "--min-seq-length", + "position": 2 + } + }, + { + "inputBinding": { + "position": 2, + "prefix": "--seed-step" + }, + "name": "seedStep", + "type": ["null", "int"] + } + ], + "name": "Map4", + "type": "record" + }, + { + "type": "record", + "name": "Stage", + "fields": [ + { + "inputBinding": { + "position": 0, + "prefix": "stage", + "separate": false + }, + "name": "stageId", + "type": ["null", "int"] + }, + { + "inputBinding": { + "position": 1, + "prefix": "-n" + }, + "name": "stageOption1", + "type": ["null", "boolean"] + }, + { + "inputBinding": { + "position": 2 + }, + "name": "algos", + "type": { + "type": "array", + "items": [ + "#Map1", + "#Map2", + "#Map3", + "#Map4" + ] + } + } + ] + } + ]}], + "baseCommand": "python", + "arguments": ["tmap", "mapall"] +} diff --git a/src/test/exampleTest.ts b/src/test/exampleTest.ts new file mode 100644 index 0000000..56c124b --- /dev/null +++ b/src/test/exampleTest.ts @@ -0,0 +1,28 @@ + +import { loadDocument, loadDocumentByString } from '../' +import fs from 'fs' + +describe('Example Tests', () => { + + it('valid_bwa_mem_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-bwa-mem-tool.cwl') + }) + it('valid_bwa_mem_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-bwa-mem-tool.cwl').toString() + await loadDocumentByString(doc, '') + }) + it('valid_binding_test', async () => { + await loadDocument(__dirname + '/data/examples/valid-binding-test.cwl') + }) + it('valid_binding_test by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-binding-test.cwl').toString() + await loadDocumentByString(doc, '') + }) + it('valid_tmap_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-tmap-tool.cwl') + }) + it('valid_tmap_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-tmap-tool.cwl').toString() + await loadDocumentByString(doc, '') + }) +}) From af823a5a1737fcc0403116505f6d3e842c9d3ffe Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 10:27:50 +0100 Subject: [PATCH 05/19] Fix bug in expandUrl which lead to custom types crashing the program --- src/util/loaders/loader.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/loaders/loader.ts b/src/util/loaders/loader.ts index 1827b8b..5cb263d 100644 --- a/src/util/loaders/loader.ts +++ b/src/util/loaders/loader.ts @@ -93,9 +93,9 @@ export function expandUrl (url: string, baseUrl: string, loadingOptions: Loading if (split.scheme !== undefined) { if (url in loadingOptions.rvocab) { return loadingOptions.rvocab[url] - } else { - throw new ValidationException(`Term '${url}' not in vocabulary`) - } + } + } else { + throw new ValidationException(`Term '${url}' not in vocabulary`) } } return url From 182c47b22ebed193c839aa8a69a9b7b07310b775 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 10:28:37 +0100 Subject: [PATCH 06/19] Fix bug in loading of extensionFields --- src/arraySchema.ts | 4 ++-- src/commandInputArraySchema.ts | 4 ++-- src/commandInputEnumSchema.ts | 4 ++-- src/commandInputParameter.ts | 4 ++-- src/commandInputRecordField.ts | 4 ++-- src/commandInputRecordSchema.ts | 4 ++-- src/commandLineBindable.ts | 4 ++-- src/commandLineBinding.ts | 4 ++-- src/commandLineTool.ts | 4 ++-- src/commandOutputArraySchema.ts | 4 ++-- src/commandOutputBinding.ts | 4 ++-- src/commandOutputEnumSchema.ts | 4 ++-- src/commandOutputParameter.ts | 4 ++-- src/commandOutputRecordField.ts | 4 ++-- src/commandOutputRecordSchema.ts | 4 ++-- src/directory.ts | 4 ++-- src/dirent.ts | 4 ++-- src/dockerRequirement.ts | 4 ++-- src/enumSchema.ts | 4 ++-- src/envVarRequirement.ts | 4 ++-- src/environmentDef.ts | 4 ++-- src/expressionTool.ts | 4 ++-- src/expressionToolOutputParameter.ts | 4 ++-- src/file.ts | 4 ++-- src/initialWorkDirRequirement.ts | 4 ++-- src/inlineJavascriptRequirement.ts | 4 ++-- src/inplaceUpdateRequirement.ts | 4 ++-- src/inputArraySchema.ts | 4 ++-- src/inputBinding.ts | 4 ++-- src/inputEnumSchema.ts | 4 ++-- src/inputRecordField.ts | 4 ++-- src/inputRecordSchema.ts | 4 ++-- src/loadListingRequirement.ts | 4 ++-- src/multipleInputFeatureRequirement.ts | 4 ++-- src/networkAccess.ts | 4 ++-- src/operation.ts | 4 ++-- src/operationInputParameter.ts | 4 ++-- src/operationOutputParameter.ts | 4 ++-- src/outputArraySchema.ts | 4 ++-- src/outputEnumSchema.ts | 4 ++-- src/outputRecordField.ts | 4 ++-- src/outputRecordSchema.ts | 4 ++-- src/recordField.ts | 4 ++-- src/recordSchema.ts | 4 ++-- src/resourceRequirement.ts | 4 ++-- src/scatterFeatureRequirement.ts | 4 ++-- src/schemaDefRequirement.ts | 4 ++-- src/secondaryFileSchema.ts | 4 ++-- src/shellCommandRequirement.ts | 4 ++-- src/softwarePackage.ts | 4 ++-- src/softwareRequirement.ts | 4 ++-- src/stepInputExpressionRequirement.ts | 4 ++-- src/subworkflowFeatureRequirement.ts | 4 ++-- src/toolTimeLimit.ts | 4 ++-- src/workReuse.ts | 4 ++-- src/workflow.ts | 4 ++-- src/workflowInputParameter.ts | 4 ++-- src/workflowOutputParameter.ts | 4 ++-- src/workflowStep.ts | 4 ++-- src/workflowStepInput.ts | 4 ++-- src/workflowStepOutput.ts | 4 ++-- 61 files changed, 122 insertions(+), 122 deletions(-) diff --git a/src/arraySchema.ts b/src/arraySchema.ts index 5aeb941..4d61790 100644 --- a/src/arraySchema.ts +++ b/src/arraySchema.ts @@ -82,8 +82,8 @@ export class ArraySchema extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ArraySchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandInputArraySchema.ts b/src/commandInputArraySchema.ts index db94fe7..66bc139 100644 --- a/src/commandInputArraySchema.ts +++ b/src/commandInputArraySchema.ts @@ -173,8 +173,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandInputArraySchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandInputEnumSchema.ts b/src/commandInputEnumSchema.ts index 5585d8d..4785774 100644 --- a/src/commandInputEnumSchema.ts +++ b/src/commandInputEnumSchema.ts @@ -173,8 +173,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandInputEnumSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandInputParameter.ts b/src/commandInputParameter.ts index 992aa7f..975eb1f 100644 --- a/src/commandInputParameter.ts +++ b/src/commandInputParameter.ts @@ -355,8 +355,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandInputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandInputRecordField.ts b/src/commandInputRecordField.ts index 9560b9c..fd59016 100644 --- a/src/commandInputRecordField.ts +++ b/src/commandInputRecordField.ts @@ -328,8 +328,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandInputRecordField.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandInputRecordSchema.ts b/src/commandInputRecordSchema.ts index f0d3400..6c6354e 100644 --- a/src/commandInputRecordSchema.ts +++ b/src/commandInputRecordSchema.ts @@ -175,8 +175,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandInputRecordSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandLineBindable.ts b/src/commandLineBindable.ts index b419b9f..abbdeee 100644 --- a/src/commandLineBindable.ts +++ b/src/commandLineBindable.ts @@ -66,8 +66,8 @@ export class CommandLineBindable extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandLineBindable.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandLineBinding.ts b/src/commandLineBinding.ts index e3b81f7..9757ae6 100644 --- a/src/commandLineBinding.ts +++ b/src/commandLineBinding.ts @@ -260,8 +260,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandLineBinding.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandLineTool.ts b/src/commandLineTool.ts index 830745c..eaefcc1 100644 --- a/src/commandLineTool.ts +++ b/src/commandLineTool.ts @@ -496,8 +496,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandLineTool.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandOutputArraySchema.ts b/src/commandOutputArraySchema.ts index 5b7e9a1..f0bc289 100644 --- a/src/commandOutputArraySchema.ts +++ b/src/commandOutputArraySchema.ts @@ -153,8 +153,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandOutputArraySchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandOutputBinding.ts b/src/commandOutputBinding.ts index b9cc234..1eead9d 100644 --- a/src/commandOutputBinding.ts +++ b/src/commandOutputBinding.ts @@ -210,8 +210,8 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandOutputBinding.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandOutputEnumSchema.ts b/src/commandOutputEnumSchema.ts index 830d33c..e942347 100644 --- a/src/commandOutputEnumSchema.ts +++ b/src/commandOutputEnumSchema.ts @@ -153,8 +153,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandOutputEnumSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandOutputParameter.ts b/src/commandOutputParameter.ts index 7b13b21..b89dfe7 100644 --- a/src/commandOutputParameter.ts +++ b/src/commandOutputParameter.ts @@ -269,8 +269,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandOutputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandOutputRecordField.ts b/src/commandOutputRecordField.ts index e58a524..ee5a312 100644 --- a/src/commandOutputRecordField.ts +++ b/src/commandOutputRecordField.ts @@ -270,8 +270,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandOutputRecordField.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/commandOutputRecordSchema.ts b/src/commandOutputRecordSchema.ts index eb124a1..361ce8c 100644 --- a/src/commandOutputRecordSchema.ts +++ b/src/commandOutputRecordSchema.ts @@ -155,8 +155,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!CommandOutputRecordSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/directory.ts b/src/directory.ts index 65ec6ef..46711b6 100644 --- a/src/directory.ts +++ b/src/directory.ts @@ -236,8 +236,8 @@ export class Directory extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!Directory.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/dirent.ts b/src/dirent.ts index 13c8498..22b3891 100644 --- a/src/dirent.ts +++ b/src/dirent.ts @@ -179,8 +179,8 @@ export class Dirent extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!Dirent.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/dockerRequirement.ts b/src/dockerRequirement.ts index 62cdd43..50251f2 100644 --- a/src/dockerRequirement.ts +++ b/src/dockerRequirement.ts @@ -246,8 +246,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!DockerRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/enumSchema.ts b/src/enumSchema.ts index b8156d0..1384f23 100644 --- a/src/enumSchema.ts +++ b/src/enumSchema.ts @@ -85,8 +85,8 @@ export class EnumSchema extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!EnumSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/envVarRequirement.ts b/src/envVarRequirement.ts index 2e1347c..0313c27 100644 --- a/src/envVarRequirement.ts +++ b/src/envVarRequirement.ts @@ -86,8 +86,8 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!EnvVarRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/environmentDef.ts b/src/environmentDef.ts index 17d97d4..a9de6d8 100644 --- a/src/environmentDef.ts +++ b/src/environmentDef.ts @@ -87,8 +87,8 @@ export class EnvironmentDef extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!EnvironmentDef.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/expressionTool.ts b/src/expressionTool.ts index bfa9833..5e1b2df 100644 --- a/src/expressionTool.ts +++ b/src/expressionTool.ts @@ -315,8 +315,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ExpressionTool.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/expressionToolOutputParameter.ts b/src/expressionToolOutputParameter.ts index fd725b3..ce00c74 100644 --- a/src/expressionToolOutputParameter.ts +++ b/src/expressionToolOutputParameter.ts @@ -247,8 +247,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ExpressionToolOutputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/file.ts b/src/file.ts index 64d18e0..9d4ab5c 100644 --- a/src/file.ts +++ b/src/file.ts @@ -462,8 +462,8 @@ export class File extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!File.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/initialWorkDirRequirement.ts b/src/initialWorkDirRequirement.ts index 0501e8d..21026e8 100644 --- a/src/initialWorkDirRequirement.ts +++ b/src/initialWorkDirRequirement.ts @@ -109,8 +109,8 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InitialWorkDirRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inlineJavascriptRequirement.ts b/src/inlineJavascriptRequirement.ts index 42a5743..1e079aa 100644 --- a/src/inlineJavascriptRequirement.ts +++ b/src/inlineJavascriptRequirement.ts @@ -92,8 +92,8 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InlineJavascriptRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inplaceUpdateRequirement.ts b/src/inplaceUpdateRequirement.ts index bd7afd9..8c43f02 100644 --- a/src/inplaceUpdateRequirement.ts +++ b/src/inplaceUpdateRequirement.ts @@ -110,8 +110,8 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InplaceUpdateRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inputArraySchema.ts b/src/inputArraySchema.ts index a1a6e61..ab418c2 100644 --- a/src/inputArraySchema.ts +++ b/src/inputArraySchema.ts @@ -153,8 +153,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InputArraySchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inputBinding.ts b/src/inputBinding.ts index d89e7ea..6f323e5 100644 --- a/src/inputBinding.ts +++ b/src/inputBinding.ts @@ -69,8 +69,8 @@ export class InputBinding extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InputBinding.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inputEnumSchema.ts b/src/inputEnumSchema.ts index f797030..2388192 100644 --- a/src/inputEnumSchema.ts +++ b/src/inputEnumSchema.ts @@ -153,8 +153,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InputEnumSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inputRecordField.ts b/src/inputRecordField.ts index b72dbf7..7e95582 100644 --- a/src/inputRecordField.ts +++ b/src/inputRecordField.ts @@ -308,8 +308,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InputRecordField.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/inputRecordSchema.ts b/src/inputRecordSchema.ts index 53ea118..76414a6 100644 --- a/src/inputRecordSchema.ts +++ b/src/inputRecordSchema.ts @@ -155,8 +155,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!InputRecordSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/loadListingRequirement.ts b/src/loadListingRequirement.ts index 1ef42c2..4a199f4 100644 --- a/src/loadListingRequirement.ts +++ b/src/loadListingRequirement.ts @@ -84,8 +84,8 @@ export class LoadListingRequirement extends Saveable implements Internal.Process } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!LoadListingRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/multipleInputFeatureRequirement.ts b/src/multipleInputFeatureRequirement.ts index edfefd6..ec24e65 100644 --- a/src/multipleInputFeatureRequirement.ts +++ b/src/multipleInputFeatureRequirement.ts @@ -68,8 +68,8 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!MultipleInputFeatureRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/networkAccess.ts b/src/networkAccess.ts index a1539d8..10aba44 100644 --- a/src/networkAccess.ts +++ b/src/networkAccess.ts @@ -95,8 +95,8 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!NetworkAccess.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/operation.ts b/src/operation.ts index 6c3c7c2..ccacca0 100644 --- a/src/operation.ts +++ b/src/operation.ts @@ -294,8 +294,8 @@ export class Operation extends Saveable implements Internal.Process { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!Operation.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/operationInputParameter.ts b/src/operationInputParameter.ts index 1ed30fc..45e8132 100644 --- a/src/operationInputParameter.ts +++ b/src/operationInputParameter.ts @@ -334,8 +334,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!OperationInputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/operationOutputParameter.ts b/src/operationOutputParameter.ts index 7e2f882..db50c5b 100644 --- a/src/operationOutputParameter.ts +++ b/src/operationOutputParameter.ts @@ -250,8 +250,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!OperationOutputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/outputArraySchema.ts b/src/outputArraySchema.ts index d3a5676..c14ace8 100644 --- a/src/outputArraySchema.ts +++ b/src/outputArraySchema.ts @@ -153,8 +153,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!OutputArraySchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/outputEnumSchema.ts b/src/outputEnumSchema.ts index d2ee07e..bd16f3d 100644 --- a/src/outputEnumSchema.ts +++ b/src/outputEnumSchema.ts @@ -153,8 +153,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!OutputEnumSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/outputRecordField.ts b/src/outputRecordField.ts index 2eb685b..4a4b14c 100644 --- a/src/outputRecordField.ts +++ b/src/outputRecordField.ts @@ -248,8 +248,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!OutputRecordField.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/outputRecordSchema.ts b/src/outputRecordSchema.ts index 0178c52..fc96483 100644 --- a/src/outputRecordSchema.ts +++ b/src/outputRecordSchema.ts @@ -155,8 +155,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!OutputRecordSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/recordField.ts b/src/recordField.ts index 86d990a..571d8b3 100644 --- a/src/recordField.ts +++ b/src/recordField.ts @@ -119,8 +119,8 @@ export class RecordField extends Saveable implements Internal.Documented { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!RecordField.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/recordSchema.ts b/src/recordSchema.ts index 3bcbb1a..eb4a2cd 100644 --- a/src/recordSchema.ts +++ b/src/recordSchema.ts @@ -84,8 +84,8 @@ export class RecordSchema extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!RecordSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/resourceRequirement.ts b/src/resourceRequirement.ts index edb9644..8415d9c 100644 --- a/src/resourceRequirement.ts +++ b/src/resourceRequirement.ts @@ -309,8 +309,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ResourceRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/scatterFeatureRequirement.ts b/src/scatterFeatureRequirement.ts index 190bc59..3e1c071 100644 --- a/src/scatterFeatureRequirement.ts +++ b/src/scatterFeatureRequirement.ts @@ -68,8 +68,8 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ScatterFeatureRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/schemaDefRequirement.ts b/src/schemaDefRequirement.ts index b89f289..0f3da6a 100644 --- a/src/schemaDefRequirement.ts +++ b/src/schemaDefRequirement.ts @@ -96,8 +96,8 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!SchemaDefRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/secondaryFileSchema.ts b/src/secondaryFileSchema.ts index b9ba4be..b8c4f29 100644 --- a/src/secondaryFileSchema.ts +++ b/src/secondaryFileSchema.ts @@ -152,8 +152,8 @@ export class SecondaryFileSchema extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!SecondaryFileSchema.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/shellCommandRequirement.ts b/src/shellCommandRequirement.ts index 4a07c35..9bc4a20 100644 --- a/src/shellCommandRequirement.ts +++ b/src/shellCommandRequirement.ts @@ -73,8 +73,8 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ShellCommandRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/softwarePackage.ts b/src/softwarePackage.ts index dfc2f32..98dc328 100644 --- a/src/softwarePackage.ts +++ b/src/softwarePackage.ts @@ -150,8 +150,8 @@ export class SoftwarePackage extends Saveable { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!SoftwarePackage.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/softwareRequirement.ts b/src/softwareRequirement.ts index 7bec1f6..cde0ebd 100644 --- a/src/softwareRequirement.ts +++ b/src/softwareRequirement.ts @@ -86,8 +86,8 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!SoftwareRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/stepInputExpressionRequirement.ts b/src/stepInputExpressionRequirement.ts index 45fe874..333e326 100644 --- a/src/stepInputExpressionRequirement.ts +++ b/src/stepInputExpressionRequirement.ts @@ -68,8 +68,8 @@ export class StepInputExpressionRequirement extends Saveable implements Internal } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!StepInputExpressionRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/subworkflowFeatureRequirement.ts b/src/subworkflowFeatureRequirement.ts index d84b5a9..c7d0b73 100644 --- a/src/subworkflowFeatureRequirement.ts +++ b/src/subworkflowFeatureRequirement.ts @@ -68,8 +68,8 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!SubworkflowFeatureRequirement.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/toolTimeLimit.ts b/src/toolTimeLimit.ts index c02b337..7720764 100644 --- a/src/toolTimeLimit.ts +++ b/src/toolTimeLimit.ts @@ -93,8 +93,8 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!ToolTimeLimit.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workReuse.ts b/src/workReuse.ts index c7270a2..d6f5c9b 100644 --- a/src/workReuse.ts +++ b/src/workReuse.ts @@ -89,8 +89,8 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!WorkReuse.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workflow.ts b/src/workflow.ts index 4af0288..032ee89 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -360,8 +360,8 @@ export class Workflow extends Saveable implements Internal.Process { } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!Workflow.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workflowInputParameter.ts b/src/workflowInputParameter.ts index e95fe16..202bdb5 100644 --- a/src/workflowInputParameter.ts +++ b/src/workflowInputParameter.ts @@ -353,8 +353,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!WorkflowInputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workflowOutputParameter.ts b/src/workflowOutputParameter.ts index 7449424..8a6b8b2 100644 --- a/src/workflowOutputParameter.ts +++ b/src/workflowOutputParameter.ts @@ -321,8 +321,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!WorkflowOutputParameter.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workflowStep.ts b/src/workflowStep.ts index b17a725..077c68c 100644 --- a/src/workflowStep.ts +++ b/src/workflowStep.ts @@ -370,8 +370,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!WorkflowStep.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workflowStepInput.ts b/src/workflowStepInput.ts index 6d9dd0e..b365af1 100644 --- a/src/workflowStepInput.ts +++ b/src/workflowStepInput.ts @@ -395,8 +395,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!WorkflowStepInput.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value diff --git a/src/workflowStepOutput.ts b/src/workflowStepOutput.ts index 2880653..5f66a1a 100644 --- a/src/workflowStepOutput.ts +++ b/src/workflowStepOutput.ts @@ -87,8 +87,8 @@ export class WorkflowStepOutput extends Saveable implements Internal.Identified } const extensionFields: Dictionary = {} - for (const [key, value] of _doc) { - if (!this.attr.has(key)) { + for (const [key, value] of Object.entries(_doc)) { + if (!WorkflowStepOutput.attr.has(key)) { if ((key as string).includes(':')) { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value From 50091ce36c455478478f81094c4f46b26c4f93d1 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 13:49:17 +0100 Subject: [PATCH 07/19] - Add more tests - Fix bug that caused exceptions not getting thrown - Fix loadDocumentByString tests baseuri parameter --- src/arraySchema.ts | 4 + src/commandInputArraySchema.ts | 12 + src/commandInputEnumSchema.ts | 12 + src/commandInputParameter.ts | 22 + src/commandInputRecordField.ts | 20 + src/commandInputRecordSchema.ts | 12 + src/commandLineBindable.ts | 2 + src/commandLineBinding.ts | 14 + src/commandLineTool.ts | 36 + src/commandOutputArraySchema.ts | 10 + src/commandOutputBinding.ts | 8 + src/commandOutputEnumSchema.ts | 10 + src/commandOutputParameter.ts | 16 + src/commandOutputRecordField.ts | 16 + src/commandOutputRecordSchema.ts | 10 + src/directory.ts | 10 + src/dirent.ts | 6 + src/dockerRequirement.ts | 14 + src/enumSchema.ts | 4 + src/envVarRequirement.ts | 4 + src/environmentDef.ts | 4 + src/expressionTool.ts | 22 + src/expressionToolOutputParameter.ts | 14 + src/file.ts | 24 + src/initialWorkDirRequirement.ts | 4 + src/inlineJavascriptRequirement.ts | 4 + src/inplaceUpdateRequirement.ts | 4 + src/inputArraySchema.ts | 10 + src/inputBinding.ts | 2 + src/inputEnumSchema.ts | 10 + src/inputRecordField.ts | 18 + src/inputRecordSchema.ts | 10 + src/loadListingRequirement.ts | 4 + src/multipleInputFeatureRequirement.ts | 2 + src/networkAccess.ts | 4 + src/operation.ts | 20 + src/operationInputParameter.ts | 20 + src/operationOutputParameter.ts | 14 + src/outputArraySchema.ts | 10 + src/outputEnumSchema.ts | 10 + src/outputRecordField.ts | 14 + src/outputRecordSchema.ts | 10 + src/recordField.ts | 6 + src/recordSchema.ts | 4 + src/resourceRequirement.ts | 18 + src/scatterFeatureRequirement.ts | 2 + src/schemaDefRequirement.ts | 4 + src/secondaryFileSchema.ts | 4 + src/shellCommandRequirement.ts | 2 + src/softwarePackage.ts | 6 + src/softwareRequirement.ts | 4 + src/stepInputExpressionRequirement.ts | 2 + src/subworkflowFeatureRequirement.ts | 2 + src/test/data/examples/underscore.js | 1416 +++++++++++++++++ .../data/examples/valid-any-type-compat.cwl | 22 + src/test/data/examples/valid-cat-tool.cwl | 17 + src/test/data/examples/valid-cat1-testcli.cwl | 41 + .../examples/valid-cat3-tool-mediumcut.cwl | 18 + .../examples/valid-cat3-tool-shortcut.cwl | 17 + src/test/data/examples/valid-cat3-tool.cwl | 19 + src/test/data/examples/valid-cat4-tool.cwl | 17 + src/test/data/examples/valid-dir2.cwl | 20 + .../examples/valid-null-expression1-tool.cwl | 16 + .../examples/valid-null-expression2-tool.cwl | 14 + .../data/examples/valid-parseInt-tool.cwl | 16 + .../data/examples/valid-stderr-mediumcut.cwl | 13 + .../data/examples/valid-stderr-shortcut.cwl | 12 + src/test/data/examples/valid-stderr.cwl | 14 + .../data/examples/valid-template-tool.cwl | 24 + src/test/data/examples/valid-wc2-tool.cwl | 17 + src/test/exampleTest.ts | 119 +- src/toolTimeLimit.ts | 4 + src/util/fetcher.ts | 4 + src/util/loaders/arrayLoader.ts | 2 + src/util/loaders/unionLoader.ts | 2 + src/workReuse.ts | 4 + src/workflow.ts | 22 + src/workflowInputParameter.ts | 22 + src/workflowOutputParameter.ts | 20 + src/workflowStep.ts | 22 + src/workflowStepInput.ts | 18 + src/workflowStepOutput.ts | 2 + 82 files changed, 2481 insertions(+), 3 deletions(-) create mode 100644 src/test/data/examples/underscore.js create mode 100644 src/test/data/examples/valid-any-type-compat.cwl create mode 100644 src/test/data/examples/valid-cat-tool.cwl create mode 100755 src/test/data/examples/valid-cat1-testcli.cwl create mode 100755 src/test/data/examples/valid-cat3-tool-mediumcut.cwl create mode 100755 src/test/data/examples/valid-cat3-tool-shortcut.cwl create mode 100755 src/test/data/examples/valid-cat3-tool.cwl create mode 100755 src/test/data/examples/valid-cat4-tool.cwl create mode 100644 src/test/data/examples/valid-dir2.cwl create mode 100644 src/test/data/examples/valid-null-expression1-tool.cwl create mode 100644 src/test/data/examples/valid-null-expression2-tool.cwl create mode 100755 src/test/data/examples/valid-parseInt-tool.cwl create mode 100644 src/test/data/examples/valid-stderr-mediumcut.cwl create mode 100644 src/test/data/examples/valid-stderr-shortcut.cwl create mode 100644 src/test/data/examples/valid-stderr.cwl create mode 100755 src/test/data/examples/valid-template-tool.cwl create mode 100755 src/test/data/examples/valid-wc2-tool.cwl diff --git a/src/arraySchema.ts b/src/arraySchema.ts index 4d61790..8727e65 100644 --- a/src/arraySchema.ts +++ b/src/arraySchema.ts @@ -66,6 +66,8 @@ export class ArraySchema extends Saveable { errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -78,6 +80,8 @@ export class ArraySchema extends Saveable { errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/commandInputArraySchema.ts b/src/commandInputArraySchema.ts index 66bc139..03e414f 100644 --- a/src/commandInputArraySchema.ts +++ b/src/commandInputArraySchema.ts @@ -91,6 +91,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -115,6 +117,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -127,6 +131,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -140,6 +146,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -154,6 +162,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -168,6 +178,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandInputEnumSchema.ts b/src/commandInputEnumSchema.ts index 4785774..a0c8274 100644 --- a/src/commandInputEnumSchema.ts +++ b/src/commandInputEnumSchema.ts @@ -91,6 +91,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -115,6 +117,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -127,6 +131,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -140,6 +146,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -154,6 +162,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -168,6 +178,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandInputParameter.ts b/src/commandInputParameter.ts index 975eb1f..df3046b 100644 --- a/src/commandInputParameter.ts +++ b/src/commandInputParameter.ts @@ -201,6 +201,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -226,6 +228,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -240,6 +244,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -254,6 +260,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -268,6 +276,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -282,6 +292,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -296,6 +308,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -310,6 +324,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -324,6 +340,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -337,6 +355,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -350,6 +370,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandInputRecordField.ts b/src/commandInputRecordField.ts index fd59016..3e03e7c 100644 --- a/src/commandInputRecordField.ts +++ b/src/commandInputRecordField.ts @@ -188,6 +188,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -213,6 +215,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -226,6 +230,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -239,6 +245,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -253,6 +261,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -267,6 +277,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -281,6 +293,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -295,6 +309,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -309,6 +325,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -323,6 +341,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandInputRecordSchema.ts b/src/commandInputRecordSchema.ts index 6c6354e..8edbf23 100644 --- a/src/commandInputRecordSchema.ts +++ b/src/commandInputRecordSchema.ts @@ -91,6 +91,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -116,6 +118,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -129,6 +133,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -142,6 +148,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -156,6 +164,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -170,6 +180,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandLineBindable.ts b/src/commandLineBindable.ts index abbdeee..bb36bac 100644 --- a/src/commandLineBindable.ts +++ b/src/commandLineBindable.ts @@ -61,6 +61,8 @@ export class CommandLineBindable extends Saveable { errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandLineBinding.ts b/src/commandLineBinding.ts index 9757ae6..a5b5360 100644 --- a/src/commandLineBinding.ts +++ b/src/commandLineBinding.ts @@ -171,6 +171,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -185,6 +187,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `position` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -199,6 +203,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `prefix` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -213,6 +219,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `separate` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -227,6 +235,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `itemSeparator` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -241,6 +251,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `valueFrom` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -255,6 +267,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin errors.push( new ValidationException('the `shellQuote` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandLineTool.ts b/src/commandLineTool.ts index eaefcc1..fb26aaa 100644 --- a/src/commandLineTool.ts +++ b/src/commandLineTool.ts @@ -248,6 +248,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -272,6 +274,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -285,6 +289,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -299,6 +305,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -312,6 +320,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -324,6 +334,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -337,6 +349,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -351,6 +365,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -365,6 +381,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -379,6 +397,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -393,6 +413,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `baseCommand` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -407,6 +429,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `arguments` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -421,6 +445,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `stdin` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -435,6 +461,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `stderr` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -449,6 +477,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `stdout` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -463,6 +493,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `successCodes` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -477,6 +509,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `temporaryFailCodes` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -491,6 +525,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `permanentFailCodes` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandOutputArraySchema.ts b/src/commandOutputArraySchema.ts index f0bc289..2d541e0 100644 --- a/src/commandOutputArraySchema.ts +++ b/src/commandOutputArraySchema.ts @@ -85,6 +85,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -109,6 +111,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -121,6 +125,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -134,6 +140,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -148,6 +156,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandOutputBinding.ts b/src/commandOutputBinding.ts index 1eead9d..1b59b9f 100644 --- a/src/commandOutputBinding.ts +++ b/src/commandOutputBinding.ts @@ -163,6 +163,8 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -177,6 +179,8 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -191,6 +195,8 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte errors.push( new ValidationException('the `glob` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -205,6 +211,8 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte errors.push( new ValidationException('the `outputEval` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandOutputEnumSchema.ts b/src/commandOutputEnumSchema.ts index e942347..dae8d72 100644 --- a/src/commandOutputEnumSchema.ts +++ b/src/commandOutputEnumSchema.ts @@ -85,6 +85,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -109,6 +111,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -121,6 +125,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -134,6 +140,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -148,6 +156,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandOutputParameter.ts b/src/commandOutputParameter.ts index b89dfe7..f08dfe3 100644 --- a/src/commandOutputParameter.ts +++ b/src/commandOutputParameter.ts @@ -157,6 +157,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -182,6 +184,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -196,6 +200,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -210,6 +216,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -224,6 +232,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -238,6 +248,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -251,6 +263,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -264,6 +278,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP errors.push( new ValidationException('the `outputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandOutputRecordField.ts b/src/commandOutputRecordField.ts index ee5a312..5359d60 100644 --- a/src/commandOutputRecordField.ts +++ b/src/commandOutputRecordField.ts @@ -158,6 +158,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -183,6 +185,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -196,6 +200,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -209,6 +215,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -223,6 +231,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -237,6 +247,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -251,6 +263,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -265,6 +279,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `outputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/commandOutputRecordSchema.ts b/src/commandOutputRecordSchema.ts index 361ce8c..7d800fb 100644 --- a/src/commandOutputRecordSchema.ts +++ b/src/commandOutputRecordSchema.ts @@ -85,6 +85,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -110,6 +112,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -123,6 +127,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -136,6 +142,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -150,6 +158,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/directory.ts b/src/directory.ts index 46711b6..7272693 100644 --- a/src/directory.ts +++ b/src/directory.ts @@ -176,6 +176,8 @@ export class Directory extends Saveable { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -189,6 +191,8 @@ export class Directory extends Saveable { errors.push( new ValidationException('the `location` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -203,6 +207,8 @@ export class Directory extends Saveable { errors.push( new ValidationException('the `path` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -217,6 +223,8 @@ export class Directory extends Saveable { errors.push( new ValidationException('the `basename` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -231,6 +239,8 @@ export class Directory extends Saveable { errors.push( new ValidationException('the `listing` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/dirent.ts b/src/dirent.ts index 22b3891..b30a506 100644 --- a/src/dirent.ts +++ b/src/dirent.ts @@ -148,6 +148,8 @@ export class Dirent extends Saveable { errors.push( new ValidationException('the `entryname` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -161,6 +163,8 @@ export class Dirent extends Saveable { errors.push( new ValidationException('the `entry` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -174,6 +178,8 @@ export class Dirent extends Saveable { errors.push( new ValidationException('the `writable` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/dockerRequirement.ts b/src/dockerRequirement.ts index 50251f2..5609c8a 100644 --- a/src/dockerRequirement.ts +++ b/src/dockerRequirement.ts @@ -158,6 +158,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -171,6 +173,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `dockerPull` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -185,6 +189,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `dockerLoad` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -199,6 +205,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `dockerFile` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -213,6 +221,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `dockerImport` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -227,6 +237,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `dockerImageId` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -241,6 +253,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `dockerOutputDirectory` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/enumSchema.ts b/src/enumSchema.ts index 1384f23..b6cde38 100644 --- a/src/enumSchema.ts +++ b/src/enumSchema.ts @@ -69,6 +69,8 @@ export class EnumSchema extends Saveable { errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -81,6 +83,8 @@ export class EnumSchema extends Saveable { errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/envVarRequirement.ts b/src/envVarRequirement.ts index 0313c27..1bf7488 100644 --- a/src/envVarRequirement.ts +++ b/src/envVarRequirement.ts @@ -70,6 +70,8 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -82,6 +84,8 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi errors.push( new ValidationException('the `envDef` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/environmentDef.ts b/src/environmentDef.ts index a9de6d8..86cc61c 100644 --- a/src/environmentDef.ts +++ b/src/environmentDef.ts @@ -71,6 +71,8 @@ export class EnvironmentDef extends Saveable { errors.push( new ValidationException('the `envName` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -83,6 +85,8 @@ export class EnvironmentDef extends Saveable { errors.push( new ValidationException('the `envValue` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/expressionTool.ts b/src/expressionTool.ts index 5e1b2df..202d7b2 100644 --- a/src/expressionTool.ts +++ b/src/expressionTool.ts @@ -167,6 +167,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -191,6 +193,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -204,6 +208,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -218,6 +224,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -231,6 +239,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -243,6 +253,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -256,6 +268,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -270,6 +284,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -284,6 +300,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -298,6 +316,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -311,6 +331,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { errors.push( new ValidationException('the `expression` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/expressionToolOutputParameter.ts b/src/expressionToolOutputParameter.ts index ce00c74..9a33c7c 100644 --- a/src/expressionToolOutputParameter.ts +++ b/src/expressionToolOutputParameter.ts @@ -149,6 +149,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -174,6 +176,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -188,6 +192,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -202,6 +208,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -216,6 +224,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -230,6 +240,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -243,6 +255,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/file.ts b/src/file.ts index 9d4ab5c..6e29098 100644 --- a/src/file.ts +++ b/src/file.ts @@ -304,6 +304,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -317,6 +319,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `location` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -331,6 +335,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `path` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -345,6 +351,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `basename` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -359,6 +367,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `dirname` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -373,6 +383,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `nameroot` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -387,6 +399,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `nameext` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -401,6 +415,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `checksum` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -415,6 +431,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `size` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -429,6 +447,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -443,6 +463,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -457,6 +479,8 @@ export class File extends Saveable { errors.push( new ValidationException('the `contents` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/initialWorkDirRequirement.ts b/src/initialWorkDirRequirement.ts index 21026e8..150bf21 100644 --- a/src/initialWorkDirRequirement.ts +++ b/src/initialWorkDirRequirement.ts @@ -93,6 +93,8 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -105,6 +107,8 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc errors.push( new ValidationException('the `listing` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/inlineJavascriptRequirement.ts b/src/inlineJavascriptRequirement.ts index 1e079aa..53a8cfd 100644 --- a/src/inlineJavascriptRequirement.ts +++ b/src/inlineJavascriptRequirement.ts @@ -74,6 +74,8 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -87,6 +89,8 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr errors.push( new ValidationException('the `expressionLib` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/inplaceUpdateRequirement.ts b/src/inplaceUpdateRequirement.ts index 8c43f02..1b0cdc2 100644 --- a/src/inplaceUpdateRequirement.ts +++ b/src/inplaceUpdateRequirement.ts @@ -94,6 +94,8 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -106,6 +108,8 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce errors.push( new ValidationException('the `inplaceUpdate` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/inputArraySchema.ts b/src/inputArraySchema.ts index ab418c2..6418613 100644 --- a/src/inputArraySchema.ts +++ b/src/inputArraySchema.ts @@ -85,6 +85,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -109,6 +111,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -121,6 +125,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -134,6 +140,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -148,6 +156,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/inputBinding.ts b/src/inputBinding.ts index 6f323e5..dbb745a 100644 --- a/src/inputBinding.ts +++ b/src/inputBinding.ts @@ -64,6 +64,8 @@ export class InputBinding extends Saveable { errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/inputEnumSchema.ts b/src/inputEnumSchema.ts index 2388192..7a570be 100644 --- a/src/inputEnumSchema.ts +++ b/src/inputEnumSchema.ts @@ -85,6 +85,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -109,6 +111,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -121,6 +125,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -134,6 +140,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -148,6 +156,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/inputRecordField.ts b/src/inputRecordField.ts index 7e95582..0ff9eea 100644 --- a/src/inputRecordField.ts +++ b/src/inputRecordField.ts @@ -182,6 +182,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -207,6 +209,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -220,6 +224,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -233,6 +239,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -247,6 +255,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -261,6 +271,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -275,6 +287,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -289,6 +303,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -303,6 +319,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/inputRecordSchema.ts b/src/inputRecordSchema.ts index 76414a6..0d2d334 100644 --- a/src/inputRecordSchema.ts +++ b/src/inputRecordSchema.ts @@ -85,6 +85,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -110,6 +112,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -123,6 +127,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -136,6 +142,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -150,6 +158,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/loadListingRequirement.ts b/src/loadListingRequirement.ts index 4a199f4..dd538a7 100644 --- a/src/loadListingRequirement.ts +++ b/src/loadListingRequirement.ts @@ -66,6 +66,8 @@ export class LoadListingRequirement extends Saveable implements Internal.Process errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -79,6 +81,8 @@ export class LoadListingRequirement extends Saveable implements Internal.Process errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/multipleInputFeatureRequirement.ts b/src/multipleInputFeatureRequirement.ts index ec24e65..c4bada5 100644 --- a/src/multipleInputFeatureRequirement.ts +++ b/src/multipleInputFeatureRequirement.ts @@ -64,6 +64,8 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/networkAccess.ts b/src/networkAccess.ts index 10aba44..dd179b5 100644 --- a/src/networkAccess.ts +++ b/src/networkAccess.ts @@ -79,6 +79,8 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -91,6 +93,8 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme errors.push( new ValidationException('the `networkAccess` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/operation.ts b/src/operation.ts index ccacca0..c53bd85 100644 --- a/src/operation.ts +++ b/src/operation.ts @@ -158,6 +158,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -182,6 +184,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -195,6 +199,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -209,6 +215,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -222,6 +230,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -234,6 +244,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -247,6 +259,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -261,6 +275,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -275,6 +291,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -289,6 +307,8 @@ export class Operation extends Saveable implements Internal.Process { errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/operationInputParameter.ts b/src/operationInputParameter.ts index 45e8132..fcfa250 100644 --- a/src/operationInputParameter.ts +++ b/src/operationInputParameter.ts @@ -194,6 +194,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -219,6 +221,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -233,6 +237,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -247,6 +253,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -261,6 +269,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -275,6 +285,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -289,6 +301,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -303,6 +317,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -317,6 +333,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -330,6 +348,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/operationOutputParameter.ts b/src/operationOutputParameter.ts index db50c5b..16f30de 100644 --- a/src/operationOutputParameter.ts +++ b/src/operationOutputParameter.ts @@ -152,6 +152,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -177,6 +179,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -191,6 +195,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -205,6 +211,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -219,6 +227,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -233,6 +243,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -246,6 +258,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/outputArraySchema.ts b/src/outputArraySchema.ts index c14ace8..2f078ae 100644 --- a/src/outputArraySchema.ts +++ b/src/outputArraySchema.ts @@ -85,6 +85,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -109,6 +111,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -121,6 +125,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -134,6 +140,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -148,6 +156,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/outputEnumSchema.ts b/src/outputEnumSchema.ts index bd16f3d..3d21801 100644 --- a/src/outputEnumSchema.ts +++ b/src/outputEnumSchema.ts @@ -85,6 +85,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -109,6 +111,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -121,6 +125,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -134,6 +140,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -148,6 +156,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/outputRecordField.ts b/src/outputRecordField.ts index 4a4b14c..510a974 100644 --- a/src/outputRecordField.ts +++ b/src/outputRecordField.ts @@ -150,6 +150,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -175,6 +177,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -188,6 +192,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -201,6 +207,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -215,6 +223,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -229,6 +239,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -243,6 +255,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/outputRecordSchema.ts b/src/outputRecordSchema.ts index fc96483..f491ba2 100644 --- a/src/outputRecordSchema.ts +++ b/src/outputRecordSchema.ts @@ -85,6 +85,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -110,6 +112,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -123,6 +127,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -136,6 +142,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -150,6 +158,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/recordField.ts b/src/recordField.ts index 571d8b3..863805e 100644 --- a/src/recordField.ts +++ b/src/recordField.ts @@ -77,6 +77,8 @@ export class RecordField extends Saveable implements Internal.Documented { errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -102,6 +104,8 @@ export class RecordField extends Saveable implements Internal.Documented { errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -115,6 +119,8 @@ export class RecordField extends Saveable implements Internal.Documented { errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/recordSchema.ts b/src/recordSchema.ts index eb4a2cd..fe0f70c 100644 --- a/src/recordSchema.ts +++ b/src/recordSchema.ts @@ -67,6 +67,8 @@ export class RecordSchema extends Saveable { errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -80,6 +82,8 @@ export class RecordSchema extends Saveable { errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/resourceRequirement.ts b/src/resourceRequirement.ts index 8415d9c..90f9ac7 100644 --- a/src/resourceRequirement.ts +++ b/src/resourceRequirement.ts @@ -193,6 +193,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -206,6 +208,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `coresMin` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -220,6 +224,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `coresMax` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -234,6 +240,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `ramMin` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -248,6 +256,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `ramMax` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -262,6 +272,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `tmpdirMin` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -276,6 +288,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `tmpdirMax` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -290,6 +304,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `outdirMin` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -304,6 +320,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `outdirMax` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/scatterFeatureRequirement.ts b/src/scatterFeatureRequirement.ts index 3e1c071..0c5c374 100644 --- a/src/scatterFeatureRequirement.ts +++ b/src/scatterFeatureRequirement.ts @@ -64,6 +64,8 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/schemaDefRequirement.ts b/src/schemaDefRequirement.ts index 0f3da6a..4bcf7f7 100644 --- a/src/schemaDefRequirement.ts +++ b/src/schemaDefRequirement.ts @@ -80,6 +80,8 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -92,6 +94,8 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe errors.push( new ValidationException('the `types` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/secondaryFileSchema.ts b/src/secondaryFileSchema.ts index b8c4f29..6f18b82 100644 --- a/src/secondaryFileSchema.ts +++ b/src/secondaryFileSchema.ts @@ -134,6 +134,8 @@ export class SecondaryFileSchema extends Saveable { errors.push( new ValidationException('the `pattern` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -147,6 +149,8 @@ export class SecondaryFileSchema extends Saveable { errors.push( new ValidationException('the `required` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/shellCommandRequirement.ts b/src/shellCommandRequirement.ts index 9bc4a20..93fc3a9 100644 --- a/src/shellCommandRequirement.ts +++ b/src/shellCommandRequirement.ts @@ -69,6 +69,8 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/softwarePackage.ts b/src/softwarePackage.ts index 98dc328..ff52fe6 100644 --- a/src/softwarePackage.ts +++ b/src/softwarePackage.ts @@ -118,6 +118,8 @@ export class SoftwarePackage extends Saveable { errors.push( new ValidationException('the `package` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -131,6 +133,8 @@ export class SoftwarePackage extends Saveable { errors.push( new ValidationException('the `version` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -145,6 +149,8 @@ export class SoftwarePackage extends Saveable { errors.push( new ValidationException('the `specs` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/softwareRequirement.ts b/src/softwareRequirement.ts index cde0ebd..29b6730 100644 --- a/src/softwareRequirement.ts +++ b/src/softwareRequirement.ts @@ -70,6 +70,8 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -82,6 +84,8 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq errors.push( new ValidationException('the `packages` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/stepInputExpressionRequirement.ts b/src/stepInputExpressionRequirement.ts index 333e326..1f54772 100644 --- a/src/stepInputExpressionRequirement.ts +++ b/src/stepInputExpressionRequirement.ts @@ -64,6 +64,8 @@ export class StepInputExpressionRequirement extends Saveable implements Internal errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/subworkflowFeatureRequirement.ts b/src/subworkflowFeatureRequirement.ts index c7d0b73..6beabe2 100644 --- a/src/subworkflowFeatureRequirement.ts +++ b/src/subworkflowFeatureRequirement.ts @@ -64,6 +64,8 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/test/data/examples/underscore.js b/src/test/data/examples/underscore.js new file mode 100644 index 0000000..05bfdc0 --- /dev/null +++ b/src/test/data/examples/underscore.js @@ -0,0 +1,1416 @@ +// Underscore.js 1.7.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `exports` on the server. + var root = this; + + // Save the previous value of the `_` variable. + //var previousUnderscore = root._; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.7.0'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var createCallback = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + _.iteratee = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return createCallback(value, context, argCount); + if (_.isObject(value)) return _.matches(value); + return _.property(value); + }; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + if (obj == null) return obj; + iteratee = createCallback(iteratee, context); + var i, length = obj.length; + if (length === +length) { + for (i = 0; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); + } + } + return obj; + }; + + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + if (obj == null) return []; + iteratee = _.iteratee(iteratee, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + results = Array(length), + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + var reduceError = 'Reduce of empty array with no initial value'; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) { + if (obj == null) obj = []; + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index = 0, currentKey; + if (arguments.length < 3) { + if (!length) throw new TypeError(reduceError); + memo = obj[keys ? keys[index++] : index++]; + } + for (; index < length; index++) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + _.reduceRight = _.foldr = function(obj, iteratee, memo, context) { + if (obj == null) obj = []; + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== + obj.length && _.keys(obj), + index = (keys || obj).length, + currentKey; + if (arguments.length < 3) { + if (!index) throw new TypeError(reduceError); + memo = obj[keys ? keys[--index] : --index]; + } + while (index--) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var result; + predicate = _.iteratee(predicate, context); + _.some(obj, function(value, index, list) { + if (predicate(value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + if (obj == null) return results; + predicate = _.iteratee(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(_.iteratee(predicate)), context); + }; + + // Determine whether all of the elements match a truth test. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + if (obj == null) return true; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + }; + + // Determine if at least one element in the object matches a truth test. + // Aliased as `any`. + _.some = _.any = function(obj, predicate, context) { + if (obj == null) return false; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + }; + + // Determine if the array or object contains a given value (using `===`). + // Aliased as `include`. + _.contains = _.include = function(obj, target) { + if (obj == null) return false; + if (obj.length !== +obj.length) obj = _.values(obj); + return _.indexOf(obj, target) >= 0; + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + return (isFunc ? method : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matches(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matches(attrs)); + }; + + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + _.shuffle = function(obj) { + var set = obj && obj.length === +obj.length ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } + return shuffled; + }; + + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iteratee(value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = array.length; + while (low < high) { + var mid = low + high >>> 1; + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + }; + + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return obj.length === +obj.length ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = _.iteratee(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, strict, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + for (var i = 0, length = input.length; i < length; i++) { + var value = input[i]; + if (!_.isArray(value) && !_.isArguments(value)) { + if (!strict) output.push(value); + } else if (shallow) { + push.apply(output, value); + } else { + flatten(value, shallow, strict, output); + } + } + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, false, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (array == null) return []; + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = _.iteratee(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = array.length; i < length; i++) { + var value = array[i]; + if (isSorted) { + if (!i || seen !== value) result.push(value); + seen = value; + } else if (iteratee) { + var computed = iteratee(value, i, array); + if (_.indexOf(seen, computed) < 0) { + seen.push(computed); + result.push(value); + } + } else if (_.indexOf(result, value) < 0) { + result.push(value); + } + } + return result; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(flatten(arguments, true, true, [])); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + if (array == null) return []; + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = array.length; i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = flatten(slice.call(arguments, 1), true, true, []); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function(array) { + if (array == null) return []; + var length = _.max(arguments, 'length').length; + var results = Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(arguments, i); + } + return results; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + if (list == null) return {}; + var result = {}; + for (var i = 0, length = list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i = 0, length = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; + } else { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + } + for (; i < length; i++) if (array[i] === item) return i; + return -1; + }; + + _.lastIndexOf = function(array, item, from) { + if (array == null) return -1; + var idx = array.length; + if (typeof from == 'number') { + idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); + } + while (--idx >= 0) if (array[idx] === item) return idx; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = step || 1; + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Reusable constructor function for prototype setting. + var Ctor = function(){}; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + args = slice.call(arguments, 2); + bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + Ctor.prototype = func.prototype; + var self = new Ctor; + Ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (_.isObject(result)) return result; + return self; + }; + return bound; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + return function() { + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); + }; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = hasher ? hasher.apply(this, arguments) : key; + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Returns a function that will only be executed before being called N times. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } else { + func = null; + } + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + if (!_.isObject(obj)) return obj; + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop]; + } + } + } + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj, iteratee, context) { + var result = {}, key; + if (obj == null) return result; + if (_.isFunction(iteratee)) { + iteratee = createCallback(iteratee, context); + for (key in obj) { + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + } else { + var keys = concat.apply([], slice.call(arguments, 1)); + obj = new Object(obj); + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (key in obj) result[key] = obj[key]; + } + } + return result; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(concat.apply([], slice.call(arguments, 1)), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; + } + return _.pick(obj, iteratee, context); + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + if (!_.isObject(obj)) return obj; + for (var i = 1, length = arguments.length; i < length; i++) { + var source = arguments[i]; + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; + } + } + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if ( + aCtor !== bCtor && + // Handle Object.create(x) cases + 'constructor' in a && 'constructor' in b && + !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + ) { + return false; + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size, result; + // Recursively compare objects and arrays. + if (className === '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size === b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!(result = eq(a[size], b[size], aStack, bStack))) break; + } + } + } else { + // Deep compare objects. + var keys = _.keys(a), key; + size = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + result = _.keys(b).length === size; + if (result) { + while (size--) { + // Deep compare each member + key = keys[size]; + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; + } + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return result; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, [], []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) === '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return _.has(obj, 'callee'); + }; + } + + // Optimize `isFunction` if appropriate. Work around an IE 11 bug. + if (typeof /./ !== 'function') { + _.isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj !== +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iteratees. + _.identity = function(value) { + return value; + }; + + // Predicate-generating functions. Often useful outside of Underscore. + _.constant = function(value) { + return function() { + return value; + }; + }; + + _.noop = function(){}; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + var pairs = _.pairs(attrs), length = pairs.length; + return function(obj) { + if (obj == null) return !length; + obj = new Object(obj); + for (var i = 0; i < length; i++) { + var pair = pairs[i], key = pair[0]; + if (pair[1] !== obj[key] || !(key in obj)) return false; + } + return true; + }; + }; + + // Run a function **n** times. + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = createCallback(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); + }; + + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + var unescapeMap = _.invert(escapeMap); + + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property) { + if (object == null) return void 0; + var value = object[property]; + return _.isFunction(value) ? object[property]() : value; + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offest. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + try { + var render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function. Start chaining a wrapped Underscore object. + _.chain = function(obj) { + var instance = _(obj); + instance._chain = true; + return instance; + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(obj) { + return this._chain ? _(obj).chain() : obj; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; + return result.call(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + _.each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result.call(this, method.apply(this._wrapped, arguments)); + }; + }); + + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}.call(this)); diff --git a/src/test/data/examples/valid-any-type-compat.cwl b/src/test/data/examples/valid-any-type-compat.cwl new file mode 100644 index 0000000..5b0c254 --- /dev/null +++ b/src/test/data/examples/valid-any-type-compat.cwl @@ -0,0 +1,22 @@ +cwlVersion: v1.2 +class: Workflow + +steps: [] +inputs: + input1: + type: Any + input2: + type: Any[] + input3: + type: Any + +outputs: + - id: output1 + type: string[] + outputSource: input1 + - id: output2 + type: string[] + outputSource: input2 + - id: output3 + type: string + outputSource: input3 diff --git a/src/test/data/examples/valid-cat-tool.cwl b/src/test/data/examples/valid-cat-tool.cwl new file mode 100644 index 0000000..ca2687f --- /dev/null +++ b/src/test/data/examples/valid-cat-tool.cwl @@ -0,0 +1,17 @@ +#!/usr/bin/env cwl-runner + +class: CommandLineTool +cwlVersion: v1.2 + +inputs: + file1: File + +outputs: + output: + type: File + outputBinding: { glob: output } + +baseCommand: [cat] + +stdin: $(inputs.file1.path) +stdout: output diff --git a/src/test/data/examples/valid-cat1-testcli.cwl b/src/test/data/examples/valid-cat1-testcli.cwl new file mode 100755 index 0000000..b82ffbe --- /dev/null +++ b/src/test/data/examples/valid-cat1-testcli.cwl @@ -0,0 +1,41 @@ +#!/usr/bin/env cwl-runner +{ + "class": "CommandLineTool", + "cwlVersion": "v1.2", + "doc": "Print the contents of a file to stdout using 'cat' running in a docker container.", + "hints": [ + { + "class": "DockerRequirement", + "dockerPull": "python:2-slim" + } + ], + "inputs": [ + { + "id": "file1", + "type": "File", + "inputBinding": {"position": 1} + }, + { + "id": "numbering", + "type": ["null", "boolean"], + "inputBinding": { + "position": 0, + "prefix": "-n" + } + }, + { + id: "args.py", + type: File, + default: { + class: File, + location: args.py + }, + inputBinding: { + position: -1 + } + } + ], + "outputs": [{"id": "args", "type": "string[]"}], + "baseCommand": "python", + "arguments": ["cat"] +} diff --git a/src/test/data/examples/valid-cat3-tool-mediumcut.cwl b/src/test/data/examples/valid-cat3-tool-mediumcut.cwl new file mode 100755 index 0000000..534a12b --- /dev/null +++ b/src/test/data/examples/valid-cat3-tool-mediumcut.cwl @@ -0,0 +1,18 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Print the contents of a file to stdout using 'cat' running in a docker container." +requirements: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim +inputs: + file1: + type: File + label: Input File + doc: "The file that will be copied using 'cat'" + inputBinding: {position: 1} +outputs: + output_file: + type: stdout +baseCommand: cat +stdout: cat-out diff --git a/src/test/data/examples/valid-cat3-tool-shortcut.cwl b/src/test/data/examples/valid-cat3-tool-shortcut.cwl new file mode 100755 index 0000000..add284d --- /dev/null +++ b/src/test/data/examples/valid-cat3-tool-shortcut.cwl @@ -0,0 +1,17 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Print the contents of a file to stdout using 'cat' running in a docker container." +requirements: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim +inputs: + file1: + type: File + label: Input File + doc: "The file that will be copied using 'cat'" + inputBinding: {position: 1} +outputs: + output_file: + type: stdout +baseCommand: cat diff --git a/src/test/data/examples/valid-cat3-tool.cwl b/src/test/data/examples/valid-cat3-tool.cwl new file mode 100755 index 0000000..f6b7a45 --- /dev/null +++ b/src/test/data/examples/valid-cat3-tool.cwl @@ -0,0 +1,19 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Print the contents of a file to stdout using 'cat' running in a docker container." +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim +inputs: + file1: + type: File + label: Input File + doc: "The file that will be copied using 'cat'" + inputBinding: {position: 1} +outputs: + output_file: + type: File + outputBinding: {glob: output.txt} +baseCommand: cat +stdout: output.txt diff --git a/src/test/data/examples/valid-cat4-tool.cwl b/src/test/data/examples/valid-cat4-tool.cwl new file mode 100755 index 0000000..656f94a --- /dev/null +++ b/src/test/data/examples/valid-cat4-tool.cwl @@ -0,0 +1,17 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Print the contents of a file to stdout using 'cat' running in a docker container if docker is available." +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim +inputs: + file1: File +outputs: + output_txt: + type: File + outputBinding: + glob: output.txt +baseCommand: cat +stdout: output.txt +stdin: $(inputs.file1.path) diff --git a/src/test/data/examples/valid-dir2.cwl b/src/test/data/examples/valid-dir2.cwl new file mode 100644 index 0000000..823ef60 --- /dev/null +++ b/src/test/data/examples/valid-dir2.cwl @@ -0,0 +1,20 @@ +class: CommandLineTool +cwlVersion: v1.2 +requirements: + ShellCommandRequirement: {} +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim +inputs: + indir: Directory +outputs: + outlist: + type: File + outputBinding: + glob: output.txt +arguments: ["cd", "$(inputs.indir.path)", + {shellQuote: false, valueFrom: "&&"}, + "find", ".", + {shellQuote: false, valueFrom: "|"}, + "sort"] +stdout: output.txt diff --git a/src/test/data/examples/valid-null-expression1-tool.cwl b/src/test/data/examples/valid-null-expression1-tool.cwl new file mode 100644 index 0000000..0a3c7be --- /dev/null +++ b/src/test/data/examples/valid-null-expression1-tool.cwl @@ -0,0 +1,16 @@ +#!/usr/bin/env cwl-runner + +class: ExpressionTool +requirements: + - class: InlineJavascriptRequirement +cwlVersion: v1.2 + +inputs: + i1: + type: Any + default: "the-default" + +outputs: + output: int + +expression: "$({'output': (inputs.i1 == 'the-default' ? 1 : 2)})" \ No newline at end of file diff --git a/src/test/data/examples/valid-null-expression2-tool.cwl b/src/test/data/examples/valid-null-expression2-tool.cwl new file mode 100644 index 0000000..2b09ec0 --- /dev/null +++ b/src/test/data/examples/valid-null-expression2-tool.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner + +class: ExpressionTool +requirements: + - class: InlineJavascriptRequirement +cwlVersion: v1.2 + +inputs: + i1: Any + +outputs: + output: int + +expression: "$({'output': (inputs.i1 == 'the-default' ? 1 : 2)})" \ No newline at end of file diff --git a/src/test/data/examples/valid-parseInt-tool.cwl b/src/test/data/examples/valid-parseInt-tool.cwl new file mode 100755 index 0000000..844cc5d --- /dev/null +++ b/src/test/data/examples/valid-parseInt-tool.cwl @@ -0,0 +1,16 @@ +#!/usr/bin/env cwl-runner + +class: ExpressionTool +requirements: + - class: InlineJavascriptRequirement +cwlVersion: v1.2 + +inputs: + file1: + type: File + loadContents: true + +outputs: + output: int + +expression: "$({'output': parseInt(inputs.file1.contents)})" diff --git a/src/test/data/examples/valid-stderr-mediumcut.cwl b/src/test/data/examples/valid-stderr-mediumcut.cwl new file mode 100644 index 0000000..8c07c72 --- /dev/null +++ b/src/test/data/examples/valid-stderr-mediumcut.cwl @@ -0,0 +1,13 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Test of capturing stderr output in a docker container." +requirements: + ShellCommandRequirement: {} +inputs: [] +outputs: + output_file: + type: stderr +arguments: + - { valueFrom: "echo foo 1>&2", shellQuote: False } +stderr: std.err diff --git a/src/test/data/examples/valid-stderr-shortcut.cwl b/src/test/data/examples/valid-stderr-shortcut.cwl new file mode 100644 index 0000000..6fd7aac --- /dev/null +++ b/src/test/data/examples/valid-stderr-shortcut.cwl @@ -0,0 +1,12 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Test of capturing stderr output." +requirements: + ShellCommandRequirement: {} +inputs: [] +outputs: + output_file: + type: stderr +arguments: + - { valueFrom: "echo foo 1>&2", shellQuote: False } diff --git a/src/test/data/examples/valid-stderr.cwl b/src/test/data/examples/valid-stderr.cwl new file mode 100644 index 0000000..ab5848b --- /dev/null +++ b/src/test/data/examples/valid-stderr.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +doc: "Test of capturing stderr output." +requirements: + ShellCommandRequirement: {} +inputs: [] +outputs: + output_file: + type: File + outputBinding: {glob: error.txt} +arguments: + - { valueFrom: "echo foo 1>&2", shellQuote: False } +stderr: error.txt diff --git a/src/test/data/examples/valid-template-tool.cwl b/src/test/data/examples/valid-template-tool.cwl new file mode 100755 index 0000000..24f93e1 --- /dev/null +++ b/src/test/data/examples/valid-template-tool.cwl @@ -0,0 +1,24 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.2 +class: CommandLineTool +requirements: + - class: InlineJavascriptRequirement + expressionLib: + - { $include: underscore.js } + - "var t = function(s) { return _.template(s, {variable: 'data'})({'inputs': inputs}); };" + - class: InitialWorkDirRequirement + listing: + - entryname: foo.txt + entry: $(t("The file is <%= data.inputs.file1.path.split('/').slice(-1)[0] %>\n")) +hints: + DockerRequirement: + dockerPull: docker.io/debian:stable-slim +inputs: + - id: file1 + type: File +outputs: + - id: foo + type: File + outputBinding: + glob: foo.txt +baseCommand: [cat, foo.txt] diff --git a/src/test/data/examples/valid-wc2-tool.cwl b/src/test/data/examples/valid-wc2-tool.cwl new file mode 100755 index 0000000..279ed20 --- /dev/null +++ b/src/test/data/examples/valid-wc2-tool.cwl @@ -0,0 +1,17 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: v1.2 +requirements: + - class: InlineJavascriptRequirement + +inputs: + - { id: file1, type: File, inputBinding: {} } +outputs: + - id: output + type: int + outputBinding: + glob: output.txt + loadContents: true + outputEval: "$(parseInt(self[0].contents))" +stdout: output.txt +baseCommand: wc diff --git a/src/test/exampleTest.ts b/src/test/exampleTest.ts index 56c124b..0642397 100644 --- a/src/test/exampleTest.ts +++ b/src/test/exampleTest.ts @@ -1,28 +1,141 @@ import { loadDocument, loadDocumentByString } from '../' import fs from 'fs' +import url from 'url' describe('Example Tests', () => { + it('valid_stderr_shortcut', async () => { + await loadDocument(__dirname + '/data/examples/valid-stderr-shortcut.cwl') + }) + it('valid_stderr_shortcut by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-stderr-shortcut.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) it('valid_bwa_mem_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-bwa-mem-tool.cwl') }) it('valid_bwa_mem_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-bwa-mem-tool.cwl').toString() - await loadDocumentByString(doc, '') + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_cat3_tool_mediumcut', async () => { + await loadDocument(__dirname + '/data/examples/valid-cat3-tool-mediumcut.cwl') + }) + it('valid_cat3_tool_mediumcut by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat3-tool-mediumcut.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_cat1_testcli', async () => { + await loadDocument(__dirname + '/data/examples/valid-cat1-testcli.cwl') + }) + it('valid_cat1_testcli by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat1-testcli.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_null_expression2_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-null-expression2-tool.cwl') + }) + it('valid_null_expression2_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-null-expression2-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_cat3_tool_shortcut', async () => { + await loadDocument(__dirname + '/data/examples/valid-cat3-tool-shortcut.cwl') + }) + it('valid_cat3_tool_shortcut by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat3-tool-shortcut.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) }) it('valid_binding_test', async () => { await loadDocument(__dirname + '/data/examples/valid-binding-test.cwl') }) it('valid_binding_test by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-binding-test.cwl').toString() - await loadDocumentByString(doc, '') + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) }) it('valid_tmap_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-tmap-tool.cwl') }) it('valid_tmap_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-tmap-tool.cwl').toString() - await loadDocumentByString(doc, '') + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_cat4_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-cat4-tool.cwl') + }) + it('valid_cat4_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat4-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_stderr', async () => { + await loadDocument(__dirname + '/data/examples/valid-stderr.cwl') + }) + it('valid_stderr by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-stderr.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_any_type_compat', async () => { + await loadDocument(__dirname + '/data/examples/valid-any-type-compat.cwl') + }) + it('valid_any_type_compat by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-any-type-compat.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_parseInt_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-parseInt-tool.cwl') + }) + it('valid_parseInt_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-parseInt-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_dir2', async () => { + await loadDocument(__dirname + '/data/examples/valid-dir2.cwl') + }) + it('valid_dir2 by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-dir2.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_wc2_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-wc2-tool.cwl') + }) + it('valid_wc2_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-wc2-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_null_expression1_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-null-expression1-tool.cwl') + }) + it('valid_null_expression1_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-null-expression1-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_stderr_mediumcut', async () => { + await loadDocument(__dirname + '/data/examples/valid-stderr-mediumcut.cwl') + }) + it('valid_stderr_mediumcut by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-stderr-mediumcut.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_cat3_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-cat3-tool.cwl') + }) + it('valid_cat3_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat3-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_template_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-template-tool.cwl') + }) + it('valid_template_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-template-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + }) + it('valid_cat_tool', async () => { + await loadDocument(__dirname + '/data/examples/valid-cat-tool.cwl') + }) + it('valid_cat_tool by string', async () => { + let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat-tool.cwl').toString() + await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) }) }) diff --git a/src/toolTimeLimit.ts b/src/toolTimeLimit.ts index 7720764..d579734 100644 --- a/src/toolTimeLimit.ts +++ b/src/toolTimeLimit.ts @@ -77,6 +77,8 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -89,6 +91,8 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme errors.push( new ValidationException('the `timelimit` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/util/fetcher.ts b/src/util/fetcher.ts index 73eb3cc..b41ea5b 100644 --- a/src/util/fetcher.ts +++ b/src/util/fetcher.ts @@ -29,6 +29,8 @@ export class DefaultFetcher extends Fetcher { } catch (e) { if (e instanceof Error) { throw new ValidationException(`Error fetching ${urlString}: ${e.message}`) + } else { + throw e } } } else if (scheme === 'file') { @@ -37,6 +39,8 @@ export class DefaultFetcher extends Fetcher { } catch (e) { if (e instanceof Error) { throw new ValidationException(`Error reading file ${urlString}: ${e.message}`) + } else { + throw e } } } diff --git a/src/util/loaders/arrayLoader.ts b/src/util/loaders/arrayLoader.ts index 68c5be0..6d2a539 100644 --- a/src/util/loaders/arrayLoader.ts +++ b/src/util/loaders/arrayLoader.ts @@ -24,6 +24,8 @@ export class _ArrayLoader implements Loader { } catch (e) { if (e instanceof ValidationException) { errors.push(e) + } else { + throw e } } } diff --git a/src/util/loaders/unionLoader.ts b/src/util/loaders/unionLoader.ts index 56c9bb0..538371a 100644 --- a/src/util/loaders/unionLoader.ts +++ b/src/util/loaders/unionLoader.ts @@ -15,6 +15,8 @@ export class _UnionLoader implements Loader { } catch (e) { if (e instanceof ValidationException) { errors.push(new ValidationException(`tried ${t.constructor.name} but`, [e])) + } else { + throw e } } } diff --git a/src/workReuse.ts b/src/workReuse.ts index d6f5c9b..3c0abd3 100644 --- a/src/workReuse.ts +++ b/src/workReuse.ts @@ -73,6 +73,8 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -85,6 +87,8 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { errors.push( new ValidationException('the `enableReuse` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/workflow.ts b/src/workflow.ts index 032ee89..93f09d6 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -212,6 +212,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -236,6 +238,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -249,6 +253,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -263,6 +269,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -276,6 +284,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -288,6 +298,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -301,6 +313,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -315,6 +329,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -329,6 +345,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -343,6 +361,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -356,6 +376,8 @@ export class Workflow extends Saveable implements Internal.Process { errors.push( new ValidationException('the `steps` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/workflowInputParameter.ts b/src/workflowInputParameter.ts index 202bdb5..81cc424 100644 --- a/src/workflowInputParameter.ts +++ b/src/workflowInputParameter.ts @@ -199,6 +199,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -224,6 +226,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -238,6 +242,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -252,6 +258,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -266,6 +274,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -280,6 +290,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -294,6 +306,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -308,6 +322,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -322,6 +338,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -335,6 +353,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -348,6 +368,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/workflowOutputParameter.ts b/src/workflowOutputParameter.ts index 8a6b8b2..a81b32b 100644 --- a/src/workflowOutputParameter.ts +++ b/src/workflowOutputParameter.ts @@ -181,6 +181,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -206,6 +208,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -220,6 +224,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -234,6 +240,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -248,6 +256,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -262,6 +272,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -276,6 +288,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `outputSource` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -290,6 +304,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `linkMerge` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -304,6 +320,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `pickValue` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -317,6 +335,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) + } else { + throw e } } diff --git a/src/workflowStep.ts b/src/workflowStep.ts index 077c68c..c5f6a11 100644 --- a/src/workflowStep.ts +++ b/src/workflowStep.ts @@ -220,6 +220,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -245,6 +247,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -259,6 +263,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -272,6 +278,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `in` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -284,6 +292,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `out` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -297,6 +307,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -311,6 +323,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -324,6 +338,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `run` field is not valid because: ', [e]) ) + } else { + throw e } } @@ -337,6 +353,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `when` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -351,6 +369,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `scatter` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -365,6 +385,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter errors.push( new ValidationException('the `scatterMethod` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/workflowStepInput.ts b/src/workflowStepInput.ts index b365af1..998c62f 100644 --- a/src/workflowStepInput.ts +++ b/src/workflowStepInput.ts @@ -267,6 +267,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -292,6 +294,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `source` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -306,6 +310,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `linkMerge` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -320,6 +326,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `pickValue` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -334,6 +342,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -348,6 +358,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -362,6 +374,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -376,6 +390,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) + } else { + throw e } } } @@ -390,6 +406,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, errors.push( new ValidationException('the `valueFrom` field is not valid because: ', [e]) ) + } else { + throw e } } } diff --git a/src/workflowStepOutput.ts b/src/workflowStepOutput.ts index 5f66a1a..aaa99e4 100644 --- a/src/workflowStepOutput.ts +++ b/src/workflowStepOutput.ts @@ -71,6 +71,8 @@ export class WorkflowStepOutput extends Saveable implements Internal.Identified errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) + } else { + throw e } } } From 46ebf12ddd017518a6d66841474dfa5a013496b6 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 13:57:47 +0100 Subject: [PATCH 08/19] - Prefix errors variable with __ to reduce name collision - Refactor example tests --- src/arraySchema.ts | 12 +++--- src/commandInputArraySchema.ts | 20 ++++----- src/commandInputEnumSchema.ts | 20 ++++----- src/commandInputParameter.ts | 30 +++++++------- src/commandInputRecordField.ts | 28 ++++++------- src/commandInputRecordSchema.ts | 20 ++++----- src/commandLineBindable.ts | 10 ++--- src/commandLineBinding.ts | 22 +++++----- src/commandLineTool.ts | 44 ++++++++++---------- src/commandOutputArraySchema.ts | 18 ++++---- src/commandOutputBinding.ts | 16 ++++---- src/commandOutputEnumSchema.ts | 18 ++++---- src/commandOutputParameter.ts | 24 +++++------ src/commandOutputRecordField.ts | 24 +++++------ src/commandOutputRecordSchema.ts | 18 ++++---- src/directory.ts | 18 ++++---- src/dirent.ts | 14 +++---- src/dockerRequirement.ts | 22 +++++----- src/enumSchema.ts | 12 +++--- src/envVarRequirement.ts | 12 +++--- src/environmentDef.ts | 12 +++--- src/expressionTool.ts | 30 +++++++------- src/expressionToolOutputParameter.ts | 22 +++++----- src/file.ts | 32 +++++++-------- src/initialWorkDirRequirement.ts | 12 +++--- src/inlineJavascriptRequirement.ts | 12 +++--- src/inplaceUpdateRequirement.ts | 12 +++--- src/inputArraySchema.ts | 18 ++++---- src/inputBinding.ts | 10 ++--- src/inputEnumSchema.ts | 18 ++++---- src/inputRecordField.ts | 26 ++++++------ src/inputRecordSchema.ts | 18 ++++---- src/loadListingRequirement.ts | 12 +++--- src/multipleInputFeatureRequirement.ts | 10 ++--- src/networkAccess.ts | 12 +++--- src/operation.ts | 28 ++++++------- src/operationInputParameter.ts | 28 ++++++------- src/operationOutputParameter.ts | 22 +++++----- src/outputArraySchema.ts | 18 ++++---- src/outputEnumSchema.ts | 18 ++++---- src/outputRecordField.ts | 22 +++++----- src/outputRecordSchema.ts | 18 ++++---- src/recordField.ts | 14 +++---- src/recordSchema.ts | 12 +++--- src/resourceRequirement.ts | 26 ++++++------ src/scatterFeatureRequirement.ts | 10 ++--- src/schemaDefRequirement.ts | 12 +++--- src/secondaryFileSchema.ts | 12 +++--- src/shellCommandRequirement.ts | 10 ++--- src/softwarePackage.ts | 14 +++---- src/softwareRequirement.ts | 12 +++--- src/stepInputExpressionRequirement.ts | 10 ++--- src/subworkflowFeatureRequirement.ts | 10 ++--- src/test/exampleTest.ts | 57 +++++++++++++++++--------- src/toolTimeLimit.ts | 12 +++--- src/workReuse.ts | 12 +++--- src/workflow.ts | 30 +++++++------- src/workflowInputParameter.ts | 30 +++++++------- src/workflowOutputParameter.ts | 28 ++++++------- src/workflowStep.ts | 30 +++++++------- src/workflowStepInput.ts | 26 ++++++------ src/workflowStepOutput.ts | 10 ++--- 62 files changed, 604 insertions(+), 585 deletions(-) diff --git a/src/arraySchema.ts b/src/arraySchema.ts index 8727e65..9840057 100644 --- a/src/arraySchema.ts +++ b/src/arraySchema.ts @@ -55,7 +55,7 @@ export class ArraySchema extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let items try { @@ -63,7 +63,7 @@ export class ArraySchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) } else { @@ -77,7 +77,7 @@ export class ArraySchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -92,7 +92,7 @@ export class ArraySchema extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`items\`,\`type\``) ) @@ -101,8 +101,8 @@ export class ArraySchema extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ArraySchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ArraySchema'", __errors) } const schema = new ArraySchema({ diff --git a/src/commandInputArraySchema.ts b/src/commandInputArraySchema.ts index 03e414f..8e42cba 100644 --- a/src/commandInputArraySchema.ts +++ b/src/commandInputArraySchema.ts @@ -79,7 +79,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -88,7 +88,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -114,7 +114,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) } else { @@ -128,7 +128,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -143,7 +143,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -159,7 +159,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -175,7 +175,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -191,7 +191,7 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\`,\`inputBinding\``) ) @@ -200,8 +200,8 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandInputArraySchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandInputArraySchema'", __errors) } const schema = new CommandInputArraySchema({ diff --git a/src/commandInputEnumSchema.ts b/src/commandInputEnumSchema.ts index a0c8274..48f9cb9 100644 --- a/src/commandInputEnumSchema.ts +++ b/src/commandInputEnumSchema.ts @@ -79,7 +79,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -88,7 +88,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -114,7 +114,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) } else { @@ -128,7 +128,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -143,7 +143,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -159,7 +159,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -175,7 +175,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -191,7 +191,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\`,\`inputBinding\``) ) @@ -200,8 +200,8 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandInputEnumSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandInputEnumSchema'", __errors) } const schema = new CommandInputEnumSchema({ diff --git a/src/commandInputParameter.ts b/src/commandInputParameter.ts index df3046b..11e241a 100644 --- a/src/commandInputParameter.ts +++ b/src/commandInputParameter.ts @@ -189,7 +189,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -198,7 +198,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -225,7 +225,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -241,7 +241,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -257,7 +257,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -273,7 +273,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -289,7 +289,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -305,7 +305,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -321,7 +321,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -337,7 +337,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) } else { @@ -352,7 +352,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -367,7 +367,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -383,7 +383,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`loadContents\`,\`loadListing\`,\`default\`,\`type\`,\`inputBinding\``) ) @@ -392,8 +392,8 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandInputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandInputParameter'", __errors) } const schema = new CommandInputParameter({ diff --git a/src/commandInputRecordField.ts b/src/commandInputRecordField.ts index 3e03e7c..a013c13 100644 --- a/src/commandInputRecordField.ts +++ b/src/commandInputRecordField.ts @@ -176,7 +176,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -185,7 +185,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -212,7 +212,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -227,7 +227,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -242,7 +242,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -258,7 +258,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -274,7 +274,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -290,7 +290,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -306,7 +306,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -322,7 +322,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -338,7 +338,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -354,7 +354,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\`,\`loadContents\`,\`loadListing\`,\`inputBinding\``) ) @@ -363,8 +363,8 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandInputRecordField'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandInputRecordField'", __errors) } const schema = new CommandInputRecordField({ diff --git a/src/commandInputRecordSchema.ts b/src/commandInputRecordSchema.ts index 8edbf23..d3f91e3 100644 --- a/src/commandInputRecordSchema.ts +++ b/src/commandInputRecordSchema.ts @@ -79,7 +79,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -88,7 +88,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -115,7 +115,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) } else { @@ -130,7 +130,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -145,7 +145,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -161,7 +161,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -177,7 +177,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -193,7 +193,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\`,\`inputBinding\``) ) @@ -202,8 +202,8 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandInputRecordSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandInputRecordSchema'", __errors) } const schema = new CommandInputRecordSchema({ diff --git a/src/commandLineBindable.ts b/src/commandLineBindable.ts index bb36bac..0b61ff1 100644 --- a/src/commandLineBindable.ts +++ b/src/commandLineBindable.ts @@ -49,7 +49,7 @@ export class CommandLineBindable extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let inputBinding if ('inputBinding' in _doc) { @@ -58,7 +58,7 @@ export class CommandLineBindable extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -74,7 +74,7 @@ export class CommandLineBindable extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`inputBinding\``) ) @@ -83,8 +83,8 @@ export class CommandLineBindable extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandLineBindable'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandLineBindable'", __errors) } const schema = new CommandLineBindable({ diff --git a/src/commandLineBinding.ts b/src/commandLineBinding.ts index a5b5360..aae82f1 100644 --- a/src/commandLineBinding.ts +++ b/src/commandLineBinding.ts @@ -159,7 +159,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let loadContents if ('loadContents' in _doc) { @@ -168,7 +168,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -184,7 +184,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `position` field is not valid because: ', [e]) ) } else { @@ -200,7 +200,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `prefix` field is not valid because: ', [e]) ) } else { @@ -216,7 +216,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `separate` field is not valid because: ', [e]) ) } else { @@ -232,7 +232,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `itemSeparator` field is not valid because: ', [e]) ) } else { @@ -248,7 +248,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `valueFrom` field is not valid because: ', [e]) ) } else { @@ -264,7 +264,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `shellQuote` field is not valid because: ', [e]) ) } else { @@ -280,7 +280,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`loadContents\`,\`position\`,\`prefix\`,\`separate\`,\`itemSeparator\`,\`valueFrom\`,\`shellQuote\``) ) @@ -289,8 +289,8 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandLineBinding'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandLineBinding'", __errors) } const schema = new CommandLineBinding({ diff --git a/src/commandLineTool.ts b/src/commandLineTool.ts index fb26aaa..bd45d62 100644 --- a/src/commandLineTool.ts +++ b/src/commandLineTool.ts @@ -236,7 +236,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -245,7 +245,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -271,7 +271,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -286,7 +286,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -302,7 +302,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -317,7 +317,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) } else { @@ -331,7 +331,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) } else { @@ -346,7 +346,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) } else { @@ -362,7 +362,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) } else { @@ -378,7 +378,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) } else { @@ -394,7 +394,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) } else { @@ -410,7 +410,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `baseCommand` field is not valid because: ', [e]) ) } else { @@ -426,7 +426,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `arguments` field is not valid because: ', [e]) ) } else { @@ -442,7 +442,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `stdin` field is not valid because: ', [e]) ) } else { @@ -458,7 +458,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `stderr` field is not valid because: ', [e]) ) } else { @@ -474,7 +474,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `stdout` field is not valid because: ', [e]) ) } else { @@ -490,7 +490,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `successCodes` field is not valid because: ', [e]) ) } else { @@ -506,7 +506,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `temporaryFailCodes` field is not valid because: ', [e]) ) } else { @@ -522,7 +522,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `permanentFailCodes` field is not valid because: ', [e]) ) } else { @@ -538,7 +538,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\`,\`baseCommand\`,\`arguments\`,\`stdin\`,\`stderr\`,\`stdout\`,\`successCodes\`,\`temporaryFailCodes\`,\`permanentFailCodes\``) ) @@ -547,8 +547,8 @@ export class CommandLineTool extends Saveable implements Internal.Process { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandLineTool'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandLineTool'", __errors) } const schema = new CommandLineTool({ diff --git a/src/commandOutputArraySchema.ts b/src/commandOutputArraySchema.ts index 2d541e0..806743d 100644 --- a/src/commandOutputArraySchema.ts +++ b/src/commandOutputArraySchema.ts @@ -73,7 +73,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -108,7 +108,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) } else { @@ -122,7 +122,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -137,7 +137,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -153,7 +153,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -169,7 +169,7 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -178,8 +178,8 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandOutputArraySchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputArraySchema'", __errors) } const schema = new CommandOutputArraySchema({ diff --git a/src/commandOutputBinding.ts b/src/commandOutputBinding.ts index 1b59b9f..bf299fe 100644 --- a/src/commandOutputBinding.ts +++ b/src/commandOutputBinding.ts @@ -151,7 +151,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let loadContents if ('loadContents' in _doc) { @@ -160,7 +160,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -176,7 +176,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -192,7 +192,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `glob` field is not valid because: ', [e]) ) } else { @@ -208,7 +208,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputEval` field is not valid because: ', [e]) ) } else { @@ -224,7 +224,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`loadContents\`,\`loadListing\`,\`glob\`,\`outputEval\``) ) @@ -233,8 +233,8 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandOutputBinding'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputBinding'", __errors) } const schema = new CommandOutputBinding({ diff --git a/src/commandOutputEnumSchema.ts b/src/commandOutputEnumSchema.ts index dae8d72..8682e65 100644 --- a/src/commandOutputEnumSchema.ts +++ b/src/commandOutputEnumSchema.ts @@ -73,7 +73,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -108,7 +108,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) } else { @@ -122,7 +122,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -137,7 +137,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -153,7 +153,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -169,7 +169,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -178,8 +178,8 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandOutputEnumSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputEnumSchema'", __errors) } const schema = new CommandOutputEnumSchema({ diff --git a/src/commandOutputParameter.ts b/src/commandOutputParameter.ts index f08dfe3..81335d5 100644 --- a/src/commandOutputParameter.ts +++ b/src/commandOutputParameter.ts @@ -145,7 +145,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -154,7 +154,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -181,7 +181,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -197,7 +197,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -213,7 +213,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -229,7 +229,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -245,7 +245,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -260,7 +260,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -275,7 +275,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputBinding` field is not valid because: ', [e]) ) } else { @@ -291,7 +291,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`type\`,\`outputBinding\``) ) @@ -300,8 +300,8 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandOutputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputParameter'", __errors) } const schema = new CommandOutputParameter({ diff --git a/src/commandOutputRecordField.ts b/src/commandOutputRecordField.ts index 5359d60..f66649e 100644 --- a/src/commandOutputRecordField.ts +++ b/src/commandOutputRecordField.ts @@ -146,7 +146,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -155,7 +155,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -182,7 +182,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -197,7 +197,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -212,7 +212,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -228,7 +228,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -244,7 +244,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -260,7 +260,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -276,7 +276,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputBinding` field is not valid because: ', [e]) ) } else { @@ -292,7 +292,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\`,\`outputBinding\``) ) @@ -301,8 +301,8 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandOutputRecordField'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputRecordField'", __errors) } const schema = new CommandOutputRecordField({ diff --git a/src/commandOutputRecordSchema.ts b/src/commandOutputRecordSchema.ts index 7d800fb..ea39fbb 100644 --- a/src/commandOutputRecordSchema.ts +++ b/src/commandOutputRecordSchema.ts @@ -73,7 +73,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -109,7 +109,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) } else { @@ -124,7 +124,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -139,7 +139,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -155,7 +155,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -171,7 +171,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -180,8 +180,8 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp } } - if (errors.length > 0) { - throw new ValidationException("Trying 'CommandOutputRecordSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'CommandOutputRecordSchema'", __errors) } const schema = new CommandOutputRecordSchema({ diff --git a/src/directory.ts b/src/directory.ts index 7272693..8b275b0 100644 --- a/src/directory.ts +++ b/src/directory.ts @@ -165,7 +165,7 @@ export class Directory extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -173,7 +173,7 @@ export class Directory extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -188,7 +188,7 @@ export class Directory extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `location` field is not valid because: ', [e]) ) } else { @@ -204,7 +204,7 @@ export class Directory extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `path` field is not valid because: ', [e]) ) } else { @@ -220,7 +220,7 @@ export class Directory extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `basename` field is not valid because: ', [e]) ) } else { @@ -236,7 +236,7 @@ export class Directory extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `listing` field is not valid because: ', [e]) ) } else { @@ -252,7 +252,7 @@ export class Directory extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`location\`,\`path\`,\`basename\`,\`listing\``) ) @@ -261,8 +261,8 @@ export class Directory extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'Directory'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'Directory'", __errors) } const schema = new Directory({ diff --git a/src/dirent.ts b/src/dirent.ts index b30a506..3542464 100644 --- a/src/dirent.ts +++ b/src/dirent.ts @@ -136,7 +136,7 @@ export class Dirent extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let entryname if ('entryname' in _doc) { @@ -145,7 +145,7 @@ export class Dirent extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `entryname` field is not valid because: ', [e]) ) } else { @@ -160,7 +160,7 @@ export class Dirent extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `entry` field is not valid because: ', [e]) ) } else { @@ -175,7 +175,7 @@ export class Dirent extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `writable` field is not valid because: ', [e]) ) } else { @@ -191,7 +191,7 @@ export class Dirent extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`entryname\`,\`entry\`,\`writable\``) ) @@ -200,8 +200,8 @@ export class Dirent extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'Dirent'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'Dirent'", __errors) } const schema = new Dirent({ diff --git a/src/dockerRequirement.ts b/src/dockerRequirement.ts index 5609c8a..35c18fe 100644 --- a/src/dockerRequirement.ts +++ b/src/dockerRequirement.ts @@ -147,7 +147,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -155,7 +155,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -170,7 +170,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dockerPull` field is not valid because: ', [e]) ) } else { @@ -186,7 +186,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dockerLoad` field is not valid because: ', [e]) ) } else { @@ -202,7 +202,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dockerFile` field is not valid because: ', [e]) ) } else { @@ -218,7 +218,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dockerImport` field is not valid because: ', [e]) ) } else { @@ -234,7 +234,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dockerImageId` field is not valid because: ', [e]) ) } else { @@ -250,7 +250,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dockerOutputDirectory` field is not valid because: ', [e]) ) } else { @@ -266,7 +266,7 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`dockerPull\`,\`dockerLoad\`,\`dockerFile\`,\`dockerImport\`,\`dockerImageId\`,\`dockerOutputDirectory\``) ) @@ -275,8 +275,8 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi } } - if (errors.length > 0) { - throw new ValidationException("Trying 'DockerRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'DockerRequirement'", __errors) } const schema = new DockerRequirement({ diff --git a/src/enumSchema.ts b/src/enumSchema.ts index b6cde38..3f5896f 100644 --- a/src/enumSchema.ts +++ b/src/enumSchema.ts @@ -58,7 +58,7 @@ export class EnumSchema extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let symbols try { @@ -66,7 +66,7 @@ export class EnumSchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) } else { @@ -80,7 +80,7 @@ export class EnumSchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -95,7 +95,7 @@ export class EnumSchema extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`symbols\`,\`type\``) ) @@ -104,8 +104,8 @@ export class EnumSchema extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'EnumSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'EnumSchema'", __errors) } const schema = new EnumSchema({ diff --git a/src/envVarRequirement.ts b/src/envVarRequirement.ts index 1bf7488..b062b00 100644 --- a/src/envVarRequirement.ts +++ b/src/envVarRequirement.ts @@ -59,7 +59,7 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -67,7 +67,7 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -81,7 +81,7 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `envDef` field is not valid because: ', [e]) ) } else { @@ -96,7 +96,7 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`envDef\``) ) @@ -105,8 +105,8 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi } } - if (errors.length > 0) { - throw new ValidationException("Trying 'EnvVarRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'EnvVarRequirement'", __errors) } const schema = new EnvVarRequirement({ diff --git a/src/environmentDef.ts b/src/environmentDef.ts index 86cc61c..aaa477c 100644 --- a/src/environmentDef.ts +++ b/src/environmentDef.ts @@ -60,7 +60,7 @@ export class EnvironmentDef extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let envName try { @@ -68,7 +68,7 @@ export class EnvironmentDef extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `envName` field is not valid because: ', [e]) ) } else { @@ -82,7 +82,7 @@ export class EnvironmentDef extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `envValue` field is not valid because: ', [e]) ) } else { @@ -97,7 +97,7 @@ export class EnvironmentDef extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`envName\`,\`envValue\``) ) @@ -106,8 +106,8 @@ export class EnvironmentDef extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'EnvironmentDef'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'EnvironmentDef'", __errors) } const schema = new EnvironmentDef({ diff --git a/src/expressionTool.ts b/src/expressionTool.ts index 202d7b2..3e8508b 100644 --- a/src/expressionTool.ts +++ b/src/expressionTool.ts @@ -155,7 +155,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -164,7 +164,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -190,7 +190,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -205,7 +205,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -221,7 +221,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -236,7 +236,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) } else { @@ -250,7 +250,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) } else { @@ -265,7 +265,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) } else { @@ -281,7 +281,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) } else { @@ -297,7 +297,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) } else { @@ -313,7 +313,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) } else { @@ -328,7 +328,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `expression` field is not valid because: ', [e]) ) } else { @@ -343,7 +343,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\`,\`expression\``) ) @@ -352,8 +352,8 @@ export class ExpressionTool extends Saveable implements Internal.Process { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ExpressionTool'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ExpressionTool'", __errors) } const schema = new ExpressionTool({ diff --git a/src/expressionToolOutputParameter.ts b/src/expressionToolOutputParameter.ts index 9a33c7c..889f779 100644 --- a/src/expressionToolOutputParameter.ts +++ b/src/expressionToolOutputParameter.ts @@ -137,7 +137,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -146,7 +146,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -173,7 +173,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -189,7 +189,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -205,7 +205,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -221,7 +221,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -237,7 +237,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -252,7 +252,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -267,7 +267,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`type\``) ) @@ -276,8 +276,8 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ExpressionToolOutputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ExpressionToolOutputParameter'", __errors) } const schema = new ExpressionToolOutputParameter({ diff --git a/src/file.ts b/src/file.ts index 6e29098..0aca835 100644 --- a/src/file.ts +++ b/src/file.ts @@ -293,7 +293,7 @@ export class File extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -301,7 +301,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -316,7 +316,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `location` field is not valid because: ', [e]) ) } else { @@ -332,7 +332,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `path` field is not valid because: ', [e]) ) } else { @@ -348,7 +348,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `basename` field is not valid because: ', [e]) ) } else { @@ -364,7 +364,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `dirname` field is not valid because: ', [e]) ) } else { @@ -380,7 +380,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `nameroot` field is not valid because: ', [e]) ) } else { @@ -396,7 +396,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `nameext` field is not valid because: ', [e]) ) } else { @@ -412,7 +412,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `checksum` field is not valid because: ', [e]) ) } else { @@ -428,7 +428,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `size` field is not valid because: ', [e]) ) } else { @@ -444,7 +444,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -460,7 +460,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -476,7 +476,7 @@ export class File extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `contents` field is not valid because: ', [e]) ) } else { @@ -492,7 +492,7 @@ export class File extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`location\`,\`path\`,\`basename\`,\`dirname\`,\`nameroot\`,\`nameext\`,\`checksum\`,\`size\`,\`secondaryFiles\`,\`format\`,\`contents\``) ) @@ -501,8 +501,8 @@ export class File extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'File'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'File'", __errors) } const schema = new File({ diff --git a/src/initialWorkDirRequirement.ts b/src/initialWorkDirRequirement.ts index 150bf21..bf89510 100644 --- a/src/initialWorkDirRequirement.ts +++ b/src/initialWorkDirRequirement.ts @@ -82,7 +82,7 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -90,7 +90,7 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -104,7 +104,7 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `listing` field is not valid because: ', [e]) ) } else { @@ -119,7 +119,7 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`listing\``) ) @@ -128,8 +128,8 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InitialWorkDirRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InitialWorkDirRequirement'", __errors) } const schema = new InitialWorkDirRequirement({ diff --git a/src/inlineJavascriptRequirement.ts b/src/inlineJavascriptRequirement.ts index 53a8cfd..dde9589 100644 --- a/src/inlineJavascriptRequirement.ts +++ b/src/inlineJavascriptRequirement.ts @@ -63,7 +63,7 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -71,7 +71,7 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -86,7 +86,7 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `expressionLib` field is not valid because: ', [e]) ) } else { @@ -102,7 +102,7 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`expressionLib\``) ) @@ -111,8 +111,8 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InlineJavascriptRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InlineJavascriptRequirement'", __errors) } const schema = new InlineJavascriptRequirement({ diff --git a/src/inplaceUpdateRequirement.ts b/src/inplaceUpdateRequirement.ts index 1b0cdc2..a59c9ea 100644 --- a/src/inplaceUpdateRequirement.ts +++ b/src/inplaceUpdateRequirement.ts @@ -83,7 +83,7 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -91,7 +91,7 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -105,7 +105,7 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inplaceUpdate` field is not valid because: ', [e]) ) } else { @@ -120,7 +120,7 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`inplaceUpdate\``) ) @@ -129,8 +129,8 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InplaceUpdateRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InplaceUpdateRequirement'", __errors) } const schema = new InplaceUpdateRequirement({ diff --git a/src/inputArraySchema.ts b/src/inputArraySchema.ts index 6418613..71dccf4 100644 --- a/src/inputArraySchema.ts +++ b/src/inputArraySchema.ts @@ -73,7 +73,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -108,7 +108,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) } else { @@ -122,7 +122,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -137,7 +137,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -153,7 +153,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -169,7 +169,7 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -178,8 +178,8 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InputArraySchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InputArraySchema'", __errors) } const schema = new InputArraySchema({ diff --git a/src/inputBinding.ts b/src/inputBinding.ts index dbb745a..0faba04 100644 --- a/src/inputBinding.ts +++ b/src/inputBinding.ts @@ -52,7 +52,7 @@ export class InputBinding extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let loadContents if ('loadContents' in _doc) { @@ -61,7 +61,7 @@ export class InputBinding extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -77,7 +77,7 @@ export class InputBinding extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`loadContents\``) ) @@ -86,8 +86,8 @@ export class InputBinding extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InputBinding'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InputBinding'", __errors) } const schema = new InputBinding({ diff --git a/src/inputEnumSchema.ts b/src/inputEnumSchema.ts index 7a570be..35c72ca 100644 --- a/src/inputEnumSchema.ts +++ b/src/inputEnumSchema.ts @@ -73,7 +73,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -108,7 +108,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) } else { @@ -122,7 +122,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -137,7 +137,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -153,7 +153,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -169,7 +169,7 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -178,8 +178,8 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InputEnumSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InputEnumSchema'", __errors) } const schema = new InputEnumSchema({ diff --git a/src/inputRecordField.ts b/src/inputRecordField.ts index 0ff9eea..58c20f2 100644 --- a/src/inputRecordField.ts +++ b/src/inputRecordField.ts @@ -170,7 +170,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -179,7 +179,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -206,7 +206,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -221,7 +221,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -236,7 +236,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -252,7 +252,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -268,7 +268,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -284,7 +284,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -300,7 +300,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -316,7 +316,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -332,7 +332,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\`,\`loadContents\`,\`loadListing\``) ) @@ -341,8 +341,8 @@ export class InputRecordField extends Saveable implements Internal.RecordField, } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InputRecordField'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InputRecordField'", __errors) } const schema = new InputRecordField({ diff --git a/src/inputRecordSchema.ts b/src/inputRecordSchema.ts index 0d2d334..8e43892 100644 --- a/src/inputRecordSchema.ts +++ b/src/inputRecordSchema.ts @@ -73,7 +73,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -109,7 +109,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) } else { @@ -124,7 +124,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -139,7 +139,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -155,7 +155,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -171,7 +171,7 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -180,8 +180,8 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema } } - if (errors.length > 0) { - throw new ValidationException("Trying 'InputRecordSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'InputRecordSchema'", __errors) } const schema = new InputRecordSchema({ diff --git a/src/loadListingRequirement.ts b/src/loadListingRequirement.ts index dd538a7..017b79e 100644 --- a/src/loadListingRequirement.ts +++ b/src/loadListingRequirement.ts @@ -55,7 +55,7 @@ export class LoadListingRequirement extends Saveable implements Internal.Process static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -63,7 +63,7 @@ export class LoadListingRequirement extends Saveable implements Internal.Process baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -78,7 +78,7 @@ export class LoadListingRequirement extends Saveable implements Internal.Process baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -94,7 +94,7 @@ export class LoadListingRequirement extends Saveable implements Internal.Process const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`loadListing\``) ) @@ -103,8 +103,8 @@ export class LoadListingRequirement extends Saveable implements Internal.Process } } - if (errors.length > 0) { - throw new ValidationException("Trying 'LoadListingRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'LoadListingRequirement'", __errors) } const schema = new LoadListingRequirement({ diff --git a/src/multipleInputFeatureRequirement.ts b/src/multipleInputFeatureRequirement.ts index c4bada5..4a151a4 100644 --- a/src/multipleInputFeatureRequirement.ts +++ b/src/multipleInputFeatureRequirement.ts @@ -53,7 +53,7 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -61,7 +61,7 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -76,7 +76,7 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\``) ) @@ -85,8 +85,8 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna } } - if (errors.length > 0) { - throw new ValidationException("Trying 'MultipleInputFeatureRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'MultipleInputFeatureRequirement'", __errors) } const schema = new MultipleInputFeatureRequirement({ diff --git a/src/networkAccess.ts b/src/networkAccess.ts index dd179b5..0017927 100644 --- a/src/networkAccess.ts +++ b/src/networkAccess.ts @@ -68,7 +68,7 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -76,7 +76,7 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -90,7 +90,7 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `networkAccess` field is not valid because: ', [e]) ) } else { @@ -105,7 +105,7 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`networkAccess\``) ) @@ -114,8 +114,8 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme } } - if (errors.length > 0) { - throw new ValidationException("Trying 'NetworkAccess'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'NetworkAccess'", __errors) } const schema = new NetworkAccess({ diff --git a/src/operation.ts b/src/operation.ts index c53bd85..0f8948a 100644 --- a/src/operation.ts +++ b/src/operation.ts @@ -146,7 +146,7 @@ export class Operation extends Saveable implements Internal.Process { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -155,7 +155,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -181,7 +181,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -196,7 +196,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -212,7 +212,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -227,7 +227,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) } else { @@ -241,7 +241,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) } else { @@ -256,7 +256,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) } else { @@ -272,7 +272,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) } else { @@ -288,7 +288,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) } else { @@ -304,7 +304,7 @@ export class Operation extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) } else { @@ -320,7 +320,7 @@ export class Operation extends Saveable implements Internal.Process { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\``) ) @@ -329,8 +329,8 @@ export class Operation extends Saveable implements Internal.Process { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'Operation'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'Operation'", __errors) } const schema = new Operation({ diff --git a/src/operationInputParameter.ts b/src/operationInputParameter.ts index fcfa250..e6ba1d5 100644 --- a/src/operationInputParameter.ts +++ b/src/operationInputParameter.ts @@ -182,7 +182,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -191,7 +191,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -218,7 +218,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -234,7 +234,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -250,7 +250,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -266,7 +266,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -282,7 +282,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -298,7 +298,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -314,7 +314,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -330,7 +330,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) } else { @@ -345,7 +345,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -360,7 +360,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`loadContents\`,\`loadListing\`,\`default\`,\`type\``) ) @@ -369,8 +369,8 @@ export class OperationInputParameter extends Saveable implements Internal.InputP } } - if (errors.length > 0) { - throw new ValidationException("Trying 'OperationInputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'OperationInputParameter'", __errors) } const schema = new OperationInputParameter({ diff --git a/src/operationOutputParameter.ts b/src/operationOutputParameter.ts index 16f30de..aef1d04 100644 --- a/src/operationOutputParameter.ts +++ b/src/operationOutputParameter.ts @@ -140,7 +140,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -149,7 +149,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -176,7 +176,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -192,7 +192,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -208,7 +208,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -224,7 +224,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -240,7 +240,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -255,7 +255,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -270,7 +270,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`type\``) ) @@ -279,8 +279,8 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu } } - if (errors.length > 0) { - throw new ValidationException("Trying 'OperationOutputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'OperationOutputParameter'", __errors) } const schema = new OperationOutputParameter({ diff --git a/src/outputArraySchema.ts b/src/outputArraySchema.ts index 2f078ae..5863884 100644 --- a/src/outputArraySchema.ts +++ b/src/outputArraySchema.ts @@ -73,7 +73,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -108,7 +108,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `items` field is not valid because: ', [e]) ) } else { @@ -122,7 +122,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -137,7 +137,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -153,7 +153,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -169,7 +169,7 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`items\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -178,8 +178,8 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, } } - if (errors.length > 0) { - throw new ValidationException("Trying 'OutputArraySchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'OutputArraySchema'", __errors) } const schema = new OutputArraySchema({ diff --git a/src/outputEnumSchema.ts b/src/outputEnumSchema.ts index 3d21801..6af6922 100644 --- a/src/outputEnumSchema.ts +++ b/src/outputEnumSchema.ts @@ -73,7 +73,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -108,7 +108,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `symbols` field is not valid because: ', [e]) ) } else { @@ -122,7 +122,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -137,7 +137,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -153,7 +153,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -169,7 +169,7 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`symbols\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -178,8 +178,8 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I } } - if (errors.length > 0) { - throw new ValidationException("Trying 'OutputEnumSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'OutputEnumSchema'", __errors) } const schema = new OutputEnumSchema({ diff --git a/src/outputRecordField.ts b/src/outputRecordField.ts index 510a974..4a91eb6 100644 --- a/src/outputRecordField.ts +++ b/src/outputRecordField.ts @@ -138,7 +138,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -147,7 +147,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -174,7 +174,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -189,7 +189,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -204,7 +204,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -220,7 +220,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -236,7 +236,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -252,7 +252,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -268,7 +268,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`doc\`,\`name\`,\`type\`,\`label\`,\`secondaryFiles\`,\`streamable\`,\`format\``) ) @@ -277,8 +277,8 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, } } - if (errors.length > 0) { - throw new ValidationException("Trying 'OutputRecordField'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'OutputRecordField'", __errors) } const schema = new OutputRecordField({ diff --git a/src/outputRecordSchema.ts b/src/outputRecordSchema.ts index f491ba2..52f73f2 100644 --- a/src/outputRecordSchema.ts +++ b/src/outputRecordSchema.ts @@ -73,7 +73,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -82,7 +82,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -109,7 +109,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) } else { @@ -124,7 +124,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -139,7 +139,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -155,7 +155,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -171,7 +171,7 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`fields\`,\`type\`,\`label\`,\`doc\`,\`name\``) ) @@ -180,8 +180,8 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem } } - if (errors.length > 0) { - throw new ValidationException("Trying 'OutputRecordSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'OutputRecordSchema'", __errors) } const schema = new OutputRecordSchema({ diff --git a/src/recordField.ts b/src/recordField.ts index 863805e..7b6b2a5 100644 --- a/src/recordField.ts +++ b/src/recordField.ts @@ -65,7 +65,7 @@ export class RecordField extends Saveable implements Internal.Documented { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let name if ('name' in _doc) { @@ -74,7 +74,7 @@ export class RecordField extends Saveable implements Internal.Documented { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `name` field is not valid because: ', [e]) ) } else { @@ -101,7 +101,7 @@ export class RecordField extends Saveable implements Internal.Documented { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -116,7 +116,7 @@ export class RecordField extends Saveable implements Internal.Documented { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -131,7 +131,7 @@ export class RecordField extends Saveable implements Internal.Documented { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`doc\`,\`name\`,\`type\``) ) @@ -140,8 +140,8 @@ export class RecordField extends Saveable implements Internal.Documented { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'RecordField'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'RecordField'", __errors) } const schema = new RecordField({ diff --git a/src/recordSchema.ts b/src/recordSchema.ts index fe0f70c..96e19b3 100644 --- a/src/recordSchema.ts +++ b/src/recordSchema.ts @@ -55,7 +55,7 @@ export class RecordSchema extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let fields if ('fields' in _doc) { @@ -64,7 +64,7 @@ export class RecordSchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `fields` field is not valid because: ', [e]) ) } else { @@ -79,7 +79,7 @@ export class RecordSchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -94,7 +94,7 @@ export class RecordSchema extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`fields\`,\`type\``) ) @@ -103,8 +103,8 @@ export class RecordSchema extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'RecordSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'RecordSchema'", __errors) } const schema = new RecordSchema({ diff --git a/src/resourceRequirement.ts b/src/resourceRequirement.ts index 90f9ac7..9c3c245 100644 --- a/src/resourceRequirement.ts +++ b/src/resourceRequirement.ts @@ -182,7 +182,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -190,7 +190,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -205,7 +205,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `coresMin` field is not valid because: ', [e]) ) } else { @@ -221,7 +221,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `coresMax` field is not valid because: ', [e]) ) } else { @@ -237,7 +237,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `ramMin` field is not valid because: ', [e]) ) } else { @@ -253,7 +253,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `ramMax` field is not valid because: ', [e]) ) } else { @@ -269,7 +269,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `tmpdirMin` field is not valid because: ', [e]) ) } else { @@ -285,7 +285,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `tmpdirMax` field is not valid because: ', [e]) ) } else { @@ -301,7 +301,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outdirMin` field is not valid because: ', [e]) ) } else { @@ -317,7 +317,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outdirMax` field is not valid because: ', [e]) ) } else { @@ -333,7 +333,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`coresMin\`,\`coresMax\`,\`ramMin\`,\`ramMax\`,\`tmpdirMin\`,\`tmpdirMax\`,\`outdirMin\`,\`outdirMax\``) ) @@ -342,8 +342,8 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ResourceRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ResourceRequirement'", __errors) } const schema = new ResourceRequirement({ diff --git a/src/scatterFeatureRequirement.ts b/src/scatterFeatureRequirement.ts index 0c5c374..c64acaa 100644 --- a/src/scatterFeatureRequirement.ts +++ b/src/scatterFeatureRequirement.ts @@ -53,7 +53,7 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -61,7 +61,7 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -76,7 +76,7 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\``) ) @@ -85,8 +85,8 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ScatterFeatureRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ScatterFeatureRequirement'", __errors) } const schema = new ScatterFeatureRequirement({ diff --git a/src/schemaDefRequirement.ts b/src/schemaDefRequirement.ts index 4bcf7f7..250d0fb 100644 --- a/src/schemaDefRequirement.ts +++ b/src/schemaDefRequirement.ts @@ -69,7 +69,7 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -77,7 +77,7 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -91,7 +91,7 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `types` field is not valid because: ', [e]) ) } else { @@ -106,7 +106,7 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`types\``) ) @@ -115,8 +115,8 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe } } - if (errors.length > 0) { - throw new ValidationException("Trying 'SchemaDefRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'SchemaDefRequirement'", __errors) } const schema = new SchemaDefRequirement({ diff --git a/src/secondaryFileSchema.ts b/src/secondaryFileSchema.ts index 6f18b82..64680f5 100644 --- a/src/secondaryFileSchema.ts +++ b/src/secondaryFileSchema.ts @@ -123,7 +123,7 @@ export class SecondaryFileSchema extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let pattern try { @@ -131,7 +131,7 @@ export class SecondaryFileSchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `pattern` field is not valid because: ', [e]) ) } else { @@ -146,7 +146,7 @@ export class SecondaryFileSchema extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `required` field is not valid because: ', [e]) ) } else { @@ -162,7 +162,7 @@ export class SecondaryFileSchema extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`pattern\`,\`required\``) ) @@ -171,8 +171,8 @@ export class SecondaryFileSchema extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'SecondaryFileSchema'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'SecondaryFileSchema'", __errors) } const schema = new SecondaryFileSchema({ diff --git a/src/shellCommandRequirement.ts b/src/shellCommandRequirement.ts index 93fc3a9..f30fcca 100644 --- a/src/shellCommandRequirement.ts +++ b/src/shellCommandRequirement.ts @@ -58,7 +58,7 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -66,7 +66,7 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -81,7 +81,7 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\``) ) @@ -90,8 +90,8 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ShellCommandRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ShellCommandRequirement'", __errors) } const schema = new ShellCommandRequirement({ diff --git a/src/softwarePackage.ts b/src/softwarePackage.ts index ff52fe6..ca98140 100644 --- a/src/softwarePackage.ts +++ b/src/softwarePackage.ts @@ -107,7 +107,7 @@ export class SoftwarePackage extends Saveable { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let package_ try { @@ -115,7 +115,7 @@ export class SoftwarePackage extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `package` field is not valid because: ', [e]) ) } else { @@ -130,7 +130,7 @@ export class SoftwarePackage extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `version` field is not valid because: ', [e]) ) } else { @@ -146,7 +146,7 @@ export class SoftwarePackage extends Saveable { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `specs` field is not valid because: ', [e]) ) } else { @@ -162,7 +162,7 @@ export class SoftwarePackage extends Saveable { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`package\`,\`version\`,\`specs\``) ) @@ -171,8 +171,8 @@ export class SoftwarePackage extends Saveable { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'SoftwarePackage'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'SoftwarePackage'", __errors) } const schema = new SoftwarePackage({ diff --git a/src/softwareRequirement.ts b/src/softwareRequirement.ts index 29b6730..1d55ac3 100644 --- a/src/softwareRequirement.ts +++ b/src/softwareRequirement.ts @@ -59,7 +59,7 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -67,7 +67,7 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -81,7 +81,7 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `packages` field is not valid because: ', [e]) ) } else { @@ -96,7 +96,7 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`packages\``) ) @@ -105,8 +105,8 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq } } - if (errors.length > 0) { - throw new ValidationException("Trying 'SoftwareRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'SoftwareRequirement'", __errors) } const schema = new SoftwareRequirement({ diff --git a/src/stepInputExpressionRequirement.ts b/src/stepInputExpressionRequirement.ts index 1f54772..ce6dcbe 100644 --- a/src/stepInputExpressionRequirement.ts +++ b/src/stepInputExpressionRequirement.ts @@ -53,7 +53,7 @@ export class StepInputExpressionRequirement extends Saveable implements Internal static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -61,7 +61,7 @@ export class StepInputExpressionRequirement extends Saveable implements Internal baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -76,7 +76,7 @@ export class StepInputExpressionRequirement extends Saveable implements Internal const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\``) ) @@ -85,8 +85,8 @@ export class StepInputExpressionRequirement extends Saveable implements Internal } } - if (errors.length > 0) { - throw new ValidationException("Trying 'StepInputExpressionRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'StepInputExpressionRequirement'", __errors) } const schema = new StepInputExpressionRequirement({ diff --git a/src/subworkflowFeatureRequirement.ts b/src/subworkflowFeatureRequirement.ts index 6beabe2..89903a5 100644 --- a/src/subworkflowFeatureRequirement.ts +++ b/src/subworkflowFeatureRequirement.ts @@ -53,7 +53,7 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -61,7 +61,7 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -76,7 +76,7 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\``) ) @@ -85,8 +85,8 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. } } - if (errors.length > 0) { - throw new ValidationException("Trying 'SubworkflowFeatureRequirement'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'SubworkflowFeatureRequirement'", __errors) } const schema = new SubworkflowFeatureRequirement({ diff --git a/src/test/exampleTest.ts b/src/test/exampleTest.ts index 0642397..7140911 100644 --- a/src/test/exampleTest.ts +++ b/src/test/exampleTest.ts @@ -10,132 +10,151 @@ describe('Example Tests', () => { }) it('valid_stderr_shortcut by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-stderr-shortcut.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_bwa_mem_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-bwa-mem-tool.cwl') }) it('valid_bwa_mem_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-bwa-mem-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_cat3_tool_mediumcut', async () => { await loadDocument(__dirname + '/data/examples/valid-cat3-tool-mediumcut.cwl') }) it('valid_cat3_tool_mediumcut by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat3-tool-mediumcut.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_cat1_testcli', async () => { await loadDocument(__dirname + '/data/examples/valid-cat1-testcli.cwl') }) it('valid_cat1_testcli by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat1-testcli.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_null_expression2_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-null-expression2-tool.cwl') }) it('valid_null_expression2_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-null-expression2-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_cat3_tool_shortcut', async () => { await loadDocument(__dirname + '/data/examples/valid-cat3-tool-shortcut.cwl') }) it('valid_cat3_tool_shortcut by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat3-tool-shortcut.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_binding_test', async () => { await loadDocument(__dirname + '/data/examples/valid-binding-test.cwl') }) it('valid_binding_test by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-binding-test.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_tmap_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-tmap-tool.cwl') }) it('valid_tmap_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-tmap-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_cat4_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-cat4-tool.cwl') }) it('valid_cat4_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat4-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_stderr', async () => { await loadDocument(__dirname + '/data/examples/valid-stderr.cwl') }) it('valid_stderr by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-stderr.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_any_type_compat', async () => { await loadDocument(__dirname + '/data/examples/valid-any-type-compat.cwl') }) it('valid_any_type_compat by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-any-type-compat.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_parseInt_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-parseInt-tool.cwl') }) it('valid_parseInt_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-parseInt-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_dir2', async () => { await loadDocument(__dirname + '/data/examples/valid-dir2.cwl') }) it('valid_dir2 by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-dir2.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_wc2_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-wc2-tool.cwl') }) it('valid_wc2_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-wc2-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_null_expression1_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-null-expression1-tool.cwl') }) it('valid_null_expression1_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-null-expression1-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_stderr_mediumcut', async () => { await loadDocument(__dirname + '/data/examples/valid-stderr-mediumcut.cwl') }) it('valid_stderr_mediumcut by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-stderr-mediumcut.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_cat3_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-cat3-tool.cwl') }) it('valid_cat3_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat3-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_template_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-template-tool.cwl') }) it('valid_template_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-template-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) it('valid_cat_tool', async () => { await loadDocument(__dirname + '/data/examples/valid-cat-tool.cwl') }) it('valid_cat_tool by string', async () => { let doc = fs.readFileSync(__dirname + '/data/examples/valid-cat-tool.cwl').toString() - await loadDocumentByString(doc, url.pathToFileURL(__dirname + '/data/examples/').toString()) + await loadDocumentByString(doc, url.pathToFileURL(__dirname + + '/data/examples/').toString()) }) }) diff --git a/src/toolTimeLimit.ts b/src/toolTimeLimit.ts index d579734..71fa728 100644 --- a/src/toolTimeLimit.ts +++ b/src/toolTimeLimit.ts @@ -66,7 +66,7 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -74,7 +74,7 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -88,7 +88,7 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `timelimit` field is not valid because: ', [e]) ) } else { @@ -103,7 +103,7 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`timelimit\``) ) @@ -112,8 +112,8 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme } } - if (errors.length > 0) { - throw new ValidationException("Trying 'ToolTimeLimit'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'ToolTimeLimit'", __errors) } const schema = new ToolTimeLimit({ diff --git a/src/workReuse.ts b/src/workReuse.ts index 3c0abd3..bc12c2b 100644 --- a/src/workReuse.ts +++ b/src/workReuse.ts @@ -62,7 +62,7 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let class_ try { @@ -70,7 +70,7 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -84,7 +84,7 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `enableReuse` field is not valid because: ', [e]) ) } else { @@ -99,7 +99,7 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`class\`,\`enableReuse\``) ) @@ -108,8 +108,8 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'WorkReuse'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'WorkReuse'", __errors) } const schema = new WorkReuse({ diff --git a/src/workflow.ts b/src/workflow.ts index 93f09d6..6585c38 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -200,7 +200,7 @@ export class Workflow extends Saveable implements Internal.Process { static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -209,7 +209,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -235,7 +235,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `class` field is not valid because: ', [e]) ) } else { @@ -250,7 +250,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -266,7 +266,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -281,7 +281,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputs` field is not valid because: ', [e]) ) } else { @@ -295,7 +295,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputs` field is not valid because: ', [e]) ) } else { @@ -310,7 +310,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) } else { @@ -326,7 +326,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) } else { @@ -342,7 +342,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `cwlVersion` field is not valid because: ', [e]) ) } else { @@ -358,7 +358,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `intent` field is not valid because: ', [e]) ) } else { @@ -373,7 +373,7 @@ export class Workflow extends Saveable implements Internal.Process { baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `steps` field is not valid because: ', [e]) ) } else { @@ -388,7 +388,7 @@ export class Workflow extends Saveable implements Internal.Process { const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\`,\`label\`,\`doc\`,\`inputs\`,\`outputs\`,\`requirements\`,\`hints\`,\`cwlVersion\`,\`intent\`,\`class\`,\`steps\``) ) @@ -397,8 +397,8 @@ export class Workflow extends Saveable implements Internal.Process { } } - if (errors.length > 0) { - throw new ValidationException("Trying 'Workflow'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'Workflow'", __errors) } const schema = new Workflow({ diff --git a/src/workflowInputParameter.ts b/src/workflowInputParameter.ts index 81cc424..7327b9d 100644 --- a/src/workflowInputParameter.ts +++ b/src/workflowInputParameter.ts @@ -187,7 +187,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -196,7 +196,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -223,7 +223,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -239,7 +239,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -255,7 +255,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -271,7 +271,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -287,7 +287,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -303,7 +303,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -319,7 +319,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -335,7 +335,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) } else { @@ -350,7 +350,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -365,7 +365,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `inputBinding` field is not valid because: ', [e]) ) } else { @@ -381,7 +381,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`loadContents\`,\`loadListing\`,\`default\`,\`type\`,\`inputBinding\``) ) @@ -390,8 +390,8 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa } } - if (errors.length > 0) { - throw new ValidationException("Trying 'WorkflowInputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'WorkflowInputParameter'", __errors) } const schema = new WorkflowInputParameter({ diff --git a/src/workflowOutputParameter.ts b/src/workflowOutputParameter.ts index a81b32b..470696f 100644 --- a/src/workflowOutputParameter.ts +++ b/src/workflowOutputParameter.ts @@ -169,7 +169,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -178,7 +178,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -205,7 +205,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -221,7 +221,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `secondaryFiles` field is not valid because: ', [e]) ) } else { @@ -237,7 +237,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `streamable` field is not valid because: ', [e]) ) } else { @@ -253,7 +253,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -269,7 +269,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `format` field is not valid because: ', [e]) ) } else { @@ -285,7 +285,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `outputSource` field is not valid because: ', [e]) ) } else { @@ -301,7 +301,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `linkMerge` field is not valid because: ', [e]) ) } else { @@ -317,7 +317,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `pickValue` field is not valid because: ', [e]) ) } else { @@ -332,7 +332,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `type` field is not valid because: ', [e]) ) } else { @@ -347,7 +347,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`label\`,\`secondaryFiles\`,\`streamable\`,\`doc\`,\`id\`,\`format\`,\`outputSource\`,\`linkMerge\`,\`pickValue\`,\`type\``) ) @@ -356,8 +356,8 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output } } - if (errors.length > 0) { - throw new ValidationException("Trying 'WorkflowOutputParameter'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'WorkflowOutputParameter'", __errors) } const schema = new WorkflowOutputParameter({ diff --git a/src/workflowStep.ts b/src/workflowStep.ts index c5f6a11..630202c 100644 --- a/src/workflowStep.ts +++ b/src/workflowStep.ts @@ -208,7 +208,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -217,7 +217,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -244,7 +244,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -260,7 +260,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `doc` field is not valid because: ', [e]) ) } else { @@ -275,7 +275,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `in` field is not valid because: ', [e]) ) } else { @@ -289,7 +289,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `out` field is not valid because: ', [e]) ) } else { @@ -304,7 +304,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `requirements` field is not valid because: ', [e]) ) } else { @@ -320,7 +320,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `hints` field is not valid because: ', [e]) ) } else { @@ -335,7 +335,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `run` field is not valid because: ', [e]) ) } else { @@ -350,7 +350,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `when` field is not valid because: ', [e]) ) } else { @@ -366,7 +366,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `scatter` field is not valid because: ', [e]) ) } else { @@ -382,7 +382,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `scatterMethod` field is not valid because: ', [e]) ) } else { @@ -398,7 +398,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\`,\`label\`,\`doc\`,\`in\`,\`out\`,\`requirements\`,\`hints\`,\`run\`,\`when\`,\`scatter\`,\`scatterMethod\``) ) @@ -407,8 +407,8 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter } } - if (errors.length > 0) { - throw new ValidationException("Trying 'WorkflowStep'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'WorkflowStep'", __errors) } const schema = new WorkflowStep({ diff --git a/src/workflowStepInput.ts b/src/workflowStepInput.ts index 998c62f..9aa5490 100644 --- a/src/workflowStepInput.ts +++ b/src/workflowStepInput.ts @@ -255,7 +255,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -264,7 +264,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -291,7 +291,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `source` field is not valid because: ', [e]) ) } else { @@ -307,7 +307,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `linkMerge` field is not valid because: ', [e]) ) } else { @@ -323,7 +323,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `pickValue` field is not valid because: ', [e]) ) } else { @@ -339,7 +339,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadContents` field is not valid because: ', [e]) ) } else { @@ -355,7 +355,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `loadListing` field is not valid because: ', [e]) ) } else { @@ -371,7 +371,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `label` field is not valid because: ', [e]) ) } else { @@ -387,7 +387,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `default` field is not valid because: ', [e]) ) } else { @@ -403,7 +403,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `valueFrom` field is not valid because: ', [e]) ) } else { @@ -419,7 +419,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\`,\`source\`,\`linkMerge\`,\`pickValue\`,\`loadContents\`,\`loadListing\`,\`label\`,\`default\`,\`valueFrom\``) ) @@ -428,8 +428,8 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, } } - if (errors.length > 0) { - throw new ValidationException("Trying 'WorkflowStepInput'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'WorkflowStepInput'", __errors) } const schema = new WorkflowStepInput({ diff --git a/src/workflowStepOutput.ts b/src/workflowStepOutput.ts index aaa99e4..8c1558d 100644 --- a/src/workflowStepOutput.ts +++ b/src/workflowStepOutput.ts @@ -59,7 +59,7 @@ export class WorkflowStepOutput extends Saveable implements Internal.Identified static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { const _doc = Object.assign({}, __doc) - const errors: ValidationException[] = [] + const __errors: ValidationException[] = [] let id if ('id' in _doc) { @@ -68,7 +68,7 @@ export class WorkflowStepOutput extends Saveable implements Internal.Identified baseuri, loadingOptions) } catch (e) { if (e instanceof ValidationException) { - errors.push( + __errors.push( new ValidationException('the `id` field is not valid because: ', [e]) ) } else { @@ -95,7 +95,7 @@ export class WorkflowStepOutput extends Saveable implements Internal.Identified const ex = expandUrl(key, '', loadingOptions, false, false) extensionFields[ex] = value } else { - errors.push( + __errors.push( new ValidationException(`invalid field ${key as string}, \ expected one of: \`id\``) ) @@ -104,8 +104,8 @@ export class WorkflowStepOutput extends Saveable implements Internal.Identified } } - if (errors.length > 0) { - throw new ValidationException("Trying 'WorkflowStepOutput'", errors) + if (__errors.length > 0) { + throw new ValidationException("Trying 'WorkflowStepOutput'", __errors) } const schema = new WorkflowStepOutput({ From c4ffcd4c2aa7e4bc0a6d21ddba66e1f5d313f4b4 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 14:16:59 +0100 Subject: [PATCH 09/19] Add CI test workflow --- .github/workflows/workflow.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..0a703aa --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,32 @@ +name: Continuous integration tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +concurrency: + group: build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +env: + NODE_VERSION: 17.x + +jobs: + + CI: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - run: node --version + - run: npm install + - run: npm test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2.1.0 + with: + fail_ci_if_error: true + flags: unittests \ No newline at end of file From 52d61ddfe5fbe1324c93a3e7eed7dc4f41b97aee Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 13 Dec 2021 15:27:08 +0100 Subject: [PATCH 10/19] Remove LICENSE copy file --- LICENSE copy | 201 --------------------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 LICENSE copy diff --git a/LICENSE copy b/LICENSE copy deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE copy +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. From 14ec7fda1e28bb79974dab55d04d1ba49526f53c Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 20 Dec 2021 10:38:48 +0100 Subject: [PATCH 11/19] Add interfaces for document properties --- src/arraySchema.ts | 10 +- src/arraySchemaProperties.ts | 21 ++ src/commandInputArraySchema.ts | 18 +- src/commandInputArraySchemaProperties.ts | 41 +++ src/commandInputEnumSchema.ts | 18 +- src/commandInputEnumSchemaProperties.ts | 41 +++ src/commandInputParameter.ts | 30 +-- src/commandInputParameterProperties.ts | 146 ++++++++++ src/commandInputRecordField.ts | 26 +- src/commandInputRecordFieldProperties.ts | 134 ++++++++++ src/commandInputRecordSchema.ts | 20 +- src/commandInputRecordSchemaProperties.ts | 41 +++ ...ema.ts => commandInputSchemaProperties.ts} | 4 +- src/commandLineBindable.ts | 12 +- src/commandLineBindableProperties.ts | 16 ++ src/commandLineBinding.ts | 24 +- src/commandLineBindingProperties.ts | 120 +++++++++ src/commandLineTool.ts | 40 ++- src/commandLineToolProperties.ts | 186 +++++++++++++ src/commandOutputArraySchema.ts | 16 +- src/commandOutputArraySchemaProperties.ts | 36 +++ src/commandOutputBinding.ts | 18 +- src/commandOutputBindingProperties.ts | 115 ++++++++ src/commandOutputEnumSchema.ts | 16 +- src/commandOutputEnumSchemaProperties.ts | 36 +++ src/commandOutputParameter.ts | 24 +- src/commandOutputParameterProperties.ts | 105 ++++++++ src/commandOutputRecordField.ts | 22 +- src/commandOutputRecordFieldProperties.ts | 106 ++++++++ src/commandOutputRecordSchema.ts | 18 +- src/commandOutputRecordSchemaProperties.ts | 36 +++ src/directory.ts | 18 +- src/directoryProperties.ts | 128 +++++++++ src/dirent.ts | 14 +- src/direntProperties.ts | 101 +++++++ src/dockerRequirement.ts | 22 +- src/dockerRequirementProperties.ts | 108 ++++++++ src/documented.ts | 9 - src/documentedProperties.ts | 14 + src/enumSchema.ts | 10 +- src/enumSchemaProperties.ts | 24 ++ src/envVarRequirement.ts | 10 +- src/envVarRequirementProperties.ts | 25 ++ src/environmentDef.ts | 10 +- src/environmentDefProperties.ts | 26 ++ src/expressionTool.ts | 24 +- src/expressionToolOutputParameter.ts | 22 +- ...expressionToolOutputParameterProperties.ts | 98 +++++++ src/expressionToolProperties.ts | 112 ++++++++ src/fieldBase.ts | 9 - src/fieldBaseProperties.ts | 71 +++++ src/file.ts | 32 ++- src/fileProperties.ts | 249 ++++++++++++++++++ src/iOSchema.ts | 9 - src/iOSchemaProperties.ts | 24 ++ src/identified.ts | 9 - src/identifiedProperties.ts | 14 + src/index.ts | 95 +++++-- src/initialWorkDirRequirement.ts | 12 +- src/initialWorkDirRequirementProperties.ts | 48 ++++ src/inlineJavascriptRequirement.ts | 12 +- src/inlineJavascriptRequirementProperties.ts | 29 ++ src/inplaceUpdateRequirement.ts | 10 +- src/inplaceUpdateRequirementProperties.ts | 49 ++++ src/inputArraySchema.ts | 16 +- src/inputArraySchemaProperties.ts | 36 +++ src/inputBinding.ts | 12 +- src/inputBindingProperties.ts | 19 ++ src/inputEnumSchema.ts | 16 +- src/inputEnumSchemaProperties.ts | 36 +++ src/inputFormat.ts | 9 - src/inputFormatProperties.ts | 20 ++ src/inputParameter.ts | 9 - src/inputParameterProperties.ts | 129 +++++++++ src/inputRecordField.ts | 24 +- src/inputRecordFieldProperties.ts | 129 +++++++++ src/inputRecordSchema.ts | 18 +- src/inputRecordSchemaProperties.ts | 36 +++ src/inputSchema.ts | 9 - src/inputSchemaProperties.ts | 24 ++ src/labeled.ts | 9 - src/labeledProperties.ts | 14 + src/loadContents.ts | 9 - src/loadContentsProperties.ts | 37 +++ src/loadListingRequirement.ts | 12 +- src/loadListingRequirementProperties.ts | 21 ++ src/multipleInputFeatureRequirement.ts | 10 +- ...ltipleInputFeatureRequirementProperties.ts | 20 ++ src/networkAccess.ts | 10 +- src/networkAccessProperties.ts | 34 +++ src/operation.ts | 24 +- src/operationInputParameter.ts | 28 +- src/operationInputParameterProperties.ts | 140 ++++++++++ src/operationOutputParameter.ts | 22 +- src/operationOutputParameterProperties.ts | 101 +++++++ src/operationProperties.ts | 104 ++++++++ src/outputArraySchema.ts | 16 +- src/outputArraySchemaProperties.ts | 36 +++ src/outputEnumSchema.ts | 16 +- src/outputEnumSchemaProperties.ts | 36 +++ src/outputFormat.ts | 9 - src/outputFormatProperties.ts | 18 ++ src/outputParameter.ts | 9 - src/outputParameterProperties.ts | 90 +++++++ src/outputRecordField.ts | 20 +- src/outputRecordFieldProperties.ts | 99 +++++++ src/outputRecordSchema.ts | 18 +- src/outputRecordSchemaProperties.ts | 36 +++ src/outputSchema.ts | 9 - src/outputSchemaProperties.ts | 24 ++ src/parameter.ts | 12 - src/parameterProperties.ts | 84 ++++++ src/process.ts | 15 -- src/processProperties.ts | 98 +++++++ ...ent.ts => processRequirementProperties.ts} | 4 +- src/recordField.ts | 12 +- src/recordFieldProperties.ts | 30 +++ src/recordSchema.ts | 12 +- src/recordSchemaProperties.ts | 21 ++ src/resourceRequirement.ts | 26 +- src/resourceRequirementProperties.ts | 141 ++++++++++ src/scatterFeatureRequirement.ts | 10 +- src/scatterFeatureRequirementProperties.ts | 20 ++ src/schemaDefRequirement.ts | 10 +- src/schemaDefRequirementProperties.ts | 35 +++ src/secondaryFileSchema.ts | 12 +- src/secondaryFileSchemaProperties.ts | 89 +++++++ src/shellCommandRequirement.ts | 10 +- src/shellCommandRequirementProperties.ts | 25 ++ src/sink.ts | 9 - src/sinkProperties.ts | 29 ++ src/softwarePackage.ts | 14 +- src/softwarePackageProperties.ts | 72 +++++ src/softwareRequirement.ts | 10 +- src/softwareRequirementProperties.ts | 25 ++ src/stepInputExpressionRequirement.ts | 10 +- ...tepInputExpressionRequirementProperties.ts | 20 ++ src/subworkflowFeatureRequirement.ts | 10 +- ...subworkflowFeatureRequirementProperties.ts | 20 ++ src/toolTimeLimit.ts | 10 +- src/toolTimeLimitProperties.ts | 32 +++ src/util/internal.ts | 95 +++++-- src/util/loaderInstances.ts | 95 +++++-- src/util/loaders/loader.ts | 1 - src/util/saveable.ts | 4 + src/workReuse.ts | 10 +- src/workReuseProperties.ts | 28 ++ src/workflow.ts | 24 +- src/workflowInputParameter.ts | 30 +-- src/workflowInputParameterProperties.ts | 144 ++++++++++ src/workflowOutputParameter.ts | 28 +- src/workflowOutputParameterProperties.ts | 127 +++++++++ src/workflowProperties.ts | 157 +++++++++++ src/workflowStep.ts | 26 +- src/workflowStepInput.ts | 28 +- src/workflowStepInputProperties.ts | 214 +++++++++++++++ src/workflowStepOutput.ts | 12 +- src/workflowStepOutputProperties.ts | 26 ++ src/workflowStepProperties.ts | 165 ++++++++++++ 159 files changed, 5859 insertions(+), 798 deletions(-) create mode 100644 src/arraySchemaProperties.ts create mode 100644 src/commandInputArraySchemaProperties.ts create mode 100644 src/commandInputEnumSchemaProperties.ts create mode 100644 src/commandInputParameterProperties.ts create mode 100644 src/commandInputRecordFieldProperties.ts create mode 100644 src/commandInputRecordSchemaProperties.ts rename src/{commandInputSchema.ts => commandInputSchemaProperties.ts} (65%) create mode 100644 src/commandLineBindableProperties.ts create mode 100644 src/commandLineBindingProperties.ts create mode 100644 src/commandLineToolProperties.ts create mode 100644 src/commandOutputArraySchemaProperties.ts create mode 100644 src/commandOutputBindingProperties.ts create mode 100644 src/commandOutputEnumSchemaProperties.ts create mode 100644 src/commandOutputParameterProperties.ts create mode 100644 src/commandOutputRecordFieldProperties.ts create mode 100644 src/commandOutputRecordSchemaProperties.ts create mode 100644 src/directoryProperties.ts create mode 100644 src/direntProperties.ts create mode 100644 src/dockerRequirementProperties.ts delete mode 100644 src/documented.ts create mode 100644 src/documentedProperties.ts create mode 100644 src/enumSchemaProperties.ts create mode 100644 src/envVarRequirementProperties.ts create mode 100644 src/environmentDefProperties.ts create mode 100644 src/expressionToolOutputParameterProperties.ts create mode 100644 src/expressionToolProperties.ts delete mode 100644 src/fieldBase.ts create mode 100644 src/fieldBaseProperties.ts create mode 100644 src/fileProperties.ts delete mode 100644 src/iOSchema.ts create mode 100644 src/iOSchemaProperties.ts delete mode 100644 src/identified.ts create mode 100644 src/identifiedProperties.ts create mode 100644 src/initialWorkDirRequirementProperties.ts create mode 100644 src/inlineJavascriptRequirementProperties.ts create mode 100644 src/inplaceUpdateRequirementProperties.ts create mode 100644 src/inputArraySchemaProperties.ts create mode 100644 src/inputBindingProperties.ts create mode 100644 src/inputEnumSchemaProperties.ts delete mode 100644 src/inputFormat.ts create mode 100644 src/inputFormatProperties.ts delete mode 100644 src/inputParameter.ts create mode 100644 src/inputParameterProperties.ts create mode 100644 src/inputRecordFieldProperties.ts create mode 100644 src/inputRecordSchemaProperties.ts delete mode 100644 src/inputSchema.ts create mode 100644 src/inputSchemaProperties.ts delete mode 100644 src/labeled.ts create mode 100644 src/labeledProperties.ts delete mode 100644 src/loadContents.ts create mode 100644 src/loadContentsProperties.ts create mode 100644 src/loadListingRequirementProperties.ts create mode 100644 src/multipleInputFeatureRequirementProperties.ts create mode 100644 src/networkAccessProperties.ts create mode 100644 src/operationInputParameterProperties.ts create mode 100644 src/operationOutputParameterProperties.ts create mode 100644 src/operationProperties.ts create mode 100644 src/outputArraySchemaProperties.ts create mode 100644 src/outputEnumSchemaProperties.ts delete mode 100644 src/outputFormat.ts create mode 100644 src/outputFormatProperties.ts delete mode 100644 src/outputParameter.ts create mode 100644 src/outputParameterProperties.ts create mode 100644 src/outputRecordFieldProperties.ts create mode 100644 src/outputRecordSchemaProperties.ts delete mode 100644 src/outputSchema.ts create mode 100644 src/outputSchemaProperties.ts delete mode 100644 src/parameter.ts create mode 100644 src/parameterProperties.ts delete mode 100644 src/process.ts create mode 100644 src/processProperties.ts rename src/{processRequirement.ts => processRequirementProperties.ts} (86%) create mode 100644 src/recordFieldProperties.ts create mode 100644 src/recordSchemaProperties.ts create mode 100644 src/resourceRequirementProperties.ts create mode 100644 src/scatterFeatureRequirementProperties.ts create mode 100644 src/schemaDefRequirementProperties.ts create mode 100644 src/secondaryFileSchemaProperties.ts create mode 100644 src/shellCommandRequirementProperties.ts delete mode 100644 src/sink.ts create mode 100644 src/sinkProperties.ts create mode 100644 src/softwarePackageProperties.ts create mode 100644 src/softwareRequirementProperties.ts create mode 100644 src/stepInputExpressionRequirementProperties.ts create mode 100644 src/subworkflowFeatureRequirementProperties.ts create mode 100644 src/toolTimeLimitProperties.ts create mode 100644 src/workReuseProperties.ts create mode 100644 src/workflowInputParameterProperties.ts create mode 100644 src/workflowOutputParameterProperties.ts create mode 100644 src/workflowProperties.ts create mode 100644 src/workflowStepInputProperties.ts create mode 100644 src/workflowStepOutputProperties.ts create mode 100644 src/workflowStepProperties.ts diff --git a/src/arraySchema.ts b/src/arraySchema.ts index 9840057..2d60dca 100644 --- a/src/arraySchema.ts +++ b/src/arraySchema.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/salad#ArraySchema */ -export class ArraySchema extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ArraySchema extends Saveable implements Internal.ArraySchemaProperties { + extensionFields?: Internal.Dictionary /** * Defines the type of the array elements. @@ -33,10 +32,9 @@ export class ArraySchema extends Saveable { type: string - constructor ({extensionFields, loadingOptions, items, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array, type: string,}) { - super() + constructor ({loadingOptions, extensionFields, items, type} : {loadingOptions?: LoadingOptions} & Internal.ArraySchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.items = items this.type = type } diff --git a/src/arraySchemaProperties.ts b/src/arraySchemaProperties.ts new file mode 100644 index 0000000..3fbd595 --- /dev/null +++ b/src/arraySchemaProperties.ts @@ -0,0 +1,21 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/salad#ArraySchema + */ +export interface ArraySchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * Defines the type of the array elements. + */ + items: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + + /** + * Must be `array` + */ + type: string +} \ No newline at end of file diff --git a/src/commandInputArraySchema.ts b/src/commandInputArraySchema.ts index 8e42cba..6dafe27 100644 --- a/src/commandInputArraySchema.ts +++ b/src/commandInputArraySchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputArraySchema */ -export class CommandInputArraySchema extends Saveable implements Internal.InputArraySchema, Internal.CommandInputSchema, Internal.CommandLineBindable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandInputArraySchema extends Saveable implements Internal.CommandInputArraySchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the type of the array elements. @@ -40,23 +39,22 @@ export class CommandInputArraySchema extends Saveable implements Internal.InputA /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Describes how to turn this object into command line arguments. */ - inputBinding: undefined | Internal.CommandLineBinding + inputBinding?: undefined | Internal.CommandLineBinding - constructor ({extensionFields, loadingOptions, name, items, type, label, doc, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { - super() + constructor ({loadingOptions, extensionFields, name, items, type, label, doc, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandInputArraySchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.items = items this.type = type diff --git a/src/commandInputArraySchemaProperties.ts b/src/commandInputArraySchemaProperties.ts new file mode 100644 index 0000000..0cb9082 --- /dev/null +++ b/src/commandInputArraySchemaProperties.ts @@ -0,0 +1,41 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputArraySchema + */ +export interface CommandInputArraySchemaProperties extends Internal.InputArraySchemaProperties, Internal.CommandInputSchemaProperties, Internal.CommandLineBindableProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding?: undefined | Internal.CommandLineBinding +} \ No newline at end of file diff --git a/src/commandInputEnumSchema.ts b/src/commandInputEnumSchema.ts index 48f9cb9..5d6ea9f 100644 --- a/src/commandInputEnumSchema.ts +++ b/src/commandInputEnumSchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputEnumSchema */ -export class CommandInputEnumSchema extends Saveable implements Internal.InputEnumSchema, Internal.CommandInputSchema, Internal.CommandLineBindable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandInputEnumSchema extends Saveable implements Internal.CommandInputEnumSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the set of valid symbols. @@ -40,23 +39,22 @@ export class CommandInputEnumSchema extends Saveable implements Internal.InputEn /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Describes how to turn this object into command line arguments. */ - inputBinding: undefined | Internal.CommandLineBinding + inputBinding?: undefined | Internal.CommandLineBinding - constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { - super() + constructor ({loadingOptions, extensionFields, name, symbols, type, label, doc, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandInputEnumSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.symbols = symbols this.type = type diff --git a/src/commandInputEnumSchemaProperties.ts b/src/commandInputEnumSchemaProperties.ts new file mode 100644 index 0000000..d2395cb --- /dev/null +++ b/src/commandInputEnumSchemaProperties.ts @@ -0,0 +1,41 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputEnumSchema + */ +export interface CommandInputEnumSchemaProperties extends Internal.InputEnumSchemaProperties, Internal.CommandInputSchemaProperties, Internal.CommandLineBindableProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding?: undefined | Internal.CommandLineBinding +} \ No newline at end of file diff --git a/src/commandInputParameter.ts b/src/commandInputParameter.ts index 11e241a..3206f0f 100644 --- a/src/commandInputParameter.ts +++ b/src/commandInputParameter.ts @@ -20,19 +20,18 @@ import * as Internal from './util/internal' * * An input parameter for a CommandLineTool. */ -export class CommandInputParameter extends Saveable implements Internal.InputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandInputParameter extends Saveable implements Internal.CommandInputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -78,7 +77,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -89,12 +88,12 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -105,7 +104,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * available, file formats may be tested by exact match. * */ - format: undefined | string | Array + format?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -118,7 +117,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -133,7 +132,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string /** * The default value to use for this parameter if the parameter is missing @@ -142,7 +141,7 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * (e.g. dependent `valueFrom` fields). * */ - default_: undefined | any + default_?: undefined | any /** * Specify valid types of data that may be assigned to this parameter. @@ -155,13 +154,12 @@ export class CommandInputParameter extends Saveable implements Internal.InputPar * command line arguments. * */ - inputBinding: undefined | Internal.CommandLineBinding + inputBinding?: undefined | Internal.CommandLineBinding - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, default_: undefined | any, type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array, inputBinding: undefined | Internal.CommandLineBinding,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandInputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/commandInputParameterProperties.ts b/src/commandInputParameterProperties.ts new file mode 100644 index 0000000..77a8dbb --- /dev/null +++ b/src/commandInputParameterProperties.ts @@ -0,0 +1,146 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputParameter + * + * An input parameter for a CommandLineTool. + */ +export interface CommandInputParameterProperties extends Internal.InputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_?: undefined | any + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + + /** + * Describes how to turns the input parameters of a process into + * command line arguments. + * + */ + inputBinding?: undefined | Internal.CommandLineBinding +} \ No newline at end of file diff --git a/src/commandInputRecordField.ts b/src/commandInputRecordField.ts index a013c13..16c4e9a 100644 --- a/src/commandInputRecordField.ts +++ b/src/commandInputRecordField.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputRecordField */ -export class CommandInputRecordField extends Saveable implements Internal.InputRecordField, Internal.CommandLineBindable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandInputRecordField extends Saveable implements Internal.CommandInputRecordFieldProperties { + extensionFields?: Internal.Dictionary /** * The name of the field @@ -31,7 +30,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * The field type @@ -42,7 +41,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -88,7 +87,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -99,7 +98,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * Only valid when `type: File` or is an array of `items: File`. @@ -110,7 +109,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR * available, file formats may be tested by exact match. * */ - format: undefined | string | Array + format?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -123,7 +122,7 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -138,18 +137,17 @@ export class CommandInputRecordField extends Saveable implements Internal.InputR * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string /** * Describes how to turn this object into command line arguments. */ - inputBinding: undefined | Internal.CommandLineBinding + inputBinding?: undefined | Internal.CommandLineBinding - constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { - super() + constructor ({loadingOptions, extensionFields, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandInputRecordFieldProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.doc = doc this.type = type diff --git a/src/commandInputRecordFieldProperties.ts b/src/commandInputRecordFieldProperties.ts new file mode 100644 index 0000000..761cd70 --- /dev/null +++ b/src/commandInputRecordFieldProperties.ts @@ -0,0 +1,134 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputRecordField + */ +export interface CommandInputRecordFieldProperties extends Internal.InputRecordFieldProperties, Internal.CommandLineBindableProperties { + + extensionFields?: Internal.Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding?: undefined | Internal.CommandLineBinding +} \ No newline at end of file diff --git a/src/commandInputRecordSchema.ts b/src/commandInputRecordSchema.ts index d3f91e3..2aaf349 100644 --- a/src/commandInputRecordSchema.ts +++ b/src/commandInputRecordSchema.ts @@ -18,19 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandInputRecordSchema */ -export class CommandInputRecordSchema extends Saveable implements Internal.InputRecordSchema, Internal.CommandInputSchema, Internal.CommandLineBindable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandInputRecordSchema extends Saveable implements Internal.CommandInputRecordSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the fields of the record. */ - fields: undefined | Array + fields?: undefined | Array /** * Must be `record` @@ -40,23 +39,22 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Input /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Describes how to turn this object into command line arguments. */ - inputBinding: undefined | Internal.CommandLineBinding + inputBinding?: undefined | Internal.CommandLineBinding - constructor ({extensionFields, loadingOptions, name, fields, type, label, doc, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string, inputBinding: undefined | Internal.CommandLineBinding,}) { - super() + constructor ({loadingOptions, extensionFields, name, fields, type, label, doc, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandInputRecordSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.fields = fields this.type = type diff --git a/src/commandInputRecordSchemaProperties.ts b/src/commandInputRecordSchemaProperties.ts new file mode 100644 index 0000000..00eaf7c --- /dev/null +++ b/src/commandInputRecordSchemaProperties.ts @@ -0,0 +1,41 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputRecordSchema + */ +export interface CommandInputRecordSchemaProperties extends Internal.InputRecordSchemaProperties, Internal.CommandInputSchemaProperties, Internal.CommandLineBindableProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the fields of the record. + */ + fields?: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding?: undefined | Internal.CommandLineBinding +} \ No newline at end of file diff --git a/src/commandInputSchema.ts b/src/commandInputSchemaProperties.ts similarity index 65% rename from src/commandInputSchema.ts rename to src/commandInputSchemaProperties.ts index dc9b874..9975240 100644 --- a/src/commandInputSchema.ts +++ b/src/commandInputSchemaProperties.ts @@ -5,5 +5,5 @@ import * as Internal from './util/internal' /** * Auto-generated interface for https://w3id.org/cwl/cwl#CommandInputSchema */ -export interface CommandInputSchema { } - \ No newline at end of file +export interface CommandInputSchemaProperties { + } \ No newline at end of file diff --git a/src/commandLineBindable.ts b/src/commandLineBindable.ts index 0b61ff1..2bba310 100644 --- a/src/commandLineBindable.ts +++ b/src/commandLineBindable.ts @@ -18,20 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandLineBindable */ -export class CommandLineBindable extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandLineBindable extends Saveable implements Internal.CommandLineBindableProperties { + extensionFields?: Internal.Dictionary /** * Describes how to turn this object into command line arguments. */ - inputBinding: undefined | Internal.CommandLineBinding + inputBinding?: undefined | Internal.CommandLineBinding - constructor ({extensionFields, loadingOptions, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, inputBinding: undefined | Internal.CommandLineBinding,}) { - super() + constructor ({loadingOptions, extensionFields, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandLineBindableProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.inputBinding = inputBinding } diff --git a/src/commandLineBindableProperties.ts b/src/commandLineBindableProperties.ts new file mode 100644 index 0000000..f52b4b1 --- /dev/null +++ b/src/commandLineBindableProperties.ts @@ -0,0 +1,16 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandLineBindable + */ +export interface CommandLineBindableProperties { + + extensionFields?: Internal.Dictionary + + /** + * Describes how to turn this object into command line arguments. + */ + inputBinding?: undefined | Internal.CommandLineBinding +} \ No newline at end of file diff --git a/src/commandLineBinding.ts b/src/commandLineBinding.ts index aae82f1..16b45ca 100644 --- a/src/commandLineBinding.ts +++ b/src/commandLineBinding.ts @@ -55,9 +55,8 @@ import * as Internal from './util/internal' * - **null**: Add nothing. * */ -export class CommandLineBinding extends Saveable implements Internal.InputBinding { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandLineBinding extends Saveable implements Internal.CommandLineBindingProperties { + extensionFields?: Internal.Dictionary /** * Use of `loadContents` in `InputBinding` is deprecated. @@ -65,7 +64,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin * CWL v2.0. Use `InputParameter.loadContents` instead. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * The sorting key. Default position is 0. If a [CWL Parameter Reference](#Parameter_references) @@ -77,12 +76,12 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin * single value of type int or a null. * */ - position: undefined | number | string + position?: undefined | number | string /** * Command line prefix to add before the value. */ - prefix: undefined | string + prefix?: undefined | string /** * If true (default), then the prefix and value must be added as separate @@ -90,14 +89,14 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin * into a single command line argument. * */ - separate: undefined | boolean + separate?: undefined | boolean /** * Join the array elements into a single string with the elements * separated by by `itemSeparator`. * */ - itemSeparator: undefined | string + itemSeparator?: undefined | string /** * If `valueFrom` is a constant string value, use this as the value and @@ -118,7 +117,7 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin * the `valueFrom` field is required. * */ - valueFrom: undefined | string + valueFrom?: undefined | string /** * If `ShellCommandRequirement` is in the requirements for the current command, @@ -129,13 +128,12 @@ export class CommandLineBinding extends Saveable implements Internal.InputBindin * permit interpretation of any shell metacharacters or directives. * */ - shellQuote: undefined | boolean + shellQuote?: undefined | boolean - constructor ({extensionFields, loadingOptions, loadContents, position, prefix, separate, itemSeparator, valueFrom, shellQuote} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, loadContents: undefined | boolean, position: undefined | number | string, prefix: undefined | string, separate: undefined | boolean, itemSeparator: undefined | string, valueFrom: undefined | string, shellQuote: undefined | boolean,}) { - super() + constructor ({loadingOptions, extensionFields, loadContents, position, prefix, separate, itemSeparator, valueFrom, shellQuote} : {loadingOptions?: LoadingOptions} & Internal.CommandLineBindingProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.loadContents = loadContents this.position = position this.prefix = prefix diff --git a/src/commandLineBindingProperties.ts b/src/commandLineBindingProperties.ts new file mode 100644 index 0000000..7db66b9 --- /dev/null +++ b/src/commandLineBindingProperties.ts @@ -0,0 +1,120 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandLineBinding + * + * + * When listed under `inputBinding` in the input schema, the term + * "value" refers to the the corresponding value in the input object. For + * binding objects listed in `CommandLineTool.arguments`, the term "value" + * refers to the effective value after evaluating `valueFrom`. + * + * The binding behavior when building the command line depends on the data + * type of the value. If there is a mismatch between the type described by + * the input schema and the effective value, such as resulting from an + * expression evaluation, an implementation must use the data type of the + * effective value. + * + * - **string**: Add `prefix` and the string to the command line. + * + * - **number**: Add `prefix` and decimal representation to command line. + * + * - **boolean**: If true, add `prefix` to the command line. If false, add + * nothing. + * + * - **File**: Add `prefix` and the value of + * [`File.path`](#File) to the command line. + * + * - **Directory**: Add `prefix` and the value of + * [`Directory.path`](#Directory) to the command line. + * + * - **array**: If `itemSeparator` is specified, add `prefix` and the join + * the array into a single string with `itemSeparator` separating the + * items. Otherwise first add `prefix`, then recursively process + * individual elements. + * If the array is empty, it does not add anything to command line. + * + * - **object**: Add `prefix` only, and recursively add object fields for + * which `inputBinding` is specified. + * + * - **null**: Add nothing. + * + */ +export interface CommandLineBindingProperties extends Internal.InputBindingProperties { + + extensionFields?: Internal.Dictionary + + /** + * Use of `loadContents` in `InputBinding` is deprecated. + * Preserved for v1.0 backwards compatability. Will be removed in + * CWL v2.0. Use `InputParameter.loadContents` instead. + * + */ + loadContents?: undefined | boolean + + /** + * The sorting key. Default position is 0. If a [CWL Parameter Reference](#Parameter_references) + * or [CWL Expression](#Expressions_(Optional)) is used and if the + * inputBinding is associated with an input parameter, then the value of + * `self` will be the value of the input parameter. Input parameter + * defaults (as specified by the `InputParameter.default` field) must be + * applied before evaluating the expression. Expressions must return a + * single value of type int or a null. + * + */ + position?: undefined | number | string + + /** + * Command line prefix to add before the value. + */ + prefix?: undefined | string + + /** + * If true (default), then the prefix and value must be added as separate + * command line arguments; if false, prefix and value must be concatenated + * into a single command line argument. + * + */ + separate?: undefined | boolean + + /** + * Join the array elements into a single string with the elements + * separated by by `itemSeparator`. + * + */ + itemSeparator?: undefined | string + + /** + * If `valueFrom` is a constant string value, use this as the value and + * apply the binding rules above. + * + * If `valueFrom` is an expression, evaluate the expression to yield the + * actual value to use to build the command line and apply the binding + * rules above. If the inputBinding is associated with an input + * parameter, the value of `self` in the expression will be the value of + * the input parameter. Input parameter defaults (as specified by the + * `InputParameter.default` field) must be applied before evaluating the + * expression. + * + * If the value of the associated input parameter is `null`, `valueFrom` is + * not evaluated and nothing is added to the command line. + * + * When a binding is part of the `CommandLineTool.arguments` field, + * the `valueFrom` field is required. + * + */ + valueFrom?: undefined | string + + /** + * If `ShellCommandRequirement` is in the requirements for the current command, + * this controls whether the value is quoted on the command line (default is true). + * Use `shellQuote: false` to inject metacharacters for operations such as pipes. + * + * If `shellQuote` is true or not provided, the implementation must not + * permit interpretation of any shell metacharacters or directives. + * + */ + shellQuote?: undefined | boolean +} \ No newline at end of file diff --git a/src/commandLineTool.ts b/src/commandLineTool.ts index bd45d62..9a2a5f4 100644 --- a/src/commandLineTool.ts +++ b/src/commandLineTool.ts @@ -21,25 +21,24 @@ import * as Internal from './util/internal' * This defines the schema of the CWL Command Line Tool Description document. * */ -export class CommandLineTool extends Saveable implements Internal.Process { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandLineTool extends Saveable implements Internal.CommandLineToolProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string class_: string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Defines the input parameters of the process. The process is ready to @@ -73,7 +72,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { * unless overridden at user option. * */ - requirements: undefined | Array + requirements?: undefined | Array /** * Declares hints applying to either the runtime environment or the @@ -82,14 +81,14 @@ export class CommandLineTool extends Saveable implements Internal.Process { * the implementation may report a warning. * */ - hints: undefined | Array + hints?: undefined | Array /** * CWL document version. Always required at the document root. Not * required for a Process embedded inside another Process. * */ - cwlVersion: undefined | string + cwlVersion?: undefined | string /** * An identifier for the type of computational operation, of this Process. @@ -107,7 +106,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { * [Split read mapping](http://edamontology.org/operation_3199). * */ - intent: undefined | Array + intent?: undefined | Array /** * Specifies the program to execute. If an array, the first element of @@ -127,7 +126,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { * executable. * */ - baseCommand: undefined | string | Array + baseCommand?: undefined | string | Array /** * Command line bindings which are not directly associated with input @@ -136,14 +135,14 @@ export class CommandLineTool extends Saveable implements Internal.Process { * as an argument. * */ - arguments_: undefined | Array + arguments_?: undefined | Array /** * A path to a file whose contents must be piped into the command's * standard input stream. * */ - stdin: undefined | string + stdin?: undefined | string /** * Capture the command's standard error stream to a file written to @@ -157,7 +156,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { * characters (such as the path separator `/`) it is an error. * */ - stderr: undefined | string + stderr?: undefined | string /** * Capture the command's standard output stream to a file written to @@ -171,7 +170,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { * characters (such as the path separator `/`) it is an error. * */ - stdout: undefined | string + stdout?: undefined | string /** * Exit codes that indicate the process completed successfully. @@ -179,7 +178,7 @@ export class CommandLineTool extends Saveable implements Internal.Process { * If not specified, only exit code 0 is considered success. * */ - successCodes: undefined | Array + successCodes?: undefined | Array /** * Exit codes that indicate the process failed due to a possibly @@ -189,19 +188,18 @@ export class CommandLineTool extends Saveable implements Internal.Process { * If not specified, no exit codes are considered temporary failure. * */ - temporaryFailCodes: undefined | Array + temporaryFailCodes?: undefined | Array /** * Exit codes that indicate the process failed due to a permanent logic error, where executing the process with the same runtime environment and same inputs is expected to always fail. * If not specified, all exit codes except 0 are considered permanent failure. */ - permanentFailCodes: undefined | Array + permanentFailCodes?: undefined | Array - constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, baseCommand, arguments_, stdin, stderr, stdout, successCodes, temporaryFailCodes, permanentFailCodes} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string, baseCommand: undefined | string | Array, arguments_: undefined | Array, stdin: undefined | string, stderr: undefined | string, stdout: undefined | string, successCodes: undefined | Array, temporaryFailCodes: undefined | Array, permanentFailCodes: undefined | Array,}) { - super() + constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, baseCommand, arguments_, stdin, stderr, stdout, successCodes, temporaryFailCodes, permanentFailCodes} : {loadingOptions?: LoadingOptions} & Internal.CommandLineToolProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.class_ = class_ this.label = label diff --git a/src/commandLineToolProperties.ts b/src/commandLineToolProperties.ts new file mode 100644 index 0000000..99055da --- /dev/null +++ b/src/commandLineToolProperties.ts @@ -0,0 +1,186 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandLineTool + * + * This defines the schema of the CWL Command Line Tool Description document. + * + */ +export interface CommandLineToolProperties extends Internal.ProcessProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements?: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints?: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion?: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent?: undefined | Array + + /** + * Specifies the program to execute. If an array, the first element of + * the array is the command to execute, and subsequent elements are + * mandatory command line arguments. The elements in `baseCommand` must + * appear before any command line bindings from `inputBinding` or + * `arguments`. + * + * If `baseCommand` is not provided or is an empty array, the first + * element of the command line produced after processing `inputBinding` or + * `arguments` must be used as the program to execute. + * + * If the program includes a path separator character it must + * be an absolute path, otherwise it is an error. If the program does not + * include a path separator, search the `$PATH` variable in the runtime + * environment of the workflow runner find the absolute path of the + * executable. + * + */ + baseCommand?: undefined | string | Array + + /** + * Command line bindings which are not directly associated with input + * parameters. If the value is a string, it is used as a string literal + * argument. If it is an Expression, the result of the evaluation is used + * as an argument. + * + */ + arguments_?: undefined | Array + + /** + * A path to a file whose contents must be piped into the command's + * standard input stream. + * + */ + stdin?: undefined | string + + /** + * Capture the command's standard error stream to a file written to + * the designated output directory. + * + * If `stderr` is a string, it specifies the file name to use. + * + * If `stderr` is an expression, the expression is evaluated and must + * return a string with the file name to use to capture stderr. If the + * return value is not a string, or the resulting path contains illegal + * characters (such as the path separator `/`) it is an error. + * + */ + stderr?: undefined | string + + /** + * Capture the command's standard output stream to a file written to + * the designated output directory. + * + * If `stdout` is a string, it specifies the file name to use. + * + * If `stdout` is an expression, the expression is evaluated and must + * return a string with the file name to use to capture stdout. If the + * return value is not a string, or the resulting path contains illegal + * characters (such as the path separator `/`) it is an error. + * + */ + stdout?: undefined | string + + /** + * Exit codes that indicate the process completed successfully. + * + * If not specified, only exit code 0 is considered success. + * + */ + successCodes?: undefined | Array + + /** + * Exit codes that indicate the process failed due to a possibly + * temporary condition, where executing the process with the same + * runtime environment and inputs may produce different results. + * + * If not specified, no exit codes are considered temporary failure. + * + */ + temporaryFailCodes?: undefined | Array + + /** + * Exit codes that indicate the process failed due to a permanent logic error, where executing the process with the same runtime environment and same inputs is expected to always fail. + * If not specified, all exit codes except 0 are considered permanent failure. + */ + permanentFailCodes?: undefined | Array +} \ No newline at end of file diff --git a/src/commandOutputArraySchema.ts b/src/commandOutputArraySchema.ts index 806743d..9f3fab9 100644 --- a/src/commandOutputArraySchema.ts +++ b/src/commandOutputArraySchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputArraySchema */ -export class CommandOutputArraySchema extends Saveable implements Internal.OutputArraySchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandOutputArraySchema extends Saveable implements Internal.CommandOutputArraySchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the type of the array elements. @@ -40,18 +39,17 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Outpu /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, items, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, items, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.CommandOutputArraySchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.items = items this.type = type diff --git a/src/commandOutputArraySchemaProperties.ts b/src/commandOutputArraySchemaProperties.ts new file mode 100644 index 0000000..412b357 --- /dev/null +++ b/src/commandOutputArraySchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandOutputArraySchema + */ +export interface CommandOutputArraySchemaProperties extends Internal.OutputArraySchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/commandOutputBinding.ts b/src/commandOutputBinding.ts index bf299fe..f017f49 100644 --- a/src/commandOutputBinding.ts +++ b/src/commandOutputBinding.ts @@ -30,9 +30,8 @@ import * as Internal from './util/internal' * - secondaryFiles * */ -export class CommandOutputBinding extends Saveable implements Internal.LoadContents { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandOutputBinding extends Saveable implements Internal.CommandOutputBindingProperties { + extensionFields?: Internal.Dictionary /** * Only valid when `type: File` or is an array of `items: File`. @@ -45,7 +44,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -60,7 +59,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string /** * Find files or directories relative to the output directory, using POSIX @@ -100,7 +99,7 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte * container filesystem except for declared input and output. * */ - glob: undefined | string | Array + glob?: undefined | string | Array /** * Evaluate an expression to generate the output value. If @@ -124,13 +123,12 @@ export class CommandOutputBinding extends Saveable implements Internal.LoadConte * `loadContents` limit. * */ - outputEval: undefined | string + outputEval?: undefined | string - constructor ({extensionFields, loadingOptions, loadContents, loadListing, glob, outputEval} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, loadContents: undefined | boolean, loadListing: undefined | string, glob: undefined | string | Array, outputEval: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, loadContents, loadListing, glob, outputEval} : {loadingOptions?: LoadingOptions} & Internal.CommandOutputBindingProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.loadContents = loadContents this.loadListing = loadListing this.glob = glob diff --git a/src/commandOutputBindingProperties.ts b/src/commandOutputBindingProperties.ts new file mode 100644 index 0000000..940ca46 --- /dev/null +++ b/src/commandOutputBindingProperties.ts @@ -0,0 +1,115 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandOutputBinding + * + * Describes how to generate an output parameter based on the files produced + * by a CommandLineTool. + * + * The output parameter value is generated by applying these operations in the + * following order: + * + * - glob + * - loadContents + * - outputEval + * - secondaryFiles + * + */ +export interface CommandOutputBindingProperties extends Internal.LoadContentsProperties { + + extensionFields?: Internal.Dictionary + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * Find files or directories relative to the output directory, using POSIX + * glob(3) pathname matching. If an array is provided, find files or + * directories that match any pattern in the array. If an expression is + * provided, the expression must return a string or an array of strings, + * which will then be evaluated as one or more glob patterns. Must only + * match and return files/directories which actually exist. + * + * If the value of glob is a relative path pattern (does not + * begin with a slash '/') then it is resolved relative to the + * output directory. If the value of the glob is an absolute + * path pattern (it does begin with a slash '/') then it must + * refer to a path within the output directory. It is an error + * if any glob resolves to a path outside the output directory. + * Specifically this means globs that resolve to paths outside the output + * directory are illegal. + * + * A glob may match a path within the output directory which is + * actually a symlink to another file. In this case, the + * expected behavior is for the resulting File/Directory object to take the + * `basename` (and corresponding `nameroot` and `nameext`) of the + * symlink. The `location` of the File/Directory is implementation + * dependent, but logically the File/Directory should have the same content + * as the symlink target. Platforms may stage output files/directories to + * cloud storage that lack the concept of a symlink. In + * this case file content and directories may be duplicated, or (to avoid + * duplication) the File/Directory `location` may refer to the symlink + * target. + * + * It is an error if a symlink in the output directory (or any + * symlink in a chain of links) refers to any file or directory + * that is not under an input or output directory. + * + * Implementations may shut down a container before globbing + * output, so globs and expressions must not assume access to the + * container filesystem except for declared input and output. + * + */ + glob?: undefined | string | Array + + /** + * Evaluate an expression to generate the output value. If + * `glob` was specified, the value of `self` must be an array + * containing file objects that were matched. If no files were + * matched, `self` must be a zero length array; if a single file + * was matched, the value of `self` is an array of a single + * element. The exit code of the process is + * available in the expression as `runtime.exitCode`. + * + * Additionally if `loadContents` is true, the file must be a + * UTF-8 text file 64 KiB or smaller, and the implementation must + * read the entire contents of the file (or file array) and place + * it in the `contents` field of the File object for use in + * `outputEval`. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + * If a tool needs to return a large amount of structured data to + * the workflow, loading the output object from `cwl.output.json` + * bypasses `outputEval` and is not subject to the 64 KiB + * `loadContents` limit. + * + */ + outputEval?: undefined | string +} \ No newline at end of file diff --git a/src/commandOutputEnumSchema.ts b/src/commandOutputEnumSchema.ts index 8682e65..6884b45 100644 --- a/src/commandOutputEnumSchema.ts +++ b/src/commandOutputEnumSchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputEnumSchema */ -export class CommandOutputEnumSchema extends Saveable implements Internal.OutputEnumSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandOutputEnumSchema extends Saveable implements Internal.CommandOutputEnumSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the set of valid symbols. @@ -40,18 +39,17 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Output /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, symbols, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.CommandOutputEnumSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.symbols = symbols this.type = type diff --git a/src/commandOutputEnumSchemaProperties.ts b/src/commandOutputEnumSchemaProperties.ts new file mode 100644 index 0000000..1e082ce --- /dev/null +++ b/src/commandOutputEnumSchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandOutputEnumSchema + */ +export interface CommandOutputEnumSchemaProperties extends Internal.OutputEnumSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/commandOutputParameter.ts b/src/commandOutputParameter.ts index 81335d5..53cb9a1 100644 --- a/src/commandOutputParameter.ts +++ b/src/commandOutputParameter.ts @@ -20,19 +20,18 @@ import * as Internal from './util/internal' * * An output parameter for a CommandLineTool. */ -export class CommandOutputParameter extends Saveable implements Internal.OutputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandOutputParameter extends Saveable implements Internal.CommandOutputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -78,7 +77,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -89,12 +88,12 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -103,7 +102,7 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP * File object. * */ - format: undefined | string + format?: undefined | string /** * Specify valid types of data that may be assigned to this parameter. @@ -114,13 +113,12 @@ export class CommandOutputParameter extends Saveable implements Internal.OutputP /** * Describes how to generate this output object based on the files produced by a CommandLineTool */ - outputBinding: undefined | Internal.CommandOutputBinding + outputBinding?: undefined | Internal.CommandOutputBinding - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, type, outputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array, outputBinding: undefined | Internal.CommandOutputBinding,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, type, outputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandOutputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/commandOutputParameterProperties.ts b/src/commandOutputParameterProperties.ts new file mode 100644 index 0000000..349a18a --- /dev/null +++ b/src/commandOutputParameterProperties.ts @@ -0,0 +1,105 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandOutputParameter + * + * An output parameter for a CommandLineTool. + */ +export interface CommandOutputParameterProperties extends Internal.OutputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + + /** + * Describes how to generate this output object based on the files produced by a CommandLineTool + */ + outputBinding?: undefined | Internal.CommandOutputBinding +} \ No newline at end of file diff --git a/src/commandOutputRecordField.ts b/src/commandOutputRecordField.ts index f66649e..0665761 100644 --- a/src/commandOutputRecordField.ts +++ b/src/commandOutputRecordField.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputRecordField */ -export class CommandOutputRecordField extends Saveable implements Internal.OutputRecordField { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandOutputRecordField extends Saveable implements Internal.CommandOutputRecordFieldProperties { + extensionFields?: Internal.Dictionary /** * The name of the field @@ -31,7 +30,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * The field type @@ -42,7 +41,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -88,7 +87,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -99,7 +98,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * Only valid when `type: File` or is an array of `items: File`. @@ -108,20 +107,19 @@ export class CommandOutputRecordField extends Saveable implements Internal.Outpu * File object. * */ - format: undefined | string + format?: undefined | string /** * Describes how to generate this output object based on the files * produced by a CommandLineTool * */ - outputBinding: undefined | Internal.CommandOutputBinding + outputBinding?: undefined | Internal.CommandOutputBinding - constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format, outputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string, outputBinding: undefined | Internal.CommandOutputBinding,}) { - super() + constructor ({loadingOptions, extensionFields, name, doc, type, label, secondaryFiles, streamable, format, outputBinding} : {loadingOptions?: LoadingOptions} & Internal.CommandOutputRecordFieldProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.doc = doc this.type = type diff --git a/src/commandOutputRecordFieldProperties.ts b/src/commandOutputRecordFieldProperties.ts new file mode 100644 index 0000000..c3e5423 --- /dev/null +++ b/src/commandOutputRecordFieldProperties.ts @@ -0,0 +1,106 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandOutputRecordField + */ +export interface CommandOutputRecordFieldProperties extends Internal.OutputRecordFieldProperties { + + extensionFields?: Internal.Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string + + /** + * Describes how to generate this output object based on the files + * produced by a CommandLineTool + * + */ + outputBinding?: undefined | Internal.CommandOutputBinding +} \ No newline at end of file diff --git a/src/commandOutputRecordSchema.ts b/src/commandOutputRecordSchema.ts index ea39fbb..a55f092 100644 --- a/src/commandOutputRecordSchema.ts +++ b/src/commandOutputRecordSchema.ts @@ -18,19 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#CommandOutputRecordSchema */ -export class CommandOutputRecordSchema extends Saveable implements Internal.OutputRecordSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class CommandOutputRecordSchema extends Saveable implements Internal.CommandOutputRecordSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the fields of the record. */ - fields: undefined | Array + fields?: undefined | Array /** * Must be `record` @@ -40,18 +39,17 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Outp /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, fields, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, fields, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.CommandOutputRecordSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.fields = fields this.type = type diff --git a/src/commandOutputRecordSchemaProperties.ts b/src/commandOutputRecordSchemaProperties.ts new file mode 100644 index 0000000..33c821a --- /dev/null +++ b/src/commandOutputRecordSchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#CommandOutputRecordSchema + */ +export interface CommandOutputRecordSchemaProperties extends Internal.OutputRecordSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the fields of the record. + */ + fields?: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/directory.ts b/src/directory.ts index 8b275b0..ed97f2e 100644 --- a/src/directory.ts +++ b/src/directory.ts @@ -63,9 +63,8 @@ import * as Internal from './util/internal' * or in any entry in `secondaryFiles` in the listing) is a fatal error. * */ -export class Directory extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class Directory extends Saveable implements Internal.DirectoryProperties { + extensionFields?: Internal.Dictionary /** * Must be `Directory` to indicate this object describes a Directory. @@ -91,7 +90,7 @@ export class Directory extends Saveable { * then follow the rules above. * */ - location: undefined | string + location?: undefined | string /** * The local path where the Directory is made available prior to executing a @@ -109,7 +108,7 @@ export class Directory extends Saveable { * `permanentFailure`. * */ - path: undefined | string + path?: undefined | string /** * The base name of the directory, that is, the name of the file without any @@ -125,7 +124,7 @@ export class Directory extends Saveable { * `basename`. * */ - basename: undefined | string + basename?: undefined | string /** * List of files or subdirectories contained in this directory. The name @@ -137,13 +136,12 @@ export class Directory extends Saveable { * merged. * */ - listing: undefined | Array + listing?: undefined | Array - constructor ({extensionFields, loadingOptions, class_, location, path, basename, listing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, location: undefined | string, path: undefined | string, basename: undefined | string, listing: undefined | Array,}) { - super() + constructor ({loadingOptions, extensionFields, class_, location, path, basename, listing} : {loadingOptions?: LoadingOptions} & Internal.DirectoryProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.location = location this.path = path diff --git a/src/directoryProperties.ts b/src/directoryProperties.ts new file mode 100644 index 0000000..21e7132 --- /dev/null +++ b/src/directoryProperties.ts @@ -0,0 +1,128 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Directory + * + * Represents a directory to present to a command line tool. + * + * Directories are represented as objects with `class` of `Directory`. Directory objects have + * a number of properties that provide metadata about the directory. + * + * The `location` property of a Directory is a URI that uniquely identifies + * the directory. Implementations must support the file:// URI scheme and may + * support other schemes such as http://. Alternately to `location`, + * implementations must also accept the `path` property on Directory, which + * must be a filesystem path available on the same host as the CWL runner (for + * inputs) or the runtime environment of a command line tool execution (for + * command line tool outputs). + * + * A Directory object may have a `listing` field. This is a list of File and + * Directory objects that are contained in the Directory. For each entry in + * `listing`, the `basename` property defines the name of the File or + * Subdirectory when staged to disk. If `listing` is not provided, the + * implementation must have some way of fetching the Directory listing at + * runtime based on the `location` field. + * + * If a Directory does not have `location`, it is a Directory literal. A + * Directory literal must provide `listing`. Directory literals must be + * created on disk at runtime as needed. + * + * The resources in a Directory literal do not need to have any implied + * relationship in their `location`. For example, a Directory listing may + * contain two files located on different hosts. It is the responsibility of + * the runtime to ensure that those files are staged to disk appropriately. + * Secondary files associated with files in `listing` must also be staged to + * the same Directory. + * + * When executing a CommandLineTool, Directories must be recursively staged + * first and have local values of `path` assigend. + * + * Directory objects in CommandLineTool output must provide either a + * `location` URI or a `path` property in the context of the tool execution + * runtime (local to the compute node, or within the executing container). + * + * An ExpressionTool may forward file references from input to output by using + * the same value for `location`. + * + * Name conflicts (the same `basename` appearing multiple times in `listing` + * or in any entry in `secondaryFiles` in the listing) is a fatal error. + * + */ +export interface DirectoryProperties { + + extensionFields?: Internal.Dictionary + + /** + * Must be `Directory` to indicate this object describes a Directory. + */ + class_: string + + /** + * An IRI that identifies the directory resource. This may be a relative + * reference, in which case it must be resolved using the base IRI of the + * document. The location may refer to a local or remote resource. If + * the `listing` field is not set, the implementation must use the + * location IRI to retrieve directory listing. If an implementation is + * unable to retrieve the directory listing stored at a remote resource (due to + * unsupported protocol, access denied, or other issue) it must signal an + * error. + * + * If the `location` field is not provided, the `listing` field must be + * provided. The implementation must assign a unique identifier for + * the `location` field. + * + * If the `path` field is provided but the `location` field is not, an + * implementation may assign the value of the `path` field to `location`, + * then follow the rules above. + * + */ + location?: undefined | string + + /** + * The local path where the Directory is made available prior to executing a + * CommandLineTool. This must be set by the implementation. This field + * must not be used in any other context. The command line tool being + * executed must be able to to access the directory at `path` using the POSIX + * `opendir(2)` syscall. + * + * If the `path` contains [POSIX shell metacharacters](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) + * (`|`,`&`, `;`, `<`, `>`, `(`,`)`, `$`,`` ` ``, `\`, `"`, `'`, + * ``, ``, and ``) or characters + * [not allowed](http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml) + * for [Internationalized Domain Names for Applications](https://tools.ietf.org/html/rfc6452) + * then implementations may terminate the process with a + * `permanentFailure`. + * + */ + path?: undefined | string + + /** + * The base name of the directory, that is, the name of the file without any + * leading directory path. The base name must not contain a slash `/`. + * + * If not provided, the implementation must set this field based on the + * `location` field by taking the final path component after parsing + * `location` as an IRI. If `basename` is provided, it is not required to + * match the value from `location`. + * + * When this file is made available to a CommandLineTool, it must be named + * with `basename`, i.e. the final component of the `path` field must match + * `basename`. + * + */ + basename?: undefined | string + + /** + * List of files or subdirectories contained in this directory. The name + * of each file or subdirectory is determined by the `basename` field of + * each `File` or `Directory` object. It is an error if a `File` shares a + * `basename` with any other entry in `listing`. If two or more + * `Directory` object share the same `basename`, this must be treated as + * equivalent to a single subdirectory with the listings recursively + * merged. + * + */ + listing?: undefined | Array +} \ No newline at end of file diff --git a/src/dirent.ts b/src/dirent.ts index 3542464..cf18c58 100644 --- a/src/dirent.ts +++ b/src/dirent.ts @@ -28,9 +28,8 @@ import * as Internal from './util/internal' * arbitrary locations, see discussion for `entryname`. * */ -export class Dirent extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class Dirent extends Saveable implements Internal.DirentProperties { + extensionFields?: Internal.Dictionary /** * The "target" name of the file or subdirectory. If `entry` is @@ -59,7 +58,7 @@ export class Dirent extends Saveable { * where the file or directory must be placed. * */ - entryname: undefined | string + entryname?: undefined | string /** * If the value is a string literal or an expression which evaluates to a @@ -110,13 +109,12 @@ export class Dirent extends Saveable { * not explicitly marked as writable. * */ - writable: undefined | boolean + writable?: undefined | boolean - constructor ({extensionFields, loadingOptions, entryname, entry, writable} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, entryname: undefined | string, entry: string, writable: undefined | boolean,}) { - super() + constructor ({loadingOptions, extensionFields, entryname, entry, writable} : {loadingOptions?: LoadingOptions} & Internal.DirentProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.entryname = entryname this.entry = entry this.writable = writable diff --git a/src/direntProperties.ts b/src/direntProperties.ts new file mode 100644 index 0000000..fb9101c --- /dev/null +++ b/src/direntProperties.ts @@ -0,0 +1,101 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Dirent + * + * Define a file or subdirectory that must be staged to a particular + * place prior to executing the command line tool. May be the result + * of executing an expression, such as building a configuration file + * from a template. + * + * Usually files are staged within the [designated output directory](#Runtime_environment). + * However, under certain circumstances, files may be staged at + * arbitrary locations, see discussion for `entryname`. + * + */ +export interface DirentProperties { + + extensionFields?: Internal.Dictionary + + /** + * The "target" name of the file or subdirectory. If `entry` is + * a File or Directory, the `entryname` field overrides the value + * of `basename` of the File or Directory object. + * + * * Required when `entry` evaluates to file contents only + * * Optional when `entry` evaluates to a File or Directory object with a `basename` + * * Invalid when `entry` evaluates to an array of File or Directory objects. + * + * If `entryname` is a relative path, it specifies a name within + * the designated output directory. A relative path starting + * with `../` or that resolves to location above the designated output directory is an error. + * + * If `entryname` is an absolute path (starts with a slash `/`) + * it is an error unless the following conditions are met: + * + * * `DockerRequirement` is present in `requirements` + * * The program is will run inside a software container + * where, from the perspective of the program, the root + * filesystem is not shared with any other user or + * running program. + * + * In this case, and the above conditions are met, then + * `entryname` may specify the absolute path within the container + * where the file or directory must be placed. + * + */ + entryname?: undefined | string + + /** + * If the value is a string literal or an expression which evaluates to a + * string, a new text file must be created with the string as the file contents. + * + * If the value is an expression that evaluates to a `File` or + * `Directory` object, or an array of `File` or `Directory` + * objects, this indicates the referenced file or directory + * should be added to the designated output directory prior to + * executing the tool. + * + * If the value is an expression that evaluates to `null`, + * nothing is added to the designated output directory, the entry + * has no effect. + * + * If the value is an expression that evaluates to some other + * array, number, or object not consisting of `File` or + * `Directory` objects, a new file must be created with the value + * serialized to JSON text as the file contents. The JSON + * serialization behavior should match the behavior of string + * interpolation of [Parameter + * references](#Parameter_references). + * + */ + entry: string + + /** + * If true, the File or Directory (or array of Files or + * Directories) declared in `entry` must be writable by the tool. + * + * Changes to the file or directory must be isolated and not + * visible by any other CommandLineTool process. This may be + * implemented by making a copy of the original file or + * directory. + * + * Disruptive changes to the referenced file or directory must not + * be allowed unless `InplaceUpdateRequirement.inplaceUpdate` is true. + * + * Default false (files and directories read-only by default). + * + * A directory marked as `writable: true` implies that all files and + * subdirectories are recursively writable as well. + * + * If `writable` is false, the file may be made available using a + * bind mount or file system link to avoid unnecessary copying of + * the input file. Command line tools may receive an error on + * attempting to rename or delete files or directories that are + * not explicitly marked as writable. + * + */ + writable?: undefined | boolean +} \ No newline at end of file diff --git a/src/dockerRequirement.ts b/src/dockerRequirement.ts index 35c18fe..5977b93 100644 --- a/src/dockerRequirement.ts +++ b/src/dockerRequirement.ts @@ -71,9 +71,8 @@ import * as Internal from './util/internal' * environment as defined by Docker. * */ -export class DockerRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class DockerRequirement extends Saveable implements Internal.DockerRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'DockerRequirement' @@ -86,22 +85,22 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi * `dockerPull: ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2` * */ - dockerPull: undefined | string + dockerPull?: undefined | string /** * Specify a HTTP URL from which to download a Docker image using `docker load`. */ - dockerLoad: undefined | string + dockerLoad?: undefined | string /** * Supply the contents of a Dockerfile which will be built using `docker build`. */ - dockerFile: undefined | string + dockerFile?: undefined | string /** * Provide HTTP URL to download and gunzip a Docker images using `docker import. */ - dockerImport: undefined | string + dockerImport?: undefined | string /** * The image id that will be used for `docker run`. May be a @@ -110,20 +109,19 @@ export class DockerRequirement extends Saveable implements Internal.ProcessRequi * must be used. * */ - dockerImageId: undefined | string + dockerImageId?: undefined | string /** * Set the designated output directory to a specific location inside the * Docker container. * */ - dockerOutputDirectory: undefined | string + dockerOutputDirectory?: undefined | string - constructor ({extensionFields, loadingOptions, class_, dockerPull, dockerLoad, dockerFile, dockerImport, dockerImageId, dockerOutputDirectory} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, dockerPull: undefined | string, dockerLoad: undefined | string, dockerFile: undefined | string, dockerImport: undefined | string, dockerImageId: undefined | string, dockerOutputDirectory: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, dockerPull, dockerLoad, dockerFile, dockerImport, dockerImageId, dockerOutputDirectory} : {loadingOptions?: LoadingOptions} & Internal.DockerRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.dockerPull = dockerPull this.dockerLoad = dockerLoad diff --git a/src/dockerRequirementProperties.ts b/src/dockerRequirementProperties.ts new file mode 100644 index 0000000..393451c --- /dev/null +++ b/src/dockerRequirementProperties.ts @@ -0,0 +1,108 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#DockerRequirement + * + * Indicates that a workflow component should be run in a + * [Docker](http://docker.com) or Docker-compatible (such as + * [Singularity](https://www.sylabs.io/) and [udocker](https://github.com/indigo-dc/udocker)) container environment and + * specifies how to fetch or build the image. + * + * If a CommandLineTool lists `DockerRequirement` under + * `hints` (or `requirements`), it may (or must) be run in the specified Docker + * container. + * + * The platform must first acquire or install the correct Docker image as + * specified by `dockerPull`, `dockerImport`, `dockerLoad` or `dockerFile`. + * + * The platform must execute the tool in the container using `docker run` with + * the appropriate Docker image and tool command line. + * + * The workflow platform may provide input files and the designated output + * directory through the use of volume bind mounts. The platform should rewrite + * file paths in the input object to correspond to the Docker bind mounted + * locations. That is, the platform should rewrite values in the parameter context + * such as `runtime.outdir`, `runtime.tmpdir` and others to be valid paths + * within the container. The platform must ensure that `runtime.outdir` and + * `runtime.tmpdir` are distinct directories. + * + * When running a tool contained in Docker, the workflow platform must not + * assume anything about the contents of the Docker container, such as the + * presence or absence of specific software, except to assume that the + * generated command line represents a valid command within the runtime + * environment of the container. + * + * A container image may specify an + * [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) + * and/or + * [CMD](https://docs.docker.com/engine/reference/builder/#cmd). + * Command line arguments will be appended after all elements of + * ENTRYPOINT, and will override all elements specified using CMD (in + * other words, CMD is only used when the CommandLineTool definition + * produces an empty command line). + * + * Use of implicit ENTRYPOINT or CMD are discouraged due to reproducibility + * concerns of the implicit hidden execution point (For further discussion, see + * [https://doi.org/10.12688/f1000research.15140.1](https://doi.org/10.12688/f1000research.15140.1)). Portable + * CommandLineTool wrappers in which use of a container is optional must not rely on ENTRYPOINT or CMD. + * CommandLineTools which do rely on ENTRYPOINT or CMD must list `DockerRequirement` in the + * `requirements` section. + * + * ## Interaction with other requirements + * + * If [EnvVarRequirement](#EnvVarRequirement) is specified alongside a + * DockerRequirement, the environment variables must be provided to Docker + * using `--env` or `--env-file` and interact with the container's preexisting + * environment as defined by Docker. + * + */ +export interface DockerRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'DockerRequirement' + */ + class_: string + + /** + * Specify a Docker image to retrieve using `docker pull`. Can contain the + * immutable digest to ensure an exact container is used: + * `dockerPull: ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2` + * + */ + dockerPull?: undefined | string + + /** + * Specify a HTTP URL from which to download a Docker image using `docker load`. + */ + dockerLoad?: undefined | string + + /** + * Supply the contents of a Dockerfile which will be built using `docker build`. + */ + dockerFile?: undefined | string + + /** + * Provide HTTP URL to download and gunzip a Docker images using `docker import. + */ + dockerImport?: undefined | string + + /** + * The image id that will be used for `docker run`. May be a + * human-readable image name or the image identifier hash. May be skipped + * if `dockerPull` is specified, in which case the `dockerPull` image id + * must be used. + * + */ + dockerImageId?: undefined | string + + /** + * Set the designated output directory to a specific location inside the + * Docker container. + * + */ + dockerOutputDirectory?: undefined | string +} \ No newline at end of file diff --git a/src/documented.ts b/src/documented.ts deleted file mode 100644 index eef14fe..0000000 --- a/src/documented.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/salad#Documented - */ -export interface Documented { } - \ No newline at end of file diff --git a/src/documentedProperties.ts b/src/documentedProperties.ts new file mode 100644 index 0000000..af83d47 --- /dev/null +++ b/src/documentedProperties.ts @@ -0,0 +1,14 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/salad#Documented + */ +export interface DocumentedProperties { + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/enumSchema.ts b/src/enumSchema.ts index 3f5896f..17fe832 100644 --- a/src/enumSchema.ts +++ b/src/enumSchema.ts @@ -21,9 +21,8 @@ import * as Internal from './util/internal' * Define an enumerated type. * */ -export class EnumSchema extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class EnumSchema extends Saveable implements Internal.EnumSchemaProperties { + extensionFields?: Internal.Dictionary /** * Defines the set of valid symbols. @@ -36,10 +35,9 @@ export class EnumSchema extends Saveable { type: string - constructor ({extensionFields, loadingOptions, symbols, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string,}) { - super() + constructor ({loadingOptions, extensionFields, symbols, type} : {loadingOptions?: LoadingOptions} & Internal.EnumSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.symbols = symbols this.type = type } diff --git a/src/enumSchemaProperties.ts b/src/enumSchemaProperties.ts new file mode 100644 index 0000000..d4a89a1 --- /dev/null +++ b/src/enumSchemaProperties.ts @@ -0,0 +1,24 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/salad#EnumSchema + * + * Define an enumerated type. + * + */ +export interface EnumSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string +} \ No newline at end of file diff --git a/src/envVarRequirement.ts b/src/envVarRequirement.ts index b062b00..2e93dbf 100644 --- a/src/envVarRequirement.ts +++ b/src/envVarRequirement.ts @@ -22,9 +22,8 @@ import * as Internal from './util/internal' * execution environment of the tool. See `EnvironmentDef` for details. * */ -export class EnvVarRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class EnvVarRequirement extends Saveable implements Internal.EnvVarRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'EnvVarRequirement' @@ -37,10 +36,9 @@ export class EnvVarRequirement extends Saveable implements Internal.ProcessRequi envDef: Array - constructor ({extensionFields, loadingOptions, class_, envDef} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, envDef: Array,}) { - super() + constructor ({loadingOptions, extensionFields, class_, envDef} : {loadingOptions?: LoadingOptions} & Internal.EnvVarRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.envDef = envDef } diff --git a/src/envVarRequirementProperties.ts b/src/envVarRequirementProperties.ts new file mode 100644 index 0000000..43bc746 --- /dev/null +++ b/src/envVarRequirementProperties.ts @@ -0,0 +1,25 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#EnvVarRequirement + * + * Define a list of environment variables which will be set in the + * execution environment of the tool. See `EnvironmentDef` for details. + * + */ +export interface EnvVarRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'EnvVarRequirement' + */ + class_: string + + /** + * The list of environment variables. + */ + envDef: Array +} \ No newline at end of file diff --git a/src/environmentDef.ts b/src/environmentDef.ts index aaa477c..d7a7ba1 100644 --- a/src/environmentDef.ts +++ b/src/environmentDef.ts @@ -23,9 +23,8 @@ import * as Internal from './util/internal' * result of executing an expression, such as getting a parameter from input. * */ -export class EnvironmentDef extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class EnvironmentDef extends Saveable implements Internal.EnvironmentDefProperties { + extensionFields?: Internal.Dictionary /** * The environment variable name @@ -38,10 +37,9 @@ export class EnvironmentDef extends Saveable { envValue: string - constructor ({extensionFields, loadingOptions, envName, envValue} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, envName: string, envValue: string,}) { - super() + constructor ({loadingOptions, extensionFields, envName, envValue} : {loadingOptions?: LoadingOptions} & Internal.EnvironmentDefProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.envName = envName this.envValue = envValue } diff --git a/src/environmentDefProperties.ts b/src/environmentDefProperties.ts new file mode 100644 index 0000000..d7131a3 --- /dev/null +++ b/src/environmentDefProperties.ts @@ -0,0 +1,26 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#EnvironmentDef + * + * Define an environment variable that will be set in the runtime environment + * by the workflow platform when executing the command line tool. May be the + * result of executing an expression, such as getting a parameter from input. + * + */ +export interface EnvironmentDefProperties { + + extensionFields?: Internal.Dictionary + + /** + * The environment variable name + */ + envName: string + + /** + * The environment variable value + */ + envValue: string +} \ No newline at end of file diff --git a/src/expressionTool.ts b/src/expressionTool.ts index 3e8508b..7641d78 100644 --- a/src/expressionTool.ts +++ b/src/expressionTool.ts @@ -27,25 +27,24 @@ import * as Internal from './util/internal' * or allowed. * */ -export class ExpressionTool extends Saveable implements Internal.Process { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ExpressionTool extends Saveable implements Internal.ExpressionToolProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string class_: string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Defines the input parameters of the process. The process is ready to @@ -79,7 +78,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { * unless overridden at user option. * */ - requirements: undefined | Array + requirements?: undefined | Array /** * Declares hints applying to either the runtime environment or the @@ -88,14 +87,14 @@ export class ExpressionTool extends Saveable implements Internal.Process { * the implementation may report a warning. * */ - hints: undefined | Array + hints?: undefined | Array /** * CWL document version. Always required at the document root. Not * required for a Process embedded inside another Process. * */ - cwlVersion: undefined | string + cwlVersion?: undefined | string /** * An identifier for the type of computational operation, of this Process. @@ -113,7 +112,7 @@ export class ExpressionTool extends Saveable implements Internal.Process { * [Split read mapping](http://edamontology.org/operation_3199). * */ - intent: undefined | Array + intent?: undefined | Array /** * The expression to execute. The expression must return a plain @@ -124,10 +123,9 @@ export class ExpressionTool extends Saveable implements Internal.Process { expression: string - constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, expression} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string, expression: string,}) { - super() + constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, expression} : {loadingOptions?: LoadingOptions} & Internal.ExpressionToolProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.class_ = class_ this.label = label diff --git a/src/expressionToolOutputParameter.ts b/src/expressionToolOutputParameter.ts index 889f779..6e3063d 100644 --- a/src/expressionToolOutputParameter.ts +++ b/src/expressionToolOutputParameter.ts @@ -18,19 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#ExpressionToolOutputParameter */ -export class ExpressionToolOutputParameter extends Saveable implements Internal.OutputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ExpressionToolOutputParameter extends Saveable implements Internal.ExpressionToolOutputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -76,7 +75,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -87,12 +86,12 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -101,7 +100,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. * File object. * */ - format: undefined | string + format?: undefined | string /** * Specify valid types of data that may be assigned to this parameter. @@ -110,10 +109,9 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, type} : {loadingOptions?: LoadingOptions} & Internal.ExpressionToolOutputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/expressionToolOutputParameterProperties.ts b/src/expressionToolOutputParameterProperties.ts new file mode 100644 index 0000000..fe5200f --- /dev/null +++ b/src/expressionToolOutputParameterProperties.ts @@ -0,0 +1,98 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ExpressionToolOutputParameter + */ +export interface ExpressionToolOutputParameterProperties extends Internal.OutputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array +} \ No newline at end of file diff --git a/src/expressionToolProperties.ts b/src/expressionToolProperties.ts new file mode 100644 index 0000000..83dbfdc --- /dev/null +++ b/src/expressionToolProperties.ts @@ -0,0 +1,112 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ExpressionTool + * + * An ExpressionTool is a type of Process object that can be run by itself + * or as a Workflow step. It executes a pure Javascript expression that has + * access to the same input parameters as a workflow. It is meant to be used + * sparingly as a way to isolate complex Javascript expressions that need to + * operate on input data and produce some result; perhaps just a + * rearrangement of the inputs. No Docker software container is required + * or allowed. + * + */ +export interface ExpressionToolProperties extends Internal.ProcessProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements?: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints?: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion?: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent?: undefined | Array + + /** + * The expression to execute. The expression must return a plain + * Javascript object which matches the output parameters of the + * ExpressionTool. + * + */ + expression: string +} \ No newline at end of file diff --git a/src/fieldBase.ts b/src/fieldBase.ts deleted file mode 100644 index c4a8748..0000000 --- a/src/fieldBase.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#FieldBase - */ -export interface FieldBase extends Internal.Labeled { } - \ No newline at end of file diff --git a/src/fieldBaseProperties.ts b/src/fieldBaseProperties.ts new file mode 100644 index 0000000..9ceeb4b --- /dev/null +++ b/src/fieldBaseProperties.ts @@ -0,0 +1,71 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#FieldBase + */ +export interface FieldBaseProperties extends Internal.LabeledProperties { + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean +} \ No newline at end of file diff --git a/src/file.ts b/src/file.ts index 0aca835..3b09ee3 100644 --- a/src/file.ts +++ b/src/file.ts @@ -86,9 +86,8 @@ import * as Internal from './util/internal' * the same value for `location`. * */ -export class File extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class File extends Saveable implements Internal.FileProperties { + extensionFields?: Internal.Dictionary /** * Must be `File` to indicate this object describes a file. @@ -113,7 +112,7 @@ export class File extends Saveable { * then follow the rules above. * */ - location: undefined | string + location?: undefined | string /** * The local host path where the File is available when a CommandLineTool is @@ -136,7 +135,7 @@ export class File extends Saveable { * `permanentFailure`. * */ - path: undefined | string + path?: undefined | string /** * The base name of the file, that is, the name of the file without any @@ -152,7 +151,7 @@ export class File extends Saveable { * `basename`. * */ - basename: undefined | string + basename?: undefined | string /** * The name of the directory containing file, that is, the path leading up @@ -165,7 +164,7 @@ export class File extends Saveable { * context. * */ - dirname: undefined | string + dirname?: undefined | string /** * The basename root such that `nameroot + nameext == basename`, and @@ -178,7 +177,7 @@ export class File extends Saveable { * of `basename` prior to evaluating parameter references or expressions. * */ - nameroot: undefined | string + nameroot?: undefined | string /** * The basename extension such that `nameroot + nameext == basename`, and @@ -190,19 +189,19 @@ export class File extends Saveable { * of `basename` prior to evaluating parameter references or expressions. * */ - nameext: undefined | string + nameext?: undefined | string /** * Optional hash code for validating file integrity. Currently must be in the form * "sha1$ + hexadecimal string" using the SHA-1 algorithm. * */ - checksum: undefined | string + checksum?: undefined | string /** * Optional file size (in bytes) */ - size: undefined | number + size?: undefined | number /** * A list of additional files or directories that are associated with the @@ -213,7 +212,7 @@ export class File extends Saveable { * which the same rules apply. * */ - secondaryFiles: undefined | Array + secondaryFiles?: undefined | Array /** * The format of the file: this must be an IRI of a concept node that @@ -232,7 +231,7 @@ export class File extends Saveable { * runtime may perform exact file format matches. * */ - format: undefined | string + format?: undefined | string /** * File contents literal. @@ -258,13 +257,12 @@ export class File extends Saveable { * implementation must raise a fatal error. * */ - contents: undefined | string + contents?: undefined | string - constructor ({extensionFields, loadingOptions, class_, location, path, basename, dirname, nameroot, nameext, checksum, size, secondaryFiles, format, contents} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, location: undefined | string, path: undefined | string, basename: undefined | string, dirname: undefined | string, nameroot: undefined | string, nameext: undefined | string, checksum: undefined | string, size: undefined | number, secondaryFiles: undefined | Array, format: undefined | string, contents: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, location, path, basename, dirname, nameroot, nameext, checksum, size, secondaryFiles, format, contents} : {loadingOptions?: LoadingOptions} & Internal.FileProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.location = location this.path = path diff --git a/src/fileProperties.ts b/src/fileProperties.ts new file mode 100644 index 0000000..37196df --- /dev/null +++ b/src/fileProperties.ts @@ -0,0 +1,249 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#File + * + * Represents a file (or group of files when `secondaryFiles` is provided) that + * will be accessible by tools using standard POSIX file system call API such as + * open(2) and read(2). + * + * Files are represented as objects with `class` of `File`. File objects have + * a number of properties that provide metadata about the file. + * + * The `location` property of a File is a URI that uniquely identifies the + * file. Implementations must support the file:// URI scheme and may support + * other schemes such as http://. The value of `location` may also be a + * relative reference, in which case it must be resolved relative to the URI + * of the document it appears in. Alternately to `location`, implementations + * must also accept the `path` property on File, which must be a filesystem + * path available on the same host as the CWL runner (for inputs) or the + * runtime environment of a command line tool execution (for command line tool + * outputs). + * + * If no `location` or `path` is specified, a file object must specify + * `contents` with the UTF-8 text content of the file. This is a "file + * literal". File literals do not correspond to external resources, but are + * created on disk with `contents` with when needed for a executing a tool. + * Where appropriate, expressions can return file literals to define new files + * on a runtime. The maximum size of `contents` is 64 kilobytes. + * + * The `basename` property defines the filename on disk where the file is + * staged. This may differ from the resource name. If not provided, + * `basename` must be computed from the last path part of `location` and made + * available to expressions. + * + * The `secondaryFiles` property is a list of File or Directory objects that + * must be staged in the same directory as the primary file. It is an error + * for file names to be duplicated in `secondaryFiles`. + * + * The `size` property is the size in bytes of the File. It must be computed + * from the resource and made available to expressions. The `checksum` field + * contains a cryptographic hash of the file content for use it verifying file + * contents. Implementations may, at user option, enable or disable + * computation of the `checksum` field for performance or other reasons. + * However, the ability to compute output checksums is required to pass the + * CWL conformance test suite. + * + * When executing a CommandLineTool, the files and secondary files may be + * staged to an arbitrary directory, but must use the value of `basename` for + * the filename. The `path` property must be file path in the context of the + * tool execution runtime (local to the compute node, or within the executing + * container). All computed properties should be available to expressions. + * File literals also must be staged and `path` must be set. + * + * When collecting CommandLineTool outputs, `glob` matching returns file paths + * (with the `path` property) and the derived properties. This can all be + * modified by `outputEval`. Alternately, if the file `cwl.output.json` is + * present in the output, `outputBinding` is ignored. + * + * File objects in the output must provide either a `location` URI or a `path` + * property in the context of the tool execution runtime (local to the compute + * node, or within the executing container). + * + * When evaluating an ExpressionTool, file objects must be referenced via + * `location` (the expression tool does not have access to files on disk so + * `path` is meaningless) or as file literals. It is legal to return a file + * object with an existing `location` but a different `basename`. The + * `loadContents` field of ExpressionTool inputs behaves the same as on + * CommandLineTool inputs, however it is not meaningful on the outputs. + * + * An ExpressionTool may forward file references from input to output by using + * the same value for `location`. + * + */ +export interface FileProperties { + + extensionFields?: Internal.Dictionary + + /** + * Must be `File` to indicate this object describes a file. + */ + class_: string + + /** + * An IRI that identifies the file resource. This may be a relative + * reference, in which case it must be resolved using the base IRI of the + * document. The location may refer to a local or remote resource; the + * implementation must use the IRI to retrieve file content. If an + * implementation is unable to retrieve the file content stored at a + * remote resource (due to unsupported protocol, access denied, or other + * issue) it must signal an error. + * + * If the `location` field is not provided, the `contents` field must be + * provided. The implementation must assign a unique identifier for + * the `location` field. + * + * If the `path` field is provided but the `location` field is not, an + * implementation may assign the value of the `path` field to `location`, + * then follow the rules above. + * + */ + location?: undefined | string + + /** + * The local host path where the File is available when a CommandLineTool is + * executed. This field must be set by the implementation. The final + * path component must match the value of `basename`. This field + * must not be used in any other context. The command line tool being + * executed must be able to to access the file at `path` using the POSIX + * `open(2)` syscall. + * + * As a special case, if the `path` field is provided but the `location` + * field is not, an implementation may assign the value of the `path` + * field to `location`, and remove the `path` field. + * + * If the `path` contains [POSIX shell metacharacters](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02) + * (`|`,`&`, `;`, `<`, `>`, `(`,`)`, `$`,`` ` ``, `\`, `"`, `'`, + * ``, ``, and ``) or characters + * [not allowed](http://www.iana.org/assignments/idna-tables-6.3.0/idna-tables-6.3.0.xhtml) + * for [Internationalized Domain Names for Applications](https://tools.ietf.org/html/rfc6452) + * then implementations may terminate the process with a + * `permanentFailure`. + * + */ + path?: undefined | string + + /** + * The base name of the file, that is, the name of the file without any + * leading directory path. The base name must not contain a slash `/`. + * + * If not provided, the implementation must set this field based on the + * `location` field by taking the final path component after parsing + * `location` as an IRI. If `basename` is provided, it is not required to + * match the value from `location`. + * + * When this file is made available to a CommandLineTool, it must be named + * with `basename`, i.e. the final component of the `path` field must match + * `basename`. + * + */ + basename?: undefined | string + + /** + * The name of the directory containing file, that is, the path leading up + * to the final slash in the path such that `dirname + '/' + basename == + * path`. + * + * The implementation must set this field based on the value of `path` + * prior to evaluating parameter references or expressions in a + * CommandLineTool document. This field must not be used in any other + * context. + * + */ + dirname?: undefined | string + + /** + * The basename root such that `nameroot + nameext == basename`, and + * `nameext` is empty or begins with a period and contains at most one + * period. For the purposess of path splitting leading periods on the + * basename are ignored; a basename of `.cshrc` will have a nameroot of + * `.cshrc`. + * + * The implementation must set this field automatically based on the value + * of `basename` prior to evaluating parameter references or expressions. + * + */ + nameroot?: undefined | string + + /** + * The basename extension such that `nameroot + nameext == basename`, and + * `nameext` is empty or begins with a period and contains at most one + * period. Leading periods on the basename are ignored; a basename of + * `.cshrc` will have an empty `nameext`. + * + * The implementation must set this field automatically based on the value + * of `basename` prior to evaluating parameter references or expressions. + * + */ + nameext?: undefined | string + + /** + * Optional hash code for validating file integrity. Currently must be in the form + * "sha1$ + hexadecimal string" using the SHA-1 algorithm. + * + */ + checksum?: undefined | string + + /** + * Optional file size (in bytes) + */ + size?: undefined | number + + /** + * A list of additional files or directories that are associated with the + * primary file and must be transferred alongside the primary file. + * Examples include indexes of the primary file, or external references + * which must be included when loading primary document. A file object + * listed in `secondaryFiles` may itself include `secondaryFiles` for + * which the same rules apply. + * + */ + secondaryFiles?: undefined | Array + + /** + * The format of the file: this must be an IRI of a concept node that + * represents the file format, preferrably defined within an ontology. + * If no ontology is available, file formats may be tested by exact match. + * + * Reasoning about format compatability must be done by checking that an + * input file format is the same, `owl:equivalentClass` or + * `rdfs:subClassOf` the format required by the input parameter. + * `owl:equivalentClass` is transitive with `rdfs:subClassOf`, e.g. if + * ` owl:equivalentClass ` and ` owl:subclassOf ` then infer + * ` owl:subclassOf `. + * + * File format ontologies may be provided in the "$schemas" metadata at the + * root of the document. If no ontologies are specified in `$schemas`, the + * runtime may perform exact file format matches. + * + */ + format?: undefined | string + + /** + * File contents literal. + * + * If neither `location` nor `path` is provided, `contents` must be + * non-null. The implementation must assign a unique identifier for the + * `location` field. When the file is staged as input to CommandLineTool, + * the value of `contents` must be written to a file. + * + * If `contents` is set as a result of an Javascript expression, + * an `entry` in `InitialWorkDirRequirement`, or read in from + * `cwl.output.json`, there is no specified upper limit on the + * size of `contents`. Implementations may have practical limits + * on the size of `contents` based on memory and storage + * available to the workflow runner or other factors. + * + * If the `loadContents` field of an `InputParameter` or + * `OutputParameter` is true, and the input or output File object + * `location` is valid, the file must be a UTF-8 text file 64 KiB + * or smaller, and the implementation must read the entire + * contents of the file and place it in the `contents` field. If + * the size of the file is greater than 64 KiB, the + * implementation must raise a fatal error. + * + */ + contents?: undefined | string +} \ No newline at end of file diff --git a/src/iOSchema.ts b/src/iOSchema.ts deleted file mode 100644 index 52c3d2a..0000000 --- a/src/iOSchema.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#IOSchema - */ -export interface IOSchema extends Internal.Labeled, Internal.Documented { } - \ No newline at end of file diff --git a/src/iOSchemaProperties.ts b/src/iOSchemaProperties.ts new file mode 100644 index 0000000..e6782e2 --- /dev/null +++ b/src/iOSchemaProperties.ts @@ -0,0 +1,24 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#IOSchema + */ +export interface IOSchemaProperties extends Internal.LabeledProperties, Internal.DocumentedProperties { + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/identified.ts b/src/identified.ts deleted file mode 100644 index ad7a771..0000000 --- a/src/identified.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#Identified - */ -export interface Identified { } - \ No newline at end of file diff --git a/src/identifiedProperties.ts b/src/identifiedProperties.ts new file mode 100644 index 0000000..256ee81 --- /dev/null +++ b/src/identifiedProperties.ts @@ -0,0 +1,14 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Identified + */ +export interface IdentifiedProperties { + + /** + * The unique identifier for this object. + */ + id?: undefined | string +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 3e74a02..c2025be 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,82 +1,143 @@ export { loadDocument, loadDocumentByString, - Documented, + DocumentedProperties, + RecordFieldProperties, RecordField, + RecordSchemaProperties, RecordSchema, + EnumSchemaProperties, EnumSchema, + ArraySchemaProperties, ArraySchema, + FileProperties, File, + DirectoryProperties, Directory, - Labeled, - Identified, - LoadContents, - FieldBase, - InputFormat, - OutputFormat, - Parameter, + LabeledProperties, + IdentifiedProperties, + LoadContentsProperties, + FieldBaseProperties, + InputFormatProperties, + OutputFormatProperties, + ParameterProperties, + InputBindingProperties, InputBinding, - IOSchema, - InputSchema, - OutputSchema, + IOSchemaProperties, + InputSchemaProperties, + OutputSchemaProperties, + InputRecordFieldProperties, InputRecordField, + InputRecordSchemaProperties, InputRecordSchema, + InputEnumSchemaProperties, InputEnumSchema, + InputArraySchemaProperties, InputArraySchema, + OutputRecordFieldProperties, OutputRecordField, + OutputRecordSchemaProperties, OutputRecordSchema, + OutputEnumSchemaProperties, OutputEnumSchema, + OutputArraySchemaProperties, OutputArraySchema, - InputParameter, - OutputParameter, - ProcessRequirement, - Process, + InputParameterProperties, + OutputParameterProperties, + ProcessRequirementProperties, + ProcessProperties, + InlineJavascriptRequirementProperties, InlineJavascriptRequirement, - CommandInputSchema, + CommandInputSchemaProperties, + SchemaDefRequirementProperties, SchemaDefRequirement, + SecondaryFileSchemaProperties, SecondaryFileSchema, + LoadListingRequirementProperties, LoadListingRequirement, + EnvironmentDefProperties, EnvironmentDef, + CommandLineBindingProperties, CommandLineBinding, + CommandOutputBindingProperties, CommandOutputBinding, + CommandLineBindableProperties, CommandLineBindable, + CommandInputRecordFieldProperties, CommandInputRecordField, + CommandInputRecordSchemaProperties, CommandInputRecordSchema, + CommandInputEnumSchemaProperties, CommandInputEnumSchema, + CommandInputArraySchemaProperties, CommandInputArraySchema, + CommandOutputRecordFieldProperties, CommandOutputRecordField, + CommandOutputRecordSchemaProperties, CommandOutputRecordSchema, + CommandOutputEnumSchemaProperties, CommandOutputEnumSchema, + CommandOutputArraySchemaProperties, CommandOutputArraySchema, + CommandInputParameterProperties, CommandInputParameter, + CommandOutputParameterProperties, CommandOutputParameter, + CommandLineToolProperties, CommandLineTool, + DockerRequirementProperties, DockerRequirement, + SoftwareRequirementProperties, SoftwareRequirement, + SoftwarePackageProperties, SoftwarePackage, + DirentProperties, Dirent, + InitialWorkDirRequirementProperties, InitialWorkDirRequirement, + EnvVarRequirementProperties, EnvVarRequirement, + ShellCommandRequirementProperties, ShellCommandRequirement, + ResourceRequirementProperties, ResourceRequirement, + WorkReuseProperties, WorkReuse, + NetworkAccessProperties, NetworkAccess, + InplaceUpdateRequirementProperties, InplaceUpdateRequirement, + ToolTimeLimitProperties, ToolTimeLimit, + ExpressionToolOutputParameterProperties, ExpressionToolOutputParameter, + WorkflowInputParameterProperties, WorkflowInputParameter, + ExpressionToolProperties, ExpressionTool, + WorkflowOutputParameterProperties, WorkflowOutputParameter, - Sink, + SinkProperties, + WorkflowStepInputProperties, WorkflowStepInput, + WorkflowStepOutputProperties, WorkflowStepOutput, + WorkflowStepProperties, WorkflowStep, + WorkflowProperties, Workflow, + SubworkflowFeatureRequirementProperties, SubworkflowFeatureRequirement, + ScatterFeatureRequirementProperties, ScatterFeatureRequirement, + MultipleInputFeatureRequirementProperties, MultipleInputFeatureRequirement, + StepInputExpressionRequirementProperties, StepInputExpressionRequirement, + OperationInputParameterProperties, OperationInputParameter, + OperationOutputParameterProperties, OperationOutputParameter, + OperationProperties, Operation } from './util/internal' \ No newline at end of file diff --git a/src/initialWorkDirRequirement.ts b/src/initialWorkDirRequirement.ts index bf89510..10bcb80 100644 --- a/src/initialWorkDirRequirement.ts +++ b/src/initialWorkDirRequirement.ts @@ -21,9 +21,8 @@ import * as Internal from './util/internal' * Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool. * Normally files are staged within the designated output directory. However, when running inside containers, files may be staged at arbitrary locations, see discussion for `Dirent.entryname`. Together with `DockerRequirement.dockerOutputDirectory` this it possible to control the locations of both input and output files when running in containers. */ -export class InitialWorkDirRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InitialWorkDirRequirement extends Saveable implements Internal.InitialWorkDirRequirementProperties { + extensionFields?: Internal.Dictionary /** * InitialWorkDirRequirement @@ -57,13 +56,12 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Proc * is undefined. * */ - listing: string | Array> + listing?: string | Array> - constructor ({extensionFields, loadingOptions, class_, listing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, listing: string | Array>,}) { - super() + constructor ({loadingOptions, extensionFields, class_, listing} : {loadingOptions?: LoadingOptions} & Internal.InitialWorkDirRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.listing = listing } diff --git a/src/initialWorkDirRequirementProperties.ts b/src/initialWorkDirRequirementProperties.ts new file mode 100644 index 0000000..93e3e95 --- /dev/null +++ b/src/initialWorkDirRequirementProperties.ts @@ -0,0 +1,48 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InitialWorkDirRequirement + * + * Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool. + * Normally files are staged within the designated output directory. However, when running inside containers, files may be staged at arbitrary locations, see discussion for `Dirent.entryname`. Together with `DockerRequirement.dockerOutputDirectory` this it possible to control the locations of both input and output files when running in containers. + */ +export interface InitialWorkDirRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * InitialWorkDirRequirement + */ + class_: string + + /** + * The list of files or subdirectories that must be staged prior + * to executing the command line tool. + * + * Return type of each expression must validate as `["null", + * File, Directory, Dirent, {type: array, items: [File, + * Directory]}]`. + * + * Each `File` or `Directory` that is returned by an Expression + * must be added to the designated output directory prior to + * executing the tool. + * + * Each `Dirent` record that is listed or returned by an + * expression specifies a file to be created or staged in the + * designated output directory prior to executing the tool. + * + * Expressions may return null, in which case they have no effect. + * + * Files or Directories which are listed in the input parameters + * and appear in the `InitialWorkDirRequirement` listing must + * have their `path` set to their staged location. If the same + * File or Directory appears more than once in the + * `InitialWorkDirRequirement` listing, the implementation must + * choose exactly one value for `path`; how this value is chosen + * is undefined. + * + */ + listing?: string | Array> +} \ No newline at end of file diff --git a/src/inlineJavascriptRequirement.ts b/src/inlineJavascriptRequirement.ts index dde9589..88946fa 100644 --- a/src/inlineJavascriptRequirement.ts +++ b/src/inlineJavascriptRequirement.ts @@ -23,9 +23,8 @@ import * as Internal from './util/internal' * interpolatation. * */ -export class InlineJavascriptRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InlineJavascriptRequirement extends Saveable implements Internal.InlineJavascriptRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'InlineJavascriptRequirement' @@ -38,13 +37,12 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.Pr * be called from CWL expressions. * */ - expressionLib: undefined | Array + expressionLib?: undefined | Array - constructor ({extensionFields, loadingOptions, class_, expressionLib} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, expressionLib: undefined | Array,}) { - super() + constructor ({loadingOptions, extensionFields, class_, expressionLib} : {loadingOptions?: LoadingOptions} & Internal.InlineJavascriptRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.expressionLib = expressionLib } diff --git a/src/inlineJavascriptRequirementProperties.ts b/src/inlineJavascriptRequirementProperties.ts new file mode 100644 index 0000000..69770a9 --- /dev/null +++ b/src/inlineJavascriptRequirementProperties.ts @@ -0,0 +1,29 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InlineJavascriptRequirement + * + * Indicates that the workflow platform must support inline Javascript expressions. + * If this requirement is not present, the workflow platform must not perform expression + * interpolatation. + * + */ +export interface InlineJavascriptRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'InlineJavascriptRequirement' + */ + class_: string + + /** + * Additional code fragments that will also be inserted + * before executing the expression code. Allows for function definitions that may + * be called from CWL expressions. + * + */ + expressionLib?: undefined | Array +} \ No newline at end of file diff --git a/src/inplaceUpdateRequirement.ts b/src/inplaceUpdateRequirement.ts index a59c9ea..459244c 100644 --- a/src/inplaceUpdateRequirement.ts +++ b/src/inplaceUpdateRequirement.ts @@ -50,9 +50,8 @@ import * as Internal from './util/internal' * not be enabled. * */ -export class InplaceUpdateRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InplaceUpdateRequirement extends Saveable implements Internal.InplaceUpdateRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'InplaceUpdateRequirement' @@ -61,10 +60,9 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Proce inplaceUpdate: boolean - constructor ({extensionFields, loadingOptions, class_, inplaceUpdate} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, inplaceUpdate: boolean,}) { - super() + constructor ({loadingOptions, extensionFields, class_, inplaceUpdate} : {loadingOptions?: LoadingOptions} & Internal.InplaceUpdateRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.inplaceUpdate = inplaceUpdate } diff --git a/src/inplaceUpdateRequirementProperties.ts b/src/inplaceUpdateRequirementProperties.ts new file mode 100644 index 0000000..fd09c5a --- /dev/null +++ b/src/inplaceUpdateRequirementProperties.ts @@ -0,0 +1,49 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InplaceUpdateRequirement + * + * + * If `inplaceUpdate` is true, then an implementation supporting this + * feature may permit tools to directly update files with `writable: + * true` in InitialWorkDirRequirement. That is, as an optimization, + * files may be destructively modified in place as opposed to copied + * and updated. + * + * An implementation must ensure that only one workflow step may + * access a writable file at a time. It is an error if a file which + * is writable by one workflow step file is accessed (for reading or + * writing) by any other workflow step running independently. + * However, a file which has been updated in a previous completed + * step may be used as input to multiple steps, provided it is + * read-only in every step. + * + * Workflow steps which modify a file must produce the modified file + * as output. Downstream steps which futher process the file must + * use the output of previous steps, and not refer to a common input + * (this is necessary for both ordering and correctness). + * + * Workflow authors should provide this in the `hints` section. The + * intent of this feature is that workflows produce the same results + * whether or not InplaceUpdateRequirement is supported by the + * implementation, and this feature is primarily available as an + * optimization for particular environments. + * + * Users and implementers should be aware that workflows that + * destructively modify inputs may not be repeatable or reproducible. + * In particular, enabling this feature implies that WorkReuse should + * not be enabled. + * + */ +export interface InplaceUpdateRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'InplaceUpdateRequirement' + */ + class_: string + inplaceUpdate: boolean +} \ No newline at end of file diff --git a/src/inputArraySchema.ts b/src/inputArraySchema.ts index 71dccf4..8ffd627 100644 --- a/src/inputArraySchema.ts +++ b/src/inputArraySchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputArraySchema */ -export class InputArraySchema extends Saveable implements Internal.ArraySchema, Internal.InputSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InputArraySchema extends Saveable implements Internal.InputArraySchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the type of the array elements. @@ -40,18 +39,17 @@ export class InputArraySchema extends Saveable implements Internal.ArraySchema, /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, items, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, items, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.InputArraySchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.items = items this.type = type diff --git a/src/inputArraySchemaProperties.ts b/src/inputArraySchemaProperties.ts new file mode 100644 index 0000000..e47a40c --- /dev/null +++ b/src/inputArraySchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputArraySchema + */ +export interface InputArraySchemaProperties extends Internal.ArraySchemaProperties, Internal.InputSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/inputBinding.ts b/src/inputBinding.ts index 0faba04..3ec7c28 100644 --- a/src/inputBinding.ts +++ b/src/inputBinding.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputBinding */ -export class InputBinding extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InputBinding extends Saveable implements Internal.InputBindingProperties { + extensionFields?: Internal.Dictionary /** * Use of `loadContents` in `InputBinding` is deprecated. @@ -28,13 +27,12 @@ export class InputBinding extends Saveable { * CWL v2.0. Use `InputParameter.loadContents` instead. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean - constructor ({extensionFields, loadingOptions, loadContents} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, loadContents: undefined | boolean,}) { - super() + constructor ({loadingOptions, extensionFields, loadContents} : {loadingOptions?: LoadingOptions} & Internal.InputBindingProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.loadContents = loadContents } diff --git a/src/inputBindingProperties.ts b/src/inputBindingProperties.ts new file mode 100644 index 0000000..f65ea18 --- /dev/null +++ b/src/inputBindingProperties.ts @@ -0,0 +1,19 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputBinding + */ +export interface InputBindingProperties { + + extensionFields?: Internal.Dictionary + + /** + * Use of `loadContents` in `InputBinding` is deprecated. + * Preserved for v1.0 backwards compatability. Will be removed in + * CWL v2.0. Use `InputParameter.loadContents` instead. + * + */ + loadContents?: undefined | boolean +} \ No newline at end of file diff --git a/src/inputEnumSchema.ts b/src/inputEnumSchema.ts index 35c72ca..c7a2600 100644 --- a/src/inputEnumSchema.ts +++ b/src/inputEnumSchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputEnumSchema */ -export class InputEnumSchema extends Saveable implements Internal.EnumSchema, Internal.InputSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InputEnumSchema extends Saveable implements Internal.InputEnumSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the set of valid symbols. @@ -40,18 +39,17 @@ export class InputEnumSchema extends Saveable implements Internal.EnumSchema, In /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, symbols, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.InputEnumSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.symbols = symbols this.type = type diff --git a/src/inputEnumSchemaProperties.ts b/src/inputEnumSchemaProperties.ts new file mode 100644 index 0000000..261eea6 --- /dev/null +++ b/src/inputEnumSchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputEnumSchema + */ +export interface InputEnumSchemaProperties extends Internal.EnumSchemaProperties, Internal.InputSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/inputFormat.ts b/src/inputFormat.ts deleted file mode 100644 index 61e81c1..0000000 --- a/src/inputFormat.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#InputFormat - */ -export interface InputFormat { } - \ No newline at end of file diff --git a/src/inputFormatProperties.ts b/src/inputFormatProperties.ts new file mode 100644 index 0000000..34e4c90 --- /dev/null +++ b/src/inputFormatProperties.ts @@ -0,0 +1,20 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputFormat + */ +export interface InputFormatProperties { + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array +} \ No newline at end of file diff --git a/src/inputParameter.ts b/src/inputParameter.ts deleted file mode 100644 index a74afee..0000000 --- a/src/inputParameter.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#InputParameter - */ -export interface InputParameter extends Internal.Parameter, Internal.InputFormat, Internal.LoadContents { } - \ No newline at end of file diff --git a/src/inputParameterProperties.ts b/src/inputParameterProperties.ts new file mode 100644 index 0000000..224cc1c --- /dev/null +++ b/src/inputParameterProperties.ts @@ -0,0 +1,129 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputParameter + */ +export interface InputParameterProperties extends Internal.ParameterProperties, Internal.InputFormatProperties, Internal.LoadContentsProperties { + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_?: undefined | any +} \ No newline at end of file diff --git a/src/inputRecordField.ts b/src/inputRecordField.ts index 58c20f2..c1afbb0 100644 --- a/src/inputRecordField.ts +++ b/src/inputRecordField.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputRecordField */ -export class InputRecordField extends Saveable implements Internal.RecordField, Internal.FieldBase, Internal.InputFormat, Internal.LoadContents { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InputRecordField extends Saveable implements Internal.InputRecordFieldProperties { + extensionFields?: Internal.Dictionary /** * The name of the field @@ -31,7 +30,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * The field type @@ -42,7 +41,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -88,7 +87,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -99,7 +98,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * Only valid when `type: File` or is an array of `items: File`. @@ -110,7 +109,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, * available, file formats may be tested by exact match. * */ - format: undefined | string | Array + format?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -123,7 +122,7 @@ export class InputRecordField extends Saveable implements Internal.RecordField, * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -138,13 +137,12 @@ export class InputRecordField extends Saveable implements Internal.RecordField, * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string - constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing} : {loadingOptions?: LoadingOptions} & Internal.InputRecordFieldProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.doc = doc this.type = type diff --git a/src/inputRecordFieldProperties.ts b/src/inputRecordFieldProperties.ts new file mode 100644 index 0000000..8d82820 --- /dev/null +++ b/src/inputRecordFieldProperties.ts @@ -0,0 +1,129 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputRecordField + */ +export interface InputRecordFieldProperties extends Internal.RecordFieldProperties, Internal.FieldBaseProperties, Internal.InputFormatProperties, Internal.LoadContentsProperties { + + extensionFields?: Internal.Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string +} \ No newline at end of file diff --git a/src/inputRecordSchema.ts b/src/inputRecordSchema.ts index 8e43892..c043dda 100644 --- a/src/inputRecordSchema.ts +++ b/src/inputRecordSchema.ts @@ -18,19 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#InputRecordSchema */ -export class InputRecordSchema extends Saveable implements Internal.RecordSchema, Internal.InputSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class InputRecordSchema extends Saveable implements Internal.InputRecordSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the fields of the record. */ - fields: undefined | Array + fields?: undefined | Array /** * Must be `record` @@ -40,18 +39,17 @@ export class InputRecordSchema extends Saveable implements Internal.RecordSchema /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, fields, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, fields, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.InputRecordSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.fields = fields this.type = type diff --git a/src/inputRecordSchemaProperties.ts b/src/inputRecordSchemaProperties.ts new file mode 100644 index 0000000..e839170 --- /dev/null +++ b/src/inputRecordSchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputRecordSchema + */ +export interface InputRecordSchemaProperties extends Internal.RecordSchemaProperties, Internal.InputSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the fields of the record. + */ + fields?: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/inputSchema.ts b/src/inputSchema.ts deleted file mode 100644 index 4b16eb1..0000000 --- a/src/inputSchema.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#InputSchema - */ -export interface InputSchema extends Internal.IOSchema { } - \ No newline at end of file diff --git a/src/inputSchemaProperties.ts b/src/inputSchemaProperties.ts new file mode 100644 index 0000000..141215b --- /dev/null +++ b/src/inputSchemaProperties.ts @@ -0,0 +1,24 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#InputSchema + */ +export interface InputSchemaProperties extends Internal.IOSchemaProperties { + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/labeled.ts b/src/labeled.ts deleted file mode 100644 index 75eb9df..0000000 --- a/src/labeled.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#Labeled - */ -export interface Labeled { } - \ No newline at end of file diff --git a/src/labeledProperties.ts b/src/labeledProperties.ts new file mode 100644 index 0000000..dbc25aa --- /dev/null +++ b/src/labeledProperties.ts @@ -0,0 +1,14 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Labeled + */ +export interface LabeledProperties { + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string +} \ No newline at end of file diff --git a/src/loadContents.ts b/src/loadContents.ts deleted file mode 100644 index 4e0bf94..0000000 --- a/src/loadContents.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#LoadContents - */ -export interface LoadContents { } - \ No newline at end of file diff --git a/src/loadContentsProperties.ts b/src/loadContentsProperties.ts new file mode 100644 index 0000000..1414c2c --- /dev/null +++ b/src/loadContentsProperties.ts @@ -0,0 +1,37 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#LoadContents + */ +export interface LoadContentsProperties { + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string +} \ No newline at end of file diff --git a/src/loadListingRequirement.ts b/src/loadListingRequirement.ts index 017b79e..5cf2218 100644 --- a/src/loadListingRequirement.ts +++ b/src/loadListingRequirement.ts @@ -22,21 +22,19 @@ import * as Internal from './util/internal' * a Directory object for use by expressions. * */ -export class LoadListingRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class LoadListingRequirement extends Saveable implements Internal.LoadListingRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'LoadListingRequirement' */ class_: string - loadListing: undefined | string + loadListing?: undefined | string - constructor ({extensionFields, loadingOptions, class_, loadListing} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, loadListing: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, loadListing} : {loadingOptions?: LoadingOptions} & Internal.LoadListingRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.loadListing = loadListing } diff --git a/src/loadListingRequirementProperties.ts b/src/loadListingRequirementProperties.ts new file mode 100644 index 0000000..1454439 --- /dev/null +++ b/src/loadListingRequirementProperties.ts @@ -0,0 +1,21 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#LoadListingRequirement + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + */ +export interface LoadListingRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'LoadListingRequirement' + */ + class_: string + loadListing?: undefined | string +} \ No newline at end of file diff --git a/src/multipleInputFeatureRequirement.ts b/src/multipleInputFeatureRequirement.ts index 4a151a4..64ac424 100644 --- a/src/multipleInputFeatureRequirement.ts +++ b/src/multipleInputFeatureRequirement.ts @@ -22,9 +22,8 @@ import * as Internal from './util/internal' * listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). * */ -export class MultipleInputFeatureRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class MultipleInputFeatureRequirement extends Saveable implements Internal.MultipleInputFeatureRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'MultipleInputFeatureRequirement' @@ -32,10 +31,9 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna class_: string - constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { - super() + constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.MultipleInputFeatureRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ } diff --git a/src/multipleInputFeatureRequirementProperties.ts b/src/multipleInputFeatureRequirementProperties.ts new file mode 100644 index 0000000..6a03863 --- /dev/null +++ b/src/multipleInputFeatureRequirementProperties.ts @@ -0,0 +1,20 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement + * + * Indicates that the workflow platform must support multiple inbound data links + * listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). + * + */ +export interface MultipleInputFeatureRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'MultipleInputFeatureRequirement' + */ + class_: string +} \ No newline at end of file diff --git a/src/networkAccess.ts b/src/networkAccess.ts index 0017927..a996155 100644 --- a/src/networkAccess.ts +++ b/src/networkAccess.ts @@ -35,9 +35,8 @@ import * as Internal from './util/internal' * address or the ability to accept inbound connections. * */ -export class NetworkAccess extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class NetworkAccess extends Saveable implements Internal.NetworkAccessProperties { + extensionFields?: Internal.Dictionary /** * Always 'NetworkAccess' @@ -46,10 +45,9 @@ export class NetworkAccess extends Saveable implements Internal.ProcessRequireme networkAccess: boolean | string - constructor ({extensionFields, loadingOptions, class_, networkAccess} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, networkAccess: boolean | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, networkAccess} : {loadingOptions?: LoadingOptions} & Internal.NetworkAccessProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.networkAccess = networkAccess } diff --git a/src/networkAccessProperties.ts b/src/networkAccessProperties.ts new file mode 100644 index 0000000..d3a2ca9 --- /dev/null +++ b/src/networkAccessProperties.ts @@ -0,0 +1,34 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#NetworkAccess + * + * Indicate whether a process requires outgoing IPv4/IPv6 network + * access. Choice of IPv4 or IPv6 is implementation and site + * specific, correct tools must support both. + * + * If `networkAccess` is false or not specified, tools must not + * assume network access, except for localhost (the loopback device). + * + * If `networkAccess` is true, the tool must be able to make outgoing + * connections to network resources. Resources may be on a private + * subnet or the public Internet. However, implementations and sites + * may apply their own security policies to restrict what is + * accessible by the tool. + * + * Enabling network access does not imply a publically routable IP + * address or the ability to accept inbound connections. + * + */ +export interface NetworkAccessProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'NetworkAccess' + */ + class_: string + networkAccess: boolean | string +} \ No newline at end of file diff --git a/src/operation.ts b/src/operation.ts index 0f8948a..813b964 100644 --- a/src/operation.ts +++ b/src/operation.ts @@ -27,25 +27,24 @@ import * as Internal from './util/internal' * CommandLineTool, or ExpressionTool) with a compatible signature. * */ -export class Operation extends Saveable implements Internal.Process { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class Operation extends Saveable implements Internal.OperationProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string class_: string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Defines the input parameters of the process. The process is ready to @@ -79,7 +78,7 @@ export class Operation extends Saveable implements Internal.Process { * unless overridden at user option. * */ - requirements: undefined | Array + requirements?: undefined | Array /** * Declares hints applying to either the runtime environment or the @@ -88,14 +87,14 @@ export class Operation extends Saveable implements Internal.Process { * the implementation may report a warning. * */ - hints: undefined | Array + hints?: undefined | Array /** * CWL document version. Always required at the document root. Not * required for a Process embedded inside another Process. * */ - cwlVersion: undefined | string + cwlVersion?: undefined | string /** * An identifier for the type of computational operation, of this Process. @@ -113,13 +112,12 @@ export class Operation extends Saveable implements Internal.Process { * [Split read mapping](http://edamontology.org/operation_3199). * */ - intent: undefined | Array + intent?: undefined | Array - constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string,}) { - super() + constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent} : {loadingOptions?: LoadingOptions} & Internal.OperationProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.class_ = class_ this.label = label diff --git a/src/operationInputParameter.ts b/src/operationInputParameter.ts index e6ba1d5..c46708a 100644 --- a/src/operationInputParameter.ts +++ b/src/operationInputParameter.ts @@ -21,19 +21,18 @@ import * as Internal from './util/internal' * Describe an input parameter of an operation. * */ -export class OperationInputParameter extends Saveable implements Internal.InputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class OperationInputParameter extends Saveable implements Internal.OperationInputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -79,7 +78,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -90,12 +89,12 @@ export class OperationInputParameter extends Saveable implements Internal.InputP * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -106,7 +105,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP * available, file formats may be tested by exact match. * */ - format: undefined | string | Array + format?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -119,7 +118,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -134,7 +133,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string /** * The default value to use for this parameter if the parameter is missing @@ -143,7 +142,7 @@ export class OperationInputParameter extends Saveable implements Internal.InputP * (e.g. dependent `valueFrom` fields). * */ - default_: undefined | any + default_?: undefined | any /** * Specify valid types of data that may be assigned to this parameter. @@ -152,10 +151,9 @@ export class OperationInputParameter extends Saveable implements Internal.InputP type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, default_: undefined | any, type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type} : {loadingOptions?: LoadingOptions} & Internal.OperationInputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/operationInputParameterProperties.ts b/src/operationInputParameterProperties.ts new file mode 100644 index 0000000..5d4aa32 --- /dev/null +++ b/src/operationInputParameterProperties.ts @@ -0,0 +1,140 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OperationInputParameter + * + * Describe an input parameter of an operation. + * + */ +export interface OperationInputParameterProperties extends Internal.InputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_?: undefined | any + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array +} \ No newline at end of file diff --git a/src/operationOutputParameter.ts b/src/operationOutputParameter.ts index aef1d04..90fbe62 100644 --- a/src/operationOutputParameter.ts +++ b/src/operationOutputParameter.ts @@ -21,19 +21,18 @@ import * as Internal from './util/internal' * Describe an output parameter of an operation. * */ -export class OperationOutputParameter extends Saveable implements Internal.OutputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class OperationOutputParameter extends Saveable implements Internal.OperationOutputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -79,7 +78,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -90,12 +89,12 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -104,7 +103,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu * File object. * */ - format: undefined | string + format?: undefined | string /** * Specify valid types of data that may be assigned to this parameter. @@ -113,10 +112,9 @@ export class OperationOutputParameter extends Saveable implements Internal.Outpu type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, type} : {loadingOptions?: LoadingOptions} & Internal.OperationOutputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/operationOutputParameterProperties.ts b/src/operationOutputParameterProperties.ts new file mode 100644 index 0000000..4c958c1 --- /dev/null +++ b/src/operationOutputParameterProperties.ts @@ -0,0 +1,101 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OperationOutputParameter + * + * Describe an output parameter of an operation. + * + */ +export interface OperationOutputParameterProperties extends Internal.OutputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array +} \ No newline at end of file diff --git a/src/operationProperties.ts b/src/operationProperties.ts new file mode 100644 index 0000000..2ea635f --- /dev/null +++ b/src/operationProperties.ts @@ -0,0 +1,104 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Operation + * + * This record describes an abstract operation. It is a potential + * step of a workflow that has not yet been bound to a concrete + * implementation. It specifies an input and output signature, but + * does not provide enough information to be executed. An + * implementation (or other tooling) may provide a means of binding + * an Operation to a concrete process (such as Workflow, + * CommandLineTool, or ExpressionTool) with a compatible signature. + * + */ +export interface OperationProperties extends Internal.ProcessProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements?: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints?: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion?: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent?: undefined | Array +} \ No newline at end of file diff --git a/src/outputArraySchema.ts b/src/outputArraySchema.ts index 5863884..ad8c923 100644 --- a/src/outputArraySchema.ts +++ b/src/outputArraySchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputArraySchema */ -export class OutputArraySchema extends Saveable implements Internal.ArraySchema, Internal.OutputSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class OutputArraySchema extends Saveable implements Internal.OutputArraySchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the type of the array elements. @@ -40,18 +39,17 @@ export class OutputArraySchema extends Saveable implements Internal.ArraySchema, /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, items, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, items: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, items, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.OutputArraySchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.items = items this.type = type diff --git a/src/outputArraySchemaProperties.ts b/src/outputArraySchemaProperties.ts new file mode 100644 index 0000000..444ce00 --- /dev/null +++ b/src/outputArraySchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputArraySchema + */ +export interface OutputArraySchemaProperties extends Internal.ArraySchemaProperties, Internal.OutputSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the type of the array elements. + */ + items: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + /** + * Must be `array` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/outputEnumSchema.ts b/src/outputEnumSchema.ts index 6af6922..3dc041e 100644 --- a/src/outputEnumSchema.ts +++ b/src/outputEnumSchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputEnumSchema */ -export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, Internal.OutputSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class OutputEnumSchema extends Saveable implements Internal.OutputEnumSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the set of valid symbols. @@ -40,18 +39,17 @@ export class OutputEnumSchema extends Saveable implements Internal.EnumSchema, I /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, symbols, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, symbols: Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, symbols, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.OutputEnumSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.symbols = symbols this.type = type diff --git a/src/outputEnumSchemaProperties.ts b/src/outputEnumSchemaProperties.ts new file mode 100644 index 0000000..c64cfe3 --- /dev/null +++ b/src/outputEnumSchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputEnumSchema + */ +export interface OutputEnumSchemaProperties extends Internal.EnumSchemaProperties, Internal.OutputSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the set of valid symbols. + */ + symbols: Array + + /** + * Must be `enum` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/outputFormat.ts b/src/outputFormat.ts deleted file mode 100644 index 930a277..0000000 --- a/src/outputFormat.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#OutputFormat - */ -export interface OutputFormat { } - \ No newline at end of file diff --git a/src/outputFormatProperties.ts b/src/outputFormatProperties.ts new file mode 100644 index 0000000..dae893a --- /dev/null +++ b/src/outputFormatProperties.ts @@ -0,0 +1,18 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputFormat + */ +export interface OutputFormatProperties { + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string +} \ No newline at end of file diff --git a/src/outputParameter.ts b/src/outputParameter.ts deleted file mode 100644 index 3d8b5c8..0000000 --- a/src/outputParameter.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#OutputParameter - */ -export interface OutputParameter extends Internal.Parameter, Internal.OutputFormat { } - \ No newline at end of file diff --git a/src/outputParameterProperties.ts b/src/outputParameterProperties.ts new file mode 100644 index 0000000..bab3b5f --- /dev/null +++ b/src/outputParameterProperties.ts @@ -0,0 +1,90 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputParameter + */ +export interface OutputParameterProperties extends Internal.ParameterProperties, Internal.OutputFormatProperties { + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string +} \ No newline at end of file diff --git a/src/outputRecordField.ts b/src/outputRecordField.ts index 4a91eb6..7db61c7 100644 --- a/src/outputRecordField.ts +++ b/src/outputRecordField.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputRecordField */ -export class OutputRecordField extends Saveable implements Internal.RecordField, Internal.FieldBase, Internal.OutputFormat { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class OutputRecordField extends Saveable implements Internal.OutputRecordFieldProperties { + extensionFields?: Internal.Dictionary /** * The name of the field @@ -31,7 +30,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * The field type @@ -42,7 +41,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -88,7 +87,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -99,7 +98,7 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * Only valid when `type: File` or is an array of `items: File`. @@ -108,13 +107,12 @@ export class OutputRecordField extends Saveable implements Internal.RecordField, * File object. * */ - format: undefined | string + format?: undefined | string - constructor ({extensionFields, loadingOptions, name, doc, type, label, secondaryFiles, streamable, format} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, format: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, doc, type, label, secondaryFiles, streamable, format} : {loadingOptions?: LoadingOptions} & Internal.OutputRecordFieldProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.doc = doc this.type = type diff --git a/src/outputRecordFieldProperties.ts b/src/outputRecordFieldProperties.ts new file mode 100644 index 0000000..1efe637 --- /dev/null +++ b/src/outputRecordFieldProperties.ts @@ -0,0 +1,99 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputRecordField + */ +export interface OutputRecordFieldProperties extends Internal.RecordFieldProperties, Internal.FieldBaseProperties, Internal.OutputFormatProperties { + + extensionFields?: Internal.Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string +} \ No newline at end of file diff --git a/src/outputRecordSchema.ts b/src/outputRecordSchema.ts index 52f73f2..142910c 100644 --- a/src/outputRecordSchema.ts +++ b/src/outputRecordSchema.ts @@ -18,19 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#OutputRecordSchema */ -export class OutputRecordSchema extends Saveable implements Internal.RecordSchema, Internal.OutputSchema { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class OutputRecordSchema extends Saveable implements Internal.OutputRecordSchemaProperties { + extensionFields?: Internal.Dictionary /** * The identifier for this type */ - name: undefined | string + name?: undefined | string /** * Defines the fields of the record. */ - fields: undefined | Array + fields?: undefined | Array /** * Must be `record` @@ -40,18 +39,17 @@ export class OutputRecordSchema extends Saveable implements Internal.RecordSchem /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array - constructor ({extensionFields, loadingOptions, name, fields, type, label, doc} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string, label: undefined | string, doc: undefined | string | Array, name: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, name, fields, type, label, doc} : {loadingOptions?: LoadingOptions} & Internal.OutputRecordSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.fields = fields this.type = type diff --git a/src/outputRecordSchemaProperties.ts b/src/outputRecordSchemaProperties.ts new file mode 100644 index 0000000..a2d614d --- /dev/null +++ b/src/outputRecordSchemaProperties.ts @@ -0,0 +1,36 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputRecordSchema + */ +export interface OutputRecordSchemaProperties extends Internal.RecordSchemaProperties, Internal.OutputSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * Defines the fields of the record. + */ + fields?: undefined | Array + + /** + * Must be `record` + */ + type: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/outputSchema.ts b/src/outputSchema.ts deleted file mode 100644 index 2941d11..0000000 --- a/src/outputSchema.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#OutputSchema - */ -export interface OutputSchema extends Internal.IOSchema { } - \ No newline at end of file diff --git a/src/outputSchemaProperties.ts b/src/outputSchemaProperties.ts new file mode 100644 index 0000000..23106a8 --- /dev/null +++ b/src/outputSchemaProperties.ts @@ -0,0 +1,24 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#OutputSchema + */ +export interface OutputSchemaProperties extends Internal.IOSchemaProperties { + + /** + * The identifier for this type + */ + name?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/parameter.ts b/src/parameter.ts deleted file mode 100644 index 54f8804..0000000 --- a/src/parameter.ts +++ /dev/null @@ -1,12 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#Parameter - * - * Define an input or output parameter to a process. - * - */ -export interface Parameter extends Internal.FieldBase, Internal.Documented, Internal.Identified { } - \ No newline at end of file diff --git a/src/parameterProperties.ts b/src/parameterProperties.ts new file mode 100644 index 0000000..af3abe2 --- /dev/null +++ b/src/parameterProperties.ts @@ -0,0 +1,84 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Parameter + * + * Define an input or output parameter to a process. + * + */ +export interface ParameterProperties extends Internal.FieldBaseProperties, Internal.DocumentedProperties, Internal.IdentifiedProperties { + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array +} \ No newline at end of file diff --git a/src/process.ts b/src/process.ts deleted file mode 100644 index e9b51ae..0000000 --- a/src/process.ts +++ /dev/null @@ -1,15 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#Process - * - * - * The base executable type in CWL is the `Process` object defined by the - * document. Note that the `Process` object is abstract and cannot be - * directly executed. - * - */ -export interface Process extends Internal.Identified, Internal.Labeled, Internal.Documented { } - \ No newline at end of file diff --git a/src/processProperties.ts b/src/processProperties.ts new file mode 100644 index 0000000..b0f72a1 --- /dev/null +++ b/src/processProperties.ts @@ -0,0 +1,98 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Process + * + * + * The base executable type in CWL is the `Process` object defined by the + * document. Note that the `Process` object is abstract and cannot be + * directly executed. + * + */ +export interface ProcessProperties extends Internal.IdentifiedProperties, Internal.LabeledProperties, Internal.DocumentedProperties { + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements?: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints?: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion?: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent?: undefined | Array +} \ No newline at end of file diff --git a/src/processRequirement.ts b/src/processRequirementProperties.ts similarity index 86% rename from src/processRequirement.ts rename to src/processRequirementProperties.ts index c30061e..fa89db6 100644 --- a/src/processRequirement.ts +++ b/src/processRequirementProperties.ts @@ -13,5 +13,5 @@ import * as Internal from './util/internal' * the CWL core specification. * */ -export interface ProcessRequirement { } - \ No newline at end of file +export interface ProcessRequirementProperties { + } \ No newline at end of file diff --git a/src/recordField.ts b/src/recordField.ts index 7b6b2a5..1cfb78b 100644 --- a/src/recordField.ts +++ b/src/recordField.ts @@ -20,9 +20,8 @@ import * as Internal from './util/internal' * * A field of a record. */ -export class RecordField extends Saveable implements Internal.Documented { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class RecordField extends Saveable implements Internal.RecordFieldProperties { + extensionFields?: Internal.Dictionary /** * The name of the field @@ -33,7 +32,7 @@ export class RecordField extends Saveable implements Internal.Documented { /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * The field type @@ -42,10 +41,9 @@ export class RecordField extends Saveable implements Internal.Documented { type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array - constructor ({extensionFields, loadingOptions, name, doc, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, doc: undefined | string | Array, name: string, type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array,}) { - super() + constructor ({loadingOptions, extensionFields, name, doc, type} : {loadingOptions?: LoadingOptions} & Internal.RecordFieldProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.name = name this.doc = doc this.type = type diff --git a/src/recordFieldProperties.ts b/src/recordFieldProperties.ts new file mode 100644 index 0000000..378bacf --- /dev/null +++ b/src/recordFieldProperties.ts @@ -0,0 +1,30 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/salad#RecordField + * + * A field of a record. + */ +export interface RecordFieldProperties extends Internal.DocumentedProperties { + + extensionFields?: Internal.Dictionary + + /** + * The name of the field + * + */ + name: string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * The field type + * + */ + type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array +} \ No newline at end of file diff --git a/src/recordSchema.ts b/src/recordSchema.ts index 96e19b3..f65dd72 100644 --- a/src/recordSchema.ts +++ b/src/recordSchema.ts @@ -18,14 +18,13 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/salad#RecordSchema */ -export class RecordSchema extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class RecordSchema extends Saveable implements Internal.RecordSchemaProperties { + extensionFields?: Internal.Dictionary /** * Defines the fields of the record. */ - fields: undefined | Array + fields?: undefined | Array /** * Must be `record` @@ -33,10 +32,9 @@ export class RecordSchema extends Saveable { type: string - constructor ({extensionFields, loadingOptions, fields, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, fields: undefined | Array, type: string,}) { - super() + constructor ({loadingOptions, extensionFields, fields, type} : {loadingOptions?: LoadingOptions} & Internal.RecordSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.fields = fields this.type = type } diff --git a/src/recordSchemaProperties.ts b/src/recordSchemaProperties.ts new file mode 100644 index 0000000..7a431a3 --- /dev/null +++ b/src/recordSchemaProperties.ts @@ -0,0 +1,21 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/salad#RecordSchema + */ +export interface RecordSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * Defines the fields of the record. + */ + fields?: undefined | Array + + /** + * Must be `record` + */ + type: string +} \ No newline at end of file diff --git a/src/resourceRequirement.ts b/src/resourceRequirement.ts index 9c3c245..74ce34f 100644 --- a/src/resourceRequirement.ts +++ b/src/resourceRequirement.ts @@ -45,9 +45,8 @@ import * as Internal from './util/internal' * If neither "min" nor "max" is specified for a resource, use the default values below. * */ -export class ResourceRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ResourceRequirement extends Saveable implements Internal.ResourceRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'ResourceRequirement' @@ -82,7 +81,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * next whole number. * */ - coresMin: undefined | number | string + coresMin?: undefined | number | string /** * Maximum reserved number of CPU cores. @@ -90,7 +89,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * See `coresMin` for discussion about fractional CPU requests. * */ - coresMax: undefined | number | string + coresMax?: undefined | number | string /** * Minimum reserved RAM in mebibytes (2**20) (default is 256) @@ -102,7 +101,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * non-zero integer. * */ - ramMin: undefined | number | string + ramMin?: undefined | number | string /** * Maximum reserved RAM in mebibytes (2**20) @@ -110,7 +109,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * See `ramMin` for discussion about fractional RAM requests. * */ - ramMax: undefined | number | string + ramMax?: undefined | number | string /** * Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) (default is 1024) @@ -122,7 +121,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * must be a non-zero integer. * */ - tmpdirMin: undefined | number | string + tmpdirMin?: undefined | number | string /** * Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) @@ -130,7 +129,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * See `tmpdirMin` for discussion about fractional storage requests. * */ - tmpdirMax: undefined | number | string + tmpdirMax?: undefined | number | string /** * Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) (default is 1024) @@ -142,7 +141,7 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * must be a non-zero integer. * */ - outdirMin: undefined | number | string + outdirMin?: undefined | number | string /** * Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) @@ -150,13 +149,12 @@ export class ResourceRequirement extends Saveable implements Internal.ProcessReq * See `outdirMin` for discussion about fractional storage requests. * */ - outdirMax: undefined | number | string + outdirMax?: undefined | number | string - constructor ({extensionFields, loadingOptions, class_, coresMin, coresMax, ramMin, ramMax, tmpdirMin, tmpdirMax, outdirMin, outdirMax} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, coresMin: undefined | number | string, coresMax: undefined | number | string, ramMin: undefined | number | string, ramMax: undefined | number | string, tmpdirMin: undefined | number | string, tmpdirMax: undefined | number | string, outdirMin: undefined | number | string, outdirMax: undefined | number | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, coresMin, coresMax, ramMin, ramMax, tmpdirMin, tmpdirMax, outdirMin, outdirMax} : {loadingOptions?: LoadingOptions} & Internal.ResourceRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.coresMin = coresMin this.coresMax = coresMax diff --git a/src/resourceRequirementProperties.ts b/src/resourceRequirementProperties.ts new file mode 100644 index 0000000..9c83a53 --- /dev/null +++ b/src/resourceRequirementProperties.ts @@ -0,0 +1,141 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ResourceRequirement + * + * Specify basic hardware resource requirements. + * + * "min" is the minimum amount of a resource that must be reserved to + * schedule a job. If "min" cannot be satisfied, the job should not + * be run. + * + * "max" is the maximum amount of a resource that the job shall be + * allocated. If a node has sufficient resources, multiple jobs may + * be scheduled on a single node provided each job's "max" resource + * requirements are met. If a job attempts to exceed its resource + * allocation, an implementation may deny additional resources, which + * may result in job failure. + * + * If both "min" and "max" are specified, an implementation may + * choose to allocate any amount between "min" and "max", with the + * actual allocation provided in the `runtime` object. + * + * If "min" is specified but "max" is not, then "max" == "min" + * If "max" is specified by "min" is not, then "min" == "max". + * + * It is an error if max < min. + * + * It is an error if the value of any of these fields is negative. + * + * If neither "min" nor "max" is specified for a resource, use the default values below. + * + */ +export interface ResourceRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'ResourceRequirement' + */ + class_: string + + /** + * Minimum reserved number of CPU cores (default is 1). + * + * May be a fractional value to indicate to a scheduling + * algorithm that one core can be allocated to multiple + * jobs. For example, a value of 0.25 indicates that up to 4 + * jobs may run in parallel on 1 core. A value of 1.25 means + * that up to 3 jobs can run on a 4 core system (4/1.25 ≈ 3). + * + * Processes can only share a core allocation if the sum of each + * of their `ramMax`, `tmpdirMax`, and `outdirMax` requests also + * do not exceed the capacity of the node. + * + * Processes sharing a core must have the same level of isolation + * (typically a container or VM) that they would normally. + * + * The reported number of CPU cores reserved for the process, + * which is available to expressions on the CommandLineTool as + * `runtime.cores`, must be a non-zero integer, and may be + * calculated by rounding up the cores request to the next whole + * number. + * + * Scheduling systems may allocate fractional CPU resources by + * setting quotas or scheduling weights. Scheduling systems that + * do not support fractional CPUs may round up the request to the + * next whole number. + * + */ + coresMin?: undefined | number | string + + /** + * Maximum reserved number of CPU cores. + * + * See `coresMin` for discussion about fractional CPU requests. + * + */ + coresMax?: undefined | number | string + + /** + * Minimum reserved RAM in mebibytes (2**20) (default is 256) + * + * May be a fractional value. If so, the actual RAM request must + * be rounded up to the next whole number. The reported amount of + * RAM reserved for the process, which is available to + * expressions on the CommandLineTool as `runtime.ram`, must be a + * non-zero integer. + * + */ + ramMin?: undefined | number | string + + /** + * Maximum reserved RAM in mebibytes (2**20) + * + * See `ramMin` for discussion about fractional RAM requests. + * + */ + ramMax?: undefined | number | string + + /** + * Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) (default is 1024) + * + * May be a fractional value. If so, the actual storage request + * must be rounded up to the next whole number. The reported + * amount of storage reserved for the process, which is available + * to expressions on the CommandLineTool as `runtime.tmpdirSize`, + * must be a non-zero integer. + * + */ + tmpdirMin?: undefined | number | string + + /** + * Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) + * + * See `tmpdirMin` for discussion about fractional storage requests. + * + */ + tmpdirMax?: undefined | number | string + + /** + * Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) (default is 1024) + * + * May be a fractional value. If so, the actual storage request + * must be rounded up to the next whole number. The reported + * amount of storage reserved for the process, which is available + * to expressions on the CommandLineTool as `runtime.outdirSize`, + * must be a non-zero integer. + * + */ + outdirMin?: undefined | number | string + + /** + * Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) + * + * See `outdirMin` for discussion about fractional storage requests. + * + */ + outdirMax?: undefined | number | string +} \ No newline at end of file diff --git a/src/scatterFeatureRequirement.ts b/src/scatterFeatureRequirement.ts index c64acaa..d09b5eb 100644 --- a/src/scatterFeatureRequirement.ts +++ b/src/scatterFeatureRequirement.ts @@ -22,9 +22,8 @@ import * as Internal from './util/internal' * `scatterMethod` fields of [WorkflowStep](#WorkflowStep). * */ -export class ScatterFeatureRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ScatterFeatureRequirement extends Saveable implements Internal.ScatterFeatureRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'ScatterFeatureRequirement' @@ -32,10 +31,9 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Proc class_: string - constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { - super() + constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.ScatterFeatureRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ } diff --git a/src/scatterFeatureRequirementProperties.ts b/src/scatterFeatureRequirementProperties.ts new file mode 100644 index 0000000..74ebb04 --- /dev/null +++ b/src/scatterFeatureRequirementProperties.ts @@ -0,0 +1,20 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ScatterFeatureRequirement + * + * Indicates that the workflow platform must support the `scatter` and + * `scatterMethod` fields of [WorkflowStep](#WorkflowStep). + * + */ +export interface ScatterFeatureRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'ScatterFeatureRequirement' + */ + class_: string +} \ No newline at end of file diff --git a/src/schemaDefRequirement.ts b/src/schemaDefRequirement.ts index 250d0fb..7523bb0 100644 --- a/src/schemaDefRequirement.ts +++ b/src/schemaDefRequirement.ts @@ -32,9 +32,8 @@ import * as Internal from './util/internal' * - A file can contain a list of type definitions * */ -export class SchemaDefRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class SchemaDefRequirement extends Saveable implements Internal.SchemaDefRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'SchemaDefRequirement' @@ -47,10 +46,9 @@ export class SchemaDefRequirement extends Saveable implements Internal.ProcessRe types: Array - constructor ({extensionFields, loadingOptions, class_, types} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, types: Array,}) { - super() + constructor ({loadingOptions, extensionFields, class_, types} : {loadingOptions?: LoadingOptions} & Internal.SchemaDefRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.types = types } diff --git a/src/schemaDefRequirementProperties.ts b/src/schemaDefRequirementProperties.ts new file mode 100644 index 0000000..655fbcb --- /dev/null +++ b/src/schemaDefRequirementProperties.ts @@ -0,0 +1,35 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#SchemaDefRequirement + * + * This field consists of an array of type definitions which must be used when + * interpreting the `inputs` and `outputs` fields. When a `type` field + * contains a IRI, the implementation must check if the type is defined in + * `schemaDefs` and use that definition. If the type is not found in + * `schemaDefs`, it is an error. The entries in `schemaDefs` must be + * processed in the order listed such that later schema definitions may refer + * to earlier schema definitions. + * + * - **Type definitions are allowed for `enum` and `record` types only.** + * - Type definitions may be shared by defining them in a file and then + * `$include`-ing them in the `types` field. + * - A file can contain a list of type definitions + * + */ +export interface SchemaDefRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'SchemaDefRequirement' + */ + class_: string + + /** + * The list of type definitions. + */ + types: Array +} \ No newline at end of file diff --git a/src/secondaryFileSchema.ts b/src/secondaryFileSchema.ts index 64680f5..0c4e848 100644 --- a/src/secondaryFileSchema.ts +++ b/src/secondaryFileSchema.ts @@ -33,9 +33,8 @@ import * as Internal from './util/internal' * in the Schema Salad specification. * */ -export class SecondaryFileSchema extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class SecondaryFileSchema extends Saveable implements Internal.SecondaryFileSchemaProperties { + extensionFields?: Internal.Dictionary /** * Provides a pattern or expression specifying files or directories that @@ -98,13 +97,12 @@ export class SecondaryFileSchema extends Saveable { * input and `false` for secondary files on output. * */ - required: undefined | boolean | string + required?: undefined | boolean | string - constructor ({extensionFields, loadingOptions, pattern, required} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, pattern: string, required: undefined | boolean | string,}) { - super() + constructor ({loadingOptions, extensionFields, pattern, required} : {loadingOptions?: LoadingOptions} & Internal.SecondaryFileSchemaProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.pattern = pattern this.required = required } diff --git a/src/secondaryFileSchemaProperties.ts b/src/secondaryFileSchemaProperties.ts new file mode 100644 index 0000000..2bba250 --- /dev/null +++ b/src/secondaryFileSchemaProperties.ts @@ -0,0 +1,89 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#SecondaryFileSchema + * + * Secondary files are specified using the following micro-DSL for secondary files: + * + * * If the value is a string, it is transformed to an object with two fields + * `pattern` and `required` + * * By default, the value of `required` is `null` + * (this indicates default behavior, which may be based on the context) + * * If the value ends with a question mark `?` the question mark is + * stripped off and the value of the field `required` is set to `False` + * * The remaining value is assigned to the field `pattern` + * + * For implementation details and examples, please see + * [this section](SchemaSalad.html#Domain_Specific_Language_for_secondary_files) + * in the Schema Salad specification. + * + */ +export interface SecondaryFileSchemaProperties { + + extensionFields?: Internal.Dictionary + + /** + * Provides a pattern or expression specifying files or directories that + * should be included alongside the primary file. + * + * If the value is an expression, the value of `self` in the + * expression must be the primary input or output File object to + * which this binding applies. The `basename`, `nameroot` and + * `nameext` fields must be present in `self`. For + * `CommandLineTool` inputs the `location` field must also be + * present. For `CommandLineTool` outputs the `path` field must + * also be present. If secondary files were included on an input + * File object as part of the Process invocation, they must also + * be present in `secondaryFiles` on `self`. + * + * The expression must return either: a filename string relative + * to the path to the primary File, a File or Directory object + * (`class: File` or `class: Directory`) with either `location` + * (for inputs) or `path` (for outputs) and `basename` fields + * set, or an array consisting of strings or File or Directory + * objects as previously described. + * + * It is legal to use `location` from a File or Directory object + * passed in as input, including `location` from secondary files + * on `self`. If an expression returns a File object with the + * same `location` but a different `basename` as a secondary file + * that was passed in, the expression result takes precedence. + * Setting the basename with an expression this way affects the + * `path` where the secondary file will be staged to in the + * CommandLineTool. + * + * The expression may return "null" in which case there is no + * secondary file from that expression. + * + * To work on non-filename-preserving storage systems, portable + * tool descriptions should treat `location` as an opaque + * identifier and avoid constructing new values from `location`, + * but should construct relative references using `basename` or + * `nameroot` instead, or propagate `location` from defined inputs. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + pattern: string + + /** + * An implementation must not fail workflow execution if `required` is + * set to `false` and the expected secondary file does not exist. + * Default value for `required` field is `true` for secondary files on + * input and `false` for secondary files on output. + * + */ + required?: undefined | boolean | string +} \ No newline at end of file diff --git a/src/shellCommandRequirement.ts b/src/shellCommandRequirement.ts index f30fcca..f182eb7 100644 --- a/src/shellCommandRequirement.ts +++ b/src/shellCommandRequirement.ts @@ -27,9 +27,8 @@ import * as Internal from './util/internal' * the use of shell metacharacters such as `|` for pipes. * */ -export class ShellCommandRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ShellCommandRequirement extends Saveable implements Internal.ShellCommandRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'ShellCommandRequirement' @@ -37,10 +36,9 @@ export class ShellCommandRequirement extends Saveable implements Internal.Proces class_: string - constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { - super() + constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.ShellCommandRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ } diff --git a/src/shellCommandRequirementProperties.ts b/src/shellCommandRequirementProperties.ts new file mode 100644 index 0000000..7f965d1 --- /dev/null +++ b/src/shellCommandRequirementProperties.ts @@ -0,0 +1,25 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ShellCommandRequirement + * + * Modify the behavior of CommandLineTool to generate a single string + * containing a shell command line. Each item in the argument list must be + * joined into a string separated by single spaces and quoted to prevent + * intepretation by the shell, unless `CommandLineBinding` for that argument + * contains `shellQuote: false`. If `shellQuote: false` is specified, the + * argument is joined into the command string without quoting, which allows + * the use of shell metacharacters such as `|` for pipes. + * + */ +export interface ShellCommandRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'ShellCommandRequirement' + */ + class_: string +} \ No newline at end of file diff --git a/src/sink.ts b/src/sink.ts deleted file mode 100644 index 9cdbb37..0000000 --- a/src/sink.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import * as Internal from './util/internal' - - -/** - * Auto-generated interface for https://w3id.org/cwl/cwl#Sink - */ -export interface Sink { } - \ No newline at end of file diff --git a/src/sinkProperties.ts b/src/sinkProperties.ts new file mode 100644 index 0000000..7ff9258 --- /dev/null +++ b/src/sinkProperties.ts @@ -0,0 +1,29 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Sink + */ +export interface SinkProperties { + + /** + * Specifies one or more workflow parameters that will provide input to + * the underlying step parameter. + * + */ + source?: undefined | string | Array + + /** + * The method to use to merge multiple inbound links into a single array. + * If not specified, the default method is "merge_nested". + * + */ + linkMerge?: undefined | string + + /** + * The method to use to choose non-null elements among multiple sources. + * + */ + pickValue?: undefined | string +} \ No newline at end of file diff --git a/src/softwarePackage.ts b/src/softwarePackage.ts index ca98140..d93204e 100644 --- a/src/softwarePackage.ts +++ b/src/softwarePackage.ts @@ -18,9 +18,8 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#SoftwarePackage */ -export class SoftwarePackage extends Saveable { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class SoftwarePackage extends Saveable implements Internal.SoftwarePackageProperties { + extensionFields?: Internal.Dictionary /** * The name of the software to be made available. If the name is @@ -35,7 +34,7 @@ export class SoftwarePackage extends Saveable { * compatible. * */ - version: undefined | Array + version?: undefined | Array /** * One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s @@ -81,13 +80,12 @@ export class SoftwarePackage extends Saveable { * clutter. * */ - specs: undefined | Array + specs?: undefined | Array - constructor ({extensionFields, loadingOptions, package_, version, specs} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, package_: string, version: undefined | Array, specs: undefined | Array,}) { - super() + constructor ({loadingOptions, extensionFields, package_, version, specs} : {loadingOptions?: LoadingOptions} & Internal.SoftwarePackageProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.package_ = package_ this.version = version this.specs = specs diff --git a/src/softwarePackageProperties.ts b/src/softwarePackageProperties.ts new file mode 100644 index 0000000..a78216b --- /dev/null +++ b/src/softwarePackageProperties.ts @@ -0,0 +1,72 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#SoftwarePackage + */ +export interface SoftwarePackageProperties { + + extensionFields?: Internal.Dictionary + + /** + * The name of the software to be made available. If the name is + * common, inconsistent, or otherwise ambiguous it should be combined with + * one or more identifiers in the `specs` field. + * + */ + package_: string + + /** + * The (optional) versions of the software that are known to be + * compatible. + * + */ + version?: undefined | Array + + /** + * One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s + * identifying resources for installing or enabling the software named in + * the `package` field. Implementations may provide resolvers which map + * these software identifer IRIs to some configuration action; or they can + * use only the name from the `package` field on a best effort basis. + * + * For example, the IRI https://packages.debian.org/bowtie could + * be resolved with `apt-get install bowtie`. The IRI + * https://anaconda.org/bioconda/bowtie could be resolved with `conda + * install -c bioconda bowtie`. + * + * IRIs can also be system independent and used to map to a specific + * software installation or selection mechanism. + * Using [RRID](https://www.identifiers.org/rrid/) as an example: + * https://identifiers.org/rrid/RRID:SCR_005476 + * could be fulfilled using the above mentioned Debian or bioconda + * package, a local installation managed by [Environment Modules](http://modules.sourceforge.net/), + * or any other mechanism the platform chooses. IRIs can also be from + * identifer sources that are discipline specific yet still system + * independent. As an example, the equivalent [ELIXIR Tools and Data + * Service Registry](https://bio.tools) IRI to the previous RRID example is + * https://bio.tools/tool/bowtie2/version/2.2.8. + * If supported by a given registry, implementations are encouraged to + * query these system independent sofware identifier IRIs directly for + * links to packaging systems. + * + * A site specific IRI can be listed as well. For example, an academic + * computing cluster using Environment Modules could list the IRI + * `https://hpc.example.edu/modules/bowtie-tbb/1.22` to indicate that + * `module load bowtie-tbb/1.1.2` should be executed to make available + * `bowtie` version 1.1.2 compiled with the TBB library prior to running + * the accompanying Workflow or CommandLineTool. Note that the example IRI + * is specific to a particular institution and computing environment as + * the Environment Modules system does not have a common namespace or + * standardized naming convention. + * + * This last example is the least portable and should only be used if + * mechanisms based off of the `package` field or more generic IRIs are + * unavailable or unsuitable. While harmless to other sites, site specific + * software IRIs should be left out of shared CWL descriptions to avoid + * clutter. + * + */ + specs?: undefined | Array +} \ No newline at end of file diff --git a/src/softwareRequirement.ts b/src/softwareRequirement.ts index 1d55ac3..232be8f 100644 --- a/src/softwareRequirement.ts +++ b/src/softwareRequirement.ts @@ -22,9 +22,8 @@ import * as Internal from './util/internal' * the defined process. * */ -export class SoftwareRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class SoftwareRequirement extends Saveable implements Internal.SoftwareRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'SoftwareRequirement' @@ -37,10 +36,9 @@ export class SoftwareRequirement extends Saveable implements Internal.ProcessReq packages: Array - constructor ({extensionFields, loadingOptions, class_, packages} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, packages: Array,}) { - super() + constructor ({loadingOptions, extensionFields, class_, packages} : {loadingOptions?: LoadingOptions} & Internal.SoftwareRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.packages = packages } diff --git a/src/softwareRequirementProperties.ts b/src/softwareRequirementProperties.ts new file mode 100644 index 0000000..bb078df --- /dev/null +++ b/src/softwareRequirementProperties.ts @@ -0,0 +1,25 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#SoftwareRequirement + * + * A list of software packages that should be configured in the environment of + * the defined process. + * + */ +export interface SoftwareRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'SoftwareRequirement' + */ + class_: string + + /** + * The list of software to be configured. + */ + packages: Array +} \ No newline at end of file diff --git a/src/stepInputExpressionRequirement.ts b/src/stepInputExpressionRequirement.ts index ce6dcbe..9b3afa6 100644 --- a/src/stepInputExpressionRequirement.ts +++ b/src/stepInputExpressionRequirement.ts @@ -22,9 +22,8 @@ import * as Internal from './util/internal' * of [WorkflowStepInput](#WorkflowStepInput). * */ -export class StepInputExpressionRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class StepInputExpressionRequirement extends Saveable implements Internal.StepInputExpressionRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'StepInputExpressionRequirement' @@ -32,10 +31,9 @@ export class StepInputExpressionRequirement extends Saveable implements Internal class_: string - constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { - super() + constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.StepInputExpressionRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ } diff --git a/src/stepInputExpressionRequirementProperties.ts b/src/stepInputExpressionRequirementProperties.ts new file mode 100644 index 0000000..8a9d735 --- /dev/null +++ b/src/stepInputExpressionRequirementProperties.ts @@ -0,0 +1,20 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#StepInputExpressionRequirement + * + * Indicate that the workflow platform must support the `valueFrom` field + * of [WorkflowStepInput](#WorkflowStepInput). + * + */ +export interface StepInputExpressionRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'StepInputExpressionRequirement' + */ + class_: string +} \ No newline at end of file diff --git a/src/subworkflowFeatureRequirement.ts b/src/subworkflowFeatureRequirement.ts index 89903a5..5770adf 100644 --- a/src/subworkflowFeatureRequirement.ts +++ b/src/subworkflowFeatureRequirement.ts @@ -22,9 +22,8 @@ import * as Internal from './util/internal' * the `run` field of [WorkflowStep](#WorkflowStep). * */ -export class SubworkflowFeatureRequirement extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class SubworkflowFeatureRequirement extends Saveable implements Internal.SubworkflowFeatureRequirementProperties { + extensionFields?: Internal.Dictionary /** * Always 'SubworkflowFeatureRequirement' @@ -32,10 +31,9 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. class_: string - constructor ({extensionFields, loadingOptions, class_} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string,}) { - super() + constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.SubworkflowFeatureRequirementProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ } diff --git a/src/subworkflowFeatureRequirementProperties.ts b/src/subworkflowFeatureRequirementProperties.ts new file mode 100644 index 0000000..bf8ce81 --- /dev/null +++ b/src/subworkflowFeatureRequirementProperties.ts @@ -0,0 +1,20 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement + * + * Indicates that the workflow platform must support nested workflows in + * the `run` field of [WorkflowStep](#WorkflowStep). + * + */ +export interface SubworkflowFeatureRequirementProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'SubworkflowFeatureRequirement' + */ + class_: string +} \ No newline at end of file diff --git a/src/toolTimeLimit.ts b/src/toolTimeLimit.ts index 71fa728..ec7dc62 100644 --- a/src/toolTimeLimit.ts +++ b/src/toolTimeLimit.ts @@ -27,9 +27,8 @@ import * as Internal from './util/internal' * wall-time for the execution of the command line itself. * */ -export class ToolTimeLimit extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class ToolTimeLimit extends Saveable implements Internal.ToolTimeLimitProperties { + extensionFields?: Internal.Dictionary /** * Always 'ToolTimeLimit' @@ -44,10 +43,9 @@ export class ToolTimeLimit extends Saveable implements Internal.ProcessRequireme timelimit: number | string - constructor ({extensionFields, loadingOptions, class_, timelimit} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, timelimit: number | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, timelimit} : {loadingOptions?: LoadingOptions} & Internal.ToolTimeLimitProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.timelimit = timelimit } diff --git a/src/toolTimeLimitProperties.ts b/src/toolTimeLimitProperties.ts new file mode 100644 index 0000000..7f177c3 --- /dev/null +++ b/src/toolTimeLimitProperties.ts @@ -0,0 +1,32 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#ToolTimeLimit + * + * Set an upper limit on the execution time of a CommandLineTool. + * A CommandLineTool whose execution duration exceeds the time + * limit may be preemptively terminated and considered failed. + * May also be used by batch systems to make scheduling decisions. + * The execution duration excludes external operations, such as + * staging of files, pulling a docker image etc, and only counts + * wall-time for the execution of the command line itself. + * + */ +export interface ToolTimeLimitProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'ToolTimeLimit' + */ + class_: string + + /** + * The time limit, in seconds. A time limit of zero means no + * time limit. Negative time limits are an error. + * + */ + timelimit: number | string +} \ No newline at end of file diff --git a/src/util/internal.ts b/src/util/internal.ts index be74205..cc3ef1c 100644 --- a/src/util/internal.ts +++ b/src/util/internal.ts @@ -19,82 +19,143 @@ export * from './loaders/unionLoader' export * from './loaders/uriLoader' export * from './validationException' export * from './vocabs' -export * from '../documented' +export * from '../documentedProperties' +export * from '../recordFieldProperties' export * from '../recordField' +export * from '../recordSchemaProperties' export * from '../recordSchema' +export * from '../enumSchemaProperties' export * from '../enumSchema' +export * from '../arraySchemaProperties' export * from '../arraySchema' +export * from '../fileProperties' export * from '../file' +export * from '../directoryProperties' export * from '../directory' -export * from '../labeled' -export * from '../identified' -export * from '../loadContents' -export * from '../fieldBase' -export * from '../inputFormat' -export * from '../outputFormat' -export * from '../parameter' +export * from '../labeledProperties' +export * from '../identifiedProperties' +export * from '../loadContentsProperties' +export * from '../fieldBaseProperties' +export * from '../inputFormatProperties' +export * from '../outputFormatProperties' +export * from '../parameterProperties' +export * from '../inputBindingProperties' export * from '../inputBinding' -export * from '../iOSchema' -export * from '../inputSchema' -export * from '../outputSchema' +export * from '../iOSchemaProperties' +export * from '../inputSchemaProperties' +export * from '../outputSchemaProperties' +export * from '../inputRecordFieldProperties' export * from '../inputRecordField' +export * from '../inputRecordSchemaProperties' export * from '../inputRecordSchema' +export * from '../inputEnumSchemaProperties' export * from '../inputEnumSchema' +export * from '../inputArraySchemaProperties' export * from '../inputArraySchema' +export * from '../outputRecordFieldProperties' export * from '../outputRecordField' +export * from '../outputRecordSchemaProperties' export * from '../outputRecordSchema' +export * from '../outputEnumSchemaProperties' export * from '../outputEnumSchema' +export * from '../outputArraySchemaProperties' export * from '../outputArraySchema' -export * from '../inputParameter' -export * from '../outputParameter' -export * from '../processRequirement' -export * from '../process' +export * from '../inputParameterProperties' +export * from '../outputParameterProperties' +export * from '../processRequirementProperties' +export * from '../processProperties' +export * from '../inlineJavascriptRequirementProperties' export * from '../inlineJavascriptRequirement' -export * from '../commandInputSchema' +export * from '../commandInputSchemaProperties' +export * from '../schemaDefRequirementProperties' export * from '../schemaDefRequirement' +export * from '../secondaryFileSchemaProperties' export * from '../secondaryFileSchema' +export * from '../loadListingRequirementProperties' export * from '../loadListingRequirement' +export * from '../environmentDefProperties' export * from '../environmentDef' +export * from '../commandLineBindingProperties' export * from '../commandLineBinding' +export * from '../commandOutputBindingProperties' export * from '../commandOutputBinding' +export * from '../commandLineBindableProperties' export * from '../commandLineBindable' +export * from '../commandInputRecordFieldProperties' export * from '../commandInputRecordField' +export * from '../commandInputRecordSchemaProperties' export * from '../commandInputRecordSchema' +export * from '../commandInputEnumSchemaProperties' export * from '../commandInputEnumSchema' +export * from '../commandInputArraySchemaProperties' export * from '../commandInputArraySchema' +export * from '../commandOutputRecordFieldProperties' export * from '../commandOutputRecordField' +export * from '../commandOutputRecordSchemaProperties' export * from '../commandOutputRecordSchema' +export * from '../commandOutputEnumSchemaProperties' export * from '../commandOutputEnumSchema' +export * from '../commandOutputArraySchemaProperties' export * from '../commandOutputArraySchema' +export * from '../commandInputParameterProperties' export * from '../commandInputParameter' +export * from '../commandOutputParameterProperties' export * from '../commandOutputParameter' +export * from '../commandLineToolProperties' export * from '../commandLineTool' +export * from '../dockerRequirementProperties' export * from '../dockerRequirement' +export * from '../softwareRequirementProperties' export * from '../softwareRequirement' +export * from '../softwarePackageProperties' export * from '../softwarePackage' +export * from '../direntProperties' export * from '../dirent' +export * from '../initialWorkDirRequirementProperties' export * from '../initialWorkDirRequirement' +export * from '../envVarRequirementProperties' export * from '../envVarRequirement' +export * from '../shellCommandRequirementProperties' export * from '../shellCommandRequirement' +export * from '../resourceRequirementProperties' export * from '../resourceRequirement' +export * from '../workReuseProperties' export * from '../workReuse' +export * from '../networkAccessProperties' export * from '../networkAccess' +export * from '../inplaceUpdateRequirementProperties' export * from '../inplaceUpdateRequirement' +export * from '../toolTimeLimitProperties' export * from '../toolTimeLimit' +export * from '../expressionToolOutputParameterProperties' export * from '../expressionToolOutputParameter' +export * from '../workflowInputParameterProperties' export * from '../workflowInputParameter' +export * from '../expressionToolProperties' export * from '../expressionTool' +export * from '../workflowOutputParameterProperties' export * from '../workflowOutputParameter' -export * from '../sink' +export * from '../sinkProperties' +export * from '../workflowStepInputProperties' export * from '../workflowStepInput' +export * from '../workflowStepOutputProperties' export * from '../workflowStepOutput' +export * from '../workflowStepProperties' export * from '../workflowStep' +export * from '../workflowProperties' export * from '../workflow' +export * from '../subworkflowFeatureRequirementProperties' export * from '../subworkflowFeatureRequirement' +export * from '../scatterFeatureRequirementProperties' export * from '../scatterFeatureRequirement' +export * from '../multipleInputFeatureRequirementProperties' export * from '../multipleInputFeatureRequirement' +export * from '../stepInputExpressionRequirementProperties' export * from '../stepInputExpressionRequirement' +export * from '../operationInputParameterProperties' export * from '../operationInputParameter' +export * from '../operationOutputParameterProperties' export * from '../operationOutputParameter' +export * from '../operationProperties' export * from '../operation' export * as LoaderInstances from './loaderInstances' diff --git a/src/util/loaderInstances.ts b/src/util/loaderInstances.ts index 8372905..c5202a3 100644 --- a/src/util/loaderInstances.ts +++ b/src/util/loaderInstances.ts @@ -11,83 +11,144 @@ import { _TypeDSLLoader, _SecondaryDSLLoader, TypeGuards, - Documented, + DocumentedProperties, + RecordFieldProperties, RecordField, + RecordSchemaProperties, RecordSchema, + EnumSchemaProperties, EnumSchema, + ArraySchemaProperties, ArraySchema, + FileProperties, File, + DirectoryProperties, Directory, - Labeled, - Identified, - LoadContents, - FieldBase, - InputFormat, - OutputFormat, - Parameter, + LabeledProperties, + IdentifiedProperties, + LoadContentsProperties, + FieldBaseProperties, + InputFormatProperties, + OutputFormatProperties, + ParameterProperties, + InputBindingProperties, InputBinding, - IOSchema, - InputSchema, - OutputSchema, + IOSchemaProperties, + InputSchemaProperties, + OutputSchemaProperties, + InputRecordFieldProperties, InputRecordField, + InputRecordSchemaProperties, InputRecordSchema, + InputEnumSchemaProperties, InputEnumSchema, + InputArraySchemaProperties, InputArraySchema, + OutputRecordFieldProperties, OutputRecordField, + OutputRecordSchemaProperties, OutputRecordSchema, + OutputEnumSchemaProperties, OutputEnumSchema, + OutputArraySchemaProperties, OutputArraySchema, - InputParameter, - OutputParameter, - ProcessRequirement, - Process, + InputParameterProperties, + OutputParameterProperties, + ProcessRequirementProperties, + ProcessProperties, + InlineJavascriptRequirementProperties, InlineJavascriptRequirement, - CommandInputSchema, + CommandInputSchemaProperties, + SchemaDefRequirementProperties, SchemaDefRequirement, + SecondaryFileSchemaProperties, SecondaryFileSchema, + LoadListingRequirementProperties, LoadListingRequirement, + EnvironmentDefProperties, EnvironmentDef, + CommandLineBindingProperties, CommandLineBinding, + CommandOutputBindingProperties, CommandOutputBinding, + CommandLineBindableProperties, CommandLineBindable, + CommandInputRecordFieldProperties, CommandInputRecordField, + CommandInputRecordSchemaProperties, CommandInputRecordSchema, + CommandInputEnumSchemaProperties, CommandInputEnumSchema, + CommandInputArraySchemaProperties, CommandInputArraySchema, + CommandOutputRecordFieldProperties, CommandOutputRecordField, + CommandOutputRecordSchemaProperties, CommandOutputRecordSchema, + CommandOutputEnumSchemaProperties, CommandOutputEnumSchema, + CommandOutputArraySchemaProperties, CommandOutputArraySchema, + CommandInputParameterProperties, CommandInputParameter, + CommandOutputParameterProperties, CommandOutputParameter, + CommandLineToolProperties, CommandLineTool, + DockerRequirementProperties, DockerRequirement, + SoftwareRequirementProperties, SoftwareRequirement, + SoftwarePackageProperties, SoftwarePackage, + DirentProperties, Dirent, + InitialWorkDirRequirementProperties, InitialWorkDirRequirement, + EnvVarRequirementProperties, EnvVarRequirement, + ShellCommandRequirementProperties, ShellCommandRequirement, + ResourceRequirementProperties, ResourceRequirement, + WorkReuseProperties, WorkReuse, + NetworkAccessProperties, NetworkAccess, + InplaceUpdateRequirementProperties, InplaceUpdateRequirement, + ToolTimeLimitProperties, ToolTimeLimit, + ExpressionToolOutputParameterProperties, ExpressionToolOutputParameter, + WorkflowInputParameterProperties, WorkflowInputParameter, + ExpressionToolProperties, ExpressionTool, + WorkflowOutputParameterProperties, WorkflowOutputParameter, - Sink, + SinkProperties, + WorkflowStepInputProperties, WorkflowStepInput, + WorkflowStepOutputProperties, WorkflowStepOutput, + WorkflowStepProperties, WorkflowStep, + WorkflowProperties, Workflow, + SubworkflowFeatureRequirementProperties, SubworkflowFeatureRequirement, + ScatterFeatureRequirementProperties, ScatterFeatureRequirement, + MultipleInputFeatureRequirementProperties, MultipleInputFeatureRequirement, + StepInputExpressionRequirementProperties, StepInputExpressionRequirement, + OperationInputParameterProperties, OperationInputParameter, + OperationOutputParameterProperties, OperationOutputParameter, + OperationProperties, Operation } from './internal' diff --git a/src/util/loaders/loader.ts b/src/util/loaders/loader.ts index 5cb263d..249db5f 100644 --- a/src/util/loaders/loader.ts +++ b/src/util/loaders/loader.ts @@ -40,7 +40,6 @@ export function expandUrl (url: string, baseUrl: string, loadingOptions: Loading const split = URI.parse(url) if ((split.scheme != null && ['http', 'https', 'file'].includes(split.scheme)) || url.startsWith('$(') || url.startsWith('${')) { - throw Error('not implemented') } else if (scopedId && split.fragment === undefined) { const splitbase = URI.parse(baseUrl) let frg = '' diff --git a/src/util/saveable.ts b/src/util/saveable.ts index 16d80db..6914738 100644 --- a/src/util/saveable.ts +++ b/src/util/saveable.ts @@ -4,6 +4,10 @@ import path from 'path' // eslint-disable-next-line @typescript-eslint/no-extraneous-class export abstract class Saveable { + loadingOptions: LoadingOptions + constructor(loadingOptions?: LoadingOptions) { + this.loadingOptions = loadingOptions ?? new LoadingOptions({}) + } static async fromDoc (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string): Promise { throw new Error('Not Implemented') } diff --git a/src/workReuse.ts b/src/workReuse.ts index bc12c2b..1094cf7 100644 --- a/src/workReuse.ts +++ b/src/workReuse.ts @@ -29,9 +29,8 @@ import * as Internal from './util/internal' * is enabled by default. * */ -export class WorkReuse extends Saveable implements Internal.ProcessRequirement { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class WorkReuse extends Saveable implements Internal.WorkReuseProperties { + extensionFields?: Internal.Dictionary /** * Always 'WorkReuse' @@ -40,10 +39,9 @@ export class WorkReuse extends Saveable implements Internal.ProcessRequirement { enableReuse: boolean | string - constructor ({extensionFields, loadingOptions, class_, enableReuse} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, class_: string, enableReuse: boolean | string,}) { - super() + constructor ({loadingOptions, extensionFields, class_, enableReuse} : {loadingOptions?: LoadingOptions} & Internal.WorkReuseProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.class_ = class_ this.enableReuse = enableReuse } diff --git a/src/workReuseProperties.ts b/src/workReuseProperties.ts new file mode 100644 index 0000000..821eb00 --- /dev/null +++ b/src/workReuseProperties.ts @@ -0,0 +1,28 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#WorkReuse + * + * For implementations that support reusing output from past work (on + * the assumption that same code and same input produce same + * results), control whether to enable or disable the reuse behavior + * for a particular tool or step (to accomodate situations where that + * assumption is incorrect). A reused step is not executed but + * instead returns the same output as the original execution. + * + * If `WorkReuse` is not specified, correct tools should assume it + * is enabled by default. + * + */ +export interface WorkReuseProperties extends Internal.ProcessRequirementProperties { + + extensionFields?: Internal.Dictionary + + /** + * Always 'WorkReuse' + */ + class_: string + enableReuse: boolean | string +} \ No newline at end of file diff --git a/src/workflow.ts b/src/workflow.ts index 6585c38..477ed0a 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -71,25 +71,24 @@ import * as Internal from './util/internal' * workflow semantics. * */ -export class Workflow extends Saveable implements Internal.Process { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class Workflow extends Saveable implements Internal.WorkflowProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string class_: string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Defines the input parameters of the process. The process is ready to @@ -123,7 +122,7 @@ export class Workflow extends Saveable implements Internal.Process { * unless overridden at user option. * */ - requirements: undefined | Array + requirements?: undefined | Array /** * Declares hints applying to either the runtime environment or the @@ -132,14 +131,14 @@ export class Workflow extends Saveable implements Internal.Process { * the implementation may report a warning. * */ - hints: undefined | Array + hints?: undefined | Array /** * CWL document version. Always required at the document root. Not * required for a Process embedded inside another Process. * */ - cwlVersion: undefined | string + cwlVersion?: undefined | string /** * An identifier for the type of computational operation, of this Process. @@ -157,7 +156,7 @@ export class Workflow extends Saveable implements Internal.Process { * [Split read mapping](http://edamontology.org/operation_3199). * */ - intent: undefined | Array + intent?: undefined | Array /** * The individual steps that make up the workflow. Each step is executed when all of its @@ -169,10 +168,9 @@ export class Workflow extends Saveable implements Internal.Process { steps: Array - constructor ({extensionFields, loadingOptions, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, steps} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, inputs: Array, outputs: Array, requirements: undefined | Array, hints: undefined | Array, cwlVersion: undefined | string, intent: undefined | Array, class_: string, steps: Array,}) { - super() + constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, steps} : {loadingOptions?: LoadingOptions} & Internal.WorkflowProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.class_ = class_ this.label = label diff --git a/src/workflowInputParameter.ts b/src/workflowInputParameter.ts index 7327b9d..127c840 100644 --- a/src/workflowInputParameter.ts +++ b/src/workflowInputParameter.ts @@ -18,19 +18,18 @@ import * as Internal from './util/internal' /** * Auto-generated class implementation for https://w3id.org/cwl/cwl#WorkflowInputParameter */ -export class WorkflowInputParameter extends Saveable implements Internal.InputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class WorkflowInputParameter extends Saveable implements Internal.WorkflowInputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -76,7 +75,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -87,12 +86,12 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -103,7 +102,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * available, file formats may be tested by exact match. * */ - format: undefined | string | Array + format?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -116,7 +115,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -131,7 +130,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string /** * The default value to use for this parameter if the parameter is missing @@ -140,7 +139,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * (e.g. dependent `valueFrom` fields). * */ - default_: undefined | any + default_?: undefined | any /** * Specify valid types of data that may be assigned to this parameter. @@ -153,13 +152,12 @@ export class WorkflowInputParameter extends Saveable implements Internal.InputPa * CWL v2.0. Use `WorkflowInputParameter.loadContents` instead. * */ - inputBinding: undefined | Internal.InputBinding + inputBinding?: undefined | Internal.InputBinding - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type, inputBinding} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string | Array, loadContents: undefined | boolean, loadListing: undefined | string, default_: undefined | any, type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array, inputBinding: undefined | Internal.InputBinding,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type, inputBinding} : {loadingOptions?: LoadingOptions} & Internal.WorkflowInputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/workflowInputParameterProperties.ts b/src/workflowInputParameterProperties.ts new file mode 100644 index 0000000..5600d62 --- /dev/null +++ b/src/workflowInputParameterProperties.ts @@ -0,0 +1,144 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#WorkflowInputParameter + */ +export interface WorkflowInputParameterProperties extends Internal.InputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This must be one or more IRIs of concept nodes + * that represents file formats which are allowed as input to this + * parameter, preferrably defined within an ontology. If no ontology is + * available, file formats may be tested by exact match. + * + */ + format?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * The default value to use for this parameter if the parameter is missing + * from the input object, or if the value of the parameter in the input + * object is `null`. Default values are applied before evaluating expressions + * (e.g. dependent `valueFrom` fields). + * + */ + default_?: undefined | any + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + + /** + * Deprecated. Preserved for v1.0 backwards compatability. Will be removed in + * CWL v2.0. Use `WorkflowInputParameter.loadContents` instead. + * + */ + inputBinding?: undefined | Internal.InputBinding +} \ No newline at end of file diff --git a/src/workflowOutputParameter.ts b/src/workflowOutputParameter.ts index 470696f..54a82e6 100644 --- a/src/workflowOutputParameter.ts +++ b/src/workflowOutputParameter.ts @@ -27,19 +27,18 @@ import * as Internal from './util/internal' * `linkMerge` and `pickValue`. * */ -export class WorkflowOutputParameter extends Saveable implements Internal.OutputParameter { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class WorkflowOutputParameter extends Saveable implements Internal.WorkflowOutputParameterProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -85,7 +84,7 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output * 3. Append the remainder of the string to the end of the file path. * */ - secondaryFiles: undefined | Internal.SecondaryFileSchema | Array + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -96,12 +95,12 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output * pipe. Default: `false`. * */ - streamable: undefined | boolean + streamable?: undefined | boolean /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Only valid when `type: File` or is an array of `items: File`. @@ -110,27 +109,27 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output * File object. * */ - format: undefined | string + format?: undefined | string /** * Specifies one or more workflow parameters that supply the value of to * the output parameter. * */ - outputSource: undefined | string | Array + outputSource?: undefined | string | Array /** * The method to use to merge multiple sources into a single array. * If not specified, the default method is "merge_nested". * */ - linkMerge: undefined | string + linkMerge?: undefined | string /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue: undefined | string + pickValue?: undefined | string /** * Specify valid types of data that may be assigned to this parameter. @@ -139,10 +138,9 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Output type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array - constructor ({extensionFields, loadingOptions, id, label, secondaryFiles, streamable, doc, format, outputSource, linkMerge, pickValue, type} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, label: undefined | string, secondaryFiles: undefined | Internal.SecondaryFileSchema | Array, streamable: undefined | boolean, doc: undefined | string | Array, id: undefined | string, format: undefined | string, outputSource: undefined | string | Array, linkMerge: undefined | string, pickValue: undefined | string, type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, outputSource, linkMerge, pickValue, type} : {loadingOptions?: LoadingOptions} & Internal.WorkflowOutputParameterProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.secondaryFiles = secondaryFiles diff --git a/src/workflowOutputParameterProperties.ts b/src/workflowOutputParameterProperties.ts new file mode 100644 index 0000000..1a0d041 --- /dev/null +++ b/src/workflowOutputParameterProperties.ts @@ -0,0 +1,127 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#WorkflowOutputParameter + * + * Describe an output parameter of a workflow. The parameter must be + * connected to one or more parameters defined in the workflow that + * will provide the value of the output parameter. It is legal to + * connect a WorkflowInputParameter to a WorkflowOutputParameter. + * + * See [WorkflowStepInput](#WorkflowStepInput) for discussion of + * `linkMerge` and `pickValue`. + * + */ +export interface WorkflowOutputParameterProperties extends Internal.OutputParameterProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * Provides a pattern or expression specifying files or + * directories that should be included alongside the primary + * file. Secondary files may be required or optional. When not + * explicitly specified, secondary files specified for `inputs` + * are required and `outputs` are optional. An implementation + * must include matching Files and Directories in the + * `secondaryFiles` property of the primary file. These Files + * and Directories must be transferred and staged alongside the + * primary file. An implementation may fail workflow execution + * if a required secondary file does not exist. + * + * If the value is an expression, the value of `self` in the expression + * must be the primary input or output File object to which this binding + * applies. The `basename`, `nameroot` and `nameext` fields must be + * present in `self`. For `CommandLineTool` outputs the `path` field must + * also be present. The expression must return a filename string relative + * to the path to the primary File, a File or Directory object with either + * `path` or `location` and `basename` fields set, or an array consisting + * of strings or File or Directory objects. It is legal to reference an + * unchanged File or Directory object taken from input as a secondaryFile. + * The expression may return "null" in which case there is no secondaryFile + * from that expression. + * + * To work on non-filename-preserving storage systems, portable tool + * descriptions should avoid constructing new values from `location`, but + * should construct relative references using `basename` or `nameroot` + * instead. + * + * If a value in `secondaryFiles` is a string that is not an expression, + * it specifies that the following pattern should be applied to the path + * of the primary file to yield a filename relative to the primary File: + * + * 1. If string ends with `?` character, remove the last `?` and mark + * the resulting secondary file as optional. + * 2. If string begins with one or more caret `^` characters, for each + * caret, remove the last file extension from the path (the last + * period `.` and all following characters). If there are no file + * extensions, the path is unchanged. + * 3. Append the remainder of the string to the end of the file path. + * + */ + secondaryFiles?: undefined | Internal.SecondaryFileSchema | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * A value of `true` indicates that the file is read or written + * sequentially without seeking. An implementation may use this flag to + * indicate whether it is valid to stream file contents using a named + * pipe. Default: `false`. + * + */ + streamable?: undefined | boolean + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * This is the file format that will be assigned to the output + * File object. + * + */ + format?: undefined | string + + /** + * Specifies one or more workflow parameters that supply the value of to + * the output parameter. + * + */ + outputSource?: undefined | string | Array + + /** + * The method to use to merge multiple sources into a single array. + * If not specified, the default method is "merge_nested". + * + */ + linkMerge?: undefined | string + + /** + * The method to use to choose non-null elements among multiple sources. + * + */ + pickValue?: undefined | string + + /** + * Specify valid types of data that may be assigned to this parameter. + * + */ + type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array +} \ No newline at end of file diff --git a/src/workflowProperties.ts b/src/workflowProperties.ts new file mode 100644 index 0000000..50d5048 --- /dev/null +++ b/src/workflowProperties.ts @@ -0,0 +1,157 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#Workflow + * + * A workflow describes a set of **steps** and the **dependencies** between + * those steps. When a step produces output that will be consumed by a + * second step, the first step is a dependency of the second step. + * + * When there is a dependency, the workflow engine must execute the preceding + * step and wait for it to successfully produce output before executing the + * dependent step. If two steps are defined in the workflow graph that + * are not directly or indirectly dependent, these steps are **independent**, + * and may execute in any order or execute concurrently. A workflow is + * complete when all steps have been executed. + * + * Dependencies between parameters are expressed using the `source` + * field on [workflow step input parameters](#WorkflowStepInput) and + * `outputSource` field on [workflow output + * parameters](#WorkflowOutputParameter). + * + * The `source` field on each workflow step input parameter expresses + * the data links that contribute to the value of the step input + * parameter (the "sink"). A workflow step can only begin execution + * when every data link connected to a step has been fulfilled. + * + * The `outputSource` field on each workflow step input parameter + * expresses the data links that contribute to the value of the + * workflow output parameter (the "sink"). Workflow execution cannot + * complete successfully until every data link connected to an output + * parameter has been fulfilled. + * + * ## Workflow success and failure + * + * A completed step must result in one of `success`, `temporaryFailure` or + * `permanentFailure` states. An implementation may choose to retry a step + * execution which resulted in `temporaryFailure`. An implementation may + * choose to either continue running other steps of a workflow, or terminate + * immediately upon `permanentFailure`. + * + * * If any step of a workflow execution results in `permanentFailure`, then + * the workflow status is `permanentFailure`. + * + * * If one or more steps result in `temporaryFailure` and all other steps + * complete `success` or are not executed, then the workflow status is + * `temporaryFailure`. + * + * * If all workflow steps are executed and complete with `success`, then the + * workflow status is `success`. + * + * # Extensions + * + * [ScatterFeatureRequirement](#ScatterFeatureRequirement) and + * [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) are + * available as standard [extensions](#Extensions_and_Metadata) to core + * workflow semantics. + * + */ +export interface WorkflowProperties extends Internal.ProcessProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + class_: string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Defines the input parameters of the process. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used to build a user + * interface for constructing the input object. + * + * When accepting an input object, all input parameters must have a value. + * If an input parameter is missing from the input object, it must be + * assigned a value of `null` (or the value of `default` for that + * parameter, if provided) for the purposes of validation and evaluation + * of expressions. + * + */ + inputs: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + outputs: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this process. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements?: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this process. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints?: undefined | Array + + /** + * CWL document version. Always required at the document root. Not + * required for a Process embedded inside another Process. + * + */ + cwlVersion?: undefined | string + + /** + * An identifier for the type of computational operation, of this Process. + * Especially useful for "class: Operation", but can also be used for + * CommandLineTool, Workflow, or ExpressionTool. + * + * If provided, then this must be an IRI of a concept node that + * represents the type of operation, preferrably defined within an ontology. + * + * For example, in the domain of bioinformatics, one can use an IRI from + * the EDAM Ontology's [Operation concept nodes](http://edamontology.org/operation_0004), + * like [Alignment](http://edamontology.org/operation_2928), + * or [Clustering](http://edamontology.org/operation_3432); or a more + * specific Operation concept like + * [Split read mapping](http://edamontology.org/operation_3199). + * + */ + intent?: undefined | Array + + /** + * The individual steps that make up the workflow. Each step is executed when all of its + * input data links are fufilled. An implementation may choose to execute + * the steps in a different order than listed and/or execute steps + * concurrently, provided that dependencies between steps are met. + * + */ + steps: Array +} \ No newline at end of file diff --git a/src/workflowStep.ts b/src/workflowStep.ts index 630202c..13979e6 100644 --- a/src/workflowStep.ts +++ b/src/workflowStep.ts @@ -99,24 +99,23 @@ import * as Internal from './util/internal' * a subworkflow (recursive workflows are not allowed). * */ -export class WorkflowStep extends Saveable implements Internal.Identified, Internal.Labeled, Internal.Documented { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class WorkflowStep extends Saveable implements Internal.WorkflowStepProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * A documentation string for this object, or an array of strings which should be concatenated. */ - doc: undefined | string | Array + doc?: undefined | string | Array /** * Defines the input parameters of the workflow step. The process is ready to @@ -144,7 +143,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter * unless overridden at user option. * */ - requirements: undefined | Array + requirements?: undefined | Array /** * Declares hints applying to either the runtime environment or the @@ -153,7 +152,7 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter * the implementation may report a warning. * */ - hints: undefined | Array + hints?: undefined | Array /** * Specifies the process to run. @@ -167,20 +166,19 @@ export class WorkflowStep extends Saveable implements Internal.Identified, Inter * produces a `null` on each output. * */ - when: undefined | string - scatter: undefined | string | Array + when?: undefined | string + scatter?: undefined | string | Array /** * Required if `scatter` is an array of more than one element. * */ - scatterMethod: undefined | string + scatterMethod?: undefined | string - constructor ({extensionFields, loadingOptions, id, label, doc, in_, out, requirements, hints, run, when, scatter, scatterMethod} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, label: undefined | string, doc: undefined | string | Array, in_: Array, out: Array, requirements: undefined | Array, hints: undefined | Array, run: string | Internal.CommandLineTool | Internal.ExpressionTool | Internal.Workflow | Internal.Operation, when: undefined | string, scatter: undefined | string | Array, scatterMethod: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, id, label, doc, in_, out, requirements, hints, run, when, scatter, scatterMethod} : {loadingOptions?: LoadingOptions} & Internal.WorkflowStepProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.label = label this.doc = doc diff --git a/src/workflowStepInput.ts b/src/workflowStepInput.ts index 9aa5490..dececad 100644 --- a/src/workflowStepInput.ts +++ b/src/workflowStepInput.ts @@ -128,34 +128,33 @@ import * as Internal from './util/internal' * should be filtered out. * */ -export class WorkflowStepInput extends Saveable implements Internal.Identified, Internal.Sink, Internal.LoadContents, Internal.Labeled { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class WorkflowStepInput extends Saveable implements Internal.WorkflowStepInputProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string /** * Specifies one or more workflow parameters that will provide input to * the underlying step parameter. * */ - source: undefined | string | Array + source?: undefined | string | Array /** * The method to use to merge multiple inbound links into a single array. * If not specified, the default method is "merge_nested". * */ - linkMerge: undefined | string + linkMerge?: undefined | string /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue: undefined | string + pickValue?: undefined | string /** * Only valid when `type: File` or is an array of `items: File`. @@ -168,7 +167,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, * the implementation must raise a fatal error. * */ - loadContents: undefined | boolean + loadContents?: undefined | boolean /** * Only valid when `type: Directory` or is an array of `items: Directory`. @@ -183,12 +182,12 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, * 3. By default: `no_listing` * */ - loadListing: undefined | string + loadListing?: undefined | string /** * A short, human-readable label of this object. */ - label: undefined | string + label?: undefined | string /** * The default value for this parameter to use if either there is no @@ -196,7 +195,7 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, * default must be applied prior to scattering or evaluating `valueFrom`. * */ - default_: undefined | any + default_?: undefined | any /** * To use valueFrom, [StepInputExpressionRequirement](#StepInputExpressionRequirement) must @@ -223,13 +222,12 @@ export class WorkflowStepInput extends Saveable implements Internal.Identified, * evaluation of `valueFrom` on other parameters. * */ - valueFrom: undefined | string + valueFrom?: undefined | string - constructor ({extensionFields, loadingOptions, id, source, linkMerge, pickValue, loadContents, loadListing, label, default_, valueFrom} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string, source: undefined | string | Array, linkMerge: undefined | string, pickValue: undefined | string, loadContents: undefined | boolean, loadListing: undefined | string, label: undefined | string, default_: undefined | any, valueFrom: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, id, source, linkMerge, pickValue, loadContents, loadListing, label, default_, valueFrom} : {loadingOptions?: LoadingOptions} & Internal.WorkflowStepInputProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id this.source = source this.linkMerge = linkMerge diff --git a/src/workflowStepInputProperties.ts b/src/workflowStepInputProperties.ts new file mode 100644 index 0000000..744eb44 --- /dev/null +++ b/src/workflowStepInputProperties.ts @@ -0,0 +1,214 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#WorkflowStepInput + * + * The input of a workflow step connects an upstream parameter (from the + * workflow inputs, or the outputs of other workflows steps) with the input + * parameters of the process specified by the `run` field. Only input parameters + * declared by the target process will be passed through at runtime to the process + * though additonal parameters may be specified (for use within `valueFrom` + * expressions for instance) - unconnected or unused parameters do not represent an + * error condition. + * + * # Input object + * + * A WorkflowStepInput object must contain an `id` field in the form + * `#fieldname` or `#prefix/fieldname`. When the `id` field contains a slash + * `/` the field name consists of the characters following the final slash + * (the prefix portion may contain one or more slashes to indicate scope). + * This defines a field of the workflow step input object with the value of + * the `source` parameter(s). + * + * # Merging multiple inbound data links + * + * To merge multiple inbound data links, + * [MultipleInputFeatureRequirement](#MultipleInputFeatureRequirement) must be specified + * in the workflow or workflow step requirements. + * + * If the sink parameter is an array, or named in a [workflow + * scatter](#WorkflowStep) operation, there may be multiple inbound + * data links listed in the `source` field. The values from the + * input links are merged depending on the method specified in the + * `linkMerge` field. If both `linkMerge` and `pickValue` are null + * or not specified, and there is more than one element in the + * `source` array, the default method is "merge_nested". + * + * If both `linkMerge` and `pickValue` are null or not specified, and + * there is only a single element in the `source`, then the input + * parameter takes the scalar value from the single input link (it is + * *not* wrapped in a single-list). + * + * * **merge_nested** + * + * The input must be an array consisting of exactly one entry for each + * input link. If "merge_nested" is specified with a single link, the value + * from the link must be wrapped in a single-item list. + * + * * **merge_flattened** + * + * 1. The source and sink parameters must be compatible types, or the source + * type must be compatible with single element from the "items" type of + * the destination array parameter. + * 2. Source parameters which are arrays are concatenated. + * Source parameters which are single element types are appended as + * single elements. + * + * # Picking non-null values among inbound data links + * + * If present, `pickValue` specifies how to picking non-null values among inbound data links. + * + * `pickValue` is evaluated + * 1. Once all source values from upstream step or parameters are available. + * 2. After `linkMerge`. + * 3. Before `scatter` or `valueFrom`. + * + * This is specifically intended to be useful in combination with + * [conditional execution](#WorkflowStep), where several upstream + * steps may be connected to a single input (`source` is a list), and + * skipped steps produce null values. + * + * Static type checkers should check for type consistency after infering what the type + * will be after `pickValue` is applied, just as they do currently for `linkMerge`. + * + * * **first_non_null** + * + * For the first level of a list input, pick the first non-null element. The result is a scalar. + * It is an error if there is no non-null element. Examples: + * * `[null, x, null, y] -> x` + * * `[null, [null], null, y] -> [null]` + * * `[null, null, null] -> Runtime Error` + * + * *Intended use case*: If-else pattern where the + * value comes either from a conditional step or from a default or + * fallback value. The conditional step(s) should be placed first in + * the list. + * + * * **the_only_non_null** + * + * For the first level of a list input, pick the single non-null element. The result is a scalar. + * It is an error if there is more than one non-null element. Examples: + * + * * `[null, x, null] -> x` + * * `[null, x, null, y] -> Runtime Error` + * * `[null, [null], null] -> [null]` + * * `[null, null, null] -> Runtime Error` + * + * *Intended use case*: Switch type patterns where developer considers + * more than one active code path as a workflow error + * (possibly indicating an error in writing `when` condition expressions). + * + * * **all_non_null** + * + * For the first level of a list input, pick all non-null values. + * The result is a list, which may be empty. Examples: + * + * * `[null, x, null] -> [x]` + * * `[x, null, y] -> [x, y]` + * * `[null, [x], [null]] -> [[x], [null]]` + * * `[null, null, null] -> []` + * + * *Intended use case*: It is valid to have more than one source, but + * sources are conditional, so null sources (from skipped steps) + * should be filtered out. + * + */ +export interface WorkflowStepInputProperties extends Internal.IdentifiedProperties, Internal.SinkProperties, Internal.LoadContentsProperties, Internal.LabeledProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * Specifies one or more workflow parameters that will provide input to + * the underlying step parameter. + * + */ + source?: undefined | string | Array + + /** + * The method to use to merge multiple inbound links into a single array. + * If not specified, the default method is "merge_nested". + * + */ + linkMerge?: undefined | string + + /** + * The method to use to choose non-null elements among multiple sources. + * + */ + pickValue?: undefined | string + + /** + * Only valid when `type: File` or is an array of `items: File`. + * + * If true, the file (or each file in the array) must be a UTF-8 + * text file 64 KiB or smaller, and the implementation must read + * the entire contents of the file (or file array) and place it + * in the `contents` field of the File object for use by + * expressions. If the size of the file is greater than 64 KiB, + * the implementation must raise a fatal error. + * + */ + loadContents?: undefined | boolean + + /** + * Only valid when `type: Directory` or is an array of `items: Directory`. + * + * Specify the desired behavior for loading the `listing` field of + * a Directory object for use by expressions. + * + * The order of precedence for loadListing is: + * + * 1. `loadListing` on an individual parameter + * 2. Inherited from `LoadListingRequirement` + * 3. By default: `no_listing` + * + */ + loadListing?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * The default value for this parameter to use if either there is no + * `source` field, or the value produced by the `source` is `null`. The + * default must be applied prior to scattering or evaluating `valueFrom`. + * + */ + default_?: undefined | any + + /** + * To use valueFrom, [StepInputExpressionRequirement](#StepInputExpressionRequirement) must + * be specified in the workflow or workflow step requirements. + * + * If `valueFrom` is a constant string value, use this as the value for + * this input parameter. + * + * If `valueFrom` is a parameter reference or expression, it must be + * evaluated to yield the actual value to be assiged to the input field. + * + * The `self` value in the parameter reference or expression must be + * 1. `null` if there is no `source` field + * 2. the value of the parameter(s) specified in the `source` field when this + * workflow input parameter **is not** specified in this workflow step's `scatter` field. + * 3. an element of the parameter specified in the `source` field when this workflow input + * parameter **is** specified in this workflow step's `scatter` field. + * + * The value of `inputs` in the parameter reference or expression must be + * the input object to the workflow step after assigning the `source` + * values, applying `default`, and then scattering. The order of + * evaluating `valueFrom` among step input parameters is undefined and the + * result of evaluating `valueFrom` on a parameter must not be visible to + * evaluation of `valueFrom` on other parameters. + * + */ + valueFrom?: undefined | string +} \ No newline at end of file diff --git a/src/workflowStepOutput.ts b/src/workflowStepOutput.ts index 8c1558d..074f894 100644 --- a/src/workflowStepOutput.ts +++ b/src/workflowStepOutput.ts @@ -28,20 +28,18 @@ import * as Internal from './util/internal' * to connect the output value to downstream parameters. * */ -export class WorkflowStepOutput extends Saveable implements Internal.Identified { - loadingOptions: LoadingOptions - extensionFields?: Dictionary +export class WorkflowStepOutput extends Saveable implements Internal.WorkflowStepOutputProperties { + extensionFields?: Internal.Dictionary /** * The unique identifier for this object. */ - id: undefined | string + id?: undefined | string - constructor ({extensionFields, loadingOptions, id} : {extensionFields?: Dictionary, loadingOptions?: LoadingOptions, id: undefined | string,}) { - super() + constructor ({loadingOptions, extensionFields, id} : {loadingOptions?: LoadingOptions} & Internal.WorkflowStepOutputProperties) { + super(loadingOptions) this.extensionFields = extensionFields ?? {} - this.loadingOptions = loadingOptions ?? new LoadingOptions({}) this.id = id } diff --git a/src/workflowStepOutputProperties.ts b/src/workflowStepOutputProperties.ts new file mode 100644 index 0000000..4b2d9e0 --- /dev/null +++ b/src/workflowStepOutputProperties.ts @@ -0,0 +1,26 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#WorkflowStepOutput + * + * Associate an output parameter of the underlying process with a workflow + * parameter. The workflow parameter (given in the `id` field) be may be used + * as a `source` to connect with input parameters of other workflow steps, or + * with an output parameter of the process. + * + * A unique identifier for this workflow output parameter. This is + * the identifier to use in the `source` field of `WorkflowStepInput` + * to connect the output value to downstream parameters. + * + */ +export interface WorkflowStepOutputProperties extends Internal.IdentifiedProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string +} \ No newline at end of file diff --git a/src/workflowStepProperties.ts b/src/workflowStepProperties.ts new file mode 100644 index 0000000..ea29864 --- /dev/null +++ b/src/workflowStepProperties.ts @@ -0,0 +1,165 @@ + +import * as Internal from './util/internal' + + +/** + * Auto-generated interface for https://w3id.org/cwl/cwl#WorkflowStep + * + * A workflow step is an executable element of a workflow. It specifies the + * underlying process implementation (such as `CommandLineTool` or another + * `Workflow`) in the `run` field and connects the input and output parameters + * of the underlying process to workflow parameters. + * + * # Scatter/gather + * + * To use scatter/gather, + * [ScatterFeatureRequirement](#ScatterFeatureRequirement) must be specified + * in the workflow or workflow step requirements. + * + * A "scatter" operation specifies that the associated workflow step or + * subworkflow should execute separately over a list of input elements. Each + * job making up a scatter operation is independent and may be executed + * concurrently. + * + * The `scatter` field specifies one or more input parameters which will be + * scattered. An input parameter may be listed more than once. The declared + * type of each input parameter is implicitly becomes an array of items of the + * input parameter type. If a parameter is listed more than once, it becomes + * a nested array. As a result, upstream parameters which are connected to + * scattered parameters must be arrays. + * + * All output parameter types are also implicitly wrapped in arrays. Each job + * in the scatter results in an entry in the output array. + * + * If any scattered parameter runtime value is an empty array, all outputs are + * set to empty arrays and no work is done for the step, according to + * applicable scattering rules. + * + * If `scatter` declares more than one input parameter, `scatterMethod` + * describes how to decompose the input into a discrete set of jobs. + * + * * **dotproduct** specifies that each of the input arrays are aligned and one + * element taken from each array to construct each job. It is an error + * if all input arrays are not the same length. + * + * * **nested_crossproduct** specifies the Cartesian product of the inputs, + * producing a job for every combination of the scattered inputs. The + * output must be nested arrays for each level of scattering, in the + * order that the input arrays are listed in the `scatter` field. + * + * * **flat_crossproduct** specifies the Cartesian product of the inputs, + * producing a job for every combination of the scattered inputs. The + * output arrays must be flattened to a single level, but otherwise listed in the + * order that the input arrays are listed in the `scatter` field. + * + * # Conditional execution (Optional) + * + * Conditional execution makes execution of a step conditional on an + * expression. A step that is not executed is "skipped". A skipped + * step produces `null` for all output parameters. + * + * The condition is evaluated after `scatter`, using the input object + * of each individual scatter job. This means over a set of scatter + * jobs, some may be executed and some may be skipped. When the + * results are gathered, skipped steps must be `null` in the output + * arrays. + * + * The `when` field controls conditional execution. This is an + * expression that must be evaluated with `inputs` bound to the step + * input object (or individual scatter job), and returns a boolean + * value. It is an error if this expression returns a value other + * than `true` or `false`. + * + * Conditionals in CWL are an optional feature and are not required + * to be implemented by all consumers of CWL documents. An + * implementation that does not support conditionals must return a + * fatal error when attempting execute a workflow that uses + * conditional constructs the implementation does not support. + * + * # Subworkflows + * + * To specify a nested workflow as part of a workflow step, + * [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) must be + * specified in the workflow or workflow step requirements. + * + * It is a fatal error if a workflow directly or indirectly invokes itself as + * a subworkflow (recursive workflows are not allowed). + * + */ +export interface WorkflowStepProperties extends Internal.IdentifiedProperties, Internal.LabeledProperties, Internal.DocumentedProperties { + + extensionFields?: Internal.Dictionary + + /** + * The unique identifier for this object. + */ + id?: undefined | string + + /** + * A short, human-readable label of this object. + */ + label?: undefined | string + + /** + * A documentation string for this object, or an array of strings which should be concatenated. + */ + doc?: undefined | string | Array + + /** + * Defines the input parameters of the workflow step. The process is ready to + * run when all required input parameters are associated with concrete + * values. Input parameters include a schema for each parameter which is + * used to validate the input object. It may also be used build a user + * interface for constructing the input object. + * + */ + in_: Array + + /** + * Defines the parameters representing the output of the process. May be + * used to generate and/or validate the output object. + * + */ + out: Array + + /** + * Declares requirements that apply to either the runtime environment or the + * workflow engine that must be met in order to execute this workflow step. If + * an implementation cannot satisfy all requirements, or a requirement is + * listed which is not recognized by the implementation, it is a fatal + * error and the implementation must not attempt to run the process, + * unless overridden at user option. + * + */ + requirements?: undefined | Array + + /** + * Declares hints applying to either the runtime environment or the + * workflow engine that may be helpful in executing this workflow step. It is + * not an error if an implementation cannot satisfy all hints, however + * the implementation may report a warning. + * + */ + hints?: undefined | Array + + /** + * Specifies the process to run. + * + */ + run: string | Internal.CommandLineTool | Internal.ExpressionTool | Internal.Workflow | Internal.Operation + + /** + * If defined, only run the step when the expression evaluates to + * `true`. If `false` the step is skipped. A skipped step + * produces a `null` on each output. + * + */ + when?: undefined | string + scatter?: undefined | string | Array + + /** + * Required if `scatter` is an array of more than one element. + * + */ + scatterMethod?: undefined | string +} \ No newline at end of file From 99b3b424f753dd10ea93c1afff38499fd08656dd Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 20 Dec 2021 17:23:03 +0100 Subject: [PATCH 12/19] List of changes: - Change file naming convention to all lower case - Introduce enum types for enum fields (instead of runtime checked strings) - Add default parameter value for "class" fields --- src/any.ts | 4 + src/{arraySchema.ts => arrayschema.ts} | 4 +- ...Properties.ts => arrayschemaproperties.ts} | 4 +- ...aySchema.ts => commandinputarrayschema.ts} | 4 +- ...s => commandinputarrayschemaproperties.ts} | 4 +- ...numSchema.ts => commandinputenumschema.ts} | 2 +- ...ts => commandinputenumschemaproperties.ts} | 2 +- ...tParameter.ts => commandinputparameter.ts} | 4 +- ....ts => commandinputparameterproperties.ts} | 4 +- ...ordField.ts => commandinputrecordfield.ts} | 4 +- ...s => commandinputrecordfieldproperties.ts} | 4 +- ...dSchema.ts => commandinputrecordschema.ts} | 2 +- ... => commandinputrecordschemaproperties.ts} | 2 +- ...ies.ts => commandinputschemaproperties.ts} | 0 ...LineBindable.ts => commandlinebindable.ts} | 0 ...es.ts => commandlinebindableproperties.ts} | 0 ...ndLineBinding.ts => commandlinebinding.ts} | 0 ...ies.ts => commandlinebindingproperties.ts} | 0 ...{commandLineTool.ts => commandlinetool.ts} | 6 +- src/commandlinetoolclass.ts | 4 + ...erties.ts => commandlinetoolproperties.ts} | 4 +- ...ySchema.ts => commandoutputarrayschema.ts} | 4 +- ... => commandoutputarrayschemaproperties.ts} | 4 +- ...tputBinding.ts => commandoutputbinding.ts} | 2 +- ...s.ts => commandoutputbindingproperties.ts} | 2 +- ...umSchema.ts => commandoutputenumschema.ts} | 2 +- ...s => commandoutputenumschemaproperties.ts} | 2 +- ...Parameter.ts => commandoutputparameter.ts} | 2 +- ...ts => commandoutputparameterproperties.ts} | 2 +- ...rdField.ts => commandoutputrecordfield.ts} | 2 +- ... => commandoutputrecordfieldproperties.ts} | 2 +- ...Schema.ts => commandoutputrecordschema.ts} | 2 +- ...=> commandoutputrecordschemaproperties.ts} | 2 +- src/cwltype.ts | 5 + src/cwlversion.ts | 23 ++ src/directory.ts | 4 +- src/directoryclass.ts | 4 + ...ryProperties.ts => directoryproperties.ts} | 2 +- ...irentProperties.ts => direntproperties.ts} | 0 ...kerRequirement.ts => dockerrequirement.ts} | 4 +- src/dockerrequirementclass.ts | 4 + ...ties.ts => dockerrequirementproperties.ts} | 2 +- ...dProperties.ts => documentedproperties.ts} | 0 ...062602be0b4b8fd33e69e29a841317b6ab665bc.ts | 4 + ...961d79c225752b9fadb617367615ab176b47d77.ts | 4 + ...9cba076fca539106791a4f46d198c7fcfbdb779.ts | 4 + src/{enumSchema.ts => enumschema.ts} | 2 +- ...aProperties.ts => enumschemaproperties.ts} | 2 +- src/{environmentDef.ts => environmentdef.ts} | 0 ...perties.ts => environmentdefproperties.ts} | 0 ...VarRequirement.ts => envvarrequirement.ts} | 4 +- src/envvarrequirementclass.ts | 4 + ...ties.ts => envvarrequirementproperties.ts} | 2 +- src/expression.ts | 4 + src/{expressionTool.ts => expressiontool.ts} | 6 +- src/expressiontoolclass.ts | 4 + ...er.ts => expressiontooloutputparameter.ts} | 2 +- ...xpressiontooloutputparameterproperties.ts} | 2 +- ...perties.ts => expressiontoolproperties.ts} | 4 +- ...seProperties.ts => fieldbaseproperties.ts} | 0 src/file.ts | 4 +- src/fileclass.ts | 4 + src/{fileProperties.ts => fileproperties.ts} | 2 +- ...dProperties.ts => identifiedproperties.ts} | 0 src/index.ts | 278 ++++++++------ ...rement.ts => initialworkdirrequirement.ts} | 4 +- src/initialworkdirrequirementclass.ts | 4 + ...=> initialworkdirrequirementproperties.ts} | 2 +- ...ment.ts => inlinejavascriptrequirement.ts} | 4 +- src/inlinejavascriptrequirementclass.ts | 4 + ... inlinejavascriptrequirementproperties.ts} | 2 +- ...irement.ts => inplaceupdaterequirement.ts} | 4 +- src/inplaceupdaterequirementclass.ts | 4 + ... => inplaceupdaterequirementproperties.ts} | 2 +- ...nputArraySchema.ts => inputarrayschema.ts} | 4 +- ...rties.ts => inputarrayschemaproperties.ts} | 4 +- src/{inputBinding.ts => inputbinding.ts} | 0 ...roperties.ts => inputbindingproperties.ts} | 0 ...{inputEnumSchema.ts => inputenumschema.ts} | 2 +- ...erties.ts => inputenumschemaproperties.ts} | 2 +- ...Properties.ts => inputformatproperties.ts} | 0 ...perties.ts => inputparameterproperties.ts} | 2 +- ...nputRecordField.ts => inputrecordfield.ts} | 4 +- ...rties.ts => inputrecordfieldproperties.ts} | 4 +- ...utRecordSchema.ts => inputrecordschema.ts} | 2 +- ...ties.ts => inputrecordschemaproperties.ts} | 2 +- ...Properties.ts => inputschemaproperties.ts} | 0 ...emaProperties.ts => ioschemaproperties.ts} | 0 ...eledProperties.ts => labeledproperties.ts} | 0 src/linkmergemethod.ts | 5 + ...roperties.ts => loadcontentsproperties.ts} | 2 +- src/loadlistingenum.ts | 6 + ...quirement.ts => loadlistingrequirement.ts} | 6 +- src/loadlistingrequirementclass.ts | 4 + ...ts => loadlistingrequirementproperties.ts} | 4 +- ....ts => multipleinputfeaturerequirement.ts} | 4 +- src/multipleinputfeaturerequirementclass.ts | 4 + ...tipleinputfeaturerequirementproperties.ts} | 2 +- src/{networkAccess.ts => networkaccess.ts} | 4 +- src/networkaccessclass.ts | 4 + ...operties.ts => networkaccessproperties.ts} | 2 +- src/operation.ts | 6 +- src/operationclass.ts | 4 + ...arameter.ts => operationinputparameter.ts} | 4 +- ...s => operationinputparameterproperties.ts} | 4 +- ...rameter.ts => operationoutputparameter.ts} | 2 +- ... => operationoutputparameterproperties.ts} | 2 +- ...onProperties.ts => operationproperties.ts} | 4 +- ...putArraySchema.ts => outputarrayschema.ts} | 4 +- ...ties.ts => outputarrayschemaproperties.ts} | 4 +- ...utputEnumSchema.ts => outputenumschema.ts} | 2 +- ...rties.ts => outputenumschemaproperties.ts} | 2 +- ...roperties.ts => outputformatproperties.ts} | 0 ...erties.ts => outputparameterproperties.ts} | 0 ...putRecordField.ts => outputrecordfield.ts} | 2 +- ...ties.ts => outputrecordfieldproperties.ts} | 2 +- ...tRecordSchema.ts => outputrecordschema.ts} | 2 +- ...ies.ts => outputrecordschemaproperties.ts} | 2 +- ...roperties.ts => outputschemaproperties.ts} | 0 ...erProperties.ts => parameterproperties.ts} | 0 src/pickvaluemethod.ts | 6 + src/primitivetype.ts | 10 + ...cessProperties.ts => processproperties.ts} | 2 +- ...ies.ts => processrequirementproperties.ts} | 0 src/{recordField.ts => recordfield.ts} | 2 +- ...Properties.ts => recordfieldproperties.ts} | 2 +- src/{recordSchema.ts => recordschema.ts} | 2 +- ...roperties.ts => recordschemaproperties.ts} | 2 +- ...eRequirement.ts => resourcerequirement.ts} | 4 +- src/resourcerequirementclass.ts | 4 + ...es.ts => resourcerequirementproperties.ts} | 2 +- ...rement.ts => scatterfeaturerequirement.ts} | 4 +- src/scatterfeaturerequirementclass.ts | 4 + ...=> scatterfeaturerequirementproperties.ts} | 2 +- src/scattermethod.ts | 6 + ...Requirement.ts => schemadefrequirement.ts} | 4 +- src/schemadefrequirementclass.ts | 4 + ...s.ts => schemadefrequirementproperties.ts} | 2 +- ...ryFileSchema.ts => secondaryfileschema.ts} | 0 ...es.ts => secondaryfileschemaproperties.ts} | 0 ...uirement.ts => shellcommandrequirement.ts} | 4 +- src/shellcommandrequirementclass.ts | 4 + ...s => shellcommandrequirementproperties.ts} | 2 +- src/{sinkProperties.ts => sinkproperties.ts} | 4 +- ...{softwarePackage.ts => softwarepackage.ts} | 0 ...erties.ts => softwarepackageproperties.ts} | 0 ...eRequirement.ts => softwarerequirement.ts} | 4 +- src/softwarerequirementclass.ts | 4 + ...es.ts => softwarerequirementproperties.ts} | 2 +- src/stderr.ts | 4 + src/stdin.ts | 4 + src/stdout.ts | 4 + ...t.ts => stepinputexpressionrequirement.ts} | 4 +- src/stepinputexpressionrequirementclass.ts | 4 + ...epinputexpressionrequirementproperties.ts} | 2 +- ...nt.ts => subworkflowfeaturerequirement.ts} | 4 +- src/subworkflowfeaturerequirementclass.ts | 4 + ...ubworkflowfeaturerequirementproperties.ts} | 2 +- src/{toolTimeLimit.ts => tooltimelimit.ts} | 4 +- src/tooltimelimitclass.ts | 4 + ...operties.ts => tooltimelimitproperties.ts} | 2 +- src/util/internal.ts | 338 +++++++++-------- ...{loaderInstances.ts => loaderinstances.ts} | 352 ++++++++++-------- .../loaders/{anyLoader.ts => anyloader.ts} | 0 .../{arrayLoader.ts => arrayloader.ts} | 0 .../loaders/{enumLoader.ts => enumloader.ts} | 0 ...xpressionLoader.ts => expressionloader.ts} | 0 .../{idMapLoader.ts => idmaploader.ts} | 0 ...{primitiveLoader.ts => primitiveloader.ts} | 0 .../{recordLoader.ts => recordloader.ts} | 0 ...daryDSLLoader.ts => secondarydslloader.ts} | 3 +- .../{typeDSLLoader.ts => typedslloader.ts} | 0 .../{unionLoader.ts => unionloader.ts} | 0 .../loaders/{uriLoader.ts => uriloader.ts} | 0 .../{loadingOptions.ts => loadingoptions.ts} | 0 ...ionException.ts => validationexception.ts} | 0 src/workflow.ts | 6 +- src/workflowclass.ts | 4 + ...Parameter.ts => workflowinputparameter.ts} | 4 +- ...ts => workflowinputparameterproperties.ts} | 4 +- ...arameter.ts => workflowoutputparameter.ts} | 6 +- ...s => workflowoutputparameterproperties.ts} | 6 +- ...lowProperties.ts => workflowproperties.ts} | 4 +- src/{workflowStep.ts => workflowstep.ts} | 2 +- ...kflowStepInput.ts => workflowstepinput.ts} | 6 +- ...ties.ts => workflowstepinputproperties.ts} | 6 +- ...lowStepOutput.ts => workflowstepoutput.ts} | 0 ...ies.ts => workflowstepoutputproperties.ts} | 0 ...roperties.ts => workflowstepproperties.ts} | 2 +- src/{workReuse.ts => workreuse.ts} | 4 +- src/workreuseclass.ts | 4 + ...seProperties.ts => workreuseproperties.ts} | 2 +- 192 files changed, 899 insertions(+), 601 deletions(-) create mode 100644 src/any.ts rename src/{arraySchema.ts => arrayschema.ts} (93%) rename src/{arraySchemaProperties.ts => arrayschemaproperties.ts} (55%) rename src/{commandInputArraySchema.ts => commandinputarrayschema.ts} (95%) rename src/{commandInputArraySchemaProperties.ts => commandinputarrayschemaproperties.ts} (73%) rename src/{commandInputEnumSchema.ts => commandinputenumschema.ts} (99%) rename src/{commandInputEnumSchemaProperties.ts => commandinputenumschemaproperties.ts} (93%) rename src/{commandInputParameter.ts => commandinputparameter.ts} (97%) rename src/{commandInputParameterProperties.ts => commandinputparameterproperties.ts} (94%) rename src/{commandInputRecordField.ts => commandinputrecordfield.ts} (97%) rename src/{commandInputRecordFieldProperties.ts => commandinputrecordfieldproperties.ts} (93%) rename src/{commandInputRecordSchema.ts => commandinputrecordschema.ts} (99%) rename src/{commandInputRecordSchemaProperties.ts => commandinputrecordschemaproperties.ts} (94%) rename src/{commandInputSchemaProperties.ts => commandinputschemaproperties.ts} (100%) rename src/{commandLineBindable.ts => commandlinebindable.ts} (100%) rename src/{commandLineBindableProperties.ts => commandlinebindableproperties.ts} (100%) rename src/{commandLineBinding.ts => commandlinebinding.ts} (100%) rename src/{commandLineBindingProperties.ts => commandlinebindingproperties.ts} (100%) rename src/{commandLineTool.ts => commandlinetool.ts} (98%) create mode 100644 src/commandlinetoolclass.ts rename src/{commandLineToolProperties.ts => commandlinetoolproperties.ts} (98%) rename src/{commandOutputArraySchema.ts => commandoutputarrayschema.ts} (95%) rename src/{commandOutputArraySchemaProperties.ts => commandoutputarrayschemaproperties.ts} (67%) rename src/{commandOutputBinding.ts => commandoutputbinding.ts} (99%) rename src/{commandOutputBindingProperties.ts => commandoutputbindingproperties.ts} (98%) rename src/{commandOutputEnumSchema.ts => commandoutputenumschema.ts} (99%) rename src/{commandOutputEnumSchemaProperties.ts => commandoutputenumschemaproperties.ts} (92%) rename src/{commandOutputParameter.ts => commandoutputparameter.ts} (97%) rename src/{commandOutputParameterProperties.ts => commandoutputparameterproperties.ts} (92%) rename src/{commandOutputRecordField.ts => commandoutputrecordfield.ts} (97%) rename src/{commandOutputRecordFieldProperties.ts => commandoutputrecordfieldproperties.ts} (93%) rename src/{commandOutputRecordSchema.ts => commandoutputrecordschema.ts} (99%) rename src/{commandOutputRecordSchemaProperties.ts => commandoutputrecordschemaproperties.ts} (92%) create mode 100644 src/cwltype.ts create mode 100644 src/cwlversion.ts create mode 100644 src/directoryclass.ts rename src/{directoryProperties.ts => directoryproperties.ts} (99%) rename src/{direntProperties.ts => direntproperties.ts} (100%) rename src/{dockerRequirement.ts => dockerrequirement.ts} (97%) create mode 100644 src/dockerrequirementclass.ts rename src/{dockerRequirementProperties.ts => dockerrequirementproperties.ts} (99%) rename src/{documentedProperties.ts => documentedproperties.ts} (100%) create mode 100644 src/enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts create mode 100644 src/enumd961d79c225752b9fadb617367615ab176b47d77.ts create mode 100644 src/enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts rename src/{enumSchema.ts => enumschema.ts} (98%) rename src/{enumSchemaProperties.ts => enumschemaproperties.ts} (86%) rename src/{environmentDef.ts => environmentdef.ts} (100%) rename src/{environmentDefProperties.ts => environmentdefproperties.ts} (100%) rename src/{envVarRequirement.ts => envvarrequirement.ts} (94%) create mode 100644 src/envvarrequirementclass.ts rename src/{envVarRequirementProperties.ts => envvarrequirementproperties.ts} (93%) create mode 100644 src/expression.ts rename src/{expressionTool.ts => expressiontool.ts} (97%) create mode 100644 src/expressiontoolclass.ts rename src/{expressionToolOutputParameter.ts => expressiontooloutputparameter.ts} (97%) rename src/{expressionToolOutputParameterProperties.ts => expressiontooloutputparameterproperties.ts} (94%) rename src/{expressionToolProperties.ts => expressiontoolproperties.ts} (98%) rename src/{fieldBaseProperties.ts => fieldbaseproperties.ts} (100%) create mode 100644 src/fileclass.ts rename src/{fileProperties.ts => fileproperties.ts} (99%) rename src/{identifiedProperties.ts => identifiedproperties.ts} (100%) rename src/{initialWorkDirRequirement.ts => initialworkdirrequirement.ts} (95%) create mode 100644 src/initialworkdirrequirementclass.ts rename src/{initialWorkDirRequirementProperties.ts => initialworkdirrequirementproperties.ts} (97%) rename src/{inlineJavascriptRequirement.ts => inlinejavascriptrequirement.ts} (94%) create mode 100644 src/inlinejavascriptrequirementclass.ts rename src/{inlineJavascriptRequirementProperties.ts => inlinejavascriptrequirementproperties.ts} (93%) rename src/{inplaceUpdateRequirement.ts => inplaceupdaterequirement.ts} (95%) create mode 100644 src/inplaceupdaterequirementclass.ts rename src/{inplaceUpdateRequirementProperties.ts => inplaceupdaterequirementproperties.ts} (97%) rename src/{inputArraySchema.ts => inputarrayschema.ts} (95%) rename src/{inputArraySchemaProperties.ts => inputarrayschemaproperties.ts} (71%) rename src/{inputBinding.ts => inputbinding.ts} (100%) rename src/{inputBindingProperties.ts => inputbindingproperties.ts} (100%) rename src/{inputEnumSchema.ts => inputenumschema.ts} (99%) rename src/{inputEnumSchemaProperties.ts => inputenumschemaproperties.ts} (92%) rename src/{inputFormatProperties.ts => inputformatproperties.ts} (100%) rename src/{inputParameterProperties.ts => inputparameterproperties.ts} (98%) rename src/{inputRecordField.ts => inputrecordfield.ts} (98%) rename src/{inputRecordFieldProperties.ts => inputrecordfieldproperties.ts} (94%) rename src/{inputRecordSchema.ts => inputrecordschema.ts} (99%) rename src/{inputRecordSchemaProperties.ts => inputrecordschemaproperties.ts} (92%) rename src/{inputSchemaProperties.ts => inputschemaproperties.ts} (100%) rename src/{iOSchemaProperties.ts => ioschemaproperties.ts} (100%) rename src/{labeledProperties.ts => labeledproperties.ts} (100%) create mode 100644 src/linkmergemethod.ts rename src/{loadContentsProperties.ts => loadcontentsproperties.ts} (95%) create mode 100644 src/loadlistingenum.ts rename src/{loadListingRequirement.ts => loadlistingrequirement.ts} (93%) create mode 100644 src/loadlistingrequirementclass.ts rename src/{loadListingRequirementProperties.ts => loadlistingrequirementproperties.ts} (82%) rename src/{multipleInputFeatureRequirement.ts => multipleinputfeaturerequirement.ts} (93%) create mode 100644 src/multipleinputfeaturerequirementclass.ts rename src/{multipleInputFeatureRequirementProperties.ts => multipleinputfeaturerequirementproperties.ts} (90%) rename src/{networkAccess.ts => networkaccess.ts} (95%) create mode 100644 src/networkaccessclass.ts rename src/{networkAccessProperties.ts => networkaccessproperties.ts} (96%) create mode 100644 src/operationclass.ts rename src/{operationInputParameter.ts => operationinputparameter.ts} (98%) rename src/{operationInputParameterProperties.ts => operationinputparameterproperties.ts} (94%) rename src/{operationOutputParameter.ts => operationoutputparameter.ts} (97%) rename src/{operationOutputParameterProperties.ts => operationoutputparameterproperties.ts} (94%) rename src/{operationProperties.ts => operationproperties.ts} (98%) rename src/{outputArraySchema.ts => outputarrayschema.ts} (95%) rename src/{outputArraySchemaProperties.ts => outputarrayschemaproperties.ts} (70%) rename src/{outputEnumSchema.ts => outputenumschema.ts} (99%) rename src/{outputEnumSchemaProperties.ts => outputenumschemaproperties.ts} (92%) rename src/{outputFormatProperties.ts => outputformatproperties.ts} (100%) rename src/{outputParameterProperties.ts => outputparameterproperties.ts} (100%) rename src/{outputRecordField.ts => outputrecordfield.ts} (97%) rename src/{outputRecordFieldProperties.ts => outputrecordfieldproperties.ts} (94%) rename src/{outputRecordSchema.ts => outputrecordschema.ts} (99%) rename src/{outputRecordSchemaProperties.ts => outputrecordschemaproperties.ts} (92%) rename src/{outputSchemaProperties.ts => outputschemaproperties.ts} (100%) rename src/{parameterProperties.ts => parameterproperties.ts} (100%) create mode 100644 src/pickvaluemethod.ts create mode 100644 src/primitivetype.ts rename src/{processProperties.ts => processproperties.ts} (98%) rename src/{processRequirementProperties.ts => processrequirementproperties.ts} (100%) rename src/{recordField.ts => recordfield.ts} (96%) rename src/{recordFieldProperties.ts => recordfieldproperties.ts} (72%) rename src/{recordSchema.ts => recordschema.ts} (98%) rename src/{recordSchemaProperties.ts => recordschemaproperties.ts} (86%) rename src/{resourceRequirement.ts => resourcerequirement.ts} (97%) create mode 100644 src/resourcerequirementclass.ts rename src/{resourceRequirementProperties.ts => resourcerequirementproperties.ts} (99%) rename src/{scatterFeatureRequirement.ts => scatterfeaturerequirement.ts} (93%) create mode 100644 src/scatterfeaturerequirementclass.ts rename src/{scatterFeatureRequirementProperties.ts => scatterfeaturerequirementproperties.ts} (91%) create mode 100644 src/scattermethod.ts rename src/{schemaDefRequirement.ts => schemadefrequirement.ts} (95%) create mode 100644 src/schemadefrequirementclass.ts rename src/{schemaDefRequirementProperties.ts => schemadefrequirementproperties.ts} (96%) rename src/{secondaryFileSchema.ts => secondaryfileschema.ts} (100%) rename src/{secondaryFileSchemaProperties.ts => secondaryfileschemaproperties.ts} (100%) rename src/{shellCommandRequirement.ts => shellcommandrequirement.ts} (94%) create mode 100644 src/shellcommandrequirementclass.ts rename src/{shellCommandRequirementProperties.ts => shellcommandrequirementproperties.ts} (94%) rename src/{sinkProperties.ts => sinkproperties.ts} (85%) rename src/{softwarePackage.ts => softwarepackage.ts} (100%) rename src/{softwarePackageProperties.ts => softwarepackageproperties.ts} (100%) rename src/{softwareRequirement.ts => softwarerequirement.ts} (94%) create mode 100644 src/softwarerequirementclass.ts rename src/{softwareRequirementProperties.ts => softwarerequirementproperties.ts} (92%) create mode 100644 src/stderr.ts create mode 100644 src/stdin.ts create mode 100644 src/stdout.ts rename src/{stepInputExpressionRequirement.ts => stepinputexpressionrequirement.ts} (93%) create mode 100644 src/stepinputexpressionrequirementclass.ts rename src/{stepInputExpressionRequirementProperties.ts => stepinputexpressionrequirementproperties.ts} (90%) rename src/{subworkflowFeatureRequirement.ts => subworkflowfeaturerequirement.ts} (93%) create mode 100644 src/subworkflowfeaturerequirementclass.ts rename src/{subworkflowFeatureRequirementProperties.ts => subworkflowfeaturerequirementproperties.ts} (90%) rename src/{toolTimeLimit.ts => tooltimelimit.ts} (95%) create mode 100644 src/tooltimelimitclass.ts rename src/{toolTimeLimitProperties.ts => tooltimelimitproperties.ts} (96%) rename src/util/{loaderInstances.ts => loaderinstances.ts} (86%) rename src/util/loaders/{anyLoader.ts => anyloader.ts} (100%) rename src/util/loaders/{arrayLoader.ts => arrayloader.ts} (100%) rename src/util/loaders/{enumLoader.ts => enumloader.ts} (100%) rename src/util/loaders/{expressionLoader.ts => expressionloader.ts} (100%) rename src/util/loaders/{idMapLoader.ts => idmaploader.ts} (100%) rename src/util/loaders/{primitiveLoader.ts => primitiveloader.ts} (100%) rename src/util/loaders/{recordLoader.ts => recordloader.ts} (100%) rename src/util/loaders/{secondaryDSLLoader.ts => secondarydslloader.ts} (94%) rename src/util/loaders/{typeDSLLoader.ts => typedslloader.ts} (100%) rename src/util/loaders/{unionLoader.ts => unionloader.ts} (100%) rename src/util/loaders/{uriLoader.ts => uriloader.ts} (100%) rename src/util/{loadingOptions.ts => loadingoptions.ts} (100%) rename src/util/{validationException.ts => validationexception.ts} (100%) create mode 100644 src/workflowclass.ts rename src/{workflowInputParameter.ts => workflowinputparameter.ts} (98%) rename src/{workflowInputParameterProperties.ts => workflowinputparameterproperties.ts} (94%) rename src/{workflowOutputParameter.ts => workflowoutputparameter.ts} (97%) rename src/{workflowOutputParameterProperties.ts => workflowoutputparameterproperties.ts} (93%) rename src/{workflowProperties.ts => workflowproperties.ts} (98%) rename src/{workflowStep.ts => workflowstep.ts} (99%) rename src/{workflowStepInput.ts => workflowstepinput.ts} (99%) rename src/{workflowStepInputProperties.ts => workflowstepinputproperties.ts} (98%) rename src/{workflowStepOutput.ts => workflowstepoutput.ts} (100%) rename src/{workflowStepOutputProperties.ts => workflowstepoutputproperties.ts} (100%) rename src/{workflowStepProperties.ts => workflowstepproperties.ts} (99%) rename src/{workReuse.ts => workreuse.ts} (95%) create mode 100644 src/workreuseclass.ts rename src/{workReuseProperties.ts => workreuseproperties.ts} (96%) diff --git a/src/any.ts b/src/any.ts new file mode 100644 index 0000000..e3ef3c6 --- /dev/null +++ b/src/any.ts @@ -0,0 +1,4 @@ + +export enum Any { + ANY='Any', +} diff --git a/src/arraySchema.ts b/src/arrayschema.ts similarity index 93% rename from src/arraySchema.ts rename to src/arrayschema.ts index 2d60dca..7adbd21 100644 --- a/src/arraySchema.ts +++ b/src/arrayschema.ts @@ -24,12 +24,12 @@ export class ArraySchema extends Saveable implements Internal.ArraySchemaPropert /** * Defines the type of the array elements. */ - items: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + items: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc constructor ({loadingOptions, extensionFields, items, type} : {loadingOptions?: LoadingOptions} & Internal.ArraySchemaProperties) { diff --git a/src/arraySchemaProperties.ts b/src/arrayschemaproperties.ts similarity index 55% rename from src/arraySchemaProperties.ts rename to src/arrayschemaproperties.ts index 3fbd595..9f10f90 100644 --- a/src/arraySchemaProperties.ts +++ b/src/arrayschemaproperties.ts @@ -12,10 +12,10 @@ export interface ArraySchemaProperties { /** * Defines the type of the array elements. */ - items: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + items: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc } \ No newline at end of file diff --git a/src/commandInputArraySchema.ts b/src/commandinputarrayschema.ts similarity index 95% rename from src/commandInputArraySchema.ts rename to src/commandinputarrayschema.ts index 6dafe27..fa52c6d 100644 --- a/src/commandInputArraySchema.ts +++ b/src/commandinputarrayschema.ts @@ -29,12 +29,12 @@ export class CommandInputArraySchema extends Saveable implements Internal.Comman /** * Defines the type of the array elements. */ - items: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + items: Internal.CWLType | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/commandInputArraySchemaProperties.ts b/src/commandinputarrayschemaproperties.ts similarity index 73% rename from src/commandInputArraySchemaProperties.ts rename to src/commandinputarrayschemaproperties.ts index 0cb9082..001298d 100644 --- a/src/commandInputArraySchemaProperties.ts +++ b/src/commandinputarrayschemaproperties.ts @@ -17,12 +17,12 @@ export interface CommandInputArraySchemaProperties extends Internal.InputArraySc /** * Defines the type of the array elements. */ - items: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + items: Internal.CWLType | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/commandInputEnumSchema.ts b/src/commandinputenumschema.ts similarity index 99% rename from src/commandInputEnumSchema.ts rename to src/commandinputenumschema.ts index 5d6ea9f..9feb0c5 100644 --- a/src/commandInputEnumSchema.ts +++ b/src/commandinputenumschema.ts @@ -34,7 +34,7 @@ export class CommandInputEnumSchema extends Saveable implements Internal.Command /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/commandInputEnumSchemaProperties.ts b/src/commandinputenumschemaproperties.ts similarity index 93% rename from src/commandInputEnumSchemaProperties.ts rename to src/commandinputenumschemaproperties.ts index d2395cb..4a4b608 100644 --- a/src/commandInputEnumSchemaProperties.ts +++ b/src/commandinputenumschemaproperties.ts @@ -22,7 +22,7 @@ export interface CommandInputEnumSchemaProperties extends Internal.InputEnumSche /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/commandInputParameter.ts b/src/commandinputparameter.ts similarity index 97% rename from src/commandInputParameter.ts rename to src/commandinputparameter.ts index 3206f0f..eed6a01 100644 --- a/src/commandInputParameter.ts +++ b/src/commandinputparameter.ts @@ -132,7 +132,7 @@ export class CommandInputParameter extends Saveable implements Internal.CommandI * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing @@ -147,7 +147,7 @@ export class CommandInputParameter extends Saveable implements Internal.CommandI * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + type: Internal.CWLType | Internal.stdin | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | string | Array /** * Describes how to turns the input parameters of a process into diff --git a/src/commandInputParameterProperties.ts b/src/commandinputparameterproperties.ts similarity index 94% rename from src/commandInputParameterProperties.ts rename to src/commandinputparameterproperties.ts index 77a8dbb..fa1520a 100644 --- a/src/commandInputParameterProperties.ts +++ b/src/commandinputparameterproperties.ts @@ -120,7 +120,7 @@ export interface CommandInputParameterProperties extends Internal.InputParameter * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing @@ -135,7 +135,7 @@ export interface CommandInputParameterProperties extends Internal.InputParameter * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + type: Internal.CWLType | Internal.stdin | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | string | Array /** * Describes how to turns the input parameters of a process into diff --git a/src/commandInputRecordField.ts b/src/commandinputrecordfield.ts similarity index 97% rename from src/commandInputRecordField.ts rename to src/commandinputrecordfield.ts index 16c4e9a..3e3cdc1 100644 --- a/src/commandInputRecordField.ts +++ b/src/commandinputrecordfield.ts @@ -36,7 +36,7 @@ export class CommandInputRecordField extends Saveable implements Internal.Comman * The field type * */ - type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + type: Internal.CWLType | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | string | Array /** * A short, human-readable label of this object. @@ -137,7 +137,7 @@ export class CommandInputRecordField extends Saveable implements Internal.Comman * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * Describes how to turn this object into command line arguments. diff --git a/src/commandInputRecordFieldProperties.ts b/src/commandinputrecordfieldproperties.ts similarity index 93% rename from src/commandInputRecordFieldProperties.ts rename to src/commandinputrecordfieldproperties.ts index 761cd70..b7c1d8d 100644 --- a/src/commandInputRecordFieldProperties.ts +++ b/src/commandinputrecordfieldproperties.ts @@ -24,7 +24,7 @@ export interface CommandInputRecordFieldProperties extends Internal.InputRecordF * The field type * */ - type: string | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | Array + type: Internal.CWLType | Internal.CommandInputRecordSchema | Internal.CommandInputEnumSchema | Internal.CommandInputArraySchema | string | Array /** * A short, human-readable label of this object. @@ -125,7 +125,7 @@ export interface CommandInputRecordFieldProperties extends Internal.InputRecordF * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * Describes how to turn this object into command line arguments. diff --git a/src/commandInputRecordSchema.ts b/src/commandinputrecordschema.ts similarity index 99% rename from src/commandInputRecordSchema.ts rename to src/commandinputrecordschema.ts index 2aaf349..26a24f9 100644 --- a/src/commandInputRecordSchema.ts +++ b/src/commandinputrecordschema.ts @@ -34,7 +34,7 @@ export class CommandInputRecordSchema extends Saveable implements Internal.Comma /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/commandInputRecordSchemaProperties.ts b/src/commandinputrecordschemaproperties.ts similarity index 94% rename from src/commandInputRecordSchemaProperties.ts rename to src/commandinputrecordschemaproperties.ts index 00eaf7c..b0b64e4 100644 --- a/src/commandInputRecordSchemaProperties.ts +++ b/src/commandinputrecordschemaproperties.ts @@ -22,7 +22,7 @@ export interface CommandInputRecordSchemaProperties extends Internal.InputRecord /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/commandInputSchemaProperties.ts b/src/commandinputschemaproperties.ts similarity index 100% rename from src/commandInputSchemaProperties.ts rename to src/commandinputschemaproperties.ts diff --git a/src/commandLineBindable.ts b/src/commandlinebindable.ts similarity index 100% rename from src/commandLineBindable.ts rename to src/commandlinebindable.ts diff --git a/src/commandLineBindableProperties.ts b/src/commandlinebindableproperties.ts similarity index 100% rename from src/commandLineBindableProperties.ts rename to src/commandlinebindableproperties.ts diff --git a/src/commandLineBinding.ts b/src/commandlinebinding.ts similarity index 100% rename from src/commandLineBinding.ts rename to src/commandlinebinding.ts diff --git a/src/commandLineBindingProperties.ts b/src/commandlinebindingproperties.ts similarity index 100% rename from src/commandLineBindingProperties.ts rename to src/commandlinebindingproperties.ts diff --git a/src/commandLineTool.ts b/src/commandlinetool.ts similarity index 98% rename from src/commandLineTool.ts rename to src/commandlinetool.ts index 9a2a5f4..e970eff 100644 --- a/src/commandLineTool.ts +++ b/src/commandlinetool.ts @@ -28,7 +28,7 @@ export class CommandLineTool extends Saveable implements Internal.CommandLineToo * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.CommandLineTool_class /** * A short, human-readable label of this object. @@ -88,7 +88,7 @@ export class CommandLineTool extends Saveable implements Internal.CommandLineToo * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. @@ -197,7 +197,7 @@ export class CommandLineTool extends Saveable implements Internal.CommandLineToo permanentFailCodes?: undefined | Array - constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, baseCommand, arguments_, stdin, stderr, stdout, successCodes, temporaryFailCodes, permanentFailCodes} : {loadingOptions?: LoadingOptions} & Internal.CommandLineToolProperties) { + constructor ({loadingOptions, extensionFields, id, class_ = Internal.CommandLineTool_class.COMMANDLINETOOL, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, baseCommand, arguments_, stdin, stderr, stdout, successCodes, temporaryFailCodes, permanentFailCodes} : {loadingOptions?: LoadingOptions} & Internal.CommandLineToolProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.id = id diff --git a/src/commandlinetoolclass.ts b/src/commandlinetoolclass.ts new file mode 100644 index 0000000..943ee44 --- /dev/null +++ b/src/commandlinetoolclass.ts @@ -0,0 +1,4 @@ + +export enum CommandLineTool_class { + COMMANDLINETOOL='CommandLineTool', +} diff --git a/src/commandLineToolProperties.ts b/src/commandlinetoolproperties.ts similarity index 98% rename from src/commandLineToolProperties.ts rename to src/commandlinetoolproperties.ts index 99055da..71d5939 100644 --- a/src/commandLineToolProperties.ts +++ b/src/commandlinetoolproperties.ts @@ -16,7 +16,7 @@ export interface CommandLineToolProperties extends Internal.ProcessProperties { * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.CommandLineTool_class /** * A short, human-readable label of this object. @@ -76,7 +76,7 @@ export interface CommandLineToolProperties extends Internal.ProcessProperties { * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. diff --git a/src/commandOutputArraySchema.ts b/src/commandoutputarrayschema.ts similarity index 95% rename from src/commandOutputArraySchema.ts rename to src/commandoutputarrayschema.ts index 9f3fab9..2ed4259 100644 --- a/src/commandOutputArraySchema.ts +++ b/src/commandoutputarrayschema.ts @@ -29,12 +29,12 @@ export class CommandOutputArraySchema extends Saveable implements Internal.Comma /** * Defines the type of the array elements. */ - items: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + items: Internal.CWLType | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/commandOutputArraySchemaProperties.ts b/src/commandoutputarrayschemaproperties.ts similarity index 67% rename from src/commandOutputArraySchemaProperties.ts rename to src/commandoutputarrayschemaproperties.ts index 412b357..8879d7f 100644 --- a/src/commandOutputArraySchemaProperties.ts +++ b/src/commandoutputarrayschemaproperties.ts @@ -17,12 +17,12 @@ export interface CommandOutputArraySchemaProperties extends Internal.OutputArray /** * Defines the type of the array elements. */ - items: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + items: Internal.CWLType | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/commandOutputBinding.ts b/src/commandoutputbinding.ts similarity index 99% rename from src/commandOutputBinding.ts rename to src/commandoutputbinding.ts index f017f49..c561f0d 100644 --- a/src/commandOutputBinding.ts +++ b/src/commandoutputbinding.ts @@ -59,7 +59,7 @@ export class CommandOutputBinding extends Saveable implements Internal.CommandOu * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * Find files or directories relative to the output directory, using POSIX diff --git a/src/commandOutputBindingProperties.ts b/src/commandoutputbindingproperties.ts similarity index 98% rename from src/commandOutputBindingProperties.ts rename to src/commandoutputbindingproperties.ts index 940ca46..d957c0c 100644 --- a/src/commandOutputBindingProperties.ts +++ b/src/commandoutputbindingproperties.ts @@ -47,7 +47,7 @@ export interface CommandOutputBindingProperties extends Internal.LoadContentsPro * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * Find files or directories relative to the output directory, using POSIX diff --git a/src/commandOutputEnumSchema.ts b/src/commandoutputenumschema.ts similarity index 99% rename from src/commandOutputEnumSchema.ts rename to src/commandoutputenumschema.ts index 6884b45..f4739cc 100644 --- a/src/commandOutputEnumSchema.ts +++ b/src/commandoutputenumschema.ts @@ -34,7 +34,7 @@ export class CommandOutputEnumSchema extends Saveable implements Internal.Comman /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/commandOutputEnumSchemaProperties.ts b/src/commandoutputenumschemaproperties.ts similarity index 92% rename from src/commandOutputEnumSchemaProperties.ts rename to src/commandoutputenumschemaproperties.ts index 1e082ce..afec87c 100644 --- a/src/commandOutputEnumSchemaProperties.ts +++ b/src/commandoutputenumschemaproperties.ts @@ -22,7 +22,7 @@ export interface CommandOutputEnumSchemaProperties extends Internal.OutputEnumSc /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/commandOutputParameter.ts b/src/commandoutputparameter.ts similarity index 97% rename from src/commandOutputParameter.ts rename to src/commandoutputparameter.ts index 53cb9a1..d6fcb28 100644 --- a/src/commandOutputParameter.ts +++ b/src/commandoutputparameter.ts @@ -108,7 +108,7 @@ export class CommandOutputParameter extends Saveable implements Internal.Command * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + type: Internal.CWLType | Internal.stdout | Internal.stderr | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | string | Array /** * Describes how to generate this output object based on the files produced by a CommandLineTool diff --git a/src/commandOutputParameterProperties.ts b/src/commandoutputparameterproperties.ts similarity index 92% rename from src/commandOutputParameterProperties.ts rename to src/commandoutputparameterproperties.ts index 349a18a..2c16f81 100644 --- a/src/commandOutputParameterProperties.ts +++ b/src/commandoutputparameterproperties.ts @@ -96,7 +96,7 @@ export interface CommandOutputParameterProperties extends Internal.OutputParamet * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + type: Internal.CWLType | Internal.stdout | Internal.stderr | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | string | Array /** * Describes how to generate this output object based on the files produced by a CommandLineTool diff --git a/src/commandOutputRecordField.ts b/src/commandoutputrecordfield.ts similarity index 97% rename from src/commandOutputRecordField.ts rename to src/commandoutputrecordfield.ts index 0665761..0d14368 100644 --- a/src/commandOutputRecordField.ts +++ b/src/commandoutputrecordfield.ts @@ -36,7 +36,7 @@ export class CommandOutputRecordField extends Saveable implements Internal.Comma * The field type * */ - type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + type: Internal.CWLType | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | string | Array /** * A short, human-readable label of this object. diff --git a/src/commandOutputRecordFieldProperties.ts b/src/commandoutputrecordfieldproperties.ts similarity index 93% rename from src/commandOutputRecordFieldProperties.ts rename to src/commandoutputrecordfieldproperties.ts index c3e5423..17b5217 100644 --- a/src/commandOutputRecordFieldProperties.ts +++ b/src/commandoutputrecordfieldproperties.ts @@ -24,7 +24,7 @@ export interface CommandOutputRecordFieldProperties extends Internal.OutputRecor * The field type * */ - type: string | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | Array + type: Internal.CWLType | Internal.CommandOutputRecordSchema | Internal.CommandOutputEnumSchema | Internal.CommandOutputArraySchema | string | Array /** * A short, human-readable label of this object. diff --git a/src/commandOutputRecordSchema.ts b/src/commandoutputrecordschema.ts similarity index 99% rename from src/commandOutputRecordSchema.ts rename to src/commandoutputrecordschema.ts index a55f092..6660372 100644 --- a/src/commandOutputRecordSchema.ts +++ b/src/commandoutputrecordschema.ts @@ -34,7 +34,7 @@ export class CommandOutputRecordSchema extends Saveable implements Internal.Comm /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/commandOutputRecordSchemaProperties.ts b/src/commandoutputrecordschemaproperties.ts similarity index 92% rename from src/commandOutputRecordSchemaProperties.ts rename to src/commandoutputrecordschemaproperties.ts index 33c821a..81b5a04 100644 --- a/src/commandOutputRecordSchemaProperties.ts +++ b/src/commandoutputrecordschemaproperties.ts @@ -22,7 +22,7 @@ export interface CommandOutputRecordSchemaProperties extends Internal.OutputReco /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/cwltype.ts b/src/cwltype.ts new file mode 100644 index 0000000..f20a2b0 --- /dev/null +++ b/src/cwltype.ts @@ -0,0 +1,5 @@ + +export enum CWLType { + FILE='File', + DIRECTORY='Directory', +} diff --git a/src/cwlversion.ts b/src/cwlversion.ts new file mode 100644 index 0000000..7165915 --- /dev/null +++ b/src/cwlversion.ts @@ -0,0 +1,23 @@ + +export enum CWLVersion { + DRAFT_2='draft-2', + DRAFT_3_DEV1='draft-3.dev1', + DRAFT_3_DEV2='draft-3.dev2', + DRAFT_3_DEV3='draft-3.dev3', + DRAFT_3_DEV4='draft-3.dev4', + DRAFT_3_DEV5='draft-3.dev5', + DRAFT_3='draft-3', + DRAFT_4_DEV1='draft-4.dev1', + DRAFT_4_DEV2='draft-4.dev2', + DRAFT_4_DEV3='draft-4.dev3', + V1_0_DEV4='v1.0.dev4', + V1_0='v1.0', + V1_1_0_DEV1='v1.1.0-dev1', + V1_1='v1.1', + V1_2_0_DEV1='v1.2.0-dev1', + V1_2_0_DEV2='v1.2.0-dev2', + V1_2_0_DEV3='v1.2.0-dev3', + V1_2_0_DEV4='v1.2.0-dev4', + V1_2_0_DEV5='v1.2.0-dev5', + V1_2='v1.2', +} diff --git a/src/directory.ts b/src/directory.ts index ed97f2e..d549c0c 100644 --- a/src/directory.ts +++ b/src/directory.ts @@ -69,7 +69,7 @@ export class Directory extends Saveable implements Internal.DirectoryProperties /** * Must be `Directory` to indicate this object describes a Directory. */ - class_: string + class_: Internal.Directory_class /** * An IRI that identifies the directory resource. This may be a relative @@ -139,7 +139,7 @@ export class Directory extends Saveable implements Internal.DirectoryProperties listing?: undefined | Array - constructor ({loadingOptions, extensionFields, class_, location, path, basename, listing} : {loadingOptions?: LoadingOptions} & Internal.DirectoryProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.Directory_class.DIRECTORY, location, path, basename, listing} : {loadingOptions?: LoadingOptions} & Internal.DirectoryProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/directoryclass.ts b/src/directoryclass.ts new file mode 100644 index 0000000..3b471d4 --- /dev/null +++ b/src/directoryclass.ts @@ -0,0 +1,4 @@ + +export enum Directory_class { + DIRECTORY='Directory', +} diff --git a/src/directoryProperties.ts b/src/directoryproperties.ts similarity index 99% rename from src/directoryProperties.ts rename to src/directoryproperties.ts index 21e7132..b16221d 100644 --- a/src/directoryProperties.ts +++ b/src/directoryproperties.ts @@ -57,7 +57,7 @@ export interface DirectoryProperties { /** * Must be `Directory` to indicate this object describes a Directory. */ - class_: string + class_: Internal.Directory_class /** * An IRI that identifies the directory resource. This may be a relative diff --git a/src/direntProperties.ts b/src/direntproperties.ts similarity index 100% rename from src/direntProperties.ts rename to src/direntproperties.ts diff --git a/src/dockerRequirement.ts b/src/dockerrequirement.ts similarity index 97% rename from src/dockerRequirement.ts rename to src/dockerrequirement.ts index 5977b93..f885f13 100644 --- a/src/dockerRequirement.ts +++ b/src/dockerrequirement.ts @@ -77,7 +77,7 @@ export class DockerRequirement extends Saveable implements Internal.DockerRequir /** * Always 'DockerRequirement' */ - class_: string + class_: Internal.DockerRequirement_class /** * Specify a Docker image to retrieve using `docker pull`. Can contain the @@ -119,7 +119,7 @@ export class DockerRequirement extends Saveable implements Internal.DockerRequir dockerOutputDirectory?: undefined | string - constructor ({loadingOptions, extensionFields, class_, dockerPull, dockerLoad, dockerFile, dockerImport, dockerImageId, dockerOutputDirectory} : {loadingOptions?: LoadingOptions} & Internal.DockerRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.DockerRequirement_class.DOCKERREQUIREMENT, dockerPull, dockerLoad, dockerFile, dockerImport, dockerImageId, dockerOutputDirectory} : {loadingOptions?: LoadingOptions} & Internal.DockerRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/dockerrequirementclass.ts b/src/dockerrequirementclass.ts new file mode 100644 index 0000000..a9d4728 --- /dev/null +++ b/src/dockerrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum DockerRequirement_class { + DOCKERREQUIREMENT='DockerRequirement', +} diff --git a/src/dockerRequirementProperties.ts b/src/dockerrequirementproperties.ts similarity index 99% rename from src/dockerRequirementProperties.ts rename to src/dockerrequirementproperties.ts index 393451c..4ea0048 100644 --- a/src/dockerRequirementProperties.ts +++ b/src/dockerrequirementproperties.ts @@ -65,7 +65,7 @@ export interface DockerRequirementProperties extends Internal.ProcessRequirement /** * Always 'DockerRequirement' */ - class_: string + class_: Internal.DockerRequirement_class /** * Specify a Docker image to retrieve using `docker pull`. Can contain the diff --git a/src/documentedProperties.ts b/src/documentedproperties.ts similarity index 100% rename from src/documentedProperties.ts rename to src/documentedproperties.ts diff --git a/src/enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts b/src/enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts new file mode 100644 index 0000000..80ba42d --- /dev/null +++ b/src/enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts @@ -0,0 +1,4 @@ + +export enum enum_d062602be0b4b8fd33e69e29a841317b6ab665bc { + ARRAY='array', +} diff --git a/src/enumd961d79c225752b9fadb617367615ab176b47d77.ts b/src/enumd961d79c225752b9fadb617367615ab176b47d77.ts new file mode 100644 index 0000000..97791e4 --- /dev/null +++ b/src/enumd961d79c225752b9fadb617367615ab176b47d77.ts @@ -0,0 +1,4 @@ + +export enum enum_d961d79c225752b9fadb617367615ab176b47d77 { + ENUM='enum', +} diff --git a/src/enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts b/src/enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts new file mode 100644 index 0000000..ddfbd7d --- /dev/null +++ b/src/enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts @@ -0,0 +1,4 @@ + +export enum enum_d9cba076fca539106791a4f46d198c7fcfbdb779 { + RECORD='record', +} diff --git a/src/enumSchema.ts b/src/enumschema.ts similarity index 98% rename from src/enumSchema.ts rename to src/enumschema.ts index 17fe832..5791bad 100644 --- a/src/enumSchema.ts +++ b/src/enumschema.ts @@ -32,7 +32,7 @@ export class EnumSchema extends Saveable implements Internal.EnumSchemaPropertie /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 constructor ({loadingOptions, extensionFields, symbols, type} : {loadingOptions?: LoadingOptions} & Internal.EnumSchemaProperties) { diff --git a/src/enumSchemaProperties.ts b/src/enumschemaproperties.ts similarity index 86% rename from src/enumSchemaProperties.ts rename to src/enumschemaproperties.ts index d4a89a1..f4b22f5 100644 --- a/src/enumSchemaProperties.ts +++ b/src/enumschemaproperties.ts @@ -20,5 +20,5 @@ export interface EnumSchemaProperties { /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 } \ No newline at end of file diff --git a/src/environmentDef.ts b/src/environmentdef.ts similarity index 100% rename from src/environmentDef.ts rename to src/environmentdef.ts diff --git a/src/environmentDefProperties.ts b/src/environmentdefproperties.ts similarity index 100% rename from src/environmentDefProperties.ts rename to src/environmentdefproperties.ts diff --git a/src/envVarRequirement.ts b/src/envvarrequirement.ts similarity index 94% rename from src/envVarRequirement.ts rename to src/envvarrequirement.ts index 2e93dbf..1f03cf0 100644 --- a/src/envVarRequirement.ts +++ b/src/envvarrequirement.ts @@ -28,7 +28,7 @@ export class EnvVarRequirement extends Saveable implements Internal.EnvVarRequir /** * Always 'EnvVarRequirement' */ - class_: string + class_: Internal.EnvVarRequirement_class /** * The list of environment variables. @@ -36,7 +36,7 @@ export class EnvVarRequirement extends Saveable implements Internal.EnvVarRequir envDef: Array - constructor ({loadingOptions, extensionFields, class_, envDef} : {loadingOptions?: LoadingOptions} & Internal.EnvVarRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.EnvVarRequirement_class.ENVVARREQUIREMENT, envDef} : {loadingOptions?: LoadingOptions} & Internal.EnvVarRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/envvarrequirementclass.ts b/src/envvarrequirementclass.ts new file mode 100644 index 0000000..09f33d5 --- /dev/null +++ b/src/envvarrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum EnvVarRequirement_class { + ENVVARREQUIREMENT='EnvVarRequirement', +} diff --git a/src/envVarRequirementProperties.ts b/src/envvarrequirementproperties.ts similarity index 93% rename from src/envVarRequirementProperties.ts rename to src/envvarrequirementproperties.ts index 43bc746..742ab0f 100644 --- a/src/envVarRequirementProperties.ts +++ b/src/envvarrequirementproperties.ts @@ -16,7 +16,7 @@ export interface EnvVarRequirementProperties extends Internal.ProcessRequirement /** * Always 'EnvVarRequirement' */ - class_: string + class_: Internal.EnvVarRequirement_class /** * The list of environment variables. diff --git a/src/expression.ts b/src/expression.ts new file mode 100644 index 0000000..bfef605 --- /dev/null +++ b/src/expression.ts @@ -0,0 +1,4 @@ + +export enum Expression { + EXPRESSIONPLACEHOLDER='ExpressionPlaceholder', +} diff --git a/src/expressionTool.ts b/src/expressiontool.ts similarity index 97% rename from src/expressionTool.ts rename to src/expressiontool.ts index 7641d78..9e1d463 100644 --- a/src/expressionTool.ts +++ b/src/expressiontool.ts @@ -34,7 +34,7 @@ export class ExpressionTool extends Saveable implements Internal.ExpressionToolP * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.ExpressionTool_class /** * A short, human-readable label of this object. @@ -94,7 +94,7 @@ export class ExpressionTool extends Saveable implements Internal.ExpressionToolP * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. @@ -123,7 +123,7 @@ export class ExpressionTool extends Saveable implements Internal.ExpressionToolP expression: string - constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, expression} : {loadingOptions?: LoadingOptions} & Internal.ExpressionToolProperties) { + constructor ({loadingOptions, extensionFields, id, class_ = Internal.ExpressionTool_class.EXPRESSIONTOOL, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, expression} : {loadingOptions?: LoadingOptions} & Internal.ExpressionToolProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.id = id diff --git a/src/expressiontoolclass.ts b/src/expressiontoolclass.ts new file mode 100644 index 0000000..3786d43 --- /dev/null +++ b/src/expressiontoolclass.ts @@ -0,0 +1,4 @@ + +export enum ExpressionTool_class { + EXPRESSIONTOOL='ExpressionTool', +} diff --git a/src/expressionToolOutputParameter.ts b/src/expressiontooloutputparameter.ts similarity index 97% rename from src/expressionToolOutputParameter.ts rename to src/expressiontooloutputparameter.ts index 6e3063d..e47e3a7 100644 --- a/src/expressionToolOutputParameter.ts +++ b/src/expressiontooloutputparameter.ts @@ -106,7 +106,7 @@ export class ExpressionToolOutputParameter extends Saveable implements Internal. * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, type} : {loadingOptions?: LoadingOptions} & Internal.ExpressionToolOutputParameterProperties) { diff --git a/src/expressionToolOutputParameterProperties.ts b/src/expressiontooloutputparameterproperties.ts similarity index 94% rename from src/expressionToolOutputParameterProperties.ts rename to src/expressiontooloutputparameterproperties.ts index fe5200f..3fbcbe5 100644 --- a/src/expressionToolOutputParameterProperties.ts +++ b/src/expressiontooloutputparameterproperties.ts @@ -94,5 +94,5 @@ export interface ExpressionToolOutputParameterProperties extends Internal.Output * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array } \ No newline at end of file diff --git a/src/expressionToolProperties.ts b/src/expressiontoolproperties.ts similarity index 98% rename from src/expressionToolProperties.ts rename to src/expressiontoolproperties.ts index 83dbfdc..9f77356 100644 --- a/src/expressionToolProperties.ts +++ b/src/expressiontoolproperties.ts @@ -22,7 +22,7 @@ export interface ExpressionToolProperties extends Internal.ProcessProperties { * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.ExpressionTool_class /** * A short, human-readable label of this object. @@ -82,7 +82,7 @@ export interface ExpressionToolProperties extends Internal.ProcessProperties { * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. diff --git a/src/fieldBaseProperties.ts b/src/fieldbaseproperties.ts similarity index 100% rename from src/fieldBaseProperties.ts rename to src/fieldbaseproperties.ts diff --git a/src/file.ts b/src/file.ts index 3b09ee3..71908d1 100644 --- a/src/file.ts +++ b/src/file.ts @@ -92,7 +92,7 @@ export class File extends Saveable implements Internal.FileProperties { /** * Must be `File` to indicate this object describes a file. */ - class_: string + class_: Internal.File_class /** * An IRI that identifies the file resource. This may be a relative @@ -260,7 +260,7 @@ export class File extends Saveable implements Internal.FileProperties { contents?: undefined | string - constructor ({loadingOptions, extensionFields, class_, location, path, basename, dirname, nameroot, nameext, checksum, size, secondaryFiles, format, contents} : {loadingOptions?: LoadingOptions} & Internal.FileProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.File_class.FILE, location, path, basename, dirname, nameroot, nameext, checksum, size, secondaryFiles, format, contents} : {loadingOptions?: LoadingOptions} & Internal.FileProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/fileclass.ts b/src/fileclass.ts new file mode 100644 index 0000000..267ce3c --- /dev/null +++ b/src/fileclass.ts @@ -0,0 +1,4 @@ + +export enum File_class { + FILE='File', +} diff --git a/src/fileProperties.ts b/src/fileproperties.ts similarity index 99% rename from src/fileProperties.ts rename to src/fileproperties.ts index 37196df..3eaa6dc 100644 --- a/src/fileProperties.ts +++ b/src/fileproperties.ts @@ -80,7 +80,7 @@ export interface FileProperties { /** * Must be `File` to indicate this object describes a file. */ - class_: string + class_: Internal.File_class /** * An IRI that identifies the file resource. This may be a relative diff --git a/src/identifiedProperties.ts b/src/identifiedproperties.ts similarity index 100% rename from src/identifiedProperties.ts rename to src/identifiedproperties.ts diff --git a/src/index.ts b/src/index.ts index c2025be..4492226 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,143 +1,181 @@ export { loadDocument, loadDocumentByString, - DocumentedProperties, - RecordFieldProperties, - RecordField, + SoftwarePackageProperties, RecordSchemaProperties, - RecordSchema, - EnumSchemaProperties, - EnumSchema, - ArraySchemaProperties, - ArraySchema, - FileProperties, - File, - DirectoryProperties, + InplaceUpdateRequirement_class, + MultipleInputFeatureRequirementProperties, + SchemaDefRequirement_class, + NetworkAccess_class, Directory, - LabeledProperties, - IdentifiedProperties, - LoadContentsProperties, - FieldBaseProperties, - InputFormatProperties, - OutputFormatProperties, - ParameterProperties, + CommandInputArraySchemaProperties, + WorkflowStepInputProperties, + CommandInputEnumSchema, + EnvVarRequirementProperties, + SecondaryFileSchemaProperties, + CWLVersion, + InplaceUpdateRequirementProperties, + OperationProperties, + RecordFieldProperties, + MultipleInputFeatureRequirement_class, + SubworkflowFeatureRequirement_class, InputBindingProperties, - InputBinding, - IOSchemaProperties, - InputSchemaProperties, - OutputSchemaProperties, - InputRecordFieldProperties, - InputRecordField, - InputRecordSchemaProperties, - InputRecordSchema, - InputEnumSchemaProperties, - InputEnumSchema, - InputArraySchemaProperties, - InputArraySchema, - OutputRecordFieldProperties, - OutputRecordField, - OutputRecordSchemaProperties, - OutputRecordSchema, - OutputEnumSchemaProperties, + EnvVarRequirement, OutputEnumSchema, - OutputArraySchemaProperties, - OutputArraySchema, - InputParameterProperties, - OutputParameterProperties, - ProcessRequirementProperties, - ProcessProperties, + StepInputExpressionRequirement, + WorkflowInputParameterProperties, + CommandLineTool_class, + ResourceRequirement, + Operation, + CommandInputRecordField, + CommandInputArraySchema, + OperationOutputParameterProperties, + EnvVarRequirement_class, + ArraySchemaProperties, InlineJavascriptRequirementProperties, - InlineJavascriptRequirement, - CommandInputSchemaProperties, - SchemaDefRequirementProperties, + InplaceUpdateRequirement, + LoadListingRequirement_class, + InlineJavascriptRequirement_class, + ScatterFeatureRequirementProperties, + CommandOutputBinding, + CWLType, + CommandOutputRecordField, + InputBinding, + Dirent, + ShellCommandRequirement, + StepInputExpressionRequirementProperties, SchemaDefRequirement, - SecondaryFileSchemaProperties, - SecondaryFileSchema, - LoadListingRequirementProperties, - LoadListingRequirement, - EnvironmentDefProperties, - EnvironmentDef, - CommandLineBindingProperties, - CommandLineBinding, + ExpressionToolOutputParameterProperties, + ExpressionTool, + stderr, + ArraySchema, + LabeledProperties, CommandOutputBindingProperties, - CommandOutputBinding, - CommandLineBindableProperties, + SoftwarePackage, + EnumSchemaProperties, + StepInputExpressionRequirement_class, + ScatterMethod, + WorkflowStepOutputProperties, + stdout, + File, + ScatterFeatureRequirement, + EnumSchema, + ShellCommandRequirement_class, + SecondaryFileSchema, + InputParameterProperties, + SoftwareRequirement_class, + WorkflowProperties, + InputFormatProperties, CommandLineBindable, - CommandInputRecordFieldProperties, - CommandInputRecordField, - CommandInputRecordSchemaProperties, - CommandInputRecordSchema, CommandInputEnumSchemaProperties, - CommandInputEnumSchema, - CommandInputArraySchemaProperties, - CommandInputArraySchema, - CommandOutputRecordFieldProperties, - CommandOutputRecordField, + enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, + FieldBaseProperties, + InputRecordFieldProperties, + CommandInputSchemaProperties, + CommandOutputParameter, + WorkflowStepOutput, + OperationOutputParameter, + OperationInputParameterProperties, + WorkflowOutputParameterProperties, + CommandOutputEnumSchema, + CommandOutputEnumSchemaProperties, + ExpressionToolProperties, CommandOutputRecordSchemaProperties, + SubworkflowFeatureRequirementProperties, + LoadListingRequirementProperties, + OutputRecordSchemaProperties, + IdentifiedProperties, + LoadContentsProperties, + EnvironmentDefProperties, + ResourceRequirement_class, + enum_d961d79c225752b9fadb617367615ab176b47d77, + ProcessRequirementProperties, + SchemaDefRequirementProperties, + WorkReuseProperties, + enum_d9cba076fca539106791a4f46d198c7fcfbdb779, + InputRecordSchemaProperties, + WorkflowStep, + Operation_class, + NetworkAccess, + FileProperties, + DirentProperties, + InitialWorkDirRequirement_class, + ResourceRequirementProperties, CommandOutputRecordSchema, - CommandOutputEnumSchemaProperties, - CommandOutputEnumSchema, - CommandOutputArraySchemaProperties, - CommandOutputArraySchema, - CommandInputParameterProperties, - CommandInputParameter, + CommandOutputRecordFieldProperties, + OutputRecordFieldProperties, + PrimitiveType, + InputRecordSchema, + DockerRequirement, + CommandLineBindableProperties, + ParameterProperties, + SoftwareRequirement, + InputSchemaProperties, + PickValueMethod, + CommandInputRecordSchema, + SoftwareRequirementProperties, + WorkflowInputParameter, CommandOutputParameterProperties, - CommandOutputParameter, + stdin, + SinkProperties, + CommandOutputArraySchema, + WorkReuse_class, + RecordSchema, + File_class, + WorkflowStepInput, + OutputEnumSchemaProperties, + CommandInputRecordSchemaProperties, + EnvironmentDef, + OperationInputParameter, + MultipleInputFeatureRequirement, + CommandLineBinding, + DocumentedProperties, CommandLineToolProperties, - CommandLineTool, + OutputParameterProperties, + ToolTimeLimit_class, + Any, DockerRequirementProperties, - DockerRequirement, - SoftwareRequirementProperties, - SoftwareRequirement, - SoftwarePackageProperties, - SoftwarePackage, - DirentProperties, - Dirent, - InitialWorkDirRequirementProperties, - InitialWorkDirRequirement, - EnvVarRequirementProperties, - EnvVarRequirement, + LinkMergeMethod, + InputArraySchema, + OutputRecordSchema, + IOSchemaProperties, + DockerRequirement_class, + CommandOutputArraySchemaProperties, + ToolTimeLimitProperties, + Workflow, ShellCommandRequirementProperties, - ShellCommandRequirement, - ResourceRequirementProperties, - ResourceRequirement, - WorkReuseProperties, - WorkReuse, + OutputArraySchemaProperties, NetworkAccessProperties, - NetworkAccess, - InplaceUpdateRequirementProperties, - InplaceUpdateRequirement, - ToolTimeLimitProperties, - ToolTimeLimit, - ExpressionToolOutputParameterProperties, + Expression, ExpressionToolOutputParameter, - WorkflowInputParameterProperties, - WorkflowInputParameter, - ExpressionToolProperties, - ExpressionTool, - WorkflowOutputParameterProperties, + ExpressionTool_class, + RecordField, + DirectoryProperties, + CommandInputParameterProperties, + ScatterFeatureRequirement_class, + ToolTimeLimit, + ProcessProperties, + InputArraySchemaProperties, + Workflow_class, + InputRecordField, + InitialWorkDirRequirement, + SubworkflowFeatureRequirement, + LoadListingRequirement, + Directory_class, + CommandLineBindingProperties, + LoadListingEnum, + InlineJavascriptRequirement, + InputEnumSchemaProperties, + CommandLineTool, + WorkReuse, + OutputArraySchema, + InitialWorkDirRequirementProperties, + CommandInputParameter, WorkflowOutputParameter, - SinkProperties, - WorkflowStepInputProperties, - WorkflowStepInput, - WorkflowStepOutputProperties, - WorkflowStepOutput, + InputEnumSchema, + CommandInputRecordFieldProperties, + OutputSchemaProperties, + OutputFormatProperties, WorkflowStepProperties, - WorkflowStep, - WorkflowProperties, - Workflow, - SubworkflowFeatureRequirementProperties, - SubworkflowFeatureRequirement, - ScatterFeatureRequirementProperties, - ScatterFeatureRequirement, - MultipleInputFeatureRequirementProperties, - MultipleInputFeatureRequirement, - StepInputExpressionRequirementProperties, - StepInputExpressionRequirement, - OperationInputParameterProperties, - OperationInputParameter, - OperationOutputParameterProperties, - OperationOutputParameter, - OperationProperties, - Operation + OutputRecordField } from './util/internal' \ No newline at end of file diff --git a/src/initialWorkDirRequirement.ts b/src/initialworkdirrequirement.ts similarity index 95% rename from src/initialWorkDirRequirement.ts rename to src/initialworkdirrequirement.ts index 10bcb80..21ce39f 100644 --- a/src/initialWorkDirRequirement.ts +++ b/src/initialworkdirrequirement.ts @@ -27,7 +27,7 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Init /** * InitialWorkDirRequirement */ - class_: string + class_: Internal.InitialWorkDirRequirement_class /** * The list of files or subdirectories that must be staged prior @@ -59,7 +59,7 @@ export class InitialWorkDirRequirement extends Saveable implements Internal.Init listing?: string | Array> - constructor ({loadingOptions, extensionFields, class_, listing} : {loadingOptions?: LoadingOptions} & Internal.InitialWorkDirRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.InitialWorkDirRequirement_class.INITIALWORKDIRREQUIREMENT, listing} : {loadingOptions?: LoadingOptions} & Internal.InitialWorkDirRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/initialworkdirrequirementclass.ts b/src/initialworkdirrequirementclass.ts new file mode 100644 index 0000000..3688c00 --- /dev/null +++ b/src/initialworkdirrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum InitialWorkDirRequirement_class { + INITIALWORKDIRREQUIREMENT='InitialWorkDirRequirement', +} diff --git a/src/initialWorkDirRequirementProperties.ts b/src/initialworkdirrequirementproperties.ts similarity index 97% rename from src/initialWorkDirRequirementProperties.ts rename to src/initialworkdirrequirementproperties.ts index 93e3e95..63fbef4 100644 --- a/src/initialWorkDirRequirementProperties.ts +++ b/src/initialworkdirrequirementproperties.ts @@ -15,7 +15,7 @@ export interface InitialWorkDirRequirementProperties extends Internal.ProcessReq /** * InitialWorkDirRequirement */ - class_: string + class_: Internal.InitialWorkDirRequirement_class /** * The list of files or subdirectories that must be staged prior diff --git a/src/inlineJavascriptRequirement.ts b/src/inlinejavascriptrequirement.ts similarity index 94% rename from src/inlineJavascriptRequirement.ts rename to src/inlinejavascriptrequirement.ts index 88946fa..6d1af54 100644 --- a/src/inlineJavascriptRequirement.ts +++ b/src/inlinejavascriptrequirement.ts @@ -29,7 +29,7 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.In /** * Always 'InlineJavascriptRequirement' */ - class_: string + class_: Internal.InlineJavascriptRequirement_class /** * Additional code fragments that will also be inserted @@ -40,7 +40,7 @@ export class InlineJavascriptRequirement extends Saveable implements Internal.In expressionLib?: undefined | Array - constructor ({loadingOptions, extensionFields, class_, expressionLib} : {loadingOptions?: LoadingOptions} & Internal.InlineJavascriptRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.InlineJavascriptRequirement_class.INLINEJAVASCRIPTREQUIREMENT, expressionLib} : {loadingOptions?: LoadingOptions} & Internal.InlineJavascriptRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/inlinejavascriptrequirementclass.ts b/src/inlinejavascriptrequirementclass.ts new file mode 100644 index 0000000..bc15b80 --- /dev/null +++ b/src/inlinejavascriptrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum InlineJavascriptRequirement_class { + INLINEJAVASCRIPTREQUIREMENT='InlineJavascriptRequirement', +} diff --git a/src/inlineJavascriptRequirementProperties.ts b/src/inlinejavascriptrequirementproperties.ts similarity index 93% rename from src/inlineJavascriptRequirementProperties.ts rename to src/inlinejavascriptrequirementproperties.ts index 69770a9..4d6a73f 100644 --- a/src/inlineJavascriptRequirementProperties.ts +++ b/src/inlinejavascriptrequirementproperties.ts @@ -17,7 +17,7 @@ export interface InlineJavascriptRequirementProperties extends Internal.ProcessR /** * Always 'InlineJavascriptRequirement' */ - class_: string + class_: Internal.InlineJavascriptRequirement_class /** * Additional code fragments that will also be inserted diff --git a/src/inplaceUpdateRequirement.ts b/src/inplaceupdaterequirement.ts similarity index 95% rename from src/inplaceUpdateRequirement.ts rename to src/inplaceupdaterequirement.ts index 459244c..d62780d 100644 --- a/src/inplaceUpdateRequirement.ts +++ b/src/inplaceupdaterequirement.ts @@ -56,11 +56,11 @@ export class InplaceUpdateRequirement extends Saveable implements Internal.Inpla /** * Always 'InplaceUpdateRequirement' */ - class_: string + class_: Internal.InplaceUpdateRequirement_class inplaceUpdate: boolean - constructor ({loadingOptions, extensionFields, class_, inplaceUpdate} : {loadingOptions?: LoadingOptions} & Internal.InplaceUpdateRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.InplaceUpdateRequirement_class.INPLACEUPDATEREQUIREMENT, inplaceUpdate} : {loadingOptions?: LoadingOptions} & Internal.InplaceUpdateRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/inplaceupdaterequirementclass.ts b/src/inplaceupdaterequirementclass.ts new file mode 100644 index 0000000..9d81122 --- /dev/null +++ b/src/inplaceupdaterequirementclass.ts @@ -0,0 +1,4 @@ + +export enum InplaceUpdateRequirement_class { + INPLACEUPDATEREQUIREMENT='InplaceUpdateRequirement', +} diff --git a/src/inplaceUpdateRequirementProperties.ts b/src/inplaceupdaterequirementproperties.ts similarity index 97% rename from src/inplaceUpdateRequirementProperties.ts rename to src/inplaceupdaterequirementproperties.ts index fd09c5a..7f80240 100644 --- a/src/inplaceUpdateRequirementProperties.ts +++ b/src/inplaceupdaterequirementproperties.ts @@ -44,6 +44,6 @@ export interface InplaceUpdateRequirementProperties extends Internal.ProcessRequ /** * Always 'InplaceUpdateRequirement' */ - class_: string + class_: Internal.InplaceUpdateRequirement_class inplaceUpdate: boolean } \ No newline at end of file diff --git a/src/inputArraySchema.ts b/src/inputarrayschema.ts similarity index 95% rename from src/inputArraySchema.ts rename to src/inputarrayschema.ts index 8ffd627..f593d2f 100644 --- a/src/inputArraySchema.ts +++ b/src/inputarrayschema.ts @@ -29,12 +29,12 @@ export class InputArraySchema extends Saveable implements Internal.InputArraySch /** * Defines the type of the array elements. */ - items: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + items: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/inputArraySchemaProperties.ts b/src/inputarrayschemaproperties.ts similarity index 71% rename from src/inputArraySchemaProperties.ts rename to src/inputarrayschemaproperties.ts index e47a40c..4c26bf5 100644 --- a/src/inputArraySchemaProperties.ts +++ b/src/inputarrayschemaproperties.ts @@ -17,12 +17,12 @@ export interface InputArraySchemaProperties extends Internal.ArraySchemaProperti /** * Defines the type of the array elements. */ - items: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + items: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/inputBinding.ts b/src/inputbinding.ts similarity index 100% rename from src/inputBinding.ts rename to src/inputbinding.ts diff --git a/src/inputBindingProperties.ts b/src/inputbindingproperties.ts similarity index 100% rename from src/inputBindingProperties.ts rename to src/inputbindingproperties.ts diff --git a/src/inputEnumSchema.ts b/src/inputenumschema.ts similarity index 99% rename from src/inputEnumSchema.ts rename to src/inputenumschema.ts index c7a2600..a5370c5 100644 --- a/src/inputEnumSchema.ts +++ b/src/inputenumschema.ts @@ -34,7 +34,7 @@ export class InputEnumSchema extends Saveable implements Internal.InputEnumSchem /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/inputEnumSchemaProperties.ts b/src/inputenumschemaproperties.ts similarity index 92% rename from src/inputEnumSchemaProperties.ts rename to src/inputenumschemaproperties.ts index 261eea6..6db7bd8 100644 --- a/src/inputEnumSchemaProperties.ts +++ b/src/inputenumschemaproperties.ts @@ -22,7 +22,7 @@ export interface InputEnumSchemaProperties extends Internal.EnumSchemaProperties /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/inputFormatProperties.ts b/src/inputformatproperties.ts similarity index 100% rename from src/inputFormatProperties.ts rename to src/inputformatproperties.ts diff --git a/src/inputParameterProperties.ts b/src/inputparameterproperties.ts similarity index 98% rename from src/inputParameterProperties.ts rename to src/inputparameterproperties.ts index 224cc1c..d40aee5 100644 --- a/src/inputParameterProperties.ts +++ b/src/inputparameterproperties.ts @@ -116,7 +116,7 @@ export interface InputParameterProperties extends Internal.ParameterProperties, * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing diff --git a/src/inputRecordField.ts b/src/inputrecordfield.ts similarity index 98% rename from src/inputRecordField.ts rename to src/inputrecordfield.ts index c1afbb0..8cf3844 100644 --- a/src/inputRecordField.ts +++ b/src/inputrecordfield.ts @@ -36,7 +36,7 @@ export class InputRecordField extends Saveable implements Internal.InputRecordFi * The field type * */ - type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + type: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array /** * A short, human-readable label of this object. @@ -137,7 +137,7 @@ export class InputRecordField extends Saveable implements Internal.InputRecordFi * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum constructor ({loadingOptions, extensionFields, name, doc, type, label, secondaryFiles, streamable, format, loadContents, loadListing} : {loadingOptions?: LoadingOptions} & Internal.InputRecordFieldProperties) { diff --git a/src/inputRecordFieldProperties.ts b/src/inputrecordfieldproperties.ts similarity index 94% rename from src/inputRecordFieldProperties.ts rename to src/inputrecordfieldproperties.ts index 8d82820..a08c846 100644 --- a/src/inputRecordFieldProperties.ts +++ b/src/inputrecordfieldproperties.ts @@ -24,7 +24,7 @@ export interface InputRecordFieldProperties extends Internal.RecordFieldProperti * The field type * */ - type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + type: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array /** * A short, human-readable label of this object. @@ -125,5 +125,5 @@ export interface InputRecordFieldProperties extends Internal.RecordFieldProperti * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum } \ No newline at end of file diff --git a/src/inputRecordSchema.ts b/src/inputrecordschema.ts similarity index 99% rename from src/inputRecordSchema.ts rename to src/inputrecordschema.ts index c043dda..8c398c6 100644 --- a/src/inputRecordSchema.ts +++ b/src/inputrecordschema.ts @@ -34,7 +34,7 @@ export class InputRecordSchema extends Saveable implements Internal.InputRecordS /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/inputRecordSchemaProperties.ts b/src/inputrecordschemaproperties.ts similarity index 92% rename from src/inputRecordSchemaProperties.ts rename to src/inputrecordschemaproperties.ts index e839170..726b4c1 100644 --- a/src/inputRecordSchemaProperties.ts +++ b/src/inputrecordschemaproperties.ts @@ -22,7 +22,7 @@ export interface InputRecordSchemaProperties extends Internal.RecordSchemaProper /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/inputSchemaProperties.ts b/src/inputschemaproperties.ts similarity index 100% rename from src/inputSchemaProperties.ts rename to src/inputschemaproperties.ts diff --git a/src/iOSchemaProperties.ts b/src/ioschemaproperties.ts similarity index 100% rename from src/iOSchemaProperties.ts rename to src/ioschemaproperties.ts diff --git a/src/labeledProperties.ts b/src/labeledproperties.ts similarity index 100% rename from src/labeledProperties.ts rename to src/labeledproperties.ts diff --git a/src/linkmergemethod.ts b/src/linkmergemethod.ts new file mode 100644 index 0000000..3e5f9e1 --- /dev/null +++ b/src/linkmergemethod.ts @@ -0,0 +1,5 @@ + +export enum LinkMergeMethod { + MERGE_NESTED='merge_nested', + MERGE_FLATTENED='merge_flattened', +} diff --git a/src/loadContentsProperties.ts b/src/loadcontentsproperties.ts similarity index 95% rename from src/loadContentsProperties.ts rename to src/loadcontentsproperties.ts index 1414c2c..15671ce 100644 --- a/src/loadContentsProperties.ts +++ b/src/loadcontentsproperties.ts @@ -33,5 +33,5 @@ export interface LoadContentsProperties { * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum } \ No newline at end of file diff --git a/src/loadlistingenum.ts b/src/loadlistingenum.ts new file mode 100644 index 0000000..e81b208 --- /dev/null +++ b/src/loadlistingenum.ts @@ -0,0 +1,6 @@ + +export enum LoadListingEnum { + NO_LISTING='no_listing', + SHALLOW_LISTING='shallow_listing', + DEEP_LISTING='deep_listing', +} diff --git a/src/loadListingRequirement.ts b/src/loadlistingrequirement.ts similarity index 93% rename from src/loadListingRequirement.ts rename to src/loadlistingrequirement.ts index 5cf2218..367d602 100644 --- a/src/loadListingRequirement.ts +++ b/src/loadlistingrequirement.ts @@ -28,11 +28,11 @@ export class LoadListingRequirement extends Saveable implements Internal.LoadLis /** * Always 'LoadListingRequirement' */ - class_: string - loadListing?: undefined | string + class_: Internal.LoadListingRequirement_class + loadListing?: undefined | Internal.LoadListingEnum - constructor ({loadingOptions, extensionFields, class_, loadListing} : {loadingOptions?: LoadingOptions} & Internal.LoadListingRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.LoadListingRequirement_class.LOADLISTINGREQUIREMENT, loadListing} : {loadingOptions?: LoadingOptions} & Internal.LoadListingRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/loadlistingrequirementclass.ts b/src/loadlistingrequirementclass.ts new file mode 100644 index 0000000..cab450c --- /dev/null +++ b/src/loadlistingrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum LoadListingRequirement_class { + LOADLISTINGREQUIREMENT='LoadListingRequirement', +} diff --git a/src/loadListingRequirementProperties.ts b/src/loadlistingrequirementproperties.ts similarity index 82% rename from src/loadListingRequirementProperties.ts rename to src/loadlistingrequirementproperties.ts index 1454439..dc7e532 100644 --- a/src/loadListingRequirementProperties.ts +++ b/src/loadlistingrequirementproperties.ts @@ -16,6 +16,6 @@ export interface LoadListingRequirementProperties extends Internal.ProcessRequir /** * Always 'LoadListingRequirement' */ - class_: string - loadListing?: undefined | string + class_: Internal.LoadListingRequirement_class + loadListing?: undefined | Internal.LoadListingEnum } \ No newline at end of file diff --git a/src/multipleInputFeatureRequirement.ts b/src/multipleinputfeaturerequirement.ts similarity index 93% rename from src/multipleInputFeatureRequirement.ts rename to src/multipleinputfeaturerequirement.ts index 64ac424..18500cb 100644 --- a/src/multipleInputFeatureRequirement.ts +++ b/src/multipleinputfeaturerequirement.ts @@ -28,10 +28,10 @@ export class MultipleInputFeatureRequirement extends Saveable implements Interna /** * Always 'MultipleInputFeatureRequirement' */ - class_: string + class_: Internal.MultipleInputFeatureRequirement_class - constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.MultipleInputFeatureRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.MultipleInputFeatureRequirement_class.MULTIPLEINPUTFEATUREREQUIREMENT} : {loadingOptions?: LoadingOptions} & Internal.MultipleInputFeatureRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/multipleinputfeaturerequirementclass.ts b/src/multipleinputfeaturerequirementclass.ts new file mode 100644 index 0000000..c6c055e --- /dev/null +++ b/src/multipleinputfeaturerequirementclass.ts @@ -0,0 +1,4 @@ + +export enum MultipleInputFeatureRequirement_class { + MULTIPLEINPUTFEATUREREQUIREMENT='MultipleInputFeatureRequirement', +} diff --git a/src/multipleInputFeatureRequirementProperties.ts b/src/multipleinputfeaturerequirementproperties.ts similarity index 90% rename from src/multipleInputFeatureRequirementProperties.ts rename to src/multipleinputfeaturerequirementproperties.ts index 6a03863..74be725 100644 --- a/src/multipleInputFeatureRequirementProperties.ts +++ b/src/multipleinputfeaturerequirementproperties.ts @@ -16,5 +16,5 @@ export interface MultipleInputFeatureRequirementProperties extends Internal.Proc /** * Always 'MultipleInputFeatureRequirement' */ - class_: string + class_: Internal.MultipleInputFeatureRequirement_class } \ No newline at end of file diff --git a/src/networkAccess.ts b/src/networkaccess.ts similarity index 95% rename from src/networkAccess.ts rename to src/networkaccess.ts index a996155..d8c5a1b 100644 --- a/src/networkAccess.ts +++ b/src/networkaccess.ts @@ -41,11 +41,11 @@ export class NetworkAccess extends Saveable implements Internal.NetworkAccessPro /** * Always 'NetworkAccess' */ - class_: string + class_: Internal.NetworkAccess_class networkAccess: boolean | string - constructor ({loadingOptions, extensionFields, class_, networkAccess} : {loadingOptions?: LoadingOptions} & Internal.NetworkAccessProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.NetworkAccess_class.NETWORKACCESS, networkAccess} : {loadingOptions?: LoadingOptions} & Internal.NetworkAccessProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/networkaccessclass.ts b/src/networkaccessclass.ts new file mode 100644 index 0000000..29e1872 --- /dev/null +++ b/src/networkaccessclass.ts @@ -0,0 +1,4 @@ + +export enum NetworkAccess_class { + NETWORKACCESS='NetworkAccess', +} diff --git a/src/networkAccessProperties.ts b/src/networkaccessproperties.ts similarity index 96% rename from src/networkAccessProperties.ts rename to src/networkaccessproperties.ts index d3a2ca9..5955249 100644 --- a/src/networkAccessProperties.ts +++ b/src/networkaccessproperties.ts @@ -29,6 +29,6 @@ export interface NetworkAccessProperties extends Internal.ProcessRequirementProp /** * Always 'NetworkAccess' */ - class_: string + class_: Internal.NetworkAccess_class networkAccess: boolean | string } \ No newline at end of file diff --git a/src/operation.ts b/src/operation.ts index 813b964..6e9f4ec 100644 --- a/src/operation.ts +++ b/src/operation.ts @@ -34,7 +34,7 @@ export class Operation extends Saveable implements Internal.OperationProperties * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.Operation_class /** * A short, human-readable label of this object. @@ -94,7 +94,7 @@ export class Operation extends Saveable implements Internal.OperationProperties * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. @@ -115,7 +115,7 @@ export class Operation extends Saveable implements Internal.OperationProperties intent?: undefined | Array - constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent} : {loadingOptions?: LoadingOptions} & Internal.OperationProperties) { + constructor ({loadingOptions, extensionFields, id, class_ = Internal.Operation_class.OPERATION, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent} : {loadingOptions?: LoadingOptions} & Internal.OperationProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.id = id diff --git a/src/operationclass.ts b/src/operationclass.ts new file mode 100644 index 0000000..85b9ed7 --- /dev/null +++ b/src/operationclass.ts @@ -0,0 +1,4 @@ + +export enum Operation_class { + OPERATION='Operation', +} diff --git a/src/operationInputParameter.ts b/src/operationinputparameter.ts similarity index 98% rename from src/operationInputParameter.ts rename to src/operationinputparameter.ts index c46708a..1b8a3f0 100644 --- a/src/operationInputParameter.ts +++ b/src/operationinputparameter.ts @@ -133,7 +133,7 @@ export class OperationInputParameter extends Saveable implements Internal.Operat * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing @@ -148,7 +148,7 @@ export class OperationInputParameter extends Saveable implements Internal.Operat * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + type: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, loadContents, loadListing, default_, type} : {loadingOptions?: LoadingOptions} & Internal.OperationInputParameterProperties) { diff --git a/src/operationInputParameterProperties.ts b/src/operationinputparameterproperties.ts similarity index 94% rename from src/operationInputParameterProperties.ts rename to src/operationinputparameterproperties.ts index 5d4aa32..7c0a21d 100644 --- a/src/operationInputParameterProperties.ts +++ b/src/operationinputparameterproperties.ts @@ -121,7 +121,7 @@ export interface OperationInputParameterProperties extends Internal.InputParamet * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing @@ -136,5 +136,5 @@ export interface OperationInputParameterProperties extends Internal.InputParamet * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + type: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array } \ No newline at end of file diff --git a/src/operationOutputParameter.ts b/src/operationoutputparameter.ts similarity index 97% rename from src/operationOutputParameter.ts rename to src/operationoutputparameter.ts index 90fbe62..9b9e21e 100644 --- a/src/operationOutputParameter.ts +++ b/src/operationoutputparameter.ts @@ -109,7 +109,7 @@ export class OperationOutputParameter extends Saveable implements Internal.Opera * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, type} : {loadingOptions?: LoadingOptions} & Internal.OperationOutputParameterProperties) { diff --git a/src/operationOutputParameterProperties.ts b/src/operationoutputparameterproperties.ts similarity index 94% rename from src/operationOutputParameterProperties.ts rename to src/operationoutputparameterproperties.ts index 4c958c1..c614193 100644 --- a/src/operationOutputParameterProperties.ts +++ b/src/operationoutputparameterproperties.ts @@ -97,5 +97,5 @@ export interface OperationOutputParameterProperties extends Internal.OutputParam * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array } \ No newline at end of file diff --git a/src/operationProperties.ts b/src/operationproperties.ts similarity index 98% rename from src/operationProperties.ts rename to src/operationproperties.ts index 2ea635f..e254c77 100644 --- a/src/operationProperties.ts +++ b/src/operationproperties.ts @@ -22,7 +22,7 @@ export interface OperationProperties extends Internal.ProcessProperties { * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.Operation_class /** * A short, human-readable label of this object. @@ -82,7 +82,7 @@ export interface OperationProperties extends Internal.ProcessProperties { * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. diff --git a/src/outputArraySchema.ts b/src/outputarrayschema.ts similarity index 95% rename from src/outputArraySchema.ts rename to src/outputarrayschema.ts index ad8c923..482cd1e 100644 --- a/src/outputArraySchema.ts +++ b/src/outputarrayschema.ts @@ -29,12 +29,12 @@ export class OutputArraySchema extends Saveable implements Internal.OutputArrayS /** * Defines the type of the array elements. */ - items: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + items: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/outputArraySchemaProperties.ts b/src/outputarrayschemaproperties.ts similarity index 70% rename from src/outputArraySchemaProperties.ts rename to src/outputarrayschemaproperties.ts index 444ce00..450c00d 100644 --- a/src/outputArraySchemaProperties.ts +++ b/src/outputarrayschemaproperties.ts @@ -17,12 +17,12 @@ export interface OutputArraySchemaProperties extends Internal.ArraySchemaPropert /** * Defines the type of the array elements. */ - items: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + items: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array /** * Must be `array` */ - type: string + type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc /** * A short, human-readable label of this object. diff --git a/src/outputEnumSchema.ts b/src/outputenumschema.ts similarity index 99% rename from src/outputEnumSchema.ts rename to src/outputenumschema.ts index 3dc041e..8ff7137 100644 --- a/src/outputEnumSchema.ts +++ b/src/outputenumschema.ts @@ -34,7 +34,7 @@ export class OutputEnumSchema extends Saveable implements Internal.OutputEnumSch /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/outputEnumSchemaProperties.ts b/src/outputenumschemaproperties.ts similarity index 92% rename from src/outputEnumSchemaProperties.ts rename to src/outputenumschemaproperties.ts index c64cfe3..19309e4 100644 --- a/src/outputEnumSchemaProperties.ts +++ b/src/outputenumschemaproperties.ts @@ -22,7 +22,7 @@ export interface OutputEnumSchemaProperties extends Internal.EnumSchemaPropertie /** * Must be `enum` */ - type: string + type: Internal.enum_d961d79c225752b9fadb617367615ab176b47d77 /** * A short, human-readable label of this object. diff --git a/src/outputFormatProperties.ts b/src/outputformatproperties.ts similarity index 100% rename from src/outputFormatProperties.ts rename to src/outputformatproperties.ts diff --git a/src/outputParameterProperties.ts b/src/outputparameterproperties.ts similarity index 100% rename from src/outputParameterProperties.ts rename to src/outputparameterproperties.ts diff --git a/src/outputRecordField.ts b/src/outputrecordfield.ts similarity index 97% rename from src/outputRecordField.ts rename to src/outputrecordfield.ts index 7db61c7..bcd39d4 100644 --- a/src/outputRecordField.ts +++ b/src/outputrecordfield.ts @@ -36,7 +36,7 @@ export class OutputRecordField extends Saveable implements Internal.OutputRecord * The field type * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array /** * A short, human-readable label of this object. diff --git a/src/outputRecordFieldProperties.ts b/src/outputrecordfieldproperties.ts similarity index 94% rename from src/outputRecordFieldProperties.ts rename to src/outputrecordfieldproperties.ts index 1efe637..547f148 100644 --- a/src/outputRecordFieldProperties.ts +++ b/src/outputrecordfieldproperties.ts @@ -24,7 +24,7 @@ export interface OutputRecordFieldProperties extends Internal.RecordFieldPropert * The field type * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array /** * A short, human-readable label of this object. diff --git a/src/outputRecordSchema.ts b/src/outputrecordschema.ts similarity index 99% rename from src/outputRecordSchema.ts rename to src/outputrecordschema.ts index 142910c..d3e5663 100644 --- a/src/outputRecordSchema.ts +++ b/src/outputrecordschema.ts @@ -34,7 +34,7 @@ export class OutputRecordSchema extends Saveable implements Internal.OutputRecor /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/outputRecordSchemaProperties.ts b/src/outputrecordschemaproperties.ts similarity index 92% rename from src/outputRecordSchemaProperties.ts rename to src/outputrecordschemaproperties.ts index a2d614d..24732b9 100644 --- a/src/outputRecordSchemaProperties.ts +++ b/src/outputrecordschemaproperties.ts @@ -22,7 +22,7 @@ export interface OutputRecordSchemaProperties extends Internal.RecordSchemaPrope /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 /** * A short, human-readable label of this object. diff --git a/src/outputSchemaProperties.ts b/src/outputschemaproperties.ts similarity index 100% rename from src/outputSchemaProperties.ts rename to src/outputschemaproperties.ts diff --git a/src/parameterProperties.ts b/src/parameterproperties.ts similarity index 100% rename from src/parameterProperties.ts rename to src/parameterproperties.ts diff --git a/src/pickvaluemethod.ts b/src/pickvaluemethod.ts new file mode 100644 index 0000000..1749c17 --- /dev/null +++ b/src/pickvaluemethod.ts @@ -0,0 +1,6 @@ + +export enum PickValueMethod { + FIRST_NON_NULL='first_non_null', + THE_ONLY_NON_NULL='the_only_non_null', + ALL_NON_NULL='all_non_null', +} diff --git a/src/primitivetype.ts b/src/primitivetype.ts new file mode 100644 index 0000000..9d0eedc --- /dev/null +++ b/src/primitivetype.ts @@ -0,0 +1,10 @@ + +export enum PrimitiveType { + NULL='null', + BOOLEAN='boolean', + INT='int', + LONG='long', + FLOAT='float', + DOUBLE='double', + STRING='string', +} diff --git a/src/processProperties.ts b/src/processproperties.ts similarity index 98% rename from src/processProperties.ts rename to src/processproperties.ts index b0f72a1..dc7f4c0 100644 --- a/src/processProperties.ts +++ b/src/processproperties.ts @@ -76,7 +76,7 @@ export interface ProcessProperties extends Internal.IdentifiedProperties, Intern * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. diff --git a/src/processRequirementProperties.ts b/src/processrequirementproperties.ts similarity index 100% rename from src/processRequirementProperties.ts rename to src/processrequirementproperties.ts diff --git a/src/recordField.ts b/src/recordfield.ts similarity index 96% rename from src/recordField.ts rename to src/recordfield.ts index 1cfb78b..a76dbae 100644 --- a/src/recordField.ts +++ b/src/recordfield.ts @@ -38,7 +38,7 @@ export class RecordField extends Saveable implements Internal.RecordFieldPropert * The field type * */ - type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + type: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string | Array constructor ({loadingOptions, extensionFields, name, doc, type} : {loadingOptions?: LoadingOptions} & Internal.RecordFieldProperties) { diff --git a/src/recordFieldProperties.ts b/src/recordfieldproperties.ts similarity index 72% rename from src/recordFieldProperties.ts rename to src/recordfieldproperties.ts index 378bacf..3dda229 100644 --- a/src/recordFieldProperties.ts +++ b/src/recordfieldproperties.ts @@ -26,5 +26,5 @@ export interface RecordFieldProperties extends Internal.DocumentedProperties { * The field type * */ - type: string | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Array + type: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string | Array } \ No newline at end of file diff --git a/src/recordSchema.ts b/src/recordschema.ts similarity index 98% rename from src/recordSchema.ts rename to src/recordschema.ts index f65dd72..a06a3e4 100644 --- a/src/recordSchema.ts +++ b/src/recordschema.ts @@ -29,7 +29,7 @@ export class RecordSchema extends Saveable implements Internal.RecordSchemaPrope /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 constructor ({loadingOptions, extensionFields, fields, type} : {loadingOptions?: LoadingOptions} & Internal.RecordSchemaProperties) { diff --git a/src/recordSchemaProperties.ts b/src/recordschemaproperties.ts similarity index 86% rename from src/recordSchemaProperties.ts rename to src/recordschemaproperties.ts index 7a431a3..fcc25e6 100644 --- a/src/recordSchemaProperties.ts +++ b/src/recordschemaproperties.ts @@ -17,5 +17,5 @@ export interface RecordSchemaProperties { /** * Must be `record` */ - type: string + type: Internal.enum_d9cba076fca539106791a4f46d198c7fcfbdb779 } \ No newline at end of file diff --git a/src/resourceRequirement.ts b/src/resourcerequirement.ts similarity index 97% rename from src/resourceRequirement.ts rename to src/resourcerequirement.ts index 74ce34f..e46583c 100644 --- a/src/resourceRequirement.ts +++ b/src/resourcerequirement.ts @@ -51,7 +51,7 @@ export class ResourceRequirement extends Saveable implements Internal.ResourceRe /** * Always 'ResourceRequirement' */ - class_: string + class_: Internal.ResourceRequirement_class /** * Minimum reserved number of CPU cores (default is 1). @@ -152,7 +152,7 @@ export class ResourceRequirement extends Saveable implements Internal.ResourceRe outdirMax?: undefined | number | string - constructor ({loadingOptions, extensionFields, class_, coresMin, coresMax, ramMin, ramMax, tmpdirMin, tmpdirMax, outdirMin, outdirMax} : {loadingOptions?: LoadingOptions} & Internal.ResourceRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.ResourceRequirement_class.RESOURCEREQUIREMENT, coresMin, coresMax, ramMin, ramMax, tmpdirMin, tmpdirMax, outdirMin, outdirMax} : {loadingOptions?: LoadingOptions} & Internal.ResourceRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/resourcerequirementclass.ts b/src/resourcerequirementclass.ts new file mode 100644 index 0000000..b619b2c --- /dev/null +++ b/src/resourcerequirementclass.ts @@ -0,0 +1,4 @@ + +export enum ResourceRequirement_class { + RESOURCEREQUIREMENT='ResourceRequirement', +} diff --git a/src/resourceRequirementProperties.ts b/src/resourcerequirementproperties.ts similarity index 99% rename from src/resourceRequirementProperties.ts rename to src/resourcerequirementproperties.ts index 9c83a53..6df3178 100644 --- a/src/resourceRequirementProperties.ts +++ b/src/resourcerequirementproperties.ts @@ -39,7 +39,7 @@ export interface ResourceRequirementProperties extends Internal.ProcessRequireme /** * Always 'ResourceRequirement' */ - class_: string + class_: Internal.ResourceRequirement_class /** * Minimum reserved number of CPU cores (default is 1). diff --git a/src/scatterFeatureRequirement.ts b/src/scatterfeaturerequirement.ts similarity index 93% rename from src/scatterFeatureRequirement.ts rename to src/scatterfeaturerequirement.ts index d09b5eb..5bb545f 100644 --- a/src/scatterFeatureRequirement.ts +++ b/src/scatterfeaturerequirement.ts @@ -28,10 +28,10 @@ export class ScatterFeatureRequirement extends Saveable implements Internal.Scat /** * Always 'ScatterFeatureRequirement' */ - class_: string + class_: Internal.ScatterFeatureRequirement_class - constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.ScatterFeatureRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.ScatterFeatureRequirement_class.SCATTERFEATUREREQUIREMENT} : {loadingOptions?: LoadingOptions} & Internal.ScatterFeatureRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/scatterfeaturerequirementclass.ts b/src/scatterfeaturerequirementclass.ts new file mode 100644 index 0000000..3991d23 --- /dev/null +++ b/src/scatterfeaturerequirementclass.ts @@ -0,0 +1,4 @@ + +export enum ScatterFeatureRequirement_class { + SCATTERFEATUREREQUIREMENT='ScatterFeatureRequirement', +} diff --git a/src/scatterFeatureRequirementProperties.ts b/src/scatterfeaturerequirementproperties.ts similarity index 91% rename from src/scatterFeatureRequirementProperties.ts rename to src/scatterfeaturerequirementproperties.ts index 74ebb04..3405c87 100644 --- a/src/scatterFeatureRequirementProperties.ts +++ b/src/scatterfeaturerequirementproperties.ts @@ -16,5 +16,5 @@ export interface ScatterFeatureRequirementProperties extends Internal.ProcessReq /** * Always 'ScatterFeatureRequirement' */ - class_: string + class_: Internal.ScatterFeatureRequirement_class } \ No newline at end of file diff --git a/src/scattermethod.ts b/src/scattermethod.ts new file mode 100644 index 0000000..c609cab --- /dev/null +++ b/src/scattermethod.ts @@ -0,0 +1,6 @@ + +export enum ScatterMethod { + DOTPRODUCT='dotproduct', + NESTED_CROSSPRODUCT='nested_crossproduct', + FLAT_CROSSPRODUCT='flat_crossproduct', +} diff --git a/src/schemaDefRequirement.ts b/src/schemadefrequirement.ts similarity index 95% rename from src/schemaDefRequirement.ts rename to src/schemadefrequirement.ts index 7523bb0..ca9cbc4 100644 --- a/src/schemaDefRequirement.ts +++ b/src/schemadefrequirement.ts @@ -38,7 +38,7 @@ export class SchemaDefRequirement extends Saveable implements Internal.SchemaDef /** * Always 'SchemaDefRequirement' */ - class_: string + class_: Internal.SchemaDefRequirement_class /** * The list of type definitions. @@ -46,7 +46,7 @@ export class SchemaDefRequirement extends Saveable implements Internal.SchemaDef types: Array - constructor ({loadingOptions, extensionFields, class_, types} : {loadingOptions?: LoadingOptions} & Internal.SchemaDefRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.SchemaDefRequirement_class.SCHEMADEFREQUIREMENT, types} : {loadingOptions?: LoadingOptions} & Internal.SchemaDefRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/schemadefrequirementclass.ts b/src/schemadefrequirementclass.ts new file mode 100644 index 0000000..e9e5207 --- /dev/null +++ b/src/schemadefrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum SchemaDefRequirement_class { + SCHEMADEFREQUIREMENT='SchemaDefRequirement', +} diff --git a/src/schemaDefRequirementProperties.ts b/src/schemadefrequirementproperties.ts similarity index 96% rename from src/schemaDefRequirementProperties.ts rename to src/schemadefrequirementproperties.ts index 655fbcb..7d1daef 100644 --- a/src/schemaDefRequirementProperties.ts +++ b/src/schemadefrequirementproperties.ts @@ -26,7 +26,7 @@ export interface SchemaDefRequirementProperties extends Internal.ProcessRequirem /** * Always 'SchemaDefRequirement' */ - class_: string + class_: Internal.SchemaDefRequirement_class /** * The list of type definitions. diff --git a/src/secondaryFileSchema.ts b/src/secondaryfileschema.ts similarity index 100% rename from src/secondaryFileSchema.ts rename to src/secondaryfileschema.ts diff --git a/src/secondaryFileSchemaProperties.ts b/src/secondaryfileschemaproperties.ts similarity index 100% rename from src/secondaryFileSchemaProperties.ts rename to src/secondaryfileschemaproperties.ts diff --git a/src/shellCommandRequirement.ts b/src/shellcommandrequirement.ts similarity index 94% rename from src/shellCommandRequirement.ts rename to src/shellcommandrequirement.ts index f182eb7..0203267 100644 --- a/src/shellCommandRequirement.ts +++ b/src/shellcommandrequirement.ts @@ -33,10 +33,10 @@ export class ShellCommandRequirement extends Saveable implements Internal.ShellC /** * Always 'ShellCommandRequirement' */ - class_: string + class_: Internal.ShellCommandRequirement_class - constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.ShellCommandRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.ShellCommandRequirement_class.SHELLCOMMANDREQUIREMENT} : {loadingOptions?: LoadingOptions} & Internal.ShellCommandRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/shellcommandrequirementclass.ts b/src/shellcommandrequirementclass.ts new file mode 100644 index 0000000..1f9eb1a --- /dev/null +++ b/src/shellcommandrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum ShellCommandRequirement_class { + SHELLCOMMANDREQUIREMENT='ShellCommandRequirement', +} diff --git a/src/shellCommandRequirementProperties.ts b/src/shellcommandrequirementproperties.ts similarity index 94% rename from src/shellCommandRequirementProperties.ts rename to src/shellcommandrequirementproperties.ts index 7f965d1..acef54d 100644 --- a/src/shellCommandRequirementProperties.ts +++ b/src/shellcommandrequirementproperties.ts @@ -21,5 +21,5 @@ export interface ShellCommandRequirementProperties extends Internal.ProcessRequi /** * Always 'ShellCommandRequirement' */ - class_: string + class_: Internal.ShellCommandRequirement_class } \ No newline at end of file diff --git a/src/sinkProperties.ts b/src/sinkproperties.ts similarity index 85% rename from src/sinkProperties.ts rename to src/sinkproperties.ts index 7ff9258..4ce8fb2 100644 --- a/src/sinkProperties.ts +++ b/src/sinkproperties.ts @@ -19,11 +19,11 @@ export interface SinkProperties { * If not specified, the default method is "merge_nested". * */ - linkMerge?: undefined | string + linkMerge?: undefined | Internal.LinkMergeMethod /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue?: undefined | string + pickValue?: undefined | Internal.PickValueMethod } \ No newline at end of file diff --git a/src/softwarePackage.ts b/src/softwarepackage.ts similarity index 100% rename from src/softwarePackage.ts rename to src/softwarepackage.ts diff --git a/src/softwarePackageProperties.ts b/src/softwarepackageproperties.ts similarity index 100% rename from src/softwarePackageProperties.ts rename to src/softwarepackageproperties.ts diff --git a/src/softwareRequirement.ts b/src/softwarerequirement.ts similarity index 94% rename from src/softwareRequirement.ts rename to src/softwarerequirement.ts index 232be8f..5717765 100644 --- a/src/softwareRequirement.ts +++ b/src/softwarerequirement.ts @@ -28,7 +28,7 @@ export class SoftwareRequirement extends Saveable implements Internal.SoftwareRe /** * Always 'SoftwareRequirement' */ - class_: string + class_: Internal.SoftwareRequirement_class /** * The list of software to be configured. @@ -36,7 +36,7 @@ export class SoftwareRequirement extends Saveable implements Internal.SoftwareRe packages: Array - constructor ({loadingOptions, extensionFields, class_, packages} : {loadingOptions?: LoadingOptions} & Internal.SoftwareRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.SoftwareRequirement_class.SOFTWAREREQUIREMENT, packages} : {loadingOptions?: LoadingOptions} & Internal.SoftwareRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/softwarerequirementclass.ts b/src/softwarerequirementclass.ts new file mode 100644 index 0000000..65d1229 --- /dev/null +++ b/src/softwarerequirementclass.ts @@ -0,0 +1,4 @@ + +export enum SoftwareRequirement_class { + SOFTWAREREQUIREMENT='SoftwareRequirement', +} diff --git a/src/softwareRequirementProperties.ts b/src/softwarerequirementproperties.ts similarity index 92% rename from src/softwareRequirementProperties.ts rename to src/softwarerequirementproperties.ts index bb078df..a068779 100644 --- a/src/softwareRequirementProperties.ts +++ b/src/softwarerequirementproperties.ts @@ -16,7 +16,7 @@ export interface SoftwareRequirementProperties extends Internal.ProcessRequireme /** * Always 'SoftwareRequirement' */ - class_: string + class_: Internal.SoftwareRequirement_class /** * The list of software to be configured. diff --git a/src/stderr.ts b/src/stderr.ts new file mode 100644 index 0000000..4e07b66 --- /dev/null +++ b/src/stderr.ts @@ -0,0 +1,4 @@ + +export enum stderr { + STDERR='stderr', +} diff --git a/src/stdin.ts b/src/stdin.ts new file mode 100644 index 0000000..d819711 --- /dev/null +++ b/src/stdin.ts @@ -0,0 +1,4 @@ + +export enum stdin { + STDIN='stdin', +} diff --git a/src/stdout.ts b/src/stdout.ts new file mode 100644 index 0000000..0da9a46 --- /dev/null +++ b/src/stdout.ts @@ -0,0 +1,4 @@ + +export enum stdout { + STDOUT='stdout', +} diff --git a/src/stepInputExpressionRequirement.ts b/src/stepinputexpressionrequirement.ts similarity index 93% rename from src/stepInputExpressionRequirement.ts rename to src/stepinputexpressionrequirement.ts index 9b3afa6..8830e3f 100644 --- a/src/stepInputExpressionRequirement.ts +++ b/src/stepinputexpressionrequirement.ts @@ -28,10 +28,10 @@ export class StepInputExpressionRequirement extends Saveable implements Internal /** * Always 'StepInputExpressionRequirement' */ - class_: string + class_: Internal.StepInputExpressionRequirement_class - constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.StepInputExpressionRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.StepInputExpressionRequirement_class.STEPINPUTEXPRESSIONREQUIREMENT} : {loadingOptions?: LoadingOptions} & Internal.StepInputExpressionRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/stepinputexpressionrequirementclass.ts b/src/stepinputexpressionrequirementclass.ts new file mode 100644 index 0000000..fd03a29 --- /dev/null +++ b/src/stepinputexpressionrequirementclass.ts @@ -0,0 +1,4 @@ + +export enum StepInputExpressionRequirement_class { + STEPINPUTEXPRESSIONREQUIREMENT='StepInputExpressionRequirement', +} diff --git a/src/stepInputExpressionRequirementProperties.ts b/src/stepinputexpressionrequirementproperties.ts similarity index 90% rename from src/stepInputExpressionRequirementProperties.ts rename to src/stepinputexpressionrequirementproperties.ts index 8a9d735..da265b6 100644 --- a/src/stepInputExpressionRequirementProperties.ts +++ b/src/stepinputexpressionrequirementproperties.ts @@ -16,5 +16,5 @@ export interface StepInputExpressionRequirementProperties extends Internal.Proce /** * Always 'StepInputExpressionRequirement' */ - class_: string + class_: Internal.StepInputExpressionRequirement_class } \ No newline at end of file diff --git a/src/subworkflowFeatureRequirement.ts b/src/subworkflowfeaturerequirement.ts similarity index 93% rename from src/subworkflowFeatureRequirement.ts rename to src/subworkflowfeaturerequirement.ts index 5770adf..c56aec8 100644 --- a/src/subworkflowFeatureRequirement.ts +++ b/src/subworkflowfeaturerequirement.ts @@ -28,10 +28,10 @@ export class SubworkflowFeatureRequirement extends Saveable implements Internal. /** * Always 'SubworkflowFeatureRequirement' */ - class_: string + class_: Internal.SubworkflowFeatureRequirement_class - constructor ({loadingOptions, extensionFields, class_} : {loadingOptions?: LoadingOptions} & Internal.SubworkflowFeatureRequirementProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.SubworkflowFeatureRequirement_class.SUBWORKFLOWFEATUREREQUIREMENT} : {loadingOptions?: LoadingOptions} & Internal.SubworkflowFeatureRequirementProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/subworkflowfeaturerequirementclass.ts b/src/subworkflowfeaturerequirementclass.ts new file mode 100644 index 0000000..57f2ade --- /dev/null +++ b/src/subworkflowfeaturerequirementclass.ts @@ -0,0 +1,4 @@ + +export enum SubworkflowFeatureRequirement_class { + SUBWORKFLOWFEATUREREQUIREMENT='SubworkflowFeatureRequirement', +} diff --git a/src/subworkflowFeatureRequirementProperties.ts b/src/subworkflowfeaturerequirementproperties.ts similarity index 90% rename from src/subworkflowFeatureRequirementProperties.ts rename to src/subworkflowfeaturerequirementproperties.ts index bf8ce81..aea7bf6 100644 --- a/src/subworkflowFeatureRequirementProperties.ts +++ b/src/subworkflowfeaturerequirementproperties.ts @@ -16,5 +16,5 @@ export interface SubworkflowFeatureRequirementProperties extends Internal.Proces /** * Always 'SubworkflowFeatureRequirement' */ - class_: string + class_: Internal.SubworkflowFeatureRequirement_class } \ No newline at end of file diff --git a/src/toolTimeLimit.ts b/src/tooltimelimit.ts similarity index 95% rename from src/toolTimeLimit.ts rename to src/tooltimelimit.ts index ec7dc62..d3fc1a9 100644 --- a/src/toolTimeLimit.ts +++ b/src/tooltimelimit.ts @@ -33,7 +33,7 @@ export class ToolTimeLimit extends Saveable implements Internal.ToolTimeLimitPro /** * Always 'ToolTimeLimit' */ - class_: string + class_: Internal.ToolTimeLimit_class /** * The time limit, in seconds. A time limit of zero means no @@ -43,7 +43,7 @@ export class ToolTimeLimit extends Saveable implements Internal.ToolTimeLimitPro timelimit: number | string - constructor ({loadingOptions, extensionFields, class_, timelimit} : {loadingOptions?: LoadingOptions} & Internal.ToolTimeLimitProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.ToolTimeLimit_class.TOOLTIMELIMIT, timelimit} : {loadingOptions?: LoadingOptions} & Internal.ToolTimeLimitProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/tooltimelimitclass.ts b/src/tooltimelimitclass.ts new file mode 100644 index 0000000..5a0d093 --- /dev/null +++ b/src/tooltimelimitclass.ts @@ -0,0 +1,4 @@ + +export enum ToolTimeLimit_class { + TOOLTIMELIMIT='ToolTimeLimit', +} diff --git a/src/toolTimeLimitProperties.ts b/src/tooltimelimitproperties.ts similarity index 96% rename from src/toolTimeLimitProperties.ts rename to src/tooltimelimitproperties.ts index 7f177c3..b8244a7 100644 --- a/src/toolTimeLimitProperties.ts +++ b/src/tooltimelimitproperties.ts @@ -21,7 +21,7 @@ export interface ToolTimeLimitProperties extends Internal.ProcessRequirementProp /** * Always 'ToolTimeLimit' */ - class_: string + class_: Internal.ToolTimeLimit_class /** * The time limit, in seconds. A time limit of zero means no diff --git a/src/util/internal.ts b/src/util/internal.ts index cc3ef1c..4c38b7a 100644 --- a/src/util/internal.ts +++ b/src/util/internal.ts @@ -1,161 +1,199 @@ // Internal modules pattern to deal with circular dependencies export * from './dict' export * as TypeGuards from './typeguards' -export * from './loaders/arrayLoader' +export * from './loaders/arrayloader' export * from './saveable' -export * from './loaders/enumLoader' -export * from './loaders/expressionLoader' +export * from './loaders/enumloader' +export * from './loaders/expressionloader' export * from './fetcher' -export * from './loaders/idMapLoader' +export * from './loaders/idmaploader' export * from './loaders/loader' -export * from './loadingOptions' -export * from './loaders/anyLoader' -export * from './loaders/primitiveLoader' -export * from './loaders/recordLoader' +export * from './loadingoptions' +export * from './loaders/anyloader' +export * from './loaders/primitiveloader' +export * from './loaders/recordloader' export * from './loaders/rootloader' -export * from './loaders/typeDSLLoader' -export * from './loaders/secondaryDSLLoader' -export * from './loaders/unionLoader' -export * from './loaders/uriLoader' -export * from './validationException' +export * from './loaders/typedslloader' +export * from './loaders/secondarydslloader' +export * from './loaders/unionloader' +export * from './loaders/uriloader' +export * from './validationexception' export * from './vocabs' -export * from '../documentedProperties' -export * from '../recordFieldProperties' -export * from '../recordField' -export * from '../recordSchemaProperties' -export * from '../recordSchema' -export * from '../enumSchemaProperties' -export * from '../enumSchema' -export * from '../arraySchemaProperties' -export * from '../arraySchema' -export * from '../fileProperties' +export * from '../outputformatproperties' +export * from '../initialworkdirrequirement' +export * from '../commandlinetoolproperties' +export * from '../workflowoutputparameter' +export * from '../envvarrequirementclass' +export * from '../outputrecordfield' +export * from '../networkaccess' +export * from '../secondaryfileschemaproperties' +export * from '../expressiontooloutputparameterproperties' +export * from '../workflowinputparameter' +export * from '../stepinputexpressionrequirement' +export * from '../commandoutputparameterproperties' +export * from '../inputformatproperties' +export * from '../commandoutputarrayschemaproperties' +export * from '../networkaccessclass' +export * from '../tooltimelimitproperties' +export * from '../inputbinding' +export * from '../expressiontoolclass' +export * from '../arrayschema' +export * from '../softwarerequirementclass' +export * from '../softwarepackageproperties' +export * from '../initialworkdirrequirementproperties' +export * from '../linkmergemethod' +export * from '../inplaceupdaterequirementproperties' +export * from '../outputarrayschema' +export * from '../processproperties' +export * from '../workflowinputparameterproperties' +export * from '../commandoutputrecordfield' +export * from '../loadlistingrequirement' +export * from '../labeledproperties' +export * from '../operationinputparameterproperties' +export * from '../inputparameterproperties' +export * from '../commandlinebinding' +export * from '../documentedproperties' +export * from '../outputrecordfieldproperties' +export * from '../inlinejavascriptrequirementproperties' +export * from '../commandlinetoolclass' +export * from '../inplaceupdaterequirementclass' +export * from '../workreuse' +export * from '../recordschemaproperties' +export * from '../loadlistingrequirementclass' +export * from '../direntproperties' +export * from '../workflowstep' +export * from '../commandlinetool' +export * from '../initialworkdirrequirementclass' +export * from '../recordschema' +export * from '../shellcommandrequirementproperties' +export * from '../outputparameterproperties' +export * from '../scattermethod' +export * from '../ioschemaproperties' +export * from '../stderr' +export * from '../workflowclass' +export * from '../inputschemaproperties' +export * from '../tooltimelimit' +export * from '../softwarepackage' +export * from '../inputbindingproperties' +export * from '../stdout' +export * from '../inputenumschema' +export * from '../environmentdef' +export * from '../workflow' +export * from '../fileproperties' +export * from '../sinkproperties' +export * from '../envvarrequirement' +export * from '../parameterproperties' +export * from '../enumschemaproperties' +export * from '../subworkflowfeaturerequirementclass' +export * from '../resourcerequirementproperties' +export * from '../schemadefrequirementproperties' +export * from '../envvarrequirementproperties' +export * from '../loadcontentsproperties' +export * from '../operationoutputparameterproperties' +export * from '../cwlversion' +export * from '../enumd062602be0b4b8fd33e69e29a841317b6ab665bc' +export * from '../inputarrayschema' +export * from '../tooltimelimitclass' +export * from '../recordfield' +export * from '../enumd9cba076fca539106791a4f46d198c7fcfbdb779' +export * from '../commandinputarrayschema' +export * from '../cwltype' +export * from '../commandlinebindingproperties' export * from '../file' -export * from '../directoryProperties' +export * from '../commandoutputbindingproperties' +export * from '../commandoutputbinding' +export * from '../workflowstepoutput' +export * from '../scatterfeaturerequirement' +export * from '../loadlistingenum' +export * from '../workreuseclass' +export * from '../workflowstepinput' +export * from '../enumd961d79c225752b9fadb617367615ab176b47d77' export * from '../directory' -export * from '../labeledProperties' -export * from '../identifiedProperties' -export * from '../loadContentsProperties' -export * from '../fieldBaseProperties' -export * from '../inputFormatProperties' -export * from '../outputFormatProperties' -export * from '../parameterProperties' -export * from '../inputBindingProperties' -export * from '../inputBinding' -export * from '../iOSchemaProperties' -export * from '../inputSchemaProperties' -export * from '../outputSchemaProperties' -export * from '../inputRecordFieldProperties' -export * from '../inputRecordField' -export * from '../inputRecordSchemaProperties' -export * from '../inputRecordSchema' -export * from '../inputEnumSchemaProperties' -export * from '../inputEnumSchema' -export * from '../inputArraySchemaProperties' -export * from '../inputArraySchema' -export * from '../outputRecordFieldProperties' -export * from '../outputRecordField' -export * from '../outputRecordSchemaProperties' -export * from '../outputRecordSchema' -export * from '../outputEnumSchemaProperties' -export * from '../outputEnumSchema' -export * from '../outputArraySchemaProperties' -export * from '../outputArraySchema' -export * from '../inputParameterProperties' -export * from '../outputParameterProperties' -export * from '../processRequirementProperties' -export * from '../processProperties' -export * from '../inlineJavascriptRequirementProperties' -export * from '../inlineJavascriptRequirement' -export * from '../commandInputSchemaProperties' -export * from '../schemaDefRequirementProperties' -export * from '../schemaDefRequirement' -export * from '../secondaryFileSchemaProperties' -export * from '../secondaryFileSchema' -export * from '../loadListingRequirementProperties' -export * from '../loadListingRequirement' -export * from '../environmentDefProperties' -export * from '../environmentDef' -export * from '../commandLineBindingProperties' -export * from '../commandLineBinding' -export * from '../commandOutputBindingProperties' -export * from '../commandOutputBinding' -export * from '../commandLineBindableProperties' -export * from '../commandLineBindable' -export * from '../commandInputRecordFieldProperties' -export * from '../commandInputRecordField' -export * from '../commandInputRecordSchemaProperties' -export * from '../commandInputRecordSchema' -export * from '../commandInputEnumSchemaProperties' -export * from '../commandInputEnumSchema' -export * from '../commandInputArraySchemaProperties' -export * from '../commandInputArraySchema' -export * from '../commandOutputRecordFieldProperties' -export * from '../commandOutputRecordField' -export * from '../commandOutputRecordSchemaProperties' -export * from '../commandOutputRecordSchema' -export * from '../commandOutputEnumSchemaProperties' -export * from '../commandOutputEnumSchema' -export * from '../commandOutputArraySchemaProperties' -export * from '../commandOutputArraySchema' -export * from '../commandInputParameterProperties' -export * from '../commandInputParameter' -export * from '../commandOutputParameterProperties' -export * from '../commandOutputParameter' -export * from '../commandLineToolProperties' -export * from '../commandLineTool' -export * from '../dockerRequirementProperties' -export * from '../dockerRequirement' -export * from '../softwareRequirementProperties' -export * from '../softwareRequirement' -export * from '../softwarePackageProperties' -export * from '../softwarePackage' -export * from '../direntProperties' -export * from '../dirent' -export * from '../initialWorkDirRequirementProperties' -export * from '../initialWorkDirRequirement' -export * from '../envVarRequirementProperties' -export * from '../envVarRequirement' -export * from '../shellCommandRequirementProperties' -export * from '../shellCommandRequirement' -export * from '../resourceRequirementProperties' -export * from '../resourceRequirement' -export * from '../workReuseProperties' -export * from '../workReuse' -export * from '../networkAccessProperties' -export * from '../networkAccess' -export * from '../inplaceUpdateRequirementProperties' -export * from '../inplaceUpdateRequirement' -export * from '../toolTimeLimitProperties' -export * from '../toolTimeLimit' -export * from '../expressionToolOutputParameterProperties' -export * from '../expressionToolOutputParameter' -export * from '../workflowInputParameterProperties' -export * from '../workflowInputParameter' -export * from '../expressionToolProperties' -export * from '../expressionTool' -export * from '../workflowOutputParameterProperties' -export * from '../workflowOutputParameter' -export * from '../sinkProperties' -export * from '../workflowStepInputProperties' -export * from '../workflowStepInput' -export * from '../workflowStepOutputProperties' -export * from '../workflowStepOutput' -export * from '../workflowStepProperties' -export * from '../workflowStep' -export * from '../workflowProperties' -export * from '../workflow' -export * from '../subworkflowFeatureRequirementProperties' -export * from '../subworkflowFeatureRequirement' -export * from '../scatterFeatureRequirementProperties' -export * from '../scatterFeatureRequirement' -export * from '../multipleInputFeatureRequirementProperties' -export * from '../multipleInputFeatureRequirement' -export * from '../stepInputExpressionRequirementProperties' -export * from '../stepInputExpressionRequirement' -export * from '../operationInputParameterProperties' -export * from '../operationInputParameter' -export * from '../operationOutputParameterProperties' -export * from '../operationOutputParameter' -export * from '../operationProperties' +export * from '../inputarrayschemaproperties' +export * from '../outputenumschemaproperties' +export * from '../dockerrequirementproperties' +export * from '../networkaccessproperties' +export * from '../commandinputenumschema' +export * from '../stepinputexpressionrequirementproperties' +export * from '../expressiontoolproperties' +export * from '../expressiontooloutputparameter' export * from '../operation' -export * as LoaderInstances from './loaderInstances' +export * from '../commandoutputarrayschema' +export * from '../enumschema' +export * from '../secondaryfileschema' +export * from '../directoryclass' +export * from '../inplaceupdaterequirement' +export * from '../pickvaluemethod' +export * from '../operationinputparameter' +export * from '../softwarerequirementproperties' +export * from '../commandinputrecordschemaproperties' +export * from '../subworkflowfeaturerequirement' +export * from '../inputrecordschema' +export * from '../dockerrequirement' +export * from '../commandinputschemaproperties' +export * from '../resourcerequirement' +export * from '../stdin' +export * from '../commandinputparameterproperties' +export * from '../arrayschemaproperties' +export * from '../dirent' +export * from '../outputrecordschema' +export * from '../commandoutputenumschema' +export * from '../commandinputrecordfieldproperties' +export * from '../scatterfeaturerequirementproperties' +export * from '../dockerrequirementclass' +export * from '../fieldbaseproperties' +export * from '../resourcerequirementclass' +export * from '../workflowstepinputproperties' +export * from '../inputrecordfield' +export * from '../shellcommandrequirement' +export * from '../schemadefrequirementclass' +export * from '../workflowoutputparameterproperties' +export * from '../recordfieldproperties' +export * from '../processrequirementproperties' +export * from '../multipleinputfeaturerequirement' +export * from '../workflowstepoutputproperties' +export * from '../directoryproperties' +export * from '../inputenumschemaproperties' +export * from '../commandoutputenumschemaproperties' +export * from '../shellcommandrequirementclass' +export * from '../expression' +export * from '../outputrecordschemaproperties' +export * from '../expressiontool' +export * from '../inputrecordfieldproperties' +export * from '../operationclass' +export * from '../schemadefrequirement' +export * from '../outputschemaproperties' +export * from '../identifiedproperties' +export * from '../scatterfeaturerequirementclass' +export * from '../outputarrayschemaproperties' +export * from '../commandinputenumschemaproperties' +export * from '../fileclass' +export * from '../inlinejavascriptrequirementclass' +export * from '../commandinputrecordschema' +export * from '../commandoutputrecordschemaproperties' +export * from '../inlinejavascriptrequirement' +export * from '../multipleinputfeaturerequirementclass' +export * from '../commandinputrecordfield' +export * from '../commandlinebindableproperties' +export * from '../commandinputarrayschemaproperties' +export * from '../subworkflowfeaturerequirementproperties' +export * from '../commandoutputrecordschema' +export * from '../commandinputparameter' +export * from '../outputenumschema' +export * from '../workflowstepproperties' +export * from '../stepinputexpressionrequirementclass' +export * from '../any' +export * from '../commandlinebindable' +export * from '../loadlistingrequirementproperties' +export * from '../commandoutputrecordfieldproperties' +export * from '../inputrecordschemaproperties' +export * from '../multipleinputfeaturerequirementproperties' +export * from '../operationoutputparameter' +export * from '../commandoutputparameter' +export * from '../softwarerequirement' +export * from '../operationproperties' +export * from '../workflowproperties' +export * from '../workreuseproperties' +export * from '../environmentdefproperties' +export * from '../primitivetype' +export * as LoaderInstances from './loaderinstances' diff --git a/src/util/loaderInstances.ts b/src/util/loaderinstances.ts similarity index 86% rename from src/util/loaderInstances.ts rename to src/util/loaderinstances.ts index c5202a3..a48a8e7 100644 --- a/src/util/loaderInstances.ts +++ b/src/util/loaderinstances.ts @@ -11,145 +11,183 @@ import { _TypeDSLLoader, _SecondaryDSLLoader, TypeGuards, - DocumentedProperties, - RecordFieldProperties, - RecordField, + SoftwarePackageProperties, RecordSchemaProperties, - RecordSchema, - EnumSchemaProperties, - EnumSchema, - ArraySchemaProperties, - ArraySchema, - FileProperties, - File, - DirectoryProperties, + InplaceUpdateRequirement_class, + MultipleInputFeatureRequirementProperties, + SchemaDefRequirement_class, + NetworkAccess_class, Directory, - LabeledProperties, - IdentifiedProperties, - LoadContentsProperties, - FieldBaseProperties, - InputFormatProperties, - OutputFormatProperties, - ParameterProperties, + CommandInputArraySchemaProperties, + WorkflowStepInputProperties, + CommandInputEnumSchema, + EnvVarRequirementProperties, + SecondaryFileSchemaProperties, + CWLVersion, + InplaceUpdateRequirementProperties, + OperationProperties, + RecordFieldProperties, + MultipleInputFeatureRequirement_class, + SubworkflowFeatureRequirement_class, InputBindingProperties, - InputBinding, - IOSchemaProperties, - InputSchemaProperties, - OutputSchemaProperties, - InputRecordFieldProperties, - InputRecordField, - InputRecordSchemaProperties, - InputRecordSchema, - InputEnumSchemaProperties, - InputEnumSchema, - InputArraySchemaProperties, - InputArraySchema, - OutputRecordFieldProperties, - OutputRecordField, - OutputRecordSchemaProperties, - OutputRecordSchema, - OutputEnumSchemaProperties, + EnvVarRequirement, OutputEnumSchema, - OutputArraySchemaProperties, - OutputArraySchema, - InputParameterProperties, - OutputParameterProperties, - ProcessRequirementProperties, - ProcessProperties, + StepInputExpressionRequirement, + WorkflowInputParameterProperties, + CommandLineTool_class, + ResourceRequirement, + Operation, + CommandInputRecordField, + CommandInputArraySchema, + OperationOutputParameterProperties, + EnvVarRequirement_class, + ArraySchemaProperties, InlineJavascriptRequirementProperties, - InlineJavascriptRequirement, - CommandInputSchemaProperties, - SchemaDefRequirementProperties, + InplaceUpdateRequirement, + LoadListingRequirement_class, + InlineJavascriptRequirement_class, + ScatterFeatureRequirementProperties, + CommandOutputBinding, + CWLType, + CommandOutputRecordField, + InputBinding, + Dirent, + ShellCommandRequirement, + StepInputExpressionRequirementProperties, SchemaDefRequirement, - SecondaryFileSchemaProperties, - SecondaryFileSchema, - LoadListingRequirementProperties, - LoadListingRequirement, - EnvironmentDefProperties, - EnvironmentDef, - CommandLineBindingProperties, - CommandLineBinding, + ExpressionToolOutputParameterProperties, + ExpressionTool, + stderr, + ArraySchema, + LabeledProperties, CommandOutputBindingProperties, - CommandOutputBinding, - CommandLineBindableProperties, + SoftwarePackage, + EnumSchemaProperties, + StepInputExpressionRequirement_class, + ScatterMethod, + WorkflowStepOutputProperties, + stdout, + File, + ScatterFeatureRequirement, + EnumSchema, + ShellCommandRequirement_class, + SecondaryFileSchema, + InputParameterProperties, + SoftwareRequirement_class, + WorkflowProperties, + InputFormatProperties, CommandLineBindable, - CommandInputRecordFieldProperties, - CommandInputRecordField, - CommandInputRecordSchemaProperties, - CommandInputRecordSchema, CommandInputEnumSchemaProperties, - CommandInputEnumSchema, - CommandInputArraySchemaProperties, - CommandInputArraySchema, - CommandOutputRecordFieldProperties, - CommandOutputRecordField, + enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, + FieldBaseProperties, + InputRecordFieldProperties, + CommandInputSchemaProperties, + CommandOutputParameter, + WorkflowStepOutput, + OperationOutputParameter, + OperationInputParameterProperties, + WorkflowOutputParameterProperties, + CommandOutputEnumSchema, + CommandOutputEnumSchemaProperties, + ExpressionToolProperties, CommandOutputRecordSchemaProperties, + SubworkflowFeatureRequirementProperties, + LoadListingRequirementProperties, + OutputRecordSchemaProperties, + IdentifiedProperties, + LoadContentsProperties, + EnvironmentDefProperties, + ResourceRequirement_class, + enum_d961d79c225752b9fadb617367615ab176b47d77, + ProcessRequirementProperties, + SchemaDefRequirementProperties, + WorkReuseProperties, + enum_d9cba076fca539106791a4f46d198c7fcfbdb779, + InputRecordSchemaProperties, + WorkflowStep, + Operation_class, + NetworkAccess, + FileProperties, + DirentProperties, + InitialWorkDirRequirement_class, + ResourceRequirementProperties, CommandOutputRecordSchema, - CommandOutputEnumSchemaProperties, - CommandOutputEnumSchema, - CommandOutputArraySchemaProperties, - CommandOutputArraySchema, - CommandInputParameterProperties, - CommandInputParameter, + CommandOutputRecordFieldProperties, + OutputRecordFieldProperties, + PrimitiveType, + InputRecordSchema, + DockerRequirement, + CommandLineBindableProperties, + ParameterProperties, + SoftwareRequirement, + InputSchemaProperties, + PickValueMethod, + CommandInputRecordSchema, + SoftwareRequirementProperties, + WorkflowInputParameter, CommandOutputParameterProperties, - CommandOutputParameter, + stdin, + SinkProperties, + CommandOutputArraySchema, + WorkReuse_class, + RecordSchema, + File_class, + WorkflowStepInput, + OutputEnumSchemaProperties, + CommandInputRecordSchemaProperties, + EnvironmentDef, + OperationInputParameter, + MultipleInputFeatureRequirement, + CommandLineBinding, + DocumentedProperties, CommandLineToolProperties, - CommandLineTool, + OutputParameterProperties, + ToolTimeLimit_class, + Any, DockerRequirementProperties, - DockerRequirement, - SoftwareRequirementProperties, - SoftwareRequirement, - SoftwarePackageProperties, - SoftwarePackage, - DirentProperties, - Dirent, - InitialWorkDirRequirementProperties, - InitialWorkDirRequirement, - EnvVarRequirementProperties, - EnvVarRequirement, + LinkMergeMethod, + InputArraySchema, + OutputRecordSchema, + IOSchemaProperties, + DockerRequirement_class, + CommandOutputArraySchemaProperties, + ToolTimeLimitProperties, + Workflow, ShellCommandRequirementProperties, - ShellCommandRequirement, - ResourceRequirementProperties, - ResourceRequirement, - WorkReuseProperties, - WorkReuse, + OutputArraySchemaProperties, NetworkAccessProperties, - NetworkAccess, - InplaceUpdateRequirementProperties, - InplaceUpdateRequirement, - ToolTimeLimitProperties, - ToolTimeLimit, - ExpressionToolOutputParameterProperties, + Expression, ExpressionToolOutputParameter, - WorkflowInputParameterProperties, - WorkflowInputParameter, - ExpressionToolProperties, - ExpressionTool, - WorkflowOutputParameterProperties, + ExpressionTool_class, + RecordField, + DirectoryProperties, + CommandInputParameterProperties, + ScatterFeatureRequirement_class, + ToolTimeLimit, + ProcessProperties, + InputArraySchemaProperties, + Workflow_class, + InputRecordField, + InitialWorkDirRequirement, + SubworkflowFeatureRequirement, + LoadListingRequirement, + Directory_class, + CommandLineBindingProperties, + LoadListingEnum, + InlineJavascriptRequirement, + InputEnumSchemaProperties, + CommandLineTool, + WorkReuse, + OutputArraySchema, + InitialWorkDirRequirementProperties, + CommandInputParameter, WorkflowOutputParameter, - SinkProperties, - WorkflowStepInputProperties, - WorkflowStepInput, - WorkflowStepOutputProperties, - WorkflowStepOutput, + InputEnumSchema, + CommandInputRecordFieldProperties, + OutputSchemaProperties, + OutputFormatProperties, WorkflowStepProperties, - WorkflowStep, - WorkflowProperties, - Workflow, - SubworkflowFeatureRequirementProperties, - SubworkflowFeatureRequirement, - ScatterFeatureRequirementProperties, - ScatterFeatureRequirement, - MultipleInputFeatureRequirementProperties, - MultipleInputFeatureRequirement, - StepInputExpressionRequirementProperties, - StepInputExpressionRequirement, - OperationInputParameterProperties, - OperationInputParameter, - OperationOutputParameterProperties, - OperationOutputParameter, - OperationProperties, - Operation + OutputRecordField } from './internal' export const strtype = new _PrimitiveLoader(TypeGuards.String); @@ -158,17 +196,17 @@ export const floattype = new _PrimitiveLoader(TypeGuards.Float); export const booltype = new _PrimitiveLoader(TypeGuards.Bool); export const undefinedtype = new _PrimitiveLoader(TypeGuards.Undefined); export const anyType = new _AnyLoader(); -export const PrimitiveTypeLoader = new _EnumLoader(["null", "boolean", "int", "long", "float", "double", "string"]); -export const AnyLoader = new _EnumLoader(["Any"]); +export const PrimitiveTypeLoader = new _EnumLoader((Object.keys(PrimitiveType) as Array).map(key => PrimitiveType[key])); +export const AnyLoader = new _EnumLoader((Object.keys(Any) as Array).map(key => Any[key])); export const RecordFieldLoader = new _RecordLoader(RecordField.fromDoc); export const RecordSchemaLoader = new _RecordLoader(RecordSchema.fromDoc); export const EnumSchemaLoader = new _RecordLoader(EnumSchema.fromDoc); export const ArraySchemaLoader = new _RecordLoader(ArraySchema.fromDoc); -export const CWLVersionLoader = new _EnumLoader(["draft-2", "draft-3.dev1", "draft-3.dev2", "draft-3.dev3", "draft-3.dev4", "draft-3.dev5", "draft-3", "draft-4.dev1", "draft-4.dev2", "draft-4.dev3", "v1.0.dev4", "v1.0", "v1.1.0-dev1", "v1.1", "v1.2.0-dev1", "v1.2.0-dev2", "v1.2.0-dev3", "v1.2.0-dev4", "v1.2.0-dev5", "v1.2"]); -export const CWLTypeLoader = new _EnumLoader(["File", "Directory"]); +export const CWLVersionLoader = new _EnumLoader((Object.keys(CWLVersion) as Array).map(key => CWLVersion[key])); +export const CWLTypeLoader = new _EnumLoader((Object.keys(CWLType) as Array).map(key => CWLType[key])); export const FileLoader = new _RecordLoader(File.fromDoc); export const DirectoryLoader = new _RecordLoader(Directory.fromDoc); -export const LoadListingEnumLoader = new _EnumLoader(["no_listing", "shallow_listing", "deep_listing"]); +export const LoadListingEnumLoader = new _EnumLoader((Object.keys(LoadListingEnum) as Array).map(key => LoadListingEnum[key])); export const ExpressionLoader = new _ExpressionLoader(); export const InputBindingLoader = new _RecordLoader(InputBinding.fromDoc); export const InputRecordFieldLoader = new _RecordLoader(InputRecordField.fromDoc); @@ -197,9 +235,9 @@ export const CommandOutputEnumSchemaLoader = new _RecordLoader(CommandOutputEnum export const CommandOutputArraySchemaLoader = new _RecordLoader(CommandOutputArraySchema.fromDoc); export const CommandInputParameterLoader = new _RecordLoader(CommandInputParameter.fromDoc); export const CommandOutputParameterLoader = new _RecordLoader(CommandOutputParameter.fromDoc); -export const stdinLoader = new _EnumLoader(["stdin"]); -export const stdoutLoader = new _EnumLoader(["stdout"]); -export const stderrLoader = new _EnumLoader(["stderr"]); +export const stdinLoader = new _EnumLoader((Object.keys(stdin) as Array).map(key => stdin[key])); +export const stdoutLoader = new _EnumLoader((Object.keys(stdout) as Array).map(key => stdout[key])); +export const stderrLoader = new _EnumLoader((Object.keys(stderr) as Array).map(key => stderr[key])); export const CommandLineToolLoader = new _RecordLoader(CommandLineTool.fromDoc); export const DockerRequirementLoader = new _RecordLoader(DockerRequirement.fromDoc); export const SoftwareRequirementLoader = new _RecordLoader(SoftwareRequirement.fromDoc); @@ -216,12 +254,12 @@ export const ToolTimeLimitLoader = new _RecordLoader(ToolTimeLimit.fromDoc); export const ExpressionToolOutputParameterLoader = new _RecordLoader(ExpressionToolOutputParameter.fromDoc); export const WorkflowInputParameterLoader = new _RecordLoader(WorkflowInputParameter.fromDoc); export const ExpressionToolLoader = new _RecordLoader(ExpressionTool.fromDoc); -export const LinkMergeMethodLoader = new _EnumLoader(["merge_nested", "merge_flattened"]); -export const PickValueMethodLoader = new _EnumLoader(["first_non_null", "the_only_non_null", "all_non_null"]); +export const LinkMergeMethodLoader = new _EnumLoader((Object.keys(LinkMergeMethod) as Array).map(key => LinkMergeMethod[key])); +export const PickValueMethodLoader = new _EnumLoader((Object.keys(PickValueMethod) as Array).map(key => PickValueMethod[key])); export const WorkflowOutputParameterLoader = new _RecordLoader(WorkflowOutputParameter.fromDoc); export const WorkflowStepInputLoader = new _RecordLoader(WorkflowStepInput.fromDoc); export const WorkflowStepOutputLoader = new _RecordLoader(WorkflowStepOutput.fromDoc); -export const ScatterMethodLoader = new _EnumLoader(["dotproduct", "nested_crossproduct", "flat_crossproduct"]); +export const ScatterMethodLoader = new _EnumLoader((Object.keys(ScatterMethod) as Array).map(key => ScatterMethod[key])); export const WorkflowStepLoader = new _RecordLoader(WorkflowStep.fromDoc); export const WorkflowLoader = new _RecordLoader(Workflow.fromDoc); export const SubworkflowFeatureRequirementLoader = new _RecordLoader(SubworkflowFeatureRequirement.fromDoc); @@ -241,14 +279,14 @@ export const typedslunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLo export const arrayOfRecordFieldLoader = new _ArrayLoader([RecordFieldLoader]); export const unionOfundefinedtypeOrarrayOfRecordFieldLoader = new _UnionLoader([undefinedtype, arrayOfRecordFieldLoader]); export const idmapfieldsunionOfundefinedtypeOrarrayOfRecordFieldLoader = new _IdMapLoader(unionOfundefinedtypeOrarrayOfRecordFieldLoader, 'name', 'type'); -export const enum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader = new _EnumLoader(["record"]); +export const enum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader = new _EnumLoader((Object.keys(enum_d9cba076fca539106791a4f46d198c7fcfbdb779) as Array).map(key => enum_d9cba076fca539106791a4f46d198c7fcfbdb779[key])); export const typedslenum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader2 = new _TypeDSLLoader(enum_d9cba076fca539106791a4f46d198c7fcfbdb779Loader, 2); export const uriarrayOfstrtypeTrueFalseNone = new _URILoader(arrayOfstrtype, true, false, undefined); -export const enum_d961d79c225752b9fadb617367615ab176b47d77Loader = new _EnumLoader(["enum"]); +export const enum_d961d79c225752b9fadb617367615ab176b47d77Loader = new _EnumLoader((Object.keys(enum_d961d79c225752b9fadb617367615ab176b47d77) as Array).map(key => enum_d961d79c225752b9fadb617367615ab176b47d77[key])); export const typedslenum_d961d79c225752b9fadb617367615ab176b47d77Loader2 = new _TypeDSLLoader(enum_d961d79c225752b9fadb617367615ab176b47d77Loader, 2); -export const enum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader = new _EnumLoader(["array"]); +export const enum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader = new _EnumLoader((Object.keys(enum_d062602be0b4b8fd33e69e29a841317b6ab665bc) as Array).map(key => enum_d062602be0b4b8fd33e69e29a841317b6ab665bc[key])); export const typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2 = new _TypeDSLLoader(enum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader, 2); -export const File_classLoader = new _EnumLoader(["File"]); +export const File_classLoader = new _EnumLoader((Object.keys(File_class) as Array).map(key => File_class[key])); export const uriFile_classLoaderFalseTrueNone = new _URILoader(File_classLoader, false, true, undefined); export const unionOfundefinedtypeOrstrtype = new _UnionLoader([undefinedtype, strtype]); export const uriunionOfundefinedtypeOrstrtypeFalseFalseNone = new _URILoader(unionOfundefinedtypeOrstrtype, false, false, undefined); @@ -258,7 +296,7 @@ export const arrayOfunionOfFileLoaderOrDirectoryLoader = new _ArrayLoader([union export const unionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _UnionLoader([undefinedtype, arrayOfunionOfFileLoaderOrDirectoryLoader]); export const secondaryfilesdslunionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _SecondaryDSLLoader(unionOfundefinedtypeOrarrayOfunionOfFileLoaderOrDirectoryLoader); export const uriunionOfundefinedtypeOrstrtypeTrueFalseNone = new _URILoader(unionOfundefinedtypeOrstrtype, true, false, undefined); -export const Directory_classLoader = new _EnumLoader(["Directory"]); +export const Directory_classLoader = new _EnumLoader((Object.keys(Directory_class) as Array).map(key => Directory_class[key])); export const uriDirectory_classLoaderFalseTrueNone = new _URILoader(Directory_classLoader, false, true, undefined); export const unionOfundefinedtypeOrbooltype = new _UnionLoader([undefinedtype, booltype]); export const unionOfundefinedtypeOrLoadListingEnumLoader = new _UnionLoader([undefinedtype, LoadListingEnumLoader]); @@ -301,15 +339,15 @@ export const unionOfundefinedtypeOrCWLVersionLoader = new _UnionLoader([undefine export const uriunionOfundefinedtypeOrCWLVersionLoaderFalseTrueNone = new _URILoader(unionOfundefinedtypeOrCWLVersionLoader, false, true, undefined); export const unionOfundefinedtypeOrarrayOfstrtype = new _UnionLoader([undefinedtype, arrayOfstrtype]); export const uriunionOfundefinedtypeOrarrayOfstrtypeTrueFalseNone = new _URILoader(unionOfundefinedtypeOrarrayOfstrtype, true, false, undefined); -export const InlineJavascriptRequirement_classLoader = new _EnumLoader(["InlineJavascriptRequirement"]); +export const InlineJavascriptRequirement_classLoader = new _EnumLoader((Object.keys(InlineJavascriptRequirement_class) as Array).map(key => InlineJavascriptRequirement_class[key])); export const uriInlineJavascriptRequirement_classLoaderFalseTrueNone = new _URILoader(InlineJavascriptRequirement_classLoader, false, true, undefined); -export const SchemaDefRequirement_classLoader = new _EnumLoader(["SchemaDefRequirement"]); +export const SchemaDefRequirement_classLoader = new _EnumLoader((Object.keys(SchemaDefRequirement_class) as Array).map(key => SchemaDefRequirement_class[key])); export const uriSchemaDefRequirement_classLoaderFalseTrueNone = new _URILoader(SchemaDefRequirement_classLoader, false, true, undefined); export const unionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader = new _UnionLoader([CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader]); export const arrayOfunionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader = new _ArrayLoader([unionOfCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoader]); export const unionOfstrtypeOrExpressionLoader = new _UnionLoader([strtype, ExpressionLoader]); export const unionOfundefinedtypeOrbooltypeOrExpressionLoader = new _UnionLoader([undefinedtype, booltype, ExpressionLoader]); -export const LoadListingRequirement_classLoader = new _EnumLoader(["LoadListingRequirement"]); +export const LoadListingRequirement_classLoader = new _EnumLoader((Object.keys(LoadListingRequirement_class) as Array).map(key => LoadListingRequirement_class[key])); export const uriLoadListingRequirement_classLoaderFalseTrueNone = new _URILoader(LoadListingRequirement_classLoader, false, true, undefined); export const unionOfundefinedtypeOrinttypeOrExpressionLoader = new _UnionLoader([undefinedtype, inttype, ExpressionLoader]); export const unionOfundefinedtypeOrstrtypeOrExpressionLoaderOrarrayOfstrtype = new _UnionLoader([undefinedtype, strtype, ExpressionLoader, arrayOfstrtype]); @@ -334,7 +372,7 @@ export const unionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOr export const typedslunionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrstdinLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandInputRecordSchemaLoaderOrCommandInputEnumSchemaLoaderOrCommandInputArraySchemaLoaderOrstrtype, 2); export const unionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype = new _UnionLoader([CWLTypeLoader, stdoutLoader, stderrLoader, CommandOutputRecordSchemaLoader, CommandOutputEnumSchemaLoader, CommandOutputArraySchemaLoader, strtype, arrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype]); export const typedslunionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype2 = new _TypeDSLLoader(unionOfCWLTypeLoaderOrstdoutLoaderOrstderrLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtypeOrarrayOfunionOfCWLTypeLoaderOrCommandOutputRecordSchemaLoaderOrCommandOutputEnumSchemaLoaderOrCommandOutputArraySchemaLoaderOrstrtype, 2); -export const CommandLineTool_classLoader = new _EnumLoader(["CommandLineTool"]); +export const CommandLineTool_classLoader = new _EnumLoader((Object.keys(CommandLineTool_class) as Array).map(key => CommandLineTool_class[key])); export const uriCommandLineTool_classLoaderFalseTrueNone = new _URILoader(CommandLineTool_classLoader, false, true, undefined); export const arrayOfCommandInputParameterLoader = new _ArrayLoader([CommandInputParameterLoader]); export const idmapinputsarrayOfCommandInputParameterLoader = new _IdMapLoader(arrayOfCommandInputParameterLoader, 'id', 'type'); @@ -345,39 +383,39 @@ export const arrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader = export const unionOfundefinedtypeOrarrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader = new _UnionLoader([undefinedtype, arrayOfunionOfstrtypeOrExpressionLoaderOrCommandLineBindingLoader]); export const arrayOfinttype = new _ArrayLoader([inttype]); export const unionOfundefinedtypeOrarrayOfinttype = new _UnionLoader([undefinedtype, arrayOfinttype]); -export const DockerRequirement_classLoader = new _EnumLoader(["DockerRequirement"]); +export const DockerRequirement_classLoader = new _EnumLoader((Object.keys(DockerRequirement_class) as Array).map(key => DockerRequirement_class[key])); export const uriDockerRequirement_classLoaderFalseTrueNone = new _URILoader(DockerRequirement_classLoader, false, true, undefined); -export const SoftwareRequirement_classLoader = new _EnumLoader(["SoftwareRequirement"]); +export const SoftwareRequirement_classLoader = new _EnumLoader((Object.keys(SoftwareRequirement_class) as Array).map(key => SoftwareRequirement_class[key])); export const uriSoftwareRequirement_classLoaderFalseTrueNone = new _URILoader(SoftwareRequirement_classLoader, false, true, undefined); export const arrayOfSoftwarePackageLoader = new _ArrayLoader([SoftwarePackageLoader]); export const idmappackagesarrayOfSoftwarePackageLoader = new _IdMapLoader(arrayOfSoftwarePackageLoader, 'package', 'specs'); export const uriunionOfundefinedtypeOrarrayOfstrtypeFalseFalseNone = new _URILoader(unionOfundefinedtypeOrarrayOfstrtype, false, false, undefined); -export const InitialWorkDirRequirement_classLoader = new _EnumLoader(["InitialWorkDirRequirement"]); +export const InitialWorkDirRequirement_classLoader = new _EnumLoader((Object.keys(InitialWorkDirRequirement_class) as Array).map(key => InitialWorkDirRequirement_class[key])); export const uriInitialWorkDirRequirement_classLoaderFalseTrueNone = new _URILoader(InitialWorkDirRequirement_classLoader, false, true, undefined); export const unionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _UnionLoader([undefinedtype, DirentLoader, ExpressionLoader, FileLoader, DirectoryLoader, arrayOfunionOfFileLoaderOrDirectoryLoader]); export const arrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _ArrayLoader([unionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader]); export const unionOfExpressionLoaderOrarrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader = new _UnionLoader([ExpressionLoader, arrayOfunionOfundefinedtypeOrDirentLoaderOrExpressionLoaderOrFileLoaderOrDirectoryLoaderOrarrayOfunionOfFileLoaderOrDirectoryLoader]); -export const EnvVarRequirement_classLoader = new _EnumLoader(["EnvVarRequirement"]); +export const EnvVarRequirement_classLoader = new _EnumLoader((Object.keys(EnvVarRequirement_class) as Array).map(key => EnvVarRequirement_class[key])); export const uriEnvVarRequirement_classLoaderFalseTrueNone = new _URILoader(EnvVarRequirement_classLoader, false, true, undefined); export const arrayOfEnvironmentDefLoader = new _ArrayLoader([EnvironmentDefLoader]); export const idmapenvDefarrayOfEnvironmentDefLoader = new _IdMapLoader(arrayOfEnvironmentDefLoader, 'envName', 'envValue'); -export const ShellCommandRequirement_classLoader = new _EnumLoader(["ShellCommandRequirement"]); +export const ShellCommandRequirement_classLoader = new _EnumLoader((Object.keys(ShellCommandRequirement_class) as Array).map(key => ShellCommandRequirement_class[key])); export const uriShellCommandRequirement_classLoaderFalseTrueNone = new _URILoader(ShellCommandRequirement_classLoader, false, true, undefined); -export const ResourceRequirement_classLoader = new _EnumLoader(["ResourceRequirement"]); +export const ResourceRequirement_classLoader = new _EnumLoader((Object.keys(ResourceRequirement_class) as Array).map(key => ResourceRequirement_class[key])); export const uriResourceRequirement_classLoaderFalseTrueNone = new _URILoader(ResourceRequirement_classLoader, false, true, undefined); export const unionOfundefinedtypeOrinttypeOrfloattypeOrExpressionLoader = new _UnionLoader([undefinedtype, inttype, floattype, ExpressionLoader]); -export const WorkReuse_classLoader = new _EnumLoader(["WorkReuse"]); +export const WorkReuse_classLoader = new _EnumLoader((Object.keys(WorkReuse_class) as Array).map(key => WorkReuse_class[key])); export const uriWorkReuse_classLoaderFalseTrueNone = new _URILoader(WorkReuse_classLoader, false, true, undefined); export const unionOfbooltypeOrExpressionLoader = new _UnionLoader([booltype, ExpressionLoader]); -export const NetworkAccess_classLoader = new _EnumLoader(["NetworkAccess"]); +export const NetworkAccess_classLoader = new _EnumLoader((Object.keys(NetworkAccess_class) as Array).map(key => NetworkAccess_class[key])); export const uriNetworkAccess_classLoaderFalseTrueNone = new _URILoader(NetworkAccess_classLoader, false, true, undefined); -export const InplaceUpdateRequirement_classLoader = new _EnumLoader(["InplaceUpdateRequirement"]); +export const InplaceUpdateRequirement_classLoader = new _EnumLoader((Object.keys(InplaceUpdateRequirement_class) as Array).map(key => InplaceUpdateRequirement_class[key])); export const uriInplaceUpdateRequirement_classLoaderFalseTrueNone = new _URILoader(InplaceUpdateRequirement_classLoader, false, true, undefined); -export const ToolTimeLimit_classLoader = new _EnumLoader(["ToolTimeLimit"]); +export const ToolTimeLimit_classLoader = new _EnumLoader((Object.keys(ToolTimeLimit_class) as Array).map(key => ToolTimeLimit_class[key])); export const uriToolTimeLimit_classLoaderFalseTrueNone = new _URILoader(ToolTimeLimit_classLoader, false, true, undefined); export const unionOfinttypeOrExpressionLoader = new _UnionLoader([inttype, ExpressionLoader]); export const unionOfundefinedtypeOrInputBindingLoader = new _UnionLoader([undefinedtype, InputBindingLoader]); -export const ExpressionTool_classLoader = new _EnumLoader(["ExpressionTool"]); +export const ExpressionTool_classLoader = new _EnumLoader((Object.keys(ExpressionTool_class) as Array).map(key => ExpressionTool_class[key])); export const uriExpressionTool_classLoaderFalseTrueNone = new _URILoader(ExpressionTool_classLoader, false, true, undefined); export const arrayOfWorkflowInputParameterLoader = new _ArrayLoader([WorkflowInputParameterLoader]); export const idmapinputsarrayOfWorkflowInputParameterLoader = new _IdMapLoader(arrayOfWorkflowInputParameterLoader, 'id', 'type'); @@ -396,22 +434,22 @@ export const uriunionOfarrayOfunionOfstrtypeOrWorkflowStepOutputLoaderTrueFalseN export const unionOfstrtypeOrCommandLineToolLoaderOrExpressionToolLoaderOrWorkflowLoaderOrOperationLoader = new _UnionLoader([strtype, CommandLineToolLoader, ExpressionToolLoader, WorkflowLoader, OperationLoader]); export const unionOfundefinedtypeOrScatterMethodLoader = new _UnionLoader([undefinedtype, ScatterMethodLoader]); export const uriunionOfundefinedtypeOrScatterMethodLoaderFalseTrueNone = new _URILoader(unionOfundefinedtypeOrScatterMethodLoader, false, true, undefined); -export const Workflow_classLoader = new _EnumLoader(["Workflow"]); +export const Workflow_classLoader = new _EnumLoader((Object.keys(Workflow_class) as Array).map(key => Workflow_class[key])); export const uriWorkflow_classLoaderFalseTrueNone = new _URILoader(Workflow_classLoader, false, true, undefined); export const arrayOfWorkflowOutputParameterLoader = new _ArrayLoader([WorkflowOutputParameterLoader]); export const idmapoutputsarrayOfWorkflowOutputParameterLoader = new _IdMapLoader(arrayOfWorkflowOutputParameterLoader, 'id', 'type'); export const arrayOfWorkflowStepLoader = new _ArrayLoader([WorkflowStepLoader]); export const unionOfarrayOfWorkflowStepLoader = new _UnionLoader([arrayOfWorkflowStepLoader]); export const idmapstepsunionOfarrayOfWorkflowStepLoader = new _IdMapLoader(unionOfarrayOfWorkflowStepLoader, 'id', 'None'); -export const SubworkflowFeatureRequirement_classLoader = new _EnumLoader(["SubworkflowFeatureRequirement"]); +export const SubworkflowFeatureRequirement_classLoader = new _EnumLoader((Object.keys(SubworkflowFeatureRequirement_class) as Array).map(key => SubworkflowFeatureRequirement_class[key])); export const uriSubworkflowFeatureRequirement_classLoaderFalseTrueNone = new _URILoader(SubworkflowFeatureRequirement_classLoader, false, true, undefined); -export const ScatterFeatureRequirement_classLoader = new _EnumLoader(["ScatterFeatureRequirement"]); +export const ScatterFeatureRequirement_classLoader = new _EnumLoader((Object.keys(ScatterFeatureRequirement_class) as Array).map(key => ScatterFeatureRequirement_class[key])); export const uriScatterFeatureRequirement_classLoaderFalseTrueNone = new _URILoader(ScatterFeatureRequirement_classLoader, false, true, undefined); -export const MultipleInputFeatureRequirement_classLoader = new _EnumLoader(["MultipleInputFeatureRequirement"]); +export const MultipleInputFeatureRequirement_classLoader = new _EnumLoader((Object.keys(MultipleInputFeatureRequirement_class) as Array).map(key => MultipleInputFeatureRequirement_class[key])); export const uriMultipleInputFeatureRequirement_classLoaderFalseTrueNone = new _URILoader(MultipleInputFeatureRequirement_classLoader, false, true, undefined); -export const StepInputExpressionRequirement_classLoader = new _EnumLoader(["StepInputExpressionRequirement"]); +export const StepInputExpressionRequirement_classLoader = new _EnumLoader((Object.keys(StepInputExpressionRequirement_class) as Array).map(key => StepInputExpressionRequirement_class[key])); export const uriStepInputExpressionRequirement_classLoaderFalseTrueNone = new _URILoader(StepInputExpressionRequirement_classLoader, false, true, undefined); -export const Operation_classLoader = new _EnumLoader(["Operation"]); +export const Operation_classLoader = new _EnumLoader((Object.keys(Operation_class) as Array).map(key => Operation_class[key])); export const uriOperation_classLoaderFalseTrueNone = new _URILoader(Operation_classLoader, false, true, undefined); export const arrayOfOperationInputParameterLoader = new _ArrayLoader([OperationInputParameterLoader]); export const idmapinputsarrayOfOperationInputParameterLoader = new _IdMapLoader(arrayOfOperationInputParameterLoader, 'id', 'type'); diff --git a/src/util/loaders/anyLoader.ts b/src/util/loaders/anyloader.ts similarity index 100% rename from src/util/loaders/anyLoader.ts rename to src/util/loaders/anyloader.ts diff --git a/src/util/loaders/arrayLoader.ts b/src/util/loaders/arrayloader.ts similarity index 100% rename from src/util/loaders/arrayLoader.ts rename to src/util/loaders/arrayloader.ts diff --git a/src/util/loaders/enumLoader.ts b/src/util/loaders/enumloader.ts similarity index 100% rename from src/util/loaders/enumLoader.ts rename to src/util/loaders/enumloader.ts diff --git a/src/util/loaders/expressionLoader.ts b/src/util/loaders/expressionloader.ts similarity index 100% rename from src/util/loaders/expressionLoader.ts rename to src/util/loaders/expressionloader.ts diff --git a/src/util/loaders/idMapLoader.ts b/src/util/loaders/idmaploader.ts similarity index 100% rename from src/util/loaders/idMapLoader.ts rename to src/util/loaders/idmaploader.ts diff --git a/src/util/loaders/primitiveLoader.ts b/src/util/loaders/primitiveloader.ts similarity index 100% rename from src/util/loaders/primitiveLoader.ts rename to src/util/loaders/primitiveloader.ts diff --git a/src/util/loaders/recordLoader.ts b/src/util/loaders/recordloader.ts similarity index 100% rename from src/util/loaders/recordLoader.ts rename to src/util/loaders/recordloader.ts diff --git a/src/util/loaders/secondaryDSLLoader.ts b/src/util/loaders/secondarydslloader.ts similarity index 94% rename from src/util/loaders/secondaryDSLLoader.ts rename to src/util/loaders/secondarydslloader.ts index 7061a2d..4ae44a0 100644 --- a/src/util/loaders/secondaryDSLLoader.ts +++ b/src/util/loaders/secondarydslloader.ts @@ -1,5 +1,4 @@ -import { Loader, LoadingOptions, Dictionary, TypeGuards } from '../internal' -import { ValidationException } from '../validationException' +import { Loader, LoadingOptions, Dictionary, TypeGuards, ValidationException } from '../internal' export class _SecondaryDSLLoader implements Loader { inner: Loader diff --git a/src/util/loaders/typeDSLLoader.ts b/src/util/loaders/typedslloader.ts similarity index 100% rename from src/util/loaders/typeDSLLoader.ts rename to src/util/loaders/typedslloader.ts diff --git a/src/util/loaders/unionLoader.ts b/src/util/loaders/unionloader.ts similarity index 100% rename from src/util/loaders/unionLoader.ts rename to src/util/loaders/unionloader.ts diff --git a/src/util/loaders/uriLoader.ts b/src/util/loaders/uriloader.ts similarity index 100% rename from src/util/loaders/uriLoader.ts rename to src/util/loaders/uriloader.ts diff --git a/src/util/loadingOptions.ts b/src/util/loadingoptions.ts similarity index 100% rename from src/util/loadingOptions.ts rename to src/util/loadingoptions.ts diff --git a/src/util/validationException.ts b/src/util/validationexception.ts similarity index 100% rename from src/util/validationException.ts rename to src/util/validationexception.ts diff --git a/src/workflow.ts b/src/workflow.ts index 477ed0a..cda4346 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -78,7 +78,7 @@ export class Workflow extends Saveable implements Internal.WorkflowProperties { * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.Workflow_class /** * A short, human-readable label of this object. @@ -138,7 +138,7 @@ export class Workflow extends Saveable implements Internal.WorkflowProperties { * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. @@ -168,7 +168,7 @@ export class Workflow extends Saveable implements Internal.WorkflowProperties { steps: Array - constructor ({loadingOptions, extensionFields, id, class_, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, steps} : {loadingOptions?: LoadingOptions} & Internal.WorkflowProperties) { + constructor ({loadingOptions, extensionFields, id, class_ = Internal.Workflow_class.WORKFLOW, label, doc, inputs, outputs, requirements, hints, cwlVersion, intent, steps} : {loadingOptions?: LoadingOptions} & Internal.WorkflowProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.id = id diff --git a/src/workflowclass.ts b/src/workflowclass.ts new file mode 100644 index 0000000..8a55d0a --- /dev/null +++ b/src/workflowclass.ts @@ -0,0 +1,4 @@ + +export enum Workflow_class { + WORKFLOW='Workflow', +} diff --git a/src/workflowInputParameter.ts b/src/workflowinputparameter.ts similarity index 98% rename from src/workflowInputParameter.ts rename to src/workflowinputparameter.ts index 127c840..c3581a1 100644 --- a/src/workflowInputParameter.ts +++ b/src/workflowinputparameter.ts @@ -130,7 +130,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.Workflo * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing @@ -145,7 +145,7 @@ export class WorkflowInputParameter extends Saveable implements Internal.Workflo * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + type: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array /** * Deprecated. Preserved for v1.0 backwards compatability. Will be removed in diff --git a/src/workflowInputParameterProperties.ts b/src/workflowinputparameterproperties.ts similarity index 94% rename from src/workflowInputParameterProperties.ts rename to src/workflowinputparameterproperties.ts index 5600d62..6e47a7d 100644 --- a/src/workflowInputParameterProperties.ts +++ b/src/workflowinputparameterproperties.ts @@ -118,7 +118,7 @@ export interface WorkflowInputParameterProperties extends Internal.InputParamete * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * The default value to use for this parameter if the parameter is missing @@ -133,7 +133,7 @@ export interface WorkflowInputParameterProperties extends Internal.InputParamete * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | Array + type: Internal.CWLType | Internal.InputRecordSchema | Internal.InputEnumSchema | Internal.InputArraySchema | string | Array /** * Deprecated. Preserved for v1.0 backwards compatability. Will be removed in diff --git a/src/workflowOutputParameter.ts b/src/workflowoutputparameter.ts similarity index 97% rename from src/workflowOutputParameter.ts rename to src/workflowoutputparameter.ts index 54a82e6..443c8cb 100644 --- a/src/workflowOutputParameter.ts +++ b/src/workflowoutputparameter.ts @@ -123,19 +123,19 @@ export class WorkflowOutputParameter extends Saveable implements Internal.Workfl * If not specified, the default method is "merge_nested". * */ - linkMerge?: undefined | string + linkMerge?: undefined | Internal.LinkMergeMethod /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue?: undefined | string + pickValue?: undefined | Internal.PickValueMethod /** * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array constructor ({loadingOptions, extensionFields, id, label, secondaryFiles, streamable, doc, format, outputSource, linkMerge, pickValue, type} : {loadingOptions?: LoadingOptions} & Internal.WorkflowOutputParameterProperties) { diff --git a/src/workflowOutputParameterProperties.ts b/src/workflowoutputparameterproperties.ts similarity index 93% rename from src/workflowOutputParameterProperties.ts rename to src/workflowoutputparameterproperties.ts index 1a0d041..7673357 100644 --- a/src/workflowOutputParameterProperties.ts +++ b/src/workflowoutputparameterproperties.ts @@ -111,17 +111,17 @@ export interface WorkflowOutputParameterProperties extends Internal.OutputParame * If not specified, the default method is "merge_nested". * */ - linkMerge?: undefined | string + linkMerge?: undefined | Internal.LinkMergeMethod /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue?: undefined | string + pickValue?: undefined | Internal.PickValueMethod /** * Specify valid types of data that may be assigned to this parameter. * */ - type: string | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | Array + type: Internal.CWLType | Internal.OutputRecordSchema | Internal.OutputEnumSchema | Internal.OutputArraySchema | string | Array } \ No newline at end of file diff --git a/src/workflowProperties.ts b/src/workflowproperties.ts similarity index 98% rename from src/workflowProperties.ts rename to src/workflowproperties.ts index 50d5048..6d448b2 100644 --- a/src/workflowProperties.ts +++ b/src/workflowproperties.ts @@ -66,7 +66,7 @@ export interface WorkflowProperties extends Internal.ProcessProperties { * The unique identifier for this object. */ id?: undefined | string - class_: string + class_: Internal.Workflow_class /** * A short, human-readable label of this object. @@ -126,7 +126,7 @@ export interface WorkflowProperties extends Internal.ProcessProperties { * required for a Process embedded inside another Process. * */ - cwlVersion?: undefined | string + cwlVersion?: undefined | Internal.CWLVersion /** * An identifier for the type of computational operation, of this Process. diff --git a/src/workflowStep.ts b/src/workflowstep.ts similarity index 99% rename from src/workflowStep.ts rename to src/workflowstep.ts index 13979e6..10768b9 100644 --- a/src/workflowStep.ts +++ b/src/workflowstep.ts @@ -173,7 +173,7 @@ export class WorkflowStep extends Saveable implements Internal.WorkflowStepPrope * Required if `scatter` is an array of more than one element. * */ - scatterMethod?: undefined | string + scatterMethod?: undefined | Internal.ScatterMethod constructor ({loadingOptions, extensionFields, id, label, doc, in_, out, requirements, hints, run, when, scatter, scatterMethod} : {loadingOptions?: LoadingOptions} & Internal.WorkflowStepProperties) { diff --git a/src/workflowStepInput.ts b/src/workflowstepinput.ts similarity index 99% rename from src/workflowStepInput.ts rename to src/workflowstepinput.ts index dececad..27ae2ee 100644 --- a/src/workflowStepInput.ts +++ b/src/workflowstepinput.ts @@ -148,13 +148,13 @@ export class WorkflowStepInput extends Saveable implements Internal.WorkflowStep * If not specified, the default method is "merge_nested". * */ - linkMerge?: undefined | string + linkMerge?: undefined | Internal.LinkMergeMethod /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue?: undefined | string + pickValue?: undefined | Internal.PickValueMethod /** * Only valid when `type: File` or is an array of `items: File`. @@ -182,7 +182,7 @@ export class WorkflowStepInput extends Saveable implements Internal.WorkflowStep * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * A short, human-readable label of this object. diff --git a/src/workflowStepInputProperties.ts b/src/workflowstepinputproperties.ts similarity index 98% rename from src/workflowStepInputProperties.ts rename to src/workflowstepinputproperties.ts index 744eb44..04906cf 100644 --- a/src/workflowStepInputProperties.ts +++ b/src/workflowstepinputproperties.ts @@ -136,13 +136,13 @@ export interface WorkflowStepInputProperties extends Internal.IdentifiedProperti * If not specified, the default method is "merge_nested". * */ - linkMerge?: undefined | string + linkMerge?: undefined | Internal.LinkMergeMethod /** * The method to use to choose non-null elements among multiple sources. * */ - pickValue?: undefined | string + pickValue?: undefined | Internal.PickValueMethod /** * Only valid when `type: File` or is an array of `items: File`. @@ -170,7 +170,7 @@ export interface WorkflowStepInputProperties extends Internal.IdentifiedProperti * 3. By default: `no_listing` * */ - loadListing?: undefined | string + loadListing?: undefined | Internal.LoadListingEnum /** * A short, human-readable label of this object. diff --git a/src/workflowStepOutput.ts b/src/workflowstepoutput.ts similarity index 100% rename from src/workflowStepOutput.ts rename to src/workflowstepoutput.ts diff --git a/src/workflowStepOutputProperties.ts b/src/workflowstepoutputproperties.ts similarity index 100% rename from src/workflowStepOutputProperties.ts rename to src/workflowstepoutputproperties.ts diff --git a/src/workflowStepProperties.ts b/src/workflowstepproperties.ts similarity index 99% rename from src/workflowStepProperties.ts rename to src/workflowstepproperties.ts index ea29864..0b8ea95 100644 --- a/src/workflowStepProperties.ts +++ b/src/workflowstepproperties.ts @@ -161,5 +161,5 @@ export interface WorkflowStepProperties extends Internal.IdentifiedProperties, I * Required if `scatter` is an array of more than one element. * */ - scatterMethod?: undefined | string + scatterMethod?: undefined | Internal.ScatterMethod } \ No newline at end of file diff --git a/src/workReuse.ts b/src/workreuse.ts similarity index 95% rename from src/workReuse.ts rename to src/workreuse.ts index 1094cf7..e4b699b 100644 --- a/src/workReuse.ts +++ b/src/workreuse.ts @@ -35,11 +35,11 @@ export class WorkReuse extends Saveable implements Internal.WorkReuseProperties /** * Always 'WorkReuse' */ - class_: string + class_: Internal.WorkReuse_class enableReuse: boolean | string - constructor ({loadingOptions, extensionFields, class_, enableReuse} : {loadingOptions?: LoadingOptions} & Internal.WorkReuseProperties) { + constructor ({loadingOptions, extensionFields, class_ = Internal.WorkReuse_class.WORKREUSE, enableReuse} : {loadingOptions?: LoadingOptions} & Internal.WorkReuseProperties) { super(loadingOptions) this.extensionFields = extensionFields ?? {} this.class_ = class_ diff --git a/src/workreuseclass.ts b/src/workreuseclass.ts new file mode 100644 index 0000000..a5275eb --- /dev/null +++ b/src/workreuseclass.ts @@ -0,0 +1,4 @@ + +export enum WorkReuse_class { + WORKREUSE='WorkReuse', +} diff --git a/src/workReuseProperties.ts b/src/workreuseproperties.ts similarity index 96% rename from src/workReuseProperties.ts rename to src/workreuseproperties.ts index 821eb00..8bffa4e 100644 --- a/src/workReuseProperties.ts +++ b/src/workreuseproperties.ts @@ -23,6 +23,6 @@ export interface WorkReuseProperties extends Internal.ProcessRequirementProperti /** * Always 'WorkReuse' */ - class_: string + class_: Internal.WorkReuse_class enableReuse: boolean | string } \ No newline at end of file From df05c4270d559e5eb621dae7f6894ecaefb8615f Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Mon, 20 Dec 2021 19:09:15 +0100 Subject: [PATCH 13/19] Undo all lowercase file names --- src/{any.ts => Any.ts} | 0 src/{arrayschema.ts => ArraySchema.ts} | 4 +- ...properties.ts => ArraySchemaProperties.ts} | 2 +- src/{cwltype.ts => CWLType.ts} | 0 src/{cwlversion.ts => CWLVersion.ts} | 0 ...ayschema.ts => CommandInputArraySchema.ts} | 4 +- ...s => CommandInputArraySchemaProperties.ts} | 2 +- ...numschema.ts => CommandInputEnumSchema.ts} | 4 +- ...ts => CommandInputEnumSchemaProperties.ts} | 2 +- ...tparameter.ts => CommandInputParameter.ts} | 4 +- ....ts => CommandInputParameterProperties.ts} | 2 +- ...ordfield.ts => CommandInputRecordField.ts} | 4 +- ...s => CommandInputRecordFieldProperties.ts} | 2 +- ...dschema.ts => CommandInputRecordSchema.ts} | 4 +- ... => CommandInputRecordSchemaProperties.ts} | 2 +- ...ies.ts => CommandInputSchemaProperties.ts} | 2 +- ...linebindable.ts => CommandLineBindable.ts} | 4 +- ...es.ts => CommandLineBindableProperties.ts} | 2 +- ...ndlinebinding.ts => CommandLineBinding.ts} | 4 +- ...ies.ts => CommandLineBindingProperties.ts} | 2 +- ...{commandlinetool.ts => CommandLineTool.ts} | 4 +- ...erties.ts => CommandLineToolProperties.ts} | 2 +- ...etoolclass.ts => CommandLineTool_class.ts} | 0 ...yschema.ts => CommandOutputArraySchema.ts} | 4 +- ... => CommandOutputArraySchemaProperties.ts} | 2 +- ...tputbinding.ts => CommandOutputBinding.ts} | 4 +- ...s.ts => CommandOutputBindingProperties.ts} | 2 +- ...umschema.ts => CommandOutputEnumSchema.ts} | 4 +- ...s => CommandOutputEnumSchemaProperties.ts} | 2 +- ...parameter.ts => CommandOutputParameter.ts} | 4 +- ...ts => CommandOutputParameterProperties.ts} | 2 +- ...rdfield.ts => CommandOutputRecordField.ts} | 4 +- ... => CommandOutputRecordFieldProperties.ts} | 2 +- ...schema.ts => CommandOutputRecordSchema.ts} | 4 +- ...=> CommandOutputRecordSchemaProperties.ts} | 2 +- src/{directory.ts => Directory.ts} | 4 +- ...ryproperties.ts => DirectoryProperties.ts} | 2 +- src/{directoryclass.ts => Directory_class.ts} | 0 src/{dirent.ts => Dirent.ts} | 4 +- ...irentproperties.ts => DirentProperties.ts} | 2 +- ...kerrequirement.ts => DockerRequirement.ts} | 4 +- ...ties.ts => DockerRequirementProperties.ts} | 2 +- ...entclass.ts => DockerRequirement_class.ts} | 0 ...dproperties.ts => DocumentedProperties.ts} | 2 +- src/{enumschema.ts => EnumSchema.ts} | 4 +- ...aproperties.ts => EnumSchemaProperties.ts} | 2 +- ...varrequirement.ts => EnvVarRequirement.ts} | 4 +- ...ties.ts => EnvVarRequirementProperties.ts} | 2 +- ...entclass.ts => EnvVarRequirement_class.ts} | 0 src/{environmentdef.ts => EnvironmentDef.ts} | 4 +- ...perties.ts => EnvironmentDefProperties.ts} | 2 +- src/{expression.ts => Expression.ts} | 0 src/{expressiontool.ts => ExpressionTool.ts} | 4 +- ...er.ts => ExpressionToolOutputParameter.ts} | 4 +- ...xpressionToolOutputParameterProperties.ts} | 2 +- ...perties.ts => ExpressionToolProperties.ts} | 2 +- ...ontoolclass.ts => ExpressionTool_class.ts} | 0 ...seproperties.ts => FieldBaseProperties.ts} | 2 +- src/{file.ts => File.ts} | 4 +- src/{fileproperties.ts => FileProperties.ts} | 2 +- src/{fileclass.ts => File_class.ts} | 0 ...emaproperties.ts => IOSchemaProperties.ts} | 2 +- ...dproperties.ts => IdentifiedProperties.ts} | 2 +- ...rement.ts => InitialWorkDirRequirement.ts} | 4 +- ...=> InitialWorkDirRequirementProperties.ts} | 2 +- ....ts => InitialWorkDirRequirement_class.ts} | 0 ...ment.ts => InlineJavascriptRequirement.ts} | 4 +- ... InlineJavascriptRequirementProperties.ts} | 2 +- ...s => InlineJavascriptRequirement_class.ts} | 0 ...irement.ts => InplaceUpdateRequirement.ts} | 4 +- ... => InplaceUpdateRequirementProperties.ts} | 2 +- ...s.ts => InplaceUpdateRequirement_class.ts} | 0 ...nputarrayschema.ts => InputArraySchema.ts} | 4 +- ...rties.ts => InputArraySchemaProperties.ts} | 2 +- src/{inputbinding.ts => InputBinding.ts} | 4 +- ...roperties.ts => InputBindingProperties.ts} | 2 +- ...{inputenumschema.ts => InputEnumSchema.ts} | 4 +- ...erties.ts => InputEnumSchemaProperties.ts} | 2 +- ...properties.ts => InputFormatProperties.ts} | 2 +- ...perties.ts => InputParameterProperties.ts} | 2 +- ...nputrecordfield.ts => InputRecordField.ts} | 4 +- ...rties.ts => InputRecordFieldProperties.ts} | 2 +- ...utrecordschema.ts => InputRecordSchema.ts} | 4 +- ...ties.ts => InputRecordSchemaProperties.ts} | 2 +- ...properties.ts => InputSchemaProperties.ts} | 2 +- ...eledproperties.ts => LabeledProperties.ts} | 2 +- ...{linkmergemethod.ts => LinkMergeMethod.ts} | 0 ...roperties.ts => LoadContentsProperties.ts} | 2 +- ...{loadlistingenum.ts => LoadListingEnum.ts} | 0 ...quirement.ts => LoadListingRequirement.ts} | 4 +- ...ts => LoadListingRequirementProperties.ts} | 2 +- ...ass.ts => LoadListingRequirement_class.ts} | 0 ....ts => MultipleInputFeatureRequirement.ts} | 4 +- ...tipleInputFeatureRequirementProperties.ts} | 2 +- ... MultipleInputFeatureRequirement_class.ts} | 0 src/{networkaccess.ts => NetworkAccess.ts} | 4 +- ...operties.ts => NetworkAccessProperties.ts} | 2 +- ...kaccessclass.ts => NetworkAccess_class.ts} | 0 src/{operation.ts => Operation.ts} | 4 +- ...arameter.ts => OperationInputParameter.ts} | 4 +- ...s => OperationInputParameterProperties.ts} | 2 +- ...rameter.ts => OperationOutputParameter.ts} | 4 +- ... => OperationOutputParameterProperties.ts} | 2 +- ...onproperties.ts => OperationProperties.ts} | 2 +- src/{operationclass.ts => Operation_class.ts} | 0 ...putarrayschema.ts => OutputArraySchema.ts} | 4 +- ...ties.ts => OutputArraySchemaProperties.ts} | 2 +- ...utputenumschema.ts => OutputEnumSchema.ts} | 4 +- ...rties.ts => OutputEnumSchemaProperties.ts} | 2 +- ...roperties.ts => OutputFormatProperties.ts} | 2 +- ...erties.ts => OutputParameterProperties.ts} | 2 +- ...putrecordfield.ts => OutputRecordField.ts} | 4 +- ...ties.ts => OutputRecordFieldProperties.ts} | 2 +- ...trecordschema.ts => OutputRecordSchema.ts} | 4 +- ...ies.ts => OutputRecordSchemaProperties.ts} | 2 +- ...roperties.ts => OutputSchemaProperties.ts} | 2 +- ...erproperties.ts => ParameterProperties.ts} | 2 +- ...{pickvaluemethod.ts => PickValueMethod.ts} | 0 src/{primitivetype.ts => PrimitiveType.ts} | 0 ...cessproperties.ts => ProcessProperties.ts} | 2 +- ...ies.ts => ProcessRequirementProperties.ts} | 2 +- src/{recordfield.ts => RecordField.ts} | 4 +- ...properties.ts => RecordFieldProperties.ts} | 2 +- src/{recordschema.ts => RecordSchema.ts} | 4 +- ...roperties.ts => RecordSchemaProperties.ts} | 2 +- ...erequirement.ts => ResourceRequirement.ts} | 4 +- ...es.ts => ResourceRequirementProperties.ts} | 2 +- ...tclass.ts => ResourceRequirement_class.ts} | 0 ...rement.ts => ScatterFeatureRequirement.ts} | 4 +- ...=> ScatterFeatureRequirementProperties.ts} | 2 +- ....ts => ScatterFeatureRequirement_class.ts} | 0 src/{scattermethod.ts => ScatterMethod.ts} | 0 ...requirement.ts => SchemaDefRequirement.ts} | 4 +- ...s.ts => SchemaDefRequirementProperties.ts} | 2 +- ...class.ts => SchemaDefRequirement_class.ts} | 0 ...ryfileschema.ts => SecondaryFileSchema.ts} | 4 +- ...es.ts => SecondaryFileSchemaProperties.ts} | 2 +- ...uirement.ts => ShellCommandRequirement.ts} | 4 +- ...s => ShellCommandRequirementProperties.ts} | 2 +- ...ss.ts => ShellCommandRequirement_class.ts} | 0 src/{sinkproperties.ts => SinkProperties.ts} | 2 +- ...{softwarepackage.ts => SoftwarePackage.ts} | 4 +- ...erties.ts => SoftwarePackageProperties.ts} | 2 +- ...erequirement.ts => SoftwareRequirement.ts} | 4 +- ...es.ts => SoftwareRequirementProperties.ts} | 2 +- ...tclass.ts => SoftwareRequirement_class.ts} | 0 ...t.ts => StepInputExpressionRequirement.ts} | 4 +- ...epInputExpressionRequirementProperties.ts} | 2 +- ...> StepInputExpressionRequirement_class.ts} | 0 ...nt.ts => SubworkflowFeatureRequirement.ts} | 4 +- ...ubworkflowFeatureRequirementProperties.ts} | 2 +- ...=> SubworkflowFeatureRequirement_class.ts} | 0 src/{tooltimelimit.ts => ToolTimeLimit.ts} | 4 +- ...operties.ts => ToolTimeLimitProperties.ts} | 2 +- ...melimitclass.ts => ToolTimeLimit_class.ts} | 0 src/{workreuse.ts => WorkReuse.ts} | 4 +- ...seproperties.ts => WorkReuseProperties.ts} | 2 +- src/{workreuseclass.ts => WorkReuse_class.ts} | 0 src/{workflow.ts => Workflow.ts} | 4 +- ...parameter.ts => WorkflowInputParameter.ts} | 4 +- ...ts => WorkflowInputParameterProperties.ts} | 2 +- ...arameter.ts => WorkflowOutputParameter.ts} | 4 +- ...s => WorkflowOutputParameterProperties.ts} | 2 +- ...lowproperties.ts => WorkflowProperties.ts} | 2 +- src/{workflowstep.ts => WorkflowStep.ts} | 4 +- ...kflowstepinput.ts => WorkflowStepInput.ts} | 4 +- ...ties.ts => WorkflowStepInputProperties.ts} | 2 +- ...lowstepoutput.ts => WorkflowStepOutput.ts} | 4 +- ...ies.ts => WorkflowStepOutputProperties.ts} | 2 +- ...roperties.ts => WorkflowStepProperties.ts} | 2 +- src/{workflowclass.ts => Workflow_class.ts} | 0 ...62602be0b4b8fd33e69e29a841317b6ab665bc.ts} | 0 ...61d79c225752b9fadb617367615ab176b47d77.ts} | 0 ...cba076fca539106791a4f46d198c7fcfbdb779.ts} | 0 src/index.ts | 312 +++++++++--------- .../{anyLoader.spec.ts => AnyLoader.spec.ts} | 2 +- src/test/{exampleTest.ts => ExampleTest.ts} | 0 src/test/{fetcher.spec.ts => Fetcher.spec.ts} | 2 +- src/test/{idMap.spec.ts => IdMap.spec.ts} | 2 +- ...{typeguards.spec.ts => Typeguards.spec.ts} | 2 +- src/util/{dict.ts => Dict.ts} | 0 src/util/{fetcher.ts => Fetcher.ts} | 2 +- src/util/Internal.ts | 199 +++++++++++ ...{loaderinstances.ts => LoaderInstances.ts} | 312 +++++++++--------- .../{loadingoptions.ts => LoadingOptions.ts} | 2 +- src/util/{saveable.ts => Saveable.ts} | 2 +- src/util/{typeguards.ts => Typeguards.ts} | 2 +- ...ionexception.ts => ValidationException.ts} | 0 src/util/{vocabs.ts => Vocabs.ts} | 0 src/util/internal.ts | 199 ----------- .../loaders/{anyloader.ts => AnyLoader.ts} | 2 +- .../{arrayloader.ts => ArrayLoader.ts} | 2 +- .../loaders/{enumloader.ts => EnumLoader.ts} | 2 +- ...xpressionloader.ts => ExpressionLoader.ts} | 2 +- .../{idmaploader.ts => IdMapLoader.ts} | 2 +- src/util/loaders/{loader.ts => Loader.ts} | 2 +- ...{primitiveloader.ts => PrimitiveLoader.ts} | 2 +- .../{recordloader.ts => RecordLoader.ts} | 2 +- .../loaders/{rootloader.ts => RootLoader.ts} | 4 +- ...darydslloader.ts => SecondaryDSLLoader.ts} | 2 +- .../{typedslloader.ts => TypeDSLLoader.ts} | 2 +- .../{unionloader.ts => UnionLoader.ts} | 2 +- .../loaders/{uriloader.ts => UriLoader.ts} | 2 +- 203 files changed, 733 insertions(+), 733 deletions(-) rename src/{any.ts => Any.ts} (100%) rename src/{arrayschema.ts => ArraySchema.ts} (98%) rename src/{arrayschemaproperties.ts => ArraySchemaProperties.ts} (93%) rename src/{cwltype.ts => CWLType.ts} (100%) rename src/{cwlversion.ts => CWLVersion.ts} (100%) rename src/{commandinputarrayschema.ts => CommandInputArraySchema.ts} (99%) rename src/{commandinputarrayschemaproperties.ts => CommandInputArraySchemaProperties.ts} (96%) rename src/{commandinputenumschema.ts => CommandInputEnumSchema.ts} (99%) rename src/{commandinputenumschemaproperties.ts => CommandInputEnumSchemaProperties.ts} (95%) rename src/{commandinputparameter.ts => CommandInputParameter.ts} (99%) rename src/{commandinputparameterproperties.ts => CommandInputParameterProperties.ts} (99%) rename src/{commandinputrecordfield.ts => CommandInputRecordField.ts} (99%) rename src/{commandinputrecordfieldproperties.ts => CommandInputRecordFieldProperties.ts} (99%) rename src/{commandinputrecordschema.ts => CommandInputRecordSchema.ts} (99%) rename src/{commandinputrecordschemaproperties.ts => CommandInputRecordSchemaProperties.ts} (95%) rename src/{commandinputschemaproperties.ts => CommandInputSchemaProperties.ts} (78%) rename src/{commandlinebindable.ts => CommandLineBindable.ts} (98%) rename src/{commandlinebindableproperties.ts => CommandLineBindableProperties.ts} (89%) rename src/{commandlinebinding.ts => CommandLineBinding.ts} (99%) rename src/{commandlinebindingproperties.ts => CommandLineBindingProperties.ts} (99%) rename src/{commandlinetool.ts => CommandLineTool.ts} (99%) rename src/{commandlinetoolproperties.ts => CommandLineToolProperties.ts} (99%) rename src/{commandlinetoolclass.ts => CommandLineTool_class.ts} (100%) rename src/{commandoutputarrayschema.ts => CommandOutputArraySchema.ts} (99%) rename src/{commandoutputarrayschemaproperties.ts => CommandOutputArraySchemaProperties.ts} (95%) rename src/{commandoutputbinding.ts => CommandOutputBinding.ts} (99%) rename src/{commandoutputbindingproperties.ts => CommandOutputBindingProperties.ts} (99%) rename src/{commandoutputenumschema.ts => CommandOutputEnumSchema.ts} (99%) rename src/{commandoutputenumschemaproperties.ts => CommandOutputEnumSchemaProperties.ts} (94%) rename src/{commandoutputparameter.ts => CommandOutputParameter.ts} (99%) rename src/{commandoutputparameterproperties.ts => CommandOutputParameterProperties.ts} (98%) rename src/{commandoutputrecordfield.ts => CommandOutputRecordField.ts} (99%) rename src/{commandoutputrecordfieldproperties.ts => CommandOutputRecordFieldProperties.ts} (98%) rename src/{commandoutputrecordschema.ts => CommandOutputRecordSchema.ts} (99%) rename src/{commandoutputrecordschemaproperties.ts => CommandOutputRecordSchemaProperties.ts} (94%) rename src/{directory.ts => Directory.ts} (99%) rename src/{directoryproperties.ts => DirectoryProperties.ts} (99%) rename src/{directoryclass.ts => Directory_class.ts} (100%) rename src/{dirent.ts => Dirent.ts} (99%) rename src/{direntproperties.ts => DirentProperties.ts} (98%) rename src/{dockerrequirement.ts => DockerRequirement.ts} (99%) rename src/{dockerrequirementproperties.ts => DockerRequirementProperties.ts} (98%) rename src/{dockerrequirementclass.ts => DockerRequirement_class.ts} (100%) rename src/{documentedproperties.ts => DocumentedProperties.ts} (87%) rename src/{enumschema.ts => EnumSchema.ts} (98%) rename src/{enumschemaproperties.ts => EnumSchemaProperties.ts} (90%) rename src/{envvarrequirement.ts => EnvVarRequirement.ts} (98%) rename src/{envvarrequirementproperties.ts => EnvVarRequirementProperties.ts} (93%) rename src/{envvarrequirementclass.ts => EnvVarRequirement_class.ts} (100%) rename src/{environmentdef.ts => EnvironmentDef.ts} (98%) rename src/{environmentdefproperties.ts => EnvironmentDefProperties.ts} (93%) rename src/{expression.ts => Expression.ts} (100%) rename src/{expressiontool.ts => ExpressionTool.ts} (99%) rename src/{expressiontooloutputparameter.ts => ExpressionToolOutputParameter.ts} (99%) rename src/{expressiontooloutputparameterproperties.ts => ExpressionToolOutputParameterProperties.ts} (98%) rename src/{expressiontoolproperties.ts => ExpressionToolProperties.ts} (99%) rename src/{expressiontoolclass.ts => ExpressionTool_class.ts} (100%) rename src/{fieldbaseproperties.ts => FieldBaseProperties.ts} (98%) rename src/{file.ts => File.ts} (99%) rename src/{fileproperties.ts => FileProperties.ts} (99%) rename src/{fileclass.ts => File_class.ts} (100%) rename src/{ioschemaproperties.ts => IOSchemaProperties.ts} (92%) rename src/{identifiedproperties.ts => IdentifiedProperties.ts} (83%) rename src/{initialworkdirrequirement.ts => InitialWorkDirRequirement.ts} (98%) rename src/{initialworkdirrequirementproperties.ts => InitialWorkDirRequirementProperties.ts} (97%) rename src/{initialworkdirrequirementclass.ts => InitialWorkDirRequirement_class.ts} (100%) rename src/{inlinejavascriptrequirement.ts => InlineJavascriptRequirement.ts} (98%) rename src/{inlinejavascriptrequirementproperties.ts => InlineJavascriptRequirementProperties.ts} (95%) rename src/{inlinejavascriptrequirementclass.ts => InlineJavascriptRequirement_class.ts} (100%) rename src/{inplaceupdaterequirement.ts => InplaceUpdateRequirement.ts} (98%) rename src/{inplaceupdaterequirementproperties.ts => InplaceUpdateRequirementProperties.ts} (97%) rename src/{inplaceupdaterequirementclass.ts => InplaceUpdateRequirement_class.ts} (100%) rename src/{inputarrayschema.ts => InputArraySchema.ts} (99%) rename src/{inputarrayschemaproperties.ts => InputArraySchemaProperties.ts} (95%) rename src/{inputbinding.ts => InputBinding.ts} (98%) rename src/{inputbindingproperties.ts => InputBindingProperties.ts} (91%) rename src/{inputenumschema.ts => InputEnumSchema.ts} (99%) rename src/{inputenumschemaproperties.ts => InputEnumSchemaProperties.ts} (94%) rename src/{inputformatproperties.ts => InputFormatProperties.ts} (92%) rename src/{inputparameterproperties.ts => InputParameterProperties.ts} (99%) rename src/{inputrecordfield.ts => InputRecordField.ts} (99%) rename src/{inputrecordfieldproperties.ts => InputRecordFieldProperties.ts} (99%) rename src/{inputrecordschema.ts => InputRecordSchema.ts} (99%) rename src/{inputrecordschemaproperties.ts => InputRecordSchemaProperties.ts} (94%) rename src/{inputschemaproperties.ts => InputSchemaProperties.ts} (91%) rename src/{labeledproperties.ts => LabeledProperties.ts} (83%) rename src/{linkmergemethod.ts => LinkMergeMethod.ts} (100%) rename src/{loadcontentsproperties.ts => LoadContentsProperties.ts} (96%) rename src/{loadlistingenum.ts => LoadListingEnum.ts} (100%) rename src/{loadlistingrequirement.ts => LoadListingRequirement.ts} (98%) rename src/{loadlistingrequirementproperties.ts => LoadListingRequirementProperties.ts} (92%) rename src/{loadlistingrequirementclass.ts => LoadListingRequirement_class.ts} (100%) rename src/{multipleinputfeaturerequirement.ts => MultipleInputFeatureRequirement.ts} (98%) rename src/{multipleinputfeaturerequirementproperties.ts => MultipleInputFeatureRequirementProperties.ts} (92%) rename src/{multipleinputfeaturerequirementclass.ts => MultipleInputFeatureRequirement_class.ts} (100%) rename src/{networkaccess.ts => NetworkAccess.ts} (98%) rename src/{networkaccessproperties.ts => NetworkAccessProperties.ts} (96%) rename src/{networkaccessclass.ts => NetworkAccess_class.ts} (100%) rename src/{operation.ts => Operation.ts} (99%) rename src/{operationinputparameter.ts => OperationInputParameter.ts} (99%) rename src/{operationinputparameterproperties.ts => OperationInputParameterProperties.ts} (99%) rename src/{operationoutputparameter.ts => OperationOutputParameter.ts} (99%) rename src/{operationoutputparameterproperties.ts => OperationOutputParameterProperties.ts} (98%) rename src/{operationproperties.ts => OperationProperties.ts} (99%) rename src/{operationclass.ts => Operation_class.ts} (100%) rename src/{outputarrayschema.ts => OutputArraySchema.ts} (99%) rename src/{outputarrayschemaproperties.ts => OutputArraySchemaProperties.ts} (95%) rename src/{outputenumschema.ts => OutputEnumSchema.ts} (99%) rename src/{outputenumschemaproperties.ts => OutputEnumSchemaProperties.ts} (94%) rename src/{outputformatproperties.ts => OutputFormatProperties.ts} (88%) rename src/{outputparameterproperties.ts => OutputParameterProperties.ts} (98%) rename src/{outputrecordfield.ts => OutputRecordField.ts} (99%) rename src/{outputrecordfieldproperties.ts => OutputRecordFieldProperties.ts} (98%) rename src/{outputrecordschema.ts => OutputRecordSchema.ts} (99%) rename src/{outputrecordschemaproperties.ts => OutputRecordSchemaProperties.ts} (94%) rename src/{outputschemaproperties.ts => OutputSchemaProperties.ts} (91%) rename src/{parameterproperties.ts => ParameterProperties.ts} (98%) rename src/{pickvaluemethod.ts => PickValueMethod.ts} (100%) rename src/{primitivetype.ts => PrimitiveType.ts} (100%) rename src/{processproperties.ts => ProcessProperties.ts} (98%) rename src/{processrequirementproperties.ts => ProcessRequirementProperties.ts} (91%) rename src/{recordfield.ts => RecordField.ts} (98%) rename src/{recordfieldproperties.ts => RecordFieldProperties.ts} (94%) rename src/{recordschema.ts => RecordSchema.ts} (98%) rename src/{recordschemaproperties.ts => RecordSchemaProperties.ts} (90%) rename src/{resourcerequirement.ts => ResourceRequirement.ts} (99%) rename src/{resourcerequirementproperties.ts => ResourceRequirementProperties.ts} (99%) rename src/{resourcerequirementclass.ts => ResourceRequirement_class.ts} (100%) rename src/{scatterfeaturerequirement.ts => ScatterFeatureRequirement.ts} (98%) rename src/{scatterfeaturerequirementproperties.ts => ScatterFeatureRequirementProperties.ts} (92%) rename src/{scatterfeaturerequirementclass.ts => ScatterFeatureRequirement_class.ts} (100%) rename src/{scattermethod.ts => ScatterMethod.ts} (100%) rename src/{schemadefrequirement.ts => SchemaDefRequirement.ts} (98%) rename src/{schemadefrequirementproperties.ts => SchemaDefRequirementProperties.ts} (96%) rename src/{schemadefrequirementclass.ts => SchemaDefRequirement_class.ts} (100%) rename src/{secondaryfileschema.ts => SecondaryFileSchema.ts} (99%) rename src/{secondaryfileschemaproperties.ts => SecondaryFileSchemaProperties.ts} (98%) rename src/{shellcommandrequirement.ts => ShellCommandRequirement.ts} (98%) rename src/{shellcommandrequirementproperties.ts => ShellCommandRequirementProperties.ts} (95%) rename src/{shellcommandrequirementclass.ts => ShellCommandRequirement_class.ts} (100%) rename src/{sinkproperties.ts => SinkProperties.ts} (93%) rename src/{softwarepackage.ts => SoftwarePackage.ts} (99%) rename src/{softwarepackageproperties.ts => SoftwarePackageProperties.ts} (98%) rename src/{softwarerequirement.ts => SoftwareRequirement.ts} (98%) rename src/{softwarerequirementproperties.ts => SoftwareRequirementProperties.ts} (92%) rename src/{softwarerequirementclass.ts => SoftwareRequirement_class.ts} (100%) rename src/{stepinputexpressionrequirement.ts => StepInputExpressionRequirement.ts} (98%) rename src/{stepinputexpressionrequirementproperties.ts => StepInputExpressionRequirementProperties.ts} (92%) rename src/{stepinputexpressionrequirementclass.ts => StepInputExpressionRequirement_class.ts} (100%) rename src/{subworkflowfeaturerequirement.ts => SubworkflowFeatureRequirement.ts} (98%) rename src/{subworkflowfeaturerequirementproperties.ts => SubworkflowFeatureRequirementProperties.ts} (92%) rename src/{subworkflowfeaturerequirementclass.ts => SubworkflowFeatureRequirement_class.ts} (100%) rename src/{tooltimelimit.ts => ToolTimeLimit.ts} (98%) rename src/{tooltimelimitproperties.ts => ToolTimeLimitProperties.ts} (95%) rename src/{tooltimelimitclass.ts => ToolTimeLimit_class.ts} (100%) rename src/{workreuse.ts => WorkReuse.ts} (98%) rename src/{workreuseproperties.ts => WorkReuseProperties.ts} (95%) rename src/{workreuseclass.ts => WorkReuse_class.ts} (100%) rename src/{workflow.ts => Workflow.ts} (99%) rename src/{workflowinputparameter.ts => WorkflowInputParameter.ts} (99%) rename src/{workflowinputparameterproperties.ts => WorkflowInputParameterProperties.ts} (99%) rename src/{workflowoutputparameter.ts => WorkflowOutputParameter.ts} (99%) rename src/{workflowoutputparameterproperties.ts => WorkflowOutputParameterProperties.ts} (99%) rename src/{workflowproperties.ts => WorkflowProperties.ts} (99%) rename src/{workflowstep.ts => WorkflowStep.ts} (99%) rename src/{workflowstepinput.ts => WorkflowStepInput.ts} (99%) rename src/{workflowstepinputproperties.ts => WorkflowStepInputProperties.ts} (99%) rename src/{workflowstepoutput.ts => WorkflowStepOutput.ts} (98%) rename src/{workflowstepoutputproperties.ts => WorkflowStepOutputProperties.ts} (94%) rename src/{workflowstepproperties.ts => WorkflowStepProperties.ts} (99%) rename src/{workflowclass.ts => Workflow_class.ts} (100%) rename src/{enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts => enum_d062602be0b4b8fd33e69e29a841317b6ab665bc.ts} (100%) rename src/{enumd961d79c225752b9fadb617367615ab176b47d77.ts => enum_d961d79c225752b9fadb617367615ab176b47d77.ts} (100%) rename src/{enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts => enum_d9cba076fca539106791a4f46d198c7fcfbdb779.ts} (100%) rename src/test/{anyLoader.spec.ts => AnyLoader.spec.ts} (92%) rename src/test/{exampleTest.ts => ExampleTest.ts} (100%) rename src/test/{fetcher.spec.ts => Fetcher.spec.ts} (97%) rename src/test/{idMap.spec.ts => IdMap.spec.ts} (97%) rename src/test/{typeguards.spec.ts => Typeguards.spec.ts} (98%) rename src/util/{dict.ts => Dict.ts} (100%) rename src/util/{fetcher.ts => Fetcher.ts} (97%) create mode 100644 src/util/Internal.ts rename src/util/{loaderinstances.ts => LoaderInstances.ts} (99%) rename src/util/{loadingoptions.ts => LoadingOptions.ts} (98%) rename src/util/{saveable.ts => Saveable.ts} (97%) rename src/util/{typeguards.ts => Typeguards.ts} (93%) rename src/util/{validationexception.ts => ValidationException.ts} (100%) rename src/util/{vocabs.ts => Vocabs.ts} (100%) delete mode 100644 src/util/internal.ts rename src/util/loaders/{anyloader.ts => AnyLoader.ts} (97%) rename src/util/loaders/{arrayloader.ts => ArrayLoader.ts} (96%) rename src/util/loaders/{enumloader.ts => EnumLoader.ts} (97%) rename src/util/loaders/{expressionloader.ts => ExpressionLoader.ts} (97%) rename src/util/loaders/{idmaploader.ts => IdMapLoader.ts} (97%) rename src/util/loaders/{loader.ts => Loader.ts} (98%) rename src/util/loaders/{primitiveloader.ts => PrimitiveLoader.ts} (97%) rename src/util/loaders/{recordloader.ts => RecordLoader.ts} (95%) rename src/util/loaders/{rootloader.ts => RootLoader.ts} (98%) rename src/util/loaders/{secondarydslloader.ts => SecondaryDSLLoader.ts} (98%) rename src/util/loaders/{typedslloader.ts => TypeDSLLoader.ts} (99%) rename src/util/loaders/{unionloader.ts => UnionLoader.ts} (97%) rename src/util/loaders/{uriloader.ts => UriLoader.ts} (93%) diff --git a/src/any.ts b/src/Any.ts similarity index 100% rename from src/any.ts rename to src/Any.ts diff --git a/src/arrayschema.ts b/src/ArraySchema.ts similarity index 98% rename from src/arrayschema.ts rename to src/ArraySchema.ts index 7adbd21..9600dc6 100644 --- a/src/arrayschema.ts +++ b/src/ArraySchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/arrayschemaproperties.ts b/src/ArraySchemaProperties.ts similarity index 93% rename from src/arrayschemaproperties.ts rename to src/ArraySchemaProperties.ts index 9f10f90..f8a04f3 100644 --- a/src/arrayschemaproperties.ts +++ b/src/ArraySchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/cwltype.ts b/src/CWLType.ts similarity index 100% rename from src/cwltype.ts rename to src/CWLType.ts diff --git a/src/cwlversion.ts b/src/CWLVersion.ts similarity index 100% rename from src/cwlversion.ts rename to src/CWLVersion.ts diff --git a/src/commandinputarrayschema.ts b/src/CommandInputArraySchema.ts similarity index 99% rename from src/commandinputarrayschema.ts rename to src/CommandInputArraySchema.ts index fa52c6d..bac4a64 100644 --- a/src/commandinputarrayschema.ts +++ b/src/CommandInputArraySchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputarrayschemaproperties.ts b/src/CommandInputArraySchemaProperties.ts similarity index 96% rename from src/commandinputarrayschemaproperties.ts rename to src/CommandInputArraySchemaProperties.ts index 001298d..e5d6371 100644 --- a/src/commandinputarrayschemaproperties.ts +++ b/src/CommandInputArraySchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputenumschema.ts b/src/CommandInputEnumSchema.ts similarity index 99% rename from src/commandinputenumschema.ts rename to src/CommandInputEnumSchema.ts index 9feb0c5..c0ed41f 100644 --- a/src/commandinputenumschema.ts +++ b/src/CommandInputEnumSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputenumschemaproperties.ts b/src/CommandInputEnumSchemaProperties.ts similarity index 95% rename from src/commandinputenumschemaproperties.ts rename to src/CommandInputEnumSchemaProperties.ts index 4a4b608..454a712 100644 --- a/src/commandinputenumschemaproperties.ts +++ b/src/CommandInputEnumSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputparameter.ts b/src/CommandInputParameter.ts similarity index 99% rename from src/commandinputparameter.ts rename to src/CommandInputParameter.ts index eed6a01..fef4ecc 100644 --- a/src/commandinputparameter.ts +++ b/src/CommandInputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputparameterproperties.ts b/src/CommandInputParameterProperties.ts similarity index 99% rename from src/commandinputparameterproperties.ts rename to src/CommandInputParameterProperties.ts index fa1520a..b3d3554 100644 --- a/src/commandinputparameterproperties.ts +++ b/src/CommandInputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputrecordfield.ts b/src/CommandInputRecordField.ts similarity index 99% rename from src/commandinputrecordfield.ts rename to src/CommandInputRecordField.ts index 3e3cdc1..3372cdb 100644 --- a/src/commandinputrecordfield.ts +++ b/src/CommandInputRecordField.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputrecordfieldproperties.ts b/src/CommandInputRecordFieldProperties.ts similarity index 99% rename from src/commandinputrecordfieldproperties.ts rename to src/CommandInputRecordFieldProperties.ts index b7c1d8d..6907b0c 100644 --- a/src/commandinputrecordfieldproperties.ts +++ b/src/CommandInputRecordFieldProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputrecordschema.ts b/src/CommandInputRecordSchema.ts similarity index 99% rename from src/commandinputrecordschema.ts rename to src/CommandInputRecordSchema.ts index 26a24f9..a65f046 100644 --- a/src/commandinputrecordschema.ts +++ b/src/CommandInputRecordSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputrecordschemaproperties.ts b/src/CommandInputRecordSchemaProperties.ts similarity index 95% rename from src/commandinputrecordschemaproperties.ts rename to src/CommandInputRecordSchemaProperties.ts index b0b64e4..9c3f6b6 100644 --- a/src/commandinputrecordschemaproperties.ts +++ b/src/CommandInputRecordSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandinputschemaproperties.ts b/src/CommandInputSchemaProperties.ts similarity index 78% rename from src/commandinputschemaproperties.ts rename to src/CommandInputSchemaProperties.ts index 9975240..e41662f 100644 --- a/src/commandinputschemaproperties.ts +++ b/src/CommandInputSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinebindable.ts b/src/CommandLineBindable.ts similarity index 98% rename from src/commandlinebindable.ts rename to src/CommandLineBindable.ts index 2bba310..986b350 100644 --- a/src/commandlinebindable.ts +++ b/src/CommandLineBindable.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinebindableproperties.ts b/src/CommandLineBindableProperties.ts similarity index 89% rename from src/commandlinebindableproperties.ts rename to src/CommandLineBindableProperties.ts index f52b4b1..d19fcc5 100644 --- a/src/commandlinebindableproperties.ts +++ b/src/CommandLineBindableProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinebinding.ts b/src/CommandLineBinding.ts similarity index 99% rename from src/commandlinebinding.ts rename to src/CommandLineBinding.ts index 16b45ca..ef578da 100644 --- a/src/commandlinebinding.ts +++ b/src/CommandLineBinding.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinebindingproperties.ts b/src/CommandLineBindingProperties.ts similarity index 99% rename from src/commandlinebindingproperties.ts rename to src/CommandLineBindingProperties.ts index 7db66b9..fcd1e60 100644 --- a/src/commandlinebindingproperties.ts +++ b/src/CommandLineBindingProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinetool.ts b/src/CommandLineTool.ts similarity index 99% rename from src/commandlinetool.ts rename to src/CommandLineTool.ts index e970eff..890691a 100644 --- a/src/commandlinetool.ts +++ b/src/CommandLineTool.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinetoolproperties.ts b/src/CommandLineToolProperties.ts similarity index 99% rename from src/commandlinetoolproperties.ts rename to src/CommandLineToolProperties.ts index 71d5939..e527ed9 100644 --- a/src/commandlinetoolproperties.ts +++ b/src/CommandLineToolProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandlinetoolclass.ts b/src/CommandLineTool_class.ts similarity index 100% rename from src/commandlinetoolclass.ts rename to src/CommandLineTool_class.ts diff --git a/src/commandoutputarrayschema.ts b/src/CommandOutputArraySchema.ts similarity index 99% rename from src/commandoutputarrayschema.ts rename to src/CommandOutputArraySchema.ts index 2ed4259..870f8a1 100644 --- a/src/commandoutputarrayschema.ts +++ b/src/CommandOutputArraySchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputarrayschemaproperties.ts b/src/CommandOutputArraySchemaProperties.ts similarity index 95% rename from src/commandoutputarrayschemaproperties.ts rename to src/CommandOutputArraySchemaProperties.ts index 8879d7f..53c6e53 100644 --- a/src/commandoutputarrayschemaproperties.ts +++ b/src/CommandOutputArraySchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputbinding.ts b/src/CommandOutputBinding.ts similarity index 99% rename from src/commandoutputbinding.ts rename to src/CommandOutputBinding.ts index c561f0d..cdc39e1 100644 --- a/src/commandoutputbinding.ts +++ b/src/CommandOutputBinding.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputbindingproperties.ts b/src/CommandOutputBindingProperties.ts similarity index 99% rename from src/commandoutputbindingproperties.ts rename to src/CommandOutputBindingProperties.ts index d957c0c..8f038d4 100644 --- a/src/commandoutputbindingproperties.ts +++ b/src/CommandOutputBindingProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputenumschema.ts b/src/CommandOutputEnumSchema.ts similarity index 99% rename from src/commandoutputenumschema.ts rename to src/CommandOutputEnumSchema.ts index f4739cc..066f8e1 100644 --- a/src/commandoutputenumschema.ts +++ b/src/CommandOutputEnumSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputenumschemaproperties.ts b/src/CommandOutputEnumSchemaProperties.ts similarity index 94% rename from src/commandoutputenumschemaproperties.ts rename to src/CommandOutputEnumSchemaProperties.ts index afec87c..4bbc8a5 100644 --- a/src/commandoutputenumschemaproperties.ts +++ b/src/CommandOutputEnumSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputparameter.ts b/src/CommandOutputParameter.ts similarity index 99% rename from src/commandoutputparameter.ts rename to src/CommandOutputParameter.ts index d6fcb28..bd8da3f 100644 --- a/src/commandoutputparameter.ts +++ b/src/CommandOutputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputparameterproperties.ts b/src/CommandOutputParameterProperties.ts similarity index 98% rename from src/commandoutputparameterproperties.ts rename to src/CommandOutputParameterProperties.ts index 2c16f81..65f596d 100644 --- a/src/commandoutputparameterproperties.ts +++ b/src/CommandOutputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputrecordfield.ts b/src/CommandOutputRecordField.ts similarity index 99% rename from src/commandoutputrecordfield.ts rename to src/CommandOutputRecordField.ts index 0d14368..a12a67a 100644 --- a/src/commandoutputrecordfield.ts +++ b/src/CommandOutputRecordField.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputrecordfieldproperties.ts b/src/CommandOutputRecordFieldProperties.ts similarity index 98% rename from src/commandoutputrecordfieldproperties.ts rename to src/CommandOutputRecordFieldProperties.ts index 17b5217..7ac77b7 100644 --- a/src/commandoutputrecordfieldproperties.ts +++ b/src/CommandOutputRecordFieldProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputrecordschema.ts b/src/CommandOutputRecordSchema.ts similarity index 99% rename from src/commandoutputrecordschema.ts rename to src/CommandOutputRecordSchema.ts index 6660372..052d8aa 100644 --- a/src/commandoutputrecordschema.ts +++ b/src/CommandOutputRecordSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/commandoutputrecordschemaproperties.ts b/src/CommandOutputRecordSchemaProperties.ts similarity index 94% rename from src/commandoutputrecordschemaproperties.ts rename to src/CommandOutputRecordSchemaProperties.ts index 81b5a04..396e623 100644 --- a/src/commandoutputrecordschemaproperties.ts +++ b/src/CommandOutputRecordSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/directory.ts b/src/Directory.ts similarity index 99% rename from src/directory.ts rename to src/Directory.ts index d549c0c..0c8ce27 100644 --- a/src/directory.ts +++ b/src/Directory.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/directoryproperties.ts b/src/DirectoryProperties.ts similarity index 99% rename from src/directoryproperties.ts rename to src/DirectoryProperties.ts index b16221d..c1ff8a6 100644 --- a/src/directoryproperties.ts +++ b/src/DirectoryProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/directoryclass.ts b/src/Directory_class.ts similarity index 100% rename from src/directoryclass.ts rename to src/Directory_class.ts diff --git a/src/dirent.ts b/src/Dirent.ts similarity index 99% rename from src/dirent.ts rename to src/Dirent.ts index cf18c58..b8cd7df 100644 --- a/src/dirent.ts +++ b/src/Dirent.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/direntproperties.ts b/src/DirentProperties.ts similarity index 98% rename from src/direntproperties.ts rename to src/DirentProperties.ts index fb9101c..877fc47 100644 --- a/src/direntproperties.ts +++ b/src/DirentProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/dockerrequirement.ts b/src/DockerRequirement.ts similarity index 99% rename from src/dockerrequirement.ts rename to src/DockerRequirement.ts index f885f13..354a7ef 100644 --- a/src/dockerrequirement.ts +++ b/src/DockerRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/dockerrequirementproperties.ts b/src/DockerRequirementProperties.ts similarity index 98% rename from src/dockerrequirementproperties.ts rename to src/DockerRequirementProperties.ts index 4ea0048..90564cf 100644 --- a/src/dockerrequirementproperties.ts +++ b/src/DockerRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/dockerrequirementclass.ts b/src/DockerRequirement_class.ts similarity index 100% rename from src/dockerrequirementclass.ts rename to src/DockerRequirement_class.ts diff --git a/src/documentedproperties.ts b/src/DocumentedProperties.ts similarity index 87% rename from src/documentedproperties.ts rename to src/DocumentedProperties.ts index af83d47..f0d5511 100644 --- a/src/documentedproperties.ts +++ b/src/DocumentedProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/enumschema.ts b/src/EnumSchema.ts similarity index 98% rename from src/enumschema.ts rename to src/EnumSchema.ts index 5791bad..d8b39c8 100644 --- a/src/enumschema.ts +++ b/src/EnumSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/enumschemaproperties.ts b/src/EnumSchemaProperties.ts similarity index 90% rename from src/enumschemaproperties.ts rename to src/EnumSchemaProperties.ts index f4b22f5..b33296f 100644 --- a/src/enumschemaproperties.ts +++ b/src/EnumSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/envvarrequirement.ts b/src/EnvVarRequirement.ts similarity index 98% rename from src/envvarrequirement.ts rename to src/EnvVarRequirement.ts index 1f03cf0..2a33080 100644 --- a/src/envvarrequirement.ts +++ b/src/EnvVarRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/envvarrequirementproperties.ts b/src/EnvVarRequirementProperties.ts similarity index 93% rename from src/envvarrequirementproperties.ts rename to src/EnvVarRequirementProperties.ts index 742ab0f..0fa02e9 100644 --- a/src/envvarrequirementproperties.ts +++ b/src/EnvVarRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/envvarrequirementclass.ts b/src/EnvVarRequirement_class.ts similarity index 100% rename from src/envvarrequirementclass.ts rename to src/EnvVarRequirement_class.ts diff --git a/src/environmentdef.ts b/src/EnvironmentDef.ts similarity index 98% rename from src/environmentdef.ts rename to src/EnvironmentDef.ts index d7a7ba1..0ef1e41 100644 --- a/src/environmentdef.ts +++ b/src/EnvironmentDef.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/environmentdefproperties.ts b/src/EnvironmentDefProperties.ts similarity index 93% rename from src/environmentdefproperties.ts rename to src/EnvironmentDefProperties.ts index d7131a3..4cb94c6 100644 --- a/src/environmentdefproperties.ts +++ b/src/EnvironmentDefProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/expression.ts b/src/Expression.ts similarity index 100% rename from src/expression.ts rename to src/Expression.ts diff --git a/src/expressiontool.ts b/src/ExpressionTool.ts similarity index 99% rename from src/expressiontool.ts rename to src/ExpressionTool.ts index 9e1d463..80aa3e4 100644 --- a/src/expressiontool.ts +++ b/src/ExpressionTool.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/expressiontooloutputparameter.ts b/src/ExpressionToolOutputParameter.ts similarity index 99% rename from src/expressiontooloutputparameter.ts rename to src/ExpressionToolOutputParameter.ts index e47e3a7..4f5dbf9 100644 --- a/src/expressiontooloutputparameter.ts +++ b/src/ExpressionToolOutputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/expressiontooloutputparameterproperties.ts b/src/ExpressionToolOutputParameterProperties.ts similarity index 98% rename from src/expressiontooloutputparameterproperties.ts rename to src/ExpressionToolOutputParameterProperties.ts index 3fbcbe5..98dbc0d 100644 --- a/src/expressiontooloutputparameterproperties.ts +++ b/src/ExpressionToolOutputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/expressiontoolproperties.ts b/src/ExpressionToolProperties.ts similarity index 99% rename from src/expressiontoolproperties.ts rename to src/ExpressionToolProperties.ts index 9f77356..e8396ab 100644 --- a/src/expressiontoolproperties.ts +++ b/src/ExpressionToolProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/expressiontoolclass.ts b/src/ExpressionTool_class.ts similarity index 100% rename from src/expressiontoolclass.ts rename to src/ExpressionTool_class.ts diff --git a/src/fieldbaseproperties.ts b/src/FieldBaseProperties.ts similarity index 98% rename from src/fieldbaseproperties.ts rename to src/FieldBaseProperties.ts index 9ceeb4b..fa34116 100644 --- a/src/fieldbaseproperties.ts +++ b/src/FieldBaseProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/file.ts b/src/File.ts similarity index 99% rename from src/file.ts rename to src/File.ts index 71908d1..29a8e9d 100644 --- a/src/file.ts +++ b/src/File.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/fileproperties.ts b/src/FileProperties.ts similarity index 99% rename from src/fileproperties.ts rename to src/FileProperties.ts index 3eaa6dc..c950465 100644 --- a/src/fileproperties.ts +++ b/src/FileProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/fileclass.ts b/src/File_class.ts similarity index 100% rename from src/fileclass.ts rename to src/File_class.ts diff --git a/src/ioschemaproperties.ts b/src/IOSchemaProperties.ts similarity index 92% rename from src/ioschemaproperties.ts rename to src/IOSchemaProperties.ts index e6782e2..a9833c7 100644 --- a/src/ioschemaproperties.ts +++ b/src/IOSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/identifiedproperties.ts b/src/IdentifiedProperties.ts similarity index 83% rename from src/identifiedproperties.ts rename to src/IdentifiedProperties.ts index 256ee81..664abb9 100644 --- a/src/identifiedproperties.ts +++ b/src/IdentifiedProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/initialworkdirrequirement.ts b/src/InitialWorkDirRequirement.ts similarity index 98% rename from src/initialworkdirrequirement.ts rename to src/InitialWorkDirRequirement.ts index 21ce39f..e1f8534 100644 --- a/src/initialworkdirrequirement.ts +++ b/src/InitialWorkDirRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/initialworkdirrequirementproperties.ts b/src/InitialWorkDirRequirementProperties.ts similarity index 97% rename from src/initialworkdirrequirementproperties.ts rename to src/InitialWorkDirRequirementProperties.ts index 63fbef4..cd90937 100644 --- a/src/initialworkdirrequirementproperties.ts +++ b/src/InitialWorkDirRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/initialworkdirrequirementclass.ts b/src/InitialWorkDirRequirement_class.ts similarity index 100% rename from src/initialworkdirrequirementclass.ts rename to src/InitialWorkDirRequirement_class.ts diff --git a/src/inlinejavascriptrequirement.ts b/src/InlineJavascriptRequirement.ts similarity index 98% rename from src/inlinejavascriptrequirement.ts rename to src/InlineJavascriptRequirement.ts index 6d1af54..bda7f46 100644 --- a/src/inlinejavascriptrequirement.ts +++ b/src/InlineJavascriptRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inlinejavascriptrequirementproperties.ts b/src/InlineJavascriptRequirementProperties.ts similarity index 95% rename from src/inlinejavascriptrequirementproperties.ts rename to src/InlineJavascriptRequirementProperties.ts index 4d6a73f..d5b5c60 100644 --- a/src/inlinejavascriptrequirementproperties.ts +++ b/src/InlineJavascriptRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inlinejavascriptrequirementclass.ts b/src/InlineJavascriptRequirement_class.ts similarity index 100% rename from src/inlinejavascriptrequirementclass.ts rename to src/InlineJavascriptRequirement_class.ts diff --git a/src/inplaceupdaterequirement.ts b/src/InplaceUpdateRequirement.ts similarity index 98% rename from src/inplaceupdaterequirement.ts rename to src/InplaceUpdateRequirement.ts index d62780d..1c2a5a5 100644 --- a/src/inplaceupdaterequirement.ts +++ b/src/InplaceUpdateRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inplaceupdaterequirementproperties.ts b/src/InplaceUpdateRequirementProperties.ts similarity index 97% rename from src/inplaceupdaterequirementproperties.ts rename to src/InplaceUpdateRequirementProperties.ts index 7f80240..5582910 100644 --- a/src/inplaceupdaterequirementproperties.ts +++ b/src/InplaceUpdateRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inplaceupdaterequirementclass.ts b/src/InplaceUpdateRequirement_class.ts similarity index 100% rename from src/inplaceupdaterequirementclass.ts rename to src/InplaceUpdateRequirement_class.ts diff --git a/src/inputarrayschema.ts b/src/InputArraySchema.ts similarity index 99% rename from src/inputarrayschema.ts rename to src/InputArraySchema.ts index f593d2f..8591ff3 100644 --- a/src/inputarrayschema.ts +++ b/src/InputArraySchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputarrayschemaproperties.ts b/src/InputArraySchemaProperties.ts similarity index 95% rename from src/inputarrayschemaproperties.ts rename to src/InputArraySchemaProperties.ts index 4c26bf5..5d74e61 100644 --- a/src/inputarrayschemaproperties.ts +++ b/src/InputArraySchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputbinding.ts b/src/InputBinding.ts similarity index 98% rename from src/inputbinding.ts rename to src/InputBinding.ts index 3ec7c28..369cd19 100644 --- a/src/inputbinding.ts +++ b/src/InputBinding.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputbindingproperties.ts b/src/InputBindingProperties.ts similarity index 91% rename from src/inputbindingproperties.ts rename to src/InputBindingProperties.ts index f65ea18..db7c292 100644 --- a/src/inputbindingproperties.ts +++ b/src/InputBindingProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputenumschema.ts b/src/InputEnumSchema.ts similarity index 99% rename from src/inputenumschema.ts rename to src/InputEnumSchema.ts index a5370c5..08c0a80 100644 --- a/src/inputenumschema.ts +++ b/src/InputEnumSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputenumschemaproperties.ts b/src/InputEnumSchemaProperties.ts similarity index 94% rename from src/inputenumschemaproperties.ts rename to src/InputEnumSchemaProperties.ts index 6db7bd8..c37d67f 100644 --- a/src/inputenumschemaproperties.ts +++ b/src/InputEnumSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputformatproperties.ts b/src/InputFormatProperties.ts similarity index 92% rename from src/inputformatproperties.ts rename to src/InputFormatProperties.ts index 34e4c90..9c2edf0 100644 --- a/src/inputformatproperties.ts +++ b/src/InputFormatProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputparameterproperties.ts b/src/InputParameterProperties.ts similarity index 99% rename from src/inputparameterproperties.ts rename to src/InputParameterProperties.ts index d40aee5..a8f025f 100644 --- a/src/inputparameterproperties.ts +++ b/src/InputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputrecordfield.ts b/src/InputRecordField.ts similarity index 99% rename from src/inputrecordfield.ts rename to src/InputRecordField.ts index 8cf3844..89c26a7 100644 --- a/src/inputrecordfield.ts +++ b/src/InputRecordField.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputrecordfieldproperties.ts b/src/InputRecordFieldProperties.ts similarity index 99% rename from src/inputrecordfieldproperties.ts rename to src/InputRecordFieldProperties.ts index a08c846..27e5f4b 100644 --- a/src/inputrecordfieldproperties.ts +++ b/src/InputRecordFieldProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputrecordschema.ts b/src/InputRecordSchema.ts similarity index 99% rename from src/inputrecordschema.ts rename to src/InputRecordSchema.ts index 8c398c6..cddbabd 100644 --- a/src/inputrecordschema.ts +++ b/src/InputRecordSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputrecordschemaproperties.ts b/src/InputRecordSchemaProperties.ts similarity index 94% rename from src/inputrecordschemaproperties.ts rename to src/InputRecordSchemaProperties.ts index 726b4c1..bd4fb29 100644 --- a/src/inputrecordschemaproperties.ts +++ b/src/InputRecordSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/inputschemaproperties.ts b/src/InputSchemaProperties.ts similarity index 91% rename from src/inputschemaproperties.ts rename to src/InputSchemaProperties.ts index 141215b..4e1b231 100644 --- a/src/inputschemaproperties.ts +++ b/src/InputSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/labeledproperties.ts b/src/LabeledProperties.ts similarity index 83% rename from src/labeledproperties.ts rename to src/LabeledProperties.ts index dbc25aa..f43cc43 100644 --- a/src/labeledproperties.ts +++ b/src/LabeledProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/linkmergemethod.ts b/src/LinkMergeMethod.ts similarity index 100% rename from src/linkmergemethod.ts rename to src/LinkMergeMethod.ts diff --git a/src/loadcontentsproperties.ts b/src/LoadContentsProperties.ts similarity index 96% rename from src/loadcontentsproperties.ts rename to src/LoadContentsProperties.ts index 15671ce..d6389b9 100644 --- a/src/loadcontentsproperties.ts +++ b/src/LoadContentsProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/loadlistingenum.ts b/src/LoadListingEnum.ts similarity index 100% rename from src/loadlistingenum.ts rename to src/LoadListingEnum.ts diff --git a/src/loadlistingrequirement.ts b/src/LoadListingRequirement.ts similarity index 98% rename from src/loadlistingrequirement.ts rename to src/LoadListingRequirement.ts index 367d602..d550112 100644 --- a/src/loadlistingrequirement.ts +++ b/src/LoadListingRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/loadlistingrequirementproperties.ts b/src/LoadListingRequirementProperties.ts similarity index 92% rename from src/loadlistingrequirementproperties.ts rename to src/LoadListingRequirementProperties.ts index dc7e532..f30c54b 100644 --- a/src/loadlistingrequirementproperties.ts +++ b/src/LoadListingRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/loadlistingrequirementclass.ts b/src/LoadListingRequirement_class.ts similarity index 100% rename from src/loadlistingrequirementclass.ts rename to src/LoadListingRequirement_class.ts diff --git a/src/multipleinputfeaturerequirement.ts b/src/MultipleInputFeatureRequirement.ts similarity index 98% rename from src/multipleinputfeaturerequirement.ts rename to src/MultipleInputFeatureRequirement.ts index 18500cb..1b7d8ca 100644 --- a/src/multipleinputfeaturerequirement.ts +++ b/src/MultipleInputFeatureRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/multipleinputfeaturerequirementproperties.ts b/src/MultipleInputFeatureRequirementProperties.ts similarity index 92% rename from src/multipleinputfeaturerequirementproperties.ts rename to src/MultipleInputFeatureRequirementProperties.ts index 74be725..b228b36 100644 --- a/src/multipleinputfeaturerequirementproperties.ts +++ b/src/MultipleInputFeatureRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/multipleinputfeaturerequirementclass.ts b/src/MultipleInputFeatureRequirement_class.ts similarity index 100% rename from src/multipleinputfeaturerequirementclass.ts rename to src/MultipleInputFeatureRequirement_class.ts diff --git a/src/networkaccess.ts b/src/NetworkAccess.ts similarity index 98% rename from src/networkaccess.ts rename to src/NetworkAccess.ts index d8c5a1b..fbd04ce 100644 --- a/src/networkaccess.ts +++ b/src/NetworkAccess.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/networkaccessproperties.ts b/src/NetworkAccessProperties.ts similarity index 96% rename from src/networkaccessproperties.ts rename to src/NetworkAccessProperties.ts index 5955249..e1f3082 100644 --- a/src/networkaccessproperties.ts +++ b/src/NetworkAccessProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/networkaccessclass.ts b/src/NetworkAccess_class.ts similarity index 100% rename from src/networkaccessclass.ts rename to src/NetworkAccess_class.ts diff --git a/src/operation.ts b/src/Operation.ts similarity index 99% rename from src/operation.ts rename to src/Operation.ts index 6e9f4ec..3c6d03d 100644 --- a/src/operation.ts +++ b/src/Operation.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/operationinputparameter.ts b/src/OperationInputParameter.ts similarity index 99% rename from src/operationinputparameter.ts rename to src/OperationInputParameter.ts index 1b8a3f0..d259de6 100644 --- a/src/operationinputparameter.ts +++ b/src/OperationInputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/operationinputparameterproperties.ts b/src/OperationInputParameterProperties.ts similarity index 99% rename from src/operationinputparameterproperties.ts rename to src/OperationInputParameterProperties.ts index 7c0a21d..e5d21e7 100644 --- a/src/operationinputparameterproperties.ts +++ b/src/OperationInputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/operationoutputparameter.ts b/src/OperationOutputParameter.ts similarity index 99% rename from src/operationoutputparameter.ts rename to src/OperationOutputParameter.ts index 9b9e21e..6c31e1e 100644 --- a/src/operationoutputparameter.ts +++ b/src/OperationOutputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/operationoutputparameterproperties.ts b/src/OperationOutputParameterProperties.ts similarity index 98% rename from src/operationoutputparameterproperties.ts rename to src/OperationOutputParameterProperties.ts index c614193..fc9a9f5 100644 --- a/src/operationoutputparameterproperties.ts +++ b/src/OperationOutputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/operationproperties.ts b/src/OperationProperties.ts similarity index 99% rename from src/operationproperties.ts rename to src/OperationProperties.ts index e254c77..fbf9ff4 100644 --- a/src/operationproperties.ts +++ b/src/OperationProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/operationclass.ts b/src/Operation_class.ts similarity index 100% rename from src/operationclass.ts rename to src/Operation_class.ts diff --git a/src/outputarrayschema.ts b/src/OutputArraySchema.ts similarity index 99% rename from src/outputarrayschema.ts rename to src/OutputArraySchema.ts index 482cd1e..e4f3077 100644 --- a/src/outputarrayschema.ts +++ b/src/OutputArraySchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputarrayschemaproperties.ts b/src/OutputArraySchemaProperties.ts similarity index 95% rename from src/outputarrayschemaproperties.ts rename to src/OutputArraySchemaProperties.ts index 450c00d..4debf9f 100644 --- a/src/outputarrayschemaproperties.ts +++ b/src/OutputArraySchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputenumschema.ts b/src/OutputEnumSchema.ts similarity index 99% rename from src/outputenumschema.ts rename to src/OutputEnumSchema.ts index 8ff7137..9dfe780 100644 --- a/src/outputenumschema.ts +++ b/src/OutputEnumSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputenumschemaproperties.ts b/src/OutputEnumSchemaProperties.ts similarity index 94% rename from src/outputenumschemaproperties.ts rename to src/OutputEnumSchemaProperties.ts index 19309e4..e064f82 100644 --- a/src/outputenumschemaproperties.ts +++ b/src/OutputEnumSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputformatproperties.ts b/src/OutputFormatProperties.ts similarity index 88% rename from src/outputformatproperties.ts rename to src/OutputFormatProperties.ts index dae893a..2c73956 100644 --- a/src/outputformatproperties.ts +++ b/src/OutputFormatProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputparameterproperties.ts b/src/OutputParameterProperties.ts similarity index 98% rename from src/outputparameterproperties.ts rename to src/OutputParameterProperties.ts index bab3b5f..bde4bd7 100644 --- a/src/outputparameterproperties.ts +++ b/src/OutputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputrecordfield.ts b/src/OutputRecordField.ts similarity index 99% rename from src/outputrecordfield.ts rename to src/OutputRecordField.ts index bcd39d4..c43c0be 100644 --- a/src/outputrecordfield.ts +++ b/src/OutputRecordField.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputrecordfieldproperties.ts b/src/OutputRecordFieldProperties.ts similarity index 98% rename from src/outputrecordfieldproperties.ts rename to src/OutputRecordFieldProperties.ts index 547f148..f5d2f16 100644 --- a/src/outputrecordfieldproperties.ts +++ b/src/OutputRecordFieldProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputrecordschema.ts b/src/OutputRecordSchema.ts similarity index 99% rename from src/outputrecordschema.ts rename to src/OutputRecordSchema.ts index d3e5663..9cf203c 100644 --- a/src/outputrecordschema.ts +++ b/src/OutputRecordSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputrecordschemaproperties.ts b/src/OutputRecordSchemaProperties.ts similarity index 94% rename from src/outputrecordschemaproperties.ts rename to src/OutputRecordSchemaProperties.ts index 24732b9..f3907cf 100644 --- a/src/outputrecordschemaproperties.ts +++ b/src/OutputRecordSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/outputschemaproperties.ts b/src/OutputSchemaProperties.ts similarity index 91% rename from src/outputschemaproperties.ts rename to src/OutputSchemaProperties.ts index 23106a8..85a39d6 100644 --- a/src/outputschemaproperties.ts +++ b/src/OutputSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/parameterproperties.ts b/src/ParameterProperties.ts similarity index 98% rename from src/parameterproperties.ts rename to src/ParameterProperties.ts index af3abe2..1945b20 100644 --- a/src/parameterproperties.ts +++ b/src/ParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/pickvaluemethod.ts b/src/PickValueMethod.ts similarity index 100% rename from src/pickvaluemethod.ts rename to src/PickValueMethod.ts diff --git a/src/primitivetype.ts b/src/PrimitiveType.ts similarity index 100% rename from src/primitivetype.ts rename to src/PrimitiveType.ts diff --git a/src/processproperties.ts b/src/ProcessProperties.ts similarity index 98% rename from src/processproperties.ts rename to src/ProcessProperties.ts index dc7f4c0..a2b7c70 100644 --- a/src/processproperties.ts +++ b/src/ProcessProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/processrequirementproperties.ts b/src/ProcessRequirementProperties.ts similarity index 91% rename from src/processrequirementproperties.ts rename to src/ProcessRequirementProperties.ts index fa89db6..683ff21 100644 --- a/src/processrequirementproperties.ts +++ b/src/ProcessRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/recordfield.ts b/src/RecordField.ts similarity index 98% rename from src/recordfield.ts rename to src/RecordField.ts index a76dbae..df6bcf9 100644 --- a/src/recordfield.ts +++ b/src/RecordField.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/recordfieldproperties.ts b/src/RecordFieldProperties.ts similarity index 94% rename from src/recordfieldproperties.ts rename to src/RecordFieldProperties.ts index 3dda229..38d5f6b 100644 --- a/src/recordfieldproperties.ts +++ b/src/RecordFieldProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/recordschema.ts b/src/RecordSchema.ts similarity index 98% rename from src/recordschema.ts rename to src/RecordSchema.ts index a06a3e4..1966d42 100644 --- a/src/recordschema.ts +++ b/src/RecordSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/recordschemaproperties.ts b/src/RecordSchemaProperties.ts similarity index 90% rename from src/recordschemaproperties.ts rename to src/RecordSchemaProperties.ts index fcc25e6..c0bfe8f 100644 --- a/src/recordschemaproperties.ts +++ b/src/RecordSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/resourcerequirement.ts b/src/ResourceRequirement.ts similarity index 99% rename from src/resourcerequirement.ts rename to src/ResourceRequirement.ts index e46583c..40b0e51 100644 --- a/src/resourcerequirement.ts +++ b/src/ResourceRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/resourcerequirementproperties.ts b/src/ResourceRequirementProperties.ts similarity index 99% rename from src/resourcerequirementproperties.ts rename to src/ResourceRequirementProperties.ts index 6df3178..c80d3a5 100644 --- a/src/resourcerequirementproperties.ts +++ b/src/ResourceRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/resourcerequirementclass.ts b/src/ResourceRequirement_class.ts similarity index 100% rename from src/resourcerequirementclass.ts rename to src/ResourceRequirement_class.ts diff --git a/src/scatterfeaturerequirement.ts b/src/ScatterFeatureRequirement.ts similarity index 98% rename from src/scatterfeaturerequirement.ts rename to src/ScatterFeatureRequirement.ts index 5bb545f..a29bec3 100644 --- a/src/scatterfeaturerequirement.ts +++ b/src/ScatterFeatureRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/scatterfeaturerequirementproperties.ts b/src/ScatterFeatureRequirementProperties.ts similarity index 92% rename from src/scatterfeaturerequirementproperties.ts rename to src/ScatterFeatureRequirementProperties.ts index 3405c87..75214ef 100644 --- a/src/scatterfeaturerequirementproperties.ts +++ b/src/ScatterFeatureRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/scatterfeaturerequirementclass.ts b/src/ScatterFeatureRequirement_class.ts similarity index 100% rename from src/scatterfeaturerequirementclass.ts rename to src/ScatterFeatureRequirement_class.ts diff --git a/src/scattermethod.ts b/src/ScatterMethod.ts similarity index 100% rename from src/scattermethod.ts rename to src/ScatterMethod.ts diff --git a/src/schemadefrequirement.ts b/src/SchemaDefRequirement.ts similarity index 98% rename from src/schemadefrequirement.ts rename to src/SchemaDefRequirement.ts index ca9cbc4..7857d8f 100644 --- a/src/schemadefrequirement.ts +++ b/src/SchemaDefRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/schemadefrequirementproperties.ts b/src/SchemaDefRequirementProperties.ts similarity index 96% rename from src/schemadefrequirementproperties.ts rename to src/SchemaDefRequirementProperties.ts index 7d1daef..b4a4da1 100644 --- a/src/schemadefrequirementproperties.ts +++ b/src/SchemaDefRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/schemadefrequirementclass.ts b/src/SchemaDefRequirement_class.ts similarity index 100% rename from src/schemadefrequirementclass.ts rename to src/SchemaDefRequirement_class.ts diff --git a/src/secondaryfileschema.ts b/src/SecondaryFileSchema.ts similarity index 99% rename from src/secondaryfileschema.ts rename to src/SecondaryFileSchema.ts index 0c4e848..2b23b01 100644 --- a/src/secondaryfileschema.ts +++ b/src/SecondaryFileSchema.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/secondaryfileschemaproperties.ts b/src/SecondaryFileSchemaProperties.ts similarity index 98% rename from src/secondaryfileschemaproperties.ts rename to src/SecondaryFileSchemaProperties.ts index 2bba250..52db003 100644 --- a/src/secondaryfileschemaproperties.ts +++ b/src/SecondaryFileSchemaProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/shellcommandrequirement.ts b/src/ShellCommandRequirement.ts similarity index 98% rename from src/shellcommandrequirement.ts rename to src/ShellCommandRequirement.ts index 0203267..e594e01 100644 --- a/src/shellcommandrequirement.ts +++ b/src/ShellCommandRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/shellcommandrequirementproperties.ts b/src/ShellCommandRequirementProperties.ts similarity index 95% rename from src/shellcommandrequirementproperties.ts rename to src/ShellCommandRequirementProperties.ts index acef54d..1d96e65 100644 --- a/src/shellcommandrequirementproperties.ts +++ b/src/ShellCommandRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/shellcommandrequirementclass.ts b/src/ShellCommandRequirement_class.ts similarity index 100% rename from src/shellcommandrequirementclass.ts rename to src/ShellCommandRequirement_class.ts diff --git a/src/sinkproperties.ts b/src/SinkProperties.ts similarity index 93% rename from src/sinkproperties.ts rename to src/SinkProperties.ts index 4ce8fb2..b3f40d7 100644 --- a/src/sinkproperties.ts +++ b/src/SinkProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/softwarepackage.ts b/src/SoftwarePackage.ts similarity index 99% rename from src/softwarepackage.ts rename to src/SoftwarePackage.ts index d93204e..e826d73 100644 --- a/src/softwarepackage.ts +++ b/src/SoftwarePackage.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/softwarepackageproperties.ts b/src/SoftwarePackageProperties.ts similarity index 98% rename from src/softwarepackageproperties.ts rename to src/SoftwarePackageProperties.ts index a78216b..bd28731 100644 --- a/src/softwarepackageproperties.ts +++ b/src/SoftwarePackageProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/softwarerequirement.ts b/src/SoftwareRequirement.ts similarity index 98% rename from src/softwarerequirement.ts rename to src/SoftwareRequirement.ts index 5717765..9e3b898 100644 --- a/src/softwarerequirement.ts +++ b/src/SoftwareRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/softwarerequirementproperties.ts b/src/SoftwareRequirementProperties.ts similarity index 92% rename from src/softwarerequirementproperties.ts rename to src/SoftwareRequirementProperties.ts index a068779..367031b 100644 --- a/src/softwarerequirementproperties.ts +++ b/src/SoftwareRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/softwarerequirementclass.ts b/src/SoftwareRequirement_class.ts similarity index 100% rename from src/softwarerequirementclass.ts rename to src/SoftwareRequirement_class.ts diff --git a/src/stepinputexpressionrequirement.ts b/src/StepInputExpressionRequirement.ts similarity index 98% rename from src/stepinputexpressionrequirement.ts rename to src/StepInputExpressionRequirement.ts index 8830e3f..3e3b2e5 100644 --- a/src/stepinputexpressionrequirement.ts +++ b/src/StepInputExpressionRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/stepinputexpressionrequirementproperties.ts b/src/StepInputExpressionRequirementProperties.ts similarity index 92% rename from src/stepinputexpressionrequirementproperties.ts rename to src/StepInputExpressionRequirementProperties.ts index da265b6..4622614 100644 --- a/src/stepinputexpressionrequirementproperties.ts +++ b/src/StepInputExpressionRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/stepinputexpressionrequirementclass.ts b/src/StepInputExpressionRequirement_class.ts similarity index 100% rename from src/stepinputexpressionrequirementclass.ts rename to src/StepInputExpressionRequirement_class.ts diff --git a/src/subworkflowfeaturerequirement.ts b/src/SubworkflowFeatureRequirement.ts similarity index 98% rename from src/subworkflowfeaturerequirement.ts rename to src/SubworkflowFeatureRequirement.ts index c56aec8..35263d0 100644 --- a/src/subworkflowfeaturerequirement.ts +++ b/src/SubworkflowFeatureRequirement.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/subworkflowfeaturerequirementproperties.ts b/src/SubworkflowFeatureRequirementProperties.ts similarity index 92% rename from src/subworkflowfeaturerequirementproperties.ts rename to src/SubworkflowFeatureRequirementProperties.ts index aea7bf6..cb68241 100644 --- a/src/subworkflowfeaturerequirementproperties.ts +++ b/src/SubworkflowFeatureRequirementProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/subworkflowfeaturerequirementclass.ts b/src/SubworkflowFeatureRequirement_class.ts similarity index 100% rename from src/subworkflowfeaturerequirementclass.ts rename to src/SubworkflowFeatureRequirement_class.ts diff --git a/src/tooltimelimit.ts b/src/ToolTimeLimit.ts similarity index 98% rename from src/tooltimelimit.ts rename to src/ToolTimeLimit.ts index d3fc1a9..bc8aa38 100644 --- a/src/tooltimelimit.ts +++ b/src/ToolTimeLimit.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/tooltimelimitproperties.ts b/src/ToolTimeLimitProperties.ts similarity index 95% rename from src/tooltimelimitproperties.ts rename to src/ToolTimeLimitProperties.ts index b8244a7..6ec0889 100644 --- a/src/tooltimelimitproperties.ts +++ b/src/ToolTimeLimitProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/tooltimelimitclass.ts b/src/ToolTimeLimit_class.ts similarity index 100% rename from src/tooltimelimitclass.ts rename to src/ToolTimeLimit_class.ts diff --git a/src/workreuse.ts b/src/WorkReuse.ts similarity index 98% rename from src/workreuse.ts rename to src/WorkReuse.ts index e4b699b..5e0c708 100644 --- a/src/workreuse.ts +++ b/src/WorkReuse.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workreuseproperties.ts b/src/WorkReuseProperties.ts similarity index 95% rename from src/workreuseproperties.ts rename to src/WorkReuseProperties.ts index 8bffa4e..e32b03a 100644 --- a/src/workreuseproperties.ts +++ b/src/WorkReuseProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workreuseclass.ts b/src/WorkReuse_class.ts similarity index 100% rename from src/workreuseclass.ts rename to src/WorkReuse_class.ts diff --git a/src/workflow.ts b/src/Workflow.ts similarity index 99% rename from src/workflow.ts rename to src/Workflow.ts index cda4346..85e443a 100644 --- a/src/workflow.ts +++ b/src/Workflow.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowinputparameter.ts b/src/WorkflowInputParameter.ts similarity index 99% rename from src/workflowinputparameter.ts rename to src/WorkflowInputParameter.ts index c3581a1..1b9f6c9 100644 --- a/src/workflowinputparameter.ts +++ b/src/WorkflowInputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowinputparameterproperties.ts b/src/WorkflowInputParameterProperties.ts similarity index 99% rename from src/workflowinputparameterproperties.ts rename to src/WorkflowInputParameterProperties.ts index 6e47a7d..76b769b 100644 --- a/src/workflowinputparameterproperties.ts +++ b/src/WorkflowInputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowoutputparameter.ts b/src/WorkflowOutputParameter.ts similarity index 99% rename from src/workflowoutputparameter.ts rename to src/WorkflowOutputParameter.ts index 443c8cb..1a27d5c 100644 --- a/src/workflowoutputparameter.ts +++ b/src/WorkflowOutputParameter.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowoutputparameterproperties.ts b/src/WorkflowOutputParameterProperties.ts similarity index 99% rename from src/workflowoutputparameterproperties.ts rename to src/WorkflowOutputParameterProperties.ts index 7673357..92b79b9 100644 --- a/src/workflowoutputparameterproperties.ts +++ b/src/WorkflowOutputParameterProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowproperties.ts b/src/WorkflowProperties.ts similarity index 99% rename from src/workflowproperties.ts rename to src/WorkflowProperties.ts index 6d448b2..957f227 100644 --- a/src/workflowproperties.ts +++ b/src/WorkflowProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowstep.ts b/src/WorkflowStep.ts similarity index 99% rename from src/workflowstep.ts rename to src/WorkflowStep.ts index 10768b9..dcaaad5 100644 --- a/src/workflowstep.ts +++ b/src/WorkflowStep.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowstepinput.ts b/src/WorkflowStepInput.ts similarity index 99% rename from src/workflowstepinput.ts rename to src/WorkflowStepInput.ts index 27ae2ee..068f89d 100644 --- a/src/workflowstepinput.ts +++ b/src/WorkflowStepInput.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowstepinputproperties.ts b/src/WorkflowStepInputProperties.ts similarity index 99% rename from src/workflowstepinputproperties.ts rename to src/WorkflowStepInputProperties.ts index 04906cf..44ef342 100644 --- a/src/workflowstepinputproperties.ts +++ b/src/WorkflowStepInputProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowstepoutput.ts b/src/WorkflowStepOutput.ts similarity index 98% rename from src/workflowstepoutput.ts rename to src/WorkflowStepOutput.ts index 074f894..6244e02 100644 --- a/src/workflowstepoutput.ts +++ b/src/WorkflowStepOutput.ts @@ -10,9 +10,9 @@ import { prefixUrl, save, saveRelativeUri -} from './util/internal' +} from './util/Internal' import { v4 as uuidv4 } from 'uuid' -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowstepoutputproperties.ts b/src/WorkflowStepOutputProperties.ts similarity index 94% rename from src/workflowstepoutputproperties.ts rename to src/WorkflowStepOutputProperties.ts index 4b2d9e0..b7065e2 100644 --- a/src/workflowstepoutputproperties.ts +++ b/src/WorkflowStepOutputProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowstepproperties.ts b/src/WorkflowStepProperties.ts similarity index 99% rename from src/workflowstepproperties.ts rename to src/WorkflowStepProperties.ts index 0b8ea95..f7b931a 100644 --- a/src/workflowstepproperties.ts +++ b/src/WorkflowStepProperties.ts @@ -1,5 +1,5 @@ -import * as Internal from './util/internal' +import * as Internal from './util/Internal' /** diff --git a/src/workflowclass.ts b/src/Workflow_class.ts similarity index 100% rename from src/workflowclass.ts rename to src/Workflow_class.ts diff --git a/src/enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts b/src/enum_d062602be0b4b8fd33e69e29a841317b6ab665bc.ts similarity index 100% rename from src/enumd062602be0b4b8fd33e69e29a841317b6ab665bc.ts rename to src/enum_d062602be0b4b8fd33e69e29a841317b6ab665bc.ts diff --git a/src/enumd961d79c225752b9fadb617367615ab176b47d77.ts b/src/enum_d961d79c225752b9fadb617367615ab176b47d77.ts similarity index 100% rename from src/enumd961d79c225752b9fadb617367615ab176b47d77.ts rename to src/enum_d961d79c225752b9fadb617367615ab176b47d77.ts diff --git a/src/enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts b/src/enum_d9cba076fca539106791a4f46d198c7fcfbdb779.ts similarity index 100% rename from src/enumd9cba076fca539106791a4f46d198c7fcfbdb779.ts rename to src/enum_d9cba076fca539106791a4f46d198c7fcfbdb779.ts diff --git a/src/index.ts b/src/index.ts index 4492226..28e5f8d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,181 +1,181 @@ export { loadDocument, loadDocumentByString, - SoftwarePackageProperties, - RecordSchemaProperties, - InplaceUpdateRequirement_class, - MultipleInputFeatureRequirementProperties, - SchemaDefRequirement_class, + ResourceRequirement, + InputArraySchema, + DockerRequirement_class, + Workflow, + ExpressionToolOutputParameterProperties, + RecordFieldProperties, + Any, + CommandLineBinding, + CommandLineBindingProperties, + DockerRequirementProperties, + DocumentedProperties, + OutputArraySchema, NetworkAccess_class, - Directory, - CommandInputArraySchemaProperties, + WorkReuse, + WorkReuse_class, + WorkflowStepOutput, + DirectoryProperties, + ScatterFeatureRequirementProperties, + CommandOutputRecordSchemaProperties, + DockerRequirement, + InlineJavascriptRequirement, + InitialWorkDirRequirementProperties, + LabeledProperties, + InputSchemaProperties, + SoftwareRequirementProperties, + InputArraySchemaProperties, + CommandOutputRecordFieldProperties, + File_class, + ProcessRequirementProperties, + Operation, + ScatterFeatureRequirement, + stdin, + EnumSchema, + CommandInputSchemaProperties, + OperationProperties, + SubworkflowFeatureRequirement, + MultipleInputFeatureRequirement, + ShellCommandRequirement_class, + IOSchemaProperties, + CommandInputRecordField, + ParameterProperties, + File, + CommandOutputParameter, + enum_d961d79c225752b9fadb617367615ab176b47d77, + OutputArraySchemaProperties, + StepInputExpressionRequirement_class, + CommandInputParameter, + EnvironmentDefProperties, + enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, + InputBinding, + ExpressionToolOutputParameter, + ScatterFeatureRequirement_class, + SoftwarePackage, + OperationInputParameter, + OutputRecordField, + SchemaDefRequirementProperties, + Dirent, + NetworkAccessProperties, + CommandOutputArraySchemaProperties, + WorkflowOutputParameter, + WorkflowStepInput, + FieldBaseProperties, + CommandInputRecordFieldProperties, + ScatterMethod, + ToolTimeLimit, WorkflowStepInputProperties, + InputRecordSchemaProperties, + InputParameterProperties, + CommandLineBindable, + SchemaDefRequirement, + InputEnumSchema, + OutputRecordSchema, + CommandOutputBinding, + CommandInputRecordSchema, + RecordSchema, + OutputSchemaProperties, CommandInputEnumSchema, - EnvVarRequirementProperties, - SecondaryFileSchemaProperties, - CWLVersion, - InplaceUpdateRequirementProperties, - OperationProperties, - RecordFieldProperties, - MultipleInputFeatureRequirement_class, - SubworkflowFeatureRequirement_class, - InputBindingProperties, + LoadContentsProperties, + DirentProperties, + OutputRecordSchemaProperties, + LoadListingEnum, + CommandOutputRecordField, EnvVarRequirement, - OutputEnumSchema, - StepInputExpressionRequirement, - WorkflowInputParameterProperties, - CommandLineTool_class, - ResourceRequirement, - Operation, - CommandInputRecordField, - CommandInputArraySchema, - OperationOutputParameterProperties, - EnvVarRequirement_class, - ArraySchemaProperties, + InplaceUpdateRequirementProperties, + FileProperties, InlineJavascriptRequirementProperties, - InplaceUpdateRequirement, - LoadListingRequirement_class, - InlineJavascriptRequirement_class, - ScatterFeatureRequirementProperties, - CommandOutputBinding, + CommandInputParameterProperties, + InputRecordField, + CWLVersion, + CommandOutputRecordSchema, + ResourceRequirementProperties, + OutputParameterProperties, + Directory, CWLType, - CommandOutputRecordField, - InputBinding, - Dirent, - ShellCommandRequirement, + WorkflowStep, + stdout, + CommandOutputParameterProperties, + ArraySchema, + InputFormatProperties, + OutputEnumSchemaProperties, + EnumSchemaProperties, + RecordSchemaProperties, + ExpressionTool_class, + WorkflowInputParameterProperties, StepInputExpressionRequirementProperties, - SchemaDefRequirement, - ExpressionToolOutputParameterProperties, ExpressionTool, - stderr, - ArraySchema, - LabeledProperties, + IdentifiedProperties, + InputRecordFieldProperties, + InitialWorkDirRequirement, CommandOutputBindingProperties, - SoftwarePackage, - EnumSchemaProperties, - StepInputExpressionRequirement_class, - ScatterMethod, - WorkflowStepOutputProperties, - stdout, - File, - ScatterFeatureRequirement, - EnumSchema, - ShellCommandRequirement_class, - SecondaryFileSchema, - InputParameterProperties, - SoftwareRequirement_class, WorkflowProperties, - InputFormatProperties, - CommandLineBindable, - CommandInputEnumSchemaProperties, - enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, - FieldBaseProperties, - InputRecordFieldProperties, - CommandInputSchemaProperties, - CommandOutputParameter, - WorkflowStepOutput, - OperationOutputParameter, - OperationInputParameterProperties, - WorkflowOutputParameterProperties, CommandOutputEnumSchema, - CommandOutputEnumSchemaProperties, - ExpressionToolProperties, - CommandOutputRecordSchemaProperties, - SubworkflowFeatureRequirementProperties, + SubworkflowFeatureRequirement_class, + NetworkAccess, + enum_d9cba076fca539106791a4f46d198c7fcfbdb779, + CommandLineTool_class, + SoftwareRequirement_class, + SoftwarePackageProperties, + OutputEnumSchema, + CommandInputRecordSchemaProperties, + WorkflowOutputParameterProperties, LoadListingRequirementProperties, - OutputRecordSchemaProperties, - IdentifiedProperties, - LoadContentsProperties, - EnvironmentDefProperties, + CommandInputEnumSchemaProperties, + LinkMergeMethod, + OperationOutputParameterProperties, + CommandInputArraySchemaProperties, + SoftwareRequirement, + Directory_class, + ArraySchemaProperties, + ToolTimeLimitProperties, + InputEnumSchemaProperties, + WorkflowInputParameter, + RecordField, + MultipleInputFeatureRequirement_class, + SinkProperties, + WorkflowStepOutputProperties, + SecondaryFileSchema, + ToolTimeLimit_class, + ShellCommandRequirement, + CommandInputArraySchema, ResourceRequirement_class, - enum_d961d79c225752b9fadb617367615ab176b47d77, - ProcessRequirementProperties, - SchemaDefRequirementProperties, - WorkReuseProperties, - enum_d9cba076fca539106791a4f46d198c7fcfbdb779, - InputRecordSchemaProperties, - WorkflowStep, - Operation_class, - NetworkAccess, - FileProperties, - DirentProperties, + MultipleInputFeatureRequirementProperties, + InplaceUpdateRequirement_class, + stderr, + CommandLineTool, InitialWorkDirRequirement_class, - ResourceRequirementProperties, - CommandOutputRecordSchema, - CommandOutputRecordFieldProperties, + ExpressionToolProperties, + SchemaDefRequirement_class, + CommandOutputEnumSchemaProperties, OutputRecordFieldProperties, + InplaceUpdateRequirement, PrimitiveType, - InputRecordSchema, - DockerRequirement, - CommandLineBindableProperties, - ParameterProperties, - SoftwareRequirement, - InputSchemaProperties, + OperationOutputParameter, + InlineJavascriptRequirement_class, + InputBindingProperties, + EnvVarRequirement_class, + CommandLineToolProperties, + OperationInputParameterProperties, + StepInputExpressionRequirement, PickValueMethod, - CommandInputRecordSchema, - SoftwareRequirementProperties, - WorkflowInputParameter, - CommandOutputParameterProperties, - stdin, - SinkProperties, - CommandOutputArraySchema, - WorkReuse_class, - RecordSchema, - File_class, - WorkflowStepInput, - OutputEnumSchemaProperties, - CommandInputRecordSchemaProperties, + EnvVarRequirementProperties, + WorkReuseProperties, + LoadListingRequirement_class, EnvironmentDef, - OperationInputParameter, - MultipleInputFeatureRequirement, - CommandLineBinding, - DocumentedProperties, - CommandLineToolProperties, - OutputParameterProperties, - ToolTimeLimit_class, - Any, - DockerRequirementProperties, - LinkMergeMethod, - InputArraySchema, - OutputRecordSchema, - IOSchemaProperties, - DockerRequirement_class, - CommandOutputArraySchemaProperties, - ToolTimeLimitProperties, - Workflow, + CommandOutputArraySchema, ShellCommandRequirementProperties, - OutputArraySchemaProperties, - NetworkAccessProperties, + SubworkflowFeatureRequirementProperties, + CommandLineBindableProperties, Expression, - ExpressionToolOutputParameter, - ExpressionTool_class, - RecordField, - DirectoryProperties, - CommandInputParameterProperties, - ScatterFeatureRequirement_class, - ToolTimeLimit, - ProcessProperties, - InputArraySchemaProperties, + Operation_class, + WorkflowStepProperties, + OutputFormatProperties, + InputRecordSchema, + SecondaryFileSchemaProperties, Workflow_class, - InputRecordField, - InitialWorkDirRequirement, - SubworkflowFeatureRequirement, LoadListingRequirement, - Directory_class, - CommandLineBindingProperties, - LoadListingEnum, - InlineJavascriptRequirement, - InputEnumSchemaProperties, - CommandLineTool, - WorkReuse, - OutputArraySchema, - InitialWorkDirRequirementProperties, - CommandInputParameter, - WorkflowOutputParameter, - InputEnumSchema, - CommandInputRecordFieldProperties, - OutputSchemaProperties, - OutputFormatProperties, - WorkflowStepProperties, - OutputRecordField -} from './util/internal' \ No newline at end of file + ProcessProperties +} from './util/Internal' \ No newline at end of file diff --git a/src/test/anyLoader.spec.ts b/src/test/AnyLoader.spec.ts similarity index 92% rename from src/test/anyLoader.spec.ts rename to src/test/AnyLoader.spec.ts index daab58c..e2ab2f6 100644 --- a/src/test/anyLoader.spec.ts +++ b/src/test/AnyLoader.spec.ts @@ -1,7 +1,7 @@ import chai from 'chai' import chaiAsPromised from 'chai-as-promised' -import { _AnyLoader, LoadingOptions } from '../util/internal' +import { _AnyLoader, LoadingOptions } from '../util/Internal' chai.use(chaiAsPromised) const assert = chai.assert diff --git a/src/test/exampleTest.ts b/src/test/ExampleTest.ts similarity index 100% rename from src/test/exampleTest.ts rename to src/test/ExampleTest.ts diff --git a/src/test/fetcher.spec.ts b/src/test/Fetcher.spec.ts similarity index 97% rename from src/test/fetcher.spec.ts rename to src/test/Fetcher.spec.ts index 291eb83..3ec526c 100644 --- a/src/test/fetcher.spec.ts +++ b/src/test/Fetcher.spec.ts @@ -1,5 +1,5 @@ import { assert } from 'chai' -import { DefaultFetcher, ValidationException } from '../util/internal' +import { DefaultFetcher, ValidationException } from '../util/Internal' import sinon from 'sinon' import * as fetchModule from 'node-fetch' import { Response } from 'node-fetch' diff --git a/src/test/idMap.spec.ts b/src/test/IdMap.spec.ts similarity index 97% rename from src/test/idMap.spec.ts rename to src/test/IdMap.spec.ts index 42c0645..4f8298a 100644 --- a/src/test/idMap.spec.ts +++ b/src/test/IdMap.spec.ts @@ -1,5 +1,5 @@ import { assert } from 'chai' -import { _IdMapLoader, Loader, LoadingOptions, ValidationException } from '../util/internal' +import { _IdMapLoader, Loader, LoadingOptions, ValidationException } from '../util/Internal' class TestLoader implements Loader { async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string | undefined): Promise { diff --git a/src/test/typeguards.spec.ts b/src/test/Typeguards.spec.ts similarity index 98% rename from src/test/typeguards.spec.ts rename to src/test/Typeguards.spec.ts index 45554bf..dd9aab3 100644 --- a/src/test/typeguards.spec.ts +++ b/src/test/Typeguards.spec.ts @@ -1,5 +1,5 @@ import { assert } from 'chai' -import { TypeGuards } from '../util/internal' +import { TypeGuards } from '../util/Internal' describe('Test Typeguards', () => { describe('Int', () => { diff --git a/src/util/dict.ts b/src/util/Dict.ts similarity index 100% rename from src/util/dict.ts rename to src/util/Dict.ts diff --git a/src/util/fetcher.ts b/src/util/Fetcher.ts similarity index 97% rename from src/util/fetcher.ts rename to src/util/Fetcher.ts index b41ea5b..784ea28 100644 --- a/src/util/fetcher.ts +++ b/src/util/Fetcher.ts @@ -1,4 +1,4 @@ -import { ValidationException } from './internal' +import { ValidationException } from './Internal' import fetch from 'node-fetch' import * as fs from 'fs' import * as URI from 'uri-js' diff --git a/src/util/Internal.ts b/src/util/Internal.ts new file mode 100644 index 0000000..e51e756 --- /dev/null +++ b/src/util/Internal.ts @@ -0,0 +1,199 @@ +// Internal modules pattern to deal with circular dependencies +export * from './Dict' +export * as TypeGuards from './Typeguards' +export * from './loaders/ArrayLoader' +export * from './Saveable' +export * from './loaders/EnumLoader' +export * from './loaders/ExpressionLoader' +export * from './Fetcher' +export * from './loaders/IdMapLoader' +export * from './loaders/Loader' +export * from './LoadingOptions' +export * from './loaders/AnyLoader' +export * from './loaders/PrimitiveLoader' +export * from './loaders/RecordLoader' +export * from './loaders/RootLoader' +export * from './loaders/TypeDSLLoader' +export * from './loaders/SecondaryDSLLoader' +export * from './loaders/UnionLoader' +export * from './loaders/UriLoader' +export * from './ValidationException' +export * from './Vocabs' +export * from '../ResourceRequirement' +export * from '../InputArraySchema' +export * from '../DockerRequirement_class' +export * from '../Workflow' +export * from '../ExpressionToolOutputParameterProperties' +export * from '../RecordFieldProperties' +export * from '../Any' +export * from '../CommandLineBinding' +export * from '../CommandLineBindingProperties' +export * from '../DockerRequirementProperties' +export * from '../DocumentedProperties' +export * from '../OutputArraySchema' +export * from '../NetworkAccess_class' +export * from '../WorkReuse' +export * from '../WorkReuse_class' +export * from '../WorkflowStepOutput' +export * from '../DirectoryProperties' +export * from '../ScatterFeatureRequirementProperties' +export * from '../CommandOutputRecordSchemaProperties' +export * from '../DockerRequirement' +export * from '../InlineJavascriptRequirement' +export * from '../InitialWorkDirRequirementProperties' +export * from '../LabeledProperties' +export * from '../InputSchemaProperties' +export * from '../SoftwareRequirementProperties' +export * from '../InputArraySchemaProperties' +export * from '../CommandOutputRecordFieldProperties' +export * from '../File_class' +export * from '../ProcessRequirementProperties' +export * from '../Operation' +export * from '../ScatterFeatureRequirement' +export * from '../stdin' +export * from '../EnumSchema' +export * from '../CommandInputSchemaProperties' +export * from '../OperationProperties' +export * from '../SubworkflowFeatureRequirement' +export * from '../MultipleInputFeatureRequirement' +export * from '../ShellCommandRequirement_class' +export * from '../IOSchemaProperties' +export * from '../CommandInputRecordField' +export * from '../ParameterProperties' +export * from '../File' +export * from '../CommandOutputParameter' +export * from '../enum_d961d79c225752b9fadb617367615ab176b47d77' +export * from '../OutputArraySchemaProperties' +export * from '../StepInputExpressionRequirement_class' +export * from '../CommandInputParameter' +export * from '../EnvironmentDefProperties' +export * from '../enum_d062602be0b4b8fd33e69e29a841317b6ab665bc' +export * from '../InputBinding' +export * from '../ExpressionToolOutputParameter' +export * from '../ScatterFeatureRequirement_class' +export * from '../SoftwarePackage' +export * from '../OperationInputParameter' +export * from '../OutputRecordField' +export * from '../SchemaDefRequirementProperties' +export * from '../Dirent' +export * from '../NetworkAccessProperties' +export * from '../CommandOutputArraySchemaProperties' +export * from '../WorkflowOutputParameter' +export * from '../WorkflowStepInput' +export * from '../FieldBaseProperties' +export * from '../CommandInputRecordFieldProperties' +export * from '../ScatterMethod' +export * from '../ToolTimeLimit' +export * from '../WorkflowStepInputProperties' +export * from '../InputRecordSchemaProperties' +export * from '../InputParameterProperties' +export * from '../CommandLineBindable' +export * from '../SchemaDefRequirement' +export * from '../InputEnumSchema' +export * from '../OutputRecordSchema' +export * from '../CommandOutputBinding' +export * from '../CommandInputRecordSchema' +export * from '../RecordSchema' +export * from '../OutputSchemaProperties' +export * from '../CommandInputEnumSchema' +export * from '../LoadContentsProperties' +export * from '../DirentProperties' +export * from '../OutputRecordSchemaProperties' +export * from '../LoadListingEnum' +export * from '../CommandOutputRecordField' +export * from '../EnvVarRequirement' +export * from '../InplaceUpdateRequirementProperties' +export * from '../FileProperties' +export * from '../InlineJavascriptRequirementProperties' +export * from '../CommandInputParameterProperties' +export * from '../InputRecordField' +export * from '../CWLVersion' +export * from '../CommandOutputRecordSchema' +export * from '../ResourceRequirementProperties' +export * from '../OutputParameterProperties' +export * from '../Directory' +export * from '../CWLType' +export * from '../WorkflowStep' +export * from '../stdout' +export * from '../CommandOutputParameterProperties' +export * from '../ArraySchema' +export * from '../InputFormatProperties' +export * from '../OutputEnumSchemaProperties' +export * from '../EnumSchemaProperties' +export * from '../RecordSchemaProperties' +export * from '../ExpressionTool_class' +export * from '../WorkflowInputParameterProperties' +export * from '../StepInputExpressionRequirementProperties' +export * from '../ExpressionTool' +export * from '../IdentifiedProperties' +export * from '../InputRecordFieldProperties' +export * from '../InitialWorkDirRequirement' +export * from '../CommandOutputBindingProperties' +export * from '../WorkflowProperties' +export * from '../CommandOutputEnumSchema' +export * from '../SubworkflowFeatureRequirement_class' +export * from '../NetworkAccess' +export * from '../enum_d9cba076fca539106791a4f46d198c7fcfbdb779' +export * from '../CommandLineTool_class' +export * from '../SoftwareRequirement_class' +export * from '../SoftwarePackageProperties' +export * from '../OutputEnumSchema' +export * from '../CommandInputRecordSchemaProperties' +export * from '../WorkflowOutputParameterProperties' +export * from '../LoadListingRequirementProperties' +export * from '../CommandInputEnumSchemaProperties' +export * from '../LinkMergeMethod' +export * from '../OperationOutputParameterProperties' +export * from '../CommandInputArraySchemaProperties' +export * from '../SoftwareRequirement' +export * from '../Directory_class' +export * from '../ArraySchemaProperties' +export * from '../ToolTimeLimitProperties' +export * from '../InputEnumSchemaProperties' +export * from '../WorkflowInputParameter' +export * from '../RecordField' +export * from '../MultipleInputFeatureRequirement_class' +export * from '../SinkProperties' +export * from '../WorkflowStepOutputProperties' +export * from '../SecondaryFileSchema' +export * from '../ToolTimeLimit_class' +export * from '../ShellCommandRequirement' +export * from '../CommandInputArraySchema' +export * from '../ResourceRequirement_class' +export * from '../MultipleInputFeatureRequirementProperties' +export * from '../InplaceUpdateRequirement_class' +export * from '../stderr' +export * from '../CommandLineTool' +export * from '../InitialWorkDirRequirement_class' +export * from '../ExpressionToolProperties' +export * from '../SchemaDefRequirement_class' +export * from '../CommandOutputEnumSchemaProperties' +export * from '../OutputRecordFieldProperties' +export * from '../InplaceUpdateRequirement' +export * from '../PrimitiveType' +export * from '../OperationOutputParameter' +export * from '../InlineJavascriptRequirement_class' +export * from '../InputBindingProperties' +export * from '../EnvVarRequirement_class' +export * from '../CommandLineToolProperties' +export * from '../OperationInputParameterProperties' +export * from '../StepInputExpressionRequirement' +export * from '../PickValueMethod' +export * from '../EnvVarRequirementProperties' +export * from '../WorkReuseProperties' +export * from '../LoadListingRequirement_class' +export * from '../EnvironmentDef' +export * from '../CommandOutputArraySchema' +export * from '../ShellCommandRequirementProperties' +export * from '../SubworkflowFeatureRequirementProperties' +export * from '../CommandLineBindableProperties' +export * from '../Expression' +export * from '../Operation_class' +export * from '../WorkflowStepProperties' +export * from '../OutputFormatProperties' +export * from '../InputRecordSchema' +export * from '../SecondaryFileSchemaProperties' +export * from '../Workflow_class' +export * from '../LoadListingRequirement' +export * from '../ProcessProperties' +export * as LoaderInstances from './LoaderInstances' diff --git a/src/util/loaderinstances.ts b/src/util/LoaderInstances.ts similarity index 99% rename from src/util/loaderinstances.ts rename to src/util/LoaderInstances.ts index a48a8e7..1fc0457 100644 --- a/src/util/loaderinstances.ts +++ b/src/util/LoaderInstances.ts @@ -11,184 +11,184 @@ import { _TypeDSLLoader, _SecondaryDSLLoader, TypeGuards, - SoftwarePackageProperties, - RecordSchemaProperties, - InplaceUpdateRequirement_class, - MultipleInputFeatureRequirementProperties, - SchemaDefRequirement_class, + ResourceRequirement, + InputArraySchema, + DockerRequirement_class, + Workflow, + ExpressionToolOutputParameterProperties, + RecordFieldProperties, + Any, + CommandLineBinding, + CommandLineBindingProperties, + DockerRequirementProperties, + DocumentedProperties, + OutputArraySchema, NetworkAccess_class, - Directory, - CommandInputArraySchemaProperties, + WorkReuse, + WorkReuse_class, + WorkflowStepOutput, + DirectoryProperties, + ScatterFeatureRequirementProperties, + CommandOutputRecordSchemaProperties, + DockerRequirement, + InlineJavascriptRequirement, + InitialWorkDirRequirementProperties, + LabeledProperties, + InputSchemaProperties, + SoftwareRequirementProperties, + InputArraySchemaProperties, + CommandOutputRecordFieldProperties, + File_class, + ProcessRequirementProperties, + Operation, + ScatterFeatureRequirement, + stdin, + EnumSchema, + CommandInputSchemaProperties, + OperationProperties, + SubworkflowFeatureRequirement, + MultipleInputFeatureRequirement, + ShellCommandRequirement_class, + IOSchemaProperties, + CommandInputRecordField, + ParameterProperties, + File, + CommandOutputParameter, + enum_d961d79c225752b9fadb617367615ab176b47d77, + OutputArraySchemaProperties, + StepInputExpressionRequirement_class, + CommandInputParameter, + EnvironmentDefProperties, + enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, + InputBinding, + ExpressionToolOutputParameter, + ScatterFeatureRequirement_class, + SoftwarePackage, + OperationInputParameter, + OutputRecordField, + SchemaDefRequirementProperties, + Dirent, + NetworkAccessProperties, + CommandOutputArraySchemaProperties, + WorkflowOutputParameter, + WorkflowStepInput, + FieldBaseProperties, + CommandInputRecordFieldProperties, + ScatterMethod, + ToolTimeLimit, WorkflowStepInputProperties, + InputRecordSchemaProperties, + InputParameterProperties, + CommandLineBindable, + SchemaDefRequirement, + InputEnumSchema, + OutputRecordSchema, + CommandOutputBinding, + CommandInputRecordSchema, + RecordSchema, + OutputSchemaProperties, CommandInputEnumSchema, - EnvVarRequirementProperties, - SecondaryFileSchemaProperties, - CWLVersion, - InplaceUpdateRequirementProperties, - OperationProperties, - RecordFieldProperties, - MultipleInputFeatureRequirement_class, - SubworkflowFeatureRequirement_class, - InputBindingProperties, + LoadContentsProperties, + DirentProperties, + OutputRecordSchemaProperties, + LoadListingEnum, + CommandOutputRecordField, EnvVarRequirement, - OutputEnumSchema, - StepInputExpressionRequirement, - WorkflowInputParameterProperties, - CommandLineTool_class, - ResourceRequirement, - Operation, - CommandInputRecordField, - CommandInputArraySchema, - OperationOutputParameterProperties, - EnvVarRequirement_class, - ArraySchemaProperties, + InplaceUpdateRequirementProperties, + FileProperties, InlineJavascriptRequirementProperties, - InplaceUpdateRequirement, - LoadListingRequirement_class, - InlineJavascriptRequirement_class, - ScatterFeatureRequirementProperties, - CommandOutputBinding, + CommandInputParameterProperties, + InputRecordField, + CWLVersion, + CommandOutputRecordSchema, + ResourceRequirementProperties, + OutputParameterProperties, + Directory, CWLType, - CommandOutputRecordField, - InputBinding, - Dirent, - ShellCommandRequirement, + WorkflowStep, + stdout, + CommandOutputParameterProperties, + ArraySchema, + InputFormatProperties, + OutputEnumSchemaProperties, + EnumSchemaProperties, + RecordSchemaProperties, + ExpressionTool_class, + WorkflowInputParameterProperties, StepInputExpressionRequirementProperties, - SchemaDefRequirement, - ExpressionToolOutputParameterProperties, ExpressionTool, - stderr, - ArraySchema, - LabeledProperties, + IdentifiedProperties, + InputRecordFieldProperties, + InitialWorkDirRequirement, CommandOutputBindingProperties, - SoftwarePackage, - EnumSchemaProperties, - StepInputExpressionRequirement_class, - ScatterMethod, - WorkflowStepOutputProperties, - stdout, - File, - ScatterFeatureRequirement, - EnumSchema, - ShellCommandRequirement_class, - SecondaryFileSchema, - InputParameterProperties, - SoftwareRequirement_class, WorkflowProperties, - InputFormatProperties, - CommandLineBindable, - CommandInputEnumSchemaProperties, - enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, - FieldBaseProperties, - InputRecordFieldProperties, - CommandInputSchemaProperties, - CommandOutputParameter, - WorkflowStepOutput, - OperationOutputParameter, - OperationInputParameterProperties, - WorkflowOutputParameterProperties, CommandOutputEnumSchema, - CommandOutputEnumSchemaProperties, - ExpressionToolProperties, - CommandOutputRecordSchemaProperties, - SubworkflowFeatureRequirementProperties, + SubworkflowFeatureRequirement_class, + NetworkAccess, + enum_d9cba076fca539106791a4f46d198c7fcfbdb779, + CommandLineTool_class, + SoftwareRequirement_class, + SoftwarePackageProperties, + OutputEnumSchema, + CommandInputRecordSchemaProperties, + WorkflowOutputParameterProperties, LoadListingRequirementProperties, - OutputRecordSchemaProperties, - IdentifiedProperties, - LoadContentsProperties, - EnvironmentDefProperties, + CommandInputEnumSchemaProperties, + LinkMergeMethod, + OperationOutputParameterProperties, + CommandInputArraySchemaProperties, + SoftwareRequirement, + Directory_class, + ArraySchemaProperties, + ToolTimeLimitProperties, + InputEnumSchemaProperties, + WorkflowInputParameter, + RecordField, + MultipleInputFeatureRequirement_class, + SinkProperties, + WorkflowStepOutputProperties, + SecondaryFileSchema, + ToolTimeLimit_class, + ShellCommandRequirement, + CommandInputArraySchema, ResourceRequirement_class, - enum_d961d79c225752b9fadb617367615ab176b47d77, - ProcessRequirementProperties, - SchemaDefRequirementProperties, - WorkReuseProperties, - enum_d9cba076fca539106791a4f46d198c7fcfbdb779, - InputRecordSchemaProperties, - WorkflowStep, - Operation_class, - NetworkAccess, - FileProperties, - DirentProperties, + MultipleInputFeatureRequirementProperties, + InplaceUpdateRequirement_class, + stderr, + CommandLineTool, InitialWorkDirRequirement_class, - ResourceRequirementProperties, - CommandOutputRecordSchema, - CommandOutputRecordFieldProperties, + ExpressionToolProperties, + SchemaDefRequirement_class, + CommandOutputEnumSchemaProperties, OutputRecordFieldProperties, + InplaceUpdateRequirement, PrimitiveType, - InputRecordSchema, - DockerRequirement, - CommandLineBindableProperties, - ParameterProperties, - SoftwareRequirement, - InputSchemaProperties, + OperationOutputParameter, + InlineJavascriptRequirement_class, + InputBindingProperties, + EnvVarRequirement_class, + CommandLineToolProperties, + OperationInputParameterProperties, + StepInputExpressionRequirement, PickValueMethod, - CommandInputRecordSchema, - SoftwareRequirementProperties, - WorkflowInputParameter, - CommandOutputParameterProperties, - stdin, - SinkProperties, - CommandOutputArraySchema, - WorkReuse_class, - RecordSchema, - File_class, - WorkflowStepInput, - OutputEnumSchemaProperties, - CommandInputRecordSchemaProperties, + EnvVarRequirementProperties, + WorkReuseProperties, + LoadListingRequirement_class, EnvironmentDef, - OperationInputParameter, - MultipleInputFeatureRequirement, - CommandLineBinding, - DocumentedProperties, - CommandLineToolProperties, - OutputParameterProperties, - ToolTimeLimit_class, - Any, - DockerRequirementProperties, - LinkMergeMethod, - InputArraySchema, - OutputRecordSchema, - IOSchemaProperties, - DockerRequirement_class, - CommandOutputArraySchemaProperties, - ToolTimeLimitProperties, - Workflow, + CommandOutputArraySchema, ShellCommandRequirementProperties, - OutputArraySchemaProperties, - NetworkAccessProperties, + SubworkflowFeatureRequirementProperties, + CommandLineBindableProperties, Expression, - ExpressionToolOutputParameter, - ExpressionTool_class, - RecordField, - DirectoryProperties, - CommandInputParameterProperties, - ScatterFeatureRequirement_class, - ToolTimeLimit, - ProcessProperties, - InputArraySchemaProperties, + Operation_class, + WorkflowStepProperties, + OutputFormatProperties, + InputRecordSchema, + SecondaryFileSchemaProperties, Workflow_class, - InputRecordField, - InitialWorkDirRequirement, - SubworkflowFeatureRequirement, LoadListingRequirement, - Directory_class, - CommandLineBindingProperties, - LoadListingEnum, - InlineJavascriptRequirement, - InputEnumSchemaProperties, - CommandLineTool, - WorkReuse, - OutputArraySchema, - InitialWorkDirRequirementProperties, - CommandInputParameter, - WorkflowOutputParameter, - InputEnumSchema, - CommandInputRecordFieldProperties, - OutputSchemaProperties, - OutputFormatProperties, - WorkflowStepProperties, - OutputRecordField -} from './internal' + ProcessProperties +} from './Internal' export const strtype = new _PrimitiveLoader(TypeGuards.String); export const inttype = new _PrimitiveLoader(TypeGuards.Int); diff --git a/src/util/loadingoptions.ts b/src/util/LoadingOptions.ts similarity index 98% rename from src/util/loadingoptions.ts rename to src/util/LoadingOptions.ts index bb24b00..ac484bc 100644 --- a/src/util/loadingoptions.ts +++ b/src/util/LoadingOptions.ts @@ -1,4 +1,4 @@ -import { Dictionary, DefaultFetcher, Fetcher, RVOCAB, VOCAB } from './internal' +import { Dictionary, DefaultFetcher, Fetcher, RVOCAB, VOCAB } from './Internal' export class LoadingOptions { fetcher: Fetcher diff --git a/src/util/saveable.ts b/src/util/Saveable.ts similarity index 97% rename from src/util/saveable.ts rename to src/util/Saveable.ts index 6914738..f983084 100644 --- a/src/util/saveable.ts +++ b/src/util/Saveable.ts @@ -1,4 +1,4 @@ -import { LoadingOptions, Dictionary, TypeGuards } from './internal' +import { LoadingOptions, Dictionary, TypeGuards } from './Internal' import * as URI from 'uri-js' import path from 'path' diff --git a/src/util/typeguards.ts b/src/util/Typeguards.ts similarity index 93% rename from src/util/typeguards.ts rename to src/util/Typeguards.ts index fc27217..0719c1f 100644 --- a/src/util/typeguards.ts +++ b/src/util/Typeguards.ts @@ -1,4 +1,4 @@ -import { Dictionary } from './internal' +import { Dictionary } from './Internal' export function Int (doc: any): boolean { return typeof doc === 'number' && Number.isInteger(doc) diff --git a/src/util/validationexception.ts b/src/util/ValidationException.ts similarity index 100% rename from src/util/validationexception.ts rename to src/util/ValidationException.ts diff --git a/src/util/vocabs.ts b/src/util/Vocabs.ts similarity index 100% rename from src/util/vocabs.ts rename to src/util/Vocabs.ts diff --git a/src/util/internal.ts b/src/util/internal.ts deleted file mode 100644 index 4c38b7a..0000000 --- a/src/util/internal.ts +++ /dev/null @@ -1,199 +0,0 @@ -// Internal modules pattern to deal with circular dependencies -export * from './dict' -export * as TypeGuards from './typeguards' -export * from './loaders/arrayloader' -export * from './saveable' -export * from './loaders/enumloader' -export * from './loaders/expressionloader' -export * from './fetcher' -export * from './loaders/idmaploader' -export * from './loaders/loader' -export * from './loadingoptions' -export * from './loaders/anyloader' -export * from './loaders/primitiveloader' -export * from './loaders/recordloader' -export * from './loaders/rootloader' -export * from './loaders/typedslloader' -export * from './loaders/secondarydslloader' -export * from './loaders/unionloader' -export * from './loaders/uriloader' -export * from './validationexception' -export * from './vocabs' -export * from '../outputformatproperties' -export * from '../initialworkdirrequirement' -export * from '../commandlinetoolproperties' -export * from '../workflowoutputparameter' -export * from '../envvarrequirementclass' -export * from '../outputrecordfield' -export * from '../networkaccess' -export * from '../secondaryfileschemaproperties' -export * from '../expressiontooloutputparameterproperties' -export * from '../workflowinputparameter' -export * from '../stepinputexpressionrequirement' -export * from '../commandoutputparameterproperties' -export * from '../inputformatproperties' -export * from '../commandoutputarrayschemaproperties' -export * from '../networkaccessclass' -export * from '../tooltimelimitproperties' -export * from '../inputbinding' -export * from '../expressiontoolclass' -export * from '../arrayschema' -export * from '../softwarerequirementclass' -export * from '../softwarepackageproperties' -export * from '../initialworkdirrequirementproperties' -export * from '../linkmergemethod' -export * from '../inplaceupdaterequirementproperties' -export * from '../outputarrayschema' -export * from '../processproperties' -export * from '../workflowinputparameterproperties' -export * from '../commandoutputrecordfield' -export * from '../loadlistingrequirement' -export * from '../labeledproperties' -export * from '../operationinputparameterproperties' -export * from '../inputparameterproperties' -export * from '../commandlinebinding' -export * from '../documentedproperties' -export * from '../outputrecordfieldproperties' -export * from '../inlinejavascriptrequirementproperties' -export * from '../commandlinetoolclass' -export * from '../inplaceupdaterequirementclass' -export * from '../workreuse' -export * from '../recordschemaproperties' -export * from '../loadlistingrequirementclass' -export * from '../direntproperties' -export * from '../workflowstep' -export * from '../commandlinetool' -export * from '../initialworkdirrequirementclass' -export * from '../recordschema' -export * from '../shellcommandrequirementproperties' -export * from '../outputparameterproperties' -export * from '../scattermethod' -export * from '../ioschemaproperties' -export * from '../stderr' -export * from '../workflowclass' -export * from '../inputschemaproperties' -export * from '../tooltimelimit' -export * from '../softwarepackage' -export * from '../inputbindingproperties' -export * from '../stdout' -export * from '../inputenumschema' -export * from '../environmentdef' -export * from '../workflow' -export * from '../fileproperties' -export * from '../sinkproperties' -export * from '../envvarrequirement' -export * from '../parameterproperties' -export * from '../enumschemaproperties' -export * from '../subworkflowfeaturerequirementclass' -export * from '../resourcerequirementproperties' -export * from '../schemadefrequirementproperties' -export * from '../envvarrequirementproperties' -export * from '../loadcontentsproperties' -export * from '../operationoutputparameterproperties' -export * from '../cwlversion' -export * from '../enumd062602be0b4b8fd33e69e29a841317b6ab665bc' -export * from '../inputarrayschema' -export * from '../tooltimelimitclass' -export * from '../recordfield' -export * from '../enumd9cba076fca539106791a4f46d198c7fcfbdb779' -export * from '../commandinputarrayschema' -export * from '../cwltype' -export * from '../commandlinebindingproperties' -export * from '../file' -export * from '../commandoutputbindingproperties' -export * from '../commandoutputbinding' -export * from '../workflowstepoutput' -export * from '../scatterfeaturerequirement' -export * from '../loadlistingenum' -export * from '../workreuseclass' -export * from '../workflowstepinput' -export * from '../enumd961d79c225752b9fadb617367615ab176b47d77' -export * from '../directory' -export * from '../inputarrayschemaproperties' -export * from '../outputenumschemaproperties' -export * from '../dockerrequirementproperties' -export * from '../networkaccessproperties' -export * from '../commandinputenumschema' -export * from '../stepinputexpressionrequirementproperties' -export * from '../expressiontoolproperties' -export * from '../expressiontooloutputparameter' -export * from '../operation' -export * from '../commandoutputarrayschema' -export * from '../enumschema' -export * from '../secondaryfileschema' -export * from '../directoryclass' -export * from '../inplaceupdaterequirement' -export * from '../pickvaluemethod' -export * from '../operationinputparameter' -export * from '../softwarerequirementproperties' -export * from '../commandinputrecordschemaproperties' -export * from '../subworkflowfeaturerequirement' -export * from '../inputrecordschema' -export * from '../dockerrequirement' -export * from '../commandinputschemaproperties' -export * from '../resourcerequirement' -export * from '../stdin' -export * from '../commandinputparameterproperties' -export * from '../arrayschemaproperties' -export * from '../dirent' -export * from '../outputrecordschema' -export * from '../commandoutputenumschema' -export * from '../commandinputrecordfieldproperties' -export * from '../scatterfeaturerequirementproperties' -export * from '../dockerrequirementclass' -export * from '../fieldbaseproperties' -export * from '../resourcerequirementclass' -export * from '../workflowstepinputproperties' -export * from '../inputrecordfield' -export * from '../shellcommandrequirement' -export * from '../schemadefrequirementclass' -export * from '../workflowoutputparameterproperties' -export * from '../recordfieldproperties' -export * from '../processrequirementproperties' -export * from '../multipleinputfeaturerequirement' -export * from '../workflowstepoutputproperties' -export * from '../directoryproperties' -export * from '../inputenumschemaproperties' -export * from '../commandoutputenumschemaproperties' -export * from '../shellcommandrequirementclass' -export * from '../expression' -export * from '../outputrecordschemaproperties' -export * from '../expressiontool' -export * from '../inputrecordfieldproperties' -export * from '../operationclass' -export * from '../schemadefrequirement' -export * from '../outputschemaproperties' -export * from '../identifiedproperties' -export * from '../scatterfeaturerequirementclass' -export * from '../outputarrayschemaproperties' -export * from '../commandinputenumschemaproperties' -export * from '../fileclass' -export * from '../inlinejavascriptrequirementclass' -export * from '../commandinputrecordschema' -export * from '../commandoutputrecordschemaproperties' -export * from '../inlinejavascriptrequirement' -export * from '../multipleinputfeaturerequirementclass' -export * from '../commandinputrecordfield' -export * from '../commandlinebindableproperties' -export * from '../commandinputarrayschemaproperties' -export * from '../subworkflowfeaturerequirementproperties' -export * from '../commandoutputrecordschema' -export * from '../commandinputparameter' -export * from '../outputenumschema' -export * from '../workflowstepproperties' -export * from '../stepinputexpressionrequirementclass' -export * from '../any' -export * from '../commandlinebindable' -export * from '../loadlistingrequirementproperties' -export * from '../commandoutputrecordfieldproperties' -export * from '../inputrecordschemaproperties' -export * from '../multipleinputfeaturerequirementproperties' -export * from '../operationoutputparameter' -export * from '../commandoutputparameter' -export * from '../softwarerequirement' -export * from '../operationproperties' -export * from '../workflowproperties' -export * from '../workreuseproperties' -export * from '../environmentdefproperties' -export * from '../primitivetype' -export * as LoaderInstances from './loaderinstances' diff --git a/src/util/loaders/anyloader.ts b/src/util/loaders/AnyLoader.ts similarity index 97% rename from src/util/loaders/anyloader.ts rename to src/util/loaders/AnyLoader.ts index f2ab23a..9b3f924 100644 --- a/src/util/loaders/anyloader.ts +++ b/src/util/loaders/AnyLoader.ts @@ -1,4 +1,4 @@ -import { Loader, LoadingOptions, ValidationException } from '../internal' +import { Loader, LoadingOptions, ValidationException } from '../Internal' export class _AnyLoader implements Loader { async load (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string | undefined): Promise { diff --git a/src/util/loaders/arrayloader.ts b/src/util/loaders/ArrayLoader.ts similarity index 96% rename from src/util/loaders/arrayloader.ts rename to src/util/loaders/ArrayLoader.ts index 6d2a539..eea30c5 100644 --- a/src/util/loaders/arrayloader.ts +++ b/src/util/loaders/ArrayLoader.ts @@ -1,4 +1,4 @@ -import { Loader, loadField, LoadingOptions, _UnionLoader, ValidationException } from '../internal' +import { Loader, loadField, LoadingOptions, _UnionLoader, ValidationException } from '../Internal' export class _ArrayLoader implements Loader { items: Loader[] diff --git a/src/util/loaders/enumloader.ts b/src/util/loaders/EnumLoader.ts similarity index 97% rename from src/util/loaders/enumloader.ts rename to src/util/loaders/EnumLoader.ts index 59b54bf..fac0f60 100644 --- a/src/util/loaders/enumloader.ts +++ b/src/util/loaders/EnumLoader.ts @@ -1,4 +1,4 @@ -import { Loader, LoadingOptions, ValidationException } from '../internal' +import { Loader, LoadingOptions, ValidationException } from '../Internal' export class _EnumLoader implements Loader { symbols: string[] diff --git a/src/util/loaders/expressionloader.ts b/src/util/loaders/ExpressionLoader.ts similarity index 97% rename from src/util/loaders/expressionloader.ts rename to src/util/loaders/ExpressionLoader.ts index 71865a5..fde0c5e 100644 --- a/src/util/loaders/expressionloader.ts +++ b/src/util/loaders/ExpressionLoader.ts @@ -1,4 +1,4 @@ -import { Loader, LoadingOptions, ValidationException } from '../internal' +import { Loader, LoadingOptions, ValidationException } from '../Internal' export class _ExpressionLoader implements Loader { diff --git a/src/util/loaders/idmaploader.ts b/src/util/loaders/IdMapLoader.ts similarity index 97% rename from src/util/loaders/idmaploader.ts rename to src/util/loaders/IdMapLoader.ts index aee7c1f..eedf248 100644 --- a/src/util/loaders/idmaploader.ts +++ b/src/util/loaders/IdMapLoader.ts @@ -1,4 +1,4 @@ -import { Dictionary, TypeGuards, Loader, LoadingOptions, ValidationException } from '../internal' +import { Dictionary, TypeGuards, Loader, LoadingOptions, ValidationException } from '../Internal' export class _IdMapLoader implements Loader { inner: Loader diff --git a/src/util/loaders/loader.ts b/src/util/loaders/Loader.ts similarity index 98% rename from src/util/loaders/loader.ts rename to src/util/loaders/Loader.ts index 249db5f..470fb2f 100644 --- a/src/util/loaders/loader.ts +++ b/src/util/loaders/Loader.ts @@ -1,4 +1,4 @@ -import { LoadingOptions, documentLoadByUrl, TypeGuards, ValidationException } from '../internal' +import { LoadingOptions, documentLoadByUrl, TypeGuards, ValidationException } from '../Internal' import * as URI from 'uri-js' export interface Loader { diff --git a/src/util/loaders/primitiveloader.ts b/src/util/loaders/PrimitiveLoader.ts similarity index 97% rename from src/util/loaders/primitiveloader.ts rename to src/util/loaders/PrimitiveLoader.ts index a49c847..5d46924 100644 --- a/src/util/loaders/primitiveloader.ts +++ b/src/util/loaders/PrimitiveLoader.ts @@ -1,4 +1,4 @@ -import { Loader, LoadingOptions, ValidationException } from '../internal' +import { Loader, LoadingOptions, ValidationException } from '../Internal' export class _PrimitiveLoader implements Loader { typeGuard: (val: any) => boolean diff --git a/src/util/loaders/recordloader.ts b/src/util/loaders/RecordLoader.ts similarity index 95% rename from src/util/loaders/recordloader.ts rename to src/util/loaders/RecordLoader.ts index 47e46cb..a9920f0 100644 --- a/src/util/loaders/recordloader.ts +++ b/src/util/loaders/RecordLoader.ts @@ -1,4 +1,4 @@ -import { Saveable, Loader, LoadingOptions, TypeGuards, ValidationException } from '../internal' +import { Saveable, Loader, LoadingOptions, TypeGuards, ValidationException } from '../Internal' export class _RecordLoader implements Loader { creatorFunc: (doc: any, baseuri: string, loadingOptions: LoadingOptions, docRoot?: string) => Promise diff --git a/src/util/loaders/rootloader.ts b/src/util/loaders/RootLoader.ts similarity index 98% rename from src/util/loaders/rootloader.ts rename to src/util/loaders/RootLoader.ts index 62e55e3..08daac7 100644 --- a/src/util/loaders/rootloader.ts +++ b/src/util/loaders/RootLoader.ts @@ -1,5 +1,5 @@ -import { LoadingOptions, Loader, TypeGuards, LoaderInstances } from '../internal' -import * as Internal from '../internal' +import { LoadingOptions, Loader, TypeGuards, LoaderInstances } from '../Internal' +import * as Internal from '../Internal' import * as yaml from 'js-yaml' import * as URL from 'url' diff --git a/src/util/loaders/secondarydslloader.ts b/src/util/loaders/SecondaryDSLLoader.ts similarity index 98% rename from src/util/loaders/secondarydslloader.ts rename to src/util/loaders/SecondaryDSLLoader.ts index 4ae44a0..4ed85e1 100644 --- a/src/util/loaders/secondarydslloader.ts +++ b/src/util/loaders/SecondaryDSLLoader.ts @@ -1,4 +1,4 @@ -import { Loader, LoadingOptions, Dictionary, TypeGuards, ValidationException } from '../internal' +import { Loader, LoadingOptions, Dictionary, TypeGuards, ValidationException } from '../Internal' export class _SecondaryDSLLoader implements Loader { inner: Loader diff --git a/src/util/loaders/typedslloader.ts b/src/util/loaders/TypeDSLLoader.ts similarity index 99% rename from src/util/loaders/typedslloader.ts rename to src/util/loaders/TypeDSLLoader.ts index 505eb22..ca55c88 100644 --- a/src/util/loaders/typedslloader.ts +++ b/src/util/loaders/TypeDSLLoader.ts @@ -1,4 +1,4 @@ -import { Dictionary, expandUrl, Loader, LoadingOptions } from '../internal' +import { Dictionary, expandUrl, Loader, LoadingOptions } from '../Internal' export class _TypeDSLLoader implements Loader { typeDSLRegex = /^([^[?]+)(\[\])?(\?)?$/ diff --git a/src/util/loaders/unionloader.ts b/src/util/loaders/UnionLoader.ts similarity index 97% rename from src/util/loaders/unionloader.ts rename to src/util/loaders/UnionLoader.ts index 538371a..2a556df 100644 --- a/src/util/loaders/unionloader.ts +++ b/src/util/loaders/UnionLoader.ts @@ -1,4 +1,4 @@ -import { Loader, LoadingOptions, Saveable, ValidationException } from '../internal' +import { Loader, LoadingOptions, Saveable, ValidationException } from '../Internal' export class _UnionLoader implements Loader { alternates: Loader[] diff --git a/src/util/loaders/uriloader.ts b/src/util/loaders/UriLoader.ts similarity index 93% rename from src/util/loaders/uriloader.ts rename to src/util/loaders/UriLoader.ts index 2fb9660..3330874 100644 --- a/src/util/loaders/uriloader.ts +++ b/src/util/loaders/UriLoader.ts @@ -1,4 +1,4 @@ -import { expandUrl, Loader, LoadingOptions } from '../internal' +import { expandUrl, Loader, LoadingOptions } from '../Internal' export class _URILoader implements Loader { inner: Loader From 9528c8da028b226f891e828da58a96f359b51eaf Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Wed, 22 Dec 2021 22:02:17 +0100 Subject: [PATCH 14/19] List of changes: - Fix 'undefined' typeguard - Fix comparison in saveRelativeUri - Add missing docRoot parameter to loader functions --- src/test/Typeguards.spec.ts | 2 +- src/util/Saveable.ts | 2 +- src/util/Typeguards.ts | 2 +- src/util/loaders/RootLoader.ts | 2 +- src/util/loaders/UnionLoader.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/Typeguards.spec.ts b/src/test/Typeguards.spec.ts index dd9aab3..00653e2 100644 --- a/src/test/Typeguards.spec.ts +++ b/src/test/Typeguards.spec.ts @@ -68,6 +68,7 @@ describe('Test Typeguards', () => { describe('Undefined', () => { it('Should return true', () => { assert.equal(TypeGuards.Undefined(undefined), true) + assert.equal(TypeGuards.Undefined(null), true) }) it('Should return false', () => { @@ -76,7 +77,6 @@ describe('Test Typeguards', () => { assert.equal(TypeGuards.Undefined(1), false) assert.equal(TypeGuards.Undefined(1.1), false) assert.equal(TypeGuards.Undefined({}), false) - assert.equal(TypeGuards.Undefined(null), false) }) }) diff --git a/src/util/Saveable.ts b/src/util/Saveable.ts index f983084..ce043d3 100644 --- a/src/util/Saveable.ts +++ b/src/util/Saveable.ts @@ -39,7 +39,7 @@ export function save (val: any, top: boolean = true, baseUrl: string = '', relat } export function saveRelativeUri (uri: any, baseUrl: string='', scopedId: boolean, relativeUris: boolean, refScope?: number): any { - if (relativeUris == null || uri === baseUrl) { + if (relativeUris === false || uri === baseUrl) { return uri } if (Array.isArray(uri)) { diff --git a/src/util/Typeguards.ts b/src/util/Typeguards.ts index 0719c1f..b187f7b 100644 --- a/src/util/Typeguards.ts +++ b/src/util/Typeguards.ts @@ -17,7 +17,7 @@ export function String (doc: any): boolean { } export function Undefined (doc: any): boolean { - return typeof doc === 'undefined' + return doc == null } export function isDictionary (doc: any): doc is Dictionary { diff --git a/src/util/loaders/RootLoader.ts b/src/util/loaders/RootLoader.ts index 08daac7..748f018 100644 --- a/src/util/loaders/RootLoader.ts +++ b/src/util/loaders/RootLoader.ts @@ -27,7 +27,7 @@ export async function documentLoad (loader: Loader, doc: unknown, baseuri: strin if ('$graph' in doc) { return await loader.load(doc.$graph, baseuri, loadingOptions) } else { - return await loader.load(doc, baseuri, loadingOptions) + return await loader.load(doc, baseuri, loadingOptions, baseuri) } } } diff --git a/src/util/loaders/UnionLoader.ts b/src/util/loaders/UnionLoader.ts index 2a556df..1a1fb4c 100644 --- a/src/util/loaders/UnionLoader.ts +++ b/src/util/loaders/UnionLoader.ts @@ -11,7 +11,7 @@ export class _UnionLoader implements Loader { const errors: ValidationException[] = [] for (const t of this.alternates) { try { - return await t.load(doc, baseuri, loadingOptions) + return await t.load(doc, baseuri, loadingOptions, docRoot) } catch (e) { if (e instanceof ValidationException) { errors.push(new ValidationException(`tried ${t.constructor.name} but`, [e])) From e697943f78f3d1617b194f58b3451233835121e8 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Thu, 23 Dec 2021 10:43:02 +0100 Subject: [PATCH 15/19] Exclude tests from generated package --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 7fbb2e4..73d52d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ }, "include": ["./src/**/*"], "exclude": [ - "node_modules" + "node_modules", + "./src/test" ] } \ No newline at end of file From cbd955e165bfffbc0b2abbac5feaffcc279b0235 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Thu, 23 Dec 2021 10:43:22 +0100 Subject: [PATCH 16/19] Update generated code --- src/ArraySchemaProperties.ts | 2 +- src/CommandInputArraySchemaProperties.ts | 2 +- src/CommandInputEnumSchemaProperties.ts | 2 +- src/CommandInputParameterProperties.ts | 2 +- src/CommandInputRecordFieldProperties.ts | 2 +- src/CommandInputRecordSchemaProperties.ts | 2 +- src/CommandLineBindableProperties.ts | 2 +- src/CommandLineBindingProperties.ts | 2 +- src/CommandLineToolProperties.ts | 2 +- src/CommandOutputArraySchemaProperties.ts | 2 +- src/CommandOutputBindingProperties.ts | 2 +- src/CommandOutputEnumSchemaProperties.ts | 2 +- src/CommandOutputParameterProperties.ts | 2 +- src/CommandOutputRecordFieldProperties.ts | 2 +- src/CommandOutputRecordSchemaProperties.ts | 2 +- src/DirectoryProperties.ts | 2 +- src/DirentProperties.ts | 2 +- src/DockerRequirementProperties.ts | 2 +- src/EnumSchemaProperties.ts | 2 +- src/EnvVarRequirementProperties.ts | 2 +- src/EnvironmentDefProperties.ts | 2 +- ...ExpressionToolOutputParameterProperties.ts | 2 +- src/ExpressionToolProperties.ts | 2 +- src/FileProperties.ts | 2 +- src/InitialWorkDirRequirementProperties.ts | 2 +- src/InlineJavascriptRequirementProperties.ts | 2 +- src/InplaceUpdateRequirementProperties.ts | 2 +- src/InputArraySchemaProperties.ts | 2 +- src/InputBindingProperties.ts | 2 +- src/InputEnumSchemaProperties.ts | 2 +- src/InputRecordFieldProperties.ts | 2 +- src/InputRecordSchemaProperties.ts | 2 +- src/LoadListingRequirementProperties.ts | 2 +- ...ltipleInputFeatureRequirementProperties.ts | 2 +- src/NetworkAccessProperties.ts | 2 +- src/OperationInputParameterProperties.ts | 2 +- src/OperationOutputParameterProperties.ts | 2 +- src/OperationProperties.ts | 2 +- src/OutputArraySchemaProperties.ts | 2 +- src/OutputEnumSchemaProperties.ts | 2 +- src/OutputRecordFieldProperties.ts | 2 +- src/OutputRecordSchemaProperties.ts | 2 +- src/RecordFieldProperties.ts | 2 +- src/RecordSchemaProperties.ts | 2 +- src/ResourceRequirementProperties.ts | 2 +- src/ScatterFeatureRequirementProperties.ts | 2 +- src/SchemaDefRequirementProperties.ts | 2 +- src/SecondaryFileSchemaProperties.ts | 2 +- src/ShellCommandRequirementProperties.ts | 2 +- src/SoftwarePackageProperties.ts | 2 +- src/SoftwareRequirementProperties.ts | 2 +- ...tepInputExpressionRequirementProperties.ts | 2 +- ...SubworkflowFeatureRequirementProperties.ts | 2 +- src/ToolTimeLimitProperties.ts | 2 +- src/WorkReuseProperties.ts | 2 +- src/WorkflowInputParameterProperties.ts | 2 +- src/WorkflowOutputParameterProperties.ts | 2 +- src/WorkflowProperties.ts | 2 +- src/WorkflowStepInputProperties.ts | 2 +- src/WorkflowStepOutputProperties.ts | 2 +- src/WorkflowStepProperties.ts | 2 +- src/index.ts | 304 +++++++++--------- src/util/Internal.ts | 304 +++++++++--------- src/util/LoaderInstances.ts | 304 +++++++++--------- 64 files changed, 517 insertions(+), 517 deletions(-) diff --git a/src/ArraySchemaProperties.ts b/src/ArraySchemaProperties.ts index f8a04f3..bf4ac9c 100644 --- a/src/ArraySchemaProperties.ts +++ b/src/ArraySchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface ArraySchemaProperties { extensionFields?: Internal.Dictionary - + /** * Defines the type of the array elements. */ diff --git a/src/CommandInputArraySchemaProperties.ts b/src/CommandInputArraySchemaProperties.ts index e5d6371..0c6ee0d 100644 --- a/src/CommandInputArraySchemaProperties.ts +++ b/src/CommandInputArraySchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandInputArraySchemaProperties extends Internal.InputArraySchemaProperties, Internal.CommandInputSchemaProperties, Internal.CommandLineBindableProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/CommandInputEnumSchemaProperties.ts b/src/CommandInputEnumSchemaProperties.ts index 454a712..a283b22 100644 --- a/src/CommandInputEnumSchemaProperties.ts +++ b/src/CommandInputEnumSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandInputEnumSchemaProperties extends Internal.InputEnumSchemaProperties, Internal.CommandInputSchemaProperties, Internal.CommandLineBindableProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/CommandInputParameterProperties.ts b/src/CommandInputParameterProperties.ts index b3d3554..9b7a271 100644 --- a/src/CommandInputParameterProperties.ts +++ b/src/CommandInputParameterProperties.ts @@ -10,7 +10,7 @@ import * as Internal from './util/Internal' export interface CommandInputParameterProperties extends Internal.InputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/CommandInputRecordFieldProperties.ts b/src/CommandInputRecordFieldProperties.ts index 6907b0c..e3fa2fe 100644 --- a/src/CommandInputRecordFieldProperties.ts +++ b/src/CommandInputRecordFieldProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandInputRecordFieldProperties extends Internal.InputRecordFieldProperties, Internal.CommandLineBindableProperties { extensionFields?: Internal.Dictionary - + /** * The name of the field * diff --git a/src/CommandInputRecordSchemaProperties.ts b/src/CommandInputRecordSchemaProperties.ts index 9c3f6b6..1bfac94 100644 --- a/src/CommandInputRecordSchemaProperties.ts +++ b/src/CommandInputRecordSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandInputRecordSchemaProperties extends Internal.InputRecordSchemaProperties, Internal.CommandInputSchemaProperties, Internal.CommandLineBindableProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/CommandLineBindableProperties.ts b/src/CommandLineBindableProperties.ts index d19fcc5..8aaf566 100644 --- a/src/CommandLineBindableProperties.ts +++ b/src/CommandLineBindableProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandLineBindableProperties { extensionFields?: Internal.Dictionary - + /** * Describes how to turn this object into command line arguments. */ diff --git a/src/CommandLineBindingProperties.ts b/src/CommandLineBindingProperties.ts index fcd1e60..46c24a8 100644 --- a/src/CommandLineBindingProperties.ts +++ b/src/CommandLineBindingProperties.ts @@ -45,7 +45,7 @@ import * as Internal from './util/Internal' export interface CommandLineBindingProperties extends Internal.InputBindingProperties { extensionFields?: Internal.Dictionary - + /** * Use of `loadContents` in `InputBinding` is deprecated. * Preserved for v1.0 backwards compatability. Will be removed in diff --git a/src/CommandLineToolProperties.ts b/src/CommandLineToolProperties.ts index e527ed9..11b536c 100644 --- a/src/CommandLineToolProperties.ts +++ b/src/CommandLineToolProperties.ts @@ -11,7 +11,7 @@ import * as Internal from './util/Internal' export interface CommandLineToolProperties extends Internal.ProcessProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/CommandOutputArraySchemaProperties.ts b/src/CommandOutputArraySchemaProperties.ts index 53c6e53..c3528eb 100644 --- a/src/CommandOutputArraySchemaProperties.ts +++ b/src/CommandOutputArraySchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandOutputArraySchemaProperties extends Internal.OutputArraySchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/CommandOutputBindingProperties.ts b/src/CommandOutputBindingProperties.ts index 8f038d4..4119b0b 100644 --- a/src/CommandOutputBindingProperties.ts +++ b/src/CommandOutputBindingProperties.ts @@ -20,7 +20,7 @@ import * as Internal from './util/Internal' export interface CommandOutputBindingProperties extends Internal.LoadContentsProperties { extensionFields?: Internal.Dictionary - + /** * Only valid when `type: File` or is an array of `items: File`. * diff --git a/src/CommandOutputEnumSchemaProperties.ts b/src/CommandOutputEnumSchemaProperties.ts index 4bbc8a5..eb88dd9 100644 --- a/src/CommandOutputEnumSchemaProperties.ts +++ b/src/CommandOutputEnumSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandOutputEnumSchemaProperties extends Internal.OutputEnumSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/CommandOutputParameterProperties.ts b/src/CommandOutputParameterProperties.ts index 65f596d..7ad4431 100644 --- a/src/CommandOutputParameterProperties.ts +++ b/src/CommandOutputParameterProperties.ts @@ -10,7 +10,7 @@ import * as Internal from './util/Internal' export interface CommandOutputParameterProperties extends Internal.OutputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/CommandOutputRecordFieldProperties.ts b/src/CommandOutputRecordFieldProperties.ts index 7ac77b7..1f4f979 100644 --- a/src/CommandOutputRecordFieldProperties.ts +++ b/src/CommandOutputRecordFieldProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandOutputRecordFieldProperties extends Internal.OutputRecordFieldProperties { extensionFields?: Internal.Dictionary - + /** * The name of the field * diff --git a/src/CommandOutputRecordSchemaProperties.ts b/src/CommandOutputRecordSchemaProperties.ts index 396e623..a05306b 100644 --- a/src/CommandOutputRecordSchemaProperties.ts +++ b/src/CommandOutputRecordSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface CommandOutputRecordSchemaProperties extends Internal.OutputRecordSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/DirectoryProperties.ts b/src/DirectoryProperties.ts index c1ff8a6..61887ea 100644 --- a/src/DirectoryProperties.ts +++ b/src/DirectoryProperties.ts @@ -53,7 +53,7 @@ import * as Internal from './util/Internal' export interface DirectoryProperties { extensionFields?: Internal.Dictionary - + /** * Must be `Directory` to indicate this object describes a Directory. */ diff --git a/src/DirentProperties.ts b/src/DirentProperties.ts index 877fc47..788c95f 100644 --- a/src/DirentProperties.ts +++ b/src/DirentProperties.ts @@ -18,7 +18,7 @@ import * as Internal from './util/Internal' export interface DirentProperties { extensionFields?: Internal.Dictionary - + /** * The "target" name of the file or subdirectory. If `entry` is * a File or Directory, the `entryname` field overrides the value diff --git a/src/DockerRequirementProperties.ts b/src/DockerRequirementProperties.ts index 90564cf..776162a 100644 --- a/src/DockerRequirementProperties.ts +++ b/src/DockerRequirementProperties.ts @@ -61,7 +61,7 @@ import * as Internal from './util/Internal' export interface DockerRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'DockerRequirement' */ diff --git a/src/EnumSchemaProperties.ts b/src/EnumSchemaProperties.ts index b33296f..7669154 100644 --- a/src/EnumSchemaProperties.ts +++ b/src/EnumSchemaProperties.ts @@ -11,7 +11,7 @@ import * as Internal from './util/Internal' export interface EnumSchemaProperties { extensionFields?: Internal.Dictionary - + /** * Defines the set of valid symbols. */ diff --git a/src/EnvVarRequirementProperties.ts b/src/EnvVarRequirementProperties.ts index 0fa02e9..4690e40 100644 --- a/src/EnvVarRequirementProperties.ts +++ b/src/EnvVarRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface EnvVarRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'EnvVarRequirement' */ diff --git a/src/EnvironmentDefProperties.ts b/src/EnvironmentDefProperties.ts index 4cb94c6..5a25f05 100644 --- a/src/EnvironmentDefProperties.ts +++ b/src/EnvironmentDefProperties.ts @@ -13,7 +13,7 @@ import * as Internal from './util/Internal' export interface EnvironmentDefProperties { extensionFields?: Internal.Dictionary - + /** * The environment variable name */ diff --git a/src/ExpressionToolOutputParameterProperties.ts b/src/ExpressionToolOutputParameterProperties.ts index 98dbc0d..ceb0166 100644 --- a/src/ExpressionToolOutputParameterProperties.ts +++ b/src/ExpressionToolOutputParameterProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface ExpressionToolOutputParameterProperties extends Internal.OutputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/ExpressionToolProperties.ts b/src/ExpressionToolProperties.ts index e8396ab..eac0ec8 100644 --- a/src/ExpressionToolProperties.ts +++ b/src/ExpressionToolProperties.ts @@ -17,7 +17,7 @@ import * as Internal from './util/Internal' export interface ExpressionToolProperties extends Internal.ProcessProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/FileProperties.ts b/src/FileProperties.ts index c950465..eef7ecf 100644 --- a/src/FileProperties.ts +++ b/src/FileProperties.ts @@ -76,7 +76,7 @@ import * as Internal from './util/Internal' export interface FileProperties { extensionFields?: Internal.Dictionary - + /** * Must be `File` to indicate this object describes a file. */ diff --git a/src/InitialWorkDirRequirementProperties.ts b/src/InitialWorkDirRequirementProperties.ts index cd90937..47a104d 100644 --- a/src/InitialWorkDirRequirementProperties.ts +++ b/src/InitialWorkDirRequirementProperties.ts @@ -11,7 +11,7 @@ import * as Internal from './util/Internal' export interface InitialWorkDirRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * InitialWorkDirRequirement */ diff --git a/src/InlineJavascriptRequirementProperties.ts b/src/InlineJavascriptRequirementProperties.ts index d5b5c60..30536f8 100644 --- a/src/InlineJavascriptRequirementProperties.ts +++ b/src/InlineJavascriptRequirementProperties.ts @@ -13,7 +13,7 @@ import * as Internal from './util/Internal' export interface InlineJavascriptRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'InlineJavascriptRequirement' */ diff --git a/src/InplaceUpdateRequirementProperties.ts b/src/InplaceUpdateRequirementProperties.ts index 5582910..a802294 100644 --- a/src/InplaceUpdateRequirementProperties.ts +++ b/src/InplaceUpdateRequirementProperties.ts @@ -40,7 +40,7 @@ import * as Internal from './util/Internal' export interface InplaceUpdateRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'InplaceUpdateRequirement' */ diff --git a/src/InputArraySchemaProperties.ts b/src/InputArraySchemaProperties.ts index 5d74e61..49ebd66 100644 --- a/src/InputArraySchemaProperties.ts +++ b/src/InputArraySchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface InputArraySchemaProperties extends Internal.ArraySchemaProperties, Internal.InputSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/InputBindingProperties.ts b/src/InputBindingProperties.ts index db7c292..ae5ed07 100644 --- a/src/InputBindingProperties.ts +++ b/src/InputBindingProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface InputBindingProperties { extensionFields?: Internal.Dictionary - + /** * Use of `loadContents` in `InputBinding` is deprecated. * Preserved for v1.0 backwards compatability. Will be removed in diff --git a/src/InputEnumSchemaProperties.ts b/src/InputEnumSchemaProperties.ts index c37d67f..c31e853 100644 --- a/src/InputEnumSchemaProperties.ts +++ b/src/InputEnumSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface InputEnumSchemaProperties extends Internal.EnumSchemaProperties, Internal.InputSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/InputRecordFieldProperties.ts b/src/InputRecordFieldProperties.ts index 27e5f4b..e518d03 100644 --- a/src/InputRecordFieldProperties.ts +++ b/src/InputRecordFieldProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface InputRecordFieldProperties extends Internal.RecordFieldProperties, Internal.FieldBaseProperties, Internal.InputFormatProperties, Internal.LoadContentsProperties { extensionFields?: Internal.Dictionary - + /** * The name of the field * diff --git a/src/InputRecordSchemaProperties.ts b/src/InputRecordSchemaProperties.ts index bd4fb29..ab76a8f 100644 --- a/src/InputRecordSchemaProperties.ts +++ b/src/InputRecordSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface InputRecordSchemaProperties extends Internal.RecordSchemaProperties, Internal.InputSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/LoadListingRequirementProperties.ts b/src/LoadListingRequirementProperties.ts index f30c54b..da6b41a 100644 --- a/src/LoadListingRequirementProperties.ts +++ b/src/LoadListingRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface LoadListingRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'LoadListingRequirement' */ diff --git a/src/MultipleInputFeatureRequirementProperties.ts b/src/MultipleInputFeatureRequirementProperties.ts index b228b36..5ddc6a4 100644 --- a/src/MultipleInputFeatureRequirementProperties.ts +++ b/src/MultipleInputFeatureRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface MultipleInputFeatureRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'MultipleInputFeatureRequirement' */ diff --git a/src/NetworkAccessProperties.ts b/src/NetworkAccessProperties.ts index e1f3082..5dfa84d 100644 --- a/src/NetworkAccessProperties.ts +++ b/src/NetworkAccessProperties.ts @@ -25,7 +25,7 @@ import * as Internal from './util/Internal' export interface NetworkAccessProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'NetworkAccess' */ diff --git a/src/OperationInputParameterProperties.ts b/src/OperationInputParameterProperties.ts index e5d21e7..6474dfc 100644 --- a/src/OperationInputParameterProperties.ts +++ b/src/OperationInputParameterProperties.ts @@ -11,7 +11,7 @@ import * as Internal from './util/Internal' export interface OperationInputParameterProperties extends Internal.InputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/OperationOutputParameterProperties.ts b/src/OperationOutputParameterProperties.ts index fc9a9f5..86fc3af 100644 --- a/src/OperationOutputParameterProperties.ts +++ b/src/OperationOutputParameterProperties.ts @@ -11,7 +11,7 @@ import * as Internal from './util/Internal' export interface OperationOutputParameterProperties extends Internal.OutputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/OperationProperties.ts b/src/OperationProperties.ts index fbf9ff4..cc81f22 100644 --- a/src/OperationProperties.ts +++ b/src/OperationProperties.ts @@ -17,7 +17,7 @@ import * as Internal from './util/Internal' export interface OperationProperties extends Internal.ProcessProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/OutputArraySchemaProperties.ts b/src/OutputArraySchemaProperties.ts index 4debf9f..f348110 100644 --- a/src/OutputArraySchemaProperties.ts +++ b/src/OutputArraySchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface OutputArraySchemaProperties extends Internal.ArraySchemaProperties, Internal.OutputSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/OutputEnumSchemaProperties.ts b/src/OutputEnumSchemaProperties.ts index e064f82..1d07165 100644 --- a/src/OutputEnumSchemaProperties.ts +++ b/src/OutputEnumSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface OutputEnumSchemaProperties extends Internal.EnumSchemaProperties, Internal.OutputSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/OutputRecordFieldProperties.ts b/src/OutputRecordFieldProperties.ts index f5d2f16..82d8a3a 100644 --- a/src/OutputRecordFieldProperties.ts +++ b/src/OutputRecordFieldProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface OutputRecordFieldProperties extends Internal.RecordFieldProperties, Internal.FieldBaseProperties, Internal.OutputFormatProperties { extensionFields?: Internal.Dictionary - + /** * The name of the field * diff --git a/src/OutputRecordSchemaProperties.ts b/src/OutputRecordSchemaProperties.ts index f3907cf..50fde87 100644 --- a/src/OutputRecordSchemaProperties.ts +++ b/src/OutputRecordSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface OutputRecordSchemaProperties extends Internal.RecordSchemaProperties, Internal.OutputSchemaProperties { extensionFields?: Internal.Dictionary - + /** * The identifier for this type */ diff --git a/src/RecordFieldProperties.ts b/src/RecordFieldProperties.ts index 38d5f6b..d03be01 100644 --- a/src/RecordFieldProperties.ts +++ b/src/RecordFieldProperties.ts @@ -10,7 +10,7 @@ import * as Internal from './util/Internal' export interface RecordFieldProperties extends Internal.DocumentedProperties { extensionFields?: Internal.Dictionary - + /** * The name of the field * diff --git a/src/RecordSchemaProperties.ts b/src/RecordSchemaProperties.ts index c0bfe8f..89f9083 100644 --- a/src/RecordSchemaProperties.ts +++ b/src/RecordSchemaProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface RecordSchemaProperties { extensionFields?: Internal.Dictionary - + /** * Defines the fields of the record. */ diff --git a/src/ResourceRequirementProperties.ts b/src/ResourceRequirementProperties.ts index c80d3a5..b81bf81 100644 --- a/src/ResourceRequirementProperties.ts +++ b/src/ResourceRequirementProperties.ts @@ -35,7 +35,7 @@ import * as Internal from './util/Internal' export interface ResourceRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'ResourceRequirement' */ diff --git a/src/ScatterFeatureRequirementProperties.ts b/src/ScatterFeatureRequirementProperties.ts index 75214ef..019138f 100644 --- a/src/ScatterFeatureRequirementProperties.ts +++ b/src/ScatterFeatureRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface ScatterFeatureRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'ScatterFeatureRequirement' */ diff --git a/src/SchemaDefRequirementProperties.ts b/src/SchemaDefRequirementProperties.ts index b4a4da1..9f65221 100644 --- a/src/SchemaDefRequirementProperties.ts +++ b/src/SchemaDefRequirementProperties.ts @@ -22,7 +22,7 @@ import * as Internal from './util/Internal' export interface SchemaDefRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'SchemaDefRequirement' */ diff --git a/src/SecondaryFileSchemaProperties.ts b/src/SecondaryFileSchemaProperties.ts index 52db003..e67bd85 100644 --- a/src/SecondaryFileSchemaProperties.ts +++ b/src/SecondaryFileSchemaProperties.ts @@ -23,7 +23,7 @@ import * as Internal from './util/Internal' export interface SecondaryFileSchemaProperties { extensionFields?: Internal.Dictionary - + /** * Provides a pattern or expression specifying files or directories that * should be included alongside the primary file. diff --git a/src/ShellCommandRequirementProperties.ts b/src/ShellCommandRequirementProperties.ts index 1d96e65..7161849 100644 --- a/src/ShellCommandRequirementProperties.ts +++ b/src/ShellCommandRequirementProperties.ts @@ -17,7 +17,7 @@ import * as Internal from './util/Internal' export interface ShellCommandRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'ShellCommandRequirement' */ diff --git a/src/SoftwarePackageProperties.ts b/src/SoftwarePackageProperties.ts index bd28731..2d25834 100644 --- a/src/SoftwarePackageProperties.ts +++ b/src/SoftwarePackageProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface SoftwarePackageProperties { extensionFields?: Internal.Dictionary - + /** * The name of the software to be made available. If the name is * common, inconsistent, or otherwise ambiguous it should be combined with diff --git a/src/SoftwareRequirementProperties.ts b/src/SoftwareRequirementProperties.ts index 367031b..35db49b 100644 --- a/src/SoftwareRequirementProperties.ts +++ b/src/SoftwareRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface SoftwareRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'SoftwareRequirement' */ diff --git a/src/StepInputExpressionRequirementProperties.ts b/src/StepInputExpressionRequirementProperties.ts index 4622614..8bc41cd 100644 --- a/src/StepInputExpressionRequirementProperties.ts +++ b/src/StepInputExpressionRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface StepInputExpressionRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'StepInputExpressionRequirement' */ diff --git a/src/SubworkflowFeatureRequirementProperties.ts b/src/SubworkflowFeatureRequirementProperties.ts index cb68241..6d1f7da 100644 --- a/src/SubworkflowFeatureRequirementProperties.ts +++ b/src/SubworkflowFeatureRequirementProperties.ts @@ -12,7 +12,7 @@ import * as Internal from './util/Internal' export interface SubworkflowFeatureRequirementProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'SubworkflowFeatureRequirement' */ diff --git a/src/ToolTimeLimitProperties.ts b/src/ToolTimeLimitProperties.ts index 6ec0889..10e4ed2 100644 --- a/src/ToolTimeLimitProperties.ts +++ b/src/ToolTimeLimitProperties.ts @@ -17,7 +17,7 @@ import * as Internal from './util/Internal' export interface ToolTimeLimitProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'ToolTimeLimit' */ diff --git a/src/WorkReuseProperties.ts b/src/WorkReuseProperties.ts index e32b03a..cfc3a42 100644 --- a/src/WorkReuseProperties.ts +++ b/src/WorkReuseProperties.ts @@ -19,7 +19,7 @@ import * as Internal from './util/Internal' export interface WorkReuseProperties extends Internal.ProcessRequirementProperties { extensionFields?: Internal.Dictionary - + /** * Always 'WorkReuse' */ diff --git a/src/WorkflowInputParameterProperties.ts b/src/WorkflowInputParameterProperties.ts index 76b769b..0c8467e 100644 --- a/src/WorkflowInputParameterProperties.ts +++ b/src/WorkflowInputParameterProperties.ts @@ -8,7 +8,7 @@ import * as Internal from './util/Internal' export interface WorkflowInputParameterProperties extends Internal.InputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/WorkflowOutputParameterProperties.ts b/src/WorkflowOutputParameterProperties.ts index 92b79b9..b78825b 100644 --- a/src/WorkflowOutputParameterProperties.ts +++ b/src/WorkflowOutputParameterProperties.ts @@ -17,7 +17,7 @@ import * as Internal from './util/Internal' export interface WorkflowOutputParameterProperties extends Internal.OutputParameterProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/WorkflowProperties.ts b/src/WorkflowProperties.ts index 957f227..a0eb3ee 100644 --- a/src/WorkflowProperties.ts +++ b/src/WorkflowProperties.ts @@ -61,7 +61,7 @@ import * as Internal from './util/Internal' export interface WorkflowProperties extends Internal.ProcessProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/WorkflowStepInputProperties.ts b/src/WorkflowStepInputProperties.ts index 44ef342..3dd7d7b 100644 --- a/src/WorkflowStepInputProperties.ts +++ b/src/WorkflowStepInputProperties.ts @@ -118,7 +118,7 @@ import * as Internal from './util/Internal' export interface WorkflowStepInputProperties extends Internal.IdentifiedProperties, Internal.SinkProperties, Internal.LoadContentsProperties, Internal.LabeledProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/WorkflowStepOutputProperties.ts b/src/WorkflowStepOutputProperties.ts index b7065e2..888e747 100644 --- a/src/WorkflowStepOutputProperties.ts +++ b/src/WorkflowStepOutputProperties.ts @@ -18,7 +18,7 @@ import * as Internal from './util/Internal' export interface WorkflowStepOutputProperties extends Internal.IdentifiedProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/WorkflowStepProperties.ts b/src/WorkflowStepProperties.ts index f7b931a..1d8810d 100644 --- a/src/WorkflowStepProperties.ts +++ b/src/WorkflowStepProperties.ts @@ -89,7 +89,7 @@ import * as Internal from './util/Internal' export interface WorkflowStepProperties extends Internal.IdentifiedProperties, Internal.LabeledProperties, Internal.DocumentedProperties { extensionFields?: Internal.Dictionary - + /** * The unique identifier for this object. */ diff --git a/src/index.ts b/src/index.ts index 28e5f8d..5ec59bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,181 +1,181 @@ export { loadDocument, loadDocumentByString, - ResourceRequirement, - InputArraySchema, - DockerRequirement_class, - Workflow, - ExpressionToolOutputParameterProperties, - RecordFieldProperties, - Any, - CommandLineBinding, - CommandLineBindingProperties, - DockerRequirementProperties, - DocumentedProperties, - OutputArraySchema, - NetworkAccess_class, - WorkReuse, + ToolTimeLimit_class, WorkReuse_class, - WorkflowStepOutput, - DirectoryProperties, - ScatterFeatureRequirementProperties, - CommandOutputRecordSchemaProperties, - DockerRequirement, - InlineJavascriptRequirement, - InitialWorkDirRequirementProperties, - LabeledProperties, - InputSchemaProperties, - SoftwareRequirementProperties, + NetworkAccessProperties, + RecordFieldProperties, + EnumSchema, + CommandInputArraySchemaProperties, + CWLVersion, + SoftwareRequirement, + SubworkflowFeatureRequirementProperties, InputArraySchemaProperties, - CommandOutputRecordFieldProperties, - File_class, - ProcessRequirementProperties, - Operation, - ScatterFeatureRequirement, + OperationInputParameter, stdin, - EnumSchema, + WorkflowStepInput, + CommandOutputParameterProperties, CommandInputSchemaProperties, - OperationProperties, - SubworkflowFeatureRequirement, - MultipleInputFeatureRequirement, - ShellCommandRequirement_class, - IOSchemaProperties, - CommandInputRecordField, - ParameterProperties, + DockerRequirementProperties, File, - CommandOutputParameter, - enum_d961d79c225752b9fadb617367615ab176b47d77, + ExpressionToolOutputParameterProperties, + CommandLineToolProperties, + Workflow_class, + InlineJavascriptRequirementProperties, + InputEnumSchemaProperties, + FileProperties, + ResourceRequirement_class, + InputArraySchema, + SinkProperties, + InplaceUpdateRequirement_class, + CommandInputRecordSchemaProperties, + InitialWorkDirRequirement, + OperationInputParameterProperties, + CommandLineBindable, + CommandInputArraySchema, + ScatterMethod, + LoadContentsProperties, OutputArraySchemaProperties, - StepInputExpressionRequirement_class, - CommandInputParameter, - EnvironmentDefProperties, - enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, - InputBinding, - ExpressionToolOutputParameter, - ScatterFeatureRequirement_class, SoftwarePackage, - OperationInputParameter, - OutputRecordField, - SchemaDefRequirementProperties, - Dirent, - NetworkAccessProperties, - CommandOutputArraySchemaProperties, - WorkflowOutputParameter, - WorkflowStepInput, - FieldBaseProperties, - CommandInputRecordFieldProperties, - ScatterMethod, - ToolTimeLimit, + LinkMergeMethod, + enum_d9cba076fca539106791a4f46d198c7fcfbdb779, + ShellCommandRequirement, + SecondaryFileSchema, + IOSchemaProperties, + WorkflowStepOutputProperties, + PickValueMethod, + CommandLineBinding, WorkflowStepInputProperties, InputRecordSchemaProperties, - InputParameterProperties, - CommandLineBindable, + InplaceUpdateRequirementProperties, + ResourceRequirement, + MultipleInputFeatureRequirementProperties, + CommandLineTool_class, SchemaDefRequirement, - InputEnumSchema, - OutputRecordSchema, - CommandOutputBinding, - CommandInputRecordSchema, - RecordSchema, - OutputSchemaProperties, - CommandInputEnumSchema, - LoadContentsProperties, + LoadListingRequirement_class, + stderr, + SoftwareRequirement_class, + WorkReuse, + OutputFormatProperties, + LabeledProperties, + CommandLineBindableProperties, + InputParameterProperties, + CommandInputRecordField, + ArraySchemaProperties, + CommandOutputRecordSchemaProperties, + InputFormatProperties, + DocumentedProperties, + OperationOutputParameter, + ExpressionToolOutputParameter, DirentProperties, - OutputRecordSchemaProperties, - LoadListingEnum, - CommandOutputRecordField, - EnvVarRequirement, - InplaceUpdateRequirementProperties, - FileProperties, - InlineJavascriptRequirementProperties, - CommandInputParameterProperties, - InputRecordField, - CWLVersion, + ProcessRequirementProperties, + CommandLineTool, + NetworkAccess, + InplaceUpdateRequirement, CommandOutputRecordSchema, ResourceRequirementProperties, - OutputParameterProperties, - Directory, - CWLType, - WorkflowStep, - stdout, - CommandOutputParameterProperties, - ArraySchema, - InputFormatProperties, - OutputEnumSchemaProperties, - EnumSchemaProperties, - RecordSchemaProperties, - ExpressionTool_class, - WorkflowInputParameterProperties, - StepInputExpressionRequirementProperties, - ExpressionTool, IdentifiedProperties, - InputRecordFieldProperties, - InitialWorkDirRequirement, - CommandOutputBindingProperties, - WorkflowProperties, - CommandOutputEnumSchema, - SubworkflowFeatureRequirement_class, - NetworkAccess, - enum_d9cba076fca539106791a4f46d198c7fcfbdb779, - CommandLineTool_class, - SoftwareRequirement_class, + CommandOutputArraySchemaProperties, + ScatterFeatureRequirement_class, + ParameterProperties, + WorkflowStepProperties, SoftwarePackageProperties, + WorkflowProperties, + OutputSchemaProperties, OutputEnumSchema, - CommandInputRecordSchemaProperties, - WorkflowOutputParameterProperties, - LoadListingRequirementProperties, - CommandInputEnumSchemaProperties, - LinkMergeMethod, - OperationOutputParameterProperties, - CommandInputArraySchemaProperties, - SoftwareRequirement, + File_class, Directory_class, - ArraySchemaProperties, + ShellCommandRequirement_class, + CommandOutputEnumSchema, + ProcessProperties, + CommandInputRecordSchema, + CWLType, + ExpressionToolProperties, + OutputParameterProperties, + OutputArraySchema, + Operation_class, + InputRecordSchema, + Any, + PrimitiveType, + Directory, + RecordSchemaProperties, + SecondaryFileSchemaProperties, + SoftwareRequirementProperties, + EnumSchemaProperties, + InlineJavascriptRequirement, + WorkflowStep, + EnvironmentDefProperties, + LoadListingRequirement, + CommandOutputRecordField, + MultipleInputFeatureRequirement, + SubworkflowFeatureRequirement_class, + DirectoryProperties, + CommandInputEnumSchema, + WorkflowStepOutput, + InputBindingProperties, + InputRecordFieldProperties, + InputBinding, + CommandInputParameterProperties, + OutputRecordSchemaProperties, + ToolTimeLimit, ToolTimeLimitProperties, - InputEnumSchemaProperties, + LoadListingRequirementProperties, + Operation, WorkflowInputParameter, - RecordField, MultipleInputFeatureRequirement_class, - SinkProperties, - WorkflowStepOutputProperties, - SecondaryFileSchema, - ToolTimeLimit_class, - ShellCommandRequirement, - CommandInputArraySchema, - ResourceRequirement_class, - MultipleInputFeatureRequirementProperties, - InplaceUpdateRequirement_class, - stderr, - CommandLineTool, - InitialWorkDirRequirement_class, - ExpressionToolProperties, - SchemaDefRequirement_class, - CommandOutputEnumSchemaProperties, - OutputRecordFieldProperties, - InplaceUpdateRequirement, - PrimitiveType, - OperationOutputParameter, + SubworkflowFeatureRequirement, + OperationProperties, + CommandInputRecordFieldProperties, + Workflow, + StepInputExpressionRequirementProperties, + CommandInputParameter, + WorkflowInputParameterProperties, + EnvVarRequirementProperties, + CommandOutputBindingProperties, InlineJavascriptRequirement_class, - InputBindingProperties, + OutputRecordFieldProperties, + InputEnumSchema, + DockerRequirement, + DockerRequirement_class, + ArraySchema, + StepInputExpressionRequirement_class, + stdout, + enum_d961d79c225752b9fadb617367615ab176b47d77, + enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, + OutputRecordSchema, + LoadListingEnum, + OutputEnumSchemaProperties, + CommandOutputArraySchema, EnvVarRequirement_class, - CommandLineToolProperties, - OperationInputParameterProperties, - StepInputExpressionRequirement, - PickValueMethod, - EnvVarRequirementProperties, + NetworkAccess_class, + ScatterFeatureRequirementProperties, + SchemaDefRequirementProperties, + EnvVarRequirement, WorkReuseProperties, - LoadListingRequirement_class, - EnvironmentDef, - CommandOutputArraySchema, + RecordSchema, + CommandLineBindingProperties, + OperationOutputParameterProperties, + CommandInputEnumSchemaProperties, + ScatterFeatureRequirement, + CommandOutputParameter, + Dirent, + OutputRecordField, + WorkflowOutputParameter, + FieldBaseProperties, + InitialWorkDirRequirementProperties, + InputRecordField, + CommandOutputRecordFieldProperties, + SchemaDefRequirement_class, + StepInputExpressionRequirement, ShellCommandRequirementProperties, - SubworkflowFeatureRequirementProperties, - CommandLineBindableProperties, + ExpressionTool, + WorkflowOutputParameterProperties, + CommandOutputEnumSchemaProperties, + ExpressionTool_class, + RecordField, Expression, - Operation_class, - WorkflowStepProperties, - OutputFormatProperties, - InputRecordSchema, - SecondaryFileSchemaProperties, - Workflow_class, - LoadListingRequirement, - ProcessProperties + CommandOutputBinding, + InitialWorkDirRequirement_class, + InputSchemaProperties, + EnvironmentDef } from './util/Internal' \ No newline at end of file diff --git a/src/util/Internal.ts b/src/util/Internal.ts index e51e756..eead71c 100644 --- a/src/util/Internal.ts +++ b/src/util/Internal.ts @@ -19,181 +19,181 @@ export * from './loaders/UnionLoader' export * from './loaders/UriLoader' export * from './ValidationException' export * from './Vocabs' -export * from '../ResourceRequirement' -export * from '../InputArraySchema' -export * from '../DockerRequirement_class' -export * from '../Workflow' -export * from '../ExpressionToolOutputParameterProperties' -export * from '../RecordFieldProperties' -export * from '../Any' -export * from '../CommandLineBinding' -export * from '../CommandLineBindingProperties' -export * from '../DockerRequirementProperties' -export * from '../DocumentedProperties' -export * from '../OutputArraySchema' -export * from '../NetworkAccess_class' -export * from '../WorkReuse' +export * from '../ToolTimeLimit_class' export * from '../WorkReuse_class' -export * from '../WorkflowStepOutput' -export * from '../DirectoryProperties' -export * from '../ScatterFeatureRequirementProperties' -export * from '../CommandOutputRecordSchemaProperties' -export * from '../DockerRequirement' -export * from '../InlineJavascriptRequirement' -export * from '../InitialWorkDirRequirementProperties' -export * from '../LabeledProperties' -export * from '../InputSchemaProperties' -export * from '../SoftwareRequirementProperties' +export * from '../NetworkAccessProperties' +export * from '../RecordFieldProperties' +export * from '../EnumSchema' +export * from '../CommandInputArraySchemaProperties' +export * from '../CWLVersion' +export * from '../SoftwareRequirement' +export * from '../SubworkflowFeatureRequirementProperties' export * from '../InputArraySchemaProperties' -export * from '../CommandOutputRecordFieldProperties' -export * from '../File_class' -export * from '../ProcessRequirementProperties' -export * from '../Operation' -export * from '../ScatterFeatureRequirement' +export * from '../OperationInputParameter' export * from '../stdin' -export * from '../EnumSchema' +export * from '../WorkflowStepInput' +export * from '../CommandOutputParameterProperties' export * from '../CommandInputSchemaProperties' -export * from '../OperationProperties' -export * from '../SubworkflowFeatureRequirement' -export * from '../MultipleInputFeatureRequirement' -export * from '../ShellCommandRequirement_class' -export * from '../IOSchemaProperties' -export * from '../CommandInputRecordField' -export * from '../ParameterProperties' +export * from '../DockerRequirementProperties' export * from '../File' -export * from '../CommandOutputParameter' -export * from '../enum_d961d79c225752b9fadb617367615ab176b47d77' +export * from '../ExpressionToolOutputParameterProperties' +export * from '../CommandLineToolProperties' +export * from '../Workflow_class' +export * from '../InlineJavascriptRequirementProperties' +export * from '../InputEnumSchemaProperties' +export * from '../FileProperties' +export * from '../ResourceRequirement_class' +export * from '../InputArraySchema' +export * from '../SinkProperties' +export * from '../InplaceUpdateRequirement_class' +export * from '../CommandInputRecordSchemaProperties' +export * from '../InitialWorkDirRequirement' +export * from '../OperationInputParameterProperties' +export * from '../CommandLineBindable' +export * from '../CommandInputArraySchema' +export * from '../ScatterMethod' +export * from '../LoadContentsProperties' export * from '../OutputArraySchemaProperties' -export * from '../StepInputExpressionRequirement_class' -export * from '../CommandInputParameter' -export * from '../EnvironmentDefProperties' -export * from '../enum_d062602be0b4b8fd33e69e29a841317b6ab665bc' -export * from '../InputBinding' -export * from '../ExpressionToolOutputParameter' -export * from '../ScatterFeatureRequirement_class' export * from '../SoftwarePackage' -export * from '../OperationInputParameter' -export * from '../OutputRecordField' -export * from '../SchemaDefRequirementProperties' -export * from '../Dirent' -export * from '../NetworkAccessProperties' -export * from '../CommandOutputArraySchemaProperties' -export * from '../WorkflowOutputParameter' -export * from '../WorkflowStepInput' -export * from '../FieldBaseProperties' -export * from '../CommandInputRecordFieldProperties' -export * from '../ScatterMethod' -export * from '../ToolTimeLimit' +export * from '../LinkMergeMethod' +export * from '../enum_d9cba076fca539106791a4f46d198c7fcfbdb779' +export * from '../ShellCommandRequirement' +export * from '../SecondaryFileSchema' +export * from '../IOSchemaProperties' +export * from '../WorkflowStepOutputProperties' +export * from '../PickValueMethod' +export * from '../CommandLineBinding' export * from '../WorkflowStepInputProperties' export * from '../InputRecordSchemaProperties' -export * from '../InputParameterProperties' -export * from '../CommandLineBindable' +export * from '../InplaceUpdateRequirementProperties' +export * from '../ResourceRequirement' +export * from '../MultipleInputFeatureRequirementProperties' +export * from '../CommandLineTool_class' export * from '../SchemaDefRequirement' -export * from '../InputEnumSchema' -export * from '../OutputRecordSchema' -export * from '../CommandOutputBinding' -export * from '../CommandInputRecordSchema' -export * from '../RecordSchema' -export * from '../OutputSchemaProperties' -export * from '../CommandInputEnumSchema' -export * from '../LoadContentsProperties' +export * from '../LoadListingRequirement_class' +export * from '../stderr' +export * from '../SoftwareRequirement_class' +export * from '../WorkReuse' +export * from '../OutputFormatProperties' +export * from '../LabeledProperties' +export * from '../CommandLineBindableProperties' +export * from '../InputParameterProperties' +export * from '../CommandInputRecordField' +export * from '../ArraySchemaProperties' +export * from '../CommandOutputRecordSchemaProperties' +export * from '../InputFormatProperties' +export * from '../DocumentedProperties' +export * from '../OperationOutputParameter' +export * from '../ExpressionToolOutputParameter' export * from '../DirentProperties' -export * from '../OutputRecordSchemaProperties' -export * from '../LoadListingEnum' -export * from '../CommandOutputRecordField' -export * from '../EnvVarRequirement' -export * from '../InplaceUpdateRequirementProperties' -export * from '../FileProperties' -export * from '../InlineJavascriptRequirementProperties' -export * from '../CommandInputParameterProperties' -export * from '../InputRecordField' -export * from '../CWLVersion' +export * from '../ProcessRequirementProperties' +export * from '../CommandLineTool' +export * from '../NetworkAccess' +export * from '../InplaceUpdateRequirement' export * from '../CommandOutputRecordSchema' export * from '../ResourceRequirementProperties' -export * from '../OutputParameterProperties' -export * from '../Directory' -export * from '../CWLType' -export * from '../WorkflowStep' -export * from '../stdout' -export * from '../CommandOutputParameterProperties' -export * from '../ArraySchema' -export * from '../InputFormatProperties' -export * from '../OutputEnumSchemaProperties' -export * from '../EnumSchemaProperties' -export * from '../RecordSchemaProperties' -export * from '../ExpressionTool_class' -export * from '../WorkflowInputParameterProperties' -export * from '../StepInputExpressionRequirementProperties' -export * from '../ExpressionTool' export * from '../IdentifiedProperties' -export * from '../InputRecordFieldProperties' -export * from '../InitialWorkDirRequirement' -export * from '../CommandOutputBindingProperties' -export * from '../WorkflowProperties' -export * from '../CommandOutputEnumSchema' -export * from '../SubworkflowFeatureRequirement_class' -export * from '../NetworkAccess' -export * from '../enum_d9cba076fca539106791a4f46d198c7fcfbdb779' -export * from '../CommandLineTool_class' -export * from '../SoftwareRequirement_class' +export * from '../CommandOutputArraySchemaProperties' +export * from '../ScatterFeatureRequirement_class' +export * from '../ParameterProperties' +export * from '../WorkflowStepProperties' export * from '../SoftwarePackageProperties' +export * from '../WorkflowProperties' +export * from '../OutputSchemaProperties' export * from '../OutputEnumSchema' -export * from '../CommandInputRecordSchemaProperties' -export * from '../WorkflowOutputParameterProperties' -export * from '../LoadListingRequirementProperties' -export * from '../CommandInputEnumSchemaProperties' -export * from '../LinkMergeMethod' -export * from '../OperationOutputParameterProperties' -export * from '../CommandInputArraySchemaProperties' -export * from '../SoftwareRequirement' +export * from '../File_class' export * from '../Directory_class' -export * from '../ArraySchemaProperties' +export * from '../ShellCommandRequirement_class' +export * from '../CommandOutputEnumSchema' +export * from '../ProcessProperties' +export * from '../CommandInputRecordSchema' +export * from '../CWLType' +export * from '../ExpressionToolProperties' +export * from '../OutputParameterProperties' +export * from '../OutputArraySchema' +export * from '../Operation_class' +export * from '../InputRecordSchema' +export * from '../Any' +export * from '../PrimitiveType' +export * from '../Directory' +export * from '../RecordSchemaProperties' +export * from '../SecondaryFileSchemaProperties' +export * from '../SoftwareRequirementProperties' +export * from '../EnumSchemaProperties' +export * from '../InlineJavascriptRequirement' +export * from '../WorkflowStep' +export * from '../EnvironmentDefProperties' +export * from '../LoadListingRequirement' +export * from '../CommandOutputRecordField' +export * from '../MultipleInputFeatureRequirement' +export * from '../SubworkflowFeatureRequirement_class' +export * from '../DirectoryProperties' +export * from '../CommandInputEnumSchema' +export * from '../WorkflowStepOutput' +export * from '../InputBindingProperties' +export * from '../InputRecordFieldProperties' +export * from '../InputBinding' +export * from '../CommandInputParameterProperties' +export * from '../OutputRecordSchemaProperties' +export * from '../ToolTimeLimit' export * from '../ToolTimeLimitProperties' -export * from '../InputEnumSchemaProperties' +export * from '../LoadListingRequirementProperties' +export * from '../Operation' export * from '../WorkflowInputParameter' -export * from '../RecordField' export * from '../MultipleInputFeatureRequirement_class' -export * from '../SinkProperties' -export * from '../WorkflowStepOutputProperties' -export * from '../SecondaryFileSchema' -export * from '../ToolTimeLimit_class' -export * from '../ShellCommandRequirement' -export * from '../CommandInputArraySchema' -export * from '../ResourceRequirement_class' -export * from '../MultipleInputFeatureRequirementProperties' -export * from '../InplaceUpdateRequirement_class' -export * from '../stderr' -export * from '../CommandLineTool' -export * from '../InitialWorkDirRequirement_class' -export * from '../ExpressionToolProperties' -export * from '../SchemaDefRequirement_class' -export * from '../CommandOutputEnumSchemaProperties' -export * from '../OutputRecordFieldProperties' -export * from '../InplaceUpdateRequirement' -export * from '../PrimitiveType' -export * from '../OperationOutputParameter' +export * from '../SubworkflowFeatureRequirement' +export * from '../OperationProperties' +export * from '../CommandInputRecordFieldProperties' +export * from '../Workflow' +export * from '../StepInputExpressionRequirementProperties' +export * from '../CommandInputParameter' +export * from '../WorkflowInputParameterProperties' +export * from '../EnvVarRequirementProperties' +export * from '../CommandOutputBindingProperties' export * from '../InlineJavascriptRequirement_class' -export * from '../InputBindingProperties' +export * from '../OutputRecordFieldProperties' +export * from '../InputEnumSchema' +export * from '../DockerRequirement' +export * from '../DockerRequirement_class' +export * from '../ArraySchema' +export * from '../StepInputExpressionRequirement_class' +export * from '../stdout' +export * from '../enum_d961d79c225752b9fadb617367615ab176b47d77' +export * from '../enum_d062602be0b4b8fd33e69e29a841317b6ab665bc' +export * from '../OutputRecordSchema' +export * from '../LoadListingEnum' +export * from '../OutputEnumSchemaProperties' +export * from '../CommandOutputArraySchema' export * from '../EnvVarRequirement_class' -export * from '../CommandLineToolProperties' -export * from '../OperationInputParameterProperties' -export * from '../StepInputExpressionRequirement' -export * from '../PickValueMethod' -export * from '../EnvVarRequirementProperties' +export * from '../NetworkAccess_class' +export * from '../ScatterFeatureRequirementProperties' +export * from '../SchemaDefRequirementProperties' +export * from '../EnvVarRequirement' export * from '../WorkReuseProperties' -export * from '../LoadListingRequirement_class' -export * from '../EnvironmentDef' -export * from '../CommandOutputArraySchema' +export * from '../RecordSchema' +export * from '../CommandLineBindingProperties' +export * from '../OperationOutputParameterProperties' +export * from '../CommandInputEnumSchemaProperties' +export * from '../ScatterFeatureRequirement' +export * from '../CommandOutputParameter' +export * from '../Dirent' +export * from '../OutputRecordField' +export * from '../WorkflowOutputParameter' +export * from '../FieldBaseProperties' +export * from '../InitialWorkDirRequirementProperties' +export * from '../InputRecordField' +export * from '../CommandOutputRecordFieldProperties' +export * from '../SchemaDefRequirement_class' +export * from '../StepInputExpressionRequirement' export * from '../ShellCommandRequirementProperties' -export * from '../SubworkflowFeatureRequirementProperties' -export * from '../CommandLineBindableProperties' +export * from '../ExpressionTool' +export * from '../WorkflowOutputParameterProperties' +export * from '../CommandOutputEnumSchemaProperties' +export * from '../ExpressionTool_class' +export * from '../RecordField' export * from '../Expression' -export * from '../Operation_class' -export * from '../WorkflowStepProperties' -export * from '../OutputFormatProperties' -export * from '../InputRecordSchema' -export * from '../SecondaryFileSchemaProperties' -export * from '../Workflow_class' -export * from '../LoadListingRequirement' -export * from '../ProcessProperties' +export * from '../CommandOutputBinding' +export * from '../InitialWorkDirRequirement_class' +export * from '../InputSchemaProperties' +export * from '../EnvironmentDef' export * as LoaderInstances from './LoaderInstances' diff --git a/src/util/LoaderInstances.ts b/src/util/LoaderInstances.ts index 1fc0457..bc6ea39 100644 --- a/src/util/LoaderInstances.ts +++ b/src/util/LoaderInstances.ts @@ -11,183 +11,183 @@ import { _TypeDSLLoader, _SecondaryDSLLoader, TypeGuards, - ResourceRequirement, - InputArraySchema, - DockerRequirement_class, - Workflow, - ExpressionToolOutputParameterProperties, - RecordFieldProperties, - Any, - CommandLineBinding, - CommandLineBindingProperties, - DockerRequirementProperties, - DocumentedProperties, - OutputArraySchema, - NetworkAccess_class, - WorkReuse, + ToolTimeLimit_class, WorkReuse_class, - WorkflowStepOutput, - DirectoryProperties, - ScatterFeatureRequirementProperties, - CommandOutputRecordSchemaProperties, - DockerRequirement, - InlineJavascriptRequirement, - InitialWorkDirRequirementProperties, - LabeledProperties, - InputSchemaProperties, - SoftwareRequirementProperties, + NetworkAccessProperties, + RecordFieldProperties, + EnumSchema, + CommandInputArraySchemaProperties, + CWLVersion, + SoftwareRequirement, + SubworkflowFeatureRequirementProperties, InputArraySchemaProperties, - CommandOutputRecordFieldProperties, - File_class, - ProcessRequirementProperties, - Operation, - ScatterFeatureRequirement, + OperationInputParameter, stdin, - EnumSchema, + WorkflowStepInput, + CommandOutputParameterProperties, CommandInputSchemaProperties, - OperationProperties, - SubworkflowFeatureRequirement, - MultipleInputFeatureRequirement, - ShellCommandRequirement_class, - IOSchemaProperties, - CommandInputRecordField, - ParameterProperties, + DockerRequirementProperties, File, - CommandOutputParameter, - enum_d961d79c225752b9fadb617367615ab176b47d77, + ExpressionToolOutputParameterProperties, + CommandLineToolProperties, + Workflow_class, + InlineJavascriptRequirementProperties, + InputEnumSchemaProperties, + FileProperties, + ResourceRequirement_class, + InputArraySchema, + SinkProperties, + InplaceUpdateRequirement_class, + CommandInputRecordSchemaProperties, + InitialWorkDirRequirement, + OperationInputParameterProperties, + CommandLineBindable, + CommandInputArraySchema, + ScatterMethod, + LoadContentsProperties, OutputArraySchemaProperties, - StepInputExpressionRequirement_class, - CommandInputParameter, - EnvironmentDefProperties, - enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, - InputBinding, - ExpressionToolOutputParameter, - ScatterFeatureRequirement_class, SoftwarePackage, - OperationInputParameter, - OutputRecordField, - SchemaDefRequirementProperties, - Dirent, - NetworkAccessProperties, - CommandOutputArraySchemaProperties, - WorkflowOutputParameter, - WorkflowStepInput, - FieldBaseProperties, - CommandInputRecordFieldProperties, - ScatterMethod, - ToolTimeLimit, + LinkMergeMethod, + enum_d9cba076fca539106791a4f46d198c7fcfbdb779, + ShellCommandRequirement, + SecondaryFileSchema, + IOSchemaProperties, + WorkflowStepOutputProperties, + PickValueMethod, + CommandLineBinding, WorkflowStepInputProperties, InputRecordSchemaProperties, - InputParameterProperties, - CommandLineBindable, + InplaceUpdateRequirementProperties, + ResourceRequirement, + MultipleInputFeatureRequirementProperties, + CommandLineTool_class, SchemaDefRequirement, - InputEnumSchema, - OutputRecordSchema, - CommandOutputBinding, - CommandInputRecordSchema, - RecordSchema, - OutputSchemaProperties, - CommandInputEnumSchema, - LoadContentsProperties, + LoadListingRequirement_class, + stderr, + SoftwareRequirement_class, + WorkReuse, + OutputFormatProperties, + LabeledProperties, + CommandLineBindableProperties, + InputParameterProperties, + CommandInputRecordField, + ArraySchemaProperties, + CommandOutputRecordSchemaProperties, + InputFormatProperties, + DocumentedProperties, + OperationOutputParameter, + ExpressionToolOutputParameter, DirentProperties, - OutputRecordSchemaProperties, - LoadListingEnum, - CommandOutputRecordField, - EnvVarRequirement, - InplaceUpdateRequirementProperties, - FileProperties, - InlineJavascriptRequirementProperties, - CommandInputParameterProperties, - InputRecordField, - CWLVersion, + ProcessRequirementProperties, + CommandLineTool, + NetworkAccess, + InplaceUpdateRequirement, CommandOutputRecordSchema, ResourceRequirementProperties, - OutputParameterProperties, - Directory, - CWLType, - WorkflowStep, - stdout, - CommandOutputParameterProperties, - ArraySchema, - InputFormatProperties, - OutputEnumSchemaProperties, - EnumSchemaProperties, - RecordSchemaProperties, - ExpressionTool_class, - WorkflowInputParameterProperties, - StepInputExpressionRequirementProperties, - ExpressionTool, IdentifiedProperties, - InputRecordFieldProperties, - InitialWorkDirRequirement, - CommandOutputBindingProperties, - WorkflowProperties, - CommandOutputEnumSchema, - SubworkflowFeatureRequirement_class, - NetworkAccess, - enum_d9cba076fca539106791a4f46d198c7fcfbdb779, - CommandLineTool_class, - SoftwareRequirement_class, + CommandOutputArraySchemaProperties, + ScatterFeatureRequirement_class, + ParameterProperties, + WorkflowStepProperties, SoftwarePackageProperties, + WorkflowProperties, + OutputSchemaProperties, OutputEnumSchema, - CommandInputRecordSchemaProperties, - WorkflowOutputParameterProperties, - LoadListingRequirementProperties, - CommandInputEnumSchemaProperties, - LinkMergeMethod, - OperationOutputParameterProperties, - CommandInputArraySchemaProperties, - SoftwareRequirement, + File_class, Directory_class, - ArraySchemaProperties, + ShellCommandRequirement_class, + CommandOutputEnumSchema, + ProcessProperties, + CommandInputRecordSchema, + CWLType, + ExpressionToolProperties, + OutputParameterProperties, + OutputArraySchema, + Operation_class, + InputRecordSchema, + Any, + PrimitiveType, + Directory, + RecordSchemaProperties, + SecondaryFileSchemaProperties, + SoftwareRequirementProperties, + EnumSchemaProperties, + InlineJavascriptRequirement, + WorkflowStep, + EnvironmentDefProperties, + LoadListingRequirement, + CommandOutputRecordField, + MultipleInputFeatureRequirement, + SubworkflowFeatureRequirement_class, + DirectoryProperties, + CommandInputEnumSchema, + WorkflowStepOutput, + InputBindingProperties, + InputRecordFieldProperties, + InputBinding, + CommandInputParameterProperties, + OutputRecordSchemaProperties, + ToolTimeLimit, ToolTimeLimitProperties, - InputEnumSchemaProperties, + LoadListingRequirementProperties, + Operation, WorkflowInputParameter, - RecordField, MultipleInputFeatureRequirement_class, - SinkProperties, - WorkflowStepOutputProperties, - SecondaryFileSchema, - ToolTimeLimit_class, - ShellCommandRequirement, - CommandInputArraySchema, - ResourceRequirement_class, - MultipleInputFeatureRequirementProperties, - InplaceUpdateRequirement_class, - stderr, - CommandLineTool, - InitialWorkDirRequirement_class, - ExpressionToolProperties, - SchemaDefRequirement_class, - CommandOutputEnumSchemaProperties, - OutputRecordFieldProperties, - InplaceUpdateRequirement, - PrimitiveType, - OperationOutputParameter, + SubworkflowFeatureRequirement, + OperationProperties, + CommandInputRecordFieldProperties, + Workflow, + StepInputExpressionRequirementProperties, + CommandInputParameter, + WorkflowInputParameterProperties, + EnvVarRequirementProperties, + CommandOutputBindingProperties, InlineJavascriptRequirement_class, - InputBindingProperties, + OutputRecordFieldProperties, + InputEnumSchema, + DockerRequirement, + DockerRequirement_class, + ArraySchema, + StepInputExpressionRequirement_class, + stdout, + enum_d961d79c225752b9fadb617367615ab176b47d77, + enum_d062602be0b4b8fd33e69e29a841317b6ab665bc, + OutputRecordSchema, + LoadListingEnum, + OutputEnumSchemaProperties, + CommandOutputArraySchema, EnvVarRequirement_class, - CommandLineToolProperties, - OperationInputParameterProperties, - StepInputExpressionRequirement, - PickValueMethod, - EnvVarRequirementProperties, + NetworkAccess_class, + ScatterFeatureRequirementProperties, + SchemaDefRequirementProperties, + EnvVarRequirement, WorkReuseProperties, - LoadListingRequirement_class, - EnvironmentDef, - CommandOutputArraySchema, + RecordSchema, + CommandLineBindingProperties, + OperationOutputParameterProperties, + CommandInputEnumSchemaProperties, + ScatterFeatureRequirement, + CommandOutputParameter, + Dirent, + OutputRecordField, + WorkflowOutputParameter, + FieldBaseProperties, + InitialWorkDirRequirementProperties, + InputRecordField, + CommandOutputRecordFieldProperties, + SchemaDefRequirement_class, + StepInputExpressionRequirement, ShellCommandRequirementProperties, - SubworkflowFeatureRequirementProperties, - CommandLineBindableProperties, + ExpressionTool, + WorkflowOutputParameterProperties, + CommandOutputEnumSchemaProperties, + ExpressionTool_class, + RecordField, Expression, - Operation_class, - WorkflowStepProperties, - OutputFormatProperties, - InputRecordSchema, - SecondaryFileSchemaProperties, - Workflow_class, - LoadListingRequirement, - ProcessProperties + CommandOutputBinding, + InitialWorkDirRequirement_class, + InputSchemaProperties, + EnvironmentDef } from './Internal' export const strtype = new _PrimitiveLoader(TypeGuards.String); From 495404cbad47f57560df454e82d54657368d9346 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Thu, 23 Dec 2021 14:27:32 +0100 Subject: [PATCH 17/19] Add basic README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc80d08 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# cwl-ts-auto +This project contains TypeScript objects and utilities auto-generated by https://github.com/common-workflow-language/schema_salad for parsing documents corresponding to the https://w3id.org/cwl/cwl schema + +## Installation +To install the latest version of cwl-ts-auto execute: + +`npm install cwl-ts-auto` From 8e695bf505aa8b97ae0812e7819be88e4a7366a1 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Thu, 23 Dec 2021 14:40:21 +0100 Subject: [PATCH 18/19] Update package.json --- package.json | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5b4817e..423ec15 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,23 @@ { "name": "cwl-ts-auto", - "version": "0.0.1-SNAPSHOT", - "description": "This project contains TypeScript objects and utilities auto-generated by Schema Salad for parsing documents corresponding to the https://w3id.org/cwl/cwl# schema.", - "main": "index.js", + "version": "0.1.0", + "description": "This project contains TypeScript objects and utilities auto-generated by https://github.com/common-workflow-language/schema_salad for parsing documents corresponding to the https://w3id.org/cwl/cwl# schema.", + "author": "Adrian Zimmer", + "homepage" : "https://www.commonwl.org/", + "license": "Apache License, Version 2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/common-workflow-lab/cwl-ts-auto" + }, + "bugs": { + "url": "https://github.com/common-workflow-lab/cwl-ts-auto/issues" + }, + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { + "build": "rm -rf ./dist && tsc", "test": "nyc --reporter=lcov mocha --require ts-node/register src/test/**/*.ts" }, - "license": "Apache License, Version 2.0", "devDependencies": { "@types/chai": "^4.2.22", "@types/chai-as-promised": "^7.1.4", @@ -30,5 +41,8 @@ "node-fetch": "^2.6.6", "uri-js": "^4.4.1", "uuid": "^8.3.2" - } -} + }, + "files": [ + "/dist" + ] +} \ No newline at end of file From 10cb402a2fc4404d03e36e98a1d715de6aa44231 Mon Sep 17 00:00:00 2001 From: Adrian Zimmer Date: Thu, 23 Dec 2021 16:14:47 +0100 Subject: [PATCH 19/19] Add notice of only v1.2 being supported --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index bc80d08..70a6da4 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,6 @@ This project contains TypeScript objects and utilities auto-generated by https:/ To install the latest version of cwl-ts-auto execute: `npm install cwl-ts-auto` + +## Limitations +cwl-ts-auto only supports the CWL v1.2 syntax. Other documents have to be upgraded using the [cwl-upgrader](https://pypi.org/project/cwl-upgrader/) \ No newline at end of file