2019-06-23 03:35:23 -07:00
|
|
|
import {
|
2022-12-23 09:27:07 -08:00
|
|
|
IPollResponse,
|
|
|
|
ITriggerResponse,
|
|
|
|
IWorkflowSettings as IWorkflowSettingsWorkflow,
|
2019-06-23 03:35:23 -07:00
|
|
|
IExecuteFunctions as IExecuteFunctionsBase,
|
|
|
|
IExecuteSingleFunctions as IExecuteSingleFunctionsBase,
|
|
|
|
IHookFunctions as IHookFunctionsBase,
|
|
|
|
ILoadOptionsFunctions as ILoadOptionsFunctionsBase,
|
2019-12-31 12:19:37 -08:00
|
|
|
IPollFunctions as IPollFunctionsBase,
|
2019-06-23 03:35:23 -07:00
|
|
|
ITriggerFunctions as ITriggerFunctionsBase,
|
|
|
|
IWebhookFunctions as IWebhookFunctionsBase,
|
2021-08-29 11:58:11 -07:00
|
|
|
} from 'n8n-workflow';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-12-23 09:27:07 -08:00
|
|
|
// TODO: remove these after removing `n8n-core` dependency from `nodes-bases`
|
|
|
|
export type IExecuteFunctions = IExecuteFunctionsBase;
|
|
|
|
export type IExecuteSingleFunctions = IExecuteSingleFunctionsBase;
|
|
|
|
export type IHookFunctions = IHookFunctionsBase;
|
|
|
|
export type ILoadOptionsFunctions = ILoadOptionsFunctionsBase;
|
|
|
|
export type IPollFunctions = IPollFunctionsBase;
|
|
|
|
export type ITriggerFunctions = ITriggerFunctionsBase;
|
|
|
|
export type IWebhookFunctions = IWebhookFunctionsBase;
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2019-08-08 11:38:25 -07:00
|
|
|
export interface IProcessMessage {
|
2022-12-23 09:27:07 -08:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2021-08-29 11:58:11 -07:00
|
|
|
data?: any;
|
2019-08-08 11:38:25 -07:00
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
2020-01-13 18:46:58 -08:00
|
|
|
export interface IResponseError extends Error {
|
|
|
|
statusCode?: number;
|
|
|
|
}
|
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
export interface IUserSettings {
|
|
|
|
encryptionKey?: string;
|
|
|
|
tunnelSubdomain?: string;
|
2021-10-18 20:57:49 -07:00
|
|
|
instanceId?: string;
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IWorkflowSettings extends IWorkflowSettingsWorkflow {
|
|
|
|
errorWorkflow?: string;
|
|
|
|
timezone?: string;
|
|
|
|
saveManualRuns?: boolean;
|
|
|
|
}
|
|
|
|
|
2019-12-31 12:19:37 -08:00
|
|
|
export interface IWorkflowData {
|
2020-01-10 11:38:55 -08:00
|
|
|
pollResponses?: IPollResponse[];
|
|
|
|
triggerResponses?: ITriggerResponse[];
|
2019-12-31 12:19:37 -08:00
|
|
|
}
|
2021-12-23 13:29:04 -08:00
|
|
|
|
|
|
|
export interface IBinaryDataConfig {
|
|
|
|
mode: 'default' | 'filesystem';
|
|
|
|
availableModes: string;
|
|
|
|
localStoragePath: string;
|
|
|
|
binaryDataTTL: number;
|
|
|
|
persistedBinaryDataTTL: number;
|
|
|
|
}
|
|
|
|
|
2022-11-24 07:54:43 -08:00
|
|
|
export interface BinaryMetadata {
|
|
|
|
fileName?: string;
|
|
|
|
mimeType?: string;
|
|
|
|
fileSize: number;
|
|
|
|
}
|
|
|
|
|
2021-12-23 13:29:04 -08:00
|
|
|
export interface IBinaryDataManager {
|
|
|
|
init(startPurger: boolean): Promise<void>;
|
2022-11-24 07:54:43 -08:00
|
|
|
getFileSize(filePath: string): Promise<number>;
|
|
|
|
copyBinaryFile(filePath: string, executionId: string): Promise<string>;
|
|
|
|
storeBinaryMetadata(identifier: string, metadata: BinaryMetadata): Promise<void>;
|
|
|
|
getBinaryMetadata(identifier: string): Promise<BinaryMetadata>;
|
2021-12-23 13:29:04 -08:00
|
|
|
storeBinaryData(binaryBuffer: Buffer, executionId: string): Promise<string>;
|
|
|
|
retrieveBinaryDataByIdentifier(identifier: string): Promise<Buffer>;
|
2022-11-24 07:54:43 -08:00
|
|
|
getBinaryPath(identifier: string): string;
|
2021-12-23 13:29:04 -08:00
|
|
|
markDataForDeletionByExecutionId(executionId: string): Promise<void>;
|
|
|
|
deleteMarkedFiles(): Promise<unknown>;
|
|
|
|
deleteBinaryDataByIdentifier(identifier: string): Promise<void>;
|
|
|
|
duplicateBinaryDataByIdentifier(binaryDataId: string, prefix: string): Promise<string>;
|
|
|
|
deleteBinaryDataByExecutionId(executionId: string): Promise<void>;
|
|
|
|
persistBinaryDataForExecutionId(executionId: string): Promise<void>;
|
|
|
|
}
|
2022-11-23 07:20:28 -08:00
|
|
|
|
|
|
|
export namespace n8n {
|
|
|
|
export interface PackageJson {
|
|
|
|
name: string;
|
|
|
|
version: string;
|
|
|
|
n8n?: {
|
|
|
|
credentials?: string[];
|
|
|
|
nodes?: string[];
|
|
|
|
};
|
|
|
|
author?: {
|
|
|
|
name?: string;
|
|
|
|
email?: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|