@atomoz/workflows-nodes 0.1.10 → 0.1.12

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.
Files changed (200) hide show
  1. package/package.json +51 -50
  2. package/src/index.d.ts +2 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +1 -0
  5. package/src/nodes/consts/index.d.ts +3 -0
  6. package/src/nodes/consts/index.d.ts.map +1 -0
  7. package/src/nodes/consts/index.js +2 -0
  8. package/src/nodes/consts/node-colors.d.ts +7 -0
  9. package/src/nodes/consts/node-colors.d.ts.map +1 -0
  10. package/src/nodes/consts/node-colors.js +6 -0
  11. package/src/nodes/consts/node-functions.d.ts +19 -0
  12. package/src/nodes/consts/node-functions.d.ts.map +1 -0
  13. package/src/nodes/consts/node-functions.js +27 -0
  14. package/src/nodes/consts/nodes.d.ts +3 -0
  15. package/src/nodes/consts/nodes.d.ts.map +1 -0
  16. package/src/nodes/consts/nodes.js +28 -0
  17. package/src/nodes/consts/schemas.d.ts +30 -0
  18. package/src/nodes/consts/schemas.d.ts.map +1 -0
  19. package/src/nodes/consts/schemas.js +7 -0
  20. package/src/nodes/ia/agent/data.d.ts +11 -0
  21. package/src/nodes/ia/agent/data.d.ts.map +1 -0
  22. package/src/nodes/ia/agent/data.js +111 -0
  23. package/src/nodes/ia/agent/function.d.ts +2 -0
  24. package/src/nodes/ia/agent/function.d.ts.map +1 -0
  25. package/src/nodes/ia/agent/function.js +90 -0
  26. package/src/nodes/ia/agent/index.d.ts +3 -0
  27. package/src/nodes/ia/agent/index.d.ts.map +1 -0
  28. package/src/nodes/ia/agent/index.js +2 -0
  29. package/src/nodes/ia/index.d.ts +5 -0
  30. package/src/nodes/ia/index.d.ts.map +1 -0
  31. package/src/nodes/ia/index.js +4 -0
  32. package/src/nodes/ia/message/index.d.ts +2 -0
  33. package/src/nodes/ia/message/index.d.ts.map +1 -0
  34. package/src/nodes/ia/message/index.js +1 -0
  35. package/src/nodes/ia/message/message.d.ts +10 -0
  36. package/src/nodes/ia/message/message.d.ts.map +1 -0
  37. package/src/nodes/ia/message/message.js +118 -0
  38. package/src/nodes/ia/supervisor/data.d.ts +10 -0
  39. package/src/nodes/ia/supervisor/data.d.ts.map +1 -0
  40. package/src/nodes/ia/supervisor/data.js +84 -0
  41. package/src/nodes/ia/supervisor/function.d.ts +2 -0
  42. package/src/nodes/ia/supervisor/function.d.ts.map +1 -0
  43. package/src/nodes/ia/supervisor/function.js +227 -0
  44. package/src/nodes/ia/supervisor/index.d.ts +3 -0
  45. package/src/nodes/ia/supervisor/index.d.ts.map +1 -0
  46. package/src/nodes/ia/supervisor/index.js +2 -0
  47. package/src/nodes/ia/tool/data.d.ts +16 -0
  48. package/src/nodes/ia/tool/data.d.ts.map +1 -0
  49. package/src/nodes/ia/tool/data.js +70 -0
  50. package/src/nodes/ia/tool/function.d.ts +4 -0
  51. package/src/nodes/ia/tool/function.d.ts.map +1 -0
  52. package/src/nodes/ia/tool/function.js +36 -0
  53. package/src/nodes/ia/tool/index.d.ts +3 -0
  54. package/src/nodes/ia/tool/index.d.ts.map +1 -0
  55. package/src/nodes/ia/tool/index.js +2 -0
  56. package/src/nodes/index.d.ts +9 -0
  57. package/src/nodes/index.d.ts.map +1 -0
  58. package/src/nodes/index.js +8 -0
  59. package/src/nodes/inputs/chat/chat.d.ts +4 -0
  60. package/src/nodes/inputs/chat/chat.d.ts.map +1 -0
  61. package/src/nodes/inputs/chat/chat.js +51 -0
  62. package/src/nodes/inputs/http/delete/data.d.ts +3 -0
  63. package/src/nodes/inputs/http/delete/data.d.ts.map +1 -0
  64. package/src/nodes/inputs/http/delete/data.js +57 -0
  65. package/src/nodes/inputs/http/delete/function.d.ts +2 -0
  66. package/src/nodes/inputs/http/delete/function.d.ts.map +1 -0
  67. package/src/nodes/inputs/http/delete/function.js +28 -0
  68. package/src/nodes/inputs/http/delete/index.d.ts +4 -0
  69. package/src/nodes/inputs/http/delete/index.d.ts.map +1 -0
  70. package/src/nodes/inputs/http/delete/index.js +3 -0
  71. package/src/nodes/inputs/http/delete/schema.d.ts +16 -0
  72. package/src/nodes/inputs/http/delete/schema.d.ts.map +1 -0
  73. package/src/nodes/inputs/http/delete/schema.js +7 -0
  74. package/src/nodes/inputs/http/get/data.d.ts +3 -0
  75. package/src/nodes/inputs/http/get/data.d.ts.map +1 -0
  76. package/src/nodes/inputs/http/get/data.js +58 -0
  77. package/src/nodes/inputs/http/get/function.d.ts +2 -0
  78. package/src/nodes/inputs/http/get/function.d.ts.map +1 -0
  79. package/src/nodes/inputs/http/get/function.js +25 -0
  80. package/src/nodes/inputs/http/get/index.d.ts +4 -0
  81. package/src/nodes/inputs/http/get/index.d.ts.map +1 -0
  82. package/src/nodes/inputs/http/get/index.js +3 -0
  83. package/src/nodes/inputs/http/get/schema.d.ts +16 -0
  84. package/src/nodes/inputs/http/get/schema.d.ts.map +1 -0
  85. package/src/nodes/inputs/http/get/schema.js +7 -0
  86. package/src/nodes/inputs/http/index.d.ts +8 -0
  87. package/src/nodes/inputs/http/index.d.ts.map +1 -0
  88. package/src/nodes/inputs/http/index.js +10 -0
  89. package/src/nodes/inputs/http/patch/data.d.ts +3 -0
  90. package/src/nodes/inputs/http/patch/data.d.ts.map +1 -0
  91. package/src/nodes/inputs/http/patch/data.js +70 -0
  92. package/src/nodes/inputs/http/patch/function.d.ts +2 -0
  93. package/src/nodes/inputs/http/patch/function.d.ts.map +1 -0
  94. package/src/nodes/inputs/http/patch/function.js +36 -0
  95. package/src/nodes/inputs/http/patch/index.d.ts +4 -0
  96. package/src/nodes/inputs/http/patch/index.d.ts.map +1 -0
  97. package/src/nodes/inputs/http/patch/index.js +3 -0
  98. package/src/nodes/inputs/http/patch/schema.d.ts +21 -0
  99. package/src/nodes/inputs/http/patch/schema.d.ts.map +1 -0
  100. package/src/nodes/inputs/http/patch/schema.js +8 -0
  101. package/src/nodes/inputs/http/post/data.d.ts +3 -0
  102. package/src/nodes/inputs/http/post/data.d.ts.map +1 -0
  103. package/src/nodes/inputs/http/post/data.js +70 -0
  104. package/src/nodes/inputs/http/post/function.d.ts +2 -0
  105. package/src/nodes/inputs/http/post/function.d.ts.map +1 -0
  106. package/src/nodes/inputs/http/post/function.js +36 -0
  107. package/src/nodes/inputs/http/post/index.d.ts +4 -0
  108. package/src/nodes/inputs/http/post/index.d.ts.map +1 -0
  109. package/src/nodes/inputs/http/post/index.js +3 -0
  110. package/src/nodes/inputs/http/post/schema.d.ts +21 -0
  111. package/src/nodes/inputs/http/post/schema.d.ts.map +1 -0
  112. package/src/nodes/inputs/http/post/schema.js +8 -0
  113. package/src/nodes/inputs/http/put/data.d.ts +3 -0
  114. package/src/nodes/inputs/http/put/data.d.ts.map +1 -0
  115. package/src/nodes/inputs/http/put/data.js +70 -0
  116. package/src/nodes/inputs/http/put/function.d.ts +2 -0
  117. package/src/nodes/inputs/http/put/function.d.ts.map +1 -0
  118. package/src/nodes/inputs/http/put/function.js +36 -0
  119. package/src/nodes/inputs/http/put/index.d.ts +4 -0
  120. package/src/nodes/inputs/http/put/index.d.ts.map +1 -0
  121. package/src/nodes/inputs/http/put/index.js +3 -0
  122. package/src/nodes/inputs/http/put/schema.d.ts +21 -0
  123. package/src/nodes/inputs/http/put/schema.d.ts.map +1 -0
  124. package/src/nodes/inputs/http/put/schema.js +8 -0
  125. package/src/nodes/inputs/http/schemas.d.ts +18 -0
  126. package/src/nodes/inputs/http/schemas.d.ts.map +1 -0
  127. package/src/nodes/inputs/http/schemas.js +17 -0
  128. package/src/nodes/inputs/http/utils.d.ts +21 -0
  129. package/src/nodes/inputs/http/utils.d.ts.map +1 -0
  130. package/src/nodes/inputs/http/utils.js +63 -0
  131. package/src/nodes/inputs/index.d.ts +5 -0
  132. package/src/nodes/inputs/index.d.ts.map +1 -0
  133. package/src/nodes/inputs/index.js +4 -0
  134. package/src/nodes/inputs/manual/trigger.d.ts +4 -0
  135. package/src/nodes/inputs/manual/trigger.d.ts.map +1 -0
  136. package/src/nodes/inputs/manual/trigger.js +39 -0
  137. package/src/nodes/output-node/index.d.ts +4 -0
  138. package/src/nodes/output-node/index.d.ts.map +1 -0
  139. package/src/nodes/output-node/index.js +123 -0
  140. package/src/nodes/outputs/chat/output.d.ts +4 -0
  141. package/src/nodes/outputs/chat/output.d.ts.map +1 -0
  142. package/src/nodes/outputs/chat/output.js +48 -0
  143. package/src/nodes/outputs/http-output.d.ts +4 -0
  144. package/src/nodes/outputs/http-output.d.ts.map +1 -0
  145. package/src/nodes/outputs/http-output.js +76 -0
  146. package/src/nodes/processors/concat.d.ts +9 -0
  147. package/src/nodes/processors/concat.d.ts.map +1 -0
  148. package/src/nodes/processors/concat.js +68 -0
  149. package/src/nodes/processors/custom-code.d.ts +4 -0
  150. package/src/nodes/processors/custom-code.d.ts.map +1 -0
  151. package/src/nodes/processors/custom-code.js +54 -0
  152. package/src/nodes/processors/index.d.ts +2 -0
  153. package/src/nodes/processors/index.d.ts.map +1 -0
  154. package/src/nodes/processors/index.js +1 -0
  155. package/src/nodes/processors/transform.d.ts +3 -0
  156. package/src/nodes/processors/transform.d.ts.map +1 -0
  157. package/src/nodes/processors/transform.js +48 -0
  158. package/src/nodes/social/index.d.ts +2 -0
  159. package/src/nodes/social/index.d.ts.map +1 -0
  160. package/src/nodes/social/index.js +1 -0
  161. package/src/nodes/social/whatsapp/index.d.ts +4 -0
  162. package/src/nodes/social/whatsapp/index.d.ts.map +1 -0
  163. package/src/nodes/social/whatsapp/index.js +3 -0
  164. package/src/nodes/social/whatsapp/message-trigger/data.d.ts +3 -0
  165. package/src/nodes/social/whatsapp/message-trigger/data.d.ts.map +1 -0
  166. package/src/nodes/social/whatsapp/message-trigger/data.js +55 -0
  167. package/src/nodes/social/whatsapp/message-trigger/index.d.ts +2 -0
  168. package/src/nodes/social/whatsapp/message-trigger/index.d.ts.map +1 -0
  169. package/src/nodes/social/whatsapp/message-trigger/index.js +1 -0
  170. package/src/nodes/social/whatsapp/send-message/data.d.ts +8 -0
  171. package/src/nodes/social/whatsapp/send-message/data.d.ts.map +1 -0
  172. package/src/nodes/social/whatsapp/send-message/data.js +46 -0
  173. package/src/nodes/social/whatsapp/send-message/functions.d.ts +3 -0
  174. package/src/nodes/social/whatsapp/send-message/functions.d.ts.map +1 -0
  175. package/src/nodes/social/whatsapp/send-message/functions.js +32 -0
  176. package/src/nodes/social/whatsapp/send-message/index.d.ts +3 -0
  177. package/src/nodes/social/whatsapp/send-message/index.d.ts.map +1 -0
  178. package/src/nodes/social/whatsapp/send-message/index.js +2 -0
  179. package/src/nodes/social/whatsapp/send-template/data.d.ts +8 -0
  180. package/src/nodes/social/whatsapp/send-template/data.d.ts.map +1 -0
  181. package/src/nodes/social/whatsapp/send-template/data.js +42 -0
  182. package/src/nodes/social/whatsapp/send-template/functions.d.ts +5 -0
  183. package/src/nodes/social/whatsapp/send-template/functions.d.ts.map +1 -0
  184. package/src/nodes/social/whatsapp/send-template/functions.js +60 -0
  185. package/src/nodes/social/whatsapp/send-template/index.d.ts +3 -0
  186. package/src/nodes/social/whatsapp/send-template/index.d.ts.map +1 -0
  187. package/src/nodes/social/whatsapp/send-template/index.js +2 -0
  188. package/src/nodes/types/base-node.d.ts +17 -0
  189. package/src/nodes/types/base-node.d.ts.map +1 -0
  190. package/src/nodes/types/base-node.js +1 -0
  191. package/src/nodes/types/base-node.types.d.ts +144 -0
  192. package/src/nodes/types/base-node.types.d.ts.map +1 -0
  193. package/src/nodes/types/base-node.types.js +1 -0
  194. package/src/utils/llm-factory.d.ts +16 -0
  195. package/src/utils/llm-factory.d.ts.map +1 -0
  196. package/src/utils/llm-factory.js +110 -0
  197. package/dist/index.cjs +0 -2154
  198. package/dist/index.d.cts +0 -429
  199. package/dist/index.d.ts +0 -429
  200. package/dist/index.js +0 -2063
