n8n/packages/core/src/Interfaces.ts

92 lines
2.9 KiB
TypeScript
Raw Normal View History

import type { Readable } from 'stream';
import type {
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,
IPollFunctions as IPollFunctionsBase,
2019-06-23 03:35:23 -07:00
ITriggerFunctions as ITriggerFunctionsBase,
IWebhookFunctions as IWebhookFunctionsBase,
BinaryMetadata,
:art: Set up linting and formatting (#2120) * :arrow_up: Upgrade TS to 4.3.5 * :shirt: Add ESLint configs * :art: Add Prettier config * :package: Add deps and commands * :zap: Adjust global .editorconfig to new ruleset * :fire: Remove unneeded local .editorconfig * :package: Update deps in editor-ui * :hammer: Limit Prettier to only TS files * :zap: Add recommended VSCode extensions * :shirt: Fix build * :fire: Remove Vue setting from global config * :zap: Disable prefer-default-export per feedback * :pencil2: Add forgotten divider * :shirt: Disable no-plusplus * :shirt: Disable class-methods-use-this * :pencil2: Alphabetize overrides * :shirt: Add one-var consecutive override * :rewind: Revert one-var consecutive override This reverts commit b9252cf935659ba6d76727ad484a1d3c00008fcc. * 🎨 👕 Lint and format workflow package (#2121) * :art: Format /workflow package * :shirt: Lint /workflow package * :art: Re-format /workflow package * :shirt: Re-lint /workflow package * :pencil2: Fix typo * :zap: Consolidate if-checks * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 🎨 👕 Lint and format node-dev package (#2122) * :art: Format /node-dev package * :zap: Exclude templates from ESLint config This keeps the templates consistent with the codebase while preventing lint exceptions from being made part of the templates. * :shirt: Lint /node-dev package * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * 🎨 👕 Lint and format core package (#2123) * :art: Format /core package * :shirt: Lint /core package * :art: Re-format /core package * :shirt: Re-lint /core package * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 🎨 👕 Lint and format cli package (#2124) * :art: Format /cli package * :shirt: Exclude migrations from linting * :shirt: Lint /cli package * :art: Re-format /cli package * :shirt: Re-lint /cli package * :shirt: Fix build * :fire: Remove prefer-default-export exceptions * :zap: Update exceptions in ActiveExecutions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 👕 fix lint issues * :wrench: use package specific linter, remove tslint command * :hammer: resolve build issue, sync dependencies * :wrench: change lint command Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>
2021-08-29 11:58:11 -07:00
} from 'n8n-workflow';
2019-06-23 03:35:23 -07: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
export interface IProcessMessage {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
:art: Set up linting and formatting (#2120) * :arrow_up: Upgrade TS to 4.3.5 * :shirt: Add ESLint configs * :art: Add Prettier config * :package: Add deps and commands * :zap: Adjust global .editorconfig to new ruleset * :fire: Remove unneeded local .editorconfig * :package: Update deps in editor-ui * :hammer: Limit Prettier to only TS files * :zap: Add recommended VSCode extensions * :shirt: Fix build * :fire: Remove Vue setting from global config * :zap: Disable prefer-default-export per feedback * :pencil2: Add forgotten divider * :shirt: Disable no-plusplus * :shirt: Disable class-methods-use-this * :pencil2: Alphabetize overrides * :shirt: Add one-var consecutive override * :rewind: Revert one-var consecutive override This reverts commit b9252cf935659ba6d76727ad484a1d3c00008fcc. * 🎨 👕 Lint and format workflow package (#2121) * :art: Format /workflow package * :shirt: Lint /workflow package * :art: Re-format /workflow package * :shirt: Re-lint /workflow package * :pencil2: Fix typo * :zap: Consolidate if-checks * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 🎨 👕 Lint and format node-dev package (#2122) * :art: Format /node-dev package * :zap: Exclude templates from ESLint config This keeps the templates consistent with the codebase while preventing lint exceptions from being made part of the templates. * :shirt: Lint /node-dev package * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * 🎨 👕 Lint and format core package (#2123) * :art: Format /core package * :shirt: Lint /core package * :art: Re-format /core package * :shirt: Re-lint /core package * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 🎨 👕 Lint and format cli package (#2124) * :art: Format /cli package * :shirt: Exclude migrations from linting * :shirt: Lint /cli package * :art: Re-format /cli package * :shirt: Re-lint /cli package * :shirt: Fix build * :fire: Remove prefer-default-export exceptions * :zap: Update exceptions in ActiveExecutions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 👕 fix lint issues * :wrench: use package specific linter, remove tslint command * :hammer: resolve build issue, sync dependencies * :wrench: change lint command Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>
2021-08-29 11:58:11 -07:00
data?: any;
type: string;
}
export interface IResponseError extends Error {
statusCode?: number;
}
2019-06-23 03:35:23 -07:00
export interface IUserSettings {
encryptionKey?: string;
tunnelSubdomain?: string;
:sparkles: Introduce telemetry (#2099) * introduce analytics * add user survey backend * add user survey backend * set answers on survey submit Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * change name to personalization * lint Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> * N8n 2495 add personalization modal (#2280) * update modals * add onboarding modal * implement questions * introduce analytics * simplify impl * implement survey handling * add personalized cateogry * update modal behavior * add thank you view * handle empty cases * rename modal * standarize modal names * update image, add tags to headings * remove unused file * remove unused interfaces * clean up footer spacing * introduce analytics * refactor to fix bug * update endpoint * set min height * update stories * update naming from questions to survey * remove spacing after core categories * fix bug in logic * sort nodes * rename types * merge with be * rename userSurvey * clean up rest api * use constants for keys * use survey keys * clean up types * move personalization to its own file Co-authored-by: ahsan-virani <ahsan.virani@gmail.com> * Survey new options (#2300) * split up options * fix quotes * remove unused import * add user created workflow event (#2301) * simplify env vars * fix versionCli on FE * update personalization env * fix event User opened Credentials panel * fix select modal spacing * fix nodes panel event * fix workflow id in workflow execute event * improve telemetry error logging * fix config and stop process events * add flush call on n8n stop * ready for release * improve telemetry process exit * fix merge * improve n8n stop events Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Co-authored-by: Mutasem <mutdmour@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
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;
}
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<void>;
getFileSize(filePath: string): Promise<number>;
copyBinaryFile(filePath: string, executionId: string): Promise<string>;
storeBinaryMetadata(identifier: string, metadata: BinaryMetadata): Promise<void>;
getBinaryMetadata(identifier: string): Promise<BinaryMetadata>;
storeBinaryData(binaryData: Buffer | Readable, executionId: string): Promise<string>;
retrieveBinaryDataByIdentifier(identifier: string): Promise<Buffer>;
getBinaryPath(identifier: string): string;
getBinaryStream(identifier: string, chunkSize?: number): Readable;
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>;
}
export namespace n8n {
export interface PackageJson {
name: string;
version: string;
n8n?: {
credentials?: string[];
nodes?: string[];
};
author?: {
name?: string;
email?: string;
};
}
}