diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index a2aa6e3d6c75..01038a1b95ce 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -4900,6 +4900,23 @@ export interface paths { patch?: never; trace?: never; }; + "/api/workflows/download/{workflow_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns a selected workflow. */ + get: operations["workflow_dict_api_workflows_download__workflow_id__get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/api/workflows/menu": { parameters: { query?: never; @@ -4909,7 +4926,8 @@ export interface paths { }; /** Get workflows present in the tools panel. */ get: operations["get_workflow_menu_api_workflows_menu_get"]; - put?: never; + /** Save workflow menu to be shown in the tool panel */ + put: operations["set_workflow_menu_api_workflows_menu_put"]; post?: never; delete?: never; options?: never; @@ -4972,6 +4990,23 @@ export interface paths { patch?: never; trace?: never; }; + "/api/workflows/{workflow_id}/download": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns a selected workflow. */ + get: operations["workflow_dict_api_workflows__workflow_id__download_get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/api/workflows/{workflow_id}/enable_link_access": { parameters: { query?: never; @@ -8470,6 +8505,13 @@ export interface components { */ src: components["schemas"]["DataItemSourceType"]; }; + /** ExportDictStepToolOutput */ + ExportDictStepToolOutput: { + /** Export step output name */ + name: string; + /** Export step output type */ + type: string; + }; /** ExportHistoryArchivePayload */ ExportHistoryArchivePayload: { /** @@ -8962,6 +9004,97 @@ export interface components { */ update_time: string; }; + /** FrameComment */ + FrameComment: { + /** + * Child Comments + * @description A list of ids (see `id`) of all Comments which are encompassed by this Frame + */ + child_comments?: number[] | null; + /** + * Child Steps + * @description A list of ids of all Steps (see WorkflowStep.id) which are encompassed by this Frame + */ + child_steps?: number[] | null; + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["FrameCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "frame"; + }; + /** FrameCommentData */ + FrameCommentData: { + /** + * Title + * @description The Frames title + */ + title: string; + }; + /** FreehandComment */ + FreehandComment: { + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["FreehandCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "freehand"; + }; + /** FreehandCommentData */ + FreehandCommentData: { + /** + * Line + * @description List of [x, y] coordinates determining the unsmoothed line. Smoothing is done client-side using Catmull-Rom + */ + line: [number, number][]; + /** + * Thickness + * @description Width of the Line in pixels + */ + thickness: number; + }; /** FtpImportElement */ FtpImportElement: { /** Md5 */ @@ -11171,6 +11304,60 @@ export interface components { */ uri: string; }; + /** InputConnectionEditor */ + InputConnectionEditor: { + /** + * ID + * @description The order index of the step. + */ + id: number; + /** + * Input Type + * @description The input type of the workflow step. + */ + input_type: string; + /** + * Output Name + * @description The output name of the input step that serves as the source for this connection. + */ + output_name: string; + }; + /** InputConnectionExport */ + InputConnectionExport: { + /** + * ID + * @description The order index of the step. + */ + id: number; + /** Input Subworkflow Step ID */ + input_subworkflow_step_id?: number | null; + /** + * Output Name + * @description The output name of the input step that serves as the source for this connection. + */ + output_name: string; + }; + /** InputDataCollectionModuleStepOutput */ + InputDataCollectionModuleStepOutput: { + /** + * Is collection + * @constant + * @enum {boolean} + */ + collection: true; + /** Input data collection module step output collection type */ + collection_type: string; + /** Input data collection module step output extensions */ + extensions: string | string[]; + /** + * Input data collection module step output name + * @constant + * @enum {string} + */ + name: "output"; + /** Is optional */ + optional: boolean; + }; /** InputDataCollectionStep */ InputDataCollectionStep: { /** @@ -11213,6 +11400,19 @@ export interface components { /** When */ when: string | null; }; + /** InputDataModuleStepOutput */ + InputDataModuleStepOutput: { + /** Input data module step output extensions */ + extensions: string | string[]; + /** + * Input data module step output name + * @constant + * @enum {string} + */ + name: "output"; + /** Is optional */ + optional: boolean; + }; /** InputDataStep */ InputDataStep: { /** @@ -11255,6 +11455,27 @@ export interface components { /** When */ when: string | null; }; + /** InputParameterModuleStepOutput */ + InputParameterModuleStepOutput: { + /** Input data module step output label */ + label: string; + /** + * Input data module step output name + * @constant + * @enum {string} + */ + name: "output"; + /** Is optional */ + optional: boolean; + /** + * Is parameter + * @constant + * @enum {boolean} + */ + parameter: true; + /** Input data module step output parameter type */ + type: string; + }; /** InputParameterStep */ InputParameterStep: { /** @@ -12075,16 +12296,12 @@ export interface components { batch: boolean | null; /** * Dataset Map - * @description TODO * @default {} */ ds_map: { [key: string]: Record; } | null; - /** - * Effective Outputs - * @description TODO - */ + /** Effective Outputs */ effective_outputs?: unknown | null; /** * History @@ -12096,10 +12313,7 @@ export interface components { * @description The encoded history id into which to import. */ history_id?: string | null; - /** - * Inputs - * @description TODO - */ + /** Inputs */ inputs?: Record | null; /** * Inputs By @@ -12158,7 +12372,6 @@ export interface components { preferred_outputs_object_store_id?: string | null; /** * Replacement Parameters - * @description TODO * @default {} */ replacement_params: Record | null; @@ -12170,7 +12383,6 @@ export interface components { require_exact_tool_versions: boolean | null; /** * Resource Parameters - * @description TODO * @default {} */ resource_params: Record | null; @@ -12179,10 +12391,7 @@ export interface components { * @description Scheduler to use for workflow invocation. */ scheduler?: string | null; - /** - * Step Parameters - * @description TODO - */ + /** Step Parameters */ step_parameters?: Record | null; /** * Use cached job @@ -13283,6 +13492,44 @@ export interface components { * @enum {string} */ MandatoryNotificationCategory: "broadcast"; + /** MarkdownComment */ + MarkdownComment: { + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["MarkdownCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "markdown"; + }; + /** MarkdownCommentData */ + MarkdownCommentData: { + /** + * Text + * @description The unrendered source Markdown for this Comment + */ + text: string; + }; /** MaterializeDatasetInstanceAPIRequest */ MaterializeDatasetInstanceAPIRequest: { /** @@ -14133,6 +14380,23 @@ export interface components { */ to_posix_lines: boolean; }; + /** PauseModuleStepOutput */ + PauseModuleStepOutput: { + /** Extension */ + extension: "input"[]; + /** + * Pause module step output label + * @constant + * @enum {string} + */ + label: "Reviewed Dataset"; + /** + * Pause module step output name + * @constant + * @enum {string} + */ + name: "output"; + }; /** PauseStep */ PauseStep: { /** @@ -14259,6 +14523,29 @@ export interface components { /** Top */ top: number; }; + /** PostJobAction */ + PostJobAction: { + /** + * Action Arguments + * @description Any additional arguments needed by the action. + */ + action_arguments: Record; + /** + * Action Type + * @description The type of action to run. + */ + action_type: string; + /** + * Output Name + * @description The name of the output that will be affected by the action. + */ + output_name: string; + /** + * Short String + * @description A short string representation of the action. + */ + short_str?: string | null; + }; /** PrepareStoreDownloadPayload */ PrepareStoreDownloadPayload: { /** @@ -14775,6 +15062,37 @@ export interface components { RootModel_Dict_str__int__: { [key: string]: number; }; + /** RunStepToolOutput */ + RunStepToolOutput: { + /** Count */ + count: number; + /** Default Identifier Source */ + default_identifier_source: string; + /** Discover Datasets */ + discover_datasets: unknown[]; + /** Edam Data */ + edam_data: string; + /** Edam Format */ + edam_format: string; + /** Format */ + format: string; + /** Format Source */ + format_source: string | null; + /** From Work Dir */ + from_work_dir: boolean | null; + /** Hidden */ + hidden: boolean; + /** Label */ + label: string; + /** Metadata Source */ + metadata_source: string; + /** Name */ + name: string; + /** Output Type */ + output_type: string; + /** Parent */ + parent: string | null; + }; /** SearchJobsPayload */ SearchJobsPayload: { /** @@ -14931,6 +15249,27 @@ export interface components { */ new_slug: string; }; + /** SetWorkflowMenuPayload */ + SetWorkflowMenuPayload: { + /** + * Workflow IDs + * @description The list of workflow IDs to set the menu entry for. + */ + workflow_ids: string[] | string; + }; + /** SetWorkflowMenuSummary */ + SetWorkflowMenuSummary: { + /** + * Message + * @description The message of the operation. + */ + message: unknown | null; + /** + * Status + * @description The status of the operation. + */ + status: string; + }; /** ShareHistoryExtra */ ShareHistoryExtra: { /** @@ -15346,6 +15685,11 @@ export interface components { * @enum {string} */ Src: "url" | "pasted" | "files" | "path" | "composite" | "ftp_import" | "server_dir"; + /** StepIn */ + StepIn: { + /** Default */ + default: unknown; + }; /** StepReferenceByLabel */ StepReferenceByLabel: { /** @@ -15775,6 +16119,59 @@ export interface components { */ type: "string"; }; + /** TextComment */ + TextComment: { + /** + * Color + * @description Color this comment is displayed as. The exact color hex is determined by the client + * @enum {string} + */ + color: "none" | "black" | "blue" | "turquoise" | "green" | "lime" | "orange" | "yellow" | "red" | "pink"; + data: components["schemas"]["TextCommentData"]; + /** + * Id + * @description Unique identifier for this comment. Determined by the comments order + */ + id: number; + /** + * Position + * @description [x, y] position of this comment in the Workflow + */ + position: [number, number]; + /** + * Size + * @description [width, height] size of this comment + */ + size: [number, number]; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + type: "text"; + }; + /** TextCommentData */ + TextCommentData: { + /** + * Bold + * @description If the Comments text is bold. Absent is interpreted as false + */ + bold?: boolean | null; + /** + * Italic + * @description If the Comments text is italic. Absent is interpreted as false + */ + italic?: boolean | null; + /** + * Size + * @description Relative size (1 -> 100%) of the text compared to the default text sitz + */ + size: number; + /** + * Text + * @description The plaintext text of this comment + */ + text: string; + }; /** ToolDataDetails */ ToolDataDetails: { /** @@ -15855,6 +16252,51 @@ export interface components { */ values: string; }; + /** ToolModuleStepOutput */ + ToolModuleStepOutput: { + /** Is collection */ + collection?: true | null; + /** Tool module step output collection type */ + collection_type?: string | null; + /** Collection Type Source */ + collection_type_source?: string | null; + /** Tool module step output extensions */ + extensions: string[]; + /** Tool module step output label */ + label?: unknown | null; + /** Tool module step output name */ + name: string; + /** + * Is optional + * @constant + * @enum {boolean} + */ + optional: false; + /** Is parameter */ + parameter?: true | null; + /** Tool module step output type */ + type: string; + }; + /** ToolShedRepositorySummary */ + ToolShedRepositorySummary: { + /** Changeset Revision */ + changeset_revision: string; + /** + * Name + * @description The name of the repository. + */ + name: string; + /** + * Owner + * @description The owner of the repository. + */ + owner: string; + /** + * Tool Shed + * @description The Tool Shed base URL. + */ + tool_shed: string; + }; /** ToolStep */ ToolStep: { /** @@ -17071,110 +17513,1173 @@ export interface components { * Annotation * @description The annotation of this Visualization. */ - annotation?: string | null; + annotation?: string | null; + /** + * Create Time + * @description The time and date this item was created. + */ + create_time: string | null; + /** + * DbKey + * @description The database key of the visualization. + */ + dbkey?: string | null; + /** + * Deleted + * @description Whether this Visualization has been deleted. + */ + deleted: boolean; + /** + * ID + * @description Encoded ID of the Visualization. + * @example 0123456789ABCDEF + */ + id: string; + /** + * Importable + * @description Whether this Visualization can be imported. + */ + importable: boolean; + /** + * Published + * @description Whether this Visualization has been published. + */ + published: boolean; + /** + * Tags + * @description A list of tags to add to this item. + */ + tags: components["schemas"]["TagCollection"] | null; + /** + * Title + * @description The name of the visualization. + */ + title: string; + /** + * Type + * @description The type of the visualization. + */ + type: string; + /** + * Update Time + * @description The last time and date this item was updated. + */ + update_time: string | null; + /** + * Username + * @description The name of the user owning this Visualization. + */ + username: string; + } & { + [key: string]: unknown; + }; + /** + * VisualizationSummaryList + * @default [] + */ + VisualizationSummaryList: components["schemas"]["VisualizationSummary"][]; + /** VisualizationUpdatePayload */ + VisualizationUpdatePayload: { + /** + * Config + * @description The config of the visualization. + * @default {} + */ + config: Record | string | null; + /** + * DbKey + * @description The database key of the visualization. + */ + dbkey?: string | null; + /** + * Deleted + * @description Whether this Visualization has been deleted. + * @default false + */ + deleted: boolean | null; + /** + * Title + * @description The name of the visualization. + */ + title?: string | null; + }; + /** VisualizationUpdateResponse */ + VisualizationUpdateResponse: { + /** + * ID + * @description Encoded ID of the Visualization. + * @example 0123456789ABCDEF + */ + id: string; + /** + * Revision + * @description Encoded ID of the Visualization Revision. + * @example 0123456789ABCDEF + */ + revision: string; + }; + /** WorkflowCommentModel */ + WorkflowCommentModel: + | components["schemas"]["TextComment"] + | components["schemas"]["MarkdownComment"] + | components["schemas"]["FrameComment"] + | components["schemas"]["FreehandComment"]; + /** WorkflowDictEditorStep */ + WorkflowDictEditorStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation: string | null; + /** + * Config Form + * @description The configuration form for the step. + */ + config_form?: Record | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * ID + * @description The identifier of the step. It matches the index order of the step inside the workflow. + */ + id: number; + /** + * Input Connections + * @description The input connections for the step. + */ + input_connections?: { + [key: string]: + | components["schemas"]["InputConnectionEditor"] + | components["schemas"]["InputConnectionEditor"][]; + } | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs?: Record[] | null; + /** + * Label + * @description The label of the step. + */ + label?: string | null; + /** + * Name + * @description The descriptive name of the module or step. + */ + name?: string | null; + /** + * Outputs + * @description The outputs of the step. + */ + outputs?: + | ( + | components["schemas"]["InputDataModuleStepOutput"] + | components["schemas"]["InputDataCollectionModuleStepOutput"] + | components["schemas"]["InputParameterModuleStepOutput"] + | components["schemas"]["PauseModuleStepOutput"] + | components["schemas"]["ToolModuleStepOutput"] + )[] + | null; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * Tooltip + * @description The tooltip for the step. + */ + tooltip?: string | null; + /** + * Type + * @description The type of the module that represents a step in the workflow. + */ + type: string; + /** + * UUID + * @description Universal unique identifier of the workflow. + */ + uuid?: string | null; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictEditorSummary */ + WorkflowDictEditorSummary: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation: string | null; + /** + * Comments + * @description Comments on the workflow. + */ + comments: components["schemas"]["WorkflowCommentModel"][]; + /** + * Creator + * @description Additional information about the creator (or multiple creators) of this workflow. + */ + creator?: + | (components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"])[] + | null; + /** + * License + * @description SPDX Identifier of the license associated with this workflow. + */ + license: string | null; + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Report + * @description The reports configuration for the workflow. + */ + report: Record; + /** + * Source Metadata + * @description Metadata about the source of the workflow + */ + source_metadata: Record | null; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: { + [key: string]: components["schemas"]["WorkflowDictEditorStep"]; + }; + /** + * Upgrade Messages + * @description Upgrade messages for each step in the workflow. + */ + upgrade_messages: { + [key: string]: string; + }; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version: number; + }; + /** WorkflowDictExportStep */ + WorkflowDictExportStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * ID + * @description The identifier of the step. It matches the index order of the step inside the workflow. + */ + id: number; + /** In */ + in?: { + [key: string]: components["schemas"]["StepIn"]; + } | null; + /** + * Input Connections + * @description The input connections of the step. + */ + input_connections?: { + [key: string]: + | components["schemas"]["InputConnectionExport"] + | components["schemas"]["InputConnectionExport"][]; + } | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs?: components["schemas"]["WorkflowDictExportStepInput"][] | null; + /** + * Label + * @description The label of the step. + */ + label?: string | null; + /** + * Name + * @description The descriptive name of the module or step. + */ + name: string; + /** + * Outputs + * @description The outputs of the step. + */ + outputs?: components["schemas"]["ExportDictStepToolOutput"][] | null; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Sub Workflow + * @description Full information about the subworkflow associated with this step. + */ + subworkflow?: components["schemas"]["WorkflowDictExportSummary"] | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool Representation + * @description The representation of the tool associated with the step. + */ + tool_representation?: Record | null; + /** + * Tool Shed Repository + * @description Information about the tool shed repository associated with the tool. + */ + tool_shed_repository?: components["schemas"]["ToolShedRepositorySummary"] | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * Type + * @description The type of the module that represents a step in the workflow. + */ + type: string; + /** + * UUID + * Format: uuid4 + * @description Universal unique identifier of the workflow. + */ + uuid: string; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictExportStepInput */ + WorkflowDictExportStepInput: { + /** + * Description + * @description The annotation or description of the input. + */ + description: string; + /** + * Name + * @description The name of the input. + */ + name: string; + }; + /** WorkflowDictExportSummary */ + WorkflowDictExportSummary: { + /** + * A Galaxy Workflow + * @description Whether this workflow is a Galaxy Workflow. + * @constant + * @enum {string} + */ + a_galaxy_workflow: "true"; + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation: string | null; + /** + * Comments + * @description Comments associated with the workflow. + */ + comments: components["schemas"]["WorkflowCommentModel"][]; + /** + * Creator + * @description Additional information about the creator (or multiple creators) of this workflow. + */ + creator?: + | (components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"])[] + | null; + /** + * Format Version + * @description The version of the workflow format being used. + * @constant + * @enum {string} + */ + "format-version": "0.1"; + /** + * License + * @description SPDX Identifier of the license associated with this workflow. + */ + license?: string | null; + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Report + * @description The configuration for generating a report for the workflow. + */ + report?: Record | null; + /** + * Source Metadata + * @description Metadata about the source of the workflow. + */ + source_metadata?: Record | null; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: { + [key: string]: components["schemas"]["WorkflowDictExportStep"]; + }; + /** + * Tags + * @description The tags associated with the workflow. + */ + tags: components["schemas"]["TagCollection"]; + /** + * UUID + * @description The UUID (Universally Unique Identifier) of the workflow. + */ + uuid?: string | null; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version?: number | null; + }; + /** WorkflowDictFormat2Summary */ + WorkflowDictFormat2Summary: { + /** + * Class + * @description The class of the workflow. + * @constant + * @enum {string} + */ + class: "GalaxyWorkflow"; + /** + * Creator + * @description Additional information about the creator (or multiple creators) of this workflow. + */ + creator?: + | (components["schemas"]["Person"] | components["schemas"]["galaxy__schema__schema__Organization"])[] + | null; + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + doc?: string | null; + /** + * Inputs + * @description The inputs of the workflow. + */ + inputs: Record; + /** + * Label + * @description The label or name of the workflow. + */ + label?: string | null; + /** + * License + * @description SPDX Identifier of the license associated with this workflow. + */ + license?: string | null; + /** + * Outputs + * @description The outputs of the workflow. + */ + outputs: Record; + /** + * Release + * @description The release information for the workflow. + */ + release?: string | null; + /** + * Report + * @description The configuration for generating a report for the workflow. + */ + report?: Record | null; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: Record; + /** + * Tags + * @description The tags associated with the workflow. + */ + tags?: components["schemas"]["TagCollection"] | null; + /** + * UUID + * @description The UUID (Universally Unique Identifier) of the workflow. + */ + uuid?: string | null; + }; + /** WorkflowDictFormat2WrappedYamlSummary */ + WorkflowDictFormat2WrappedYamlSummary: { + /** + * YAML Content + * @description The content of the workflow in YAML . + */ + yaml_content: unknown; + }; + /** WorkflowDictPreviewStep */ + WorkflowDictPreviewStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs: Record[]; + /** + * Label + * @description The label of the step. + */ + label: string; + /** + * Order Index + * @description The order index of the step. + */ + order_index: number; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * Type + * @description The type of the module that represents a step in the workflow. + */ + type: string; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictPreviewSummary */ + WorkflowDictPreviewSummary: { + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: components["schemas"]["WorkflowDictPreviewStep"][]; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version: number; + }; + /** WorkflowDictRunStep */ + WorkflowDictRunStep: { + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * Inputs + * @description The inputs of the step. + */ + inputs: Record[]; + /** + * Messages + * @description Upgrade messages for the step. + */ + messages?: string[] | null; + /** + * Output Connections + * @description The output connections of the step. + */ + output_connections: Record[]; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Replacement Parameters + * @description Informal replacement parameters for the step. + */ + replacement_parameters?: (string | Record)[] | null; + /** + * Step Index + * @description The order index of the step. + */ + step_index: number; + /** + * Step Label + * @description The label of the step. + */ + step_label?: string | null; + /** + * Step Name + * @description The descriptive name of the module or step. + */ + step_name: string; + /** + * Step Type + * @description The type of the step. + */ + step_type: string; + /** + * Step Version + * @description The version of the step's module. + */ + step_version?: string | null; + /** + * Tool ID + * @description The unique name of the tool associated with this step. + */ + tool_id?: string | null; + /** + * Tool State + * @description The state of the tool associated with the step + */ + tool_state?: Record | string | null; + /** + * Tool Version + * @description The version of the tool associated with the step. + */ + tool_version?: string | null; + /** + * When + * @description The when expression for the step. + */ + when?: string | null; + /** + * Workflow Outputs + * @description Workflow outputs associated with this step. + */ + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; + }; + /** WorkflowDictRunSummary */ + WorkflowDictRunSummary: { + /** + * Has Upgrade Messages + * @description Whether the workflow has upgrade messages. + */ + has_upgrade_messages: boolean; + /** + * History ID + * @description The encoded ID of the history associated with the workflow. + */ + history_id?: string | null; + /** + * ID + * @description The encoded ID of the stored workflow. + */ + id: string; + /** + * Name + * @description The name of the workflow. + */ + name: string; + /** + * Step Version Changes + * @description Version changes for the workflow steps. + */ + step_version_changes: (string | Record)[]; + /** + * Steps + * @description Information about all the steps of the workflow. + */ + steps: (components["schemas"]["WorkflowDictRunToolStep"] | components["schemas"]["WorkflowDictRunStep"])[]; + /** + * Version + * @description The version of the workflow represented by an incremental number. + */ + version: number; + /** + * Workflow Resource Parameters + * @description The resource parameters of the workflow. + */ + workflow_resource_parameters: Record | null; + }; + /** WorkflowDictRunToolStep */ + WorkflowDictRunToolStep: { + /** + * Action + * @description The action of the tool step. + */ + action: string; + /** + * Annotation + * @description An annotation to provide details or to help understand the purpose and usage of this item. + */ + annotation?: string | null; + /** + * Citations + * @description The citations of the tool step. + */ + citations: boolean; + /** + * Content ID + * @description The content ID of the step. + */ + content_id?: string | null; + /** + * Creator + * @description The creator of the tool step. + */ + creator?: string | null; + /** + * Description + * @description The description of the tool step. + */ + description: string; + /** + * Display + * @description Indicates if the tool step should be displayed. + */ + display: boolean; + /** + * EDAM Operations + * @description The EDAM operations of the tool step. + */ + edam_operations: string[]; + /** + * EDAM Topics + * @description The EDAM topics of the tool step. + */ + edam_topics: string[]; + /** + * Enctype + * @description The enctype of the tool step. + */ + enctype: string; + /** + * Errors + * @description An message indicating possible errors in the step. + */ + errors?: + | { + [key: string]: + | ( + | "The number of repeat elements is outside the range specified by the tool." + | "The selected case is unavailable/invalid." + ) + | string; + } + | "Tool is not installed" + | string + | ("Tool is not installed" | string)[] + | null; + /** + * Form Style + * @description The form style of the tool step. + */ + form_style: string; + /** + * Help + * @description The help of the tool step. + */ + help: string; + /** + * Hidden + * @description The hidden status of the tool step. + */ + hidden: string; + /** + * History ID + * @description The ID of the history associated with the tool step. + */ + history_id: string; + /** + * ID + * @description The identifier of the tool step. + */ + id: string; + /** + * Inputs + * @description The inputs of the step. + */ + inputs: Record[]; + /** + * Is Workflow Compatible + * @description Indicates if the tool step is compatible with workflows. + */ + is_workflow_compatible: boolean; + /** + * Job ID + * @description The ID of the job associated with the tool step. + */ + job_id?: string | null; + /** + * Job Remap + * @description The remap of the job associated with the tool step. + */ + job_remap?: string | null; + /** + * Labels + * @description The labels of the tool step. + */ + labels: string[]; + /** + * License + * @description The license of the tool step. + */ + license?: string | null; + /** + * Link + * @description The link of the tool step. + */ + link?: string | null; + /** + * Message + * @description The message of the tool step. + */ + message: string; + /** + * Messages + * @description Upgrade messages for the step. + */ + messages?: string[] | null; + /** + * Method + * @description The method of the tool step. + */ + method: string; + /** + * Min Width + * @description The minimum width of the tool step. + */ + min_width?: unknown | null; + /** + * Model Class + * @description The model class of the tool step. + * @constant + * @enum {string} + */ + model_class: "tool"; + /** + * Name + * @description The name of the tool step. + */ + name: string; + /** + * Output Connections + * @description The output connections of the step. + */ + output_connections: Record[]; + /** + * Outputs + * @description The outputs of the step. + */ + outputs: components["schemas"]["RunStepToolOutput"][]; + /** + * Panel Section ID + * @description The panel section ID of the tool step. + */ + panel_section_id: string; + /** + * Panel Section Name + * @description The panel section name of the tool step. + */ + panel_section_name: string; + /** + * Position + * @description Layout position of this step in the graph + */ + position?: components["schemas"]["WorkflowStepLayoutPosition"] | null; + /** + * Post Job Actions + * @description Set of actions that will be run when the job finishes. + */ + post_job_actions?: + | components["schemas"]["PostJobAction"][] + | { + [key: string]: components["schemas"]["PostJobAction"]; + } + | null; + /** + * Replacement Parameters + * @description Informal replacement parameters for the step. + */ + replacement_parameters?: (string | Record)[] | null; + /** + * Requirements + * @description The requirements of the tool step. + */ + requirements: string[]; + /** + * Sharable URL + * @description The sharable URL of the tool step. + */ + sharable_url?: string | null; + /** + * State Inputs + * @description The state inputs of the tool step. + */ + state_inputs: Record; /** - * Create Time - * @description The time and date this item was created. + * Step Index + * @description The order index of the step. */ - create_time: string | null; + step_index: number; /** - * DbKey - * @description The database key of the visualization. + * Step Label + * @description The label of the step. */ - dbkey?: string | null; + step_label?: string | null; /** - * Deleted - * @description Whether this Visualization has been deleted. + * Step Name + * @description The descriptive name of the module or step. */ - deleted: boolean; + step_name: string; /** - * ID - * @description Encoded ID of the Visualization. - * @example 0123456789ABCDEF + * Step Type + * @description The type of the step. */ - id: string; + step_type: string; /** - * Importable - * @description Whether this Visualization can be imported. + * Step Version + * @description The version of the step's module. */ - importable: boolean; + step_version?: string | null; /** - * Published - * @description Whether this Visualization has been published. + * Target + * @description The target of the tool step. */ - published: boolean; + target?: unknown | null; /** - * Tags - * @description A list of tags to add to this item. + * Tool Errors + * @description An message indicating possible errors in the tool step. */ - tags: components["schemas"]["TagCollection"] | null; + tool_errors?: string | null; /** - * Title - * @description The name of the visualization. + * Tool ID + * @description The unique name of the tool associated with this step. */ - title: string; + tool_id: string; /** - * Type - * @description The type of the visualization. + * Tool Shed Repository + * @description Information about the tool shed repository associated with the tool. */ - type: string; + tool_shed_repository?: components["schemas"]["ToolShedRepositorySummary"] | null; /** - * Update Time - * @description The last time and date this item was updated. + * Tool State + * @description The state of the tool associated with the step */ - update_time: string | null; + tool_state?: Record | string | null; /** - * Username - * @description The name of the user owning this Visualization. + * Tool Version + * @description The version of the tool associated with the step. */ - username: string; - } & { - [key: string]: unknown; - }; - /** - * VisualizationSummaryList - * @default [] - */ - VisualizationSummaryList: components["schemas"]["VisualizationSummary"][]; - /** VisualizationUpdatePayload */ - VisualizationUpdatePayload: { + tool_version?: string | null; /** - * Config - * @description The config of the visualization. - * @default {} + * Version + * @description The version of the tool step. */ - config: Record | string | null; + version: string; /** - * DbKey - * @description The database key of the visualization. + * Versions + * @description The versions of the tool step. */ - dbkey?: string | null; + versions: string[]; /** - * Deleted - * @description Whether this Visualization has been deleted. - * @default false + * Warnings + * @description The warnings of the tool step. */ - deleted: boolean | null; + warnings?: string | null; /** - * Title - * @description The name of the visualization. + * When + * @description The when expression for the step. */ - title?: string | null; - }; - /** VisualizationUpdateResponse */ - VisualizationUpdateResponse: { + when?: string | null; /** - * ID - * @description Encoded ID of the Visualization. - * @example 0123456789ABCDEF + * Workflow Outputs + * @description Workflow outputs associated with this step. */ - id: string; + workflow_outputs?: components["schemas"]["WorkflowOutput"][] | null; /** - * Revision - * @description Encoded ID of the Visualization Revision. - * @example 0123456789ABCDEF + * XRefs + * @description The cross-references of the tool step. */ - revision: string; + xrefs: string[]; }; /** WorkflowInput */ WorkflowInput: { @@ -17188,10 +18693,7 @@ export interface components { * @description Universal unique identifier of the input. */ uuid: string | null; - /** - * Value - * @description TODO - */ + /** Value */ value: unknown | null; }; /** WorkflowInvocationCollectionView */ @@ -17367,6 +18869,70 @@ export interface components { [key: string]: number; }; }; + /** WorkflowOutput */ + WorkflowOutput: { + /** + * Label + * @description Label of the output. + */ + label?: string | null; + /** + * Output Name + * @description The name of the step output. + */ + output_name: string; + /** + * UUID + * @description Universal unique identifier of the output. + */ + uuid?: string | null; + }; + /** + * WorkflowStepLayoutPosition + * @description Position and dimensions of the workflow step represented by a box on the graph. + */ + WorkflowStepLayoutPosition: { + /** + * Bottom + * @description Position of the bottom of the box. + */ + bottom?: number | null; + /** + * Height + * @description Height of the box. + */ + height?: number | null; + /** + * Left + * @description Left margin or left-most position of the box. + */ + left: number; + /** + * Right + * @description Right margin or right-most position of the box. + */ + right?: number | null; + /** + * Top + * @description Position of the top of the box. + */ + top: number; + /** + * Width + * @description Width of the box. + */ + width?: number | null; + /** + * X + * @description Horizontal coordinate of the top right corner of the box. + */ + x?: number | null; + /** + * Y + * @description Vertical coordinate of the top right corner of the box. + */ + y?: number | null; + }; /** WriteInvocationStoreToPayload */ WriteInvocationStoreToPayload: { /** @@ -33195,6 +34761,79 @@ export interface operations { }; }; }; + workflow_dict_api_workflows_download__workflow_id__get: { + parameters: { + query?: { + /** @description The history id to import a workflow from. */ + history_id?: string | null; + /** @description The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ + style?: + | ( + | "export" + | "format2" + | "editor" + | "legacy" + | "instance" + | "run" + | "preview" + | "format2_wrapped_yaml" + | "ga" + ) + | null; + /** @description The format to download the workflow in. */ + format?: string | null; + /** @description The version of the workflow to fetch. */ + version?: number | null; + instance?: boolean | null; + }; + header?: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + "run-as"?: string | null; + }; + path: { + /** @description The encoded database identifier of the Stored Workflow. */ + workflow_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": + | components["schemas"]["WorkflowDictEditorSummary"] + | components["schemas"]["StoredWorkflowDetailed"] + | components["schemas"]["WorkflowDictRunSummary"] + | components["schemas"]["WorkflowDictPreviewSummary"] + | components["schemas"]["WorkflowDictFormat2Summary"] + | components["schemas"]["WorkflowDictExportSummary"] + | components["schemas"]["WorkflowDictFormat2WrappedYamlSummary"]; + }; + }; + /** @description Request Error */ + "4XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + /** @description Server Error */ + "5XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + }; + }; get_workflow_menu_api_workflows_menu_get: { parameters: { query?: { @@ -33245,6 +34884,51 @@ export interface operations { }; }; }; + set_workflow_menu_api_workflows_menu_put: { + parameters: { + query?: never; + header?: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + "run-as"?: string | null; + }; + path?: never; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": components["schemas"]["SetWorkflowMenuPayload"] | null; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SetWorkflowMenuSummary"]; + }; + }; + /** @description Request Error */ + "4XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + /** @description Server Error */ + "5XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + }; + }; show_workflow_api_workflows__workflow_id__get: { parameters: { query?: { @@ -33430,6 +35114,79 @@ export interface operations { }; }; }; + workflow_dict_api_workflows__workflow_id__download_get: { + parameters: { + query?: { + /** @description The history id to import a workflow from. */ + history_id?: string | null; + /** @description The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download. */ + style?: + | ( + | "export" + | "format2" + | "editor" + | "legacy" + | "instance" + | "run" + | "preview" + | "format2_wrapped_yaml" + | "ga" + ) + | null; + /** @description The format to download the workflow in. */ + format?: string | null; + /** @description The version of the workflow to fetch. */ + version?: number | null; + instance?: boolean | null; + }; + header?: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + "run-as"?: string | null; + }; + path: { + /** @description The encoded database identifier of the Stored Workflow. */ + workflow_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": + | components["schemas"]["WorkflowDictEditorSummary"] + | components["schemas"]["StoredWorkflowDetailed"] + | components["schemas"]["WorkflowDictRunSummary"] + | components["schemas"]["WorkflowDictPreviewSummary"] + | components["schemas"]["WorkflowDictFormat2Summary"] + | components["schemas"]["WorkflowDictExportSummary"] + | components["schemas"]["WorkflowDictFormat2WrappedYamlSummary"]; + }; + }; + /** @description Request Error */ + "4XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + /** @description Server Error */ + "5XX": { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["MessageExceptionModel"]; + }; + }; + }; + }; enable_link_access_api_workflows__workflow_id__enable_link_access_put: { parameters: { query?: never; diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 8b9c1ecc0bdd..f3592a4ab8b4 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -23,7 +23,6 @@ BeforeValidator, ConfigDict, Field, - Json, model_validator, RootModel, UUID4, @@ -2282,42 +2281,6 @@ class StoredWorkflowSummary(Model, WithModelClass): ) -class WorkflowInput(Model): - label: Optional[str] = Field( - ..., - title="Label", - description="Label of the input.", - ) - value: Optional[Any] = Field( - ..., - title="Value", - description="TODO", - ) - uuid: Optional[UUID4] = Field( - ..., - title="UUID", - description="Universal unique identifier of the input.", - ) - - -class WorkflowOutput(Model): - label: Optional[str] = Field( - None, - title="Label", - description="Label of the output.", - ) - output_name: str = Field( - ..., - title="Output Name", - description="The name assigned to the output.", - ) - uuid: Optional[UUID4] = Field( - None, - title="UUID", - description="Universal unique identifier of the output.", - ) - - class InputStep(Model): source_step: int = Field( ..., @@ -2456,201 +2419,9 @@ class Person(Creator): ) -class Input(Model): - name: str = Field(..., title="Name", description="The name of the input.") - description: str = Field(..., title="Description", description="The annotation or description of the input.") - - -class Output(Model): - name: str = Field(..., title="Name", description="The name of the output.") - type: str = Field(..., title="Type", description="The extension or type of output.") - - -class InputConnection(Model): - id: int = Field(..., title="ID", description="The identifier of the input.") - output_name: str = Field( - ..., - title="Output Name", - description="The name assigned to the output.", - ) - input_subworkflow_step_id: Optional[int] = Field( - None, - title="Input Subworkflow Step ID", - description="TODO", - ) - - -class WorkflowStepLayoutPosition(Model): - """Position and dimensions of the workflow step represented by a box on the graph.""" - - bottom: int = Field(..., title="Bottom", description="Position in pixels of the bottom of the box.") - top: int = Field(..., title="Top", description="Position in pixels of the top of the box.") - left: int = Field(..., title="Left", description="Left margin or left-most position of the box.") - right: int = Field(..., title="Right", description="Right margin or right-most position of the box.") - x: int = Field(..., title="X", description="Horizontal pixel coordinate of the top right corner of the box.") - y: int = Field(..., title="Y", description="Vertical pixel coordinate of the top right corner of the box.") - height: int = Field(..., title="Height", description="Height of the box in pixels.") - width: int = Field(..., title="Width", description="Width of the box in pixels.") - - InvocationsStateCounts = RootModel[Dict[str, int]] -class WorkflowStepToExportBase(Model): - id: int = Field( - ..., - title="ID", - description="The identifier of the step. It matches the index order of the step inside the workflow.", - ) - type: str = Field(..., title="Type", description="The type of workflow module.") - name: str = Field(..., title="Name", description="The descriptive name of the module or step.") - annotation: Optional[str] = AnnotationField - tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? - None, title="Tool ID", description="The unique name of the tool associated with this step." - ) - uuid: UUID4 = Field( - ..., - title="UUID", - description="Universal unique identifier of the workflow.", - ) - label: Optional[str] = Field( - None, - title="Label", - ) - inputs: List[Input] = Field( - ..., - title="Inputs", - description="TODO", - ) - outputs: List[Output] = Field( - ..., - title="Outputs", - description="TODO", - ) - input_connections: Dict[str, InputConnection] = Field( - {}, - title="Input Connections", - description="TODO", - ) - position: WorkflowStepLayoutPosition = Field( - ..., - title="Position", - description="Layout position of this step in the graph", - ) - workflow_outputs: List[WorkflowOutput] = Field( - [], title="Workflow Outputs", description="Workflow outputs associated with this step." - ) - - -class WorkflowStepToExport(WorkflowStepToExportBase): - content_id: Optional[str] = Field( # Duplicate of `tool_id` or viceversa? - None, title="Content ID", description="TODO" - ) - tool_version: Optional[str] = Field( - None, title="Tool Version", description="The version of the tool associated with this step." - ) - tool_state: Json = Field( - ..., - title="Tool State", - description="JSON string containing the serialized representation of the persistable state of the step.", - ) - errors: Optional[str] = Field( - None, - title="Errors", - description="An message indicating possible errors in the step.", - ) - - -class ToolShedRepositorySummary(Model): - name: str = Field( - ..., - title="Name", - description="The name of the repository.", - ) - owner: str = Field( - ..., - title="Owner", - description="The owner of the repository.", - ) - changeset_revision: str = Field( - ..., - title="Changeset Revision", - description="TODO", - ) - tool_shed: str = Field( - ..., - title="Tool Shed", - description="The Tool Shed base URL.", - ) - - -class PostJobAction(Model): - action_type: str = Field( - ..., - title="Action Type", - description="The type of action to run.", - ) - output_name: str = Field( - ..., - title="Output Name", - description="The name of the output that will be affected by the action.", - ) - action_arguments: Dict[str, Any] = Field( - ..., - title="Action Arguments", - description="Any additional arguments needed by the action.", - ) - - -class WorkflowToolStepToExport(WorkflowStepToExportBase): - tool_shed_repository: ToolShedRepositorySummary = Field( - ..., title="Tool Shed Repository", description="Information about the origin repository of this tool." - ) - post_job_actions: Dict[str, PostJobAction] = Field( - ..., title="Post-job Actions", description="Set of actions that will be run when the job finish." - ) - - -class SubworkflowStepToExport(WorkflowStepToExportBase): - subworkflow: "WorkflowToExport" = Field( - ..., title="Subworkflow", description="Full information about the subworkflow associated with this step." - ) - - -class WorkflowToExport(Model): - a_galaxy_workflow: str = Field( # Is this meant to be a bool instead? - "true", title="Galaxy Workflow", description="Whether this workflow is a Galaxy Workflow." - ) - format_version: str = Field( - "0.1", - alias="format-version", # why this field uses `-` instead of `_`? - title="Galaxy Workflow", - description="Whether this workflow is a Galaxy Workflow.", - ) - name: str = Field(..., title="Name", description="The name of the workflow.") - annotation: Optional[str] = AnnotationField - tags: TagCollection - uuid: Optional[UUID4] = Field( - None, - title="UUID", - description="Universal unique identifier of the workflow.", - ) - creator: Optional[List[Union[Person, Organization]]] = Field( - None, - title="Creator", - description=("Additional information about the creator (or multiple creators) of this workflow."), - ) - license: Optional[str] = Field( - None, title="License", description="SPDX Identifier of the license associated with this workflow." - ) - version: int = Field( - ..., title="Version", description="The version of the workflow represented by an incremental number." - ) - steps: Dict[int, Union[SubworkflowStepToExport, WorkflowToolStepToExport, WorkflowStepToExport]] = Field( - {}, title="Steps", description="A dictionary with information about all the steps of the workflow." - ) - - # Roles ----------------------------------------------------------------- RoleIdField = Annotated[EncodedDatabaseIdField, Field(title="ID", description="Encoded ID of the role")] diff --git a/lib/galaxy/schema/workflows.py b/lib/galaxy/schema/workflows.py index 4e80dcb7c55e..e233e9058c9f 100644 --- a/lib/galaxy/schema/workflows.py +++ b/lib/galaxy/schema/workflows.py @@ -10,9 +10,14 @@ from pydantic import ( Field, field_validator, + UUID4, +) +from typing_extensions import ( + Annotated, + Literal, ) -from typing_extensions import Annotated +from galaxy.schema.fields import DecodedDatabaseIdField from galaxy.schema.schema import ( AnnotationField, InputDataCollectionStep, @@ -25,9 +30,190 @@ PreferredObjectStoreIdField, StoredWorkflowSummary, SubworkflowStep, + TagCollection, ToolStep, - WorkflowInput, ) +from galaxy.schema.workflow.comments import WorkflowCommentModel + +WorkflowAnnotationField = Annotated[ + Optional[str], + Field( + title="Annotation", + description="An annotation to provide details or to help understand the purpose and usage of this item.", + ), +] + +WorkflowCreator = Annotated[ + Optional[List[Union[Person, Organization]]], + Field( + None, + title="Creator", + description=("Additional information about the creator (or multiple creators) of this workflow."), + ), +] + + +class WorkflowDictExportStepInput(Model): + name: str = Field(..., title="Name", description="The name of the input.") + description: str = Field(..., title="Description", description="The annotation or description of the input.") + + +class InputConnectionBase(Model): + id: int = Field(..., title="ID", description="The order index of the step.") + output_name: str = Field( + ..., + title="Output Name", + description="The output name of the input step that serves as the source for this connection.", + ) + + +class InputConnectionExport(InputConnectionBase): + input_subworkflow_step_id: Optional[int] = Field( + None, + title="Input Subworkflow Step ID", + ) + + +class InputConnectionEditor(InputConnectionBase): + input_type: str = Field( + ..., + title="Input Type", + description="The input type of the workflow step.", + ) + + +class WorkflowStepLayoutPosition(Model): + """Position and dimensions of the workflow step represented by a box on the graph.""" + + bottom: Optional[Union[int, float]] = Field( + None, + title="Bottom", + description="Position of the bottom of the box.", + ) + top: Union[int, float] = Field( + ..., + title="Top", + description="Position of the top of the box.", + ) + left: Union[int, float] = Field( + ..., + title="Left", + description="Left margin or left-most position of the box.", + ) + right: Optional[Union[int, float]] = Field( + None, + title="Right", + description="Right margin or right-most position of the box.", + ) + x: Optional[int] = Field( + None, + title="X", + description="Horizontal coordinate of the top right corner of the box.", + ) + y: Optional[int] = Field( + None, + title="Y", + description="Vertical coordinate of the top right corner of the box.", + ) + height: Optional[Union[int, float]] = Field( + None, + title="Height", + description="Height of the box.", + ) + width: Optional[Union[int, float]] = Field( + None, + title="Width", + description="Width of the box.", + ) + + +class WorkflowInput(Model): + label: Optional[str] = Field( + ..., + title="Label", + description="Label of the input.", + ) + value: Optional[Any] = Field( + ..., + title="Value", + ) + uuid: Optional[UUID4] = Field( + ..., + title="UUID", + description="Universal unique identifier of the input.", + ) + + +class WorkflowOutput(Model): + label: Optional[str] = Field( + None, + title="Label", + description="Label of the output.", + ) + output_name: str = Field( + ..., + title="Output Name", + description="The name of the step output.", + ) + uuid: Optional[UUID4] = Field( + None, + title="UUID", + description="Universal unique identifier of the output.", + ) + + +class ToolShedRepositorySummary(Model): + name: str = Field( + ..., + title="Name", + description="The name of the repository.", + ) + owner: str = Field( + ..., + title="Owner", + description="The owner of the repository.", + ) + changeset_revision: str = Field( + ..., + title="Changeset Revision", + ) + tool_shed: str = Field( + ..., + title="Tool Shed", + description="The Tool Shed base URL.", + ) + + +class PostJobAction(Model): + action_type: str = Field( + ..., + title="Action Type", + description="The type of action to run.", + ) + output_name: str = Field( + ..., + title="Output Name", + description="The name of the output that will be affected by the action.", + ) + action_arguments: Dict[str, Any] = Field( + ..., + title="Action Arguments", + description="Any additional arguments needed by the action.", + ) + short_str: Optional[str] = Field( + None, + title="Short String", + description="A short string representation of the action.", + ) + + +class StepIn(Model): + # TODO - add proper type and description - see _workflow_to_dict_export in manager for more details + # or class WorkflowStepInput + default: Any = Field( + ..., + title="Default", + ) class GetTargetHistoryPayload(Model): @@ -35,19 +221,16 @@ class GetTargetHistoryPayload(Model): history: Optional[str] = Field( None, title="History", - # description="The encoded history id - passed exactly like this 'hist_id=...' - to import the workflow into. Or the name of the new history to import the workflow into.", description="The encoded history id - passed exactly like this 'hist_id=...' - into which to import. Or the name of the new history into which to import.", ) history_id: Optional[str] = Field( None, title="History ID", - # description="The history to import the workflow into.", description="The encoded history id into which to import.", ) new_history_name: Optional[str] = Field( None, title="New History Name", - # description="The name of the new history to import the workflow into.", description="The name of the new history into which to import.", ) @@ -78,7 +261,6 @@ class InvokeWorkflowPayload(GetTargetHistoryPayload): True, title="Require Exact Tool Versions", description="If true, exact tool versions are required for workflow invocation.", - # description="TODO", ) allow_tool_state_corrections: Optional[bool] = Field( False, @@ -120,27 +302,22 @@ def inputs_string_to_json(cls, v): inputs: Optional[Dict[str, Any]] = Field( None, title="Inputs", - description="TODO", ) ds_map: Optional[Dict[str, Dict[str, Any]]] = Field( {}, title="Dataset Map", - description="TODO", ) resource_params: Optional[Dict[str, Any]] = Field( {}, title="Resource Parameters", - description="TODO", ) replacement_params: Optional[Dict[str, Any]] = Field( {}, title="Replacement Parameters", - description="TODO", ) step_parameters: Optional[Dict[str, Any]] = Field( None, title="Step Parameters", - description="TODO", ) no_add_to_history: Optional[bool] = Field( False, @@ -162,7 +339,6 @@ def inputs_string_to_json(cls, v): None, title="Effective Outputs", # lib/galaxy/workflow/run_request.py - see line 455 - description="TODO", ) preferred_intermediate_object_store_id: Optional[str] = Field( None, @@ -188,11 +364,7 @@ class StoredWorkflowDetailed(StoredWorkflowSummary): inputs: Dict[int, WorkflowInput] = Field( {}, title="Inputs", description="A dictionary containing information about all the inputs of the workflow." ) - creator: Optional[List[Union[Person, Organization]]] = Field( - None, - title="Creator", - description=("Additional information about the creator (or multiple creators) of this workflow."), - ) + creator: WorkflowCreator steps: Dict[ int, Annotated[ @@ -231,3 +403,914 @@ class StoredWorkflowDetailed(StoredWorkflowSummary): title="Source Metadata", description="The source metadata of the workflow.", ) + + +class SetWorkflowMenuPayload(Model): + workflow_ids: Union[List[DecodedDatabaseIdField], DecodedDatabaseIdField] = Field( + ..., + title="Workflow IDs", + description="The list of workflow IDs to set the menu entry for.", + ) + + +class SetWorkflowMenuSummary(Model): + message: Optional[Any] = Field( + ..., + title="Message", + description="The message of the operation.", + ) + status: str = Field( + ..., + title="Status", + description="The status of the operation.", + ) + + +# see lib/galaxy/tools/parameters/__init__.py - def populate_state +RunStepLiteralError = Literal[ + "The number of repeat elements is outside the range specified by the tool.", + "The selected case is unavailable/invalid.", +] + +# see lib/galaxy/tools/parameters/__init__.py - def check_param +RunStepValueError = Union[ + # ValueError, + str, # unicodify(ValueError) +] + +# see lib/galaxy/tools/__init__.py - def to_json +RunStepError = Union[ + RunStepLiteralError, + RunStepValueError, +] + +# see lib/galaxy/workflow/modules.py - def get_errors +GeneralStepError = Union[ + Literal["Tool is not installed"], + str, # f"{self.tool_id} is not installed" +] + +# see lib/galaxy/managers/workflows.py - _workflow_to_dict_* +StepError = Union[ + Dict[str, RunStepError], + GeneralStepError, + List[GeneralStepError], +] + + +# TODO control typing +# see lib/galaxy/managers/workflows.py - line 1555 +class ExportDictStepToolOutput(Model): + name: str = Field( + ..., + title="Export step output name", + ) + type: str = Field( + ..., + title="Export step output type", + ) + + +# see lib/galaxy/tools/__init__.py - line 2404/2444 +# lib/galaxy/tool_util/parser/output_objects.py - line 123 +class RunStepToolOutput(Model): + name: str = Field( + ..., + ) + format: str = Field( + ..., + ) + label: str = Field( + ..., + ) + hidden: bool = Field( + ..., + ) + output_type: str = Field( + ..., + ) + format_source: Optional[str] = Field( + ..., + ) + default_identifier_source: str = Field( + ..., + ) + metadata_source: str = Field( + ..., + ) + parent: Optional[str] = Field( + ..., + ) + count: int = Field( + ..., + ) + from_work_dir: Optional[bool] = Field( + ..., + ) + edam_format: str = Field( + ..., + ) + edam_data: str = Field( + ..., + ) + # see lib/galaxy/tool_util/parser/output_collection_def.py - line 78 + discover_datasets: List[Any] = Field( + ..., + ) + + +# There is no need to model a class for the output of SubworkflowModule +# as it is equal to the output of one of the other modules + + +# see lib/galaxy/workflow/modules.py - class InputDataModule; method get_all_outputs +class InputDataModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Input data module step output name", + ) + extensions: Union[str, List[str]] = Field( + ..., + title="Input data module step output extensions", + ) + optional: bool = Field( + ..., + title="Is optional", + ) + + +# see lib/galaxy/workflow/modules.py - - class InputDataCollectionModule; method get_all_outputs +class InputDataCollectionModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Input data collection module step output name", + ) + extensions: Union[str, List[str]] = Field( + ..., + title="Input data collection module step output extensions", + ) + collection: Literal[True] = Field( + ..., + title="Is collection", + ) + collection_type: str = Field( + ..., + title="Input data collection module step output collection type", + ) + optional: bool = Field( + ..., + title="Is optional", + ) + + +# see lib/galaxy/workflow/modules.py - - class InputParameterModule; method get_all_outputs +class InputParameterModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Input data module step output name", + ) + label: str = Field( + ..., + title="Input data module step output label", + ) + type: str = Field( + ..., + title="Input data module step output parameter type", + ) + optional: bool = Field( + ..., + title="Is optional", + ) + parameter: Literal[True] = Field( + ..., + title="Is parameter", + ) + + +# see lib/galaxy/workflow/modules.py - class PauseModule; method get_all_outputs +class PauseModuleStepOutput(Model): + name: Literal["output"] = Field( + ..., + title="Pause module step output name", + ) + label: Literal["Reviewed Dataset"] = Field( + ..., + title="Pause module step output label", + ) + extension: List[Literal["input"]] = Field( + ..., + ) + + +# see lib/galaxy/workflow/modules.py - class ToolModule; method get_all_outputs +class ToolModuleStepOutput(Model): + name: str = Field( + ..., + title="Tool module step output name", + ) + extensions: List[str] = Field( + ..., + title="Tool module step output extensions", + ) + type: str = Field( + ..., + title="Tool module step output type", + ) + optional: Literal[False] = Field(..., title="Is optional") + parameter: Optional[Literal[True]] = Field( + None, + title="Is parameter", + ) + collection: Optional[Literal[True]] = Field( + None, + title="Is collection", + ) + collection_type: Optional[str] = Field( + None, + title="Tool module step output collection type", + ) + collection_type_source: Optional[str] = Field( + None, + ) + label: Optional[Any] = Field( + None, + title="Tool module step output label", + ) + + +# used by: WorkflowDictEditorStep +ModulesStepOutput = Union[ + InputDataModuleStepOutput, + InputDataCollectionModuleStepOutput, + InputParameterModuleStepOutput, + PauseModuleStepOutput, + ToolModuleStepOutput, +] + + +class WorkflowDictStepsBase(Model): + when: Optional[str] = Field( + None, + title="When", + description="The when expression for the step.", + ) + # We should eventually clean this up, `Dict[str, PostJobAction]]` is probably the better form. + post_job_actions: Optional[Union[List[PostJobAction], Dict[str, PostJobAction]]] = Field( + None, + title="Post Job Actions", + description="Set of actions that will be run when the job finishes.", + ) + tool_version: Optional[str] = Field( + None, + title="Tool Version", + description="The version of the tool associated with the step.", + ) + errors: Optional[StepError] = Field( + None, + title="Errors", + description="An message indicating possible errors in the step.", + ) + position: Optional[WorkflowStepLayoutPosition] = Field( + None, + title="Position", + description="Layout position of this step in the graph", + ) + # TODO: model outputs + # # outputs: Optional[List[Dict[str, Any]]] = Field( + # None, + # title="Outputs", + # description="The outputs of the step.", + # ) + tool_state: Optional[Union[Dict[str, Any], str]] = Field( + None, + title="Tool State", + description="The state of the tool associated with the step", + ) + content_id: Optional[str] = Field( + None, + title="Content ID", + description="The content ID of the step.", + ) + workflow_outputs: Optional[List[WorkflowOutput]] = Field( + None, + title="Workflow Outputs", + description="Workflow outputs associated with this step.", + ) + + # @field_validator( + # "tool_state", + # mode="before", + # check_fields=False, + # ) + # @classmethod + # def inputs_string_to_json(cls, v): + # if isinstance(v, str): + # return json.loads(v) + # return v + + +class WorkflowDictStepsExtendedBase(WorkflowDictStepsBase): + type: str = Field( + ..., + title="Type", + description="The type of the module that represents a step in the workflow.", + ) + label: Optional[str] = Field( + None, + title="Label", + description="The label of the step.", + ) + + +class WorkflowDictRunStep(WorkflowDictStepsBase): + inputs: List[Dict[str, Any]] = Field( + ..., + title="Inputs", + description="The inputs of the step.", + ) + replacement_parameters: Optional[List[Union[str, Dict[str, Any]]]] = Field( + None, + title="Replacement Parameters", + description="Informal replacement parameters for the step.", + ) + step_name: str = Field(..., title="Step Name", description="The descriptive name of the module or step.") + step_version: Optional[str] = Field( + None, + title="Step Version", + description="The version of the step's module.", + ) + step_index: int = Field( + ..., + title="Step Index", + description="The order index of the step.", + ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) + output_connections: List[Dict[str, Any]] = Field( + ..., + title="Output Connections", + description="The output connections of the step.", + ) + annotation: WorkflowAnnotationField = None + messages: Optional[List[str]] = Field( + None, + title="Messages", + description="Upgrade messages for the step.", + ) + step_type: str = Field( + ..., + title="Step Type", + description="The type of the step.", + ) + step_label: Optional[str] = Field( + None, + title="Step Label", + description="The label of the step.", + ) + + +class WorkflowDictRunToolStep(WorkflowDictRunStep): + # TODO: remove everything that can be gotten through the tool store + outputs: List[RunStepToolOutput] = Field( + ..., + title="Outputs", + description="The outputs of the step.", + ) + model_class: Literal["tool"] = Field( + ..., + title="Model Class", + description="The model class of the tool step.", + ) + id: str = Field( + ..., + title="ID", + description="The identifier of the tool step.", + ) + name: str = Field( + ..., + title="Name", + description="The name of the tool step.", + ) + version: str = Field( + ..., + title="Version", + description="The version of the tool step.", + ) + description: str = Field( + ..., + title="Description", + description="The description of the tool step.", + ) + labels: List[str] = Field( + ..., + title="Labels", + description="The labels of the tool step.", + ) + edam_operations: List[str] = Field( + ..., + title="EDAM Operations", + description="The EDAM operations of the tool step.", + ) + edam_topics: List[str] = Field( + ..., + title="EDAM Topics", + description="The EDAM topics of the tool step.", + ) + hidden: str = Field( + ..., + title="Hidden", + description="The hidden status of the tool step.", + ) + is_workflow_compatible: bool = Field( + ..., + title="Is Workflow Compatible", + description="Indicates if the tool step is compatible with workflows.", + ) + xrefs: List[str] = Field( + ..., + title="XRefs", + description="The cross-references of the tool step.", + ) + panel_section_id: str = Field( + ..., + title="Panel Section ID", + description="The panel section ID of the tool step.", + ) + panel_section_name: str = Field( + ..., + title="Panel Section Name", + description="The panel section name of the tool step.", + ) + form_style: str = Field( + ..., + title="Form Style", + description="The form style of the tool step.", + ) + help: str = Field( + ..., + title="Help", + description="The help of the tool step.", + ) + citations: bool = Field( + ..., + title="Citations", + description="The citations of the tool step.", + ) + sharable_url: Optional[str] = Field( + None, + title="Sharable URL", + description="The sharable URL of the tool step.", + ) + message: str = Field( + ..., + title="Message", + description="The message of the tool step.", + ) + warnings: Optional[str] = Field( + None, + title="Warnings", + description="The warnings of the tool step.", + ) + versions: List[str] = Field( + ..., + title="Versions", + description="The versions of the tool step.", + ) + requirements: List[str] = Field( + ..., + title="Requirements", + description="The requirements of the tool step.", + ) + tool_errors: Optional[str] = Field( + None, + title="Tool Errors", + description="An message indicating possible errors in the tool step.", + ) + state_inputs: Dict[str, Any] = Field( + ..., + title="State Inputs", + description="The state inputs of the tool step.", + ) + job_id: Optional[str] = Field( + None, + title="Job ID", + description="The ID of the job associated with the tool step.", + ) + job_remap: Optional[str] = Field( + None, + title="Job Remap", + description="The remap of the job associated with the tool step.", + ) + history_id: str = Field( + ..., + title="History ID", + description="The ID of the history associated with the tool step.", + ) + display: bool = Field( + ..., + title="Display", + description="Indicates if the tool step should be displayed.", + ) + action: str = Field( + ..., + title="Action", + description="The action of the tool step.", + ) + license: Optional[str] = Field( + None, + title="License", + description="The license of the tool step.", + ) + creator: Optional[str] = Field( + None, + title="Creator", + description="The creator of the tool step.", + ) + method: str = Field( + ..., + title="Method", + description="The method of the tool step.", + ) + enctype: str = Field( + ..., + title="Enctype", + description="The enctype of the tool step.", + ) + tool_shed_repository: Optional[ToolShedRepositorySummary] = Field( + None, + title="Tool Shed Repository", + description="Information about the tool shed repository associated with the tool.", + ) + link: Optional[str] = Field( + None, + title="Link", + description="The link of the tool step.", + ) + # TODO - see lib/galaxy/tools/__init__.py - class Tool - to_dict for further typing + min_width: Optional[Any] = Field( + None, + title="Min Width", + description="The minimum width of the tool step.", + ) + # TODO - see lib/galaxy/tools/__init__.py - class Tool - to_dict for further typing + target: Optional[Any] = Field( + None, + title="Target", + description="The target of the tool step.", + ) + tool_id: str = Field( # Duplicate of `content_id` or viceversa? + ..., + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) + + +class WorkflowDictPreviewStep(WorkflowDictStepsExtendedBase): + order_index: int = Field( + ..., + title="Order Index", + description="The order index of the step.", + ) + annotation: WorkflowAnnotationField = None + label: str = Field( + ..., + title="Label", + description="The label of the step.", + ) + inputs: List[Dict[str, Any]] = Field( + ..., + title="Inputs", + description="The inputs of the step.", + ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) + + +class WorkflowDictEditorStep(WorkflowDictStepsExtendedBase): + id: int = Field( + ..., + title="ID", + description="The identifier of the step. It matches the index order of the step inside the workflow.", + ) + name: Optional[str] = Field( + None, + title="Name", + description="The descriptive name of the module or step.", + ) + inputs: Optional[List[Dict[str, Any]]] = Field( + None, + title="Inputs", + description="The inputs of the step.", + ) + config_form: Optional[Dict[str, Any]] = Field( + None, + title="Config Form", + description="The configuration form for the step.", + ) + annotation: WorkflowAnnotationField + uuid: Optional[UUID4] = Field( + None, + title="UUID", + description="Universal unique identifier of the workflow.", + ) + tooltip: Optional[str] = Field( + None, + title="Tooltip", + description="The tooltip for the step.", + ) + input_connections: Optional[Dict[str, Union[InputConnectionEditor, List[InputConnectionEditor]]]] = Field( + # input_connections: Optional[Dict[str, Any]] = Field( + None, + title="Input Connections", + description="The input connections for the step.", + ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) + outputs: Optional[List[ModulesStepOutput]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) + + +class WorkflowDictExportStep(WorkflowDictStepsExtendedBase): + id: int = Field( + ..., + title="ID", + description="The identifier of the step. It matches the index order of the step inside the workflow.", + ) + name: str = Field( + ..., + title="Name", + description="The descriptive name of the module or step.", + ) + uuid: UUID4 = Field( + ..., + title="UUID", + description="Universal unique identifier of the workflow.", + ) + annotation: WorkflowAnnotationField = None + tool_shed_repository: Optional[ToolShedRepositorySummary] = Field( + None, + title="Tool Shed Repository", + description="Information about the tool shed repository associated with the tool.", + ) + tool_representation: Optional[Dict[str, Any]] = Field( + None, + title="Tool Representation", + description="The representation of the tool associated with the step.", + ) + subworkflow: Optional["WorkflowDictExportSummary"] = Field( + None, + title="Sub Workflow", + description="Full information about the subworkflow associated with this step.", + ) + tool_id: Optional[str] = Field( # Duplicate of `content_id` or viceversa? + None, + title="Tool ID", + description="The unique name of the tool associated with this step.", + ) + inputs: Optional[List[WorkflowDictExportStepInput]] = Field( + None, + title="Inputs", + description="The inputs of the step.", + ) + outputs: Optional[List[ExportDictStepToolOutput]] = Field( + None, + title="Outputs", + description="The outputs of the step.", + ) + in_parameter: Optional[Dict[str, StepIn]] = Field(None, title="In", alias="in") + input_connections: Optional[Dict[str, Union[InputConnectionExport, List[InputConnectionExport]]]] = Field( + None, + title="Input Connections", + description="The input connections of the step.", + ) + + +class WorkflowDictBaseModel(Model): + name: str = Field( + ..., + title="Name", + description="The name of the workflow.", + ) + + +class WorkflowDictExtendedBaseModel(WorkflowDictBaseModel): + version: int = Field( + ..., + title="Version", + description="The version of the workflow represented by an incremental number.", + ) + + +class WorkflowDictPreviewSummary(WorkflowDictExtendedBaseModel): + steps: List[WorkflowDictPreviewStep] = Field( + ..., + title="Steps", + description="Information about all the steps of the workflow.", + ) + + +class WorkflowDictEditorSummary(WorkflowDictExtendedBaseModel): + upgrade_messages: Dict[int, str] = Field( + ..., + title="Upgrade Messages", + description="Upgrade messages for each step in the workflow.", + ) + # TODO - can this be modeled further? see manager method _workflow_to_dict_editor + report: Dict[str, Any] = Field( + ..., + title="Report", + description="The reports configuration for the workflow.", + ) + comments: List[WorkflowCommentModel] = Field( + ..., + title="Comments", + description="Comments on the workflow.", + ) + annotation: WorkflowAnnotationField + license: Optional[str] = Field( + ..., + title="License", + description="SPDX Identifier of the license associated with this workflow.", + ) + creator: WorkflowCreator + source_metadata: Optional[Dict[str, Any]] = Field( + ..., + title="Source Metadata", + description="Metadata about the source of the workflow", + ) + steps: Dict[int, WorkflowDictEditorStep] = Field( + ..., + title="Steps", + description="Information about all the steps of the workflow.", + ) + + +class WorkflowDictRunSummary(WorkflowDictExtendedBaseModel): + id: str = Field( + ..., + title="ID", + description="The encoded ID of the stored workflow.", + ) + history_id: Optional[str] = Field( + None, + title="History ID", + description="The encoded ID of the history associated with the workflow.", + ) + step_version_changes: List[Union[str, Dict[str, Any]]] = Field( + ..., + title="Step Version Changes", + description="Version changes for the workflow steps.", + ) + has_upgrade_messages: bool = Field( + ..., + title="Has Upgrade Messages", + description="Whether the workflow has upgrade messages.", + ) + workflow_resource_parameters: Optional[Dict[str, Any]] = Field( + ..., + title="Workflow Resource Parameters", + description="The resource parameters of the workflow.", + ) + steps: List[Union[WorkflowDictRunToolStep, WorkflowDictRunStep]] = Field( + ..., + title="Steps", + description="Information about all the steps of the workflow.", + ) + + +class WorkflowDictExportSummary(WorkflowDictBaseModel): + a_galaxy_workflow: Literal["true"] = Field( + # a_galaxy_workflow: str = Field( + ..., + title="A Galaxy Workflow", + description="Whether this workflow is a Galaxy Workflow.", + ) + version: Optional[int] = Field( + None, + title="Version", + description="The version of the workflow represented by an incremental number.", + ) + format_version: Literal["0.1"] = Field( + # format_version: str = Field( + ..., + alias="format-version", + title="Format Version", + description="The version of the workflow format being used.", + ) + annotation: WorkflowAnnotationField + tags: TagCollection = Field( + ..., + title="Tags", + description="The tags associated with the workflow.", + ) + uuid: Optional[UUID4] = Field( + None, + title="UUID", + description="The UUID (Universally Unique Identifier) of the workflow.", + ) + comments: List[WorkflowCommentModel] = Field( + # comments: List[Dict[str, Any]] = Field( + ..., + title="Comments", + description="Comments associated with the workflow.", + ) + report: Optional[Dict[str, Any]] = Field( + None, + title="Report", + description="The configuration for generating a report for the workflow.", + ) + creator: WorkflowCreator + license: Optional[str] = Field( + None, + title="License", + description="SPDX Identifier of the license associated with this workflow.", + ) + source_metadata: Optional[Dict[str, Any]] = Field( + None, + title="Source Metadata", + description="Metadata about the source of the workflow.", + ) + steps: Dict[int, WorkflowDictExportStep] = Field( + ..., + title="Steps", + description="Information about all the steps of the workflow.", + ) + + +class WorkflowDictFormat2Summary(Model): + workflow_class: Literal["GalaxyWorkflow"] = Field( + ..., + title="Class", + description="The class of the workflow.", + alias="class", + ) + label: Optional[str] = Field( + None, + title="Label", + description="The label or name of the workflow.", + ) + creator: WorkflowCreator + license: Optional[str] = Field( + None, + title="License", + description="SPDX Identifier of the license associated with this workflow.", + ) + release: Optional[str] = Field( + None, + title="Release", + description="The release information for the workflow.", + ) + tags: Optional[TagCollection] = Field( + None, + title="Tags", + description="The tags associated with the workflow.", + ) + uuid: Optional[UUID4] = Field( + None, + title="UUID", + description="The UUID (Universally Unique Identifier) of the workflow.", + ) + report: Optional[Dict[str, Any]] = Field( + None, + title="Report", + description="The configuration for generating a report for the workflow.", + ) + inputs: Dict[str, Any] = Field( + ..., + title="Inputs", + description="The inputs of the workflow.", + ) + outputs: Dict[str, Any] = Field( + ..., + title="Outputs", + description="The outputs of the workflow.", + ) + # TODO - can be modeled further see manager method workflow_to_dict + steps: Dict[str, Any] = Field( + ..., + title="Steps", + description="Information about all the steps of the workflow.", + ) + doc: WorkflowAnnotationField = None + + +class WorkflowDictFormat2WrappedYamlSummary(Model): + # TODO What type is this? + yaml_content: Any = Field( + ..., + title="YAML Content", + # description="Safe and ordered dump of YAML to stream", + description="The content of the workflow in YAML .", + ) diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 05a475d430e6..098d516eee87 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -10,6 +10,7 @@ Any, Dict, List, + Literal, Optional, Union, ) @@ -21,7 +22,6 @@ Response, status, ) -from gxformat2.yaml import ordered_dump from pydantic import ( UUID1, UUID4, @@ -78,7 +78,15 @@ ) from galaxy.schema.workflows import ( InvokeWorkflowPayload, + SetWorkflowMenuPayload, + SetWorkflowMenuSummary, StoredWorkflowDetailed, + WorkflowDictEditorSummary, + WorkflowDictExportSummary, + WorkflowDictFormat2Summary, + WorkflowDictFormat2WrappedYamlSummary, + WorkflowDictPreviewSummary, + WorkflowDictRunSummary, ) from galaxy.structured_app import StructuredApp from galaxy.tool_shed.galaxy_install.install_manager import InstallRepositoryManager @@ -86,11 +94,7 @@ from galaxy.tools._types import ParameterValidationErrorsT from galaxy.tools.parameters import populate_state from galaxy.tools.parameters.workflow_utils import workflow_building_modes -from galaxy.web import ( - expose_api, - expose_api_raw_anonymous_and_sessionless, - format_return_as_json, -) +from galaxy.web import expose_api from galaxy.webapps.base.controller import ( SharableMixin, url_for, @@ -145,46 +149,6 @@ def __init__(self, app: StructuredApp): self.workflow_contents_manager = app.workflow_contents_manager self.tool_recommendations = recommendations.ToolRecommendations() - @expose_api - def set_workflow_menu(self, trans: GalaxyWebTransaction, payload=None, **kwd): - """ - Save workflow menu to be shown in the tool panel - PUT /api/workflows/menu - """ - payload = payload or {} - user = trans.user - workflow_ids = payload.get("workflow_ids") - if workflow_ids is None: - workflow_ids = [] - elif not isinstance(workflow_ids, list): - workflow_ids = [workflow_ids] - workflow_ids_decoded = [] - # Decode the encoded workflow ids - for ids in workflow_ids: - workflow_ids_decoded.append(trans.security.decode_id(ids)) - session = trans.sa_session - # This explicit remove seems like a hack, need to figure out - # how to make the association do it automatically. - for m in user.stored_workflow_menu_entries: - session.delete(m) - user.stored_workflow_menu_entries = [] - # To ensure id list is unique - seen_workflow_ids = set() - for wf_id in workflow_ids_decoded: - if wf_id in seen_workflow_ids: - continue - else: - seen_workflow_ids.add(wf_id) - m = model.StoredWorkflowMenuEntry() - m.stored_workflow = session.get(model.StoredWorkflow, wf_id) - - user.stored_workflow_menu_entries.append(m) - with transaction(session): - session.commit() - message = "Menu updated." - trans.set_message(message) - return {"message": message, "status": "done"} - @expose_api def create(self, trans: GalaxyWebTransaction, payload=None, **kwd): """ @@ -323,56 +287,6 @@ def create(self, trans: GalaxyWebTransaction, payload=None, **kwd): # This was already raised above, but just in case... raise exceptions.RequestParameterMissingException("No method for workflow creation supplied.") - @expose_api_raw_anonymous_and_sessionless - def workflow_dict(self, trans: GalaxyWebTransaction, workflow_id, **kwd): - """ - GET /api/workflows/{encoded_workflow_id}/download - - Returns a selected workflow. - - :type style: str - :param style: Style of export. The default is 'export', which is the meant to be used - with workflow import endpoints. Other formats such as 'instance', 'editor', - 'run' are more tied to the GUI and should not be considered stable APIs. - The default format for 'export' is specified by the - admin with the `default_workflow_export_format` config - option. Style can be specified as either 'ga' or 'format2' directly - to be explicit about which format to download. - - :param instance: true if fetch by Workflow ID instead of StoredWorkflow id, false - by default. - :type instance: boolean - """ - stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id, **kwd) - - style = kwd.get("style", "export") - download_format = kwd.get("format") - version = kwd.get("version") - history = None - if history_id := kwd.get("history_id"): - history = self.history_manager.get_accessible( - self.decode_id(history_id), trans.user, current_history=trans.history - ) - ret_dict = self.workflow_contents_manager.workflow_to_dict( - trans, stored_workflow, style=style, version=version, history=history - ) - if download_format == "json-download": - sname = stored_workflow.name - sname = "".join(c in util.FILENAME_VALID_CHARS and c or "_" for c in sname)[0:150] - if ret_dict.get("format-version", None) == "0.1": - extension = "ga" - else: - extension = "gxwf.json" - trans.response.headers["Content-Disposition"] = ( - f'attachment; filename="Galaxy-Workflow-{sname}.{extension}"' - ) - trans.response.set_content_type("application/galaxy-archive") - - if style == "format2" and download_format != "json-download": - return ordered_dump(ret_dict) - else: - return format_return_as_json(ret_dict, pretty=True) - @expose_api def import_new_workflow_deprecated(self, trans: GalaxyWebTransaction, payload, **kwd): """ @@ -737,10 +651,6 @@ def _import_tools_if_needed(self, trans, workflow_create_options, raw_workflow_d changeset_revision = item["changeset_revision"] irm.install(tool_shed_url, name, owner, changeset_revision, install_options) - def __get_stored_accessible_workflow(self, trans, workflow_id, **kwd): - instance = util.string_as_bool(kwd.get("instance", "false")) - return self.workflow_manager.get_stored_accessible_workflow(trans, workflow_id, by_stored_id=not instance) - def __get_stored_workflow(self, trans, workflow_id, **kwd): instance = util.string_as_bool(kwd.get("instance", "false")) return self.workflow_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) @@ -887,6 +797,32 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): description="Set this to true to skip joining workflow step counts and optimize the resulting index query. Response objects will not contain step counts.", ) +StyleQueryParam = Annotated[ + Optional[ + Literal["export", "format2", "editor", "legacy", "instance", "run", "preview", "format2_wrapped_yaml", "ga"] + ], + Query( + title="Style of export", + description="The default is 'export', which is meant to be used with workflow import endpoints. Other formats such as 'instance', 'editor', 'run' are tied to the GUI and should not be considered stable APIs. The default format for 'export' is specified by the admin with the `default_workflow_export_format` config option. Style can be specified as either 'ga' or 'format2' directly to be explicit about which format to download.", + ), +] + +FormatQueryParam = Annotated[ + Optional[str], + Query( + title="Format", + description="The format to download the workflow in.", + ), +] + +WorkflowsHistoryIDQueryParam = Annotated[ + Optional[DecodedDatabaseIdField], + Query( + title="History ID", + description="The history id to import a workflow from.", + ), +] + InvokeWorkflowBody = Annotated[ InvokeWorkflowPayload, Body( @@ -905,6 +841,24 @@ def __get_stored_workflow(self, trans, workflow_id, **kwd): ), ] +SetWorkflowMenuBody = Annotated[ + Optional[SetWorkflowMenuPayload], + Body( + title="Set workflow menu", + description="The values to set a workflow menu.", + ), +] + +DownloadWorkflowSummary = Union[ + WorkflowDictEditorSummary, + StoredWorkflowDetailed, + WorkflowDictRunSummary, + WorkflowDictPreviewSummary, + WorkflowDictFormat2Summary, + WorkflowDictExportSummary, + WorkflowDictFormat2WrappedYamlSummary, +] + @router.cbv class FastAPIWorkflows: @@ -961,6 +915,29 @@ def sharing( """Return the sharing status of the item.""" return self.service.shareable_service.sharing(trans, workflow_id) + @router.get( + "/api/workflows/{workflow_id}/download", + summary="Returns a selected workflow.", + response_model_exclude_unset=True, + ) + # Preserve the following download route for now for dependent applications -- deprecate at some point + @router.get( + "/api/workflows/download/{workflow_id}", + summary="Returns a selected workflow.", + response_model_exclude_unset=True, + ) + def workflow_dict( + self, + workflow_id: StoredWorkflowIDPathParam, + history_id: WorkflowsHistoryIDQueryParam = None, + style: StyleQueryParam = "export", + format: FormatQueryParam = None, + version: VersionQueryParam = None, + instance: InstanceQueryParam = False, + trans: ProvidesUserContext = DependsOnTrans, + ) -> DownloadWorkflowSummary: + return self.service.download_workflow(trans, workflow_id, history_id, style, format, version, instance) + @router.put( "/api/workflows/{workflow_id}/enable_link_access", summary="Makes this item accessible by a URL link.", @@ -1022,6 +999,17 @@ def unpublish( """Removes this item from the published list and return the current sharing status.""" return self.service.shareable_service.unpublish(trans, workflow_id) + @router.put( + "/api/workflows/menu", + summary="Save workflow menu to be shown in the tool panel", + ) + def set_workflow_menu( + self, + payload: SetWorkflowMenuBody = None, + trans: ProvidesHistoryContext = DependsOnTrans, + ) -> SetWorkflowMenuSummary: + return self.service.set_workflow_menu(payload, trans) + @router.put( "/api/workflows/{workflow_id}/share_with_users", summary="Share this item with specific users.", @@ -1190,7 +1178,7 @@ def show_workflow( ), ] -HistoryIdQueryParam = Annotated[ +InvocationsHistoryIdQueryParam = Annotated[ Optional[DecodedDatabaseIdField], Query( title="History ID", @@ -1299,7 +1287,7 @@ def index_invocations( self, response: Response, workflow_id: WorkflowIdQueryParam = None, - history_id: HistoryIdQueryParam = None, + history_id: InvocationsHistoryIdQueryParam = None, job_id: JobIdQueryParam = None, user_id: UserIdQueryParam = None, sort_by: InvocationsSortByQueryParam = None, @@ -1353,7 +1341,7 @@ def index_workflow_invocations( self, response: Response, workflow_id: StoredWorkflowIDPathParam, - history_id: HistoryIdQueryParam = None, + history_id: InvocationsHistoryIdQueryParam = None, job_id: JobIdQueryParam = None, user_id: UserIdQueryParam = None, sort_by: InvocationsSortByQueryParam = None, diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 951926dcc35b..8a700636c839 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -591,9 +591,6 @@ def populate_api_routes(webapp, app): webapp.mapper.resource("plugins", "plugins", path_prefix="/api") webapp.mapper.connect("/api/workflows/build_module", action="build_module", controller="workflows") - webapp.mapper.connect( - "/api/workflows/menu", action="set_workflow_menu", controller="workflows", conditions=dict(method=["PUT"]) - ) webapp.mapper.resource("workflow", "workflows", path_prefix="/api") # ---- visualizations registry ---- generic template renderer @@ -624,21 +621,6 @@ def populate_api_routes(webapp, app): action="import_new_workflow_deprecated", conditions=dict(method=["POST"]), ) - webapp.mapper.connect( - "workflow_dict", - "/api/workflows/{workflow_id}/download", - controller="workflows", - action="workflow_dict", - conditions=dict(method=["GET"]), - ) - # Preserve the following download route for now for dependent applications -- deprecate at some point - webapp.mapper.connect( - "workflow_dict", - "/api/workflows/download/{workflow_id}", - controller="workflows", - action="workflow_dict", - conditions=dict(method=["GET"]), - ) # Deprecated in favor of POST /api/workflows with shared_workflow_id in payload. webapp.mapper.connect( "import_shared_workflow_deprecated", diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 72414b169abf..155d66d27b90 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -8,11 +8,20 @@ Union, ) +from fastapi.responses import PlainTextResponse +from gxformat2._yaml import ordered_dump + from galaxy import ( exceptions, + model, + util, web, ) -from galaxy.managers.context import ProvidesUserContext +from galaxy.managers.context import ( + ProvidesHistoryContext, + ProvidesUserContext, +) +from galaxy.managers.histories import HistoryManager from galaxy.managers.workflows import ( RefactorResponse, WorkflowContentsManager, @@ -28,7 +37,15 @@ ) from galaxy.schema.workflows import ( InvokeWorkflowPayload, + SetWorkflowMenuPayload, + SetWorkflowMenuSummary, StoredWorkflowDetailed, + WorkflowDictEditorSummary, + WorkflowDictExportSummary, + WorkflowDictFormat2Summary, + WorkflowDictFormat2WrappedYamlSummary, + WorkflowDictPreviewSummary, + WorkflowDictRunSummary, ) from galaxy.util.tool_shed.tool_shed_registry import Registry from galaxy.webapps.galaxy.services.base import ServiceBase @@ -52,12 +69,56 @@ def __init__( serializer: WorkflowSerializer, tool_shed_registry: Registry, notification_service: NotificationService, + history_manager: HistoryManager, ): self._workflows_manager = workflows_manager self._workflow_contents_manager = workflow_contents_manager self._serializer = serializer self.shareable_service = ShareableService(workflows_manager, serializer, notification_service) self._tool_shed_registry = tool_shed_registry + self._history_manager = history_manager + + def download_workflow(self, trans, workflow_id, history_id, style, format, version, instance): + stored_workflow = self._workflows_manager.get_stored_accessible_workflow( + trans, workflow_id, by_stored_id=not instance + ) + history = None + if history_id: + history = self._history_manager.get_accessible(history_id, trans.user, current_history=trans.history) + ret_dict = self._workflow_contents_manager.workflow_to_dict( + trans, stored_workflow, style=style, version=version, history=history + ) + if format == "json-download": + sname = stored_workflow.name + sname = "".join(c in util.FILENAME_VALID_CHARS and c or "_" for c in sname)[0:150] + if ret_dict.get("format-version", None) == "0.1": + extension = "ga" + else: + extension = "gxwf.json" + trans.response.headers["Content-Disposition"] = ( + f'attachment; filename="Galaxy-Workflow-{sname}.{extension}"' + ) + trans.response.set_content_type("application/galaxy-archive") + if style == "export": + style = self._workflow_contents_manager.app.config.default_workflow_export_format + if style == "format2" and format != "json-download": + return PlainTextResponse(ordered_dump(ret_dict)) + elif style == "editor": + return WorkflowDictEditorSummary(**ret_dict) + elif style == ("legacy" or "instance"): + return StoredWorkflowDetailed(**ret_dict) + elif style == "run": + return WorkflowDictRunSummary(**ret_dict) + elif style == "preview": + return WorkflowDictPreviewSummary(**ret_dict) + elif style == "format2": + return WorkflowDictFormat2Summary(**ret_dict) + elif style == "format2_wrapped_yaml": + return WorkflowDictFormat2WrappedYamlSummary(**ret_dict) + elif style == "ga": + return WorkflowDictExportSummary(**ret_dict) + else: + raise exceptions.RequestParameterInvalidException(f"Unknown workflow style {style}") def index( self, @@ -221,6 +282,42 @@ def refactor( stored_workflow = self._workflows_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) return self._workflow_contents_manager.refactor(trans, stored_workflow, payload) + def set_workflow_menu( + self, + payload: Optional[SetWorkflowMenuPayload], + trans: ProvidesHistoryContext, + ) -> SetWorkflowMenuSummary: + user = trans.user + if payload: + workflow_ids = payload.workflow_ids + if not isinstance(workflow_ids, list): + workflow_ids = [workflow_ids] + else: + workflow_ids = [] + session = trans.sa_session + # This explicit remove seems like a hack, need to figure out + # how to make the association do it automatically. + for m in user.stored_workflow_menu_entries: + session.delete(m) + user.stored_workflow_menu_entries = [] + # To ensure id list is unique + seen_workflow_ids = set() + for wf_id in workflow_ids: + if wf_id in seen_workflow_ids: + continue + else: + seen_workflow_ids.add(wf_id) + m = model.StoredWorkflowMenuEntry() + m.stored_workflow = session.get(model.StoredWorkflow, wf_id) + + user.stored_workflow_menu_entries.append(m) + with transaction(session): + session.commit() + message = "Menu updated." + # TODO - It seems like this populates a mako template, is it necessary? + # trans.set_message(message) + return SetWorkflowMenuSummary(message=message, status="done") + def show_workflow(self, trans, workflow_id, instance, legacy, version) -> StoredWorkflowDetailed: stored_workflow = self._workflows_manager.get_stored_workflow(trans, workflow_id, by_stored_id=not instance) if stored_workflow.importable is False and stored_workflow.user != trans.user and not trans.user_is_admin: diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index d7a77b04bb22..aeedbd174576 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -870,6 +870,15 @@ def test_update_tags(self): update_response = self._update_workflow(workflow_id, update_payload).json() assert update_response["tags"] == [] + def test_set_workflow_menu(self): + original_name = "test update name" + workflow_object = self.workflow_populator.load_workflow(name=original_name) + upload_response = self.__test_upload(workflow=workflow_object, name=original_name) + workflow = upload_response.json() + workflow_id = workflow["id"] + response = self._put("/api/workflows/menu", {"workflow_ids": workflow_id}, json=True) + self._assert_status_code_is(response, 200) + def test_update_name(self): original_name = "test update name" workflow_object = self.workflow_populator.load_workflow(name=original_name)