From a3185cc07e06b2de80d50c2bb20f34b6022c1662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 10 Mar 2021 19:56:59 -0300 Subject: [PATCH] :zap: Add channel resource description stub --- .../descriptions/ChannelDescription.ts | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 packages/nodes-base/nodes/Discord/descriptions/ChannelDescription.ts diff --git a/packages/nodes-base/nodes/Discord/descriptions/ChannelDescription.ts b/packages/nodes-base/nodes/Discord/descriptions/ChannelDescription.ts new file mode 100644 index 0000000000..fe5b3d7d60 --- /dev/null +++ b/packages/nodes-base/nodes/Discord/descriptions/ChannelDescription.ts @@ -0,0 +1,148 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const channelOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'channel', + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + }, + { + name: 'Delete', + value: 'delete', + }, + { + name: 'Update', + value: 'update', + }, + ], + default: 'get', + description: 'Operation to perform', + }, +] as INodeProperties[]; + +export const channelFields = [ + // ---------------------------------- + // channel: get + // ---------------------------------- + { + displayName: 'Channel ID', + name: 'channelId', + description: 'ID of the channel to retrieve.', + type: 'string', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'channel', + ], + operation: [ + 'get', + ], + }, + }, + }, + + // ---------------------------------- + // channel: update + // ---------------------------------- + { + displayName: 'Channel ID', + name: 'channelId', + description: '', // TODO + type: 'string', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'channel', + ], + operation: [ + 'update', + ], + }, + }, + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'channel', + ], + operation: [ + 'update', + ], + }, + }, + options: [ + { + displayName: 'Bitrate', + name: 'bitrate', + description: 'Bitrate of the channel, in bits. Voice channels only.', + type: 'number', + default: 0, + }, + { + displayName: 'Name', + name: 'name', + description: 'Name of the channel.', + type: 'string', + default: '', + }, + { + displayName: 'NSFW', + name: 'nsfw', + description: 'Whether the channel is labeled \'Not safe for work\'.', + type: 'boolean', + default: false, + }, + { + displayName: 'Position', + name: 'position', + description: 'Position of the channel in the left-hand listing.', + type: 'string', + default: '', + }, + { + displayName: 'Rate Limit Per User', + name: 'rate_limit_per_user', + description: 'Seconds that a user must wait before sending another message.', + type: 'number', + default: 0, + }, + { + displayName: 'Topic', + name: 'topic', + description: 'Topic of the channel.', + type: 'string', + default: '', + }, + { + displayName: 'User Limit', + name: 'user_limit', + description: 'User limit of the channel. Voice channels only.', + type: 'number', + default: 0, + }, + ], + }, +] as INodeProperties[];