@sendpulse/n8n-nodes-sendpulse 0.0.1

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.
Files changed (71) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +820 -0
  3. package/dist/credentials/SendPulseApi.credentials.d.ts +10 -0
  4. package/dist/credentials/SendPulseApi.credentials.js +37 -0
  5. package/dist/credentials/SendPulseApi.credentials.js.map +1 -0
  6. package/dist/credentials/SendPulseOAuth2Api.credentials.d.ts +10 -0
  7. package/dist/credentials/SendPulseOAuth2Api.credentials.js +62 -0
  8. package/dist/credentials/SendPulseOAuth2Api.credentials.js.map +1 -0
  9. package/dist/icons/sendpulse.dark.svg +4 -0
  10. package/dist/icons/sendpulse.svg +4 -0
  11. package/dist/images/mailing-list-operation.png +0 -0
  12. package/dist/images/node.png +0 -0
  13. package/dist/images/workflow1.png +0 -0
  14. package/dist/images/workflow2.png +0 -0
  15. package/dist/images/workflow3.png +0 -0
  16. package/dist/nodes/SendPulseA360/SendPulseA360.node.d.ts +4 -0
  17. package/dist/nodes/SendPulseA360/SendPulseA360.node.js +174 -0
  18. package/dist/nodes/SendPulseA360/SendPulseA360.node.js.map +1 -0
  19. package/dist/nodes/SendPulseA360/SendPulseA360.node.json +25 -0
  20. package/dist/nodes/SendPulseA360/sendpulse.svg +4 -0
  21. package/dist/nodes/SendPulseChatbots/SendPulseChatbots.node.d.ts +4 -0
  22. package/dist/nodes/SendPulseChatbots/SendPulseChatbots.node.js +489 -0
  23. package/dist/nodes/SendPulseChatbots/SendPulseChatbots.node.js.map +1 -0
  24. package/dist/nodes/SendPulseChatbots/SendPulseChatbots.node.json +25 -0
  25. package/dist/nodes/SendPulseChatbots/sendpulse.svg +4 -0
  26. package/dist/nodes/SendPulseChatbots/shared/utils.d.ts +5 -0
  27. package/dist/nodes/SendPulseChatbots/shared/utils.js +45 -0
  28. package/dist/nodes/SendPulseChatbots/shared/utils.js.map +1 -0
  29. package/dist/nodes/SendPulseCrm/SendPulseCrm.node.d.ts +4 -0
  30. package/dist/nodes/SendPulseCrm/SendPulseCrm.node.js +1750 -0
  31. package/dist/nodes/SendPulseCrm/SendPulseCrm.node.js.map +1 -0
  32. package/dist/nodes/SendPulseCrm/SendPulseCrm.node.json +25 -0
  33. package/dist/nodes/SendPulseCrm/sendpulse.svg +4 -0
  34. package/dist/nodes/SendPulseEmail/SendPulseEmail.node.d.ts +4 -0
  35. package/dist/nodes/SendPulseEmail/SendPulseEmail.node.js +992 -0
  36. package/dist/nodes/SendPulseEmail/SendPulseEmail.node.js.map +1 -0
  37. package/dist/nodes/SendPulseEmail/SendPulseEmail.node.json +25 -0
  38. package/dist/nodes/SendPulseEmail/sendpulse.svg +4 -0
  39. package/dist/nodes/SendPulseFileManager/SendPulseFileManager.node.d.ts +4 -0
  40. package/dist/nodes/SendPulseFileManager/SendPulseFileManager.node.js +234 -0
  41. package/dist/nodes/SendPulseFileManager/SendPulseFileManager.node.js.map +1 -0
  42. package/dist/nodes/SendPulseFileManager/SendPulseFileManager.node.json +25 -0
  43. package/dist/nodes/SendPulseFileManager/sendpulse.svg +4 -0
  44. package/dist/nodes/SendPulsePopUps/SendPulsePopUps.node.d.ts +4 -0
  45. package/dist/nodes/SendPulsePopUps/SendPulsePopUps.node.js +196 -0
  46. package/dist/nodes/SendPulsePopUps/SendPulsePopUps.node.js.map +1 -0
  47. package/dist/nodes/SendPulsePopUps/SendPulsePopUps.node.json +25 -0
  48. package/dist/nodes/SendPulsePopUps/sendpulse.svg +4 -0
  49. package/dist/nodes/SendPulseSms/SendPulseSms.node.d.ts +4 -0
  50. package/dist/nodes/SendPulseSms/SendPulseSms.node.js +347 -0
  51. package/dist/nodes/SendPulseSms/SendPulseSms.node.js.map +1 -0
  52. package/dist/nodes/SendPulseSms/SendPulseSms.node.json +25 -0
  53. package/dist/nodes/SendPulseSms/sendpulse.svg +4 -0
  54. package/dist/nodes/SendPulseSmtp/SendPulseSmtp.node.d.ts +4 -0
  55. package/dist/nodes/SendPulseSmtp/SendPulseSmtp.node.js +644 -0
  56. package/dist/nodes/SendPulseSmtp/SendPulseSmtp.node.js.map +1 -0
  57. package/dist/nodes/SendPulseSmtp/SendPulseSmtp.node.json +25 -0
  58. package/dist/nodes/SendPulseSmtp/sendpulse.svg +4 -0
  59. package/dist/nodes/SendPulseVerifier/SendPulseVerifier.node.d.ts +4 -0
  60. package/dist/nodes/SendPulseVerifier/SendPulseVerifier.node.js +195 -0
  61. package/dist/nodes/SendPulseVerifier/SendPulseVerifier.node.js.map +1 -0
  62. package/dist/nodes/SendPulseVerifier/SendPulseVerifier.node.json +25 -0
  63. package/dist/nodes/SendPulseVerifier/sendpulse.svg +4 -0
  64. package/dist/nodes/SendPulseWebPush/SendPulseWebPush.node.d.ts +4 -0
  65. package/dist/nodes/SendPulseWebPush/SendPulseWebPush.node.js +697 -0
  66. package/dist/nodes/SendPulseWebPush/SendPulseWebPush.node.js.map +1 -0
  67. package/dist/nodes/SendPulseWebPush/SendPulseWebPush.node.json +25 -0
  68. package/dist/nodes/SendPulseWebPush/sendpulse.svg +4 -0
  69. package/dist/package.json +67 -0
  70. package/dist/tsconfig.tsbuildinfo +1 -0
  71. package/package.json +67 -0
