@atomoz/workflows-nodes 0.1.13 → 0.1.15
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/package.json +49 -51
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -1
- package/src/nodes/consts/index.d.ts +0 -3
- package/src/nodes/consts/index.d.ts.map +0 -1
- package/src/nodes/consts/index.js +0 -2
- package/src/nodes/consts/node-colors.d.ts +0 -7
- package/src/nodes/consts/node-colors.d.ts.map +0 -1
- package/src/nodes/consts/node-colors.js +0 -6
- package/src/nodes/consts/node-functions.d.ts +0 -20
- package/src/nodes/consts/node-functions.d.ts.map +0 -1
- package/src/nodes/consts/node-functions.js +0 -29
- package/src/nodes/consts/nodes.d.ts +0 -3
- package/src/nodes/consts/nodes.d.ts.map +0 -1
- package/src/nodes/consts/nodes.js +0 -30
- package/src/nodes/consts/schemas.d.ts +0 -30
- package/src/nodes/consts/schemas.d.ts.map +0 -1
- package/src/nodes/consts/schemas.js +0 -7
- package/src/nodes/ia/agent/data.d.ts +0 -11
- package/src/nodes/ia/agent/data.d.ts.map +0 -1
- package/src/nodes/ia/agent/data.js +0 -111
- package/src/nodes/ia/agent/function.d.ts +0 -2
- package/src/nodes/ia/agent/function.d.ts.map +0 -1
- package/src/nodes/ia/agent/function.js +0 -90
- package/src/nodes/ia/agent/index.d.ts +0 -3
- package/src/nodes/ia/agent/index.d.ts.map +0 -1
- package/src/nodes/ia/agent/index.js +0 -2
- package/src/nodes/ia/index.d.ts +0 -5
- package/src/nodes/ia/index.d.ts.map +0 -1
- package/src/nodes/ia/index.js +0 -4
- package/src/nodes/ia/message/index.d.ts +0 -2
- package/src/nodes/ia/message/index.d.ts.map +0 -1
- package/src/nodes/ia/message/index.js +0 -1
- package/src/nodes/ia/message/message.d.ts +0 -10
- package/src/nodes/ia/message/message.d.ts.map +0 -1
- package/src/nodes/ia/message/message.js +0 -118
- package/src/nodes/ia/supervisor/data.d.ts +0 -10
- package/src/nodes/ia/supervisor/data.d.ts.map +0 -1
- package/src/nodes/ia/supervisor/data.js +0 -84
- package/src/nodes/ia/supervisor/function.d.ts +0 -2
- package/src/nodes/ia/supervisor/function.d.ts.map +0 -1
- package/src/nodes/ia/supervisor/function.js +0 -227
- package/src/nodes/ia/supervisor/index.d.ts +0 -3
- package/src/nodes/ia/supervisor/index.d.ts.map +0 -1
- package/src/nodes/ia/supervisor/index.js +0 -2
- package/src/nodes/ia/tool/data.d.ts +0 -16
- package/src/nodes/ia/tool/data.d.ts.map +0 -1
- package/src/nodes/ia/tool/data.js +0 -70
- package/src/nodes/ia/tool/function.d.ts +0 -4
- package/src/nodes/ia/tool/function.d.ts.map +0 -1
- package/src/nodes/ia/tool/function.js +0 -36
- package/src/nodes/ia/tool/index.d.ts +0 -3
- package/src/nodes/ia/tool/index.d.ts.map +0 -1
- package/src/nodes/ia/tool/index.js +0 -2
- package/src/nodes/index.d.ts +0 -9
- package/src/nodes/index.d.ts.map +0 -1
- package/src/nodes/index.js +0 -8
- package/src/nodes/inputs/chat/chat.d.ts +0 -4
- package/src/nodes/inputs/chat/chat.d.ts.map +0 -1
- package/src/nodes/inputs/chat/chat.js +0 -51
- package/src/nodes/inputs/http/delete/data.d.ts +0 -3
- package/src/nodes/inputs/http/delete/data.d.ts.map +0 -1
- package/src/nodes/inputs/http/delete/data.js +0 -57
- package/src/nodes/inputs/http/delete/function.d.ts +0 -2
- package/src/nodes/inputs/http/delete/function.d.ts.map +0 -1
- package/src/nodes/inputs/http/delete/function.js +0 -28
- package/src/nodes/inputs/http/delete/index.d.ts +0 -4
- package/src/nodes/inputs/http/delete/index.d.ts.map +0 -1
- package/src/nodes/inputs/http/delete/index.js +0 -3
- package/src/nodes/inputs/http/delete/schema.d.ts +0 -16
- package/src/nodes/inputs/http/delete/schema.d.ts.map +0 -1
- package/src/nodes/inputs/http/delete/schema.js +0 -7
- package/src/nodes/inputs/http/get/data.d.ts +0 -3
- package/src/nodes/inputs/http/get/data.d.ts.map +0 -1
- package/src/nodes/inputs/http/get/data.js +0 -58
- package/src/nodes/inputs/http/get/function.d.ts +0 -2
- package/src/nodes/inputs/http/get/function.d.ts.map +0 -1
- package/src/nodes/inputs/http/get/function.js +0 -25
- package/src/nodes/inputs/http/get/index.d.ts +0 -4
- package/src/nodes/inputs/http/get/index.d.ts.map +0 -1
- package/src/nodes/inputs/http/get/index.js +0 -3
- package/src/nodes/inputs/http/get/schema.d.ts +0 -16
- package/src/nodes/inputs/http/get/schema.d.ts.map +0 -1
- package/src/nodes/inputs/http/get/schema.js +0 -7
- package/src/nodes/inputs/http/index.d.ts +0 -8
- package/src/nodes/inputs/http/index.d.ts.map +0 -1
- package/src/nodes/inputs/http/index.js +0 -10
- package/src/nodes/inputs/http/patch/data.d.ts +0 -3
- package/src/nodes/inputs/http/patch/data.d.ts.map +0 -1
- package/src/nodes/inputs/http/patch/data.js +0 -70
- package/src/nodes/inputs/http/patch/function.d.ts +0 -2
- package/src/nodes/inputs/http/patch/function.d.ts.map +0 -1
- package/src/nodes/inputs/http/patch/function.js +0 -36
- package/src/nodes/inputs/http/patch/index.d.ts +0 -4
- package/src/nodes/inputs/http/patch/index.d.ts.map +0 -1
- package/src/nodes/inputs/http/patch/index.js +0 -3
- package/src/nodes/inputs/http/patch/schema.d.ts +0 -21
- package/src/nodes/inputs/http/patch/schema.d.ts.map +0 -1
- package/src/nodes/inputs/http/patch/schema.js +0 -8
- package/src/nodes/inputs/http/post/data.d.ts +0 -3
- package/src/nodes/inputs/http/post/data.d.ts.map +0 -1
- package/src/nodes/inputs/http/post/data.js +0 -70
- package/src/nodes/inputs/http/post/function.d.ts +0 -2
- package/src/nodes/inputs/http/post/function.d.ts.map +0 -1
- package/src/nodes/inputs/http/post/function.js +0 -36
- package/src/nodes/inputs/http/post/index.d.ts +0 -4
- package/src/nodes/inputs/http/post/index.d.ts.map +0 -1
- package/src/nodes/inputs/http/post/index.js +0 -3
- package/src/nodes/inputs/http/post/schema.d.ts +0 -21
- package/src/nodes/inputs/http/post/schema.d.ts.map +0 -1
- package/src/nodes/inputs/http/post/schema.js +0 -8
- package/src/nodes/inputs/http/put/data.d.ts +0 -3
- package/src/nodes/inputs/http/put/data.d.ts.map +0 -1
- package/src/nodes/inputs/http/put/data.js +0 -70
- package/src/nodes/inputs/http/put/function.d.ts +0 -2
- package/src/nodes/inputs/http/put/function.d.ts.map +0 -1
- package/src/nodes/inputs/http/put/function.js +0 -36
- package/src/nodes/inputs/http/put/index.d.ts +0 -4
- package/src/nodes/inputs/http/put/index.d.ts.map +0 -1
- package/src/nodes/inputs/http/put/index.js +0 -3
- package/src/nodes/inputs/http/put/schema.d.ts +0 -21
- package/src/nodes/inputs/http/put/schema.d.ts.map +0 -1
- package/src/nodes/inputs/http/put/schema.js +0 -8
- package/src/nodes/inputs/http/schemas.d.ts +0 -18
- package/src/nodes/inputs/http/schemas.d.ts.map +0 -1
- package/src/nodes/inputs/http/schemas.js +0 -17
- package/src/nodes/inputs/http/utils.d.ts +0 -21
- package/src/nodes/inputs/http/utils.d.ts.map +0 -1
- package/src/nodes/inputs/http/utils.js +0 -63
- package/src/nodes/inputs/index.d.ts +0 -5
- package/src/nodes/inputs/index.d.ts.map +0 -1
- package/src/nodes/inputs/index.js +0 -4
- package/src/nodes/inputs/manual/trigger.d.ts +0 -4
- package/src/nodes/inputs/manual/trigger.d.ts.map +0 -1
- package/src/nodes/inputs/manual/trigger.js +0 -39
- package/src/nodes/output-node/index.d.ts +0 -4
- package/src/nodes/output-node/index.d.ts.map +0 -1
- package/src/nodes/output-node/index.js +0 -123
- package/src/nodes/outputs/chat/output.d.ts +0 -4
- package/src/nodes/outputs/chat/output.d.ts.map +0 -1
- package/src/nodes/outputs/chat/output.js +0 -48
- package/src/nodes/outputs/http-output.d.ts +0 -4
- package/src/nodes/outputs/http-output.d.ts.map +0 -1
- package/src/nodes/outputs/http-output.js +0 -76
- package/src/nodes/processors/concat.d.ts +0 -9
- package/src/nodes/processors/concat.d.ts.map +0 -1
- package/src/nodes/processors/concat.js +0 -68
- package/src/nodes/processors/custom-code.d.ts +0 -4
- package/src/nodes/processors/custom-code.d.ts.map +0 -1
- package/src/nodes/processors/custom-code.js +0 -54
- package/src/nodes/processors/index.d.ts +0 -2
- package/src/nodes/processors/index.d.ts.map +0 -1
- package/src/nodes/processors/index.js +0 -1
- package/src/nodes/processors/transform.d.ts +0 -3
- package/src/nodes/processors/transform.d.ts.map +0 -1
- package/src/nodes/processors/transform.js +0 -48
- package/src/nodes/social/index.d.ts +0 -2
- package/src/nodes/social/index.d.ts.map +0 -1
- package/src/nodes/social/index.js +0 -1
- package/src/nodes/social/whatsapp/index.d.ts +0 -4
- package/src/nodes/social/whatsapp/index.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/index.js +0 -3
- package/src/nodes/social/whatsapp/message-trigger/data.d.ts +0 -3
- package/src/nodes/social/whatsapp/message-trigger/data.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/message-trigger/data.js +0 -55
- package/src/nodes/social/whatsapp/message-trigger/index.d.ts +0 -2
- package/src/nodes/social/whatsapp/message-trigger/index.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/message-trigger/index.js +0 -1
- package/src/nodes/social/whatsapp/send-message/data.d.ts +0 -8
- package/src/nodes/social/whatsapp/send-message/data.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/send-message/data.js +0 -46
- package/src/nodes/social/whatsapp/send-message/functions.d.ts +0 -3
- package/src/nodes/social/whatsapp/send-message/functions.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/send-message/functions.js +0 -32
- package/src/nodes/social/whatsapp/send-message/index.d.ts +0 -3
- package/src/nodes/social/whatsapp/send-message/index.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/send-message/index.js +0 -2
- package/src/nodes/social/whatsapp/send-template/data.d.ts +0 -8
- package/src/nodes/social/whatsapp/send-template/data.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/send-template/data.js +0 -42
- package/src/nodes/social/whatsapp/send-template/functions.d.ts +0 -5
- package/src/nodes/social/whatsapp/send-template/functions.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/send-template/functions.js +0 -60
- package/src/nodes/social/whatsapp/send-template/index.d.ts +0 -3
- package/src/nodes/social/whatsapp/send-template/index.d.ts.map +0 -1
- package/src/nodes/social/whatsapp/send-template/index.js +0 -2
- package/src/nodes/types/base-node.d.ts +0 -17
- package/src/nodes/types/base-node.d.ts.map +0 -1
- package/src/nodes/types/base-node.js +0 -1
- package/src/nodes/types/base-node.types.d.ts +0 -144
- package/src/nodes/types/base-node.types.d.ts.map +0 -1
- package/src/nodes/types/base-node.types.js +0 -1
- package/src/utils/llm-factory.d.ts +0 -16
- package/src/utils/llm-factory.d.ts.map +0 -1
- package/src/utils/llm-factory.js +0 -110
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export const ChatOutputNodeFunction = async (params) => {
|
|
2
|
-
const { inputs, fieldValues, stream, emitter } = params || {};
|
|
3
|
-
const content = inputs?.data ?? fieldValues?.data ?? "";
|
|
4
|
-
if (stream && emitter) {
|
|
5
|
-
// Não streamar palavras; ChatOutput deve apenas finalizar com o conteúdo completo (final)
|
|
6
|
-
try {
|
|
7
|
-
emitter.emitDone({ content });
|
|
8
|
-
}
|
|
9
|
-
catch (_e) {
|
|
10
|
-
try {
|
|
11
|
-
emitter.emitDone({ content });
|
|
12
|
-
}
|
|
13
|
-
catch (err) {
|
|
14
|
-
console.debug('ChatOutput emitDone error', err);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
output: content,
|
|
20
|
-
type: "ChatOutput",
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export const ChatOutputNode = {
|
|
24
|
-
label: "Chat Output",
|
|
25
|
-
type: "ChatOutput",
|
|
26
|
-
category: "output",
|
|
27
|
-
icon: "📤",
|
|
28
|
-
description: "Output de chat que envia a resposta para o cliente via WebSocket",
|
|
29
|
-
tags: {
|
|
30
|
-
execution: "async",
|
|
31
|
-
group: "IA",
|
|
32
|
-
},
|
|
33
|
-
fields: [
|
|
34
|
-
{
|
|
35
|
-
id: "data",
|
|
36
|
-
label: "Data",
|
|
37
|
-
type: "string",
|
|
38
|
-
required: true,
|
|
39
|
-
typeable: false,
|
|
40
|
-
handle: {
|
|
41
|
-
type: "input",
|
|
42
|
-
label: "Data",
|
|
43
|
-
name: "data",
|
|
44
|
-
fieldType: "string",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-output.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/outputs/http-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,eAAO,MAAM,YAAY,GAAI,QAAQ,GAAG,KAAG,GA8B1C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAiD5B,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Função de execução para o nó HttpOutput
|
|
2
|
-
export const NodeFunction = (params) => {
|
|
3
|
-
const { inputs, fieldValues } = params;
|
|
4
|
-
// fieldValues contém os valores dos campos com placeholders JÁ RESOLVIDOS no backend
|
|
5
|
-
// Sempre usar fieldValues.data (que agora tem os placeholders resolvidos)
|
|
6
|
-
let responseData = fieldValues?.data || {};
|
|
7
|
-
// Se é uma string simples vinda de uma conexão, usar como valor direto
|
|
8
|
-
// Se é um objeto, usar como está (assumindo que já foi processado corretamente)
|
|
9
|
-
if (typeof responseData === 'string') {
|
|
10
|
-
// Se é uma string simples conectada de outro node, criar objeto
|
|
11
|
-
responseData = { value: responseData };
|
|
12
|
-
}
|
|
13
|
-
// Configurações: priorizar inputs resolvidos, senão usar fieldValues
|
|
14
|
-
const status = inputs?.status ?? fieldValues?.status ?? 200;
|
|
15
|
-
const headers = inputs?.headers ?? fieldValues?.headers ?? {};
|
|
16
|
-
// Validações
|
|
17
|
-
if (status && (status < 100 || status > 599)) {
|
|
18
|
-
throw new Error(`Status HTTP inválido: ${status}`);
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
status,
|
|
22
|
-
headers,
|
|
23
|
-
data: responseData,
|
|
24
|
-
isHttpResponse: true
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export const HttpOutputNode = {
|
|
28
|
-
label: 'Http Output',
|
|
29
|
-
type: 'HttpOutput',
|
|
30
|
-
category: 'output',
|
|
31
|
-
icon: '📤',
|
|
32
|
-
description: 'Node para definir a resposta HTTP',
|
|
33
|
-
fields: [
|
|
34
|
-
{
|
|
35
|
-
id: 'status',
|
|
36
|
-
label: 'Status Code',
|
|
37
|
-
type: 'number',
|
|
38
|
-
required: false,
|
|
39
|
-
defaultValue: 200,
|
|
40
|
-
placeholder: '200',
|
|
41
|
-
handle: {
|
|
42
|
-
type: 'input',
|
|
43
|
-
label: 'Status',
|
|
44
|
-
name: 'status',
|
|
45
|
-
fieldType: 'number',
|
|
46
|
-
required: false
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: 'headers',
|
|
51
|
-
label: 'Response Headers',
|
|
52
|
-
type: 'keyValue',
|
|
53
|
-
required: false,
|
|
54
|
-
handle: {
|
|
55
|
-
type: 'input',
|
|
56
|
-
label: 'Headers',
|
|
57
|
-
name: 'headers',
|
|
58
|
-
fieldType: 'keyValue',
|
|
59
|
-
required: false
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'data',
|
|
64
|
-
label: 'Response Data',
|
|
65
|
-
type: 'json',
|
|
66
|
-
required: false,
|
|
67
|
-
handle: {
|
|
68
|
-
type: 'input',
|
|
69
|
-
label: 'Data',
|
|
70
|
-
name: 'data',
|
|
71
|
-
fieldType: 'json',
|
|
72
|
-
required: false
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NodeData } from "../types/base-node";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
export declare const ConcatNodeFunction: (inputs: any) => any;
|
|
4
|
-
export declare const ConcatNodeSchema: z.ZodObject<{
|
|
5
|
-
input1: z.ZodString;
|
|
6
|
-
input2: z.ZodString;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export declare const ConcatNode: NodeData;
|
|
9
|
-
//# sourceMappingURL=concat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/processors/concat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,GAAI,QAAQ,GAAG,KAAG,GAY9C,CAAC;AAEJ,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,QAmDxB,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const ConcatNodeFunction = (inputs) => {
|
|
3
|
-
const input1 = inputs.input1 || '';
|
|
4
|
-
const input2 = inputs.input2 || '';
|
|
5
|
-
// A lógica principal do nó
|
|
6
|
-
const result = `${input1}${input2}`;
|
|
7
|
-
return {
|
|
8
|
-
output: result,
|
|
9
|
-
function: ConcatNodeFunction,
|
|
10
|
-
type: "ConcatNode"
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export const ConcatNodeSchema = z.object({
|
|
14
|
-
input1: z.string(),
|
|
15
|
-
input2: z.string(),
|
|
16
|
-
});
|
|
17
|
-
export const ConcatNode = {
|
|
18
|
-
label: 'Concat Data',
|
|
19
|
-
type: 'ConcatNode',
|
|
20
|
-
category: 'step',
|
|
21
|
-
icon: '🔄',
|
|
22
|
-
description: 'Node para concatenar dados de entrada',
|
|
23
|
-
toolable: true,
|
|
24
|
-
fields: [
|
|
25
|
-
{
|
|
26
|
-
id: 'input1',
|
|
27
|
-
label: 'Input 1',
|
|
28
|
-
type: 'string',
|
|
29
|
-
required: true,
|
|
30
|
-
typeable: false,
|
|
31
|
-
handle: {
|
|
32
|
-
type: 'input',
|
|
33
|
-
label: 'Input 1',
|
|
34
|
-
name: 'input1',
|
|
35
|
-
fieldType: 'string',
|
|
36
|
-
required: true
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'input2',
|
|
41
|
-
label: 'Input 2',
|
|
42
|
-
type: 'string',
|
|
43
|
-
required: true,
|
|
44
|
-
typeable: false,
|
|
45
|
-
handle: {
|
|
46
|
-
type: 'input',
|
|
47
|
-
label: 'Input 2',
|
|
48
|
-
name: 'input2',
|
|
49
|
-
fieldType: 'string',
|
|
50
|
-
required: true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'output',
|
|
55
|
-
label: 'Output',
|
|
56
|
-
type: 'string',
|
|
57
|
-
required: true,
|
|
58
|
-
typeable: false,
|
|
59
|
-
handle: {
|
|
60
|
-
type: 'output',
|
|
61
|
-
label: 'Output',
|
|
62
|
-
name: 'output',
|
|
63
|
-
fieldType: 'string',
|
|
64
|
-
required: true
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-code.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/processors/custom-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,eAAO,MAAM,YAAY,GAAI,QAAQ,GAAG,KAAG,GAiB1C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAoC5B,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Função de execução para o nó CustomCode
|
|
2
|
-
export const NodeFunction = (params) => {
|
|
3
|
-
const { inputValue, fieldValues } = params;
|
|
4
|
-
const { customCode } = fieldValues;
|
|
5
|
-
if (!customCode) {
|
|
6
|
-
return inputValue; // Retorna o input se não há código customizado
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
// Executa o código customizado
|
|
10
|
-
// O código pode usar 'input', 'context', 'request', etc.
|
|
11
|
-
const customFunction = new Function('input', 'context', 'request', 'params', customCode);
|
|
12
|
-
const result = customFunction(inputValue, fieldValues, params.request, params);
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
throw new Error(`Erro ao executar código customizado: ${error instanceof Error ? error.message : 'Erro desconhecido'}`);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
export const CustomCodeNode = {
|
|
20
|
-
label: 'Custom Code',
|
|
21
|
-
type: 'CustomCodeNode',
|
|
22
|
-
category: 'step',
|
|
23
|
-
icon: '💻',
|
|
24
|
-
description: 'Node para executar código JavaScript customizado',
|
|
25
|
-
fields: [
|
|
26
|
-
{
|
|
27
|
-
id: 'customCode',
|
|
28
|
-
label: 'Código Customizado',
|
|
29
|
-
type: 'code',
|
|
30
|
-
required: false,
|
|
31
|
-
placeholder: '// Seu código JavaScript aqui\n// Use "input" para acessar o valor de entrada\n// Use "context" para acessar os dados do nó\nreturn input;',
|
|
32
|
-
handle: {
|
|
33
|
-
type: 'input',
|
|
34
|
-
label: 'Input',
|
|
35
|
-
name: 'input',
|
|
36
|
-
fieldType: 'any',
|
|
37
|
-
required: false
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: 'output',
|
|
42
|
-
label: 'Output',
|
|
43
|
-
type: 'any',
|
|
44
|
-
required: false,
|
|
45
|
-
handle: {
|
|
46
|
-
type: 'output',
|
|
47
|
-
label: 'Output',
|
|
48
|
-
name: 'output',
|
|
49
|
-
fieldType: 'any',
|
|
50
|
-
required: false
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/processors/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './transform';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/processors/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,eAAO,MAAM,aAAa,EAAE,QA+C3B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export const TransformNode = {
|
|
2
|
-
label: 'Transform Data',
|
|
3
|
-
type: 'TransformNode',
|
|
4
|
-
category: 'step',
|
|
5
|
-
icon: '🔄',
|
|
6
|
-
description: 'Node para transformar dados de entrada',
|
|
7
|
-
fields: [
|
|
8
|
-
{
|
|
9
|
-
id: 'transformFunction',
|
|
10
|
-
label: 'Transform Function',
|
|
11
|
-
type: 'string',
|
|
12
|
-
required: true,
|
|
13
|
-
handle: {
|
|
14
|
-
type: 'input',
|
|
15
|
-
label: 'Transform Function',
|
|
16
|
-
name: 'transformFunction',
|
|
17
|
-
fieldType: 'string',
|
|
18
|
-
required: true
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'outputFormat',
|
|
23
|
-
label: 'Output Format',
|
|
24
|
-
type: 'string',
|
|
25
|
-
required: false,
|
|
26
|
-
handle: {
|
|
27
|
-
type: 'input',
|
|
28
|
-
label: 'Output Format',
|
|
29
|
-
name: 'outputFormat',
|
|
30
|
-
fieldType: 'string',
|
|
31
|
-
required: false
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: 'output',
|
|
36
|
-
label: 'Output',
|
|
37
|
-
type: 'object',
|
|
38
|
-
required: false,
|
|
39
|
-
handle: {
|
|
40
|
-
type: 'output',
|
|
41
|
-
label: 'Output',
|
|
42
|
-
name: 'output',
|
|
43
|
-
fieldType: 'object',
|
|
44
|
-
required: false
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/social/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './whatsapp';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../libs/nodes/src/nodes/social/whatsapp/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/message-trigger/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,eAAO,MAAM,0BAA0B,EAAE,QAqDxC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export const WhatsappMessageTriggerNode = {
|
|
2
|
-
label: "Whatsapp Message Trigger",
|
|
3
|
-
type: "WhatsappMessageTriggerNode",
|
|
4
|
-
category: "input",
|
|
5
|
-
description: "Trigger when a message is received from a WhatsApp number",
|
|
6
|
-
icon: "📱",
|
|
7
|
-
toolable: false,
|
|
8
|
-
group: 'Social',
|
|
9
|
-
tags: {
|
|
10
|
-
execution: 'async',
|
|
11
|
-
group: 'Social'
|
|
12
|
-
},
|
|
13
|
-
fields: [
|
|
14
|
-
{
|
|
15
|
-
id: "phoneNumber",
|
|
16
|
-
label: "Phone Number",
|
|
17
|
-
type: "string",
|
|
18
|
-
required: true,
|
|
19
|
-
typeable: false,
|
|
20
|
-
handle: {
|
|
21
|
-
type: "output",
|
|
22
|
-
label: "Phone Number",
|
|
23
|
-
name: "phoneNumber",
|
|
24
|
-
fieldType: "string",
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: "userName",
|
|
29
|
-
label: "User Name",
|
|
30
|
-
type: "string",
|
|
31
|
-
required: true,
|
|
32
|
-
typeable: false,
|
|
33
|
-
handle: {
|
|
34
|
-
type: "output",
|
|
35
|
-
label: "User Name",
|
|
36
|
-
name: "userName",
|
|
37
|
-
fieldType: "string",
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "message",
|
|
42
|
-
label: "Message",
|
|
43
|
-
type: "string",
|
|
44
|
-
required: true,
|
|
45
|
-
typeable: false,
|
|
46
|
-
handle: {
|
|
47
|
-
type: "output",
|
|
48
|
-
label: "Message",
|
|
49
|
-
name: "message",
|
|
50
|
-
fieldType: "string",
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
};
|
|
55
|
-
//Webhook -> identificar numero -> ir para hierarchy e pegar o tenant_id com base no numero da integração -> executar workflows com o input de whatsapp do tenant_id
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/message-trigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './data';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { NodeData } from "../../../types/base-node";
|
|
3
|
-
export declare const WhatsappSendMessageNodeSchema: z.ZodObject<{
|
|
4
|
-
phoneNumber: z.ZodString;
|
|
5
|
-
message: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export declare const WhatsappSendMessageNode: NodeData;
|
|
8
|
-
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/send-message/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,QAwCrC,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const WhatsappSendMessageNodeSchema = z.object({
|
|
3
|
-
phoneNumber: z.string().describe("Phone number to send the message to"),
|
|
4
|
-
message: z.string().describe("Message content to send"),
|
|
5
|
-
});
|
|
6
|
-
export const WhatsappSendMessageNode = {
|
|
7
|
-
label: "Whatsapp Send Message",
|
|
8
|
-
type: "WhatsappSendMessageNode",
|
|
9
|
-
category: "step",
|
|
10
|
-
description: "Send an open text message to a WhatsApp number",
|
|
11
|
-
icon: "💬",
|
|
12
|
-
toolable: true,
|
|
13
|
-
group: 'Social',
|
|
14
|
-
tags: {
|
|
15
|
-
execution: 'async',
|
|
16
|
-
group: 'Social'
|
|
17
|
-
},
|
|
18
|
-
fields: [
|
|
19
|
-
{
|
|
20
|
-
id: "phoneNumber",
|
|
21
|
-
label: "Phone Number",
|
|
22
|
-
type: "string",
|
|
23
|
-
required: true,
|
|
24
|
-
placeholder: "e.g., +5511999999999",
|
|
25
|
-
handle: {
|
|
26
|
-
type: "input",
|
|
27
|
-
label: "Phone Number",
|
|
28
|
-
name: "phoneNumber",
|
|
29
|
-
fieldType: "string",
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: "message",
|
|
34
|
-
label: "Message",
|
|
35
|
-
type: "textarea",
|
|
36
|
-
required: true,
|
|
37
|
-
placeholder: "Type your message here...",
|
|
38
|
-
handle: {
|
|
39
|
-
type: "input",
|
|
40
|
-
label: "Message",
|
|
41
|
-
name: "message",
|
|
42
|
-
fieldType: "string",
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
]
|
|
46
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/send-message/functions.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,2BAA2B,GAAU,aAAa,GAAG,KAAG,OAAO,CAAC,GAAG,CAmCxE,CAAA;AAED,OAAO,EACH,2BAA2B,EAC9B,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const NUMBER_ID = "700207253183039";
|
|
2
|
-
const TOKEN = 'EAAUuy5eznhEBPWw62uE6cs4oZAW6WvpsiF9RBjTGDjg8H74GouBMl1MBifCuA572AVMp53T83pBuSaMJUcWMDIGxvXbxaU6RFTyXOuKkhUPkF3Boc7QbmRuUWSFuyvkjZCyA7ngAg2NXV8nYzzZCleSuFQD487NN2mat7sHPx2pMHuN95IcaevyKLnuz5Om2Bp36JihQweodc517aH2Krv70jqNKKzBjoGVziWNnOhULQZDZD';
|
|
3
|
-
const WhatsappSendMessageFunction = async (fieldValues) => {
|
|
4
|
-
const { phoneNumber, message } = fieldValues;
|
|
5
|
-
const response = await fetch(`https://graph.facebook.com/v23.0/${NUMBER_ID}/messages`, {
|
|
6
|
-
method: 'POST',
|
|
7
|
-
headers: {
|
|
8
|
-
'Authorization': `Bearer ${TOKEN}`,
|
|
9
|
-
'Content-Type': 'application/json'
|
|
10
|
-
},
|
|
11
|
-
body: JSON.stringify({
|
|
12
|
-
messaging_product: 'whatsapp',
|
|
13
|
-
to: phoneNumber,
|
|
14
|
-
type: 'text',
|
|
15
|
-
text: {
|
|
16
|
-
preview_url: false,
|
|
17
|
-
body: message
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
const data = await response.json();
|
|
22
|
-
if (!response.ok) {
|
|
23
|
-
const errObj = data.error;
|
|
24
|
-
const msg = errObj?.message || response.statusText;
|
|
25
|
-
const enriched = new Error(`Failed to send message: ${msg}`);
|
|
26
|
-
enriched.details = data;
|
|
27
|
-
enriched.status = response.status;
|
|
28
|
-
throw enriched;
|
|
29
|
-
}
|
|
30
|
-
return data;
|
|
31
|
-
};
|
|
32
|
-
export { WhatsappSendMessageFunction };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/send-message/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { NodeData } from "../../../types/base-node";
|
|
3
|
-
export declare const WhatsappSendTemplateNodeSchema: z.ZodObject<{
|
|
4
|
-
phoneNumber: z.ZodString;
|
|
5
|
-
message: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export declare const WhatsappSendTemplateNode: NodeData;
|
|
8
|
-
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/send-template/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,wBAAwB,EAAE,QAoCtC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const WhatsappSendTemplateNodeSchema = z.object({
|
|
3
|
-
phoneNumber: z.string().describe("Phone number to send the message to"),
|
|
4
|
-
message: z.string().describe("Message to send"),
|
|
5
|
-
});
|
|
6
|
-
export const WhatsappSendTemplateNode = {
|
|
7
|
-
label: "Whatsapp Send Template",
|
|
8
|
-
type: "WhatsappSendTemplateNode",
|
|
9
|
-
category: "step",
|
|
10
|
-
description: "Send a template message to a WhatsApp number",
|
|
11
|
-
icon: "📱",
|
|
12
|
-
toolable: true,
|
|
13
|
-
group: 'Social',
|
|
14
|
-
tags: {
|
|
15
|
-
execution: 'async',
|
|
16
|
-
group: 'Social'
|
|
17
|
-
},
|
|
18
|
-
fields: [
|
|
19
|
-
{
|
|
20
|
-
id: "phoneNumber",
|
|
21
|
-
label: "Phone Number",
|
|
22
|
-
type: "string",
|
|
23
|
-
required: true,
|
|
24
|
-
placeholder: "e.g., +5511999999999",
|
|
25
|
-
handle: {
|
|
26
|
-
type: "input",
|
|
27
|
-
label: "Phone Number",
|
|
28
|
-
name: "phoneNumber",
|
|
29
|
-
fieldType: "string",
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: "template",
|
|
34
|
-
label: "Template",
|
|
35
|
-
type: "select",
|
|
36
|
-
required: true,
|
|
37
|
-
optionsSource: {
|
|
38
|
-
provider: "whatsapp.messageTemplates"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
]
|
|
42
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const WhatsappStartChatFunction: (fieldValues: any) => Promise<any>;
|
|
2
|
-
declare const getMessageTemplates: () => Promise<unknown>;
|
|
3
|
-
declare const createMessageTemplate: (payload: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
4
|
-
export { WhatsappStartChatFunction, getMessageTemplates, createMessageTemplate };
|
|
5
|
-
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/send-template/functions.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,yBAAyB,GAAU,aAAa,GAAG,KAAG,OAAO,CAAC,GAAG,CA6BtE,CAAA;AAED,QAAA,MAAM,mBAAmB,wBAWxB,CAAA;AAED,QAAA,MAAM,qBAAqB,GAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,qCAyBpE,CAAA;AAED,OAAO,EACH,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACxB,CAAA"}
|