mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Handle Declarative nodes more like regular nodes (#13007)
This commit is contained in:
committed by
GitHub
parent
ac7bc4f191
commit
a65a9e631b
@@ -40,7 +40,6 @@ export const describeCommonTests = (
|
||||
executeData: IExecuteData;
|
||||
},
|
||||
) => {
|
||||
// @ts-expect-error `additionalData` is private
|
||||
const additionalData = context.additionalData as MockProxy<IWorkflowExecuteAdditionalData>;
|
||||
|
||||
describe('getExecutionCancelSignal', () => {
|
||||
|
||||
@@ -41,12 +41,12 @@ export class BaseExecuteContext extends NodeExecutionContext {
|
||||
node: INode,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
mode: WorkflowExecuteMode,
|
||||
protected readonly runExecutionData: IRunExecutionData,
|
||||
readonly runExecutionData: IRunExecutionData,
|
||||
runIndex: number,
|
||||
protected readonly connectionInputData: INodeExecutionData[],
|
||||
protected readonly inputData: ITaskDataConnections,
|
||||
protected readonly executeData: IExecuteData,
|
||||
protected readonly abortSignal?: AbortSignal,
|
||||
readonly connectionInputData: INodeExecutionData[],
|
||||
readonly inputData: ITaskDataConnections,
|
||||
readonly executeData: IExecuteData,
|
||||
readonly abortSignal?: AbortSignal,
|
||||
) {
|
||||
super(workflow, node, additionalData, mode, runExecutionData, runIndex);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Container } from '@n8n/di';
|
||||
import type { ICredentialTestFunctions } from 'n8n-workflow';
|
||||
|
||||
import { Memoized } from '@/decorators';
|
||||
import { Logger } from '@/logging';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { getSSHTunnelFunctions, proxyRequestToAxios } from '@/node-execute-functions';
|
||||
|
||||
export class CredentialTestContext implements ICredentialTestFunctions {
|
||||
readonly helpers: ICredentialTestFunctions['helpers'];
|
||||
|
||||
constructor() {
|
||||
this.helpers = {
|
||||
...getSSHTunnelFunctions(),
|
||||
request: async (uriOrObject: string | object, options?: object) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return await proxyRequestToAxios(undefined, undefined, undefined, uriOrObject, options);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@Memoized
|
||||
get logger() {
|
||||
return Container.get(Logger);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
export { CredentialTestContext } from './credentials-test-context';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
export { ExecuteContext } from './execute-context';
|
||||
export { ExecuteSingleContext } from './execute-single-context';
|
||||
export { HookContext } from './hook-context';
|
||||
|
||||
@@ -43,14 +43,14 @@ export abstract class NodeExecutionContext implements Omit<FunctionsBase, 'getCr
|
||||
protected readonly instanceSettings = Container.get(InstanceSettings);
|
||||
|
||||
constructor(
|
||||
protected readonly workflow: Workflow,
|
||||
protected readonly node: INode,
|
||||
protected readonly additionalData: IWorkflowExecuteAdditionalData,
|
||||
protected readonly mode: WorkflowExecuteMode,
|
||||
protected readonly runExecutionData: IRunExecutionData | null = null,
|
||||
protected readonly runIndex = 0,
|
||||
protected readonly connectionInputData: INodeExecutionData[] = [],
|
||||
protected readonly executeData?: IExecuteData,
|
||||
readonly workflow: Workflow,
|
||||
readonly node: INode,
|
||||
readonly additionalData: IWorkflowExecuteAdditionalData,
|
||||
readonly mode: WorkflowExecuteMode,
|
||||
readonly runExecutionData: IRunExecutionData | null = null,
|
||||
readonly runIndex = 0,
|
||||
readonly connectionInputData: INodeExecutionData[] = [],
|
||||
readonly executeData?: IExecuteData,
|
||||
) {}
|
||||
|
||||
@Memoized
|
||||
|
||||
Reference in New Issue
Block a user