n8n/packages/nodes-base/nodes/ICalendar/ICalendar.node.ts
Michael Kret 5e16dd4ab4
feat(core): Improvements/overhaul for nodes working with binary data (#7651)
Github issue / Community forum post (link here to close automatically):

---------

Co-authored-by: Giulio Andreini <andreini@netseven.it>
Co-authored-by: Marcus <marcus@n8n.io>
2024-01-03 13:08:16 +02:00

59 lines
1.2 KiB
TypeScript

/* eslint-disable n8n-nodes-base/node-filename-against-convention */
import type {
IExecuteFunctions,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import * as createEvent from './createEvent.operation';
export class ICalendar implements INodeType {
description: INodeTypeDescription = {
hidden: true,
displayName: 'iCalendar',
name: 'iCal',
icon: 'fa:calendar',
group: ['input'],
version: 1,
subtitle: '={{$parameter["operation"]}}',
description: 'Create iCalendar file',
defaults: {
name: 'iCalendar',
color: '#408000',
},
inputs: ['main'],
outputs: ['main'],
credentials: [],
properties: [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Create Event File',
value: 'createEventFile',
},
],
default: 'createEventFile',
},
...createEvent.description,
],
};
async execute(this: IExecuteFunctions) {
const items = this.getInputData();
const operation = this.getNodeParameter('operation', 0);
let returnData: INodeExecutionData[] = [];
if (operation === 'createEventFile') {
returnData = await createEvent.execute.call(this, items);
}
return [returnData];
}
}