refactor(core): Convert workflows controller to DI (no-changelog) (#8253)

This commit is contained in:
Iván Ovejero
2024-01-08 12:54:23 +01:00
committed by GitHub
parent ac1c642fdd
commit 90c065e999
10 changed files with 179 additions and 232 deletions

View File

@@ -0,0 +1,46 @@
import type { IWorkflowDb } from '@/Interfaces';
import type { AuthenticatedRequest } from '@/requests';
import type { INode, IConnections, IWorkflowSettings, IRunData, IPinData } from 'n8n-workflow';
export declare namespace WorkflowRequest {
type CreateUpdatePayload = Partial<{
id: string; // delete if sent
name: string;
nodes: INode[];
connections: IConnections;
settings: IWorkflowSettings;
active: boolean;
tags: string[];
hash: string;
meta: Record<string, unknown>;
}>;
type ManualRunPayload = {
workflowData: IWorkflowDb;
runData: IRunData;
pinData: IPinData;
startNodes?: string[];
destinationNode?: string;
};
type Create = AuthenticatedRequest<{}, {}, CreateUpdatePayload>;
type Get = AuthenticatedRequest<{ id: string }>;
type Delete = Get;
type Update = AuthenticatedRequest<
{ id: string },
{},
CreateUpdatePayload,
{ forceSave?: string }
>;
type NewName = AuthenticatedRequest<{}, {}, {}, { name?: string }>;
type ManualRun = AuthenticatedRequest<{}, {}, ManualRunPayload>;
type Share = AuthenticatedRequest<{ workflowId: string }, {}, { shareWithIds: string[] }>;
type FromUrl = AuthenticatedRequest<{}, {}, {}, { url?: string }>;
}