import type { Readable } from 'stream'; import type { IPollResponse, ITriggerResponse, IWorkflowSettings as IWorkflowSettingsWorkflow, IExecuteFunctions as IExecuteFunctionsBase, IExecuteSingleFunctions as IExecuteSingleFunctionsBase, IHookFunctions as IHookFunctionsBase, ILoadOptionsFunctions as ILoadOptionsFunctionsBase, IPollFunctions as IPollFunctionsBase, ITriggerFunctions as ITriggerFunctionsBase, IWebhookFunctions as IWebhookFunctionsBase, BinaryMetadata, } from 'n8n-workflow'; // 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; export interface IProcessMessage { // eslint-disable-next-line @typescript-eslint/no-explicit-any data?: any; type: string; } export interface IResponseError extends Error { statusCode?: number; } export interface IUserSettings { encryptionKey?: string; tunnelSubdomain?: string; instanceId?: string; } export interface IWorkflowSettings extends IWorkflowSettingsWorkflow { errorWorkflow?: string; timezone?: string; saveManualRuns?: boolean; } export interface IWorkflowData { pollResponses?: IPollResponse[]; triggerResponses?: ITriggerResponse[]; } export interface IBinaryDataConfig { mode: 'default' | 'filesystem'; availableModes: string; localStoragePath: string; binaryDataTTL: number; persistedBinaryDataTTL: number; } export interface IBinaryDataManager { init(startPurger: boolean): Promise; getFileSize(filePath: string): Promise; copyBinaryFile(filePath: string, executionId: string): Promise; storeBinaryMetadata(identifier: string, metadata: BinaryMetadata): Promise; getBinaryMetadata(identifier: string): Promise; storeBinaryData(binaryData: Buffer | Readable, executionId: string): Promise; retrieveBinaryDataByIdentifier(identifier: string): Promise; getBinaryPath(identifier: string): string; getBinaryStream(identifier: string, chunkSize?: number): Readable; markDataForDeletionByExecutionId(executionId: string): Promise; deleteMarkedFiles(): Promise; deleteBinaryDataByIdentifier(identifier: string): Promise; duplicateBinaryDataByIdentifier(binaryDataId: string, prefix: string): Promise; deleteBinaryDataByExecutionId(executionId: string): Promise; persistBinaryDataForExecutionId(executionId: string): Promise; } export namespace n8n { export interface PackageJson { name: string; version: string; n8n?: { credentials?: string[]; nodes?: string[]; }; author?: { name?: string; email?: string; }; } }