mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-08 19:37:29 -08:00
b8da4ff9ed
Co-authored-by: Danny Martini <danny@n8n.io>
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
import type { INode, IConnections, IWorkflowSettings, IRunData, StartNodeData } from 'n8n-workflow';
|
|
|
|
import type { IWorkflowDb } from '@/interfaces';
|
|
import type { AuthenticatedRequest, ListQuery } from '@/requests';
|
|
|
|
export declare namespace WorkflowRequest {
|
|
type CreateUpdatePayload = Partial<{
|
|
id: string; // deleted if sent
|
|
name: string;
|
|
nodes: INode[];
|
|
connections: IConnections;
|
|
settings: IWorkflowSettings;
|
|
active: boolean;
|
|
tags: string[];
|
|
hash: string;
|
|
meta: Record<string, unknown>;
|
|
projectId: string;
|
|
}>;
|
|
|
|
type ManualRunPayload = {
|
|
workflowData: IWorkflowDb;
|
|
runData: IRunData;
|
|
startNodes?: StartNodeData[];
|
|
destinationNode?: string;
|
|
dirtyNodeNames?: string[];
|
|
};
|
|
|
|
type Create = AuthenticatedRequest<{}, {}, CreateUpdatePayload>;
|
|
|
|
type Get = AuthenticatedRequest<{ workflowId: string }>;
|
|
|
|
type GetMany = AuthenticatedRequest<{}, {}, {}, ListQuery.Params & { includeScopes?: string }> & {
|
|
listQueryOptions: ListQuery.Options;
|
|
};
|
|
|
|
type Delete = Get;
|
|
|
|
type Update = AuthenticatedRequest<
|
|
{ workflowId: string },
|
|
{},
|
|
CreateUpdatePayload,
|
|
{ forceSave?: string }
|
|
>;
|
|
|
|
type NewName = AuthenticatedRequest<{}, {}, {}, { name?: string }>;
|
|
|
|
type ManualRun = AuthenticatedRequest<
|
|
{ workflowId: string },
|
|
{},
|
|
ManualRunPayload,
|
|
{ partialExecutionVersion?: string }
|
|
>;
|
|
|
|
type Share = AuthenticatedRequest<{ workflowId: string }, {}, { shareWithIds: string[] }>;
|
|
|
|
type Transfer = AuthenticatedRequest<
|
|
{ workflowId: string },
|
|
{},
|
|
{ destinationProjectId: string }
|
|
>;
|
|
|
|
type FromUrl = AuthenticatedRequest<{}, {}, {}, { url?: string }>;
|
|
}
|