n8n-nodes-digitalsac 0.4.0 → 0.4.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.
package/README.md
CHANGED
|
@@ -384,13 +384,25 @@ Cria um novo agendamento no sistema.
|
|
|
384
384
|
- **Nome do Contato**: Nome do cliente
|
|
385
385
|
- **Telefone do Contato**: Telefone do cliente (formato: 5511999999999)
|
|
386
386
|
- **Observações** (opcional): Notas sobre o agendamento
|
|
387
|
+
- **ID da Conexão WhatsApp** (opcional): ID da conexão WhatsApp (usa primeira disponível se não informado)
|
|
388
|
+
- **Mensagem Personalizada** (opcional): Mensagem personalizada do agendamento
|
|
389
|
+
- **Lembretes (minutos)**: Lembretes em minutos antes do agendamento (separados por vírgula, ex: 60,240,1440)
|
|
390
|
+
- **Duração do Intervalo (minutos)**: Duração do intervalo em minutos (padrão: 30)
|
|
391
|
+
- **Fechar Ticket**: Se deve fechar o ticket após criar agendamento
|
|
392
|
+
|
|
393
|
+
**Observações importantes:**
|
|
394
|
+
- Se o contato não existir no sistema, ele será criado automaticamente
|
|
395
|
+
- Se não informar conexão WhatsApp, será usada a primeira disponível
|
|
396
|
+
- Os lembretes são em minutos (60 = 1 hora, 240 = 4 horas, 1440 = 1 dia)
|
|
387
397
|
|
|
388
398
|
**Retorno exemplo:**
|
|
389
399
|
```json
|
|
390
400
|
{
|
|
391
|
-
"status":
|
|
401
|
+
"status": 1,
|
|
392
402
|
"mensagem": "Agendamento criado com sucesso",
|
|
393
|
-
"scheduleId": 123
|
|
403
|
+
"scheduleId": 123,
|
|
404
|
+
"contactId": 456,
|
|
405
|
+
"whatsappId": 789
|
|
394
406
|
}
|
|
395
407
|
```
|
|
396
408
|
|
|
@@ -320,6 +320,67 @@ class Digitalsac {
|
|
|
320
320
|
},
|
|
321
321
|
description: 'Observações sobre o agendamento (opcional)',
|
|
322
322
|
},
|
|
323
|
+
{
|
|
324
|
+
displayName: 'ID da Conexão WhatsApp',
|
|
325
|
+
name: 'whatsappId',
|
|
326
|
+
type: 'number',
|
|
327
|
+
default: 0,
|
|
328
|
+
displayOptions: {
|
|
329
|
+
show: {
|
|
330
|
+
operation: ['createSchedule'],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
description: 'ID da conexão WhatsApp (opcional - usa primeira disponível se não informado)',
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
displayName: 'Mensagem Personalizada',
|
|
337
|
+
name: 'customMessage',
|
|
338
|
+
type: 'string',
|
|
339
|
+
default: '',
|
|
340
|
+
displayOptions: {
|
|
341
|
+
show: {
|
|
342
|
+
operation: ['createSchedule'],
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
description: 'Mensagem personalizada do agendamento (opcional)',
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
displayName: 'Lembretes (minutos)',
|
|
349
|
+
name: 'reminders',
|
|
350
|
+
type: 'string',
|
|
351
|
+
default: '60,240',
|
|
352
|
+
placeholder: '60,240,1440',
|
|
353
|
+
displayOptions: {
|
|
354
|
+
show: {
|
|
355
|
+
operation: ['createSchedule'],
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
description: 'Lembretes em minutos antes do agendamento (separados por vírgula)',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
displayName: 'Duração do Intervalo (minutos)',
|
|
362
|
+
name: 'intervalDuration',
|
|
363
|
+
type: 'number',
|
|
364
|
+
default: 30,
|
|
365
|
+
displayOptions: {
|
|
366
|
+
show: {
|
|
367
|
+
operation: ['createSchedule'],
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
description: 'Duração do intervalo em minutos',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
displayName: 'Fechar Ticket',
|
|
374
|
+
name: 'closeTicket',
|
|
375
|
+
type: 'boolean',
|
|
376
|
+
default: false,
|
|
377
|
+
displayOptions: {
|
|
378
|
+
show: {
|
|
379
|
+
operation: ['createSchedule'],
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
description: 'Se deve fechar o ticket após criar agendamento',
|
|
383
|
+
},
|
|
323
384
|
{
|
|
324
385
|
displayName: 'ID do Agendamento',
|
|
325
386
|
name: 'scheduleId',
|
|
@@ -627,6 +688,13 @@ class Digitalsac {
|
|
|
627
688
|
const contactNameForCreate = this.getNodeParameter('contactName', i);
|
|
628
689
|
const contactPhoneForCreate = this.getNodeParameter('contactPhone', i);
|
|
629
690
|
const notesForCreate = this.getNodeParameter('scheduleNotes', i);
|
|
691
|
+
const whatsappIdForCreate = this.getNodeParameter('whatsappId', i);
|
|
692
|
+
const customMessageForCreate = this.getNodeParameter('customMessage', i);
|
|
693
|
+
const remindersForCreate = this.getNodeParameter('reminders', i);
|
|
694
|
+
const intervalDurationForCreate = this.getNodeParameter('intervalDuration', i);
|
|
695
|
+
const closeTicketForCreate = this.getNodeParameter('closeTicket', i);
|
|
696
|
+
// Converter string de lembretes para array
|
|
697
|
+
const remindersArray = remindersForCreate ? remindersForCreate.split(',').map(r => parseInt(r.trim())) : [60, 240];
|
|
630
698
|
body = {
|
|
631
699
|
serviceId: serviceIdForCreate,
|
|
632
700
|
userId: userIdForCreate,
|
|
@@ -634,7 +702,12 @@ class Digitalsac {
|
|
|
634
702
|
time: timeForCreate,
|
|
635
703
|
contactName: contactNameForCreate,
|
|
636
704
|
contactPhone: contactPhoneForCreate,
|
|
637
|
-
notes: notesForCreate
|
|
705
|
+
notes: notesForCreate,
|
|
706
|
+
whatsappId: whatsappIdForCreate > 0 ? whatsappIdForCreate : undefined,
|
|
707
|
+
message: customMessageForCreate || undefined,
|
|
708
|
+
reminders: remindersArray,
|
|
709
|
+
intervalDuration: intervalDurationForCreate,
|
|
710
|
+
closeTicket: closeTicketForCreate
|
|
638
711
|
};
|
|
639
712
|
headers['Content-Type'] = 'application/json';
|
|
640
713
|
options = {
|
|
@@ -327,6 +327,67 @@ export class Digitalsac implements INodeType {
|
|
|
327
327
|
},
|
|
328
328
|
description: 'Observações sobre o agendamento (opcional)',
|
|
329
329
|
},
|
|
330
|
+
{
|
|
331
|
+
displayName: 'ID da Conexão WhatsApp',
|
|
332
|
+
name: 'whatsappId',
|
|
333
|
+
type: 'number',
|
|
334
|
+
default: 0,
|
|
335
|
+
displayOptions: {
|
|
336
|
+
show: {
|
|
337
|
+
operation: ['createSchedule'],
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
description: 'ID da conexão WhatsApp (opcional - usa primeira disponível se não informado)',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
displayName: 'Mensagem Personalizada',
|
|
344
|
+
name: 'customMessage',
|
|
345
|
+
type: 'string',
|
|
346
|
+
default: '',
|
|
347
|
+
displayOptions: {
|
|
348
|
+
show: {
|
|
349
|
+
operation: ['createSchedule'],
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
description: 'Mensagem personalizada do agendamento (opcional)',
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
displayName: 'Lembretes (minutos)',
|
|
356
|
+
name: 'reminders',
|
|
357
|
+
type: 'string',
|
|
358
|
+
default: '60,240',
|
|
359
|
+
placeholder: '60,240,1440',
|
|
360
|
+
displayOptions: {
|
|
361
|
+
show: {
|
|
362
|
+
operation: ['createSchedule'],
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
description: 'Lembretes em minutos antes do agendamento (separados por vírgula)',
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
displayName: 'Duração do Intervalo (minutos)',
|
|
369
|
+
name: 'intervalDuration',
|
|
370
|
+
type: 'number',
|
|
371
|
+
default: 30,
|
|
372
|
+
displayOptions: {
|
|
373
|
+
show: {
|
|
374
|
+
operation: ['createSchedule'],
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
description: 'Duração do intervalo em minutos',
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
displayName: 'Fechar Ticket',
|
|
381
|
+
name: 'closeTicket',
|
|
382
|
+
type: 'boolean',
|
|
383
|
+
default: false,
|
|
384
|
+
displayOptions: {
|
|
385
|
+
show: {
|
|
386
|
+
operation: ['createSchedule'],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
description: 'Se deve fechar o ticket após criar agendamento',
|
|
390
|
+
},
|
|
330
391
|
{
|
|
331
392
|
displayName: 'ID do Agendamento',
|
|
332
393
|
name: 'scheduleId',
|
|
@@ -648,6 +709,14 @@ export class Digitalsac implements INodeType {
|
|
|
648
709
|
const contactNameForCreate = this.getNodeParameter('contactName', i) as string;
|
|
649
710
|
const contactPhoneForCreate = this.getNodeParameter('contactPhone', i) as string;
|
|
650
711
|
const notesForCreate = this.getNodeParameter('scheduleNotes', i) as string;
|
|
712
|
+
const whatsappIdForCreate = this.getNodeParameter('whatsappId', i) as number;
|
|
713
|
+
const customMessageForCreate = this.getNodeParameter('customMessage', i) as string;
|
|
714
|
+
const remindersForCreate = this.getNodeParameter('reminders', i) as string;
|
|
715
|
+
const intervalDurationForCreate = this.getNodeParameter('intervalDuration', i) as number;
|
|
716
|
+
const closeTicketForCreate = this.getNodeParameter('closeTicket', i) as boolean;
|
|
717
|
+
|
|
718
|
+
// Converter string de lembretes para array
|
|
719
|
+
const remindersArray = remindersForCreate ? remindersForCreate.split(',').map(r => parseInt(r.trim())) : [60, 240];
|
|
651
720
|
|
|
652
721
|
body = {
|
|
653
722
|
serviceId: serviceIdForCreate,
|
|
@@ -656,7 +725,12 @@ export class Digitalsac implements INodeType {
|
|
|
656
725
|
time: timeForCreate,
|
|
657
726
|
contactName: contactNameForCreate,
|
|
658
727
|
contactPhone: contactPhoneForCreate,
|
|
659
|
-
notes: notesForCreate
|
|
728
|
+
notes: notesForCreate,
|
|
729
|
+
whatsappId: whatsappIdForCreate > 0 ? whatsappIdForCreate : undefined,
|
|
730
|
+
message: customMessageForCreate || undefined,
|
|
731
|
+
reminders: remindersArray,
|
|
732
|
+
intervalDuration: intervalDurationForCreate,
|
|
733
|
+
closeTicket: closeTicketForCreate
|
|
660
734
|
};
|
|
661
735
|
|
|
662
736
|
headers['Content-Type'] = 'application/json';
|