refactor(core): Extract hook context out of NodeExecutionFunctions (no-changelog) (#11537)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-11-04 16:27:23 +01:00
committed by GitHub
parent 0817f8571a
commit 19a5c2fcf1
6 changed files with 265 additions and 62 deletions

View File

@@ -1104,8 +1104,8 @@ export interface ITriggerFunctions
export interface IHookFunctions
extends FunctionsBaseWithRequiredKeys<'getMode' | 'getActivationMode'> {
getWebhookName(): string;
getWebhookDescription(name: string): IWebhookDescription | undefined;
getNodeWebhookUrl: (name: string) => string | undefined;
getWebhookDescription(name: WebhookType): IWebhookDescription | undefined;
getNodeWebhookUrl: (name: WebhookType) => string | undefined;
getNodeParameter(
parameterName: string,
fallbackValue?: any,
@@ -1127,7 +1127,7 @@ export interface IWebhookFunctions extends FunctionsBaseWithRequiredKeys<'getMod
fallbackValue?: any,
options?: IGetNodeParameterOptions,
): NodeParameterValueType | object;
getNodeWebhookUrl: (name: string) => string | undefined;
getNodeWebhookUrl: (name: WebhookType) => string | undefined;
evaluateExpression(expression: string, itemIndex?: number): NodeParameterValueType;
getParamsData(): object;
getQueryData(): object;
@@ -1619,7 +1619,7 @@ export interface INodeType {
};
};
webhookMethods?: {
[name in IWebhookDescription['name']]?: {
[name in WebhookType]?: {
[method in WebhookSetupMethodNames]: (this: IHookFunctions) => Promise<boolean>;
};
};
@@ -1972,11 +1972,13 @@ export interface IWebhookData {
staticData?: Workflow['staticData'];
}
export type WebhookType = 'default' | 'setup';
export interface IWebhookDescription {
[key: string]: IHttpRequestMethods | WebhookResponseMode | boolean | string | undefined;
httpMethod: IHttpRequestMethods | string;
isFullPath?: boolean;
name: 'default' | 'setup';
name: WebhookType;
path: string;
responseBinaryPropertyName?: string;
responseContentType?: string;