X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/952aa1c7170d4b24951f40ed66b5f19a53d11daf..91bf126bc097ea203c1c081adc187e7567367a35:/src/models/workflow.ts diff --git a/src/models/workflow.ts b/src/models/workflow.ts index 923a9cbd31..95cc926fbd 100644 --- a/src/models/workflow.ts +++ b/src/models/workflow.ts @@ -31,13 +31,19 @@ export interface CommandLineTool { outputs: any[]; } -export interface CommandInputParameter { - id: string; - label?: string; - doc?: string | string[]; - default?: any; - type?: CWLType | CWLType[] | CommandInputEnumSchema | CommandInputArraySchema; -} +export type CommandInputParameter = + BooleanCommandInputParameter | + IntCommandInputParameter | + LongCommandInputParameter | + FloatCommandInputParameter | + DoubleCommandInputParameter | + StringCommandInputParameter | + FileCommandInputParameter | + DirectoryCommandInputParameter | + StringArrayCommandInputParameter | + FileArrayCommandInputParameter | + DirectoryArrayCommandInputParameter | + EnumCommandInputParameter; export enum CWLType { NULL = 'null', @@ -58,8 +64,8 @@ export interface CommandInputEnumSchema { name?: string; } -export interface CommandInputArraySchema { - items: CWLType; +export interface CommandInputArraySchema { + items: ItemType; type: 'array'; label?: string; } @@ -78,6 +84,29 @@ export interface Directory { basename?: string; } +export interface GenericCommandInputParameter { + id: string; + label?: string; + doc?: string | string[]; + default?: Value; + type?: Type | Array; +} +export type GenericArrayCommandInputParameter = GenericCommandInputParameter, Value[]>; + +export type BooleanCommandInputParameter = GenericCommandInputParameter; +export type IntCommandInputParameter = GenericCommandInputParameter; +export type LongCommandInputParameter = GenericCommandInputParameter; +export type FloatCommandInputParameter = GenericCommandInputParameter; +export type DoubleCommandInputParameter = GenericCommandInputParameter; +export type StringCommandInputParameter = GenericCommandInputParameter; +export type FileCommandInputParameter = GenericCommandInputParameter; +export type DirectoryCommandInputParameter = GenericCommandInputParameter; +export type EnumCommandInputParameter = GenericCommandInputParameter; + +export type StringArrayCommandInputParameter = GenericArrayCommandInputParameter; +export type FileArrayCommandInputParameter = GenericArrayCommandInputParameter; +export type DirectoryArrayCommandInputParameter = GenericArrayCommandInputParameter; + export const parseWorkflowDefinition = (workflow: WorkflowResource): WorkflowResoruceDefinition => { const definition = safeLoad(workflow.definition); return definition;