mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
* clean up dropdown * clean up focusoncreate * ⚡ Ignore mistaken ID in POST /workflows * ⚡ Fix undefined tag ID in PATCH /workflows * ⚡ Shorten response for POST /tags * remove scss mixins * clean up imports * ⚡ Implement validation with class-validator * address ivan's comments * implement modals * Fix lint issues * fix disabling shortcuts * fix focus issues * fix focus issues * fix focus issues with modal * fix linting issues * use dispatch * use constants for modal keys * fix focus * fix lint issues * remove unused prop * add modal root * fix lint issues * remove unused methods * fix shortcut * remove max width * ⚡ Fix duplicate entry error for pg and MySQL * update rename messaging * update order of buttons * fix firefox overflow on windows * fix dropdown height * 🔨 refactor tag crud controllers * 🧹 remove unused imports * use variable for number of items * fix dropdown spacing * ⚡ Restore type to fix build * ⚡ Fix post-refactor PATCH /workflows/:id * ⚡ Fix PATCH /workflows/:id for zero tags * ⚡ Fix usage count becoming stringified * address max's comments * fix filter spacing * fix blur bug * address most of ivan's comments * address tags type concern * remove defaults * ⚡ return tag id as string * 🔨 add hooks to tag CUD operations * 🏎 simplify timestamp pruning * remove blur event * fix onblur bug * ⚡ Fix fs import to fix build * address max's comments * implement responsive tag container * fix lint issues * Set default dates in entities * 👕 Fix lint in migrations * update tag limits * address ivan's comments * remove rename, refactor header, implement new designs for save, remove responsive tag container * update styling * update styling * implement responsive tag container * implement header tags edit * implement header tags edit * fix lint issues * implement expandable input * minor fixes * minor fixes * use variable * rename save as * duplicate fixes * ⚡ Implement unique workflow names * ⚡ Create /workflows/new endpoint * minor edit fixes * lint fixes * style fixes * hook up saving name * hook up tags * clean up impl * fix dirty state bug * update limit * update notification messages * on click outside * fix minor bug with count * lint fixes * ⚡ Add query string params to /workflows/new * handle minor edge cases * handle minor edge cases * handle minor bugs; fix firefox dropdown issue * Fix min width * apply tags only after api success * remove count fix * 🚧 Adjust to new qs requirements * clean up workflow tags impl, fix tags delete bug * fix minor issue * fix minor spacing issue * disable wrap for ops * fix viewport root; save on click in dropdown * save button loading when saving name/tags * implement max width on tags container * implement cleaner create experience * disable edit while updating * codacy hex color * refactor tags container * fix clickability * fix workflow open and count * clean up structure * fix up lint issues * ⚡ Create migrations for unique workflow names * fix button size * increase workflow name limit for larger screen * tslint fixes * disable responsiveness for workflow modal * rename event * change min width for tags * clean up pr * ⚡ Adjust quotes in MySQL migration * ⚡ Adjust quotes in Postgres migration * address max's comments on styles * remove success toasts * add hover mode to name * minor fixes * refactor name preview * fix name input not to jiggle * finish up name input * Fix up add tags * clean up param * clean up scss * fix resizing name * fix resizing name * fix resize bug * clean up edit spacing * ignore on esc * fix input bug * focus input on clear * build * fix up add tags clickablity * remove scrollbars * move into folders * clean up multiple patch req * remove padding top from edit * update tags on enter * build * rollout blur on enter behavior * rollout esc behavior * fix tags bug when duplicating tags * move key to reload tags * update header spacing * build * update hex case * refactor workflow title * remove unusued prop * keep focus on error, fix bug on error * Fix bug with name / tags toggle on error * impl creating new workflow name * ⚡ Refactor endpoint per new guidelines * support naming endpoint * ⚡ Refactor to support numeric suffixes * 👕 Lint migrations for unique workflow names * ⚡ Add migrations set default dates to indexes * fix connection push bug * ⚡ Lowercase default workflow name * ⚡ Add prefixes to set default dates migration * ⚡ Fix indentation on default dates migrations * ⚡ Add temp ts-ignore for unrelated change * ⚡ Adjust default dates migration for MySQL Remove change to data column in credentials_entity, already covered by Omar's migration. Also, fix quotes from table prefix addition. * ⚡ Adjust quotes in dates migration for PG * fix safari color bug * fix count bug * fix scroll bugs in dropdown * expand filter size * apply box-sizing to main header * update workflow names in executions to be wrapped by quotes * fix bug where key is same in dropdown * fix firefox bug * move up push connection session * 🔨 Remove mistakenly added nullable property * 🔥 Remove unneeded index drop-create (PG) * 🔥 Remove unneeded table copying * ⚡ Merge dates migration with tags migration * 🔨 Refactor endpoint and make wf name env * dropdown colors in firefox * update colors to use variables * update thumb color * change error message * remove 100 char maximum * fix bug with saving tags dropdowns multiple times * update error message when no name * ⚡ Update name missing toast message * ⚡ Update workflow already exists message * disable saving for executions * fix bug causing modal to close * make tags in workflow open clickable * increase workflow limit to 3 * remove success notifications * update header spacing * escape tag names * update tag and table colors * remove tags from export * build * clean up push connection dependencies * address ben's comments * revert tags optional interface * address comments * update duplicate message * build * fix eol * add one more eol * ⚡ Update comment * add hover style for workflow open, fix up font weight Co-authored-by: Mutasem <mutdmour@gmail.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com> Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
534 lines
13 KiB
TypeScript
534 lines
13 KiB
TypeScript
|
|
import {
|
|
IConnections,
|
|
ICredentialsDecrypted,
|
|
ICredentialsEncrypted,
|
|
ICredentialType,
|
|
IDataObject,
|
|
GenericValue,
|
|
IWorkflowSettings as IWorkflowSettingsWorkflow,
|
|
INode,
|
|
INodeCredentials,
|
|
INodeIssues,
|
|
INodeParameters,
|
|
INodePropertyOptions,
|
|
INodeTypeDescription,
|
|
IRunExecutionData,
|
|
IRun,
|
|
IRunData,
|
|
ITaskData,
|
|
WorkflowExecuteMode,
|
|
} from 'n8n-workflow';
|
|
|
|
import {
|
|
PaintStyle,
|
|
} from 'jsplumb';
|
|
|
|
declare module 'jsplumb' {
|
|
interface Anchor {
|
|
lastReturnValue: number[];
|
|
}
|
|
|
|
interface Connection {
|
|
// bind(event: string, (connection: Connection): void;): void; // tslint:disable-line:no-any
|
|
bind(event: string, callback: Function): void; // tslint:disable-line:no-any
|
|
removeOverlay(name: string): void;
|
|
removeOverlays(): void;
|
|
setParameter(name: string, value: any): void; // tslint:disable-line:no-any
|
|
setPaintStyle(arg0: PaintStyle): void;
|
|
addOverlay(arg0: any[]): void; // tslint:disable-line:no-any
|
|
setConnector(arg0: any[]): void; // tslint:disable-line:no-any
|
|
}
|
|
|
|
interface Endpoint {
|
|
getOverlay(name: string): any; // tslint:disable-line:no-any
|
|
}
|
|
|
|
interface Overlay {
|
|
setVisible(visible: boolean): void;
|
|
}
|
|
|
|
interface OnConnectionBindInfo {
|
|
originalSourceEndpoint: Endpoint;
|
|
originalTargetEndpoint: Endpoint;
|
|
getParameters(): { index: number };
|
|
}
|
|
}
|
|
|
|
// EndpointOptions from jsplumb seems incomplete and wrong so we define an own one
|
|
export interface IEndpointOptions {
|
|
anchor?: any; // tslint:disable-line:no-any
|
|
createEndpoint?: boolean;
|
|
dragAllowedWhenFull?: boolean;
|
|
dropOptions?: any; // tslint:disable-line:no-any
|
|
dragProxy?: any; // tslint:disable-line:no-any
|
|
endpoint?: string;
|
|
endpointStyle?: object;
|
|
isSource?: boolean;
|
|
isTarget?: boolean;
|
|
maxConnections?: number;
|
|
overlays?: any; // tslint:disable-line:no-any
|
|
parameters?: any; // tslint:disable-line:no-any
|
|
uuid?: string;
|
|
}
|
|
|
|
export interface IConnectionsUi {
|
|
[key: string]: {
|
|
[key: string]: IEndpointOptions;
|
|
};
|
|
}
|
|
|
|
export interface IUpdateInformation {
|
|
name: string;
|
|
key: string;
|
|
value: string | number; // with null makes problems in NodeSettings.vue
|
|
node?: string;
|
|
oldValue?: string | number;
|
|
}
|
|
|
|
export interface INodeUpdatePropertiesInformation {
|
|
name: string; // Node-Name
|
|
properties: {
|
|
[key: string]: IDataObject;
|
|
};
|
|
}
|
|
|
|
export type XYPositon = [number, number];
|
|
|
|
export type MessageType = 'success' | 'warning' | 'info' | 'error';
|
|
|
|
export interface INodeUi extends INode {
|
|
position: XYPositon;
|
|
color?: string;
|
|
notes?: string;
|
|
issues?: INodeIssues;
|
|
_jsPlumb?: {
|
|
endpoints?: {
|
|
[key: string]: IEndpointOptions[];
|
|
};
|
|
};
|
|
}
|
|
|
|
export interface INodeTypesMaxCount {
|
|
[key: string]: {
|
|
exist: number;
|
|
max: number;
|
|
nodeNames: string[];
|
|
};
|
|
}
|
|
|
|
export interface IExternalHooks {
|
|
run(eventName: string, metadata?: IDataObject): Promise<void>;
|
|
}
|
|
|
|
export interface IRestApi {
|
|
getActiveWorkflows(): Promise<string[]>;
|
|
getActivationError(id: string): Promise<IActivationError | undefined >;
|
|
getCurrentExecutions(filter: object): Promise<IExecutionsCurrentSummaryExtended[]>;
|
|
getPastExecutions(filter: object, limit: number, lastId?: string | number, firstId?: string | number): Promise<IExecutionsListResponse>;
|
|
stopCurrentExecution(executionId: string): Promise<IExecutionsStopData>;
|
|
makeRestApiRequest(method: string, endpoint: string, data?: any): Promise<any>; // tslint:disable-line:no-any
|
|
getSettings(): Promise<IN8nUISettings>;
|
|
getNodeTypes(): Promise<INodeTypeDescription[]>;
|
|
getNodesInformation(nodeList: string[]): Promise<INodeTypeDescription[]>;
|
|
getNodeParameterOptions(nodeType: string, path: string, methodName: string, currentNodeParameters: INodeParameters, credentials?: INodeCredentials): Promise<INodePropertyOptions[]>;
|
|
removeTestWebhook(workflowId: string): Promise<boolean>;
|
|
runWorkflow(runData: IStartRunData): Promise<IExecutionPushResponse>;
|
|
createNewWorkflow(sendData: IWorkflowDataUpdate): Promise<IWorkflowDb>;
|
|
updateWorkflow(id: string, data: IWorkflowDataUpdate): Promise<IWorkflowDb>;
|
|
deleteWorkflow(name: string): Promise<void>;
|
|
getWorkflow(id: string): Promise<IWorkflowDb>;
|
|
getWorkflows(filter?: object): Promise<IWorkflowShortResponse[]>;
|
|
getWorkflowFromUrl(url: string): Promise<IWorkflowDb>;
|
|
createNewCredentials(sendData: ICredentialsDecrypted): Promise<ICredentialsResponse>;
|
|
deleteCredentials(id: string): Promise<void>;
|
|
updateCredentials(id: string, data: ICredentialsDecrypted): Promise<ICredentialsResponse>;
|
|
getAllCredentials(filter?: object): Promise<ICredentialsResponse[]>;
|
|
getCredentials(id: string, includeData?: boolean): Promise<ICredentialsDecryptedResponse | ICredentialsResponse | undefined>;
|
|
getCredentialTypes(): Promise<ICredentialType[]>;
|
|
getExecution(id: string): Promise<IExecutionResponse>;
|
|
deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void>;
|
|
retryExecution(id: string, loadWorkflow?: boolean): Promise<boolean>;
|
|
getTimezones(): Promise<IDataObject>;
|
|
oAuth1CredentialAuthorize(sendData: ICredentialsResponse): Promise<string>;
|
|
oAuth2CredentialAuthorize(sendData: ICredentialsResponse): Promise<string>;
|
|
oAuth2Callback(code: string, state: string): Promise<string>;
|
|
}
|
|
|
|
export interface IBinaryDisplayData {
|
|
index: number;
|
|
key: string;
|
|
node: string;
|
|
outputIndex: number;
|
|
runIndex: number;
|
|
}
|
|
|
|
export interface ICredentialsCreatedEvent {
|
|
data: ICredentialsDecryptedResponse;
|
|
options: {
|
|
closeDialog: boolean,
|
|
};
|
|
}
|
|
|
|
export interface IStartRunData {
|
|
workflowData: IWorkflowData;
|
|
startNodes?: string[];
|
|
destinationNode?: string;
|
|
runData?: IRunData;
|
|
}
|
|
|
|
export interface IRunDataUi {
|
|
node?: string;
|
|
workflowData: IWorkflowData;
|
|
}
|
|
|
|
export interface ITableData {
|
|
columns: string[];
|
|
data: GenericValue[][];
|
|
}
|
|
|
|
export interface IVariableItemSelected {
|
|
variable: string;
|
|
}
|
|
|
|
export interface IVariableSelectorOption {
|
|
name: string;
|
|
key?: string;
|
|
value?: string;
|
|
options?: IVariableSelectorOption[] | null;
|
|
allowParentSelect?: boolean;
|
|
dataType?: string;
|
|
}
|
|
|
|
// Simple version of n8n-workflow.Workflow
|
|
export interface IWorkflowData {
|
|
id?: string;
|
|
name?: string;
|
|
active?: boolean;
|
|
nodes: INode[];
|
|
connections: IConnections;
|
|
settings?: IWorkflowSettings;
|
|
tags?: string[];
|
|
}
|
|
|
|
export interface IWorkflowDataUpdate {
|
|
id?: string;
|
|
name?: string;
|
|
nodes?: INode[];
|
|
connections?: IConnections;
|
|
settings?: IWorkflowSettings;
|
|
active?: boolean;
|
|
tags?: ITag[] | string[]; // string[] when store or requested, ITag[] from API response
|
|
}
|
|
|
|
// Almost identical to cli.Interfaces.ts
|
|
export interface IWorkflowDb {
|
|
id: string;
|
|
name: string;
|
|
active: boolean;
|
|
createdAt: number | string;
|
|
updatedAt: number | string;
|
|
nodes: INodeUi[];
|
|
connections: IConnections;
|
|
settings?: IWorkflowSettings;
|
|
tags?: ITag[] | string[]; // string[] when store or requested, ITag[] from API response
|
|
}
|
|
|
|
// Identical to cli.Interfaces.ts
|
|
export interface IWorkflowShortResponse {
|
|
id: string;
|
|
name: string;
|
|
active: boolean;
|
|
createdAt: number | string;
|
|
updatedAt: number | string;
|
|
tags: ITag[];
|
|
}
|
|
|
|
|
|
// Identical or almost identical to cli.Interfaces.ts
|
|
|
|
export interface IActivationError {
|
|
time: number;
|
|
error: {
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
export interface ICredentialsResponse extends ICredentialsEncrypted {
|
|
id?: string;
|
|
createdAt: number | string;
|
|
updatedAt: number | string;
|
|
}
|
|
|
|
export interface ICredentialsBase {
|
|
createdAt: number | string;
|
|
updatedAt: number | string;
|
|
}
|
|
|
|
export interface ICredentialsDecryptedResponse extends ICredentialsBase, ICredentialsDecrypted{
|
|
id: string;
|
|
}
|
|
|
|
export interface IExecutionBase {
|
|
id?: number | string;
|
|
finished: boolean;
|
|
mode: WorkflowExecuteMode;
|
|
retryOf?: string;
|
|
retrySuccessId?: string;
|
|
startedAt: Date;
|
|
stoppedAt?: Date;
|
|
workflowId?: string; // To be able to filter executions easily //
|
|
}
|
|
|
|
export interface IExecutionFlatted extends IExecutionBase {
|
|
data: string;
|
|
workflowData: IWorkflowDb;
|
|
}
|
|
|
|
export interface IExecutionFlattedResponse extends IExecutionFlatted {
|
|
id: string;
|
|
}
|
|
|
|
export interface IExecutionPushResponse {
|
|
executionId?: string;
|
|
waitingForWebhook?: boolean;
|
|
}
|
|
|
|
export interface IExecutionResponse extends IExecutionBase {
|
|
id: string;
|
|
data: IRunExecutionData;
|
|
workflowData: IWorkflowDb;
|
|
}
|
|
|
|
export interface IExecutionShortResponse {
|
|
id: string;
|
|
workflowData: {
|
|
id: string;
|
|
name: string;
|
|
};
|
|
mode: WorkflowExecuteMode;
|
|
finished: boolean;
|
|
startedAt: Date;
|
|
stoppedAt: Date;
|
|
executionTime?: number;
|
|
}
|
|
|
|
export interface IExecutionsListResponse {
|
|
count: number;
|
|
results: IExecutionsSummary[];
|
|
}
|
|
|
|
export interface IExecutionsCurrentSummaryExtended {
|
|
id: string;
|
|
finished?: boolean;
|
|
mode: WorkflowExecuteMode;
|
|
retryOf?: string;
|
|
retrySuccessId?: string;
|
|
startedAt: Date;
|
|
stoppedAt?: Date;
|
|
workflowId: string;
|
|
workflowName?: string;
|
|
}
|
|
|
|
export interface IExecutionsStopData {
|
|
finished?: boolean;
|
|
mode: WorkflowExecuteMode;
|
|
startedAt: Date;
|
|
stoppedAt: Date;
|
|
}
|
|
|
|
export interface IExecutionsSummary {
|
|
id: string;
|
|
mode: WorkflowExecuteMode;
|
|
finished?: boolean;
|
|
retryOf?: string;
|
|
retrySuccessId?: string;
|
|
startedAt: Date;
|
|
stoppedAt?: Date;
|
|
workflowId: string;
|
|
workflowName?: string;
|
|
}
|
|
|
|
export interface IExecutionDeleteFilter {
|
|
deleteBefore?: Date;
|
|
filters?: IDataObject;
|
|
ids?: string[];
|
|
}
|
|
|
|
export interface IPushData {
|
|
data: IPushDataExecutionFinished | IPushDataNodeExecuteAfter | IPushDataNodeExecuteBefore | IPushDataTestWebhook;
|
|
type: IPushDataType;
|
|
}
|
|
|
|
export type IPushDataType = 'executionFinished' | 'executionStarted' | 'nodeExecuteAfter' | 'nodeExecuteBefore' | 'testWebhookDeleted' | 'testWebhookReceived';
|
|
|
|
export interface IPushDataExecutionStarted {
|
|
executionId: string;
|
|
mode: WorkflowExecuteMode;
|
|
startedAt: Date;
|
|
retryOf?: string;
|
|
workflowId: string;
|
|
workflowName?: string;
|
|
}
|
|
|
|
export interface IPushDataExecutionFinished {
|
|
data: IRun;
|
|
executionId: string;
|
|
retryOf?: string;
|
|
}
|
|
|
|
export interface IPushDataExecutionStarted {
|
|
executionId: string;
|
|
}
|
|
|
|
export interface IPushDataNodeExecuteAfter {
|
|
data: ITaskData;
|
|
executionId: string;
|
|
nodeName: string;
|
|
}
|
|
|
|
export interface IPushDataNodeExecuteBefore {
|
|
executionId: string;
|
|
nodeName: string;
|
|
}
|
|
|
|
export interface IPushDataTestWebhook {
|
|
executionId: string;
|
|
workflowId: string;
|
|
}
|
|
|
|
export interface IN8nUISettings {
|
|
endpointWebhook: string;
|
|
endpointWebhookTest: string;
|
|
saveDataErrorExecution: string;
|
|
saveDataSuccessExecution: string;
|
|
saveManualExecutions: boolean;
|
|
timezone: string;
|
|
executionTimeout: number;
|
|
maxExecutionTimeout: number;
|
|
oauthCallbackUrls: {
|
|
oauth1: string;
|
|
oauth2: string;
|
|
};
|
|
urlBaseWebhook: string;
|
|
versionCli: string;
|
|
n8nMetadata?: {
|
|
[key: string]: string | number | undefined;
|
|
};
|
|
}
|
|
|
|
export interface IWorkflowSettings extends IWorkflowSettingsWorkflow {
|
|
errorWorkflow?: string;
|
|
saveDataErrorExecution?: string;
|
|
saveDataSuccessExecution?: string;
|
|
saveManualExecutions?: boolean;
|
|
timezone?: string;
|
|
executionTimeout?: number;
|
|
}
|
|
|
|
export interface ITimeoutHMS {
|
|
hours: number;
|
|
minutes: number;
|
|
seconds: number;
|
|
}
|
|
|
|
export type WorkflowTitleStatus = 'EXECUTING' | 'IDLE' | 'ERROR';
|
|
|
|
export type MenuItemType = 'link';
|
|
export type MenuItemPosition = 'top' | 'bottom';
|
|
|
|
export interface IMenuItem {
|
|
id: string;
|
|
type: MenuItemType;
|
|
position?: MenuItemPosition;
|
|
properties: ILinkMenuItemProperties;
|
|
}
|
|
|
|
export interface ILinkMenuItemProperties {
|
|
title: string;
|
|
icon: string;
|
|
href: string;
|
|
newWindow?: boolean;
|
|
}
|
|
|
|
export interface ITag {
|
|
id: string;
|
|
name: string;
|
|
usageCount?: number;
|
|
}
|
|
|
|
export interface ITagRow {
|
|
tag?: ITag;
|
|
usage?: string;
|
|
create?: boolean;
|
|
disable?: boolean;
|
|
update?: boolean;
|
|
delete?: boolean;
|
|
}
|
|
|
|
export interface IRootState {
|
|
activeExecutions: IExecutionsCurrentSummaryExtended[];
|
|
activeWorkflows: string[];
|
|
activeActions: string[];
|
|
activeNode: string | null;
|
|
baseUrl: string;
|
|
credentials: ICredentialsResponse[] | null;
|
|
credentialTypes: ICredentialType[] | null;
|
|
endpointWebhook: string;
|
|
endpointWebhookTest: string;
|
|
executionId: string | null;
|
|
executingNode: string | null;
|
|
executionWaitingForWebhook: boolean;
|
|
pushConnectionActive: boolean;
|
|
saveDataErrorExecution: string;
|
|
saveDataSuccessExecution: string;
|
|
saveManualExecutions: boolean;
|
|
timezone: string;
|
|
stateIsDirty: boolean;
|
|
executionTimeout: number;
|
|
maxExecutionTimeout: number;
|
|
versionCli: string;
|
|
oauthCallbackUrls: object;
|
|
n8nMetadata: object;
|
|
workflowExecutionData: IExecutionResponse | null;
|
|
lastSelectedNode: string | null;
|
|
lastSelectedNodeOutputIndex: number | null;
|
|
nodeIndex: Array<string | null>;
|
|
nodeTypes: INodeTypeDescription[];
|
|
nodeViewOffsetPosition: XYPositon;
|
|
nodeViewMoveInProgress: boolean;
|
|
selectedNodes: INodeUi[];
|
|
sessionId: string;
|
|
urlBaseWebhook: string;
|
|
workflow: IWorkflowDb;
|
|
sidebarMenuItems: IMenuItem[];
|
|
}
|
|
|
|
export interface ITagsState {
|
|
tags: { [id: string]: ITag };
|
|
isLoading: boolean;
|
|
fetchedAll: boolean;
|
|
fetchedUsageCount: boolean;
|
|
}
|
|
|
|
export interface IModalState {
|
|
open: boolean;
|
|
}
|
|
|
|
export interface IUiState {
|
|
sidebarMenuCollapsed: boolean;
|
|
modalStack: string[];
|
|
modals: {
|
|
[key: string]: IModalState;
|
|
};
|
|
isPageLoading: boolean;
|
|
}
|
|
|
|
export interface IWorkflowsState {
|
|
}
|
|
|
|
export interface IRestApiContext {
|
|
baseUrl: string;
|
|
sessionId: string;
|
|
}
|