mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
5e16dd4ab4
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>
59 lines
1.2 KiB
TypeScript
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];
|
|
}
|
|
}
|