@@ -0,0 +1,489 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendPulseChatbots = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const utils_1 = require("./shared/utils");
6
+ class SendPulseChatbots {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'SendPulse Chatbots',
10
+ name: 'sendPulseChatbots',
11
+ icon: 'file:sendpulse.svg',
12
+ group: ['transform'],
13
+ version: 1,
14
+ subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
15
+ description: 'Interact with SendPulse API',
16
+ defaults: {
17
+ name: 'SendPulse Chatbots',
18
+ },
19
+ usableAsTool: true,
20
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
21
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
22
+ credentials: [
23
+ {
24
+ name: 'sendPulseApi',
25
+ required: false,
26
+ displayOptions: {
27
+ show: {
28
+ authentication: ['accessToken'],
29
+ },
30
+ },
31
+ },
32
+ {
33
+ name: 'sendPulseOAuth2Api',
34
+ required: false,
35
+ displayOptions: {
36
+ show: {
37
+ authentication: ['oAuth2'],
38
+ },
39
+ },
40
+ },
41
+ ],
42
+ requestDefaults: {
43
+ baseURL: 'https://api.sendpulse.com',
44
+ headers: {
45
+ Accept: 'application/json',
46
+ 'Content-Type': 'application/json',
47
+ },
48
+ },
49
+ properties: [
50
+ {
51
+ displayName: 'Authentication',
52
+ name: 'authentication',
53
+ type: 'options',
54
+ options: [
55
+ {
56
+ name: 'Client ID & Client Secret',
57
+ value: 'oAuth2',
58
+ },
59
+ {
60
+ name: 'Access Token',
61
+ value: 'accessToken',
62
+ }
63
+ ],
64
+ default: 'oAuth2',
65
+ },
66
+ {
67
+ displayName: 'Resource',
68
+ name: 'resource',
69
+ type: 'options',
70
+ noDataExpression: true,
71
+ options: [
72
+ {
73
+ name: 'Bot',
74
+ value: 'bot',
75
+ },
76
+ {
77
+ name: 'Dialog',
78
+ value: 'dialog',
79
+ },
80
+ {
81
+ name: 'Contact',
82
+ value: 'contact',
83
+ },
84
+ {
85
+ name: 'Flow',
86
+ value: 'flow',
87
+ },
88
+ ],
89
+ default: 'bot',
90
+ },
91
+ {
92
+ displayName: 'Operation',
93
+ name: 'operation',
94
+ type: 'options',
95
+ noDataExpression: true,
96
+ displayOptions: {
97
+ show: {
98
+ resource: ['bot'],
99
+ },
100
+ },
101
+ options: [
102
+ {
103
+ name: 'Get Many',
104
+ value: 'getMany',
105
+ description: 'Get a list of bots',
106
+ action: 'Get many bots',
107
+ routing: {
108
+ request: {
109
+ method: 'GET',
110
+ url: '=/chatbots/bots',
111
+ },
112
+ },
113
+ },
114
+ ],
115
+ default: 'getMany',
116
+ },
117
+ {
118
+ displayName: 'Operation',
119
+ name: 'operation',
120
+ type: 'options',
121
+ noDataExpression: true,
122
+ displayOptions: {
123
+ show: {
124
+ resource: ['dialog'],
125
+ },
126
+ },
127
+ options: [
128
+ {
129
+ name: 'Get Many',
130
+ value: 'getMany',
131
+ description: 'Get a list of dialogs',
132
+ action: 'Get many dialogs',
133
+ routing: {
134
+ request: {
135
+ method: 'GET',
136
+ url: '=/chatbots/dialogs',
137
+ qs: {
138
+ size: '={{ $parameter.additionalFields.limit }}',
139
+ skip: '={{ $parameter.additionalFields.offset }}',
140
+ search_after: '={{ $parameter.additionalFields.searchAfterId }}',
141
+ order: '={{ $parameter.additionalFields.order }}',
142
+ },
143
+ },
144
+ },
145
+ },
146
+ ],
147
+ default: 'getMany',
148
+ },
149
+ {
150
+ displayName: 'Operation',
151
+ name: 'operation',
152
+ type: 'options',
153
+ noDataExpression: true,
154
+ displayOptions: {
155
+ show: {
156
+ resource: ['contact'],
157
+ },
158
+ },
159
+ options: [
160
+ {
161
+ name: 'Get',
162
+ value: 'get',
163
+ description: 'Get a contact by ID',
164
+ action: 'Get a contact',
165
+ routing: {
166
+ request: {
167
+ method: 'GET',
168
+ url: '=/{{ $parameter.channel }}/contacts/get',
169
+ qs: {
170
+ id: '={{ $parameter.contactId }}',
171
+ },
172
+ },
173
+ },
174
+ },
175
+ {
176
+ name: 'Send Message',
177
+ value: 'send',
178
+ description: 'Sends a text message, image or file to a contact via chatbot',
179
+ action: 'Send a message to a contact',
180
+ routing: {
181
+ request: {
182
+ method: 'POST',
183
+ url: '=/{{ $parameter.channel }}/contacts/send',
184
+ body: {
185
+ contact_id: '={{ $parameter.contactId }}',
186
+ },
187
+ },
188
+ },
189
+ },
190
+ ],
191
+ default: 'get',
192
+ },
193
+ {
194
+ displayName: 'Operation',
195
+ name: 'operation',
196
+ type: 'options',
197
+ noDataExpression: true,
198
+ displayOptions: {
199
+ show: {
200
+ resource: ['flow'],
201
+ },
202
+ },
203
+ options: [
204
+ {
205
+ name: 'Run',
206
+ value: 'run',
207
+ description: 'Run a flow by ID and contact ID',
208
+ action: 'Run a flow',
209
+ routing: {
210
+ request: {
211
+ method: 'POST',
212
+ url: '=/{{ $parameter.channel }}/flows/run',
213
+ body: {
214
+ contact_id: '={{ $parameter.contactId }}',
215
+ },
216
+ },
217
+ },
218
+ },
219
+ ],
220
+ default: 'run',
221
+ },
222
+ {
223
+ displayName: 'Channel',
224
+ name: 'channel',
225
+ type: 'options',
226
+ required: true,
227
+ displayOptions: {
228
+ show: {
229
+ resource: ['contact', 'flow'],
230
+ operation: ['get', 'send', 'run'],
231
+ },
232
+ },
233
+ options: [
234
+ {
235
+ name: 'Facebook Messenger',
236
+ value: 'messenger',
237
+ },
238
+ {
239
+ name: 'Instagram',
240
+ value: 'instagram',
241
+ },
242
+ {
243
+ name: 'LiveChat',
244
+ value: 'live-chat',
245
+ },
246
+ {
247
+ name: 'Telegram',
248
+ value: 'telegram',
249
+ },
250
+ {
251
+ name: 'TikTok',
252
+ value: 'tiktok',
253
+ },
254
+ {
255
+ name: 'Viber',
256
+ value: 'viber/chatbots',
257
+ },
258
+ {
259
+ name: 'WhatsApp',
260
+ value: 'whatsapp',
261
+ },
262
+ ],
263
+ default: 'messenger',
264
+ description: 'Chatbot channel',
265
+ },
266
+ {
267
+ displayName: 'Contact ID',
268
+ name: 'contactId',
269
+ type: 'string',
270
+ required: true,
271
+ displayOptions: {
272
+ show: {
273
+ resource: ['contact', 'flow'],
274
+ operation: ['get', 'send', 'run'],
275
+ },
276
+ },
277
+ default: '',
278
+ description: 'The ID of the contact',
279
+ },
280
+ {
281
+ displayName: 'Flow ID',
282
+ name: 'flowId',
283
+ type: 'string',
284
+ required: true,
285
+ displayOptions: {
286
+ show: {
287
+ resource: ['flow'],
288
+ operation: ['run'],
289
+ },
290
+ },
291
+ default: '',
292
+ description: 'The ID of the flow',
293
+ routing: {
294
+ send: {
295
+ type: 'body',
296
+ property: 'flow_id',
297
+ },
298
+ },
299
+ },
300
+ {
301
+ displayName: 'Message Text',
302
+ name: 'messageText',
303
+ type: 'string',
304
+ required: true,
305
+ typeOptions: {
306
+ rows: 4,
307
+ },
308
+ displayOptions: {
309
+ show: {
310
+ resource: ['contact'],
311
+ operation: ['send'],
312
+ channel: ['telegram', 'messenger', 'whatsapp'],
313
+ },
314
+ },
315
+ default: '',
316
+ description: 'The text message to send',
317
+ routing: {
318
+ send: {
319
+ type: 'body',
320
+ property: 'message',
321
+ value: `={{ (${utils_1.prepareMessage})($parameter.channel, $value) }}`,
322
+ },
323
+ },
324
+ },
325
+ {
326
+ displayName: 'Messages',
327
+ name: 'messages',
328
+ type: 'fixedCollection',
329
+ required: true,
330
+ typeOptions: {
331
+ multipleValues: true,
332
+ },
333
+ displayOptions: {
334
+ show: {
335
+ resource: ['contact'],
336
+ operation: ['send'],
337
+ channel: ['live-chat', 'instagram', 'viber/chatbots', 'tiktok'],
338
+ },
339
+ },
340
+ options: [
341
+ {
342
+ name: 'messagesList',
343
+ displayName: 'Messages',
344
+ values: [
345
+ {
346
+ displayName: 'Message Text',
347
+ name: 'messageText',
348
+ type: 'string',
349
+ typeOptions: {
350
+ rows: 4,
351
+ },
352
+ default: '',
353
+ description: 'The text message',
354
+ },
355
+ ],
356
+ },
357
+ ],
358
+ default: {},
359
+ placeholder: 'Add Message',
360
+ description: 'The text messages to send',
361
+ routing: {
362
+ send: {
363
+ type: 'body',
364
+ property: 'messages',
365
+ value: `={{ (${utils_1.prepareMessage})($parameter.channel, $value.messagesList) }}`,
366
+ },
367
+ },
368
+ },
369
+ {
370
+ displayName: 'Additional Fields',
371
+ name: 'additionalFields',
372
+ type: 'collection',
373
+ placeholder: 'Add Field',
374
+ default: {},
375
+ displayOptions: {
376
+ show: {
377
+ resource: ['dialog'],
378
+ operation: ['getMany'],
379
+ },
380
+ },
381
+ options: [
382
+ {
383
+ displayName: 'Limit',
384
+ name: 'limit',
385
+ type: 'number',
386
+ typeOptions: {
387
+ minValue: 1,
388
+ maxValue: 1000,
389
+ },
390
+ default: 50,
391
+ description: 'Max number of results to return',
392
+ },
393
+ {
394
+ displayName: 'Order',
395
+ name: 'order',
396
+ type: 'options',
397
+ options: [
398
+ {
399
+ name: 'Ascending',
400
+ value: 'asc',
401
+ },
402
+ {
403
+ name: 'Descending',
404
+ value: 'desc',
405
+ },
406
+ ],
407
+ default: 'desc',
408
+ description: 'Sorting direction for dialogs',
409
+ },
410
+ {
411
+ displayName: 'Offset',
412
+ name: 'offset',
413
+ type: 'number',
414
+ typeOptions: {
415
+ minValue: 0,
416
+ },
417
+ default: 0,
418
+ description: 'Number of results to skip',
419
+ },
420
+ {
421
+ displayName: 'Search After ID',
422
+ name: 'searchAfterId',
423
+ type: 'string',
424
+ default: '',
425
+ description: 'Dialog ID after which the listing should resume',
426
+ },
427
+ ],
428
+ },
429
+ {
430
+ displayName: 'Additional Fields',
431
+ name: 'additionalFields',
432
+ type: 'collection',
433
+ placeholder: 'Add Field',
434
+ default: {},
435
+ displayOptions: {
436
+ show: {
437
+ resource: ['flow'],
438
+ operation: ['run'],
439
+ },
440
+ },
441
+ options: [
442
+ {
443
+ displayName: 'External Data',
444
+ name: 'externalData',
445
+ type: 'fixedCollection',
446
+ typeOptions: {
447
+ multipleValues: true,
448
+ },
449
+ options: [
450
+ {
451
+ name: 'data',
452
+ displayName: 'Variables',
453
+ values: [
454
+ {
455
+ displayName: 'Name',
456
+ name: 'name',
457
+ type: 'string',
458
+ default: '',
459
+ description: 'Data name',
460
+ },
461
+ {
462
+ displayName: 'Value',
463
+ name: 'value',
464
+ type: 'string',
465
+ default: '',
466
+ description: 'Data value',
467
+ },
468
+ ],
469
+ },
470
+ ],
471
+ default: {},
472
+ placeholder: 'Add Data',
473
+ description: 'Additional data',
474
+ routing: {
475
+ send: {
476
+ type: 'body',
477
+ property: 'external_data',
478
+ value: '={{Object.fromEntries($value.data?.map(v => [v.name, v.value]) || [])}}',
479
+ },
480
+ },
481
+ },
482
+ ],
483
+ },
484
+ ],
485
+ };
486
+ }
487
+ }
488
+ exports.SendPulseChatbots = SendPulseChatbots;
489
+ //# sourceMappingURL=SendPulseChatbots.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SendPulseChatbots.node.js","sourceRoot":"","sources":["../../../nodes/SendPulseChatbots/SendPulseChatbots.node.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AACtB,0CAAgD;AAEhD,MAAa,iBAAiB;IAA9B;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gEAAgE;YAC1E,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE;gBACN,IAAI,EAAE,oBAAoB;aAC7B;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,KAAK;oBACf,cAAc,EAAE;wBACZ,IAAI,EAAE;4BACF,cAAc,EAAE,CAAC,aAAa,CAAC;yBAClC;qBACJ;iBACJ;gBACD;oBACI,IAAI,EAAE,oBAAoB;oBAC1B,QAAQ,EAAE,KAAK;oBACf,cAAc,EAAE;wBACZ,IAAI,EAAE;4BACF,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC7B;qBACJ;iBACJ;aACJ;YACD,eAAe,EAAE;gBACb,OAAO,EAAE,2BAA2B;gBACpC,OAAO,EAAE;oBACL,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBACrC;aACJ;YACD,UAAU,EAAE;gBAER;oBACI,WAAW,EAAE,gBAAgB;oBAC7B,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACL;4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,eAAe;4BAC5B,IAAI,EAAE,cAAc;4BACpB,IAAI,EAAE,iBAAiB;4BACvB,WAAW,EAAE;gCACT,cAAc,EAAE,IAAI;6BACvB;4BACD,OAAO,EAAE;gCACL;oCACI,IAAI,EAAE,MAAM;oCACZ,WAAW,EAAE,WAAW;oCACxB,MAAM,EAAE;wCACJ;4CACI,WAAW,EAAE,MAAM;4CACnB,IAAI,EAAE,MAAM;4CACZ,IAAI,EAAE,QAAQ;4CACd,OAAO,EAAE,EAAE;4CACX,WAAW,EAAE,WAAW;yCAC3B;wCACD;4CACI,WAAW,EAAE,OAAO;4CACpB,IAAI,EAAE,OAAO;4CACb,IAAI,EAAE,QAAQ;4CACd,OAAO,EAAE,EAAE;4CACX,WAAW,EAAE,YAAY;yCAC5B;qCACJ;iCACJ;6BACJ;4BACD,OAAO,EAAE,EAAE;4BACX,WAAW,EAAE,UAAU;4BACvB,WAAW,EAAE,iBAAiB;4BAC9B,OAAO,EAAE;gCACL,IAAI,EAAE;oCACF,IAAI,EAAE,MAAM;oCACZ,QAAQ,EAAE,eAAe;oCACzB,KAAK,EAAE,yEAAyE;iCACnF;6BACJ;yBACJ;qBACJ;iBACJ;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AAhfD,8CAgfC"}
@@ -0,0 +1,25 @@
1
+ {
2
+ "node": "n8n-nodes-base.SendPulseChatbots",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Marketing & Content",
7
+ "Sales"
8
+ ],
9
+ "resources": {
10
+ "credentialDocumentation": [
11
+ {
12
+ "url": "https://sendpulse.com/integrations/api"
13
+ }
14
+ ],
15
+ "primaryDocumentation": [
16
+ {
17
+ "url": "https://sendpulse.com/integrations/api"
18
+ }
19
+ ]
20
+ },
21
+ "alias": [
22
+ "Marketing",
23
+ "SendPulse"
24
+ ]
25
+ }
@@ -0,0 +1,4 @@
1
+ <svg width="200" height="200" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="200" height="200" fill="#009FC1"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M78.527 167H61.281L49.1074 116.919H26V100.79H64.099L70.4113 127.296L95.4349 33H113.244L121.924 104.061H141.312C144.242 98.7593 149.991 95.1498 156.641 95.1498C166.222 95.1498 174 102.707 174 112.069C174 121.431 166.222 128.988 156.641 128.988C149.991 128.988 144.355 125.379 141.312 120.077H106.143L100.958 84.2088L78.527 167Z" fill="white"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ interface Texts {
2
+ messageText: string;
3
+ }
4
+ export declare function prepareMessage(channel: string, text: string | Texts[]): object;
5
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prepareMessage = prepareMessage;
4
+ function prepareMessage(channel, text) {
5
+ switch (channel) {
6
+ case 'telegram':
7
+ return {
8
+ type: 'text',
9
+ text: text,
10
+ };
11
+ case 'messenger':
12
+ return {
13
+ type: 'RESPONSE',
14
+ tag: 'CUSTOMER_FEEDBACK',
15
+ content_type: 'message',
16
+ text: text,
17
+ };
18
+ case 'whatsapp':
19
+ return {
20
+ type: 'text',
21
+ text: {
22
+ body: text,
23
+ },
24
+ };
25
+ case 'instagram':
26
+ return text.map(item => ({
27
+ type: 'text',
28
+ message: {
29
+ text: item.messageText,
30
+ },
31
+ }));
32
+ case 'live-chat':
33
+ case 'viber/chatbots':
34
+ case 'tiktok':
35
+ return text.map(item => ({
36
+ type: 'text',
37
+ text: {
38
+ text: item.messageText,
39
+ }
40
+ }));
41
+ default:
42
+ throw new Error(`Unsupported channel: ${channel}`);
43
+ }
44
+ }
45
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../nodes/SendPulseChatbots/shared/utils.ts"],"names":[],"mappings":";;AAIA,wCAwCC;AAxCD,SAAgB,cAAc,CAAC,OAAe,EAAE,IAAoB;IAChE,QAAQ,OAAO,EAAE,CAAC;QACd,KAAK,UAAU;YACX,OAAO;gBACH,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAc;aACvB,CAAC;QACN,KAAK,WAAW;YACZ,OAAO;gBACH,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,mBAAmB;gBACxB,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAc;aACvB,CAAC;QACN,KAAK,UAAU;YACX,OAAO;gBACH,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;oBACF,IAAI,EAAE,IAAc;iBACvB;aACJ,CAAC;QACN,KAAK,WAAW;YACZ,OAAQ,IAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAClC,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACL,IAAI,EAAE,IAAI,CAAC,WAAW;iBACzB;aACJ,CAAC,CAAC,CAAC;QACR,KAAK,WAAW,CAAC;QACjB,KAAK,gBAAgB,CAAC;QACtB,KAAK,QAAQ;YACT,OAAQ,IAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAClC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;oBACF,IAAI,EAAE,IAAI,CAAC,WAAW;iBACzB;aACJ,CAAC,CAAC,CAAC;QACR;YACI,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class SendPulseCrm implements INodeType {
3
+ description: INodeTypeDescription;
4
+ }