2024-01-08 03:54:23 -08:00
|
|
|
import type { IWorkflowDb } from '@/Interfaces';
|
|
|
|
import type { AuthenticatedRequest } from '@/requests';
|
2024-02-23 02:43:08 -08:00
|
|
|
import type {
|
|
|
|
INode,
|
|
|
|
IConnections,
|
|
|
|
IWorkflowSettings,
|
|
|
|
IRunData,
|
|
|
|
IPinData,
|
|
|
|
StartNodeData,
|
|
|
|
} from 'n8n-workflow';
|
2024-01-08 03:54:23 -08:00
|
|
|
|
|
|
|
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;
|
2024-02-23 02:43:08 -08:00
|
|
|
startNodes?: StartNodeData[];
|
2024-01-08 03:54:23 -08:00
|
|
|
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 }>;
|
|
|
|
}
|