@atomoz/workflows-nodes 0.1.12 → 0.1.14
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 +8 -8
- 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 -19
- package/src/nodes/consts/node-functions.d.ts.map +0 -1
- package/src/nodes/consts/node-functions.js +0 -27
- 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 -28
- 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,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"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const BUSINESS_ACCOUNT_ID = "1079341674316936";
|
|
2
|
-
const NUMBER_ID = "700207253183039";
|
|
3
|
-
const TOKEN = 'EAAUuy5eznhEBPQUOoF07SUTSVjgNIX9eZCWSKPYQhzHiXeEp4Qj3g47bZAPcZAgs8P2B5cZBH9YJjzq0HKNXfA14kaK5Cp2DZCmxzV60MgWlsY1yKavb2qXAQcydoHTTLKcWO53w6ZB7JNzZBeIpZBTb9cB0teRzfX3kjrZBc7utyKq2ZCZCCOQ74pZA28gnmQYzp24oZBQpf7BmuNHgndFVlTba5drxgcpERyNl1dUIDhky7NIruggZDZD';
|
|
4
|
-
const WhatsappStartChatFunction = async (fieldValues) => {
|
|
5
|
-
const { phoneNumber, template } = fieldValues;
|
|
6
|
-
const response = await fetch(`https://graph.facebook.com/v23.0/${NUMBER_ID}/messages`, {
|
|
7
|
-
method: 'POST',
|
|
8
|
-
headers: {
|
|
9
|
-
'Authorization': `Bearer ${TOKEN}`,
|
|
10
|
-
'Content-Type': 'application/json'
|
|
11
|
-
},
|
|
12
|
-
body: JSON.stringify({
|
|
13
|
-
messaging_product: 'whatsapp',
|
|
14
|
-
to: phoneNumber,
|
|
15
|
-
type: 'template',
|
|
16
|
-
template: {
|
|
17
|
-
name: template,
|
|
18
|
-
language: {
|
|
19
|
-
code: 'pt_BR'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
const data = await response.json();
|
|
25
|
-
if (!response.ok) {
|
|
26
|
-
throw new Error(`Failed to start chat: ${response.statusText}`);
|
|
27
|
-
}
|
|
28
|
-
return data;
|
|
29
|
-
};
|
|
30
|
-
const getMessageTemplates = async () => {
|
|
31
|
-
const response = await fetch(`https://graph.facebook.com/v23.0/${BUSINESS_ACCOUNT_ID}/message_templates`, {
|
|
32
|
-
method: 'GET',
|
|
33
|
-
headers: {
|
|
34
|
-
'Authorization': `Bearer ${TOKEN}`,
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const data = await response.json();
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
const createMessageTemplate = async (payload) => {
|
|
41
|
-
const response = await fetch(`https://graph.facebook.com/v23.0/${BUSINESS_ACCOUNT_ID}/message_templates`, {
|
|
42
|
-
method: 'POST',
|
|
43
|
-
headers: {
|
|
44
|
-
'Authorization': `Bearer ${TOKEN}`,
|
|
45
|
-
'Content-Type': 'application/json'
|
|
46
|
-
},
|
|
47
|
-
body: JSON.stringify(payload)
|
|
48
|
-
});
|
|
49
|
-
const data = (await response.json());
|
|
50
|
-
if (!response.ok) {
|
|
51
|
-
const errObj = data.error;
|
|
52
|
-
const msg = errObj?.message || response.statusText;
|
|
53
|
-
const enriched = new Error(`Failed to create template: ${msg}`);
|
|
54
|
-
enriched.details = data;
|
|
55
|
-
enriched.status = response.status;
|
|
56
|
-
throw enriched;
|
|
57
|
-
}
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
export { WhatsappStartChatFunction, getMessageTemplates, createMessageTemplate };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/nodes/src/nodes/social/whatsapp/send-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAe,aAAa,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NodeField, NodeTags } from './base-node.types';
|
|
2
|
-
export type NodeData = {
|
|
3
|
-
nodeId?: string;
|
|
4
|
-
label: string;
|
|
5
|
-
type: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
category: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
toolable?: boolean;
|
|
10
|
-
tags?: NodeTags;
|
|
11
|
-
fields?: NodeField[];
|
|
12
|
-
value?: any;
|
|
13
|
-
friendlyId?: string;
|
|
14
|
-
data?: any;
|
|
15
|
-
group?: string;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=base-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-node.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/types/base-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|