| | import { |
| | IDataObject, |
| | IWebhookFunctions, |
| | INodeTypeDescription, |
| | INodeType, |
| | IWebhookResponseData, |
| | } from 'n8n-workflow'; |
| |
|
| | export class ClassNameReplace implements INodeType { |
| | description: INodeTypeDescription = { |
| | displayName: 'DisplayNameReplace', |
| | name: 'N8nNameReplace', |
| | group: ['trigger'], |
| | version: 1, |
| | description: 'NodeDescriptionReplace', |
| | defaults: { |
| | name: 'DisplayNameReplace', |
| | color: '#885577', |
| | }, |
| | inputs: [], |
| | outputs: ['main'], |
| | webhooks: [ |
| | { |
| | name: 'default', |
| | httpMethod: 'POST', |
| | responseMode: 'onReceived', |
| | |
| | |
| | |
| | path: '={{$parameter["path"]}}', |
| | }, |
| | ], |
| | properties: [ |
| | { |
| | displayName: 'Path', |
| | name: 'path', |
| | type: 'string', |
| | default: '', |
| | placeholder: '', |
| | required: true, |
| | description: 'The path to listen to', |
| | }, |
| | ], |
| | }; |
| |
|
| | async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> { |
| | |
| | const returnData: IDataObject[] = []; |
| | returnData.push({ |
| | headers: this.getHeaderData(), |
| | params: this.getParamsData(), |
| | query: this.getQueryData(), |
| | body: this.getBodyData(), |
| | }); |
| |
|
| | return { |
| | workflowData: [this.helpers.returnJsonArray(returnData)], |
| | }; |
| | } |
| | } |
| |
|