n8n-nodes-whaticket-360-house 0.1.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.
@@ -0,0 +1,4124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Whaticket = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const RESOURCE_OPTIONS = [
6
+ { name: "Chat interno", value: "internalChat" },
7
+ { name: "Tickets", value: "tickets" },
8
+ { name: "Contatos", value: "contacts" },
9
+ { name: "Mensagens", value: "messages" },
10
+ { name: "Quick messages", value: "quickMessages" },
11
+ { name: "Schedules", value: "schedules" },
12
+ { name: "Tags", value: "tags" },
13
+ { name: "ToDo List", value: "todo" },
14
+ { name: "Relatorios", value: "reports" },
15
+ { name: "Moments", value: "moments" },
16
+ { name: "Usuarios", value: "users" },
17
+ { name: "Filas", value: "queues" },
18
+ { name: "Kanban", value: "kanban" },
19
+ { name: "Conexoes", value: "connections" },
20
+ { name: "Empresas", value: "companies" },
21
+ { name: "Faturas", value: "invoices" },
22
+ { name: "Custom (qualquer endpoint)", value: "custom" }
23
+ ];
24
+ const CONTACT_OPERATIONS = [
25
+ { name: "Listar", value: "list", action: "List" },
26
+ { name: "Buscar por nome", value: "search", action: "Search" },
27
+ { name: "Obter", value: "get", action: "Get" },
28
+ { name: "Criar", value: "create", action: "Create" },
29
+ { name: "Atualizar", value: "update", action: "Update" },
30
+ { name: "Remover", value: "delete", action: "Delete" }
31
+ ];
32
+ const TICKET_OPERATIONS = [
33
+ { name: "Listar", value: "list", action: "List" },
34
+ { name: "Obter", value: "get", action: "Get" },
35
+ { name: "Criar", value: "create", action: "Create" },
36
+ { name: "Atualizar", value: "update", action: "Update" },
37
+ { name: "Remover", value: "delete", action: "Delete" },
38
+ { name: "Contar", value: "count", action: "Count" }
39
+ ];
40
+ const MESSAGE_OPERATIONS = [
41
+ { name: "Listar", value: "list", action: "List" },
42
+ { name: "Enviar texto", value: "send", action: "Send" },
43
+ { name: "Editar", value: "edit", action: "Edit" },
44
+ { name: "Remover", value: "delete", action: "Delete" }
45
+ ];
46
+ const CHAT_OPERATIONS = [
47
+ { name: "Listar chats", value: "list", action: "List" },
48
+ { name: "Obter chat", value: "get", action: "Get" },
49
+ { name: "Listar mensagens", value: "messages", action: "Messages" },
50
+ { name: "Enviar mensagem", value: "send", action: "Send" },
51
+ { name: "Criar chat", value: "create", action: "Create" },
52
+ { name: "Atualizar chat", value: "update", action: "Update" },
53
+ { name: "Remover chat", value: "delete", action: "Delete" },
54
+ { name: "Marcar lido", value: "read", action: "Read" }
55
+ ];
56
+ const QUICK_MESSAGE_OPERATIONS = [
57
+ { name: "Listar", value: "list", action: "List" },
58
+ { name: "Obter", value: "get", action: "Get" },
59
+ { name: "Criar", value: "create", action: "Create" },
60
+ { name: "Atualizar", value: "update", action: "Update" },
61
+ { name: "Remover", value: "delete", action: "Delete" }
62
+ ];
63
+ const SCHEDULE_OPERATIONS = [
64
+ { name: "Listar", value: "list", action: "List" },
65
+ { name: "Obter", value: "get", action: "Get" },
66
+ { name: "Criar", value: "create", action: "Create" },
67
+ { name: "Atualizar", value: "update", action: "Update" },
68
+ { name: "Remover", value: "delete", action: "Delete" }
69
+ ];
70
+ const TAG_OPERATIONS = [
71
+ { name: "Listar", value: "list", action: "List" },
72
+ { name: "Kanban", value: "kanban", action: "Kanban" },
73
+ { name: "Obter", value: "get", action: "Get" },
74
+ { name: "Criar", value: "create", action: "Create" },
75
+ { name: "Atualizar", value: "update", action: "Update" },
76
+ { name: "Remover", value: "delete", action: "Delete" }
77
+ ];
78
+ const TODO_OPERATIONS = [
79
+ { name: "Listar", value: "list", action: "List" },
80
+ { name: "Obter", value: "get", action: "Get" },
81
+ { name: "Criar", value: "create", action: "Create" },
82
+ { name: "Atualizar", value: "update", action: "Update" },
83
+ { name: "Remover", value: "delete", action: "Delete" }
84
+ ];
85
+ const REPORT_OPERATIONS = [
86
+ { name: "Tickets report", value: "ticketsReport", action: "Report" },
87
+ { name: "Relatorio vendas", value: "salesReport", action: "Report" },
88
+ { name: "Dashboard tickets users", value: "ticketsUsers", action: "Report" },
89
+ { name: "Dashboard tickets day", value: "ticketsDay", action: "Report" },
90
+ { name: "Contacts report", value: "contactsReport", action: "Report" }
91
+ ];
92
+ const MOMENTS_OPERATIONS = [
93
+ { name: "Dashboard moments", value: "dashboardMoments", action: "Report" },
94
+ { name: "Users moments", value: "usersMoments", action: "Report" }
95
+ ];
96
+ const USER_OPERATIONS = [
97
+ { name: "Listar", value: "list", action: "List" },
98
+ { name: "Obter", value: "get", action: "Get" },
99
+ { name: "Criar", value: "create", action: "Create" },
100
+ { name: "Atualizar", value: "update", action: "Update" },
101
+ { name: "Remover", value: "delete", action: "Delete" }
102
+ ];
103
+ const QUEUE_OPERATIONS = [
104
+ { name: "Listar", value: "list", action: "List" },
105
+ { name: "Obter", value: "get", action: "Get" },
106
+ { name: "Criar", value: "create", action: "Create" },
107
+ { name: "Atualizar", value: "update", action: "Update" },
108
+ { name: "Remover", value: "delete", action: "Delete" }
109
+ ];
110
+ const KANBAN_OPERATIONS = [
111
+ { name: "Ticket kanban", value: "ticketKanban", action: "Kanban" },
112
+ { name: "Tag kanban", value: "tagKanban", action: "Kanban" },
113
+ { name: "Company lane order (get)", value: "companyLaneGet", action: "Kanban" },
114
+ { name: "Company lane order (set)", value: "companyLaneSet", action: "Kanban" }
115
+ ];
116
+ const COMPANY_OPERATIONS = [
117
+ { name: "Listar", value: "list", action: "List" },
118
+ { name: "Obter", value: "get", action: "Get" },
119
+ { name: "Criar", value: "create", action: "Create" },
120
+ { name: "Atualizar", value: "update", action: "Update" },
121
+ { name: "Remover", value: "delete", action: "Delete" }
122
+ ];
123
+ const INVOICE_OPERATIONS = [
124
+ { name: "Listar", value: "list", action: "List" },
125
+ { name: "Obter", value: "get", action: "Get" },
126
+ { name: "Atualizar", value: "update", action: "Update" }
127
+ ];
128
+ const CONNECTION_OPERATIONS = [
129
+ { name: "Listar", value: "list", action: "List" },
130
+ { name: "Obter", value: "get", action: "Get" },
131
+ { name: "Criar", value: "create", action: "Create" },
132
+ { name: "Atualizar", value: "update", action: "Update" },
133
+ { name: "Remover", value: "delete", action: "Delete" }
134
+ ];
135
+ const REQUEST_OPERATION = [
136
+ {
137
+ name: "Request",
138
+ value: "request",
139
+ description: "Faz uma chamada ao endpoint informado",
140
+ action: "Request"
141
+ }
142
+ ];
143
+ class Whaticket {
144
+ constructor() {
145
+ this.description = {
146
+ displayName: "Whaticket",
147
+ name: "whaticket",
148
+ icon: "file:whaticket.svg",
149
+ group: ["transform"],
150
+ version: 1,
151
+ description: "Acesso aos endpoints do Whaticket via API",
152
+ defaults: {
153
+ name: "Whaticket"
154
+ },
155
+ inputs: ["main"],
156
+ outputs: ["main"],
157
+ credentials: [
158
+ {
159
+ name: "whaticketApi",
160
+ required: true
161
+ }
162
+ ],
163
+ properties: [
164
+ {
165
+ displayName: "Recurso",
166
+ name: "resource",
167
+ type: "options",
168
+ noDataExpression: true,
169
+ options: RESOURCE_OPTIONS,
170
+ default: "tickets"
171
+ },
172
+ {
173
+ displayName: "Operacao",
174
+ name: "operation",
175
+ type: "options",
176
+ noDataExpression: true,
177
+ options: CONTACT_OPERATIONS,
178
+ default: "list",
179
+ displayOptions: {
180
+ show: {
181
+ resource: ["contacts"]
182
+ }
183
+ }
184
+ },
185
+ {
186
+ displayName: "Operacao",
187
+ name: "operation",
188
+ type: "options",
189
+ noDataExpression: true,
190
+ options: TICKET_OPERATIONS,
191
+ default: "list",
192
+ displayOptions: {
193
+ show: {
194
+ resource: ["tickets"]
195
+ }
196
+ }
197
+ },
198
+ {
199
+ displayName: "Operacao",
200
+ name: "operation",
201
+ type: "options",
202
+ noDataExpression: true,
203
+ options: MESSAGE_OPERATIONS,
204
+ default: "list",
205
+ displayOptions: {
206
+ show: {
207
+ resource: ["messages"]
208
+ }
209
+ }
210
+ },
211
+ {
212
+ displayName: "Operacao",
213
+ name: "operation",
214
+ type: "options",
215
+ noDataExpression: true,
216
+ options: CHAT_OPERATIONS,
217
+ default: "list",
218
+ displayOptions: {
219
+ show: {
220
+ resource: ["internalChat"]
221
+ }
222
+ }
223
+ },
224
+ {
225
+ displayName: "Operacao",
226
+ name: "operation",
227
+ type: "options",
228
+ noDataExpression: true,
229
+ options: QUICK_MESSAGE_OPERATIONS,
230
+ default: "list",
231
+ displayOptions: {
232
+ show: {
233
+ resource: ["quickMessages"]
234
+ }
235
+ }
236
+ },
237
+ {
238
+ displayName: "Operacao",
239
+ name: "operation",
240
+ type: "options",
241
+ noDataExpression: true,
242
+ options: SCHEDULE_OPERATIONS,
243
+ default: "list",
244
+ displayOptions: {
245
+ show: {
246
+ resource: ["schedules"]
247
+ }
248
+ }
249
+ },
250
+ {
251
+ displayName: "Operacao",
252
+ name: "operation",
253
+ type: "options",
254
+ noDataExpression: true,
255
+ options: TAG_OPERATIONS,
256
+ default: "list",
257
+ displayOptions: {
258
+ show: {
259
+ resource: ["tags"]
260
+ }
261
+ }
262
+ },
263
+ {
264
+ displayName: "Operacao",
265
+ name: "operation",
266
+ type: "options",
267
+ noDataExpression: true,
268
+ options: TODO_OPERATIONS,
269
+ default: "list",
270
+ displayOptions: {
271
+ show: {
272
+ resource: ["todo"]
273
+ }
274
+ }
275
+ },
276
+ {
277
+ displayName: "Operacao",
278
+ name: "operation",
279
+ type: "options",
280
+ noDataExpression: true,
281
+ options: REPORT_OPERATIONS,
282
+ default: "ticketsReport",
283
+ displayOptions: {
284
+ show: {
285
+ resource: ["reports"]
286
+ }
287
+ }
288
+ },
289
+ {
290
+ displayName: "Operacao",
291
+ name: "operation",
292
+ type: "options",
293
+ noDataExpression: true,
294
+ options: MOMENTS_OPERATIONS,
295
+ default: "dashboardMoments",
296
+ displayOptions: {
297
+ show: {
298
+ resource: ["moments"]
299
+ }
300
+ }
301
+ },
302
+ {
303
+ displayName: "Operacao",
304
+ name: "operation",
305
+ type: "options",
306
+ noDataExpression: true,
307
+ options: USER_OPERATIONS,
308
+ default: "list",
309
+ displayOptions: {
310
+ show: {
311
+ resource: ["users"]
312
+ }
313
+ }
314
+ },
315
+ {
316
+ displayName: "Operacao",
317
+ name: "operation",
318
+ type: "options",
319
+ noDataExpression: true,
320
+ options: QUEUE_OPERATIONS,
321
+ default: "list",
322
+ displayOptions: {
323
+ show: {
324
+ resource: ["queues"]
325
+ }
326
+ }
327
+ },
328
+ {
329
+ displayName: "Operacao",
330
+ name: "operation",
331
+ type: "options",
332
+ noDataExpression: true,
333
+ options: KANBAN_OPERATIONS,
334
+ default: "ticketKanban",
335
+ displayOptions: {
336
+ show: {
337
+ resource: ["kanban"]
338
+ }
339
+ }
340
+ },
341
+ {
342
+ displayName: "Operacao",
343
+ name: "operation",
344
+ type: "options",
345
+ noDataExpression: true,
346
+ options: COMPANY_OPERATIONS,
347
+ default: "list",
348
+ displayOptions: {
349
+ show: {
350
+ resource: ["companies"]
351
+ }
352
+ }
353
+ },
354
+ {
355
+ displayName: "Operacao",
356
+ name: "operation",
357
+ type: "options",
358
+ noDataExpression: true,
359
+ options: CONNECTION_OPERATIONS,
360
+ default: "list",
361
+ displayOptions: {
362
+ show: {
363
+ resource: ["connections"]
364
+ }
365
+ }
366
+ },
367
+ {
368
+ displayName: "Operacao",
369
+ name: "operation",
370
+ type: "options",
371
+ noDataExpression: true,
372
+ options: INVOICE_OPERATIONS,
373
+ default: "list",
374
+ displayOptions: {
375
+ show: {
376
+ resource: ["invoices"]
377
+ }
378
+ }
379
+ },
380
+ {
381
+ displayName: "Operacao",
382
+ name: "operation",
383
+ type: "options",
384
+ noDataExpression: true,
385
+ options: REQUEST_OPERATION,
386
+ default: "request",
387
+ displayOptions: {
388
+ show: {
389
+ resource: [
390
+ "custom"
391
+ ]
392
+ }
393
+ }
394
+ },
395
+ {
396
+ displayName: "Metodo HTTP",
397
+ name: "method",
398
+ type: "options",
399
+ options: [
400
+ { name: "GET", value: "GET" },
401
+ { name: "POST", value: "POST" },
402
+ { name: "PUT", value: "PUT" },
403
+ { name: "PATCH", value: "PATCH" },
404
+ { name: "DELETE", value: "DELETE" }
405
+ ],
406
+ default: "GET",
407
+ displayOptions: {
408
+ show: {
409
+ resource: ["custom"],
410
+ operation: ["request"]
411
+ }
412
+ }
413
+ },
414
+ {
415
+ displayName: "Endpoint",
416
+ name: "endpoint",
417
+ type: "string",
418
+ default: "/tickets",
419
+ placeholder: "/tickets",
420
+ description: "Endpoint relativo ao host (ex.: /tickets, /contacts, /messages)",
421
+ displayOptions: {
422
+ show: {
423
+ resource: ["custom"],
424
+ operation: ["request"]
425
+ }
426
+ }
427
+ },
428
+ {
429
+ displayName: "JSON Parameters",
430
+ name: "jsonParameters",
431
+ type: "boolean",
432
+ default: true,
433
+ displayOptions: {
434
+ show: {
435
+ resource: ["custom"],
436
+ operation: ["request"]
437
+ }
438
+ }
439
+ },
440
+ {
441
+ displayName: "Query Parameters (JSON)",
442
+ name: "queryParametersJson",
443
+ type: "string",
444
+ default: "{}",
445
+ typeOptions: {
446
+ rows: 4
447
+ },
448
+ displayOptions: {
449
+ show: {
450
+ resource: ["custom"],
451
+ operation: ["request"],
452
+ jsonParameters: [true]
453
+ }
454
+ }
455
+ },
456
+ {
457
+ displayName: "Body Parameters (JSON)",
458
+ name: "bodyParametersJson",
459
+ type: "string",
460
+ default: "{}",
461
+ typeOptions: {
462
+ rows: 6
463
+ },
464
+ displayOptions: {
465
+ show: {
466
+ resource: ["custom"],
467
+ operation: ["request"],
468
+ jsonParameters: [true]
469
+ }
470
+ }
471
+ },
472
+ {
473
+ displayName: "Contato ID",
474
+ name: "contactId",
475
+ type: "string",
476
+ default: "",
477
+ required: true,
478
+ displayOptions: {
479
+ show: {
480
+ resource: ["contacts"],
481
+ operation: ["get", "update", "delete"]
482
+ }
483
+ }
484
+ },
485
+ {
486
+ displayName: "Nome",
487
+ name: "contactName",
488
+ type: "string",
489
+ default: "",
490
+ required: true,
491
+ displayOptions: {
492
+ show: {
493
+ resource: ["contacts"],
494
+ operation: ["create"]
495
+ }
496
+ }
497
+ },
498
+ {
499
+ displayName: "Numero",
500
+ name: "contactNumber",
501
+ type: "string",
502
+ default: "",
503
+ required: true,
504
+ description: "Somente numeros",
505
+ displayOptions: {
506
+ show: {
507
+ resource: ["contacts"],
508
+ operation: ["create"]
509
+ }
510
+ }
511
+ },
512
+ {
513
+ displayName: "Nome",
514
+ name: "contactNameUpdate",
515
+ type: "string",
516
+ default: "",
517
+ displayOptions: {
518
+ show: {
519
+ resource: ["contacts"],
520
+ operation: ["update"]
521
+ }
522
+ }
523
+ },
524
+ {
525
+ displayName: "Numero",
526
+ name: "contactNumberUpdate",
527
+ type: "string",
528
+ default: "",
529
+ description: "Somente numeros",
530
+ displayOptions: {
531
+ show: {
532
+ resource: ["contacts"],
533
+ operation: ["update"]
534
+ }
535
+ }
536
+ },
537
+ {
538
+ displayName: "Email",
539
+ name: "contactEmail",
540
+ type: "string",
541
+ default: "",
542
+ displayOptions: {
543
+ show: {
544
+ resource: ["contacts"],
545
+ operation: ["create", "update"]
546
+ }
547
+ }
548
+ },
549
+ {
550
+ displayName: "Data de nascimento",
551
+ name: "contactBirthDate",
552
+ type: "string",
553
+ default: "",
554
+ description: "Formato YYYY-MM-DD",
555
+ displayOptions: {
556
+ show: {
557
+ resource: ["contacts"],
558
+ operation: ["create", "update"]
559
+ }
560
+ }
561
+ },
562
+ {
563
+ displayName: "Extra info (JSON)",
564
+ name: "contactExtraInfo",
565
+ type: "string",
566
+ default: "[]",
567
+ typeOptions: {
568
+ rows: 4
569
+ },
570
+ description: "Ex.: [{\"name\":\"CPF\",\"value\":\"123\"}]",
571
+ displayOptions: {
572
+ show: {
573
+ resource: ["contacts"],
574
+ operation: ["create", "update"]
575
+ }
576
+ }
577
+ },
578
+ {
579
+ displayName: "Nome (pesquisa)",
580
+ name: "contactSearchName",
581
+ type: "string",
582
+ default: "",
583
+ required: true,
584
+ displayOptions: {
585
+ show: {
586
+ resource: ["contacts"],
587
+ operation: ["search"]
588
+ }
589
+ }
590
+ },
591
+ {
592
+ displayName: "Pagina",
593
+ name: "contactsPage",
594
+ type: "number",
595
+ default: 1,
596
+ displayOptions: {
597
+ show: {
598
+ resource: ["contacts"],
599
+ operation: ["list"]
600
+ }
601
+ }
602
+ },
603
+ {
604
+ displayName: "Buscar",
605
+ name: "contactsSearchParam",
606
+ type: "string",
607
+ default: "",
608
+ displayOptions: {
609
+ show: {
610
+ resource: ["contacts"],
611
+ operation: ["list"]
612
+ }
613
+ }
614
+ },
615
+ {
616
+ displayName: "Contact Tag IDs (JSON)",
617
+ name: "contactsTagIds",
618
+ type: "string",
619
+ default: "[]",
620
+ description: "Ex.: [1,2,3]",
621
+ displayOptions: {
622
+ show: {
623
+ resource: ["contacts"],
624
+ operation: ["list"]
625
+ }
626
+ }
627
+ },
628
+ {
629
+ displayName: "Is Group",
630
+ name: "contactsIsGroup",
631
+ type: "boolean",
632
+ default: false,
633
+ displayOptions: {
634
+ show: {
635
+ resource: ["contacts"],
636
+ operation: ["list"]
637
+ }
638
+ }
639
+ },
640
+ {
641
+ displayName: "Ticket ID",
642
+ name: "ticketId",
643
+ type: "string",
644
+ default: "",
645
+ required: true,
646
+ displayOptions: {
647
+ show: {
648
+ resource: ["tickets"],
649
+ operation: ["get", "update", "delete"]
650
+ }
651
+ }
652
+ },
653
+ {
654
+ displayName: "Contato ID",
655
+ name: "ticketContactId",
656
+ type: "number",
657
+ default: 0,
658
+ required: true,
659
+ displayOptions: {
660
+ show: {
661
+ resource: ["tickets"],
662
+ operation: ["create"]
663
+ }
664
+ }
665
+ },
666
+ {
667
+ displayName: "Fila ID",
668
+ name: "ticketQueueId",
669
+ type: "number",
670
+ default: 0,
671
+ required: true,
672
+ displayOptions: {
673
+ show: {
674
+ resource: ["tickets"],
675
+ operation: ["create"]
676
+ }
677
+ }
678
+ },
679
+ {
680
+ displayName: "Usuario ID",
681
+ name: "ticketUserId",
682
+ type: "number",
683
+ default: 0,
684
+ required: true,
685
+ displayOptions: {
686
+ show: {
687
+ resource: ["tickets"],
688
+ operation: ["create"]
689
+ }
690
+ }
691
+ },
692
+ {
693
+ displayName: "Status",
694
+ name: "ticketStatus",
695
+ type: "string",
696
+ default: "open",
697
+ displayOptions: {
698
+ show: {
699
+ resource: ["tickets"],
700
+ operation: ["create", "update", "list"]
701
+ }
702
+ }
703
+ },
704
+ {
705
+ displayName: "Whatsapp ID",
706
+ name: "ticketWhatsappId",
707
+ type: "string",
708
+ default: "",
709
+ displayOptions: {
710
+ show: {
711
+ resource: ["tickets"],
712
+ operation: ["create", "update", "list"]
713
+ }
714
+ }
715
+ },
716
+ {
717
+ displayName: "Enviar mensagem de despedida",
718
+ name: "ticketSendFarewell",
719
+ type: "boolean",
720
+ default: false,
721
+ displayOptions: {
722
+ show: {
723
+ resource: ["tickets"],
724
+ operation: ["update"]
725
+ }
726
+ }
727
+ },
728
+ {
729
+ displayName: "Finalizado com venda",
730
+ name: "ticketFinalizadoComVenda",
731
+ type: "boolean",
732
+ default: false,
733
+ displayOptions: {
734
+ show: {
735
+ resource: ["tickets"],
736
+ operation: ["update"]
737
+ }
738
+ }
739
+ },
740
+ {
741
+ displayName: "Motivo finalizacao",
742
+ name: "ticketMotivoFinalizacao",
743
+ type: "string",
744
+ default: "",
745
+ displayOptions: {
746
+ show: {
747
+ resource: ["tickets"],
748
+ operation: ["update"]
749
+ }
750
+ }
751
+ },
752
+ {
753
+ displayName: "Motivo nao venda",
754
+ name: "ticketMotivoNaoVenda",
755
+ type: "string",
756
+ default: "",
757
+ displayOptions: {
758
+ show: {
759
+ resource: ["tickets"],
760
+ operation: ["update"]
761
+ }
762
+ }
763
+ },
764
+ {
765
+ displayName: "Valor venda",
766
+ name: "ticketValorVenda",
767
+ type: "number",
768
+ default: 0,
769
+ displayOptions: {
770
+ show: {
771
+ resource: ["tickets"],
772
+ operation: ["update"]
773
+ }
774
+ }
775
+ },
776
+ {
777
+ displayName: "Dados adicionais (JSON)",
778
+ name: "ticketExtraJson",
779
+ type: "string",
780
+ default: "{}",
781
+ typeOptions: {
782
+ rows: 4
783
+ },
784
+ displayOptions: {
785
+ show: {
786
+ resource: ["tickets"],
787
+ operation: ["update"]
788
+ }
789
+ }
790
+ },
791
+ {
792
+ displayName: "Pagina",
793
+ name: "ticketsPage",
794
+ type: "number",
795
+ default: 1,
796
+ displayOptions: {
797
+ show: {
798
+ resource: ["tickets"],
799
+ operation: ["list"]
800
+ }
801
+ }
802
+ },
803
+ {
804
+ displayName: "Buscar",
805
+ name: "ticketsSearchParam",
806
+ type: "string",
807
+ default: "",
808
+ displayOptions: {
809
+ show: {
810
+ resource: ["tickets"],
811
+ operation: ["list"]
812
+ }
813
+ }
814
+ },
815
+ {
816
+ displayName: "Queue IDs (JSON)",
817
+ name: "ticketsQueueIds",
818
+ type: "string",
819
+ default: "[]",
820
+ displayOptions: {
821
+ show: {
822
+ resource: ["tickets"],
823
+ operation: ["list", "count"]
824
+ }
825
+ }
826
+ },
827
+ {
828
+ displayName: "Tag IDs (JSON)",
829
+ name: "ticketsTagIds",
830
+ type: "string",
831
+ default: "[]",
832
+ displayOptions: {
833
+ show: {
834
+ resource: ["tickets"],
835
+ operation: ["list"]
836
+ }
837
+ }
838
+ },
839
+ {
840
+ displayName: "User IDs (JSON)",
841
+ name: "ticketsUserIds",
842
+ type: "string",
843
+ default: "[]",
844
+ displayOptions: {
845
+ show: {
846
+ resource: ["tickets"],
847
+ operation: ["list"]
848
+ }
849
+ }
850
+ },
851
+ {
852
+ displayName: "Whatsapp IDs (JSON)",
853
+ name: "ticketsWhatsappIds",
854
+ type: "string",
855
+ default: "[]",
856
+ displayOptions: {
857
+ show: {
858
+ resource: ["tickets"],
859
+ operation: ["list"]
860
+ }
861
+ }
862
+ },
863
+ {
864
+ displayName: "Somente nao lidas",
865
+ name: "ticketsWithUnread",
866
+ type: "boolean",
867
+ default: false,
868
+ displayOptions: {
869
+ show: {
870
+ resource: ["tickets"],
871
+ operation: ["list"]
872
+ }
873
+ }
874
+ },
875
+ {
876
+ displayName: "Mostrar todos",
877
+ name: "ticketsShowAll",
878
+ type: "boolean",
879
+ default: false,
880
+ displayOptions: {
881
+ show: {
882
+ resource: ["tickets"],
883
+ operation: ["list", "count"]
884
+ }
885
+ }
886
+ },
887
+ {
888
+ displayName: "Mensagem ID",
889
+ name: "messageId",
890
+ type: "string",
891
+ default: "",
892
+ required: true,
893
+ displayOptions: {
894
+ show: {
895
+ resource: ["messages"],
896
+ operation: ["edit", "delete"]
897
+ }
898
+ }
899
+ },
900
+ {
901
+ displayName: "Ticket ID",
902
+ name: "messageTicketId",
903
+ type: "string",
904
+ default: "",
905
+ required: true,
906
+ displayOptions: {
907
+ show: {
908
+ resource: ["messages"],
909
+ operation: ["list", "send"]
910
+ }
911
+ }
912
+ },
913
+ {
914
+ displayName: "Pagina",
915
+ name: "messagesPage",
916
+ type: "number",
917
+ default: 1,
918
+ displayOptions: {
919
+ show: {
920
+ resource: ["messages"],
921
+ operation: ["list"]
922
+ }
923
+ }
924
+ },
925
+ {
926
+ displayName: "Mensagem",
927
+ name: "messageBody",
928
+ type: "string",
929
+ default: "",
930
+ required: true,
931
+ typeOptions: { rows: 4 },
932
+ displayOptions: {
933
+ show: {
934
+ resource: ["messages"],
935
+ operation: ["send"]
936
+ }
937
+ }
938
+ },
939
+ {
940
+ displayName: "Privado",
941
+ name: "messageIsPrivate",
942
+ type: "boolean",
943
+ default: false,
944
+ displayOptions: {
945
+ show: {
946
+ resource: ["messages"],
947
+ operation: ["send"]
948
+ }
949
+ }
950
+ },
951
+ {
952
+ displayName: "QuotedMsg (JSON)",
953
+ name: "messageQuotedJson",
954
+ type: "string",
955
+ default: "{}",
956
+ typeOptions: { rows: 4 },
957
+ displayOptions: {
958
+ show: {
959
+ resource: ["messages"],
960
+ operation: ["send"]
961
+ }
962
+ }
963
+ },
964
+ {
965
+ displayName: "vCard (JSON)",
966
+ name: "messageVcardJson",
967
+ type: "string",
968
+ default: "{}",
969
+ typeOptions: { rows: 4 },
970
+ displayOptions: {
971
+ show: {
972
+ resource: ["messages"],
973
+ operation: ["send"]
974
+ }
975
+ }
976
+ },
977
+ {
978
+ displayName: "Novo texto",
979
+ name: "messageEditBody",
980
+ type: "string",
981
+ default: "",
982
+ required: true,
983
+ typeOptions: { rows: 4 },
984
+ displayOptions: {
985
+ show: {
986
+ resource: ["messages"],
987
+ operation: ["edit"]
988
+ }
989
+ }
990
+ },
991
+ {
992
+ displayName: "Chat ID",
993
+ name: "chatId",
994
+ type: "string",
995
+ default: "",
996
+ required: true,
997
+ displayOptions: {
998
+ show: {
999
+ resource: ["internalChat"],
1000
+ operation: ["get", "messages", "send", "update", "delete", "read"]
1001
+ }
1002
+ }
1003
+ },
1004
+ {
1005
+ displayName: "Pagina",
1006
+ name: "chatPage",
1007
+ type: "number",
1008
+ default: 1,
1009
+ displayOptions: {
1010
+ show: {
1011
+ resource: ["internalChat"],
1012
+ operation: ["list", "messages"]
1013
+ }
1014
+ }
1015
+ },
1016
+ {
1017
+ displayName: "Titulo",
1018
+ name: "chatTitle",
1019
+ type: "string",
1020
+ default: "",
1021
+ required: true,
1022
+ displayOptions: {
1023
+ show: {
1024
+ resource: ["internalChat"],
1025
+ operation: ["create"]
1026
+ }
1027
+ }
1028
+ },
1029
+ {
1030
+ displayName: "Descricao",
1031
+ name: "chatDescription",
1032
+ type: "string",
1033
+ default: "",
1034
+ typeOptions: { rows: 3 },
1035
+ displayOptions: {
1036
+ show: {
1037
+ resource: ["internalChat"],
1038
+ operation: ["create", "update"]
1039
+ }
1040
+ }
1041
+ },
1042
+ {
1043
+ displayName: "Usuarios (JSON)",
1044
+ name: "chatUsersJson",
1045
+ type: "string",
1046
+ default: "[]",
1047
+ description: "Ex.: [1,2,3]",
1048
+ displayOptions: {
1049
+ show: {
1050
+ resource: ["internalChat"],
1051
+ operation: ["create", "update"]
1052
+ }
1053
+ }
1054
+ },
1055
+ {
1056
+ displayName: "Mensagem",
1057
+ name: "chatMessage",
1058
+ type: "string",
1059
+ default: "",
1060
+ required: true,
1061
+ typeOptions: { rows: 4 },
1062
+ displayOptions: {
1063
+ show: {
1064
+ resource: ["internalChat"],
1065
+ operation: ["send"]
1066
+ }
1067
+ }
1068
+ },
1069
+ {
1070
+ displayName: "ReplyTo ID",
1071
+ name: "chatReplyToId",
1072
+ type: "string",
1073
+ default: "",
1074
+ displayOptions: {
1075
+ show: {
1076
+ resource: ["internalChat"],
1077
+ operation: ["send"]
1078
+ }
1079
+ }
1080
+ },
1081
+ {
1082
+ displayName: "Usuario ID",
1083
+ name: "chatReadUserId",
1084
+ type: "number",
1085
+ default: 0,
1086
+ required: true,
1087
+ displayOptions: {
1088
+ show: {
1089
+ resource: ["internalChat"],
1090
+ operation: ["read"]
1091
+ }
1092
+ }
1093
+ },
1094
+ {
1095
+ displayName: "Quick message ID",
1096
+ name: "quickMessageId",
1097
+ type: "string",
1098
+ default: "",
1099
+ required: true,
1100
+ displayOptions: {
1101
+ show: {
1102
+ resource: ["quickMessages"],
1103
+ operation: ["get", "update", "delete"]
1104
+ }
1105
+ }
1106
+ },
1107
+ {
1108
+ displayName: "Shortcode",
1109
+ name: "quickMessageShortcode",
1110
+ type: "string",
1111
+ default: "",
1112
+ required: true,
1113
+ displayOptions: {
1114
+ show: {
1115
+ resource: ["quickMessages"],
1116
+ operation: ["create", "update"]
1117
+ }
1118
+ }
1119
+ },
1120
+ {
1121
+ displayName: "Mensagem",
1122
+ name: "quickMessageMessage",
1123
+ type: "string",
1124
+ default: "",
1125
+ required: true,
1126
+ typeOptions: { rows: 4 },
1127
+ displayOptions: {
1128
+ show: {
1129
+ resource: ["quickMessages"],
1130
+ operation: ["create", "update"]
1131
+ }
1132
+ }
1133
+ },
1134
+ {
1135
+ displayName: "Geral",
1136
+ name: "quickMessageGeral",
1137
+ type: "boolean",
1138
+ default: false,
1139
+ displayOptions: {
1140
+ show: {
1141
+ resource: ["quickMessages"],
1142
+ operation: ["create", "update"]
1143
+ }
1144
+ }
1145
+ },
1146
+ {
1147
+ displayName: "Is Media",
1148
+ name: "quickMessageIsMedia",
1149
+ type: "boolean",
1150
+ default: false,
1151
+ displayOptions: {
1152
+ show: {
1153
+ resource: ["quickMessages"],
1154
+ operation: ["create", "update"]
1155
+ }
1156
+ }
1157
+ },
1158
+ {
1159
+ displayName: "Visao",
1160
+ name: "quickMessageVisao",
1161
+ type: "boolean",
1162
+ default: false,
1163
+ displayOptions: {
1164
+ show: {
1165
+ resource: ["quickMessages"],
1166
+ operation: ["create", "update"]
1167
+ }
1168
+ }
1169
+ },
1170
+ {
1171
+ displayName: "Oficial",
1172
+ name: "quickMessageIsOficial",
1173
+ type: "boolean",
1174
+ default: false,
1175
+ displayOptions: {
1176
+ show: {
1177
+ resource: ["quickMessages"],
1178
+ operation: ["create", "update"]
1179
+ }
1180
+ }
1181
+ },
1182
+ {
1183
+ displayName: "Language",
1184
+ name: "quickMessageLanguage",
1185
+ type: "string",
1186
+ default: "",
1187
+ displayOptions: {
1188
+ show: {
1189
+ resource: ["quickMessages"],
1190
+ operation: ["create", "update"]
1191
+ }
1192
+ }
1193
+ },
1194
+ {
1195
+ displayName: "Status",
1196
+ name: "quickMessageStatus",
1197
+ type: "string",
1198
+ default: "",
1199
+ displayOptions: {
1200
+ show: {
1201
+ resource: ["quickMessages"],
1202
+ operation: ["create", "update"]
1203
+ }
1204
+ }
1205
+ },
1206
+ {
1207
+ displayName: "Categoria",
1208
+ name: "quickMessageCategory",
1209
+ type: "string",
1210
+ default: "",
1211
+ displayOptions: {
1212
+ show: {
1213
+ resource: ["quickMessages"],
1214
+ operation: ["create", "update"]
1215
+ }
1216
+ }
1217
+ },
1218
+ {
1219
+ displayName: "Meta ID",
1220
+ name: "quickMessageMetaId",
1221
+ type: "string",
1222
+ default: "",
1223
+ displayOptions: {
1224
+ show: {
1225
+ resource: ["quickMessages"],
1226
+ operation: ["create", "update"]
1227
+ }
1228
+ }
1229
+ },
1230
+ {
1231
+ displayName: "Pagina",
1232
+ name: "quickMessagesPage",
1233
+ type: "number",
1234
+ default: 1,
1235
+ displayOptions: {
1236
+ show: {
1237
+ resource: ["quickMessages"],
1238
+ operation: ["list"]
1239
+ }
1240
+ }
1241
+ },
1242
+ {
1243
+ displayName: "Buscar",
1244
+ name: "quickMessagesSearchParam",
1245
+ type: "string",
1246
+ default: "",
1247
+ displayOptions: {
1248
+ show: {
1249
+ resource: ["quickMessages"],
1250
+ operation: ["list"]
1251
+ }
1252
+ }
1253
+ },
1254
+ {
1255
+ displayName: "Schedule ID",
1256
+ name: "scheduleId",
1257
+ type: "string",
1258
+ default: "",
1259
+ required: true,
1260
+ displayOptions: {
1261
+ show: {
1262
+ resource: ["schedules"],
1263
+ operation: ["get", "update", "delete"]
1264
+ }
1265
+ }
1266
+ },
1267
+ {
1268
+ displayName: "Mensagem",
1269
+ name: "scheduleBody",
1270
+ type: "string",
1271
+ default: "",
1272
+ required: true,
1273
+ typeOptions: { rows: 4 },
1274
+ displayOptions: {
1275
+ show: {
1276
+ resource: ["schedules"],
1277
+ operation: ["create"]
1278
+ }
1279
+ }
1280
+ },
1281
+ {
1282
+ displayName: "Enviar em",
1283
+ name: "scheduleSendAt",
1284
+ type: "string",
1285
+ default: "",
1286
+ required: true,
1287
+ description: "Formato ISO (YYYY-MM-DDTHH:mm:ss)",
1288
+ displayOptions: {
1289
+ show: {
1290
+ resource: ["schedules"],
1291
+ operation: ["create"]
1292
+ }
1293
+ }
1294
+ },
1295
+ {
1296
+ displayName: "Contato ID",
1297
+ name: "scheduleContactId",
1298
+ type: "number",
1299
+ default: 0,
1300
+ displayOptions: {
1301
+ show: {
1302
+ resource: ["schedules"],
1303
+ operation: ["create"]
1304
+ }
1305
+ }
1306
+ },
1307
+ {
1308
+ displayName: "Usuario ID",
1309
+ name: "scheduleUserId",
1310
+ type: "number",
1311
+ default: 0,
1312
+ displayOptions: {
1313
+ show: {
1314
+ resource: ["schedules"],
1315
+ operation: ["create"]
1316
+ }
1317
+ }
1318
+ },
1319
+ {
1320
+ displayName: "Queue ID",
1321
+ name: "scheduleQueueId",
1322
+ type: "number",
1323
+ default: 0,
1324
+ displayOptions: {
1325
+ show: {
1326
+ resource: ["schedules"],
1327
+ operation: ["create"]
1328
+ }
1329
+ }
1330
+ },
1331
+ {
1332
+ displayName: "Whatsapp ID",
1333
+ name: "scheduleWhatsappId",
1334
+ type: "string",
1335
+ default: "",
1336
+ displayOptions: {
1337
+ show: {
1338
+ resource: ["schedules"],
1339
+ operation: ["create"]
1340
+ }
1341
+ }
1342
+ },
1343
+ {
1344
+ displayName: "Abrir ticket",
1345
+ name: "scheduleOpenTicket",
1346
+ type: "boolean",
1347
+ default: false,
1348
+ displayOptions: {
1349
+ show: {
1350
+ resource: ["schedules"],
1351
+ operation: ["create"]
1352
+ }
1353
+ }
1354
+ },
1355
+ {
1356
+ displayName: "Status ticket",
1357
+ name: "scheduleStatusTicket",
1358
+ type: "string",
1359
+ default: "open",
1360
+ displayOptions: {
1361
+ show: {
1362
+ resource: ["schedules"],
1363
+ operation: ["create"]
1364
+ }
1365
+ }
1366
+ },
1367
+ {
1368
+ displayName: "Reminder date",
1369
+ name: "scheduleReminderDate",
1370
+ type: "string",
1371
+ default: "",
1372
+ displayOptions: {
1373
+ show: {
1374
+ resource: ["schedules"],
1375
+ operation: ["create"]
1376
+ }
1377
+ }
1378
+ },
1379
+ {
1380
+ displayName: "Dados adicionais (JSON)",
1381
+ name: "scheduleExtraJson",
1382
+ type: "string",
1383
+ default: "{}",
1384
+ typeOptions: { rows: 4 },
1385
+ displayOptions: {
1386
+ show: {
1387
+ resource: ["schedules"],
1388
+ operation: ["update"]
1389
+ }
1390
+ }
1391
+ },
1392
+ {
1393
+ displayName: "Pagina",
1394
+ name: "schedulesPage",
1395
+ type: "number",
1396
+ default: 1,
1397
+ displayOptions: {
1398
+ show: {
1399
+ resource: ["schedules"],
1400
+ operation: ["list"]
1401
+ }
1402
+ }
1403
+ },
1404
+ {
1405
+ displayName: "Buscar",
1406
+ name: "schedulesSearchParam",
1407
+ type: "string",
1408
+ default: "",
1409
+ displayOptions: {
1410
+ show: {
1411
+ resource: ["schedules"],
1412
+ operation: ["list"]
1413
+ }
1414
+ }
1415
+ },
1416
+ {
1417
+ displayName: "Contato ID",
1418
+ name: "schedulesContactId",
1419
+ type: "number",
1420
+ default: 0,
1421
+ displayOptions: {
1422
+ show: {
1423
+ resource: ["schedules"],
1424
+ operation: ["list"]
1425
+ }
1426
+ }
1427
+ },
1428
+ {
1429
+ displayName: "Usuario ID",
1430
+ name: "schedulesUserId",
1431
+ type: "number",
1432
+ default: 0,
1433
+ displayOptions: {
1434
+ show: {
1435
+ resource: ["schedules"],
1436
+ operation: ["list"]
1437
+ }
1438
+ }
1439
+ },
1440
+ {
1441
+ displayName: "Tag ID",
1442
+ name: "tagId",
1443
+ type: "string",
1444
+ default: "",
1445
+ required: true,
1446
+ displayOptions: {
1447
+ show: {
1448
+ resource: ["tags"],
1449
+ operation: ["get", "update", "delete"]
1450
+ }
1451
+ }
1452
+ },
1453
+ {
1454
+ displayName: "Nome",
1455
+ name: "tagName",
1456
+ type: "string",
1457
+ default: "",
1458
+ required: true,
1459
+ displayOptions: {
1460
+ show: {
1461
+ resource: ["tags"],
1462
+ operation: ["create", "update"]
1463
+ }
1464
+ }
1465
+ },
1466
+ {
1467
+ displayName: "Cor",
1468
+ name: "tagColor",
1469
+ type: "string",
1470
+ default: "",
1471
+ displayOptions: {
1472
+ show: {
1473
+ resource: ["tags"],
1474
+ operation: ["create", "update"]
1475
+ }
1476
+ }
1477
+ },
1478
+ {
1479
+ displayName: "Kanban",
1480
+ name: "tagKanban",
1481
+ type: "number",
1482
+ default: 0,
1483
+ displayOptions: {
1484
+ show: {
1485
+ resource: ["tags"],
1486
+ operation: ["create", "update", "list"]
1487
+ }
1488
+ }
1489
+ },
1490
+ {
1491
+ displayName: "Is Private",
1492
+ name: "tagIsPrivate",
1493
+ type: "boolean",
1494
+ default: false,
1495
+ displayOptions: {
1496
+ show: {
1497
+ resource: ["tags"],
1498
+ operation: ["create", "update"]
1499
+ }
1500
+ }
1501
+ },
1502
+ {
1503
+ displayName: "Time Lane",
1504
+ name: "tagTimeLane",
1505
+ type: "string",
1506
+ default: "",
1507
+ displayOptions: {
1508
+ show: {
1509
+ resource: ["tags"],
1510
+ operation: ["create", "update"]
1511
+ }
1512
+ }
1513
+ },
1514
+ {
1515
+ displayName: "Next Lane ID",
1516
+ name: "tagNextLaneId",
1517
+ type: "number",
1518
+ default: 0,
1519
+ displayOptions: {
1520
+ show: {
1521
+ resource: ["tags"],
1522
+ operation: ["create", "update"]
1523
+ }
1524
+ }
1525
+ },
1526
+ {
1527
+ displayName: "Rollback Lane ID",
1528
+ name: "tagRollbackLaneId",
1529
+ type: "number",
1530
+ default: 0,
1531
+ displayOptions: {
1532
+ show: {
1533
+ resource: ["tags"],
1534
+ operation: ["create", "update"]
1535
+ }
1536
+ }
1537
+ },
1538
+ {
1539
+ displayName: "Mensagem de boas vindas",
1540
+ name: "tagGreetingMessageLane",
1541
+ type: "string",
1542
+ default: "",
1543
+ typeOptions: { rows: 3 },
1544
+ displayOptions: {
1545
+ show: {
1546
+ resource: ["tags"],
1547
+ operation: ["create", "update"]
1548
+ }
1549
+ }
1550
+ },
1551
+ {
1552
+ displayName: "Pagina",
1553
+ name: "tagsPage",
1554
+ type: "number",
1555
+ default: 1,
1556
+ displayOptions: {
1557
+ show: {
1558
+ resource: ["tags"],
1559
+ operation: ["list"]
1560
+ }
1561
+ }
1562
+ },
1563
+ {
1564
+ displayName: "Buscar",
1565
+ name: "tagsSearchParam",
1566
+ type: "string",
1567
+ default: "",
1568
+ displayOptions: {
1569
+ show: {
1570
+ resource: ["tags"],
1571
+ operation: ["list"]
1572
+ }
1573
+ }
1574
+ },
1575
+ {
1576
+ displayName: "Limite",
1577
+ name: "tagsLimit",
1578
+ type: "number",
1579
+ default: 0,
1580
+ displayOptions: {
1581
+ show: {
1582
+ resource: ["tags"],
1583
+ operation: ["list"]
1584
+ }
1585
+ }
1586
+ },
1587
+ {
1588
+ displayName: "ToDo ID",
1589
+ name: "todoId",
1590
+ type: "string",
1591
+ default: "",
1592
+ required: true,
1593
+ displayOptions: {
1594
+ show: {
1595
+ resource: ["todo"],
1596
+ operation: ["get", "update", "delete"]
1597
+ }
1598
+ }
1599
+ },
1600
+ {
1601
+ displayName: "Titulo",
1602
+ name: "todoTitle",
1603
+ type: "string",
1604
+ default: "",
1605
+ required: true,
1606
+ displayOptions: {
1607
+ show: {
1608
+ resource: ["todo"],
1609
+ operation: ["create"]
1610
+ }
1611
+ }
1612
+ },
1613
+ {
1614
+ displayName: "Descricao",
1615
+ name: "todoDescription",
1616
+ type: "string",
1617
+ default: "",
1618
+ typeOptions: { rows: 3 },
1619
+ displayOptions: {
1620
+ show: {
1621
+ resource: ["todo"],
1622
+ operation: ["create"]
1623
+ }
1624
+ }
1625
+ },
1626
+ {
1627
+ displayName: "Prioridade",
1628
+ name: "todoPriority",
1629
+ type: "string",
1630
+ default: "",
1631
+ displayOptions: {
1632
+ show: {
1633
+ resource: ["todo"],
1634
+ operation: ["create", "update", "list"]
1635
+ }
1636
+ }
1637
+ },
1638
+ {
1639
+ displayName: "Cor",
1640
+ name: "todoColor",
1641
+ type: "string",
1642
+ default: "",
1643
+ displayOptions: {
1644
+ show: {
1645
+ resource: ["todo"],
1646
+ operation: ["create", "update"]
1647
+ }
1648
+ }
1649
+ },
1650
+ {
1651
+ displayName: "Due date",
1652
+ name: "todoDueDate",
1653
+ type: "string",
1654
+ default: "",
1655
+ displayOptions: {
1656
+ show: {
1657
+ resource: ["todo"],
1658
+ operation: ["create", "update"]
1659
+ }
1660
+ }
1661
+ },
1662
+ {
1663
+ displayName: "Reminder date",
1664
+ name: "todoReminderDate",
1665
+ type: "string",
1666
+ default: "",
1667
+ displayOptions: {
1668
+ show: {
1669
+ resource: ["todo"],
1670
+ operation: ["create", "update"]
1671
+ }
1672
+ }
1673
+ },
1674
+ {
1675
+ displayName: "Mensagem notificacao",
1676
+ name: "todoNotificationMessage",
1677
+ type: "string",
1678
+ default: "",
1679
+ displayOptions: {
1680
+ show: {
1681
+ resource: ["todo"],
1682
+ operation: ["create", "update"]
1683
+ }
1684
+ }
1685
+ },
1686
+ {
1687
+ displayName: "Notificar ao concluir",
1688
+ name: "todoNotifyOnComplete",
1689
+ type: "boolean",
1690
+ default: false,
1691
+ displayOptions: {
1692
+ show: {
1693
+ resource: ["todo"],
1694
+ operation: ["create", "update"]
1695
+ }
1696
+ }
1697
+ },
1698
+ {
1699
+ displayName: "Notificar antes do vencimento",
1700
+ name: "todoNotifyBeforeDue",
1701
+ type: "boolean",
1702
+ default: false,
1703
+ displayOptions: {
1704
+ show: {
1705
+ resource: ["todo"],
1706
+ operation: ["create", "update"]
1707
+ }
1708
+ }
1709
+ },
1710
+ {
1711
+ displayName: "Minutos antes",
1712
+ name: "todoNotifyBeforeDueMinutes",
1713
+ type: "number",
1714
+ default: 0,
1715
+ displayOptions: {
1716
+ show: {
1717
+ resource: ["todo"],
1718
+ operation: ["create", "update"]
1719
+ }
1720
+ }
1721
+ },
1722
+ {
1723
+ displayName: "Notify recipients (JSON)",
1724
+ name: "todoNotifyRecipientsJson",
1725
+ type: "string",
1726
+ default: "[]",
1727
+ typeOptions: { rows: 3 },
1728
+ displayOptions: {
1729
+ show: {
1730
+ resource: ["todo"],
1731
+ operation: ["create", "update"]
1732
+ }
1733
+ }
1734
+ },
1735
+ {
1736
+ displayName: "Items (JSON)",
1737
+ name: "todoItemsJson",
1738
+ type: "string",
1739
+ default: "[]",
1740
+ typeOptions: { rows: 3 },
1741
+ displayOptions: {
1742
+ show: {
1743
+ resource: ["todo"],
1744
+ operation: ["create", "update"]
1745
+ }
1746
+ }
1747
+ },
1748
+ {
1749
+ displayName: "Assigned user ID",
1750
+ name: "todoAssignedUserId",
1751
+ type: "number",
1752
+ default: 0,
1753
+ displayOptions: {
1754
+ show: {
1755
+ resource: ["todo"],
1756
+ operation: ["create", "update"]
1757
+ }
1758
+ }
1759
+ },
1760
+ {
1761
+ displayName: "Dados adicionais (JSON)",
1762
+ name: "todoUpdateJson",
1763
+ type: "string",
1764
+ default: "{}",
1765
+ typeOptions: { rows: 4 },
1766
+ displayOptions: {
1767
+ show: {
1768
+ resource: ["todo"],
1769
+ operation: ["update"]
1770
+ }
1771
+ }
1772
+ },
1773
+ {
1774
+ displayName: "Pagina",
1775
+ name: "todoPage",
1776
+ type: "number",
1777
+ default: 1,
1778
+ displayOptions: {
1779
+ show: {
1780
+ resource: ["todo"],
1781
+ operation: ["list"]
1782
+ }
1783
+ }
1784
+ },
1785
+ {
1786
+ displayName: "Buscar",
1787
+ name: "todoSearchParam",
1788
+ type: "string",
1789
+ default: "",
1790
+ displayOptions: {
1791
+ show: {
1792
+ resource: ["todo"],
1793
+ operation: ["list"]
1794
+ }
1795
+ }
1796
+ },
1797
+ {
1798
+ displayName: "Status",
1799
+ name: "todoStatus",
1800
+ type: "string",
1801
+ default: "",
1802
+ displayOptions: {
1803
+ show: {
1804
+ resource: ["todo"],
1805
+ operation: ["list"]
1806
+ }
1807
+ }
1808
+ },
1809
+ {
1810
+ displayName: "Priority",
1811
+ name: "todoPriorityFilter",
1812
+ type: "string",
1813
+ default: "",
1814
+ displayOptions: {
1815
+ show: {
1816
+ resource: ["todo"],
1817
+ operation: ["list"]
1818
+ }
1819
+ }
1820
+ },
1821
+ {
1822
+ displayName: "User ID",
1823
+ name: "todoUserIdFilter",
1824
+ type: "number",
1825
+ default: 0,
1826
+ displayOptions: {
1827
+ show: {
1828
+ resource: ["todo"],
1829
+ operation: ["list"]
1830
+ }
1831
+ }
1832
+ },
1833
+ {
1834
+ displayName: "All",
1835
+ name: "todoAll",
1836
+ type: "boolean",
1837
+ default: false,
1838
+ displayOptions: {
1839
+ show: {
1840
+ resource: ["todo"],
1841
+ operation: ["list"]
1842
+ }
1843
+ }
1844
+ },
1845
+ {
1846
+ displayName: "Report date from",
1847
+ name: "reportDateFrom",
1848
+ type: "string",
1849
+ default: "",
1850
+ displayOptions: {
1851
+ show: {
1852
+ resource: ["reports"],
1853
+ operation: ["ticketsReport", "salesReport", "contactsReport"]
1854
+ }
1855
+ }
1856
+ },
1857
+ {
1858
+ displayName: "Report date to",
1859
+ name: "reportDateTo",
1860
+ type: "string",
1861
+ default: "",
1862
+ displayOptions: {
1863
+ show: {
1864
+ resource: ["reports"],
1865
+ operation: ["ticketsReport", "salesReport", "contactsReport"]
1866
+ }
1867
+ }
1868
+ },
1869
+ {
1870
+ displayName: "Status",
1871
+ name: "reportStatus",
1872
+ type: "string",
1873
+ default: "",
1874
+ displayOptions: {
1875
+ show: {
1876
+ resource: ["reports"],
1877
+ operation: ["ticketsReport", "salesReport"]
1878
+ }
1879
+ }
1880
+ },
1881
+ {
1882
+ displayName: "Contact ID",
1883
+ name: "reportContactId",
1884
+ type: "number",
1885
+ default: 0,
1886
+ displayOptions: {
1887
+ show: {
1888
+ resource: ["reports"],
1889
+ operation: ["ticketsReport"]
1890
+ }
1891
+ }
1892
+ },
1893
+ {
1894
+ displayName: "Whatsapp ID",
1895
+ name: "reportWhatsappId",
1896
+ type: "number",
1897
+ default: 0,
1898
+ displayOptions: {
1899
+ show: {
1900
+ resource: ["reports"],
1901
+ operation: ["ticketsReport"]
1902
+ }
1903
+ }
1904
+ },
1905
+ {
1906
+ displayName: "Queue IDs (JSON)",
1907
+ name: "reportQueueIds",
1908
+ type: "string",
1909
+ default: "[]",
1910
+ displayOptions: {
1911
+ show: {
1912
+ resource: ["reports"],
1913
+ operation: ["ticketsReport"]
1914
+ }
1915
+ }
1916
+ },
1917
+ {
1918
+ displayName: "Tag IDs (JSON)",
1919
+ name: "reportTagIds",
1920
+ type: "string",
1921
+ default: "[]",
1922
+ displayOptions: {
1923
+ show: {
1924
+ resource: ["reports"],
1925
+ operation: ["ticketsReport"]
1926
+ }
1927
+ }
1928
+ },
1929
+ {
1930
+ displayName: "User IDs (JSON)",
1931
+ name: "reportUserIds",
1932
+ type: "string",
1933
+ default: "[]",
1934
+ displayOptions: {
1935
+ show: {
1936
+ resource: ["reports"],
1937
+ operation: ["ticketsReport"]
1938
+ }
1939
+ }
1940
+ },
1941
+ {
1942
+ displayName: "Pagina",
1943
+ name: "reportPage",
1944
+ type: "number",
1945
+ default: 1,
1946
+ displayOptions: {
1947
+ show: {
1948
+ resource: ["reports"],
1949
+ operation: ["ticketsReport", "salesReport"]
1950
+ }
1951
+ }
1952
+ },
1953
+ {
1954
+ displayName: "Page size",
1955
+ name: "reportPageSize",
1956
+ type: "number",
1957
+ default: 20,
1958
+ displayOptions: {
1959
+ show: {
1960
+ resource: ["reports"],
1961
+ operation: ["ticketsReport", "salesReport"]
1962
+ }
1963
+ }
1964
+ },
1965
+ {
1966
+ displayName: "Only rated",
1967
+ name: "reportOnlyRated",
1968
+ type: "boolean",
1969
+ default: false,
1970
+ displayOptions: {
1971
+ show: {
1972
+ resource: ["reports"],
1973
+ operation: ["ticketsReport"]
1974
+ }
1975
+ }
1976
+ },
1977
+ {
1978
+ displayName: "User ID",
1979
+ name: "reportUserId",
1980
+ type: "number",
1981
+ default: 0,
1982
+ displayOptions: {
1983
+ show: {
1984
+ resource: ["reports"],
1985
+ operation: ["salesReport"]
1986
+ }
1987
+ }
1988
+ },
1989
+ {
1990
+ displayName: "User ID",
1991
+ name: "userId",
1992
+ type: "string",
1993
+ default: "",
1994
+ required: true,
1995
+ displayOptions: {
1996
+ show: {
1997
+ resource: ["users"],
1998
+ operation: ["get", "update", "delete"]
1999
+ }
2000
+ }
2001
+ },
2002
+ {
2003
+ displayName: "Nome",
2004
+ name: "userName",
2005
+ type: "string",
2006
+ default: "",
2007
+ required: true,
2008
+ displayOptions: {
2009
+ show: {
2010
+ resource: ["users"],
2011
+ operation: ["create"]
2012
+ }
2013
+ }
2014
+ },
2015
+ {
2016
+ displayName: "Email",
2017
+ name: "userEmail",
2018
+ type: "string",
2019
+ default: "",
2020
+ required: true,
2021
+ displayOptions: {
2022
+ show: {
2023
+ resource: ["users"],
2024
+ operation: ["create"]
2025
+ }
2026
+ }
2027
+ },
2028
+ {
2029
+ displayName: "Senha",
2030
+ name: "userPassword",
2031
+ type: "string",
2032
+ default: "",
2033
+ typeOptions: { password: true },
2034
+ required: true,
2035
+ displayOptions: {
2036
+ show: {
2037
+ resource: ["users"],
2038
+ operation: ["create"]
2039
+ }
2040
+ }
2041
+ },
2042
+ {
2043
+ displayName: "Profile",
2044
+ name: "userProfile",
2045
+ type: "string",
2046
+ default: "user",
2047
+ displayOptions: {
2048
+ show: {
2049
+ resource: ["users"],
2050
+ operation: ["create", "update"]
2051
+ }
2052
+ }
2053
+ },
2054
+ {
2055
+ displayName: "Telefone",
2056
+ name: "userPhone",
2057
+ type: "string",
2058
+ default: "",
2059
+ displayOptions: {
2060
+ show: {
2061
+ resource: ["users"],
2062
+ operation: ["create", "update"]
2063
+ }
2064
+ }
2065
+ },
2066
+ {
2067
+ displayName: "Company ID",
2068
+ name: "userCompanyId",
2069
+ type: "number",
2070
+ default: 0,
2071
+ displayOptions: {
2072
+ show: {
2073
+ resource: ["users"],
2074
+ operation: ["create", "update"]
2075
+ }
2076
+ }
2077
+ },
2078
+ {
2079
+ displayName: "Queue IDs (JSON)",
2080
+ name: "userQueueIds",
2081
+ type: "string",
2082
+ default: "[]",
2083
+ displayOptions: {
2084
+ show: {
2085
+ resource: ["users"],
2086
+ operation: ["create", "update"]
2087
+ }
2088
+ }
2089
+ },
2090
+ {
2091
+ displayName: "Start work",
2092
+ name: "userStartWork",
2093
+ type: "string",
2094
+ default: "",
2095
+ displayOptions: {
2096
+ show: {
2097
+ resource: ["users"],
2098
+ operation: ["create", "update"]
2099
+ }
2100
+ }
2101
+ },
2102
+ {
2103
+ displayName: "End work",
2104
+ name: "userEndWork",
2105
+ type: "string",
2106
+ default: "",
2107
+ displayOptions: {
2108
+ show: {
2109
+ resource: ["users"],
2110
+ operation: ["create", "update"]
2111
+ }
2112
+ }
2113
+ },
2114
+ {
2115
+ displayName: "Dados adicionais (JSON)",
2116
+ name: "userExtraJson",
2117
+ type: "string",
2118
+ default: "{}",
2119
+ typeOptions: { rows: 4 },
2120
+ displayOptions: {
2121
+ show: {
2122
+ resource: ["users"],
2123
+ operation: ["update"]
2124
+ }
2125
+ }
2126
+ },
2127
+ {
2128
+ displayName: "Pagina",
2129
+ name: "usersPage",
2130
+ type: "number",
2131
+ default: 1,
2132
+ displayOptions: {
2133
+ show: {
2134
+ resource: ["users"],
2135
+ operation: ["list"]
2136
+ }
2137
+ }
2138
+ },
2139
+ {
2140
+ displayName: "Buscar",
2141
+ name: "usersSearchParam",
2142
+ type: "string",
2143
+ default: "",
2144
+ displayOptions: {
2145
+ show: {
2146
+ resource: ["users"],
2147
+ operation: ["list"]
2148
+ }
2149
+ }
2150
+ },
2151
+ {
2152
+ displayName: "Queue ID",
2153
+ name: "queueId",
2154
+ type: "string",
2155
+ default: "",
2156
+ required: true,
2157
+ displayOptions: {
2158
+ show: {
2159
+ resource: ["queues"],
2160
+ operation: ["get", "update", "delete"]
2161
+ }
2162
+ }
2163
+ },
2164
+ {
2165
+ displayName: "Nome",
2166
+ name: "queueName",
2167
+ type: "string",
2168
+ default: "",
2169
+ required: true,
2170
+ displayOptions: {
2171
+ show: {
2172
+ resource: ["queues"],
2173
+ operation: ["create"]
2174
+ }
2175
+ }
2176
+ },
2177
+ {
2178
+ displayName: "Cor",
2179
+ name: "queueColor",
2180
+ type: "string",
2181
+ default: "",
2182
+ displayOptions: {
2183
+ show: {
2184
+ resource: ["queues"],
2185
+ operation: ["create", "update"]
2186
+ }
2187
+ }
2188
+ },
2189
+ {
2190
+ displayName: "Mensagem de saudacao",
2191
+ name: "queueGreetingMessage",
2192
+ type: "string",
2193
+ default: "",
2194
+ typeOptions: { rows: 3 },
2195
+ displayOptions: {
2196
+ show: {
2197
+ resource: ["queues"],
2198
+ operation: ["create", "update"]
2199
+ }
2200
+ }
2201
+ },
2202
+ {
2203
+ displayName: "Mensagem fora do horario",
2204
+ name: "queueOutOfHoursMessage",
2205
+ type: "string",
2206
+ default: "",
2207
+ typeOptions: { rows: 3 },
2208
+ displayOptions: {
2209
+ show: {
2210
+ resource: ["queues"],
2211
+ operation: ["create", "update"]
2212
+ }
2213
+ }
2214
+ },
2215
+ {
2216
+ displayName: "Order",
2217
+ name: "queueOrder",
2218
+ type: "number",
2219
+ default: 0,
2220
+ displayOptions: {
2221
+ show: {
2222
+ resource: ["queues"],
2223
+ operation: ["create", "update"]
2224
+ }
2225
+ }
2226
+ },
2227
+ {
2228
+ displayName: "Tempo roteador",
2229
+ name: "queueTempoRoteador",
2230
+ type: "number",
2231
+ default: 0,
2232
+ displayOptions: {
2233
+ show: {
2234
+ resource: ["queues"],
2235
+ operation: ["create", "update"]
2236
+ }
2237
+ }
2238
+ },
2239
+ {
2240
+ displayName: "Ativar roteador",
2241
+ name: "queueAtivarRoteador",
2242
+ type: "boolean",
2243
+ default: false,
2244
+ displayOptions: {
2245
+ show: {
2246
+ resource: ["queues"],
2247
+ operation: ["create", "update"]
2248
+ }
2249
+ }
2250
+ },
2251
+ {
2252
+ displayName: "Integration ID",
2253
+ name: "queueIntegrationId",
2254
+ type: "number",
2255
+ default: 0,
2256
+ displayOptions: {
2257
+ show: {
2258
+ resource: ["queues"],
2259
+ operation: ["create", "update"]
2260
+ }
2261
+ }
2262
+ },
2263
+ {
2264
+ displayName: "File list ID",
2265
+ name: "queueFileListId",
2266
+ type: "number",
2267
+ default: 0,
2268
+ displayOptions: {
2269
+ show: {
2270
+ resource: ["queues"],
2271
+ operation: ["create", "update"]
2272
+ }
2273
+ }
2274
+ },
2275
+ {
2276
+ displayName: "Close ticket",
2277
+ name: "queueCloseTicket",
2278
+ type: "boolean",
2279
+ default: false,
2280
+ displayOptions: {
2281
+ show: {
2282
+ resource: ["queues"],
2283
+ operation: ["create", "update"]
2284
+ }
2285
+ }
2286
+ },
2287
+ {
2288
+ displayName: "Randomize immediate",
2289
+ name: "queueRandomizeImmediate",
2290
+ type: "boolean",
2291
+ default: false,
2292
+ displayOptions: {
2293
+ show: {
2294
+ resource: ["queues"],
2295
+ operation: ["create", "update"]
2296
+ }
2297
+ }
2298
+ },
2299
+ {
2300
+ displayName: "Schedules (JSON)",
2301
+ name: "queueSchedulesJson",
2302
+ type: "string",
2303
+ default: "[]",
2304
+ displayOptions: {
2305
+ show: {
2306
+ resource: ["queues"],
2307
+ operation: ["create", "update"]
2308
+ }
2309
+ }
2310
+ },
2311
+ {
2312
+ displayName: "Chatbots (JSON)",
2313
+ name: "queueChatbotsJson",
2314
+ type: "string",
2315
+ default: "[]",
2316
+ displayOptions: {
2317
+ show: {
2318
+ resource: ["queues"],
2319
+ operation: ["create", "update"]
2320
+ }
2321
+ }
2322
+ },
2323
+ {
2324
+ displayName: "Lane order (JSON)",
2325
+ name: "kanbanLaneOrder",
2326
+ type: "string",
2327
+ default: "[]",
2328
+ typeOptions: { rows: 4 },
2329
+ displayOptions: {
2330
+ show: {
2331
+ resource: ["kanban"],
2332
+ operation: ["companyLaneSet"]
2333
+ }
2334
+ }
2335
+ },
2336
+ {
2337
+ displayName: "Company ID",
2338
+ name: "companyId",
2339
+ type: "number",
2340
+ default: 0,
2341
+ required: true,
2342
+ displayOptions: {
2343
+ show: {
2344
+ resource: ["companies"],
2345
+ operation: ["get", "update", "delete"]
2346
+ }
2347
+ }
2348
+ },
2349
+ {
2350
+ displayName: "Conexao ID",
2351
+ name: "connectionId",
2352
+ type: "string",
2353
+ default: "",
2354
+ required: true,
2355
+ displayOptions: {
2356
+ show: {
2357
+ resource: ["connections"],
2358
+ operation: ["get", "update", "delete"]
2359
+ }
2360
+ }
2361
+ },
2362
+ {
2363
+ displayName: "Nome",
2364
+ name: "connectionName",
2365
+ type: "string",
2366
+ default: "",
2367
+ required: true,
2368
+ displayOptions: {
2369
+ show: {
2370
+ resource: ["connections"],
2371
+ operation: ["create"]
2372
+ }
2373
+ }
2374
+ },
2375
+ {
2376
+ displayName: "Tipo de conexao",
2377
+ name: "connectionChannel",
2378
+ type: "options",
2379
+ options: [
2380
+ { name: "WhatsApp", value: "whatsapp" },
2381
+ { name: "WhatsApp Oficial", value: "whatsapp_oficial" },
2382
+ { name: "Wuzapi", value: "wuzapi" },
2383
+ { name: "Evolution API", value: "evolution_api" },
2384
+ { name: "Evolution API Oficial", value: "evolution_api_oficial" },
2385
+ { name: "WebChat", value: "webchat" }
2386
+ ],
2387
+ default: "whatsapp",
2388
+ required: true,
2389
+ displayOptions: {
2390
+ show: {
2391
+ resource: ["connections"],
2392
+ operation: ["create", "update"]
2393
+ }
2394
+ }
2395
+ },
2396
+ {
2397
+ displayName: "Default",
2398
+ name: "connectionIsDefault",
2399
+ type: "boolean",
2400
+ default: false,
2401
+ displayOptions: {
2402
+ show: {
2403
+ resource: ["connections"],
2404
+ operation: ["create", "update"]
2405
+ }
2406
+ }
2407
+ },
2408
+ {
2409
+ displayName: "Queue IDs (JSON)",
2410
+ name: "connectionQueueIds",
2411
+ type: "string",
2412
+ default: "[]",
2413
+ displayOptions: {
2414
+ show: {
2415
+ resource: ["connections"],
2416
+ operation: ["create", "update"]
2417
+ }
2418
+ }
2419
+ },
2420
+ {
2421
+ displayName: "Greeting message",
2422
+ name: "connectionGreetingMessage",
2423
+ type: "string",
2424
+ default: "",
2425
+ typeOptions: { rows: 3 },
2426
+ displayOptions: {
2427
+ show: {
2428
+ resource: ["connections"],
2429
+ operation: ["create", "update"]
2430
+ }
2431
+ }
2432
+ },
2433
+ {
2434
+ displayName: "Out of hours message",
2435
+ name: "connectionOutOfHoursMessage",
2436
+ type: "string",
2437
+ default: "",
2438
+ typeOptions: { rows: 3 },
2439
+ displayOptions: {
2440
+ show: {
2441
+ resource: ["connections"],
2442
+ operation: ["create", "update"]
2443
+ }
2444
+ }
2445
+ },
2446
+ {
2447
+ displayName: "Token",
2448
+ name: "connectionToken",
2449
+ type: "string",
2450
+ default: "",
2451
+ displayOptions: {
2452
+ show: {
2453
+ resource: ["connections"],
2454
+ operation: ["create", "update"]
2455
+ }
2456
+ }
2457
+ },
2458
+ {
2459
+ displayName: "Send token",
2460
+ name: "connectionSendToken",
2461
+ type: "string",
2462
+ default: "",
2463
+ displayOptions: {
2464
+ show: {
2465
+ resource: ["connections"],
2466
+ operation: ["create", "update"]
2467
+ }
2468
+ }
2469
+ },
2470
+ {
2471
+ displayName: "Phone number id",
2472
+ name: "connectionPhoneNumberId",
2473
+ type: "string",
2474
+ default: "",
2475
+ displayOptions: {
2476
+ show: {
2477
+ resource: ["connections"],
2478
+ operation: ["create", "update"]
2479
+ }
2480
+ }
2481
+ },
2482
+ {
2483
+ displayName: "WABA ID",
2484
+ name: "connectionWabaId",
2485
+ type: "string",
2486
+ default: "",
2487
+ displayOptions: {
2488
+ show: {
2489
+ resource: ["connections"],
2490
+ operation: ["create", "update"]
2491
+ }
2492
+ }
2493
+ },
2494
+ {
2495
+ displayName: "Business ID",
2496
+ name: "connectionBusinessId",
2497
+ type: "string",
2498
+ default: "",
2499
+ displayOptions: {
2500
+ show: {
2501
+ resource: ["connections"],
2502
+ operation: ["create", "update"]
2503
+ }
2504
+ }
2505
+ },
2506
+ {
2507
+ displayName: "Phone number",
2508
+ name: "connectionPhoneNumber",
2509
+ type: "string",
2510
+ default: "",
2511
+ displayOptions: {
2512
+ show: {
2513
+ resource: ["connections"],
2514
+ operation: ["create", "update"]
2515
+ }
2516
+ }
2517
+ },
2518
+ {
2519
+ displayName: "WABA webhook",
2520
+ name: "connectionWabaWebhook",
2521
+ type: "string",
2522
+ default: "",
2523
+ displayOptions: {
2524
+ show: {
2525
+ resource: ["connections"],
2526
+ operation: ["create", "update"]
2527
+ }
2528
+ }
2529
+ },
2530
+ {
2531
+ displayName: "Cor",
2532
+ name: "connectionColor",
2533
+ type: "string",
2534
+ default: "",
2535
+ displayOptions: {
2536
+ show: {
2537
+ resource: ["connections"],
2538
+ operation: ["create", "update"]
2539
+ }
2540
+ }
2541
+ },
2542
+ {
2543
+ displayName: "Filtro por tipo",
2544
+ name: "connectionFilterChannel",
2545
+ type: "options",
2546
+ options: [
2547
+ { name: "Todos", value: "" },
2548
+ { name: "WhatsApp", value: "whatsapp" },
2549
+ { name: "WhatsApp Oficial", value: "whatsapp_oficial" },
2550
+ { name: "Wuzapi", value: "wuzapi" },
2551
+ { name: "Evolution API", value: "evolution_api" },
2552
+ { name: "Evolution API Oficial", value: "evolution_api_oficial" },
2553
+ { name: "WebChat", value: "webchat" }
2554
+ ],
2555
+ default: "",
2556
+ displayOptions: {
2557
+ show: {
2558
+ resource: ["connections"],
2559
+ operation: ["list"]
2560
+ }
2561
+ }
2562
+ },
2563
+ {
2564
+ displayName: "Session",
2565
+ name: "connectionSession",
2566
+ type: "string",
2567
+ default: "",
2568
+ displayOptions: {
2569
+ show: {
2570
+ resource: ["connections"],
2571
+ operation: ["list"]
2572
+ }
2573
+ }
2574
+ },
2575
+ {
2576
+ displayName: "Dados adicionais (JSON)",
2577
+ name: "connectionExtraJson",
2578
+ type: "string",
2579
+ default: "{}",
2580
+ typeOptions: { rows: 4 },
2581
+ displayOptions: {
2582
+ show: {
2583
+ resource: ["connections"],
2584
+ operation: ["update"]
2585
+ }
2586
+ }
2587
+ },
2588
+ {
2589
+ displayName: "Nome",
2590
+ name: "companyName",
2591
+ type: "string",
2592
+ default: "",
2593
+ required: true,
2594
+ displayOptions: {
2595
+ show: {
2596
+ resource: ["companies"],
2597
+ operation: ["create"]
2598
+ }
2599
+ }
2600
+ },
2601
+ {
2602
+ displayName: "Senha",
2603
+ name: "companyPassword",
2604
+ type: "string",
2605
+ default: "",
2606
+ typeOptions: { password: true },
2607
+ required: true,
2608
+ displayOptions: {
2609
+ show: {
2610
+ resource: ["companies"],
2611
+ operation: ["create"]
2612
+ }
2613
+ }
2614
+ },
2615
+ {
2616
+ displayName: "Email",
2617
+ name: "companyEmail",
2618
+ type: "string",
2619
+ default: "",
2620
+ displayOptions: {
2621
+ show: {
2622
+ resource: ["companies"],
2623
+ operation: ["create", "update"]
2624
+ }
2625
+ }
2626
+ },
2627
+ {
2628
+ displayName: "Telefone",
2629
+ name: "companyPhone",
2630
+ type: "string",
2631
+ default: "",
2632
+ displayOptions: {
2633
+ show: {
2634
+ resource: ["companies"],
2635
+ operation: ["create", "update"]
2636
+ }
2637
+ }
2638
+ },
2639
+ {
2640
+ displayName: "Plan ID",
2641
+ name: "companyPlanId",
2642
+ type: "number",
2643
+ default: 0,
2644
+ displayOptions: {
2645
+ show: {
2646
+ resource: ["companies"],
2647
+ operation: ["create", "update"]
2648
+ }
2649
+ }
2650
+ },
2651
+ {
2652
+ displayName: "Status",
2653
+ name: "companyStatus",
2654
+ type: "boolean",
2655
+ default: true,
2656
+ displayOptions: {
2657
+ show: {
2658
+ resource: ["companies"],
2659
+ operation: ["create", "update"]
2660
+ }
2661
+ }
2662
+ },
2663
+ {
2664
+ displayName: "Due date",
2665
+ name: "companyDueDate",
2666
+ type: "string",
2667
+ default: "",
2668
+ displayOptions: {
2669
+ show: {
2670
+ resource: ["companies"],
2671
+ operation: ["create", "update"]
2672
+ }
2673
+ }
2674
+ },
2675
+ {
2676
+ displayName: "Recurrence",
2677
+ name: "companyRecurrence",
2678
+ type: "string",
2679
+ default: "",
2680
+ displayOptions: {
2681
+ show: {
2682
+ resource: ["companies"],
2683
+ operation: ["create", "update"]
2684
+ }
2685
+ }
2686
+ },
2687
+ {
2688
+ displayName: "Document",
2689
+ name: "companyDocument",
2690
+ type: "string",
2691
+ default: "",
2692
+ displayOptions: {
2693
+ show: {
2694
+ resource: ["companies"],
2695
+ operation: ["create", "update"]
2696
+ }
2697
+ }
2698
+ },
2699
+ {
2700
+ displayName: "Payment method",
2701
+ name: "companyPaymentMethod",
2702
+ type: "string",
2703
+ default: "",
2704
+ displayOptions: {
2705
+ show: {
2706
+ resource: ["companies"],
2707
+ operation: ["create", "update"]
2708
+ }
2709
+ }
2710
+ },
2711
+ {
2712
+ displayName: "Campaigns enabled",
2713
+ name: "companyCampaignsEnabled",
2714
+ type: "boolean",
2715
+ default: false,
2716
+ displayOptions: {
2717
+ show: {
2718
+ resource: ["companies"],
2719
+ operation: ["create", "update"]
2720
+ }
2721
+ }
2722
+ },
2723
+ {
2724
+ displayName: "Pagina",
2725
+ name: "companiesPage",
2726
+ type: "number",
2727
+ default: 1,
2728
+ displayOptions: {
2729
+ show: {
2730
+ resource: ["companies"],
2731
+ operation: ["list"]
2732
+ }
2733
+ }
2734
+ },
2735
+ {
2736
+ displayName: "Buscar",
2737
+ name: "companiesSearchParam",
2738
+ type: "string",
2739
+ default: "",
2740
+ displayOptions: {
2741
+ show: {
2742
+ resource: ["companies"],
2743
+ operation: ["list"]
2744
+ }
2745
+ }
2746
+ },
2747
+ {
2748
+ displayName: "Invoice ID",
2749
+ name: "invoiceId",
2750
+ type: "string",
2751
+ default: "",
2752
+ required: true,
2753
+ displayOptions: {
2754
+ show: {
2755
+ resource: ["invoices"],
2756
+ operation: ["get", "update"]
2757
+ }
2758
+ }
2759
+ },
2760
+ {
2761
+ displayName: "Status",
2762
+ name: "invoiceStatus",
2763
+ type: "string",
2764
+ default: "",
2765
+ displayOptions: {
2766
+ show: {
2767
+ resource: ["invoices"],
2768
+ operation: ["update"]
2769
+ }
2770
+ }
2771
+ },
2772
+ {
2773
+ displayName: "Pagina",
2774
+ name: "invoicesPage",
2775
+ type: "number",
2776
+ default: 1,
2777
+ displayOptions: {
2778
+ show: {
2779
+ resource: ["invoices"],
2780
+ operation: ["list"]
2781
+ }
2782
+ }
2783
+ },
2784
+ {
2785
+ displayName: "Buscar",
2786
+ name: "invoicesSearchParam",
2787
+ type: "string",
2788
+ default: "",
2789
+ displayOptions: {
2790
+ show: {
2791
+ resource: ["invoices"],
2792
+ operation: ["list"]
2793
+ }
2794
+ }
2795
+ }
2796
+ ]
2797
+ };
2798
+ }
2799
+ async execute() {
2800
+ const items = this.getInputData();
2801
+ const returnData = [];
2802
+ const credentials = await this.getCredentials("whaticketApi");
2803
+ const baseUrl = normalizeBaseUrl(String(credentials.host || ""));
2804
+ const licenseServer = "https://noden8n.360houseleadpro.com.br";
2805
+ if (!baseUrl) {
2806
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Host do Whaticket nao configurado na credencial");
2807
+ }
2808
+ for (let i = 0; i < items.length; i++) {
2809
+ const resource = this.getNodeParameter("resource", i);
2810
+ const operation = this.getNodeParameter("operation", i);
2811
+ if (resource === "contacts") {
2812
+ const response = await executeContacts(this, i, baseUrl, credentials, operation, licenseServer);
2813
+ returnData.push({ json: response });
2814
+ continue;
2815
+ }
2816
+ if (resource === "tickets") {
2817
+ const response = await executeTickets(this, i, baseUrl, credentials, operation, licenseServer);
2818
+ returnData.push({ json: response });
2819
+ continue;
2820
+ }
2821
+ if (resource === "messages") {
2822
+ const response = await executeMessages(this, i, baseUrl, credentials, operation, licenseServer);
2823
+ returnData.push({ json: response });
2824
+ continue;
2825
+ }
2826
+ if (resource === "internalChat") {
2827
+ const response = await executeInternalChat(this, i, baseUrl, credentials, operation, licenseServer);
2828
+ returnData.push({ json: response });
2829
+ continue;
2830
+ }
2831
+ if (resource === "quickMessages") {
2832
+ const response = await executeQuickMessages(this, i, baseUrl, credentials, operation, licenseServer);
2833
+ returnData.push({ json: response });
2834
+ continue;
2835
+ }
2836
+ if (resource === "schedules") {
2837
+ const response = await executeSchedules(this, i, baseUrl, credentials, operation, licenseServer);
2838
+ returnData.push({ json: response });
2839
+ continue;
2840
+ }
2841
+ if (resource === "tags") {
2842
+ const response = await executeTags(this, i, baseUrl, credentials, operation, licenseServer);
2843
+ returnData.push({ json: response });
2844
+ continue;
2845
+ }
2846
+ if (resource === "todo") {
2847
+ const response = await executeTodo(this, i, baseUrl, credentials, operation, licenseServer);
2848
+ returnData.push({ json: response });
2849
+ continue;
2850
+ }
2851
+ if (resource === "reports") {
2852
+ const response = await executeReports(this, i, baseUrl, credentials, operation, licenseServer);
2853
+ returnData.push({ json: response });
2854
+ continue;
2855
+ }
2856
+ if (resource === "moments") {
2857
+ const response = await executeMoments(this, i, baseUrl, credentials, operation, licenseServer);
2858
+ returnData.push({ json: response });
2859
+ continue;
2860
+ }
2861
+ if (resource === "users") {
2862
+ const response = await executeUsers(this, i, baseUrl, credentials, operation, licenseServer);
2863
+ returnData.push({ json: response });
2864
+ continue;
2865
+ }
2866
+ if (resource === "queues") {
2867
+ const response = await executeQueues(this, i, baseUrl, credentials, operation, licenseServer);
2868
+ returnData.push({ json: response });
2869
+ continue;
2870
+ }
2871
+ if (resource === "kanban") {
2872
+ const response = await executeKanban(this, i, baseUrl, credentials, operation, licenseServer);
2873
+ returnData.push({ json: response });
2874
+ continue;
2875
+ }
2876
+ if (resource === "companies") {
2877
+ const response = await executeCompanies(this, i, baseUrl, credentials, operation, licenseServer);
2878
+ returnData.push({ json: response });
2879
+ continue;
2880
+ }
2881
+ if (resource === "invoices") {
2882
+ const response = await executeInvoices(this, i, baseUrl, credentials, operation, licenseServer);
2883
+ returnData.push({ json: response });
2884
+ continue;
2885
+ }
2886
+ if (resource === "connections") {
2887
+ const response = await executeConnections(this, i, baseUrl, credentials, operation, licenseServer);
2888
+ returnData.push({ json: response });
2889
+ continue;
2890
+ }
2891
+ const method = this.getNodeParameter("method", i);
2892
+ const endpointRaw = this.getNodeParameter("endpoint", i);
2893
+ const jsonParameters = this.getNodeParameter("jsonParameters", i);
2894
+ const endpoint = endpointRaw.startsWith("/") ? endpointRaw : `/${endpointRaw}`;
2895
+ const qs = jsonParameters
2896
+ ? safeJsonParse(this, this.getNodeParameter("queryParametersJson", i), "Query Parameters")
2897
+ : {};
2898
+ const body = jsonParameters
2899
+ ? safeJsonParse(this, this.getNodeParameter("bodyParametersJson", i), "Body Parameters")
2900
+ : {};
2901
+ const response = await makeRequest(this, baseUrl, credentials, licenseServer, {
2902
+ method,
2903
+ endpoint,
2904
+ qs,
2905
+ body
2906
+ });
2907
+ returnData.push({ json: response });
2908
+ }
2909
+ return [returnData];
2910
+ }
2911
+ }
2912
+ exports.Whaticket = Whaticket;
2913
+ const normalizeBaseUrl = (host) => {
2914
+ const trimmed = host.trim();
2915
+ if (trimmed.startsWith("http://") || trimmed.startsWith("https://")) {
2916
+ return trimmed.replace(/\/$/, "");
2917
+ }
2918
+ return `http://${trimmed}`.replace(/\/$/, "");
2919
+ };
2920
+ const safeJsonParse = (ctx, value, label) => {
2921
+ try {
2922
+ return value ? JSON.parse(value) : {};
2923
+ }
2924
+ catch (e) {
2925
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${label} nao e um JSON valido`);
2926
+ }
2927
+ };
2928
+ const toUserObjects = (ctx, value, label) => {
2929
+ const parsed = safeJsonParse(ctx, value, label);
2930
+ if (!Array.isArray(parsed)) {
2931
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${label} deve ser um array de IDs`);
2932
+ }
2933
+ return parsed
2934
+ .map((id) => ({ id: Number(id) }))
2935
+ .filter((u) => !isNaN(u.id));
2936
+ };
2937
+ const toIdArray = (ctx, value, label) => {
2938
+ const parsed = safeJsonParse(ctx, value, label);
2939
+ if (!Array.isArray(parsed)) {
2940
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${label} deve ser um array de IDs`);
2941
+ }
2942
+ return parsed.map((id) => Number(id)).filter((id) => !isNaN(id));
2943
+ };
2944
+ const executeContacts = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
2945
+ if (operation === "list") {
2946
+ const pageNumber = ctx.getNodeParameter("contactsPage", itemIndex);
2947
+ const searchParam = ctx.getNodeParameter("contactsSearchParam", itemIndex);
2948
+ const tagIdsRaw = ctx.getNodeParameter("contactsTagIds", itemIndex);
2949
+ const isGroup = ctx.getNodeParameter("contactsIsGroup", itemIndex);
2950
+ const tagIds = safeJsonParse(ctx, tagIdsRaw, "Contact Tag IDs");
2951
+ const qs = {
2952
+ pageNumber,
2953
+ searchParam: searchParam || undefined,
2954
+ contactTag: Array.isArray(tagIds) ? JSON.stringify(tagIds) : undefined,
2955
+ isGroup: isGroup ? true : undefined
2956
+ };
2957
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
2958
+ method: "GET",
2959
+ endpoint: "/contacts",
2960
+ qs
2961
+ });
2962
+ }
2963
+ if (operation === "search") {
2964
+ const name = ctx.getNodeParameter("contactSearchName", itemIndex);
2965
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
2966
+ method: "GET",
2967
+ endpoint: "/contacts/list",
2968
+ qs: { name }
2969
+ });
2970
+ }
2971
+ if (operation === "get") {
2972
+ const contactId = ctx.getNodeParameter("contactId", itemIndex);
2973
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
2974
+ method: "GET",
2975
+ endpoint: `/contacts/${contactId}`
2976
+ });
2977
+ }
2978
+ if (operation === "create") {
2979
+ const name = ctx.getNodeParameter("contactName", itemIndex);
2980
+ const number = ctx.getNodeParameter("contactNumber", itemIndex);
2981
+ const email = ctx.getNodeParameter("contactEmail", itemIndex);
2982
+ const birthDate = ctx.getNodeParameter("contactBirthDate", itemIndex);
2983
+ const extraInfoRaw = ctx.getNodeParameter("contactExtraInfo", itemIndex);
2984
+ const extraInfo = safeJsonParse(ctx, extraInfoRaw, "Extra info");
2985
+ const body = {
2986
+ name,
2987
+ number
2988
+ };
2989
+ if (email)
2990
+ body.email = email;
2991
+ if (birthDate)
2992
+ body.birthDate = birthDate;
2993
+ if (Array.isArray(extraInfo) && extraInfo.length > 0)
2994
+ body.extraInfo = extraInfo;
2995
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
2996
+ method: "POST",
2997
+ endpoint: "/contacts",
2998
+ body
2999
+ });
3000
+ }
3001
+ if (operation === "update") {
3002
+ const contactId = ctx.getNodeParameter("contactId", itemIndex);
3003
+ const name = ctx.getNodeParameter("contactNameUpdate", itemIndex);
3004
+ const number = ctx.getNodeParameter("contactNumberUpdate", itemIndex);
3005
+ const email = ctx.getNodeParameter("contactEmail", itemIndex);
3006
+ const birthDate = ctx.getNodeParameter("contactBirthDate", itemIndex);
3007
+ const extraInfoRaw = ctx.getNodeParameter("contactExtraInfo", itemIndex);
3008
+ const extraInfo = safeJsonParse(ctx, extraInfoRaw, "Extra info");
3009
+ const body = {};
3010
+ if (name)
3011
+ body.name = name;
3012
+ if (number)
3013
+ body.number = number;
3014
+ if (email)
3015
+ body.email = email;
3016
+ if (birthDate)
3017
+ body.birthDate = birthDate;
3018
+ if (Array.isArray(extraInfo) && extraInfo.length > 0)
3019
+ body.extraInfo = extraInfo;
3020
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3021
+ method: "PUT",
3022
+ endpoint: `/contacts/${contactId}`,
3023
+ body
3024
+ });
3025
+ }
3026
+ if (operation === "delete") {
3027
+ const contactId = ctx.getNodeParameter("contactId", itemIndex);
3028
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3029
+ method: "DELETE",
3030
+ endpoint: `/contacts/${contactId}`
3031
+ });
3032
+ }
3033
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de contatos nao suportada");
3034
+ };
3035
+ const executeTickets = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3036
+ if (operation === "list") {
3037
+ const pageNumber = ctx.getNodeParameter("ticketsPage", itemIndex);
3038
+ const status = ctx.getNodeParameter("ticketStatus", itemIndex);
3039
+ const searchParam = ctx.getNodeParameter("ticketsSearchParam", itemIndex);
3040
+ const queueIds = toIdArray(ctx, ctx.getNodeParameter("ticketsQueueIds", itemIndex), "Queue IDs");
3041
+ const tags = toIdArray(ctx, ctx.getNodeParameter("ticketsTagIds", itemIndex), "Tag IDs");
3042
+ const users = toIdArray(ctx, ctx.getNodeParameter("ticketsUserIds", itemIndex), "User IDs");
3043
+ const whatsapps = toIdArray(ctx, ctx.getNodeParameter("ticketsWhatsappIds", itemIndex), "Whatsapp IDs");
3044
+ const withUnreadMessages = ctx.getNodeParameter("ticketsWithUnread", itemIndex);
3045
+ const showAll = ctx.getNodeParameter("ticketsShowAll", itemIndex);
3046
+ const qs = {
3047
+ pageNumber,
3048
+ status: status || undefined,
3049
+ searchParam: searchParam || undefined,
3050
+ queueIds: queueIds.length ? JSON.stringify(queueIds) : undefined,
3051
+ tags: tags.length ? JSON.stringify(tags) : undefined,
3052
+ users: users.length ? JSON.stringify(users) : undefined,
3053
+ whatsapps: whatsapps.length ? JSON.stringify(whatsapps) : undefined,
3054
+ withUnreadMessages: withUnreadMessages ? true : undefined,
3055
+ showAll: showAll ? true : undefined
3056
+ };
3057
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3058
+ method: "GET",
3059
+ endpoint: "/tickets",
3060
+ qs
3061
+ });
3062
+ }
3063
+ if (operation === "count") {
3064
+ const queueIds = toIdArray(ctx, ctx.getNodeParameter("ticketsQueueIds", itemIndex), "Queue IDs");
3065
+ const showAll = ctx.getNodeParameter("ticketsShowAll", itemIndex);
3066
+ const qs = {
3067
+ queueIds: queueIds.length ? JSON.stringify(queueIds) : undefined,
3068
+ showAll: showAll ? true : undefined
3069
+ };
3070
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3071
+ method: "GET",
3072
+ endpoint: "/tickets/count",
3073
+ qs
3074
+ });
3075
+ }
3076
+ if (operation === "get") {
3077
+ const ticketId = ctx.getNodeParameter("ticketId", itemIndex);
3078
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3079
+ method: "GET",
3080
+ endpoint: `/tickets/${ticketId}`
3081
+ });
3082
+ }
3083
+ if (operation === "create") {
3084
+ const contactId = ctx.getNodeParameter("ticketContactId", itemIndex);
3085
+ const queueId = ctx.getNodeParameter("ticketQueueId", itemIndex);
3086
+ const userId = ctx.getNodeParameter("ticketUserId", itemIndex);
3087
+ const status = ctx.getNodeParameter("ticketStatus", itemIndex);
3088
+ const whatsappId = ctx.getNodeParameter("ticketWhatsappId", itemIndex);
3089
+ const body = {
3090
+ contactId,
3091
+ queueId,
3092
+ userId,
3093
+ status
3094
+ };
3095
+ if (whatsappId)
3096
+ body.whatsappId = whatsappId;
3097
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3098
+ method: "POST",
3099
+ endpoint: "/tickets",
3100
+ body
3101
+ });
3102
+ }
3103
+ if (operation === "update") {
3104
+ const ticketId = ctx.getNodeParameter("ticketId", itemIndex);
3105
+ const status = ctx.getNodeParameter("ticketStatus", itemIndex);
3106
+ const whatsappId = ctx.getNodeParameter("ticketWhatsappId", itemIndex);
3107
+ const sendFarewellMessage = ctx.getNodeParameter("ticketSendFarewell", itemIndex);
3108
+ const finalizadoComVenda = ctx.getNodeParameter("ticketFinalizadoComVenda", itemIndex);
3109
+ const motivoFinalizacao = ctx.getNodeParameter("ticketMotivoFinalizacao", itemIndex);
3110
+ const motivoNaoVenda = ctx.getNodeParameter("ticketMotivoNaoVenda", itemIndex);
3111
+ const valorVenda = ctx.getNodeParameter("ticketValorVenda", itemIndex);
3112
+ const extraRaw = ctx.getNodeParameter("ticketExtraJson", itemIndex);
3113
+ const extra = safeJsonParse(ctx, extraRaw, "Dados adicionais");
3114
+ const body = { ...extra };
3115
+ if (status)
3116
+ body.status = status;
3117
+ if (whatsappId)
3118
+ body.whatsappId = whatsappId;
3119
+ if (sendFarewellMessage)
3120
+ body.sendFarewellMessage = true;
3121
+ if (finalizadoComVenda)
3122
+ body.finalizadoComVenda = true;
3123
+ if (motivoFinalizacao)
3124
+ body.motivoFinalizacao = motivoFinalizacao;
3125
+ if (motivoNaoVenda)
3126
+ body.motivoNaoVenda = motivoNaoVenda;
3127
+ if (valorVenda)
3128
+ body.valorVenda = valorVenda;
3129
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3130
+ method: "PUT",
3131
+ endpoint: `/tickets/${ticketId}`,
3132
+ body
3133
+ });
3134
+ }
3135
+ if (operation === "delete") {
3136
+ const ticketId = ctx.getNodeParameter("ticketId", itemIndex);
3137
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3138
+ method: "DELETE",
3139
+ endpoint: `/tickets/${ticketId}`
3140
+ });
3141
+ }
3142
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de tickets nao suportada");
3143
+ };
3144
+ const executeMessages = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3145
+ if (operation === "list") {
3146
+ const ticketId = ctx.getNodeParameter("messageTicketId", itemIndex);
3147
+ const pageNumber = ctx.getNodeParameter("messagesPage", itemIndex);
3148
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3149
+ method: "GET",
3150
+ endpoint: `/messages/${ticketId}`,
3151
+ qs: { pageNumber }
3152
+ });
3153
+ }
3154
+ if (operation === "send") {
3155
+ const ticketId = ctx.getNodeParameter("messageTicketId", itemIndex);
3156
+ const body = ctx.getNodeParameter("messageBody", itemIndex);
3157
+ const isPrivate = ctx.getNodeParameter("messageIsPrivate", itemIndex);
3158
+ const quotedRaw = ctx.getNodeParameter("messageQuotedJson", itemIndex);
3159
+ const vcardRaw = ctx.getNodeParameter("messageVcardJson", itemIndex);
3160
+ const quotedMsg = safeJsonParse(ctx, quotedRaw, "QuotedMsg");
3161
+ const vCard = safeJsonParse(ctx, vcardRaw, "vCard");
3162
+ const payload = { body, isPrivate: isPrivate ? "true" : "false" };
3163
+ if (quotedRaw && quotedRaw !== "{}")
3164
+ payload.quotedMsg = quotedMsg;
3165
+ if (vcardRaw && vcardRaw !== "{}")
3166
+ payload.vCard = vCard;
3167
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3168
+ method: "POST",
3169
+ endpoint: `/messages/${ticketId}`,
3170
+ body: payload
3171
+ });
3172
+ }
3173
+ if (operation === "edit") {
3174
+ const messageId = ctx.getNodeParameter("messageId", itemIndex);
3175
+ const body = ctx.getNodeParameter("messageEditBody", itemIndex);
3176
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3177
+ method: "POST",
3178
+ endpoint: `/messages/edit/${messageId}`,
3179
+ body: { body }
3180
+ });
3181
+ }
3182
+ if (operation === "delete") {
3183
+ const messageId = ctx.getNodeParameter("messageId", itemIndex);
3184
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3185
+ method: "DELETE",
3186
+ endpoint: `/messages/${messageId}`
3187
+ });
3188
+ }
3189
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de mensagens nao suportada");
3190
+ };
3191
+ const executeInternalChat = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3192
+ if (operation === "list") {
3193
+ const pageNumber = ctx.getNodeParameter("chatPage", itemIndex);
3194
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3195
+ method: "GET",
3196
+ endpoint: "/chats",
3197
+ qs: { pageNumber }
3198
+ });
3199
+ }
3200
+ if (operation === "get") {
3201
+ const chatId = ctx.getNodeParameter("chatId", itemIndex);
3202
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3203
+ method: "GET",
3204
+ endpoint: `/chats/${chatId}`
3205
+ });
3206
+ }
3207
+ if (operation === "messages") {
3208
+ const chatId = ctx.getNodeParameter("chatId", itemIndex);
3209
+ const pageNumber = ctx.getNodeParameter("chatPage", itemIndex);
3210
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3211
+ method: "GET",
3212
+ endpoint: `/chats/${chatId}/messages`,
3213
+ qs: { pageNumber }
3214
+ });
3215
+ }
3216
+ if (operation === "send") {
3217
+ const chatId = ctx.getNodeParameter("chatId", itemIndex);
3218
+ const message = ctx.getNodeParameter("chatMessage", itemIndex);
3219
+ const replyToId = ctx.getNodeParameter("chatReplyToId", itemIndex);
3220
+ const body = { message };
3221
+ if (replyToId)
3222
+ body.replyToId = replyToId;
3223
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3224
+ method: "POST",
3225
+ endpoint: `/chats/${chatId}/messages`,
3226
+ body
3227
+ });
3228
+ }
3229
+ if (operation === "create") {
3230
+ const title = ctx.getNodeParameter("chatTitle", itemIndex);
3231
+ const description = ctx.getNodeParameter("chatDescription", itemIndex);
3232
+ const usersJson = ctx.getNodeParameter("chatUsersJson", itemIndex);
3233
+ const users = toUserObjects(ctx, usersJson, "Usuarios");
3234
+ const body = { title, users };
3235
+ if (description)
3236
+ body.description = description;
3237
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3238
+ method: "POST",
3239
+ endpoint: "/chats",
3240
+ body
3241
+ });
3242
+ }
3243
+ if (operation === "update") {
3244
+ const chatId = ctx.getNodeParameter("chatId", itemIndex);
3245
+ const title = ctx.getNodeParameter("chatTitle", itemIndex);
3246
+ const description = ctx.getNodeParameter("chatDescription", itemIndex);
3247
+ const usersJson = ctx.getNodeParameter("chatUsersJson", itemIndex);
3248
+ const body = {};
3249
+ if (title)
3250
+ body.title = title;
3251
+ if (description)
3252
+ body.description = description;
3253
+ if (usersJson && usersJson !== "[]")
3254
+ body.users = toUserObjects(ctx, usersJson, "Usuarios");
3255
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3256
+ method: "PUT",
3257
+ endpoint: `/chats/${chatId}`,
3258
+ body
3259
+ });
3260
+ }
3261
+ if (operation === "delete") {
3262
+ const chatId = ctx.getNodeParameter("chatId", itemIndex);
3263
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3264
+ method: "DELETE",
3265
+ endpoint: `/chats/${chatId}`
3266
+ });
3267
+ }
3268
+ if (operation === "read") {
3269
+ const chatId = ctx.getNodeParameter("chatId", itemIndex);
3270
+ const userId = ctx.getNodeParameter("chatReadUserId", itemIndex);
3271
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3272
+ method: "POST",
3273
+ endpoint: `/chats/${chatId}/read`,
3274
+ body: { userId }
3275
+ });
3276
+ }
3277
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de chat interno nao suportada");
3278
+ };
3279
+ const executeQuickMessages = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3280
+ if (operation === "list") {
3281
+ const pageNumber = ctx.getNodeParameter("quickMessagesPage", itemIndex);
3282
+ const searchParam = ctx.getNodeParameter("quickMessagesSearchParam", itemIndex);
3283
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3284
+ method: "GET",
3285
+ endpoint: "/quick-messages",
3286
+ qs: {
3287
+ pageNumber,
3288
+ searchParam: searchParam || undefined
3289
+ }
3290
+ });
3291
+ }
3292
+ if (operation === "get") {
3293
+ const id = ctx.getNodeParameter("quickMessageId", itemIndex);
3294
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3295
+ method: "GET",
3296
+ endpoint: `/quick-messages/${id}`
3297
+ });
3298
+ }
3299
+ if (operation === "create" || operation === "update") {
3300
+ const shortcode = ctx.getNodeParameter("quickMessageShortcode", itemIndex);
3301
+ const message = ctx.getNodeParameter("quickMessageMessage", itemIndex);
3302
+ const geral = ctx.getNodeParameter("quickMessageGeral", itemIndex);
3303
+ const isMedia = ctx.getNodeParameter("quickMessageIsMedia", itemIndex);
3304
+ const visao = ctx.getNodeParameter("quickMessageVisao", itemIndex);
3305
+ const isOficial = ctx.getNodeParameter("quickMessageIsOficial", itemIndex);
3306
+ const language = ctx.getNodeParameter("quickMessageLanguage", itemIndex);
3307
+ const status = ctx.getNodeParameter("quickMessageStatus", itemIndex);
3308
+ const category = ctx.getNodeParameter("quickMessageCategory", itemIndex);
3309
+ const metaID = ctx.getNodeParameter("quickMessageMetaId", itemIndex);
3310
+ const body = {
3311
+ shortcode,
3312
+ message,
3313
+ geral,
3314
+ isMedia,
3315
+ visao,
3316
+ isOficial
3317
+ };
3318
+ if (language)
3319
+ body.language = language;
3320
+ if (status)
3321
+ body.status = status;
3322
+ if (category)
3323
+ body.category = category;
3324
+ if (metaID)
3325
+ body.metaID = metaID;
3326
+ if (operation === "create") {
3327
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3328
+ method: "POST",
3329
+ endpoint: "/quick-messages",
3330
+ body
3331
+ });
3332
+ }
3333
+ const id = ctx.getNodeParameter("quickMessageId", itemIndex);
3334
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3335
+ method: "PUT",
3336
+ endpoint: `/quick-messages/${id}`,
3337
+ body
3338
+ });
3339
+ }
3340
+ if (operation === "delete") {
3341
+ const id = ctx.getNodeParameter("quickMessageId", itemIndex);
3342
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3343
+ method: "DELETE",
3344
+ endpoint: `/quick-messages/${id}`
3345
+ });
3346
+ }
3347
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de quick-messages nao suportada");
3348
+ };
3349
+ const executeSchedules = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3350
+ if (operation === "list") {
3351
+ const pageNumber = ctx.getNodeParameter("schedulesPage", itemIndex);
3352
+ const searchParam = ctx.getNodeParameter("schedulesSearchParam", itemIndex);
3353
+ const contactId = ctx.getNodeParameter("schedulesContactId", itemIndex);
3354
+ const userId = ctx.getNodeParameter("schedulesUserId", itemIndex);
3355
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3356
+ method: "GET",
3357
+ endpoint: "/schedules",
3358
+ qs: {
3359
+ pageNumber,
3360
+ searchParam: searchParam || undefined,
3361
+ contactId: contactId || undefined,
3362
+ userId: userId || undefined
3363
+ }
3364
+ });
3365
+ }
3366
+ if (operation === "get") {
3367
+ const id = ctx.getNodeParameter("scheduleId", itemIndex);
3368
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3369
+ method: "GET",
3370
+ endpoint: `/schedules/${id}`
3371
+ });
3372
+ }
3373
+ if (operation === "create") {
3374
+ const body = ctx.getNodeParameter("scheduleBody", itemIndex);
3375
+ const sendAt = ctx.getNodeParameter("scheduleSendAt", itemIndex);
3376
+ const contactId = ctx.getNodeParameter("scheduleContactId", itemIndex);
3377
+ const userId = ctx.getNodeParameter("scheduleUserId", itemIndex);
3378
+ const queueId = ctx.getNodeParameter("scheduleQueueId", itemIndex);
3379
+ const whatsappId = ctx.getNodeParameter("scheduleWhatsappId", itemIndex);
3380
+ const openTicket = ctx.getNodeParameter("scheduleOpenTicket", itemIndex);
3381
+ const statusTicket = ctx.getNodeParameter("scheduleStatusTicket", itemIndex);
3382
+ const reminderDate = ctx.getNodeParameter("scheduleReminderDate", itemIndex);
3383
+ const payload = {
3384
+ body,
3385
+ sendAt,
3386
+ contactId,
3387
+ userId,
3388
+ queueId,
3389
+ openTicket,
3390
+ statusTicket
3391
+ };
3392
+ if (whatsappId)
3393
+ payload.whatsappId = whatsappId;
3394
+ if (reminderDate)
3395
+ payload.reminderDate = reminderDate;
3396
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3397
+ method: "POST",
3398
+ endpoint: "/schedules",
3399
+ body: payload
3400
+ });
3401
+ }
3402
+ if (operation === "update") {
3403
+ const id = ctx.getNodeParameter("scheduleId", itemIndex);
3404
+ const extraRaw = ctx.getNodeParameter("scheduleExtraJson", itemIndex);
3405
+ const scheduleData = safeJsonParse(ctx, extraRaw, "Dados adicionais");
3406
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3407
+ method: "PUT",
3408
+ endpoint: `/schedules/${id}`,
3409
+ body: scheduleData
3410
+ });
3411
+ }
3412
+ if (operation === "delete") {
3413
+ const id = ctx.getNodeParameter("scheduleId", itemIndex);
3414
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3415
+ method: "DELETE",
3416
+ endpoint: `/schedules/${id}`
3417
+ });
3418
+ }
3419
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de schedules nao suportada");
3420
+ };
3421
+ const executeTags = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3422
+ if (operation === "list") {
3423
+ const pageNumber = ctx.getNodeParameter("tagsPage", itemIndex);
3424
+ const searchParam = ctx.getNodeParameter("tagsSearchParam", itemIndex);
3425
+ const kanban = ctx.getNodeParameter("tagKanban", itemIndex);
3426
+ const limit = ctx.getNodeParameter("tagsLimit", itemIndex);
3427
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3428
+ method: "GET",
3429
+ endpoint: "/tags",
3430
+ qs: {
3431
+ pageNumber,
3432
+ searchParam: searchParam || undefined,
3433
+ kanban: kanban || undefined,
3434
+ limit: limit || undefined
3435
+ }
3436
+ });
3437
+ }
3438
+ if (operation === "kanban") {
3439
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3440
+ method: "GET",
3441
+ endpoint: "/tag/kanban"
3442
+ });
3443
+ }
3444
+ if (operation === "get") {
3445
+ const id = ctx.getNodeParameter("tagId", itemIndex);
3446
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3447
+ method: "GET",
3448
+ endpoint: `/tags/${id}`
3449
+ });
3450
+ }
3451
+ if (operation === "create" || operation === "update") {
3452
+ const name = ctx.getNodeParameter("tagName", itemIndex);
3453
+ const color = ctx.getNodeParameter("tagColor", itemIndex);
3454
+ const kanban = ctx.getNodeParameter("tagKanban", itemIndex);
3455
+ const isPrivate = ctx.getNodeParameter("tagIsPrivate", itemIndex);
3456
+ const timeLane = ctx.getNodeParameter("tagTimeLane", itemIndex);
3457
+ const nextLaneId = ctx.getNodeParameter("tagNextLaneId", itemIndex);
3458
+ const rollbackLaneId = ctx.getNodeParameter("tagRollbackLaneId", itemIndex);
3459
+ const greetingMessageLane = ctx.getNodeParameter("tagGreetingMessageLane", itemIndex);
3460
+ const body = {
3461
+ name,
3462
+ color,
3463
+ kanban,
3464
+ isPrivate,
3465
+ timeLane,
3466
+ nextLaneId,
3467
+ rollbackLaneId,
3468
+ greetingMessageLane
3469
+ };
3470
+ if (operation === "create") {
3471
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3472
+ method: "POST",
3473
+ endpoint: "/tags",
3474
+ body
3475
+ });
3476
+ }
3477
+ const id = ctx.getNodeParameter("tagId", itemIndex);
3478
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3479
+ method: "PUT",
3480
+ endpoint: `/tags/${id}`,
3481
+ body
3482
+ });
3483
+ }
3484
+ if (operation === "delete") {
3485
+ const id = ctx.getNodeParameter("tagId", itemIndex);
3486
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3487
+ method: "DELETE",
3488
+ endpoint: `/tags/${id}`
3489
+ });
3490
+ }
3491
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de tags nao suportada");
3492
+ };
3493
+ const executeTodo = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3494
+ if (operation === "list") {
3495
+ const pageNumber = ctx.getNodeParameter("todoPage", itemIndex);
3496
+ const searchParam = ctx.getNodeParameter("todoSearchParam", itemIndex);
3497
+ const status = ctx.getNodeParameter("todoStatus", itemIndex);
3498
+ const priority = ctx.getNodeParameter("todoPriorityFilter", itemIndex);
3499
+ const all = ctx.getNodeParameter("todoAll", itemIndex);
3500
+ const userId = ctx.getNodeParameter("todoUserIdFilter", itemIndex);
3501
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3502
+ method: "GET",
3503
+ endpoint: "/todolist",
3504
+ qs: {
3505
+ pageNumber,
3506
+ searchParam: searchParam || undefined,
3507
+ status: status || undefined,
3508
+ priority: priority || undefined,
3509
+ all: all ? "true" : undefined,
3510
+ userId: userId || undefined
3511
+ }
3512
+ });
3513
+ }
3514
+ if (operation === "get") {
3515
+ const id = ctx.getNodeParameter("todoId", itemIndex);
3516
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3517
+ method: "GET",
3518
+ endpoint: `/todolist/${id}`
3519
+ });
3520
+ }
3521
+ if (operation === "create" || operation === "update") {
3522
+ const title = ctx.getNodeParameter("todoTitle", itemIndex);
3523
+ const description = ctx.getNodeParameter("todoDescription", itemIndex);
3524
+ const priority = ctx.getNodeParameter("todoPriority", itemIndex);
3525
+ const color = ctx.getNodeParameter("todoColor", itemIndex);
3526
+ const dueDate = ctx.getNodeParameter("todoDueDate", itemIndex);
3527
+ const reminderDate = ctx.getNodeParameter("todoReminderDate", itemIndex);
3528
+ const notificationMessage = ctx.getNodeParameter("todoNotificationMessage", itemIndex);
3529
+ const notifyOnComplete = ctx.getNodeParameter("todoNotifyOnComplete", itemIndex);
3530
+ const notifyBeforeDue = ctx.getNodeParameter("todoNotifyBeforeDue", itemIndex);
3531
+ const notifyBeforeDueMinutes = ctx.getNodeParameter("todoNotifyBeforeDueMinutes", itemIndex);
3532
+ const notifyRecipients = safeJsonParse(ctx, ctx.getNodeParameter("todoNotifyRecipientsJson", itemIndex), "Notify recipients");
3533
+ const items = safeJsonParse(ctx, ctx.getNodeParameter("todoItemsJson", itemIndex), "Items");
3534
+ const assignedUserId = ctx.getNodeParameter("todoAssignedUserId", itemIndex);
3535
+ const body = {
3536
+ title,
3537
+ description,
3538
+ priority,
3539
+ color,
3540
+ dueDate,
3541
+ reminderDate,
3542
+ notificationMessage,
3543
+ notifyOnComplete,
3544
+ notifyBeforeDue,
3545
+ notifyBeforeDueMinutes,
3546
+ notifyRecipients,
3547
+ items,
3548
+ assignedUserId
3549
+ };
3550
+ if (operation === "create") {
3551
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3552
+ method: "POST",
3553
+ endpoint: "/todolist",
3554
+ body
3555
+ });
3556
+ }
3557
+ const id = ctx.getNodeParameter("todoId", itemIndex);
3558
+ const extraRaw = ctx.getNodeParameter("todoUpdateJson", itemIndex);
3559
+ const extra = safeJsonParse(ctx, extraRaw, "Dados adicionais");
3560
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3561
+ method: "PUT",
3562
+ endpoint: `/todolist/${id}`,
3563
+ body: { ...body, ...extra }
3564
+ });
3565
+ }
3566
+ if (operation === "delete") {
3567
+ const id = ctx.getNodeParameter("todoId", itemIndex);
3568
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3569
+ method: "DELETE",
3570
+ endpoint: `/todolist/${id}`
3571
+ });
3572
+ }
3573
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de todo nao suportada");
3574
+ };
3575
+ const executeReports = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3576
+ const dateFrom = ctx.getNodeParameter("reportDateFrom", itemIndex);
3577
+ const dateTo = ctx.getNodeParameter("reportDateTo", itemIndex);
3578
+ if (operation === "ticketsReport") {
3579
+ const status = ctx.getNodeParameter("reportStatus", itemIndex);
3580
+ const contactId = ctx.getNodeParameter("reportContactId", itemIndex);
3581
+ const whatsappId = ctx.getNodeParameter("reportWhatsappId", itemIndex);
3582
+ const queueIds = toIdArray(ctx, ctx.getNodeParameter("reportQueueIds", itemIndex), "Queue IDs");
3583
+ const tagIds = toIdArray(ctx, ctx.getNodeParameter("reportTagIds", itemIndex), "Tag IDs");
3584
+ const userIds = toIdArray(ctx, ctx.getNodeParameter("reportUserIds", itemIndex), "User IDs");
3585
+ const page = ctx.getNodeParameter("reportPage", itemIndex);
3586
+ const pageSize = ctx.getNodeParameter("reportPageSize", itemIndex);
3587
+ const onlyRated = ctx.getNodeParameter("reportOnlyRated", itemIndex);
3588
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3589
+ method: "GET",
3590
+ endpoint: "/ticketreport/reports",
3591
+ qs: {
3592
+ dateFrom: dateFrom || undefined,
3593
+ dateTo: dateTo || undefined,
3594
+ status: status || undefined,
3595
+ contactId: contactId || undefined,
3596
+ whatsappId: whatsappId || undefined,
3597
+ queueIds: queueIds.length ? JSON.stringify(queueIds) : undefined,
3598
+ tags: tagIds.length ? JSON.stringify(tagIds) : undefined,
3599
+ users: userIds.length ? JSON.stringify(userIds) : undefined,
3600
+ page,
3601
+ pageSize,
3602
+ onlyRated: onlyRated ? true : undefined
3603
+ }
3604
+ });
3605
+ }
3606
+ if (operation === "salesReport") {
3607
+ const status = ctx.getNodeParameter("reportStatus", itemIndex);
3608
+ const userId = ctx.getNodeParameter("reportUserId", itemIndex);
3609
+ const page = ctx.getNodeParameter("reportPage", itemIndex);
3610
+ const pageSize = ctx.getNodeParameter("reportPageSize", itemIndex);
3611
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3612
+ method: "GET",
3613
+ endpoint: "/ticketreport/vendas",
3614
+ qs: {
3615
+ dateFrom: dateFrom || undefined,
3616
+ dateTo: dateTo || undefined,
3617
+ status: status || undefined,
3618
+ userId: userId || undefined,
3619
+ page,
3620
+ pageSize
3621
+ }
3622
+ });
3623
+ }
3624
+ if (operation === "ticketsUsers") {
3625
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3626
+ method: "GET",
3627
+ endpoint: "/dashboard/ticketsUsers",
3628
+ qs: {
3629
+ dateFrom: dateFrom || undefined,
3630
+ dateTo: dateTo || undefined
3631
+ }
3632
+ });
3633
+ }
3634
+ if (operation === "ticketsDay") {
3635
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3636
+ method: "GET",
3637
+ endpoint: "/dashboard/ticketsDay",
3638
+ qs: {
3639
+ dateFrom: dateFrom || undefined,
3640
+ dateTo: dateTo || undefined
3641
+ }
3642
+ });
3643
+ }
3644
+ if (operation === "contactsReport") {
3645
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3646
+ method: "GET",
3647
+ endpoint: "/contacts-report",
3648
+ qs: {
3649
+ dateFrom: dateFrom || undefined,
3650
+ dateTo: dateTo || undefined
3651
+ }
3652
+ });
3653
+ }
3654
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de relatorios nao suportada");
3655
+ };
3656
+ const executeMoments = async (ctx, _itemIndex, baseUrl, credentials, operation, licenseServer) => {
3657
+ if (operation === "dashboardMoments") {
3658
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3659
+ method: "GET",
3660
+ endpoint: "/dashboard/moments"
3661
+ });
3662
+ }
3663
+ if (operation === "usersMoments") {
3664
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3665
+ method: "GET",
3666
+ endpoint: "/usersMoments"
3667
+ });
3668
+ }
3669
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de moments nao suportada");
3670
+ };
3671
+ const executeUsers = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3672
+ if (operation === "list") {
3673
+ const pageNumber = ctx.getNodeParameter("usersPage", itemIndex);
3674
+ const searchParam = ctx.getNodeParameter("usersSearchParam", itemIndex);
3675
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3676
+ method: "GET",
3677
+ endpoint: "/users",
3678
+ qs: {
3679
+ pageNumber,
3680
+ searchParam: searchParam || undefined
3681
+ }
3682
+ });
3683
+ }
3684
+ if (operation === "get") {
3685
+ const id = ctx.getNodeParameter("userId", itemIndex);
3686
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3687
+ method: "GET",
3688
+ endpoint: `/users/${id}`
3689
+ });
3690
+ }
3691
+ if (operation === "create") {
3692
+ const body = {
3693
+ name: ctx.getNodeParameter("userName", itemIndex),
3694
+ email: ctx.getNodeParameter("userEmail", itemIndex),
3695
+ password: ctx.getNodeParameter("userPassword", itemIndex),
3696
+ profile: ctx.getNodeParameter("userProfile", itemIndex),
3697
+ phone: ctx.getNodeParameter("userPhone", itemIndex),
3698
+ companyId: ctx.getNodeParameter("userCompanyId", itemIndex),
3699
+ queueIds: toIdArray(ctx, ctx.getNodeParameter("userQueueIds", itemIndex), "Queue IDs"),
3700
+ startWork: ctx.getNodeParameter("userStartWork", itemIndex),
3701
+ endWork: ctx.getNodeParameter("userEndWork", itemIndex)
3702
+ };
3703
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3704
+ method: "POST",
3705
+ endpoint: "/users",
3706
+ body
3707
+ });
3708
+ }
3709
+ if (operation === "update") {
3710
+ const id = ctx.getNodeParameter("userId", itemIndex);
3711
+ const extraRaw = ctx.getNodeParameter("userExtraJson", itemIndex);
3712
+ const extra = safeJsonParse(ctx, extraRaw, "Dados adicionais");
3713
+ const body = {};
3714
+ const name = ctx.getNodeParameter("userName", itemIndex);
3715
+ const email = ctx.getNodeParameter("userEmail", itemIndex);
3716
+ const password = ctx.getNodeParameter("userPassword", itemIndex);
3717
+ const profile = ctx.getNodeParameter("userProfile", itemIndex);
3718
+ const phone = ctx.getNodeParameter("userPhone", itemIndex);
3719
+ const companyId = ctx.getNodeParameter("userCompanyId", itemIndex);
3720
+ const queueIds = toIdArray(ctx, ctx.getNodeParameter("userQueueIds", itemIndex), "Queue IDs");
3721
+ const startWork = ctx.getNodeParameter("userStartWork", itemIndex);
3722
+ const endWork = ctx.getNodeParameter("userEndWork", itemIndex);
3723
+ if (name)
3724
+ body.name = name;
3725
+ if (email)
3726
+ body.email = email;
3727
+ if (password)
3728
+ body.password = password;
3729
+ if (profile)
3730
+ body.profile = profile;
3731
+ if (phone)
3732
+ body.phone = phone;
3733
+ if (companyId)
3734
+ body.companyId = companyId;
3735
+ if (queueIds.length)
3736
+ body.queueIds = queueIds;
3737
+ if (startWork)
3738
+ body.startWork = startWork;
3739
+ if (endWork)
3740
+ body.endWork = endWork;
3741
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3742
+ method: "PUT",
3743
+ endpoint: `/users/${id}`,
3744
+ body: { ...body, ...extra }
3745
+ });
3746
+ }
3747
+ if (operation === "delete") {
3748
+ const id = ctx.getNodeParameter("userId", itemIndex);
3749
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3750
+ method: "DELETE",
3751
+ endpoint: `/users/${id}`
3752
+ });
3753
+ }
3754
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de users nao suportada");
3755
+ };
3756
+ const executeQueues = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3757
+ if (operation === "list") {
3758
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3759
+ method: "GET",
3760
+ endpoint: "/queue",
3761
+ qs: {}
3762
+ });
3763
+ }
3764
+ if (operation === "get") {
3765
+ const id = ctx.getNodeParameter("queueId", itemIndex);
3766
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3767
+ method: "GET",
3768
+ endpoint: `/queue/${id}`
3769
+ });
3770
+ }
3771
+ if (operation === "create" || operation === "update") {
3772
+ const body = {};
3773
+ const name = ctx.getNodeParameter("queueName", itemIndex);
3774
+ const color = ctx.getNodeParameter("queueColor", itemIndex);
3775
+ const greetingMessage = ctx.getNodeParameter("queueGreetingMessage", itemIndex);
3776
+ const outOfHoursMessage = ctx.getNodeParameter("queueOutOfHoursMessage", itemIndex);
3777
+ const orderQueue = ctx.getNodeParameter("queueOrder", itemIndex);
3778
+ const tempoRoteador = ctx.getNodeParameter("queueTempoRoteador", itemIndex);
3779
+ const ativarRoteador = ctx.getNodeParameter("queueAtivarRoteador", itemIndex);
3780
+ const integrationId = ctx.getNodeParameter("queueIntegrationId", itemIndex);
3781
+ const fileListId = ctx.getNodeParameter("queueFileListId", itemIndex);
3782
+ const closeTicket = ctx.getNodeParameter("queueCloseTicket", itemIndex);
3783
+ const randomizeImmediate = ctx.getNodeParameter("queueRandomizeImmediate", itemIndex);
3784
+ const schedules = safeJsonParse(ctx, ctx.getNodeParameter("queueSchedulesJson", itemIndex), "Schedules");
3785
+ const chatbots = safeJsonParse(ctx, ctx.getNodeParameter("queueChatbotsJson", itemIndex), "Chatbots");
3786
+ if (name)
3787
+ body.name = name;
3788
+ if (color)
3789
+ body.color = color;
3790
+ if (greetingMessage)
3791
+ body.greetingMessage = greetingMessage;
3792
+ if (outOfHoursMessage)
3793
+ body.outOfHoursMessage = outOfHoursMessage;
3794
+ if (orderQueue)
3795
+ body.orderQueue = orderQueue;
3796
+ if (tempoRoteador)
3797
+ body.tempoRoteador = tempoRoteador;
3798
+ if (ativarRoteador)
3799
+ body.ativarRoteador = ativarRoteador;
3800
+ if (integrationId)
3801
+ body.integrationId = integrationId;
3802
+ if (fileListId)
3803
+ body.fileListId = fileListId;
3804
+ if (closeTicket)
3805
+ body.closeTicket = closeTicket;
3806
+ if (randomizeImmediate)
3807
+ body.randomizeImmediate = randomizeImmediate;
3808
+ if (Array.isArray(schedules) && schedules.length)
3809
+ body.schedules = schedules;
3810
+ if (Array.isArray(chatbots) && chatbots.length)
3811
+ body.chatbots = chatbots;
3812
+ if (operation === "create") {
3813
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3814
+ method: "POST",
3815
+ endpoint: "/queue",
3816
+ body
3817
+ });
3818
+ }
3819
+ const id = ctx.getNodeParameter("queueId", itemIndex);
3820
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3821
+ method: "PUT",
3822
+ endpoint: `/queue/${id}`,
3823
+ body
3824
+ });
3825
+ }
3826
+ if (operation === "delete") {
3827
+ const id = ctx.getNodeParameter("queueId", itemIndex);
3828
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3829
+ method: "DELETE",
3830
+ endpoint: `/queue/${id}`
3831
+ });
3832
+ }
3833
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de queues nao suportada");
3834
+ };
3835
+ const executeKanban = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3836
+ if (operation === "ticketKanban") {
3837
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3838
+ method: "GET",
3839
+ endpoint: "/ticket/kanban"
3840
+ });
3841
+ }
3842
+ if (operation === "tagKanban") {
3843
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3844
+ method: "GET",
3845
+ endpoint: "/tag/kanban"
3846
+ });
3847
+ }
3848
+ if (operation === "companyLaneGet") {
3849
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3850
+ method: "GET",
3851
+ endpoint: "/company-kanban/lane-order"
3852
+ });
3853
+ }
3854
+ if (operation === "companyLaneSet") {
3855
+ const laneOrder = safeJsonParse(ctx, ctx.getNodeParameter("kanbanLaneOrder", itemIndex), "Lane order");
3856
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3857
+ method: "POST",
3858
+ endpoint: "/company-kanban/lane-order",
3859
+ body: { laneOrder }
3860
+ });
3861
+ }
3862
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de kanban nao suportada");
3863
+ };
3864
+ const executeCompanies = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3865
+ const companyId = ctx.getNodeParameter("companyId", itemIndex);
3866
+ if (operation === "list") {
3867
+ const pageNumber = ctx.getNodeParameter("companiesPage", itemIndex);
3868
+ const searchParam = ctx.getNodeParameter("companiesSearchParam", itemIndex);
3869
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3870
+ method: "GET",
3871
+ endpoint: "/companies",
3872
+ qs: {
3873
+ pageNumber,
3874
+ searchParam: searchParam || undefined
3875
+ }
3876
+ });
3877
+ }
3878
+ if (operation === "get") {
3879
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3880
+ method: "GET",
3881
+ endpoint: `/companies/${companyId}`
3882
+ });
3883
+ }
3884
+ if (operation === "create") {
3885
+ const body = {
3886
+ name: ctx.getNodeParameter("companyName", itemIndex),
3887
+ password: ctx.getNodeParameter("companyPassword", itemIndex)
3888
+ };
3889
+ const email = ctx.getNodeParameter("companyEmail", itemIndex);
3890
+ const phone = ctx.getNodeParameter("companyPhone", itemIndex);
3891
+ const planId = ctx.getNodeParameter("companyPlanId", itemIndex);
3892
+ const status = ctx.getNodeParameter("companyStatus", itemIndex);
3893
+ const dueDate = ctx.getNodeParameter("companyDueDate", itemIndex);
3894
+ const recurrence = ctx.getNodeParameter("companyRecurrence", itemIndex);
3895
+ const document = ctx.getNodeParameter("companyDocument", itemIndex);
3896
+ const paymentMethod = ctx.getNodeParameter("companyPaymentMethod", itemIndex);
3897
+ const campaignsEnabled = ctx.getNodeParameter("companyCampaignsEnabled", itemIndex);
3898
+ if (email)
3899
+ body.email = email;
3900
+ if (phone)
3901
+ body.phone = phone;
3902
+ if (planId)
3903
+ body.planId = planId;
3904
+ body.status = status;
3905
+ if (dueDate)
3906
+ body.dueDate = dueDate;
3907
+ if (recurrence)
3908
+ body.recurrence = recurrence;
3909
+ if (document)
3910
+ body.document = document;
3911
+ if (paymentMethod)
3912
+ body.paymentMethod = paymentMethod;
3913
+ if (campaignsEnabled)
3914
+ body.campaignsEnabled = campaignsEnabled;
3915
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3916
+ method: "POST",
3917
+ endpoint: "/companies",
3918
+ body
3919
+ });
3920
+ }
3921
+ if (operation === "update") {
3922
+ const body = {};
3923
+ const name = ctx.getNodeParameter("companyName", itemIndex);
3924
+ const email = ctx.getNodeParameter("companyEmail", itemIndex);
3925
+ const phone = ctx.getNodeParameter("companyPhone", itemIndex);
3926
+ const password = ctx.getNodeParameter("companyPassword", itemIndex);
3927
+ const planId = ctx.getNodeParameter("companyPlanId", itemIndex);
3928
+ const status = ctx.getNodeParameter("companyStatus", itemIndex);
3929
+ const dueDate = ctx.getNodeParameter("companyDueDate", itemIndex);
3930
+ const recurrence = ctx.getNodeParameter("companyRecurrence", itemIndex);
3931
+ const document = ctx.getNodeParameter("companyDocument", itemIndex);
3932
+ const paymentMethod = ctx.getNodeParameter("companyPaymentMethod", itemIndex);
3933
+ const campaignsEnabled = ctx.getNodeParameter("companyCampaignsEnabled", itemIndex);
3934
+ if (name)
3935
+ body.name = name;
3936
+ if (email)
3937
+ body.email = email;
3938
+ if (phone)
3939
+ body.phone = phone;
3940
+ if (password)
3941
+ body.password = password;
3942
+ if (planId)
3943
+ body.planId = planId;
3944
+ body.status = status;
3945
+ if (dueDate)
3946
+ body.dueDate = dueDate;
3947
+ if (recurrence)
3948
+ body.recurrence = recurrence;
3949
+ if (document)
3950
+ body.document = document;
3951
+ if (paymentMethod)
3952
+ body.paymentMethod = paymentMethod;
3953
+ if (campaignsEnabled)
3954
+ body.campaignsEnabled = campaignsEnabled;
3955
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3956
+ method: "PUT",
3957
+ endpoint: `/companies/${companyId}`,
3958
+ body
3959
+ });
3960
+ }
3961
+ if (operation === "delete") {
3962
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3963
+ method: "DELETE",
3964
+ endpoint: `/companies/${companyId}`
3965
+ });
3966
+ }
3967
+ if (operation === "connections") {
3968
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3969
+ method: "GET",
3970
+ endpoint: `/companies/${companyId}/connections`
3971
+ });
3972
+ }
3973
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de companies nao suportada");
3974
+ };
3975
+ const executeInvoices = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
3976
+ if (operation === "list") {
3977
+ const pageNumber = ctx.getNodeParameter("invoicesPage", itemIndex);
3978
+ const searchParam = ctx.getNodeParameter("invoicesSearchParam", itemIndex);
3979
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3980
+ method: "GET",
3981
+ endpoint: "/invoices",
3982
+ qs: {
3983
+ pageNumber,
3984
+ searchParam: searchParam || undefined
3985
+ }
3986
+ });
3987
+ }
3988
+ if (operation === "get") {
3989
+ const id = ctx.getNodeParameter("invoiceId", itemIndex);
3990
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3991
+ method: "GET",
3992
+ endpoint: `/invoices/${id}`
3993
+ });
3994
+ }
3995
+ if (operation === "update") {
3996
+ const id = ctx.getNodeParameter("invoiceId", itemIndex);
3997
+ const status = ctx.getNodeParameter("invoiceStatus", itemIndex);
3998
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
3999
+ method: "PUT",
4000
+ endpoint: `/invoices/${id}`,
4001
+ body: { id, status }
4002
+ });
4003
+ }
4004
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de invoices nao suportada");
4005
+ };
4006
+ const executeConnections = async (ctx, itemIndex, baseUrl, credentials, operation, licenseServer) => {
4007
+ if (operation === "list") {
4008
+ const session = ctx.getNodeParameter("connectionSession", itemIndex);
4009
+ const channel = ctx.getNodeParameter("connectionFilterChannel", itemIndex);
4010
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
4011
+ method: "GET",
4012
+ endpoint: channel ? "/whatsapp/filter" : "/whatsapp/",
4013
+ qs: {
4014
+ session: session || undefined,
4015
+ channel: channel || undefined
4016
+ }
4017
+ });
4018
+ }
4019
+ if (operation === "get") {
4020
+ const id = ctx.getNodeParameter("connectionId", itemIndex);
4021
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
4022
+ method: "GET",
4023
+ endpoint: `/whatsapp/${id}`
4024
+ });
4025
+ }
4026
+ if (operation === "create" || operation === "update") {
4027
+ const name = ctx.getNodeParameter("connectionName", itemIndex);
4028
+ const channel = ctx.getNodeParameter("connectionChannel", itemIndex);
4029
+ const isDefault = ctx.getNodeParameter("connectionIsDefault", itemIndex);
4030
+ const queueIds = toIdArray(ctx, ctx.getNodeParameter("connectionQueueIds", itemIndex), "Queue IDs");
4031
+ const greetingMessage = ctx.getNodeParameter("connectionGreetingMessage", itemIndex);
4032
+ const outOfHoursMessage = ctx.getNodeParameter("connectionOutOfHoursMessage", itemIndex);
4033
+ const token = ctx.getNodeParameter("connectionToken", itemIndex);
4034
+ const send_token = ctx.getNodeParameter("connectionSendToken", itemIndex);
4035
+ const phone_number_id = ctx.getNodeParameter("connectionPhoneNumberId", itemIndex);
4036
+ const waba_id = ctx.getNodeParameter("connectionWabaId", itemIndex);
4037
+ const business_id = ctx.getNodeParameter("connectionBusinessId", itemIndex);
4038
+ const phone_number = ctx.getNodeParameter("connectionPhoneNumber", itemIndex);
4039
+ const waba_webhook = ctx.getNodeParameter("connectionWabaWebhook", itemIndex);
4040
+ const color = ctx.getNodeParameter("connectionColor", itemIndex);
4041
+ const body = {};
4042
+ if (name)
4043
+ body.name = name;
4044
+ if (channel)
4045
+ body.channel = channel;
4046
+ if (isDefault)
4047
+ body.isDefault = isDefault;
4048
+ if (queueIds.length)
4049
+ body.queueIds = queueIds;
4050
+ if (greetingMessage)
4051
+ body.greetingMessage = greetingMessage;
4052
+ if (outOfHoursMessage)
4053
+ body.outOfHoursMessage = outOfHoursMessage;
4054
+ if (token)
4055
+ body.token = token;
4056
+ if (send_token)
4057
+ body.send_token = send_token;
4058
+ if (phone_number_id)
4059
+ body.phone_number_id = phone_number_id;
4060
+ if (waba_id)
4061
+ body.waba_id = waba_id;
4062
+ if (business_id)
4063
+ body.business_id = business_id;
4064
+ if (phone_number)
4065
+ body.phone_number = phone_number;
4066
+ if (waba_webhook)
4067
+ body.waba_webhook = waba_webhook;
4068
+ if (color)
4069
+ body.color = color;
4070
+ if (operation === "create") {
4071
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
4072
+ method: "POST",
4073
+ endpoint: "/whatsapp/",
4074
+ body
4075
+ });
4076
+ }
4077
+ const id = ctx.getNodeParameter("connectionId", itemIndex);
4078
+ const extraRaw = ctx.getNodeParameter("connectionExtraJson", itemIndex);
4079
+ const extra = safeJsonParse(ctx, extraRaw, "Dados adicionais");
4080
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
4081
+ method: "PUT",
4082
+ endpoint: `/whatsapp/${id}`,
4083
+ body: { ...body, ...extra }
4084
+ });
4085
+ }
4086
+ if (operation === "delete") {
4087
+ const id = ctx.getNodeParameter("connectionId", itemIndex);
4088
+ return makeRequest(ctx, baseUrl, credentials, licenseServer, {
4089
+ method: "DELETE",
4090
+ endpoint: `/whatsapp/${id}`
4091
+ });
4092
+ }
4093
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Operacao de conexoes nao suportada");
4094
+ };
4095
+ const makeRequest = async (ctx, baseUrl, credentials, licenseServer, opts) => {
4096
+ const n8nUrl = String(credentials.n8nUrl || "").trim();
4097
+ const licenseToken = String(credentials.licenseToken || "").trim();
4098
+ if (licenseServer) {
4099
+ const proxyOptions = {
4100
+ method: "POST",
4101
+ uri: `${licenseServer.replace(/\/$/, "")}/api/execute`,
4102
+ headers: licenseToken ? { Authorization: `Bearer ${licenseToken}` } : {},
4103
+ body: {
4104
+ method: opts.method,
4105
+ endpoint: opts.endpoint,
4106
+ query: opts.qs || {},
4107
+ body: opts.body || {},
4108
+ whaticketHost: baseUrl,
4109
+ whaticketEmail: String(credentials.username),
4110
+ whaticketPassword: String(credentials.password),
4111
+ n8nUrl
4112
+ },
4113
+ json: true
4114
+ };
4115
+ try {
4116
+ const response = await ctx.helpers.request(proxyOptions);
4117
+ return response.data !== undefined ? response.data : response;
4118
+ }
4119
+ catch (error) {
4120
+ throw new n8n_workflow_1.NodeApiError(ctx.getNode(), error);
4121
+ }
4122
+ }
4123
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), "Servidor de licencas nao configurado");
4124
+ };