X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7597dab11b25e5bb67becf99db622f7f7737a235..ba27bdf218da8894df4ffa6174c67c1fb3e70c81:/src/models/workflow.ts diff --git a/src/models/workflow.ts b/src/models/workflow.ts index 88ceb6ed..a342dbbf 100644 --- a/src/models/workflow.ts +++ b/src/models/workflow.ts @@ -41,6 +41,8 @@ export type CommandInputParameter = FileCommandInputParameter | DirectoryCommandInputParameter | StringArrayCommandInputParameter | + IntArrayCommandInputParameter | + FloatArrayCommandInputParameter | FileArrayCommandInputParameter | DirectoryArrayCommandInputParameter | EnumCommandInputParameter; @@ -104,9 +106,14 @@ export type DirectoryCommandInputParameter = GenericCommandInputParameter; export type StringArrayCommandInputParameter = GenericArrayCommandInputParameter; +export type IntArrayCommandInputParameter = GenericArrayCommandInputParameter; +export type FloatArrayCommandInputParameter = GenericArrayCommandInputParameter; export type FileArrayCommandInputParameter = GenericArrayCommandInputParameter; export type DirectoryArrayCommandInputParameter = GenericArrayCommandInputParameter; +export type WorkflowInputsData = { + [key: string]: boolean | number | string | File | Directory; +}; export const parseWorkflowDefinition = (workflow: WorkflowResource): WorkflowResoruceDefinition => { const definition = safeLoad(workflow.definition); return definition; @@ -138,6 +145,12 @@ export const isPrimitiveOfType = (input: GenericCommandInputParameter, ? input.type.indexOf(type) > -1 : input.type === type; +export const isArrayOfType = (input: GenericCommandInputParameter, type: CWLType) => + typeof input.type === 'object' && + input.type.type === 'array' + ? input.type.items === type + : false; + export const stringifyInputType = ({ type }: CommandInputParameter) => { if (typeof type === 'string') { return type;