@shoutkol/n8n-nodes-pumble 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/dist/credentials/PumbleApi.credentials.d.ts +9 -0
- package/dist/credentials/PumbleApi.credentials.js +36 -0
- package/dist/nodes/Pumble/Pumble.node.d.ts +5 -0
- package/dist/nodes/Pumble/Pumble.node.js +337 -0
- package/dist/nodes/Pumble/descriptions.d.ts +655 -0
- package/dist/nodes/Pumble/descriptions.js +618 -0
- package/dist/nodes/Pumble/pumble.svg +4 -0
- package/package.json +40 -0
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── Resource & Operation definitions ────────────────────────────────────────
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.userFields = exports.userOperations = exports.scheduledMessageFields = exports.scheduledMessageOperations = exports.reactionFields = exports.reactionOperations = exports.messageFields = exports.messageOperations = exports.channelFields = exports.channelOperations = exports.resourceOptions = void 0;
|
|
5
|
+
exports.resourceOptions = [
|
|
6
|
+
{ name: 'Channel', value: 'channel' },
|
|
7
|
+
{ name: 'Message', value: 'message' },
|
|
8
|
+
{ name: 'Reaction', value: 'reaction' },
|
|
9
|
+
{ name: 'Scheduled Message', value: 'scheduledMessage' },
|
|
10
|
+
{ name: 'User', value: 'user' },
|
|
11
|
+
];
|
|
12
|
+
// ─── CHANNEL operations ───────────────────────────────────────────────────────
|
|
13
|
+
exports.channelOperations = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Operation',
|
|
16
|
+
name: 'operation',
|
|
17
|
+
type: 'options',
|
|
18
|
+
noDataExpression: true,
|
|
19
|
+
displayOptions: { show: { resource: ['channel'] } },
|
|
20
|
+
options: [
|
|
21
|
+
{ name: 'Add Users', value: 'addUsers', action: 'Add users to a channel' },
|
|
22
|
+
{ name: 'Create', value: 'create', action: 'Create a channel' },
|
|
23
|
+
{ name: 'Get', value: 'get', action: 'Get channel details' },
|
|
24
|
+
{ name: 'List', value: 'list', action: 'List all channels' },
|
|
25
|
+
{ name: 'Remove User', value: 'removeUser', action: 'Remove a user from a channel' },
|
|
26
|
+
],
|
|
27
|
+
default: 'list',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
exports.channelFields = [
|
|
31
|
+
// ── create ──
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Name',
|
|
34
|
+
name: 'name',
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: true,
|
|
37
|
+
default: '',
|
|
38
|
+
displayOptions: { show: { resource: ['channel'], operation: ['create'] } },
|
|
39
|
+
description: 'The name of the new channel',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Type',
|
|
43
|
+
name: 'type',
|
|
44
|
+
type: 'options',
|
|
45
|
+
options: [
|
|
46
|
+
{ name: 'Public', value: 'public' },
|
|
47
|
+
{ name: 'Private', value: 'private' },
|
|
48
|
+
],
|
|
49
|
+
default: 'public',
|
|
50
|
+
displayOptions: { show: { resource: ['channel'], operation: ['create'] } },
|
|
51
|
+
description: 'The type of the channel',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Description',
|
|
55
|
+
name: 'description',
|
|
56
|
+
type: 'string',
|
|
57
|
+
default: '',
|
|
58
|
+
displayOptions: { show: { resource: ['channel'], operation: ['create'] } },
|
|
59
|
+
description: 'Optional description for the new channel',
|
|
60
|
+
},
|
|
61
|
+
// ── get ──
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Identify Channel By',
|
|
64
|
+
name: 'getBy',
|
|
65
|
+
type: 'options',
|
|
66
|
+
options: [
|
|
67
|
+
{ name: 'Channel ID', value: 'channelId' },
|
|
68
|
+
{ name: 'Channel Name', value: 'channel' },
|
|
69
|
+
],
|
|
70
|
+
default: 'channelId',
|
|
71
|
+
displayOptions: { show: { resource: ['channel'], operation: ['get'] } },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Channel ID',
|
|
75
|
+
name: 'channelId',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: '',
|
|
78
|
+
displayOptions: { show: { resource: ['channel'], operation: ['get'], getBy: ['channelId'] } },
|
|
79
|
+
description: 'The unique ID of the channel',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Channel Name',
|
|
83
|
+
name: 'channelName',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
displayOptions: { show: { resource: ['channel'], operation: ['get'], getBy: ['channel'] } },
|
|
87
|
+
description: 'The name of the channel',
|
|
88
|
+
},
|
|
89
|
+
// ── addUsers ──
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Channel ID',
|
|
92
|
+
name: 'channelId',
|
|
93
|
+
type: 'string',
|
|
94
|
+
required: true,
|
|
95
|
+
default: '',
|
|
96
|
+
displayOptions: { show: { resource: ['channel'], operation: ['addUsers'] } },
|
|
97
|
+
description: 'The unique ID of the channel',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
displayName: 'User IDs',
|
|
101
|
+
name: 'userIds',
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true,
|
|
104
|
+
default: '',
|
|
105
|
+
displayOptions: { show: { resource: ['channel'], operation: ['addUsers'] } },
|
|
106
|
+
description: 'Comma-separated list of user IDs to add to the channel',
|
|
107
|
+
},
|
|
108
|
+
// ── removeUser ──
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Channel ID',
|
|
111
|
+
name: 'channelId',
|
|
112
|
+
type: 'string',
|
|
113
|
+
required: true,
|
|
114
|
+
default: '',
|
|
115
|
+
displayOptions: { show: { resource: ['channel'], operation: ['removeUser'] } },
|
|
116
|
+
description: 'The unique ID of the channel',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
displayName: 'User ID',
|
|
120
|
+
name: 'userId',
|
|
121
|
+
type: 'string',
|
|
122
|
+
required: true,
|
|
123
|
+
default: '',
|
|
124
|
+
displayOptions: { show: { resource: ['channel'], operation: ['removeUser'] } },
|
|
125
|
+
description: 'The unique ID of the user to remove',
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
// ─── MESSAGE operations ───────────────────────────────────────────────────────
|
|
129
|
+
exports.messageOperations = [
|
|
130
|
+
{
|
|
131
|
+
displayName: 'Operation',
|
|
132
|
+
name: 'operation',
|
|
133
|
+
type: 'options',
|
|
134
|
+
noDataExpression: true,
|
|
135
|
+
displayOptions: { show: { resource: ['message'] } },
|
|
136
|
+
options: [
|
|
137
|
+
{ name: 'Delete', value: 'delete', action: 'Delete a message' },
|
|
138
|
+
{ name: 'DM Group', value: 'dmGroup', action: 'Send a direct message to a group' },
|
|
139
|
+
{ name: 'DM User', value: 'dmUser', action: 'Send a direct message to a user' },
|
|
140
|
+
{ name: 'Edit', value: 'edit', action: 'Edit a message' },
|
|
141
|
+
{ name: 'Fetch', value: 'fetch', action: 'Fetch a message by ID' },
|
|
142
|
+
{ name: 'Fetch Thread Replies', value: 'fetchThreadReplies', action: 'Fetch replies of a thread' },
|
|
143
|
+
{ name: 'List', value: 'list', action: 'List messages in a channel' },
|
|
144
|
+
{ name: 'Reply', value: 'reply', action: 'Reply to a message' },
|
|
145
|
+
{ name: 'Search', value: 'search', action: 'Search messages' },
|
|
146
|
+
{ name: 'Send', value: 'send', action: 'Send a message to a channel' },
|
|
147
|
+
],
|
|
148
|
+
default: 'send',
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
exports.messageFields = [
|
|
152
|
+
// ── send ──
|
|
153
|
+
{
|
|
154
|
+
displayName: 'Channel Identifier Type',
|
|
155
|
+
name: 'channelIdentType',
|
|
156
|
+
type: 'options',
|
|
157
|
+
options: [
|
|
158
|
+
{ name: 'Channel ID', value: 'channelId' },
|
|
159
|
+
{ name: 'Channel Name', value: 'channel' },
|
|
160
|
+
],
|
|
161
|
+
default: 'channelId',
|
|
162
|
+
displayOptions: { show: { resource: ['message'], operation: ['send', 'reply', 'list', 'fetchThreadReplies'] } },
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Channel ID',
|
|
166
|
+
name: 'channelId',
|
|
167
|
+
type: 'string',
|
|
168
|
+
default: '',
|
|
169
|
+
displayOptions: {
|
|
170
|
+
show: {
|
|
171
|
+
resource: ['message'],
|
|
172
|
+
operation: ['send', 'reply', 'list', 'fetchThreadReplies'],
|
|
173
|
+
channelIdentType: ['channelId'],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
displayName: 'Channel Name',
|
|
179
|
+
name: 'channelName',
|
|
180
|
+
type: 'string',
|
|
181
|
+
default: '',
|
|
182
|
+
displayOptions: {
|
|
183
|
+
show: {
|
|
184
|
+
resource: ['message'],
|
|
185
|
+
operation: ['send', 'reply', 'list', 'fetchThreadReplies'],
|
|
186
|
+
channelIdentType: ['channel'],
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
displayName: 'Text',
|
|
192
|
+
name: 'text',
|
|
193
|
+
type: 'string',
|
|
194
|
+
required: true,
|
|
195
|
+
default: '',
|
|
196
|
+
typeOptions: { rows: 3 },
|
|
197
|
+
displayOptions: { show: { resource: ['message'], operation: ['send', 'reply'] } },
|
|
198
|
+
description: 'The content of the message',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
displayName: 'Send As Bot',
|
|
202
|
+
name: 'asBot',
|
|
203
|
+
type: 'boolean',
|
|
204
|
+
default: false,
|
|
205
|
+
displayOptions: { show: { resource: ['message'], operation: ['send', 'reply'] } },
|
|
206
|
+
description: 'Whether to post the message as a bot',
|
|
207
|
+
},
|
|
208
|
+
// ── reply ──
|
|
209
|
+
{
|
|
210
|
+
displayName: 'Message ID',
|
|
211
|
+
name: 'messageId',
|
|
212
|
+
type: 'string',
|
|
213
|
+
required: true,
|
|
214
|
+
default: '',
|
|
215
|
+
displayOptions: { show: { resource: ['message'], operation: ['reply'] } },
|
|
216
|
+
description: 'The ID of the message to reply to',
|
|
217
|
+
},
|
|
218
|
+
// ── fetch ──
|
|
219
|
+
{
|
|
220
|
+
displayName: 'Message ID',
|
|
221
|
+
name: 'messageId',
|
|
222
|
+
type: 'string',
|
|
223
|
+
required: true,
|
|
224
|
+
default: '',
|
|
225
|
+
displayOptions: { show: { resource: ['message'], operation: ['fetch'] } },
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
displayName: 'Channel Identifier Type',
|
|
229
|
+
name: 'channelIdentType',
|
|
230
|
+
type: 'options',
|
|
231
|
+
options: [
|
|
232
|
+
{ name: 'Channel ID', value: 'channelId' },
|
|
233
|
+
{ name: 'Channel Name', value: 'channel' },
|
|
234
|
+
],
|
|
235
|
+
default: 'channelId',
|
|
236
|
+
displayOptions: { show: { resource: ['message'], operation: ['fetch', 'delete', 'edit'] } },
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
displayName: 'Channel ID',
|
|
240
|
+
name: 'channelId',
|
|
241
|
+
type: 'string',
|
|
242
|
+
default: '',
|
|
243
|
+
displayOptions: {
|
|
244
|
+
show: {
|
|
245
|
+
resource: ['message'],
|
|
246
|
+
operation: ['fetch', 'delete', 'edit'],
|
|
247
|
+
channelIdentType: ['channelId'],
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Channel Name',
|
|
253
|
+
name: 'channelName',
|
|
254
|
+
type: 'string',
|
|
255
|
+
default: '',
|
|
256
|
+
displayOptions: {
|
|
257
|
+
show: {
|
|
258
|
+
resource: ['message'],
|
|
259
|
+
operation: ['fetch', 'delete', 'edit'],
|
|
260
|
+
channelIdentType: ['channel'],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
// ── delete ──
|
|
265
|
+
{
|
|
266
|
+
displayName: 'Message ID',
|
|
267
|
+
name: 'messageId',
|
|
268
|
+
type: 'string',
|
|
269
|
+
required: true,
|
|
270
|
+
default: '',
|
|
271
|
+
displayOptions: { show: { resource: ['message'], operation: ['delete'] } },
|
|
272
|
+
},
|
|
273
|
+
// ── edit ──
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Message ID',
|
|
276
|
+
name: 'messageId',
|
|
277
|
+
type: 'string',
|
|
278
|
+
required: true,
|
|
279
|
+
default: '',
|
|
280
|
+
displayOptions: { show: { resource: ['message'], operation: ['edit'] } },
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
displayName: 'New Text',
|
|
284
|
+
name: 'text',
|
|
285
|
+
type: 'string',
|
|
286
|
+
required: true,
|
|
287
|
+
default: '',
|
|
288
|
+
typeOptions: { rows: 3 },
|
|
289
|
+
displayOptions: { show: { resource: ['message'], operation: ['edit'] } },
|
|
290
|
+
},
|
|
291
|
+
// ── list ──
|
|
292
|
+
{
|
|
293
|
+
displayName: 'Additional Options',
|
|
294
|
+
name: 'listOptions',
|
|
295
|
+
type: 'collection',
|
|
296
|
+
placeholder: 'Add Option',
|
|
297
|
+
default: {},
|
|
298
|
+
displayOptions: { show: { resource: ['message'], operation: ['list'] } },
|
|
299
|
+
options: [
|
|
300
|
+
{ displayName: 'Cursor', name: 'cursor', type: 'string', default: '', description: 'Pagination cursor' },
|
|
301
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', default: 50, description: 'Number of messages to fetch' },
|
|
302
|
+
{ displayName: 'Strategy', name: 'strategy', type: 'string', default: '' },
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
// ── fetchThreadReplies ──
|
|
306
|
+
{
|
|
307
|
+
displayName: 'Root Message ID',
|
|
308
|
+
name: 'rootMessageId',
|
|
309
|
+
type: 'string',
|
|
310
|
+
required: true,
|
|
311
|
+
default: '',
|
|
312
|
+
displayOptions: { show: { resource: ['message'], operation: ['fetchThreadReplies'] } },
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
displayName: 'Additional Options',
|
|
316
|
+
name: 'threadOptions',
|
|
317
|
+
type: 'collection',
|
|
318
|
+
placeholder: 'Add Option',
|
|
319
|
+
default: {},
|
|
320
|
+
displayOptions: { show: { resource: ['message'], operation: ['fetchThreadReplies'] } },
|
|
321
|
+
options: [
|
|
322
|
+
{ displayName: 'Cursor', name: 'cursor', type: 'string', default: '' },
|
|
323
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', default: 50 },
|
|
324
|
+
{ displayName: 'Strategy', name: 'strategy', type: 'string', default: '' },
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
// ── search ──
|
|
328
|
+
{
|
|
329
|
+
displayName: 'Search Text',
|
|
330
|
+
name: 'searchText',
|
|
331
|
+
type: 'string',
|
|
332
|
+
default: '',
|
|
333
|
+
displayOptions: { show: { resource: ['message'], operation: ['search'] } },
|
|
334
|
+
description: 'Text to search for. At least one of text, from, or in must be provided.',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
displayName: 'From (User IDs)',
|
|
338
|
+
name: 'searchFrom',
|
|
339
|
+
type: 'string',
|
|
340
|
+
default: '',
|
|
341
|
+
displayOptions: { show: { resource: ['message'], operation: ['search'] } },
|
|
342
|
+
description: 'Comma-separated user IDs to filter messages by author',
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
displayName: 'In (Channel IDs)',
|
|
346
|
+
name: 'searchIn',
|
|
347
|
+
type: 'string',
|
|
348
|
+
default: '',
|
|
349
|
+
displayOptions: { show: { resource: ['message'], operation: ['search'] } },
|
|
350
|
+
description: 'Comma-separated channel IDs to search within',
|
|
351
|
+
},
|
|
352
|
+
// ── dmUser ──
|
|
353
|
+
{
|
|
354
|
+
displayName: 'Identify User By',
|
|
355
|
+
name: 'dmUserBy',
|
|
356
|
+
type: 'options',
|
|
357
|
+
options: [
|
|
358
|
+
{ name: 'User ID', value: 'userId' },
|
|
359
|
+
{ name: 'Email', value: 'email' },
|
|
360
|
+
],
|
|
361
|
+
default: 'userId',
|
|
362
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmUser'] } },
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
displayName: 'User ID',
|
|
366
|
+
name: 'userId',
|
|
367
|
+
type: 'string',
|
|
368
|
+
default: '',
|
|
369
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmUser'], dmUserBy: ['userId'] } },
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
displayName: 'Email',
|
|
373
|
+
name: 'email',
|
|
374
|
+
type: 'string',
|
|
375
|
+
default: '',
|
|
376
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmUser'], dmUserBy: ['email'] } },
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: 'Text',
|
|
380
|
+
name: 'text',
|
|
381
|
+
type: 'string',
|
|
382
|
+
required: true,
|
|
383
|
+
default: '',
|
|
384
|
+
typeOptions: { rows: 3 },
|
|
385
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmUser'] } },
|
|
386
|
+
},
|
|
387
|
+
// ── dmGroup ──
|
|
388
|
+
{
|
|
389
|
+
displayName: 'Identify Users By',
|
|
390
|
+
name: 'dmGroupBy',
|
|
391
|
+
type: 'options',
|
|
392
|
+
options: [
|
|
393
|
+
{ name: 'User IDs', value: 'userIds' },
|
|
394
|
+
{ name: 'Emails', value: 'emails' },
|
|
395
|
+
],
|
|
396
|
+
default: 'userIds',
|
|
397
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmGroup'] } },
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
displayName: 'User IDs',
|
|
401
|
+
name: 'userIds',
|
|
402
|
+
type: 'string',
|
|
403
|
+
default: '',
|
|
404
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmGroup'], dmGroupBy: ['userIds'] } },
|
|
405
|
+
description: 'Comma-separated list of user IDs',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
displayName: 'Emails',
|
|
409
|
+
name: 'emails',
|
|
410
|
+
type: 'string',
|
|
411
|
+
default: '',
|
|
412
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmGroup'], dmGroupBy: ['emails'] } },
|
|
413
|
+
description: 'Comma-separated list of email addresses',
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
displayName: 'Text',
|
|
417
|
+
name: 'text',
|
|
418
|
+
type: 'string',
|
|
419
|
+
required: true,
|
|
420
|
+
default: '',
|
|
421
|
+
typeOptions: { rows: 3 },
|
|
422
|
+
displayOptions: { show: { resource: ['message'], operation: ['dmGroup'] } },
|
|
423
|
+
},
|
|
424
|
+
];
|
|
425
|
+
// ─── REACTION operations ──────────────────────────────────────────────────────
|
|
426
|
+
exports.reactionOperations = [
|
|
427
|
+
{
|
|
428
|
+
displayName: 'Operation',
|
|
429
|
+
name: 'operation',
|
|
430
|
+
type: 'options',
|
|
431
|
+
noDataExpression: true,
|
|
432
|
+
displayOptions: { show: { resource: ['reaction'] } },
|
|
433
|
+
options: [
|
|
434
|
+
{ name: 'Add', value: 'add', action: 'Add a reaction to a message' },
|
|
435
|
+
{ name: 'Remove', value: 'remove', action: 'Remove a reaction from a message' },
|
|
436
|
+
],
|
|
437
|
+
default: 'add',
|
|
438
|
+
},
|
|
439
|
+
];
|
|
440
|
+
exports.reactionFields = [
|
|
441
|
+
{
|
|
442
|
+
displayName: 'Message ID',
|
|
443
|
+
name: 'messageId',
|
|
444
|
+
type: 'string',
|
|
445
|
+
required: true,
|
|
446
|
+
default: '',
|
|
447
|
+
displayOptions: { show: { resource: ['reaction'], operation: ['add', 'remove'] } },
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
displayName: 'Reaction (Emoji Code)',
|
|
451
|
+
name: 'reaction',
|
|
452
|
+
type: 'string',
|
|
453
|
+
required: true,
|
|
454
|
+
default: '',
|
|
455
|
+
placeholder: ':thumbsup:',
|
|
456
|
+
displayOptions: { show: { resource: ['reaction'], operation: ['add', 'remove'] } },
|
|
457
|
+
description: 'Emoji code for the reaction (e.g. :joy:). Must be at least 3 characters.',
|
|
458
|
+
},
|
|
459
|
+
];
|
|
460
|
+
// ─── SCHEDULED MESSAGE operations ────────────────────────────────────────────
|
|
461
|
+
exports.scheduledMessageOperations = [
|
|
462
|
+
{
|
|
463
|
+
displayName: 'Operation',
|
|
464
|
+
name: 'operation',
|
|
465
|
+
type: 'options',
|
|
466
|
+
noDataExpression: true,
|
|
467
|
+
displayOptions: { show: { resource: ['scheduledMessage'] } },
|
|
468
|
+
options: [
|
|
469
|
+
{ name: 'Create', value: 'create', action: 'Create a scheduled message' },
|
|
470
|
+
{ name: 'Delete', value: 'delete', action: 'Delete a scheduled message' },
|
|
471
|
+
{ name: 'Edit', value: 'edit', action: 'Edit a scheduled message' },
|
|
472
|
+
{ name: 'Fetch', value: 'fetch', action: 'Fetch a scheduled message by ID' },
|
|
473
|
+
{ name: 'List', value: 'list', action: 'List scheduled messages' },
|
|
474
|
+
],
|
|
475
|
+
default: 'list',
|
|
476
|
+
},
|
|
477
|
+
];
|
|
478
|
+
exports.scheduledMessageFields = [
|
|
479
|
+
// ── create ──
|
|
480
|
+
{
|
|
481
|
+
displayName: 'Channel ID',
|
|
482
|
+
name: 'channelId',
|
|
483
|
+
type: 'string',
|
|
484
|
+
required: true,
|
|
485
|
+
default: '',
|
|
486
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['create'] } },
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
displayName: 'Text',
|
|
490
|
+
name: 'text',
|
|
491
|
+
type: 'string',
|
|
492
|
+
required: true,
|
|
493
|
+
default: '',
|
|
494
|
+
typeOptions: { rows: 3 },
|
|
495
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['create'] } },
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
displayName: 'Send At (Unix ms)',
|
|
499
|
+
name: 'sendAt',
|
|
500
|
+
type: 'number',
|
|
501
|
+
required: true,
|
|
502
|
+
default: 0,
|
|
503
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['create'] } },
|
|
504
|
+
description: 'Unix timestamp in milliseconds when the message should be sent',
|
|
505
|
+
},
|
|
506
|
+
// ── list ──
|
|
507
|
+
{
|
|
508
|
+
displayName: 'Additional Options',
|
|
509
|
+
name: 'listOptions',
|
|
510
|
+
type: 'collection',
|
|
511
|
+
placeholder: 'Add Option',
|
|
512
|
+
default: {},
|
|
513
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['list'] } },
|
|
514
|
+
options: [
|
|
515
|
+
{ displayName: 'Channel ID', name: 'channelId', type: 'string', default: '' },
|
|
516
|
+
{ displayName: 'Cursor', name: 'cursor', type: 'string', default: '' },
|
|
517
|
+
{ displayName: 'Limit', name: 'limit', type: 'number', default: 50 },
|
|
518
|
+
],
|
|
519
|
+
},
|
|
520
|
+
// ── fetch ──
|
|
521
|
+
{
|
|
522
|
+
displayName: 'Scheduled Message ID',
|
|
523
|
+
name: 'scheduledMessageId',
|
|
524
|
+
type: 'string',
|
|
525
|
+
required: true,
|
|
526
|
+
default: '',
|
|
527
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['fetch', 'delete'] } },
|
|
528
|
+
},
|
|
529
|
+
// ── edit ──
|
|
530
|
+
{
|
|
531
|
+
displayName: 'Scheduled Message ID',
|
|
532
|
+
name: 'scheduledMessageId',
|
|
533
|
+
type: 'string',
|
|
534
|
+
required: true,
|
|
535
|
+
default: '',
|
|
536
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['edit'] } },
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
displayName: 'New Text',
|
|
540
|
+
name: 'text',
|
|
541
|
+
type: 'string',
|
|
542
|
+
default: '',
|
|
543
|
+
typeOptions: { rows: 3 },
|
|
544
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['edit'] } },
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
displayName: 'New Send At (Unix ms)',
|
|
548
|
+
name: 'sendAt',
|
|
549
|
+
type: 'number',
|
|
550
|
+
default: 0,
|
|
551
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['edit'] } },
|
|
552
|
+
description: 'Unix timestamp in milliseconds. Leave 0 to keep the current schedule.',
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
displayName: 'Channel ID',
|
|
556
|
+
name: 'channelId',
|
|
557
|
+
type: 'string',
|
|
558
|
+
default: '',
|
|
559
|
+
displayOptions: { show: { resource: ['scheduledMessage'], operation: ['edit'] } },
|
|
560
|
+
},
|
|
561
|
+
];
|
|
562
|
+
// ─── USER operations ──────────────────────────────────────────────────────────
|
|
563
|
+
exports.userOperations = [
|
|
564
|
+
{
|
|
565
|
+
displayName: 'Operation',
|
|
566
|
+
name: 'operation',
|
|
567
|
+
type: 'options',
|
|
568
|
+
noDataExpression: true,
|
|
569
|
+
displayOptions: { show: { resource: ['user'] } },
|
|
570
|
+
options: [
|
|
571
|
+
{ name: 'Get My Info', value: 'myInfo', action: 'Get information about the current user' },
|
|
572
|
+
{ name: 'List Users', value: 'list', action: 'List all users in the workspace' },
|
|
573
|
+
{ name: 'List User Groups', value: 'listGroups', action: 'List all user groups' },
|
|
574
|
+
{ name: 'Update Custom Status', value: 'customStatus', action: 'Update custom status' },
|
|
575
|
+
],
|
|
576
|
+
default: 'myInfo',
|
|
577
|
+
},
|
|
578
|
+
];
|
|
579
|
+
exports.userFields = [
|
|
580
|
+
// ── customStatus ──
|
|
581
|
+
{
|
|
582
|
+
displayName: 'Emoji Code',
|
|
583
|
+
name: 'code',
|
|
584
|
+
type: 'string',
|
|
585
|
+
default: '',
|
|
586
|
+
placeholder: ':joy:',
|
|
587
|
+
displayOptions: { show: { resource: ['user'], operation: ['customStatus'] } },
|
|
588
|
+
description: 'Emoji code for the custom status',
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
displayName: 'Status Text',
|
|
592
|
+
name: 'status',
|
|
593
|
+
type: 'string',
|
|
594
|
+
default: '',
|
|
595
|
+
displayOptions: { show: { resource: ['user'], operation: ['customStatus'] } },
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
displayName: 'Expiration Type',
|
|
599
|
+
name: 'expiration',
|
|
600
|
+
type: 'options',
|
|
601
|
+
options: [
|
|
602
|
+
{ name: 'Custom', value: 'custom' },
|
|
603
|
+
{ name: 'Never', value: 'never' },
|
|
604
|
+
{ name: 'Today', value: 'today' },
|
|
605
|
+
{ name: 'This Week', value: 'thisWeek' },
|
|
606
|
+
],
|
|
607
|
+
default: 'never',
|
|
608
|
+
displayOptions: { show: { resource: ['user'], operation: ['customStatus'] } },
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
displayName: 'Expires At (Unix ms)',
|
|
612
|
+
name: 'expiresAt',
|
|
613
|
+
type: 'number',
|
|
614
|
+
default: 0,
|
|
615
|
+
displayOptions: { show: { resource: ['user'], operation: ['customStatus'], expiration: ['custom'] } },
|
|
616
|
+
description: 'Unix timestamp in milliseconds when the status expires',
|
|
617
|
+
},
|
|
618
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shoutkol/n8n-nodes-pumble",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for the Pumble API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"pumble",
|
|
8
|
+
"messaging",
|
|
9
|
+
"chat"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "shoutkol"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc && cp nodes/Pumble/*.svg dist/nodes/Pumble/",
|
|
17
|
+
"dev": "tsc --watch",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"n8n": {
|
|
24
|
+
"n8nNodesApiVersion": 1,
|
|
25
|
+
"credentials": [
|
|
26
|
+
"dist/credentials/PumbleApi.credentials.js"
|
|
27
|
+
],
|
|
28
|
+
"nodes": [
|
|
29
|
+
"dist/nodes/Pumble/Pumble.node.js"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^18.16.0",
|
|
34
|
+
"n8n-workflow": "*",
|
|
35
|
+
"typescript": "^5.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"n8n-workflow": "*"
|
|
39
|
+
}
|
|
40
|
+
}
|