feat(core): Expose data store service to Data Store Node (no-changelog) (#17970)

Co-authored-by: Daria Staferova <daria.staferova@n8n.io>
This commit is contained in:
Charlie Kolb
2025-08-19 17:43:19 +02:00
committed by GitHub
parent 970351bf23
commit 169acd12bd
20 changed files with 547 additions and 15 deletions

View File

@@ -13,6 +13,10 @@ import type { SecureContextOptions } from 'tls';
import type { URLSearchParams } from 'url';
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES, LOG_LEVELS } from './constants';
import type {
IDataStoreProjectAggregateService,
IDataStoreProjectService,
} from './data-store.types';
import type { IDeferredPromise } from './deferred-promise';
import type { ExecutionCancelledError } from './errors';
import type { ExpressionError } from './errors/expression.error';
@@ -916,6 +920,24 @@ type FunctionsBaseWithRequiredKeys<Keys extends keyof FunctionsBase> = Functions
export type ContextType = 'flow' | 'node';
export type DataStoreProxyProvider = {
getDataStoreAggregateProxy(
workflow: Workflow,
node: INode,
): Promise<IDataStoreProjectAggregateService>;
getDataStoreProxy(
workflow: Workflow,
node: INode,
dataStoreId: string,
): Promise<IDataStoreProjectService>;
};
export type DataStoreProxyFunctions = {
// These are optional to account for situations where the data-store module is disabled
getDataStoreAggregateProxy?(): Promise<IDataStoreProjectAggregateService>;
getDataStoreProxy?(dataStoreId: string): Promise<IDataStoreProjectService>;
};
type BaseExecutionFunctions = FunctionsBaseWithRequiredKeys<'getMode'> & {
continueOnFail(): boolean;
setMetadata(metadata: ITaskMetadata): void;
@@ -978,7 +1000,8 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn &
BinaryHelperFunctions &
DeduplicationHelperFunctions &
FileSystemHelperFunctions &
SSHTunnelFunctions & {
SSHTunnelFunctions &
DataStoreProxyFunctions & {
normalizeItems(items: INodeExecutionData | INodeExecutionData[]): INodeExecutionData[];
constructExecutionMetaData(
inputData: INodeExecutionData[],
@@ -1062,7 +1085,7 @@ export interface ILoadOptionsFunctions extends FunctionsBase {
): NodeParameterValueType | object | undefined;
getCurrentNodeParameters(): INodeParameters | undefined;
helpers: RequestHelperFunctions & SSHTunnelFunctions;
helpers: RequestHelperFunctions & SSHTunnelFunctions & DataStoreProxyFunctions;
}
export type FieldValueOption = { name: string; type: FieldType | 'any' };