@@ -0,0 +1,4 @@
1
+ import { NodeData } from "../types/base-node";
2
+ export declare const NodeFunction: (params: any) => any;
3
+ export declare const HttpOutputNode: NodeData;
4
+ //# sourceMappingURL=http-output.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,76 @@
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
+ };
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,68 @@
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
+ };
@@ -0,0 +1,4 @@
1
+ import { NodeData } from "../types/base-node";
2
+ export declare const NodeFunction: (params: any) => any;
3
+ export declare const CustomCodeNode: NodeData;
4
+ //# sourceMappingURL=custom-code.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,54 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ export * from './transform';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/processors/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './transform';
@@ -0,0 +1,3 @@
1
+ import { NodeData } from "../types/base-node";
2
+ export declare const TransformNode: NodeData;
3
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,48 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ export * from './whatsapp';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/nodes/src/nodes/social/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './whatsapp';
@@ -0,0 +1,4 @@
1
+ export * from './send-template';
2
+ export * from './send-message';
3
+ export * from './message-trigger';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ export * from './send-template';
2
+ export * from './send-message';
3
+ export * from './message-trigger';
@@ -0,0 +1,3 @@
1
+ import { NodeData } from "../../../types/base-node";
2
+ export declare const WhatsappMessageTriggerNode: NodeData;
3
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,55 @@
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
@@ -0,0 +1,2 @@
1
+ export * from './data';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
1
+ export * from './data';
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,46 @@
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
+ };
@@ -0,0 +1,3 @@
1
+ declare const WhatsappSendMessageFunction: (fieldValues: any) => Promise<any>;
2
+ export { WhatsappSendMessageFunction };
3
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,32 @@
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 };
@@ -0,0 +1,3 @@
1
+ export * from './data';
2
+ export * from './functions';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export * from './data';
2
+ export * from './functions';
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,42 @@
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
+ };
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,60 @@
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 };
@@ -0,0 +1,3 @@
1
+ export * from './data';
2
+ export * from './functions';
3
+ //# sourceMappingURL=index.d.ts.map