mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 21:49:41 -08:00
409a9ea357
* PairedItem for N8n training * Add paired item to ftp node * Add paired item to rocketChat * Add pairedItem to pushOver * Add paired item to Matrix * Add pairedItem to theHive * Add paired item to Snowflake * Add paired item to PhilipsHue * Add pairedItem to supabase * Add paired item to Odoo * fix odoo & add paired item to grist * add pairedItem to Linkedin * add pairedItem Zulip * add pairedItem PhatomBuster * add pairedItem to TodoistV2 * Add pairedItem HomeAssistant * Add pairedItem to DropContact * Add pairedItem to Aws SES * Add pairedItem to microsoftOutlook * Add pairedItem to AwsS3 * Add pairedItem to Aws DynamoDB * 🐛 fix Dropcontact enrich operation paired item support * 🐛 fix Dropcontact insert/update operation paired items * 🐛 fix Supabase paired item support * 🐛 fix Supabase paired item support * 🐛 fix N8nTrainingCustomerDatastore paired item support * 🎨 remove unused imports * 🐛 fix MicrosoftOutlook paired item support * 🐛 fix AwsS3 paired item support --------- Co-authored-by: Marcus <marcus@n8n.io>
61 lines
1.6 KiB
TypeScript
61 lines
1.6 KiB
TypeScript
import type { IExecuteFunctions } from 'n8n-core';
|
|
|
|
import type { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
|
|
export class N8nTrainingCustomerMessenger implements INodeType {
|
|
description: INodeTypeDescription = {
|
|
displayName: 'Customer Messenger (n8n training)',
|
|
name: 'n8nTrainingCustomerMessenger',
|
|
icon: 'file:n8nTrainingCustomerMessenger.svg',
|
|
group: ['transform'],
|
|
version: 1,
|
|
description: 'Dummy node used for n8n training',
|
|
defaults: {
|
|
name: 'Customer Messenger (n8n training)',
|
|
},
|
|
inputs: ['main'],
|
|
outputs: ['main'],
|
|
properties: [
|
|
{
|
|
displayName: 'Customer ID',
|
|
name: 'customerId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Message',
|
|
name: 'message',
|
|
type: 'string',
|
|
required: true,
|
|
typeOptions: {
|
|
rows: 4,
|
|
},
|
|
default: '',
|
|
},
|
|
],
|
|
};
|
|
|
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
const items = this.getInputData();
|
|
const returnData: INodeExecutionData[] = [];
|
|
const length = items.length;
|
|
let responseData;
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
const customerId = this.getNodeParameter('customerId', i) as string;
|
|
|
|
const message = this.getNodeParameter('message', i) as string;
|
|
|
|
responseData = { output: `Sent message to customer ${customerId}: ${message}` };
|
|
const executionData = this.helpers.constructExecutionMetaData(
|
|
this.helpers.returnJsonArray(responseData),
|
|
{ itemData: { item: i } },
|
|
);
|
|
|
|
returnData.push(...executionData);
|
|
}
|
|
return this.prepareOutputData(returnData);
|
|
}
|
|
}
|