n8n-nodes-aib 0.5.0 → 0.5.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.
|
@@ -73,6 +73,7 @@ class AibDigital {
|
|
|
73
73
|
{ name: "Mensagem", value: "mensagem" },
|
|
74
74
|
{ name: "Contato", value: "contato" },
|
|
75
75
|
{ name: "Funil (Kanban)", value: "funil" },
|
|
76
|
+
{ name: "Etiqueta", value: "etiqueta" },
|
|
76
77
|
],
|
|
77
78
|
},
|
|
78
79
|
{
|
|
@@ -137,6 +138,18 @@ class AibDigital {
|
|
|
137
138
|
{ name: "Criar etapa", value: "criarEtapa", action: "Criar etapa num funil" },
|
|
138
139
|
],
|
|
139
140
|
},
|
|
141
|
+
{
|
|
142
|
+
displayName: "Operação",
|
|
143
|
+
name: "operation",
|
|
144
|
+
type: "options",
|
|
145
|
+
noDataExpression: true,
|
|
146
|
+
default: "criarEtiqueta",
|
|
147
|
+
displayOptions: { show: { recurso: ["etiqueta"] } },
|
|
148
|
+
options: [
|
|
149
|
+
{ name: "Criar etiqueta", value: "criarEtiqueta", action: "Criar ou atualizar uma etiqueta" },
|
|
150
|
+
{ name: "Listar etiquetas", value: "listarEtiquetas", action: "Listar as etiquetas da conta" },
|
|
151
|
+
],
|
|
152
|
+
},
|
|
140
153
|
// ── parâmetros por operação ─────────────────────────────
|
|
141
154
|
{
|
|
142
155
|
displayName: "Conversa (ID)",
|
|
@@ -252,7 +265,7 @@ class AibDigital {
|
|
|
252
265
|
type: "options",
|
|
253
266
|
typeOptions: { loadOptionsMethod: "getAmbientes", loadOptionsDependsOn: ["conta"] },
|
|
254
267
|
default: "",
|
|
255
|
-
displayOptions: { show: { operation: ["selecionarConta", "criarFunil"] } },
|
|
268
|
+
displayOptions: { show: { operation: ["selecionarConta", "criarFunil", "criarEtiqueta"] } },
|
|
256
269
|
description: "Onde o funil/dado vai nascer. Conta com 2+ ambientes exige escolher aqui.",
|
|
257
270
|
},
|
|
258
271
|
{
|
|
@@ -295,6 +308,28 @@ class AibDigital {
|
|
|
295
308
|
displayOptions: { show: { operation: ["criarEtapa"] } },
|
|
296
309
|
description: "Card que chega aqui conta como negócio perdido",
|
|
297
310
|
},
|
|
311
|
+
{
|
|
312
|
+
displayName: "Nome da etiqueta",
|
|
313
|
+
name: "etiquetaNome",
|
|
314
|
+
type: "string",
|
|
315
|
+
default: "",
|
|
316
|
+
required: true,
|
|
317
|
+
displayOptions: { show: { operation: ["criarEtiqueta"] } },
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
displayName: "Cor",
|
|
321
|
+
name: "etiquetaCor",
|
|
322
|
+
type: "color",
|
|
323
|
+
default: "",
|
|
324
|
+
displayOptions: { show: { operation: ["criarEtiqueta"] } },
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
displayName: "Descrição",
|
|
328
|
+
name: "etiquetaDescricao",
|
|
329
|
+
type: "string",
|
|
330
|
+
default: "",
|
|
331
|
+
displayOptions: { show: { operation: ["criarEtiqueta"] } },
|
|
332
|
+
},
|
|
298
333
|
{
|
|
299
334
|
displayName: "Contato (ID)",
|
|
300
335
|
name: "contatoId",
|
|
@@ -380,6 +415,7 @@ class AibDigital {
|
|
|
380
415
|
mensagem: "enviarMensagem",
|
|
381
416
|
contato: "atualizarContato",
|
|
382
417
|
funil: "criarFunil",
|
|
418
|
+
etiqueta: "criarEtiqueta",
|
|
383
419
|
};
|
|
384
420
|
operation = padrao[recurso] ?? "selecionarConta";
|
|
385
421
|
}
|
|
@@ -460,6 +496,18 @@ class AibDigital {
|
|
|
460
496
|
const campos = this.getNodeParameter("camposContato", i, {});
|
|
461
497
|
res = await api(this, "PATCH", `/api/v1/contatos/${contatoId}`, campos, qs);
|
|
462
498
|
}
|
|
499
|
+
else if (operation === "criarEtiqueta") {
|
|
500
|
+
const ambienteSel = this.getNodeParameter("ambienteId", i, "");
|
|
501
|
+
res = await api(this, "POST", "/api/v1/etiquetas", {
|
|
502
|
+
nome: this.getNodeParameter("etiquetaNome", i),
|
|
503
|
+
...(this.getNodeParameter("etiquetaCor", i, "") ? { cor: this.getNodeParameter("etiquetaCor", i, "") } : {}),
|
|
504
|
+
...(this.getNodeParameter("etiquetaDescricao", i, "") ? { descricao: this.getNodeParameter("etiquetaDescricao", i, "") } : {}),
|
|
505
|
+
...(ambienteSel ? { ambiente_id: ambienteSel } : {}),
|
|
506
|
+
}, qs);
|
|
507
|
+
}
|
|
508
|
+
else if (operation === "listarEtiquetas") {
|
|
509
|
+
res = await api(this, "GET", "/api/v1/etiquetas", undefined, qs);
|
|
510
|
+
}
|
|
463
511
|
else if (operation === "selecionarConta") {
|
|
464
512
|
// A âncora do fluxo: devolve a conta E o ambiente escolhidos para os
|
|
465
513
|
// nós seguintes referenciarem ($('Selecionar conta').item.json.id e
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-aib",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Nós do Sistema AIB Digital para n8n: gatilho de mensagens do WhatsApp (via AIB Inbox) e ações — enviar mensagem, mover card no funil, pausar IA — escolhendo conta e caixa por dropdown.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "AIB Digital",
|