mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Improve typings for webhook methods (no-changelog) (#5713)
This commit is contained in:
committed by
GitHub
parent
a28396ee91
commit
6a8c9b7ccc
@@ -1163,6 +1163,8 @@ export interface ITriggerResponse {
|
||||
manualTriggerResponse?: Promise<INodeExecutionData[][]>;
|
||||
}
|
||||
|
||||
export type WebhookSetupMethodNames = 'checkExists' | 'create' | 'delete';
|
||||
|
||||
export interface INodeType {
|
||||
description: INodeTypeDescription;
|
||||
execute?(
|
||||
@@ -1172,9 +1174,6 @@ export interface INodeType {
|
||||
poll?(this: IPollFunctions): Promise<INodeExecutionData[][] | null>;
|
||||
trigger?(this: ITriggerFunctions): Promise<ITriggerResponse | undefined>;
|
||||
webhook?(this: IWebhookFunctions): Promise<IWebhookResponseData>;
|
||||
hooks?: {
|
||||
[key: string]: (this: IHookFunctions) => Promise<boolean>;
|
||||
};
|
||||
methods?: {
|
||||
loadOptions?: {
|
||||
[key: string]: (this: ILoadOptionsFunctions) => Promise<INodePropertyOptions[]>;
|
||||
@@ -1192,7 +1191,9 @@ export interface INodeType {
|
||||
};
|
||||
};
|
||||
webhookMethods?: {
|
||||
[key: string]: IWebhookSetupMethods;
|
||||
[name in IWebhookDescription['name']]?: {
|
||||
[method in WebhookSetupMethodNames]: (this: IHookFunctions) => Promise<boolean>;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1213,15 +1214,6 @@ export interface INodeCredentialTestRequest {
|
||||
credentials: ICredentialsDecrypted;
|
||||
}
|
||||
|
||||
export type WebhookSetupMethodNames = 'checkExists' | 'create' | 'delete';
|
||||
|
||||
export interface IWebhookSetupMethods {
|
||||
[key: string]: ((this: IHookFunctions) => Promise<boolean>) | undefined;
|
||||
checkExists?: (this: IHookFunctions) => Promise<boolean>;
|
||||
create?: (this: IHookFunctions) => Promise<boolean>;
|
||||
delete?: (this: IHookFunctions) => Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface INodeCredentialDescription {
|
||||
name: string;
|
||||
required?: boolean;
|
||||
@@ -1436,7 +1428,7 @@ export interface IWebhookDescription {
|
||||
[key: string]: WebhookHttpMethod | WebhookResponseMode | boolean | string | undefined;
|
||||
httpMethod: WebhookHttpMethod | string;
|
||||
isFullPath?: boolean;
|
||||
name: string;
|
||||
name: 'default' | 'setup';
|
||||
path: string;
|
||||
responseBinaryPropertyName?: string;
|
||||
responseContentType?: string;
|
||||
|
||||
Reference in New Issue
Block a user