@wondai/n8n-nodes-nucleo 0.5.6 → 0.6.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/dist/nodes/Nucleo/Nucleo.node.js +387 -1
- package/package.json +3 -2
|
@@ -181,6 +181,11 @@ class Nucleo {
|
|
|
181
181
|
{ name: "Conversa", value: "conversa" },
|
|
182
182
|
{ name: "Contexto", value: "contexto" },
|
|
183
183
|
{ name: "Telemetria", value: "telemetria" },
|
|
184
|
+
// --- odonto (ADR-036/038): resources próprios do vertical; server roteia pelo token ---
|
|
185
|
+
{ name: "Paciente", value: "paciente" },
|
|
186
|
+
{ name: "Procedimento", value: "procedimento" },
|
|
187
|
+
{ name: "Agenda", value: "agenda" },
|
|
188
|
+
{ name: "Agendamento", value: "agendamento" },
|
|
184
189
|
],
|
|
185
190
|
default: "catalogo",
|
|
186
191
|
},
|
|
@@ -322,6 +327,82 @@ class Nucleo {
|
|
|
322
327
|
],
|
|
323
328
|
default: "enviar",
|
|
324
329
|
},
|
|
330
|
+
{
|
|
331
|
+
displayName: "Operação",
|
|
332
|
+
name: "operation",
|
|
333
|
+
type: "options",
|
|
334
|
+
noDataExpression: true,
|
|
335
|
+
displayOptions: { show: { resource: ["paciente"] } },
|
|
336
|
+
options: [
|
|
337
|
+
{
|
|
338
|
+
name: "Buscar",
|
|
339
|
+
value: "buscar",
|
|
340
|
+
action: "Buscar paciente por telefone",
|
|
341
|
+
description: "Lookup do paciente (cliente + dados clínicos) + agendamentos recentes",
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
default: "buscar",
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
displayName: "Operação",
|
|
348
|
+
name: "operation",
|
|
349
|
+
type: "options",
|
|
350
|
+
noDataExpression: true,
|
|
351
|
+
displayOptions: { show: { resource: ["procedimento"] } },
|
|
352
|
+
options: [
|
|
353
|
+
{
|
|
354
|
+
name: "Resolver",
|
|
355
|
+
value: "resolver",
|
|
356
|
+
action: "Resolver procedimentos por nome",
|
|
357
|
+
description: "Busca vários procedimentos numa chamada, tolera erro de digitação e apelidos e devolve id, duração e preço (status achou/ambiguo/nao_encontrado)",
|
|
358
|
+
},
|
|
359
|
+
],
|
|
360
|
+
default: "resolver",
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
displayName: "Operação",
|
|
364
|
+
name: "operation",
|
|
365
|
+
type: "options",
|
|
366
|
+
noDataExpression: true,
|
|
367
|
+
displayOptions: { show: { resource: ["agenda"] } },
|
|
368
|
+
options: [
|
|
369
|
+
{
|
|
370
|
+
name: "Consultar",
|
|
371
|
+
value: "consultar",
|
|
372
|
+
action: "Consultar horários livres numa data",
|
|
373
|
+
description: "Horários livres por profissional numa data (horário publicado − ocupado). Sem config do dia ⇒ unknown honesto",
|
|
374
|
+
},
|
|
375
|
+
],
|
|
376
|
+
default: "consultar",
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: "Operação",
|
|
380
|
+
name: "operation",
|
|
381
|
+
type: "options",
|
|
382
|
+
noDataExpression: true,
|
|
383
|
+
displayOptions: { show: { resource: ["agendamento"] } },
|
|
384
|
+
options: [
|
|
385
|
+
{
|
|
386
|
+
name: "Criar",
|
|
387
|
+
value: "criar",
|
|
388
|
+
action: "Criar agendamento",
|
|
389
|
+
description: "Marca um horário (idempotente). Overlap do profissional ⇒ 409",
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: "Alterar",
|
|
393
|
+
value: "alterar",
|
|
394
|
+
action: "Alterar agendamento",
|
|
395
|
+
description: "Remarca / troca procedimento ou profissional / observação / status (idempotente). Transição inválida ⇒ 409",
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: "Cancelar",
|
|
399
|
+
value: "cancelar",
|
|
400
|
+
action: "Cancelar agendamento",
|
|
401
|
+
description: "Cancela o agendamento (idempotente). Libera o horário",
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
default: "criar",
|
|
405
|
+
},
|
|
325
406
|
// ----------------------------------------------------------------- cliente:buscar
|
|
326
407
|
{
|
|
327
408
|
displayName: "Telefone",
|
|
@@ -345,6 +426,15 @@ class Nucleo {
|
|
|
345
426
|
description: "Produtos a buscar: um por linha ou separados por vírgula (máx 10). Aceita erro de digitação, falta de acento e apelidos. Para produto configurável, use regras_compra como fonte da verdade e colete todas as opções obrigatórias antes de criar o pedido.",
|
|
346
427
|
displayOptions: { show: { resource: ["catalogo"], operation: ["resolver"] } },
|
|
347
428
|
},
|
|
429
|
+
{
|
|
430
|
+
displayName: "Continuacao Cursor",
|
|
431
|
+
name: "continuacaoCursor",
|
|
432
|
+
type: "string",
|
|
433
|
+
default: "",
|
|
434
|
+
required: false,
|
|
435
|
+
description: "Cursor opaco retornado por resultados[].continuacao.cursor. Use somente quando o cliente pedir a proxima pagina da mesma lista ('mostrar os outros', 'mais sabores'). Se informado, vence Consultas.",
|
|
436
|
+
displayOptions: { show: { resource: ["catalogo"], operation: ["resolver"] } },
|
|
437
|
+
},
|
|
348
438
|
// ----------------------------------------------------------------- catalogo:disponibilidadeRede
|
|
349
439
|
{
|
|
350
440
|
displayName: "Produto (ID)",
|
|
@@ -854,6 +944,211 @@ class Nucleo {
|
|
|
854
944
|
description: "Opcional. UUID do pedido vinculado (validado contra o tenant).",
|
|
855
945
|
displayOptions: { show: { resource: ["telemetria"], operation: ["enviar"] } },
|
|
856
946
|
},
|
|
947
|
+
// ===================================================================== ODONTO (ADR-036/038)
|
|
948
|
+
// ----------------------------------------------------------------- paciente:buscar
|
|
949
|
+
{
|
|
950
|
+
displayName: "Telefone",
|
|
951
|
+
name: "pacTelefone",
|
|
952
|
+
type: "string",
|
|
953
|
+
default: "",
|
|
954
|
+
required: true,
|
|
955
|
+
placeholder: "+5511999999999",
|
|
956
|
+
description: "Telefone do paciente em E.164 (só dígitos + DDI). Devolve o paciente (cliente + dados clínicos) e os agendamentos recentes.",
|
|
957
|
+
displayOptions: { show: { resource: ["paciente"], operation: ["buscar"] } },
|
|
958
|
+
},
|
|
959
|
+
// ----------------------------------------------------------------- procedimento:resolver
|
|
960
|
+
{
|
|
961
|
+
displayName: "Consultas",
|
|
962
|
+
name: "procConsultas",
|
|
963
|
+
type: "string",
|
|
964
|
+
typeOptions: { rows: 3 },
|
|
965
|
+
default: "",
|
|
966
|
+
required: true,
|
|
967
|
+
placeholder: "limpeza, clareamento, canal",
|
|
968
|
+
description: "Procedimentos a buscar: um por linha ou separados por vírgula (máx 10). Tolera erro de digitação, falta de acento e apelidos. Devolve status (achou/ambiguo/nao_encontrado) + candidatos com id, duração e preço.",
|
|
969
|
+
displayOptions: { show: { resource: ["procedimento"], operation: ["resolver"] } },
|
|
970
|
+
},
|
|
971
|
+
// ----------------------------------------------------------------- agenda:consultar
|
|
972
|
+
{
|
|
973
|
+
displayName: "Data",
|
|
974
|
+
name: "agdData",
|
|
975
|
+
type: "string",
|
|
976
|
+
default: "",
|
|
977
|
+
required: true,
|
|
978
|
+
placeholder: "2026-07-15",
|
|
979
|
+
description: "UMA data YYYY-MM-DD. Devolve horários livres por profissional (horário publicado − ocupado). Sem config do dia ⇒ status unknown (não invente horário).",
|
|
980
|
+
displayOptions: { show: { resource: ["agenda"], operation: ["consultar"] } },
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
displayName: "Procedimento (ID, opcional)",
|
|
984
|
+
name: "agdProcedimentoId",
|
|
985
|
+
type: "string",
|
|
986
|
+
default: "",
|
|
987
|
+
description: "UUID do procedimento (do Procedimento Resolver). Define a duração dos slots; vazio = 30 min.",
|
|
988
|
+
displayOptions: { show: { resource: ["agenda"], operation: ["consultar"] } },
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
displayName: "Profissional (ID, opcional)",
|
|
992
|
+
name: "agdProfissionalId",
|
|
993
|
+
type: "string",
|
|
994
|
+
default: "",
|
|
995
|
+
description: "UUID do profissional. Vazio = todos os profissionais ativos.",
|
|
996
|
+
displayOptions: { show: { resource: ["agenda"], operation: ["consultar"] } },
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
displayName: "Passo (min, opcional)",
|
|
1000
|
+
name: "agdPassoMin",
|
|
1001
|
+
type: "number",
|
|
1002
|
+
default: 30,
|
|
1003
|
+
description: "Granularidade dos horários oferecidos, em minutos (1..240). Default 30.",
|
|
1004
|
+
displayOptions: { show: { resource: ["agenda"], operation: ["consultar"] } },
|
|
1005
|
+
},
|
|
1006
|
+
// ----------------------------------------------------------------- agendamento:criar
|
|
1007
|
+
{
|
|
1008
|
+
displayName: "Telefone",
|
|
1009
|
+
name: "agcTelefone",
|
|
1010
|
+
type: "string",
|
|
1011
|
+
default: "",
|
|
1012
|
+
required: true,
|
|
1013
|
+
placeholder: "+5511999999999",
|
|
1014
|
+
description: "Telefone do paciente (E.164). Resolve o paciente existente ou cria um novo.",
|
|
1015
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
displayName: "Nome do Paciente",
|
|
1019
|
+
name: "agcNomePaciente",
|
|
1020
|
+
type: "string",
|
|
1021
|
+
default: "",
|
|
1022
|
+
description: "Opcional. Preenche paciente novo ou existente ainda sem nome. Não sobrescreve nome já cadastrado.",
|
|
1023
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
displayName: "Profissional (ID)",
|
|
1027
|
+
name: "agcProfissionalId",
|
|
1028
|
+
type: "string",
|
|
1029
|
+
default: "",
|
|
1030
|
+
required: true,
|
|
1031
|
+
description: "UUID do profissional (obrigatório). Horário ocupado desse profissional ⇒ 409 (indisponível).",
|
|
1032
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
displayName: "Procedimento (ID, opcional)",
|
|
1036
|
+
name: "agcProcedimentoId",
|
|
1037
|
+
type: "string",
|
|
1038
|
+
default: "",
|
|
1039
|
+
description: "UUID do procedimento (do Procedimento Resolver). Define a duração quando 'Fim' não é enviado.",
|
|
1040
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
displayName: "Início",
|
|
1044
|
+
name: "agcInicio",
|
|
1045
|
+
type: "string",
|
|
1046
|
+
default: "",
|
|
1047
|
+
required: true,
|
|
1048
|
+
placeholder: "2026-07-15T14:00:00-03:00",
|
|
1049
|
+
description: "Instante ISO 8601 do início do agendamento.",
|
|
1050
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
displayName: "Fim (opcional)",
|
|
1054
|
+
name: "agcFim",
|
|
1055
|
+
type: "string",
|
|
1056
|
+
default: "",
|
|
1057
|
+
placeholder: "2026-07-15T14:30:00-03:00",
|
|
1058
|
+
description: "Instante ISO 8601 do fim. Vazio = início + duração do procedimento (ou 30 min).",
|
|
1059
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
displayName: "Observações",
|
|
1063
|
+
name: "agcObservacoes",
|
|
1064
|
+
type: "string",
|
|
1065
|
+
default: "",
|
|
1066
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["criar"] } },
|
|
1067
|
+
},
|
|
1068
|
+
// ----------------------------------------------------------------- agendamento:alterar / cancelar
|
|
1069
|
+
{
|
|
1070
|
+
displayName: "Agendamento ID",
|
|
1071
|
+
name: "agAgendamentoId",
|
|
1072
|
+
type: "string",
|
|
1073
|
+
default: "",
|
|
1074
|
+
required: true,
|
|
1075
|
+
description: "UUID do agendamento (do tenant). Agendamento de outro tenant → 404.",
|
|
1076
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar", "cancelar"] } },
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
displayName: "Início (remarcar)",
|
|
1080
|
+
name: "agaInicio",
|
|
1081
|
+
type: "string",
|
|
1082
|
+
default: "",
|
|
1083
|
+
placeholder: "2026-07-16T09:00:00-03:00",
|
|
1084
|
+
description: "ISO 8601. Vazio = não remarca.",
|
|
1085
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar"] } },
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
displayName: "Fim (remarcar)",
|
|
1089
|
+
name: "agaFim",
|
|
1090
|
+
type: "string",
|
|
1091
|
+
default: "",
|
|
1092
|
+
description: "ISO 8601. Vazio = mantém/recalcula pelo início.",
|
|
1093
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar"] } },
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
displayName: "Procedimento (ID, alterar)",
|
|
1097
|
+
name: "agaProcedimentoId",
|
|
1098
|
+
type: "string",
|
|
1099
|
+
default: "",
|
|
1100
|
+
description: "UUID do novo procedimento. Vazio = não altera. Use 'null' para desvincular.",
|
|
1101
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar"] } },
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
displayName: "Profissional (ID, alterar)",
|
|
1105
|
+
name: "agaProfissionalId",
|
|
1106
|
+
type: "string",
|
|
1107
|
+
default: "",
|
|
1108
|
+
description: "UUID do novo profissional. Vazio = não altera. Overlap ⇒ 409.",
|
|
1109
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar"] } },
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
displayName: "Observações (alterar)",
|
|
1113
|
+
name: "agaObservacoes",
|
|
1114
|
+
type: "string",
|
|
1115
|
+
default: "",
|
|
1116
|
+
description: "Vazio = não altera.",
|
|
1117
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar"] } },
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
displayName: "Status",
|
|
1121
|
+
name: "agaStatus",
|
|
1122
|
+
type: "options",
|
|
1123
|
+
options: [
|
|
1124
|
+
{ name: "(não alterar)", value: "" },
|
|
1125
|
+
{ name: "Confirmado", value: "confirmado" },
|
|
1126
|
+
{ name: "Realizado", value: "realizado" },
|
|
1127
|
+
{ name: "Faltou", value: "faltou" },
|
|
1128
|
+
{ name: "Cancelado", value: "cancelado" },
|
|
1129
|
+
],
|
|
1130
|
+
default: "",
|
|
1131
|
+
description: "Transição de status (a API recusa transição inválida com 409). Válidas: agendado→confirmado/cancelado; confirmado→realizado/faltou/cancelado.",
|
|
1132
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["alterar"] } },
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
displayName: "Motivo",
|
|
1136
|
+
name: "agxMotivo",
|
|
1137
|
+
type: "string",
|
|
1138
|
+
default: "",
|
|
1139
|
+
description: "Motivo do cancelamento (opcional).",
|
|
1140
|
+
displayOptions: { show: { resource: ["agendamento"], operation: ["cancelar"] } },
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
displayName: "Idempotency Key",
|
|
1144
|
+
name: "agIdempotencyKey",
|
|
1145
|
+
type: "string",
|
|
1146
|
+
default: "",
|
|
1147
|
+
description: "Criar: vazio = gerada automaticamente. Alterar/cancelar: use a MESMA chave (ex.: messageID do WhatsApp) num retry para não reaplicar a operação.",
|
|
1148
|
+
displayOptions: {
|
|
1149
|
+
show: { resource: ["agendamento"], operation: ["criar", "alterar", "cancelar"] },
|
|
1150
|
+
},
|
|
1151
|
+
},
|
|
857
1152
|
],
|
|
858
1153
|
};
|
|
859
1154
|
}
|
|
@@ -879,9 +1174,10 @@ class Nucleo {
|
|
|
879
1174
|
}
|
|
880
1175
|
else if (resource === "catalogo" && operation === "resolver") {
|
|
881
1176
|
const consultas = parseConsultas(this.getNodeParameter("consultas", i));
|
|
1177
|
+
const continuacaoCursor = this.getNodeParameter("continuacaoCursor", i, "").trim();
|
|
882
1178
|
method = "POST";
|
|
883
1179
|
path = "/api/v1/agent/catalogo/resolver";
|
|
884
|
-
bodyObj = { consultas };
|
|
1180
|
+
bodyObj = continuacaoCursor ? { continuacao_cursor: continuacaoCursor } : { consultas };
|
|
885
1181
|
}
|
|
886
1182
|
else if (resource === "catalogo" && operation === "disponibilidadeRede") {
|
|
887
1183
|
const produtoId = this.getNodeParameter("produtoIdRede", i, "").trim();
|
|
@@ -1105,6 +1401,96 @@ class Nucleo {
|
|
|
1105
1401
|
path = "/api/v1/agent/telemetria";
|
|
1106
1402
|
bodyObj = b;
|
|
1107
1403
|
}
|
|
1404
|
+
else if (resource === "paciente" && operation === "buscar") {
|
|
1405
|
+
const telefone = this.getNodeParameter("pacTelefone", i).trim();
|
|
1406
|
+
method = "POST";
|
|
1407
|
+
path = "/api/v1/agent/paciente";
|
|
1408
|
+
bodyObj = { telefone };
|
|
1409
|
+
}
|
|
1410
|
+
else if (resource === "procedimento" && operation === "resolver") {
|
|
1411
|
+
const consultas = parseConsultas(this.getNodeParameter("procConsultas", i));
|
|
1412
|
+
method = "POST";
|
|
1413
|
+
path = "/api/v1/agent/procedimento/resolver";
|
|
1414
|
+
bodyObj = { consultas };
|
|
1415
|
+
}
|
|
1416
|
+
else if (resource === "agenda" && operation === "consultar") {
|
|
1417
|
+
const data = this.getNodeParameter("agdData", i).trim();
|
|
1418
|
+
const procedimentoId = this.getNodeParameter("agdProcedimentoId", i, "").trim();
|
|
1419
|
+
const profissionalId = this.getNodeParameter("agdProfissionalId", i, "").trim();
|
|
1420
|
+
const passoMin = Number(this.getNodeParameter("agdPassoMin", i, 30));
|
|
1421
|
+
const b = { data };
|
|
1422
|
+
if (procedimentoId)
|
|
1423
|
+
b.procedimento_id = procedimentoId;
|
|
1424
|
+
if (profissionalId)
|
|
1425
|
+
b.profissional_id = profissionalId;
|
|
1426
|
+
if (Number.isFinite(passoMin) && passoMin > 0)
|
|
1427
|
+
b.passo_min = passoMin;
|
|
1428
|
+
method = "POST";
|
|
1429
|
+
path = "/api/v1/agent/agenda/consultar";
|
|
1430
|
+
bodyObj = b;
|
|
1431
|
+
}
|
|
1432
|
+
else if (resource === "agendamento" && operation === "criar") {
|
|
1433
|
+
const telefone = this.getNodeParameter("agcTelefone", i).trim();
|
|
1434
|
+
const nomePaciente = this.getNodeParameter("agcNomePaciente", i, "").trim();
|
|
1435
|
+
const profissionalId = this.getNodeParameter("agcProfissionalId", i).trim();
|
|
1436
|
+
const procedimentoId = this.getNodeParameter("agcProcedimentoId", i, "").trim();
|
|
1437
|
+
const inicio = this.getNodeParameter("agcInicio", i).trim();
|
|
1438
|
+
const fim = this.getNodeParameter("agcFim", i, "").trim();
|
|
1439
|
+
const observacoes = this.getNodeParameter("agcObservacoes", i, "").trim();
|
|
1440
|
+
// Escrita de agenda EXIGE Idempotency-Key no servidor (400 se vazia) — gera se não vier.
|
|
1441
|
+
idempotencyKey =
|
|
1442
|
+
this.getNodeParameter("agIdempotencyKey", i, "").trim() || (0, node_crypto_1.randomUUID)();
|
|
1443
|
+
const b = { telefone, profissional_id: profissionalId, inicio };
|
|
1444
|
+
if (nomePaciente)
|
|
1445
|
+
b.nome_paciente = nomePaciente;
|
|
1446
|
+
if (procedimentoId)
|
|
1447
|
+
b.procedimento_id = procedimentoId;
|
|
1448
|
+
if (fim)
|
|
1449
|
+
b.fim = fim;
|
|
1450
|
+
if (observacoes)
|
|
1451
|
+
b.observacoes = observacoes;
|
|
1452
|
+
method = "POST";
|
|
1453
|
+
path = "/api/v1/agent/agendamento";
|
|
1454
|
+
bodyObj = b;
|
|
1455
|
+
}
|
|
1456
|
+
else if (resource === "agendamento" && operation === "alterar") {
|
|
1457
|
+
const agendamentoId = this.getNodeParameter("agAgendamentoId", i).trim();
|
|
1458
|
+
const inicio = this.getNodeParameter("agaInicio", i, "").trim();
|
|
1459
|
+
const fim = this.getNodeParameter("agaFim", i, "").trim();
|
|
1460
|
+
const procedimentoId = this.getNodeParameter("agaProcedimentoId", i, "").trim();
|
|
1461
|
+
const profissionalId = this.getNodeParameter("agaProfissionalId", i, "").trim();
|
|
1462
|
+
const observacoes = this.getNodeParameter("agaObservacoes", i, "").trim();
|
|
1463
|
+
const status = this.getNodeParameter("agaStatus", i, "").trim();
|
|
1464
|
+
const b = {};
|
|
1465
|
+
if (inicio)
|
|
1466
|
+
b.inicio = inicio;
|
|
1467
|
+
if (fim)
|
|
1468
|
+
b.fim = fim;
|
|
1469
|
+
// "null" (string) desvincula o procedimento; vazio = não mexe no campo.
|
|
1470
|
+
if (procedimentoId) {
|
|
1471
|
+
b.procedimento_id = procedimentoId.toLowerCase() === "null" ? null : procedimentoId;
|
|
1472
|
+
}
|
|
1473
|
+
if (profissionalId)
|
|
1474
|
+
b.profissional_id = profissionalId;
|
|
1475
|
+
if (observacoes)
|
|
1476
|
+
b.observacoes = observacoes;
|
|
1477
|
+
if (status)
|
|
1478
|
+
b.status = status;
|
|
1479
|
+
idempotencyKey =
|
|
1480
|
+
this.getNodeParameter("agIdempotencyKey", i, "").trim() || (0, node_crypto_1.randomUUID)();
|
|
1481
|
+
method = "PATCH";
|
|
1482
|
+
path = `/api/v1/agent/agendamento/${encodeURIComponent(agendamentoId)}`;
|
|
1483
|
+
bodyObj = b;
|
|
1484
|
+
}
|
|
1485
|
+
else if (resource === "agendamento" && operation === "cancelar") {
|
|
1486
|
+
const agendamentoId = this.getNodeParameter("agAgendamentoId", i).trim();
|
|
1487
|
+
const motivo = this.getNodeParameter("agxMotivo", i, "").trim();
|
|
1488
|
+
idempotencyKey =
|
|
1489
|
+
this.getNodeParameter("agIdempotencyKey", i, "").trim() || (0, node_crypto_1.randomUUID)();
|
|
1490
|
+
method = "POST";
|
|
1491
|
+
path = `/api/v1/agent/agendamento/${encodeURIComponent(agendamentoId)}/cancelar`;
|
|
1492
|
+
bodyObj = motivo ? { motivo } : {};
|
|
1493
|
+
}
|
|
1108
1494
|
else {
|
|
1109
1495
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
1110
1496
|
message: `Operação não suportada: ${resource}.${operation}`,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wondai/n8n-nodes-nucleo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Node n8n para o Núcleo Wondai — atendimento de IA (gate liga/desliga, cliente, catálogo fuzzy,
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "Node n8n para o Núcleo Wondai — atendimento de IA multi-vertical (gate liga/desliga, cliente/paciente, catálogo fuzzy, pedidos [padaria], procedimento/agenda/agendamento [odonto], contexto operacional, telemetria) com assinatura HMAC v1. Tenant e vertical vêm do token (a parede, ADR-013/038).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
7
7
|
"n8n",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"nucleo",
|
|
10
10
|
"crm",
|
|
11
11
|
"padaria",
|
|
12
|
+
"odonto",
|
|
12
13
|
"ai-tool"
|
|
13
14
|
],
|
|
14
15
|
"license": "MIT",
|