UNPKG

n8n-nodes-tess-ai-by-pareto

Version:

n8n community node for interacting with the Tess API by Pareto

51 lines (45 loc) 1.21 kB
import { INodeType, INodeTypeDescription, IExecuteFunctions } from 'n8n-workflow'; export class TessApi implements INodeType { description: INodeTypeDescription = { displayName: 'Tess API', name: 'tessApi', group: ['transform'], version: 1, description: 'Consume Tess API', defaults: { name: 'Tess API', }, inputs: ['main' as const], outputs: ['main' as const], credentials: [ { name: 'tessApi', required: true, }, ], properties: [ { displayName: 'Resource', name: 'resource', type: 'string', default: 'agents', }, { displayName: 'Operation', name: 'operation', type: 'string', default: 'list', } ], }; async execute(this: IExecuteFunctions) { const items = this.getInputData(); const returnData = []; for (let i = 0; i < items.length; i++) { const resource = this.getNodeParameter('resource', i) as string; const operation = this.getNodeParameter('operation', i) as string; returnData.push({ json: { resource, operation, status: 'Executed (Mock)' } }); } return [returnData]; } }