mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 20:49:15 +00:00
Compare commits
1223 Commits
1.0
...
contributo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5b5578320 | ||
|
|
7e2bf22d63 | ||
|
|
a4b610e21f | ||
|
|
120520df50 | ||
|
|
1551aafd54 | ||
|
|
eca876db9c | ||
|
|
96a387ed50 | ||
|
|
558013b2b4 | ||
|
|
58df7ddc71 | ||
|
|
e25f3abf1c | ||
|
|
0f6b82a9ab | ||
|
|
8f505bdb2b | ||
|
|
24220822f4 | ||
|
|
943fe8698c | ||
|
|
371b403456 | ||
|
|
77145bcc54 | ||
|
|
8f241834e8 | ||
|
|
5174c6b3bb | ||
|
|
f3ed6da4ba | ||
|
|
0dc839e531 | ||
|
|
7475d6f8fd | ||
|
|
a6a33ac7b7 | ||
|
|
71c969f3e9 | ||
|
|
cebfed0382 | ||
|
|
e89ad450a1 | ||
|
|
ac39ac831c | ||
|
|
0af74602f5 | ||
|
|
767e0764d6 | ||
|
|
b2a3343f82 | ||
|
|
5ddd885554 | ||
|
|
7078dc4c93 | ||
|
|
c7e829e954 | ||
|
|
5a81a77802 | ||
|
|
588411653e | ||
|
|
3c4b1c0fc4 | ||
|
|
0f06fd3e80 | ||
|
|
79cc31a96f | ||
|
|
7067b4a80b | ||
|
|
aa7e4239ae | ||
|
|
877252bd4a | ||
|
|
f5a7de3a00 | ||
|
|
c792d47344 | ||
|
|
f6130cf0b9 | ||
|
|
9f9d833925 | ||
|
|
02c0d8af76 | ||
|
|
880d5323e8 | ||
|
|
9bb33582fb | ||
|
|
c8ff84e9cd | ||
|
|
e942bd1d5e | ||
|
|
7e557bdd30 | ||
|
|
fcd1a63676 | ||
|
|
4ade5f02a7 | ||
|
|
05c834d6b1 | ||
|
|
234cc3ffb6 | ||
|
|
e321f35d86 | ||
|
|
5edd755491 | ||
|
|
10748a46a4 | ||
|
|
5b3136999b | ||
|
|
cb047cca8e | ||
|
|
4b8c09633e | ||
|
|
7cabc53eed | ||
|
|
40c34dd7a5 | ||
|
|
7e25dcaa93 | ||
|
|
bfa622fad0 | ||
|
|
e88141077f | ||
|
|
d743fdcfe3 | ||
|
|
1261580004 | ||
|
|
a14c67ad45 | ||
|
|
c5af1f8107 | ||
|
|
01a4edb7e3 | ||
|
|
98793d0cfc | ||
|
|
168b81315b | ||
|
|
8520b09dac | ||
|
|
adb0e49029 | ||
|
|
464dd44ce2 | ||
|
|
e3c94a49d7 | ||
|
|
a29b9d4e1f | ||
|
|
e036817e84 | ||
|
|
18ef4e9d72 | ||
|
|
fe129f62fe | ||
|
|
bb6ed4a084 | ||
|
|
9234cf1c5d | ||
|
|
a118bbbf7f | ||
|
|
f54dea52b0 | ||
|
|
72e0a91050 | ||
|
|
70dd4d73e8 | ||
|
|
ecf0eef928 | ||
|
|
345f256a1b | ||
|
|
3648757fa0 | ||
|
|
32f6a70f8f | ||
|
|
8c825e7f6b | ||
|
|
0c0f4375b8 | ||
|
|
039ce5dd7c | ||
|
|
5e879188b8 | ||
|
|
21a7270281 | ||
|
|
82a99b2c80 | ||
|
|
cc19974579 | ||
|
|
56fcb8fb72 | ||
|
|
f36cff1eef | ||
|
|
09fd0dd2e1 | ||
|
|
b393c11af6 | ||
|
|
6683715ad6 | ||
|
|
e72794a296 | ||
|
|
13e0530c01 | ||
|
|
e5ee70f088 | ||
|
|
bb1f60c6e3 | ||
|
|
b9a1703b20 | ||
|
|
f274379c53 | ||
|
|
d18efc88a9 | ||
|
|
03b5b441de | ||
|
|
06862abece | ||
|
|
d25307dd2d | ||
|
|
04c5209cac | ||
|
|
5362fcec7a | ||
|
|
2f8d5a3fb3 | ||
|
|
4f32e6f2c2 | ||
|
|
553d7fcba9 | ||
| d483b91359 | |||
|
|
6aed100d96 | ||
|
|
c8335c37c2 | ||
|
|
4a7c2fe553 | ||
|
|
a02e373cd9 | ||
| a9755da8c9 | |||
| 46a9fa6793 | |||
|
|
4ee1136115 | ||
|
|
b60db404a9 | ||
|
|
44efbd8518 | ||
|
|
8357eda573 | ||
|
|
05dbf2f240 | ||
|
|
b65c40e59b | ||
|
|
d8bb1418dd | ||
|
|
8f27d34081 | ||
|
|
ee30df73b8 | ||
|
|
8a1bdc5878 | ||
|
|
f742caa9a4 | ||
|
|
a1ce98bdc8 | ||
|
|
230981e267 | ||
|
|
7242ab92f7 | ||
|
|
d3c937579a | ||
| 1302491869 | |||
|
|
45cbc09b0e | ||
|
|
aaec075140 | ||
|
|
42b98801db | ||
|
|
b681be3f11 | ||
|
|
e442d05aa4 | ||
|
|
b682b0b6ba | ||
|
|
96b6430efe | ||
|
|
9723e9d908 | ||
|
|
1bea3401dc | ||
|
|
0f9e57df37 | ||
|
|
49b9b77543 | ||
|
|
804ea2b258 | ||
|
|
939cea03cc | ||
|
|
89cf909888 | ||
|
|
f323184b34 | ||
|
|
65ad00e4ec | ||
|
|
c4158cbac6 | ||
|
|
5a06d2cf88 | ||
|
|
675046cc58 | ||
| f430380b4f | |||
| 8a1c9f3b0e | |||
| eceb170df0 | |||
|
|
ef03478683 | ||
|
|
fb3e2913e3 | ||
|
|
9fb34cc9e0 | ||
|
|
3d2c3e1452 | ||
|
|
83e262b818 | ||
|
|
389169fc58 | ||
|
|
f80a051fa9 | ||
|
|
9688ec1844 | ||
|
|
288894ee8e | ||
|
|
f3151850d5 | ||
|
|
49e9c70d7c | ||
|
|
6a156183ad | ||
|
|
f029c7317a | ||
|
|
fea6276b89 | ||
|
|
4b8c1d0ec6 | ||
|
|
552a425cc0 | ||
|
|
7566059073 | ||
|
|
b321b03b2a | ||
|
|
edf5fdcbdc | ||
|
|
eb1fcbff22 | ||
|
|
68a6e4b241 | ||
|
|
837bbf3c36 | ||
|
|
c8c5a03bad | ||
|
|
353e25c204 | ||
|
|
be6c609570 | ||
|
|
c6f58e913d | ||
|
|
e2fec5d521 | ||
|
|
681ec2e1ab | ||
|
|
0dc5f99089 | ||
|
|
5c880eddf1 | ||
|
|
57fc150331 | ||
|
|
9704bc0f02 | ||
|
|
7d65fee978 | ||
|
|
faa3a21ffe | ||
|
|
84f689cee1 | ||
|
|
5175f66dd0 | ||
|
|
0af9ef2dae | ||
|
|
787cdc69a0 | ||
|
|
f8ceb01eca | ||
|
|
d52951adf9 | ||
|
|
c621d0ee24 | ||
|
|
f047ba6e71 | ||
|
|
401c012e00 | ||
|
|
39859f819c | ||
|
|
5b3e7cefde | ||
|
|
8436d7b0d3 | ||
|
|
135961daf0 | ||
|
|
375a997f25 | ||
|
|
625ca405fc | ||
|
|
8e3413ca80 | ||
|
|
09407401eb | ||
|
|
1fa17dc601 | ||
|
|
73f3e6245d | ||
|
|
afb127278a | ||
|
|
15bfb19853 | ||
|
|
d90a42b962 | ||
|
|
0619641f82 | ||
|
|
d00547866a | ||
|
|
ca978867ff | ||
|
|
af44ed1268 | ||
|
|
2a416bf751 | ||
|
|
2fc274725d | ||
|
|
ecde23fdea | ||
|
|
a73ff9c217 | ||
|
|
16e4575777 | ||
|
|
74a1301342 | ||
|
|
210c013290 | ||
|
|
bfb76c87a1 | ||
|
|
8f2eb6d4f2 | ||
|
|
44dfe8ed1a | ||
|
|
63ecac6f2b | ||
|
|
ac72c5e4e7 | ||
|
|
50d64596c7 | ||
|
|
a7801d1fa2 | ||
|
|
74e6aae631 | ||
|
|
c913d5ee5c | ||
|
|
eafd27c25a | ||
|
|
4289b7c3dd | ||
|
|
c793890c50 | ||
|
|
48a87fff26 | ||
|
|
98bff0285d | ||
|
|
f5b8e42608 | ||
|
|
6469c83552 | ||
|
|
dba33359a0 | ||
|
|
14f3893727 | ||
|
|
a6607f1896 | ||
|
|
9669cc0807 | ||
|
|
1ee05d925a | ||
|
|
3e18bc1f57 | ||
|
|
5872d860c9 | ||
|
|
caa2a42933 | ||
|
|
6b407a1d72 | ||
|
|
da67b75d98 | ||
|
|
28b5739f3f | ||
|
|
2d9da1e584 | ||
|
|
11bcb3f2c8 | ||
|
|
7731f4149e | ||
|
|
ae645643d5 | ||
|
|
9960227006 | ||
|
|
c0bbf5c48f | ||
|
|
512207207c | ||
|
|
200dd6b187 | ||
|
|
cad73dca99 | ||
|
|
2114f997db | ||
|
|
c5d4d82538 | ||
|
|
fdab223786 | ||
|
|
f4d1ae3199 | ||
|
|
527eac4962 | ||
|
|
8ef6d6b560 | ||
|
|
0d588f067f | ||
|
|
b4368fd30a | ||
|
|
b0dd007918 | ||
|
|
246ecdc11a | ||
|
|
891ea75f62 | ||
|
|
af8b401d07 | ||
|
|
3658efd98a | ||
|
|
fd044fb169 | ||
|
|
3fb0f2282c | ||
|
|
46ef98cb23 | ||
|
|
b61a4d7fa0 | ||
|
|
6417f8e63b | ||
|
|
20f752e6c1 | ||
|
|
2b37e5a29d | ||
|
|
8ec7c2108a | ||
|
|
dfc7847573 | ||
|
|
7a23eb0cc6 | ||
|
|
ab2a21ee42 | ||
|
|
249a97862f | ||
|
|
feb9ede912 | ||
|
|
03918fb091 | ||
|
|
1fee5b6bfa | ||
|
|
131d3b7f03 | ||
|
|
d794f604ac | ||
|
|
b2559731da | ||
|
|
f0c332e278 | ||
|
|
4450245d91 | ||
|
|
ca960cd80c | ||
|
|
4d721f99e2 | ||
|
|
cb2e8692a3 | ||
|
|
969ffe177f | ||
|
|
83383e2022 | ||
|
|
09aa3c8ca9 | ||
|
|
9e93795e6f | ||
|
|
3c178ea113 | ||
|
|
1f1f564f4e | ||
|
|
21cc0e3c7d | ||
|
|
40c51236db | ||
|
|
3de5f4b77a | ||
|
|
c6af472d42 | ||
|
|
1c5da9cc6a | ||
|
|
96bfb9af4e | ||
|
|
dd07526a3d | ||
|
|
fd935b9785 | ||
|
|
4e0d33c6bb | ||
|
|
5e6077dd8f | ||
|
|
41de8b9b5a | ||
|
|
5d0929efb4 | ||
|
|
5a033da83a | ||
|
|
8ff9cacae0 | ||
| f9e3bbc665 | |||
| e5f6cf8563 | |||
|
|
2ad57a8be1 | ||
|
|
4f2fbaf21b | ||
|
|
b7694d7857 | ||
|
|
b3eec37fa9 | ||
|
|
bdbf529cb6 | ||
|
|
4ff02d2bfa | ||
|
|
2ddea5468d | ||
|
|
391e11ce73 | ||
|
|
5d10cb9026 | ||
|
|
716349a839 | ||
|
|
9e0a61b7ba | ||
|
|
6ea377e9e5 | ||
|
|
8017426cfc | ||
|
|
b588479fd1 | ||
|
|
25f90e4162 | ||
|
|
b2e57396fb | ||
|
|
df786f7d34 | ||
|
|
930e120d70 | ||
|
|
0ebead27f5 | ||
|
|
397c143952 | ||
|
|
0451043a21 | ||
|
|
2cb032a5da | ||
|
|
a31ded6b02 | ||
|
|
e8e14d3b65 | ||
|
|
a6c10fe414 | ||
| b040790129 | |||
|
|
a71566f2ad | ||
|
|
cb0d0be786 | ||
|
|
2040f857a5 | ||
|
|
28a3a7a5e3 | ||
|
|
737b0b6055 | ||
|
|
bd5a01b7e4 | ||
|
|
3a74927b9d | ||
|
|
31a7b58709 | ||
|
|
acf13fb02f | ||
|
|
21773e244e | ||
|
|
345f626986 | ||
|
|
b72dcd75b7 | ||
|
|
2318a6f1e3 | ||
|
|
9b77b3f148 | ||
|
|
75ec60a1bf | ||
|
|
2c5f3a60b7 | ||
|
|
3cc79a7fd7 | ||
|
|
db7257638a | ||
|
|
59130952fa | ||
|
|
e07e6c5e19 | ||
|
|
190aae55e3 | ||
|
|
15c3747fbf | ||
|
|
d945f0ea79 | ||
|
|
99218b861a | ||
|
|
0feb51cfd0 | ||
|
|
54270c197e | ||
|
|
6940737d49 | ||
|
|
6e10a1084d | ||
|
|
ec2041b75a | ||
| d3eb10d1b3 | |||
|
|
983db5c7b8 | ||
| 95947cdefc | |||
|
|
53fe5b2e14 | ||
|
|
ba17e6c72c | ||
|
|
5e95b200cf | ||
|
|
8dad0a49b1 | ||
|
|
80d3f09480 | ||
|
|
d1b4cbf28b | ||
|
|
3202d45aa8 | ||
|
|
c05de8556f | ||
|
|
81c4ca968e | ||
|
|
ba61b6718d | ||
|
|
665e19fe5b | ||
|
|
7a6274e739 | ||
|
|
f2c8794c48 | ||
|
|
593858bcd2 | ||
|
|
3605f0d1f6 | ||
|
|
f77581fc9d | ||
|
|
b74bc67a94 | ||
|
|
2f9f2169f3 | ||
|
|
0f1c040bb8 | ||
|
|
62c16785a2 | ||
|
|
1d64a6b331 | ||
|
|
ccbf7a7754 | ||
|
|
eaefc734d9 | ||
|
|
8d6c34d8b9 | ||
|
|
77c6baf46b | ||
|
|
faa4ea0152 | ||
|
|
022a3b7d8e | ||
|
|
6e8e8090fb | ||
|
|
a3403dfd92 | ||
|
|
4756745200 | ||
|
|
0d07998a9e | ||
|
|
1cbccb0463 | ||
|
|
d84ee56778 | ||
|
|
aa5aa99d7f | ||
|
|
7d22a47408 | ||
|
|
bed4422e44 | ||
|
|
6d6a4aea84 | ||
|
|
d8d7afe3e4 | ||
|
|
7b7ff8da55 | ||
|
|
fdd38dd541 | ||
|
|
5ce9d82c6d | ||
|
|
54d84cd156 | ||
|
|
5ae588e9cb | ||
|
|
8e6d5cd159 | ||
|
|
f7da73050d | ||
|
|
8a7ee09211 | ||
|
|
1ba2219710 | ||
|
|
ae83774365 | ||
|
|
47a59dc989 | ||
| 49e55088c7 | |||
|
|
19fd788c0f | ||
| 445d3ba78c | |||
|
|
3c16f8f501 | ||
|
|
41c911f867 | ||
|
|
93745dcc14 | ||
|
|
b89aebb106 | ||
|
|
a20499bf35 | ||
|
|
d06294a15a | ||
|
|
dcbc070ea5 | ||
|
|
c84fd60237 | ||
|
|
3012e026b7 | ||
|
|
d94034d5bb | ||
| dbf291070e | |||
|
|
9d2f57da76 | ||
|
|
ceda946d78 | ||
|
|
b0fe63e70f | ||
|
|
eabef7a92d | ||
|
|
9afc5b5a00 | ||
|
|
1b878d2ba0 | ||
|
|
fe33c213b1 | ||
|
|
b0b7ea0e1b | ||
|
|
3d197e877e | ||
|
|
08de15d3d8 | ||
|
|
2a1436bf7c | ||
|
|
78b0a9dddc | ||
|
|
77be7ec7fb | ||
|
|
d8309f77e1 | ||
|
|
d49a91308d | ||
|
|
96a993eeb0 | ||
|
|
760586c819 | ||
|
|
3cef741c9e | ||
|
|
d307d2e7a3 | ||
|
|
fe1129e5ff | ||
|
|
57fd3e8aab | ||
|
|
9b087e0710 | ||
|
|
568978c0dc | ||
|
|
45f477e782 | ||
|
|
79f638d01b | ||
|
|
208fb4e913 | ||
|
|
a603e3b7dc | ||
|
|
38e2340782 | ||
|
|
43f870b1bb | ||
|
|
54a59c7f0d | ||
|
|
2850a34ead | ||
|
|
9242a54fc2 | ||
|
|
b0c0510420 | ||
|
|
4dda7c8491 | ||
|
|
0fee32e788 | ||
|
|
ebf53fd79f | ||
|
|
3d639b78f2 | ||
|
|
1c1a1e6954 | ||
|
|
4e1aeacc35 | ||
|
|
4dc65fd519 | ||
|
|
bd952243b7 | ||
|
|
641d9a2519 | ||
|
|
6940d33960 | ||
| 76a4216772 | |||
| ba2291a3dd | |||
|
|
0d6f702ff5 | ||
| 32db429f29 | |||
|
|
b5d8a6d28a | ||
| d04e7322cb | |||
|
|
f5eee8b6f5 | ||
|
|
78fb70bc1a | ||
|
|
99b18617e7 | ||
|
|
6a26aed929 | ||
|
|
bdf8abfca4 | ||
|
|
fa64d4e3fd | ||
|
|
55bef7c4e7 | ||
|
|
04b51046aa | ||
|
|
6b75bd10fa | ||
|
|
1415a3c915 | ||
|
|
a3c2c85d90 | ||
|
|
38cd1593a1 | ||
|
|
815bb9df84 | ||
|
|
b5016c7b98 | ||
|
|
b968d4cba2 | ||
|
|
adda5d8c64 | ||
|
|
f15e34020e | ||
|
|
65afdeb69e | ||
|
|
1a5c591294 | ||
|
|
b5bfeab57c | ||
|
|
c309d4fbda | ||
|
|
8f2734bfaa | ||
|
|
637c13e81c | ||
|
|
3248dce03d | ||
|
|
928365dcaf | ||
|
|
e37f28096c | ||
|
|
ea1c0bf99b | ||
|
|
aff9f19d8e | ||
|
|
3324ebbb7d | ||
|
|
5633f7c71c | ||
|
|
b659cc9b15 | ||
|
|
c42591000a | ||
|
|
eaf6e084c1 | ||
|
|
ee5b69dbf3 | ||
|
|
e0a34d8d8d | ||
|
|
30e4c20669 | ||
|
|
b2f9f7158b | ||
|
|
229e017ae2 | ||
|
|
dacc7af87b | ||
|
|
e54f1fff51 | ||
|
|
cfde8b213c | ||
|
|
7d96a2c8d9 | ||
|
|
e596526762 | ||
|
|
230bfc16eb | ||
|
|
2cbc96245d | ||
|
|
952ce86ffa | ||
|
|
c62af73c16 | ||
|
|
20f665175c | ||
|
|
11c784f882 | ||
|
|
a6f4aa8d1e | ||
|
|
41e95a606d | ||
|
|
33c0fc09d0 | ||
|
|
751ae00df3 | ||
|
|
e17fb93b47 | ||
|
|
5088b9ff1b | ||
|
|
0db9a190cb | ||
|
|
27ad84fc6c | ||
|
|
447e75f97d | ||
|
|
a60c891a86 | ||
|
|
480d96771f | ||
|
|
5c620342a4 | ||
|
|
d39feb78f0 | ||
|
|
3af618d466 | ||
|
|
30f9975738 | ||
|
|
18a59b85cb | ||
|
|
2563e3ed84 | ||
|
|
c382ca3ca2 | ||
|
|
ab7ad81efb | ||
|
|
91cafe5bb9 | ||
|
|
83fb510a39 | ||
|
|
9a0ba42705 | ||
|
|
e8d625201e | ||
|
|
f1addf6746 | ||
|
|
6c50148143 | ||
|
|
8bc233a79a | ||
|
|
4abb29f8db | ||
|
|
1c976f28f0 | ||
|
|
98440bbd16 | ||
|
|
069b59e71d | ||
|
|
96b569766c | ||
|
|
939c9cbae5 | ||
|
|
be39e8fd30 | ||
|
|
279b93b61b | ||
|
|
5b796a163e | ||
|
|
305d957e11 | ||
|
|
54d1f57a54 | ||
|
|
4896284a23 | ||
|
|
5aa348be0d | ||
|
|
846cecdcab | ||
|
|
954e6b3a98 | ||
|
|
b58e0cc048 | ||
|
|
8b3c02d027 | ||
|
|
086c1c3a36 | ||
|
|
edf45774ba | ||
|
|
7f437d0587 | ||
|
|
14c818102c | ||
|
|
8ce5d43d6b | ||
|
|
b6fd8e2632 | ||
|
|
e5efdec31d | ||
|
|
de43077860 | ||
|
|
d7cb5b285e | ||
|
|
21407c0e37 | ||
|
|
484c8c3bde | ||
|
|
6499248983 | ||
|
|
f2137d310d | ||
|
|
69fd81a565 | ||
|
|
d522b03e2e | ||
|
|
e62351bbc8 | ||
|
|
2db0e10626 | ||
|
|
e331c2dcc4 | ||
|
|
eacf5ded69 | ||
|
|
bb7161b8f3 | ||
|
|
3cdff95f0f | ||
|
|
512c923095 | ||
|
|
aa522059bb | ||
|
|
15d06c6674 | ||
|
|
52eacfc8c9 | ||
|
|
78ddf742db | ||
|
|
2d2bb085cd | ||
|
|
9dc1ac5c42 | ||
|
|
3cc386acd4 | ||
|
|
887b0335b4 | ||
|
|
42931ca689 | ||
|
|
c3e44f764b | ||
|
|
8b6a27b0a7 | ||
|
|
e4ed904a8b | ||
|
|
4be1906914 | ||
|
|
eba032b3b8 | ||
|
|
666d689986 | ||
|
|
351e2b97d0 | ||
|
|
7d2aecf369 | ||
|
|
917942139f | ||
|
|
d117bdd463 | ||
|
|
68eee0f36d | ||
|
|
ecf2a16b3d | ||
|
|
eba92299cf | ||
|
|
88ff3a43a0 | ||
|
|
ba02496222 | ||
|
|
c20e151e20 | ||
|
|
2cf7f5e668 | ||
|
|
b336586de3 | ||
|
|
69557968ab | ||
|
|
9223b0dda7 | ||
|
|
146f2ba489 | ||
|
|
6403b83c23 | ||
|
|
0e111b2bb7 | ||
|
|
b2a0b351ee | ||
|
|
5be76e9d2d | ||
|
|
be124cd7a2 | ||
| 377d819038 | |||
|
|
33ad9c7703 | ||
|
|
458fd30178 | ||
| c539fc3788 | |||
| 6656676123 | |||
| 26dbfcdc72 | |||
| a256b78e5f | |||
| 9577aba145 | |||
| 2f30b995e2 | |||
| c410e9763c | |||
|
|
c308834e6d | ||
|
|
748262302c | ||
|
|
111368e9e4 | ||
|
|
70eebe58b9 | ||
|
|
67d47a6630 | ||
|
|
3dcb247ef9 | ||
|
|
15d31d6047 | ||
|
|
65ffbc358d | ||
|
|
0353d0994d | ||
|
|
160adee406 | ||
|
|
5ee5973911 | ||
|
|
331e5b0f8e | ||
|
|
4d8cf623ff | ||
|
|
9885872991 | ||
|
|
d1e2fbc750 | ||
|
|
6aa78233ff | ||
|
|
e9539cab8b | ||
|
|
386c1bbbac | ||
|
|
3bdc7afe80 | ||
|
|
1b23b83746 | ||
|
|
37fe32322e | ||
|
|
9b30e7dcfc | ||
|
|
478929d134 | ||
|
|
16e5d4b176 | ||
|
|
0b4e35308d | ||
|
|
1ec15647dc | ||
|
|
9ad4874fda | ||
|
|
4d34d3ab1d | ||
|
|
772e52358d | ||
|
|
24b59b1ecb | ||
|
|
f200be76f4 | ||
|
|
c344ef3677 | ||
|
|
388f56f183 | ||
|
|
2eab155cc9 | ||
| 3cca0d3d14 | |||
|
|
b62d21a0bf | ||
|
|
0c94647a27 | ||
|
|
2f633c72da | ||
|
|
7d6708c01b | ||
|
|
798f1cebde | ||
|
|
78aa23fab0 | ||
|
|
b6bf43d70f | ||
|
|
d9aa97c781 | ||
|
|
964a074aa4 | ||
|
|
b4aea18b63 | ||
| 4fc3a6332b | |||
| 42a1f6502f | |||
| 50c975c8bd | |||
| aed0f76dfb | |||
|
|
954e751f70 | ||
| b2f1339610 | |||
|
|
1f61e1a8ea | ||
|
|
63aacdbcaf | ||
|
|
290812bf9a | ||
|
|
be3c228e9e | ||
|
|
e585e2f5f6 | ||
|
|
ed36ce0a77 | ||
|
|
bad16943fc | ||
|
|
a21633fb7c | ||
|
|
96e220cd71 | ||
|
|
0e69d894e1 | ||
| 8160d13c86 | |||
| dcf65b87bc | |||
| a8b29ee1ce | |||
| b59d4fcdd7 | |||
| 2f730ae71e | |||
|
|
6c4845d733 | ||
|
|
91bfdc4630 | ||
|
|
ff65832012 | ||
|
|
68dd1820f0 | ||
|
|
663641a1b8 | ||
|
|
694284488d | ||
|
|
9f8693d63d | ||
|
|
21ec4d1bdd | ||
|
|
bf07c664d1 | ||
|
|
c7e56a4b13 | ||
| fc56c3f042 | |||
|
|
4ec6f1e120 | ||
|
|
1032a3b769 | ||
| cc809368f0 | |||
|
|
6051da99c8 | ||
|
|
942d7e539a | ||
|
|
85f50be9dc | ||
|
|
a52aaa11d8 | ||
|
|
5b15527d78 | ||
|
|
25fc864f66 | ||
| 0581d63942 | |||
|
|
83c247377a | ||
|
|
032dc384b7 | ||
|
|
e3cbf6af01 | ||
|
|
188ff4fb7d | ||
|
|
73e079e93a | ||
|
|
911965b48e | ||
|
|
186477f04d | ||
|
|
2b13d58077 | ||
| 4e0a1091ee | |||
|
|
a7d4103eb3 | ||
|
|
8328f5a078 | ||
|
|
7e5533e46e | ||
|
|
b041f7d0c7 | ||
|
|
3842bb6889 | ||
|
|
71d43b585a | ||
|
|
438607c222 | ||
| e79b881297 | |||
| 99f508f938 | |||
|
|
b7e1ae534a | ||
|
|
77af8f9488 | ||
|
|
dabb0cf131 | ||
|
|
55985083ec | ||
|
|
1fa234c870 | ||
|
|
7890eae03a | ||
|
|
a80225f40e | ||
|
|
467cd23457 | ||
|
|
407e9065e7 | ||
|
|
5433610a84 | ||
|
|
a42b6f4af8 | ||
|
|
fbaef0f60c | ||
|
|
342cbccff1 | ||
| 663f20cc43 | |||
|
|
73671b26ef | ||
|
|
06acec2bf2 | ||
|
|
c868f73462 | ||
|
|
93a990e229 | ||
|
|
00c587fbf2 | ||
|
|
e6fefb4049 | ||
|
|
2d5ac2664b | ||
|
|
4d4f15ce73 | ||
|
|
a30eaac775 | ||
|
|
5da4b7a4d1 | ||
|
|
4e0fcbd834 | ||
|
|
041bf6280e | ||
|
|
e37fd0da36 | ||
|
|
ca6afbb87f | ||
|
|
66f75f8722 | ||
|
|
b8ea8283eb | ||
|
|
3e0781fde6 | ||
|
|
f50658c0ba | ||
|
|
4819dfebda | ||
|
|
25fb0d6ece | ||
|
|
29fd94a0e1 | ||
|
|
851052b3d2 | ||
|
|
a43444bb3e | ||
|
|
c2a6c6872d | ||
| d5a614e5f8 | |||
| c97a172b34 | |||
|
|
31c83f5d68 | ||
|
|
1b83871cca | ||
|
|
337c2e94bc | ||
|
|
01fe9ebc9a | ||
|
|
23b2e8e439 | ||
|
|
f799498dec | ||
| 17466138dd | |||
| 63ca8e8892 | |||
| 60fdbf3d3c | |||
|
|
e8c249897d | ||
| 55d12810d9 | |||
| 639e2defa7 | |||
| b97d8ba8f1 | |||
|
|
f05b76936a | ||
|
|
0a4e1e052a | ||
|
|
28d88c282c | ||
|
|
a2be57f0aa | ||
|
|
670ecf121b | ||
|
|
79e2318256 | ||
|
|
87ba43a553 | ||
|
|
acc1d37e4f | ||
|
|
c578d039c0 | ||
|
|
162067104e | ||
|
|
ea677b6eea | ||
|
|
a82b1cfb57 | ||
| 61d0324261 | |||
|
|
4d692e0a26 | ||
|
|
9de7eada87 | ||
|
|
8f81d995a4 | ||
|
|
024f13691d | ||
|
|
4aa91cb22a | ||
|
|
9ecafe5fc8 | ||
|
|
d039e2aacd | ||
|
|
5173a6c467 | ||
|
|
1d08682393 | ||
|
|
0bb251b4d5 | ||
|
|
04baa7f6fd | ||
|
|
32212fb52d | ||
|
|
aa61a1e1b5 | ||
|
|
f0a0bacec9 | ||
|
|
ec32dc429f | ||
|
|
5ecf9c6ba7 | ||
|
|
d233cbac22 | ||
|
|
10098f018f | ||
|
|
70de13ef6a | ||
|
|
f912fd328f | ||
|
|
6a86da2851 | ||
|
|
1a2a246bf8 | ||
|
|
248d04b666 | ||
|
|
41e96ad027 | ||
|
|
f2fd254d17 | ||
|
|
7790391b50 | ||
|
|
b827a0ab22 | ||
|
|
4142ca4fd5 | ||
|
|
fee7c2e967 | ||
|
|
091544ac3f | ||
|
|
2ce342a0cb | ||
|
|
781779328f | ||
|
|
dfced8c594 | ||
|
|
aaa4ce8372 | ||
|
|
9ddf144244 | ||
|
|
b465de55a0 | ||
|
|
cf1dc6fac8 | ||
|
|
739c63d025 | ||
|
|
8d897f824e | ||
|
|
5303dd7d25 | ||
|
|
aad129ea94 | ||
|
|
e48b29ed29 | ||
|
|
c64560bfc3 | ||
|
|
255ba86506 | ||
|
|
cd2dad9d26 | ||
|
|
c7ff6b4794 | ||
|
|
0246fc0b91 | ||
|
|
2858e910dc | ||
|
|
628d55df37 | ||
|
|
0059a1e7fb | ||
|
|
73ea7c0063 | ||
|
|
cb9f4befa0 | ||
|
|
decccb672a | ||
|
|
51466bf1c7 | ||
|
|
397798790e | ||
|
|
d3b8310180 | ||
|
|
7797c2b461 | ||
|
|
929e74c84b | ||
| 08e2552907 | |||
| 6617107ab8 | |||
|
|
8921959ea0 | ||
|
|
ec46cfdd65 | ||
|
|
bfb69d9a95 | ||
|
|
15f6972257 | ||
|
|
2319db3009 | ||
|
|
9cb98b5e73 | ||
|
|
2999e0e753 | ||
|
|
af716b7537 | ||
|
|
c6999c8493 | ||
|
|
d4b49a9bd7 | ||
|
|
eebc3c9806 | ||
|
|
257f1cc12d | ||
|
|
1036273a28 | ||
|
|
1b8ed93367 | ||
|
|
8c1820c879 | ||
|
|
e5a9db7e12 | ||
|
|
9d5aa7db5d | ||
|
|
40b0d9691e | ||
|
|
2e906bce79 | ||
|
|
33490dc737 | ||
|
|
f05ff4cf88 | ||
|
|
5735b49e25 | ||
|
|
1988948c30 | ||
|
|
cb33c0df68 | ||
|
|
f4ad7040ab | ||
|
|
b3b458e41c | ||
|
|
b115dc3654 | ||
|
|
8c6023e93b | ||
|
|
5d7c297f2f | ||
|
|
04f99d5ed2 | ||
|
|
bb3f21b056 | ||
|
|
cf6188d860 | ||
|
|
294bfbb35f | ||
|
|
230538bcea | ||
|
|
5e7aa72494 | ||
|
|
3159ea5665 | ||
|
|
4b307efe79 | ||
|
|
0105dab2c4 | ||
|
|
6e8e16c9a4 | ||
|
|
8d73c86946 | ||
|
|
a7b19d9bff | ||
|
|
4b7de0f690 | ||
|
|
520145bf7d | ||
|
|
e8aed880d8 | ||
|
|
babff11c70 | ||
|
|
b24c005e3e | ||
|
|
2d6c1879ce | ||
|
|
f88607c2c2 | ||
|
|
b3c13d5f98 | ||
|
|
2253d57fed | ||
|
|
0fb93f66a3 | ||
|
|
501887300d | ||
|
|
14b6247106 | ||
|
|
eda8a67718 | ||
|
|
73caf090ba | ||
|
|
afa6771903 | ||
|
|
8dd3be909b | ||
|
|
88af2469cb | ||
|
|
999d6742b4 | ||
|
|
24ac9fbf48 | ||
|
|
ee87e9e875 | ||
|
|
1884832192 | ||
|
|
4350dff22a | ||
|
|
30e3d443bb | ||
|
|
f5ea7fe2c4 | ||
|
|
94d139e484 | ||
|
|
8049241f3f | ||
|
|
28d308ed4b | ||
|
|
e0862053d0 | ||
|
|
e0e76d3a56 | ||
|
|
242e44315b | ||
|
|
6b53ed13e2 | ||
|
|
fafccbcecc | ||
|
|
49698bfda9 | ||
|
|
4154cc2230 | ||
|
|
ce8a96b958 | ||
|
|
f373a3abc7 | ||
|
|
371ee0a780 | ||
|
|
327cf5730b | ||
|
|
5e1a373730 | ||
|
|
f21a58b6ff | ||
|
|
717a7dc95f | ||
|
|
aa2417af12 | ||
|
|
f2533f1ed5 | ||
|
|
7d41699207 | ||
|
|
f9ccfef8e0 | ||
|
|
468a2ba251 | ||
|
|
08dbdcf4ae | ||
|
|
50d73f7bc8 | ||
|
|
d7ed9ff592 | ||
|
|
05c6fd4528 | ||
|
|
a99f424901 | ||
|
|
648354500b | ||
|
|
28c0480b8b | ||
|
|
f29ed6e29b | ||
|
|
903b4d79ac | ||
|
|
026c189901 | ||
|
|
f2b30ee349 | ||
|
|
5c02a9325a | ||
|
|
7645c8642f | ||
|
|
c5ebbe319f | ||
|
|
6f36eb1690 | ||
|
|
18f9e006a3 | ||
|
|
a7e334ebe9 | ||
|
|
a5e15d9d84 | ||
|
|
b3173517b4 | ||
|
|
06d2963163 | ||
|
|
df8282015d | ||
|
|
81b0aab850 | ||
|
|
a8705c5b44 | ||
|
|
efe739f9fc | ||
|
|
2e83a0508a | ||
|
|
d66adb2a1f | ||
|
|
e5cecdee03 | ||
|
|
9351af16b7 | ||
|
|
ad8831a75a | ||
|
|
c63018ff08 | ||
|
|
131bce3898 | ||
|
|
fff9316030 | ||
|
|
2b3148dc3c | ||
|
|
13a4202f08 | ||
|
|
f0df143aaf | ||
|
|
70a94ab2c6 | ||
|
|
e6d18d1a72 | ||
|
|
46cd57fb36 | ||
|
|
4ae389846d | ||
|
|
37d04e9e89 | ||
|
|
39d141ca67 | ||
|
|
befcc169e0 | ||
|
|
6bbb9c1b81 | ||
|
|
bb77afc4d2 | ||
|
|
b43697fd68 | ||
|
|
86eebbead6 | ||
|
|
7463b8badc | ||
|
|
37e857f093 | ||
|
|
2db240b32e | ||
|
|
3c5f6031e1 | ||
|
|
b25fee0d86 | ||
|
|
a6ee58ff28 | ||
|
|
fdb083f2a3 | ||
|
|
ee32a35a42 | ||
|
|
d17b41da38 | ||
|
|
870184b2a5 | ||
|
|
e787691efc | ||
|
|
859716e6c7 | ||
|
|
aab91b3842 | ||
|
|
f9dd0a6b03 | ||
|
|
f55cfae6e4 | ||
|
|
671c5b37f3 | ||
|
|
46c4ec7ab9 | ||
|
|
1856bd5022 | ||
|
|
21cfc498e8 | ||
|
|
ec7007071e | ||
|
|
e33509789c | ||
|
|
9fddcef271 | ||
|
|
d2acb641c5 | ||
|
|
82a6b634a9 | ||
|
|
f466b0cf7b | ||
|
|
b3f6fc852b | ||
|
|
976d892061 | ||
|
|
2a0a9e79da | ||
|
|
8d24093aec | ||
|
|
c6b23d353a | ||
|
|
b6a21b9c12 | ||
|
|
14fbae3c86 | ||
|
|
1dd88d117d | ||
|
|
f6d70b4f7d | ||
|
|
368bf29e63 | ||
|
|
c40c0c54bd | ||
|
|
0c850d47d7 | ||
|
|
4879df040f | ||
|
|
8a4f134327 | ||
|
|
7cf013e52b | ||
|
|
4e0a1a59e0 | ||
|
|
6953c954a8 | ||
|
|
e3664cc973 | ||
|
|
417d938677 | ||
|
|
2042abb045 | ||
|
|
0f5efa9852 | ||
|
|
76968ded02 | ||
|
|
ce8e7be9d7 | ||
|
|
1290d6b478 | ||
|
|
a5c38658a8 | ||
|
|
5797beb0ca | ||
|
|
9178bc083e | ||
|
|
878840fc06 | ||
|
|
716f0587c3 | ||
|
|
03eed5131a | ||
|
|
3946c88ed7 | ||
|
|
59182f20f3 | ||
|
|
a20b128ee8 | ||
|
|
1edd9ab371 | ||
|
|
da8defc517 | ||
|
|
45272fb34f | ||
|
|
a8dc44b41e | ||
|
|
1954a5a90a | ||
|
|
228530a454 | ||
|
|
4216cdd1e5 | ||
|
|
6afb019f9d | ||
|
|
8410309e38 | ||
|
|
ceb6faa5af | ||
|
|
9de4777cdb | ||
|
|
83df967247 | ||
|
|
39e2356feb | ||
|
|
24484015b3 | ||
|
|
30e7b220cd | ||
|
|
576092fc96 | ||
|
|
2114800b84 | ||
|
|
d9492eeee6 | ||
|
|
2442b59a5f | ||
|
|
1c01e27a65 | ||
|
|
0a9b1907d7 | ||
|
|
0a9e14c460 | ||
|
|
33797ce9de | ||
|
|
97ff1402f8 | ||
|
|
5fa6660afd | ||
|
|
9b6ce92612 | ||
|
|
c05470c045 | ||
|
|
e24e648e07 | ||
|
|
a4d51304b9 | ||
|
|
4210214735 | ||
|
|
403dea665d | ||
|
|
5704300d75 | ||
|
|
deb238d423 | ||
|
|
b678041e68 | ||
|
|
df5fe085a8 | ||
|
|
46ee2c6dd0 | ||
|
|
eccbe59a1a | ||
|
|
3e2869b54a | ||
|
|
96b8a7626c | ||
|
|
7593d6e564 | ||
|
|
e00aacfe3e | ||
|
|
860c2bc8fb | ||
|
|
710f1b9f90 | ||
|
|
4e87ca790e | ||
|
|
5974f3c9f2 | ||
|
|
62f1b7eb88 | ||
|
|
1e9574e740 | ||
|
|
b6207ba447 | ||
|
|
7fe2611aed | ||
|
|
860bd8539f | ||
|
|
ceade85334 | ||
|
|
5dc81f60c0 | ||
|
|
40b08622ec | ||
|
|
a12d5dbb78 | ||
|
|
663fcafc9c | ||
|
|
f36ddd3014 | ||
|
|
3fadaaaf13 | ||
|
|
dfa569f29d | ||
|
|
601508f379 | ||
|
|
e7ad205268 | ||
|
|
f62ba0a076 | ||
|
|
a9efa0aa58 | ||
|
|
3276c21bc3 | ||
|
|
1114f25a71 | ||
|
|
f13a34ff75 | ||
|
|
d45ea85e7d | ||
|
|
10e2b138d3 | ||
|
|
a1bf5ba5c2 | ||
|
|
19102b7b3a | ||
|
|
5efcc2a9a6 | ||
|
|
8279c07a88 | ||
|
|
02d7b3bd98 | ||
|
|
f8f6a3000d | ||
|
|
9a92b152a4 | ||
|
|
f86700deaf | ||
|
|
4ba259b46c | ||
|
|
cf459e94d2 | ||
|
|
4f8ed1361c | ||
|
|
bad8802241 | ||
|
|
f09ac862d5 | ||
|
|
fe7567e1a9 | ||
|
|
9b0b7f4d54 | ||
|
|
3ddbf462a8 | ||
|
|
e6043c99a7 | ||
|
|
b1daa0020e | ||
|
|
190d35c9a5 | ||
|
|
e4378fe848 | ||
|
|
981a6bd928 | ||
|
|
676e48021f | ||
|
|
1d4daf10db | ||
|
|
3c9341d87d | ||
|
|
04982941a7 | ||
|
|
ba4f05ebb2 | ||
|
|
5aaf761fce | ||
|
|
12539d00fa | ||
|
|
ec8ad955ee | ||
|
|
d10504c40b | ||
|
|
d200100caa | ||
|
|
902431c533 | ||
|
|
e23540593a | ||
|
|
9b548d9418 | ||
|
|
c25de59a93 | ||
|
|
cfe2c17165 | ||
|
|
1309b7f806 | ||
|
|
1071469e53 | ||
|
|
1795e8de20 | ||
|
|
7414d958ab | ||
|
|
9487c795b4 | ||
|
|
a3ebebb19c | ||
|
|
4624cb6c60 | ||
|
|
c7bc021f93 | ||
|
|
ebfd232a6c | ||
|
|
a20f0654eb | ||
|
|
f0a9c41dc5 | ||
|
|
033b3fd411 | ||
|
|
952a87f941 | ||
|
|
17bc227295 | ||
|
|
7cdfcdac64 | ||
|
|
82c5af9605 | ||
|
|
1dbd8a8a67 | ||
|
|
4c67e35d8d | ||
|
|
0c26d96752 | ||
|
|
7ed67e0e2e | ||
|
|
7d1d009fe8 | ||
|
|
ad8ef25d2c | ||
|
|
a71204b384 | ||
|
|
c9a96ca0ac | ||
|
|
e32f5c9210 | ||
|
|
ffaa7b04a2 | ||
|
|
9a2ce98dfd | ||
|
|
f338b77d09 | ||
|
|
1f9af4f7b2 | ||
|
|
67bea61055 | ||
|
|
a63b4cb569 | ||
|
|
9123c58611 | ||
|
|
d3a086fc98 | ||
|
|
effeb3d4e9 | ||
|
|
826c5d9bf6 | ||
|
|
a21f70af1f | ||
|
|
982df6184e | ||
|
|
8a988dab67 | ||
|
|
cef5c618a3 | ||
|
|
4339d56870 | ||
|
|
69720b382a | ||
|
|
691880e628 | ||
|
|
0a5c3055ce | ||
|
|
1533161bbd | ||
|
|
ccca7f5612 | ||
|
|
1d3410ac91 |
8
.c8rc.json
Normal file
8
.c8rc.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"src": "./src",
|
||||
"exclude": ["**/bot/lib", "__mocks__", "**/mock"],
|
||||
"reporter": ["html"],
|
||||
"report-dir": "./coverage",
|
||||
"check-coverage": true,
|
||||
"lines": 90
|
||||
}
|
||||
2
.eslintignore
Normal file
2
.eslintignore
Normal file
@@ -0,0 +1,2 @@
|
||||
packages/docs/*
|
||||
packages/portal/*
|
||||
18
.eslintrc.js
Normal file
18
.eslintrc.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
extends: 'eslint:recommended',
|
||||
overrides: [],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
},
|
||||
rules: {
|
||||
'no-unsafe-negation': 'off',
|
||||
'no-prototype-builtins': 'off',
|
||||
'no-useless-escape': 'off',
|
||||
},
|
||||
}
|
||||
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
open_collective: bot-whatsapp
|
||||
patreon: leifermendez
|
||||
custom: https://www.buymeacoffee.com/leifermendez
|
||||
58
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
58
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: 🐛 Reporte Bug
|
||||
description: Algo no va bien?. Hazlo saber
|
||||
labels: [bug, triage]
|
||||
title: '[🐛]'
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Gracias por tomarte el tiempo de reportar este problema
|
||||
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: ¿Que versión estas usando?
|
||||
description: '__INFO:__ Recuerda que puedes consultar dudas directamente en [discord](https://link.codigoencasa.com/DISCORD)'
|
||||
options:
|
||||
- v2
|
||||
- v1
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: ¿Sobre que afecta?
|
||||
options:
|
||||
- Flujo de palabras (Flow)
|
||||
- DialogFlow
|
||||
- Base de datos
|
||||
- Otro
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
description: 'Trata de ser lo más claro posible, de esa manera podemos entender el contexto de tu problema y darte una mejor solución'
|
||||
label: Describe tu problema
|
||||
placeholder: Yo tengo un problema....
|
||||
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Reproducir error
|
||||
description: __(Recomendación)__ trata de grabar un video puedes usar algunas de las siguientes herramientas [https://www.vidyard.com/](https://www.vidyard.com/) [https://www.loom.com/](https://www.loom.com/) y en lo posbile apoyate en [https://stackblitz.com/](https://stackblitz.com/) para compartir el código de ser necesario
|
||||
placeholder: URL video o stackblitz
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional_information
|
||||
attributes:
|
||||
label: Información Adicional
|
||||
validations:
|
||||
required: false
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
contact_links:
|
||||
- name: 🤔 Core Team
|
||||
url: https://link.codigoencasa.com/DISCORD
|
||||
about: Si quieres formar parte del CoreTeam, patrocinar el proyecto o propuesta profesionales
|
||||
79
.github/ISSUE_TEMPLATE/test-case.yml
vendored
Normal file
79
.github/ISSUE_TEMPLATE/test-case.yml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
name: 🐬 Caso de uso
|
||||
description: Reporta tu caso de uso y cuales fueron tus resultados
|
||||
labels: [usecase]
|
||||
title: '[🐬]'
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Gracias por tomarte el tiempo de detallar este caso de uso, sera de gran utilidad para mantener un software de calidad puedes comenzar
|
||||
⚡ `npm create bot-whatsapp@dev`
|
||||
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: ¿Cual proveedor usaste?
|
||||
description: 'Actualmente tenemos varios proveedores que sirven como punto de entrada y salida con Whatsapp'
|
||||
options:
|
||||
- whatsapp-web.js
|
||||
- venom
|
||||
- bailey
|
||||
- twilio
|
||||
- meta
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: component
|
||||
attributes:
|
||||
label: ¿Cual base de datos usaste?
|
||||
options:
|
||||
- memory
|
||||
- mongo
|
||||
- mysql
|
||||
- json
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: result
|
||||
attributes:
|
||||
label: Conclusion de la prueba
|
||||
options:
|
||||
- muy buena
|
||||
- buena
|
||||
- tiene errores
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
description: 'Trata de ser lo más claro posible, de esa manera podemos entender el contexto del caso de uso'
|
||||
label: Describe tu caso
|
||||
placeholder: Yo tengo un caso....
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: ¿Logs Importantes?
|
||||
description: Si tienes algunos logs importantes a tener en cuenta o que muetren algun error en concreto.
|
||||
render: shell
|
||||
|
||||
- type: textarea
|
||||
id: additional_information
|
||||
attributes:
|
||||
label: Información Adicional
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: usernames
|
||||
attributes:
|
||||
label: ¿Quieres que te mencionemos?
|
||||
description: Siempre buscamos fomentar la comunidad por lo cual si quieres que te mencionemos publicamente en nuestras redes sociales puedes dejar tu username
|
||||
placeholder: twitter o github o instagram o alguna url
|
||||
validations:
|
||||
required: false
|
||||
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
17
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Que tipo de Pull Request es?
|
||||
|
||||
- [ ] Mejoras
|
||||
- [ ] Bug
|
||||
- [ ] Docs / tests
|
||||
|
||||
# Descripción
|
||||
|
||||
Por favor agrega una descripción de tu aporte para tener más contexto y poder avanzar más rápido. Si es de ayuda puedes usar plataformar como [https://www.loom.com/](https://www.loom.com/) para grabar un video.
|
||||
|
||||
|
||||
> Forma parte de este proyecto.
|
||||
|
||||
- [Discord](https://link.codigoencasa.com/DISCORD)
|
||||
- [Twitter](https://twitter.com/leifermendez)
|
||||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
|
||||
- [Telegram](https://t.me/leifermendez)
|
||||
52
.github/workflows/check-provider-major.yml
vendored
Normal file
52
.github/workflows/check-provider-major.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Rev Major Providers
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * *'
|
||||
|
||||
jobs:
|
||||
check-npm:
|
||||
name: Install Dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Check Baileys
|
||||
run: yarn node ./scripts/checker.js --name=baileys --stable=true
|
||||
|
||||
- name: Check Venom
|
||||
run: yarn node ./scripts/checker.js --name=venom --stable=true
|
||||
|
||||
- name: Check web-whatsapp
|
||||
run: yarn node ./scripts/checker.js --name=web-whatsapp --stable=true
|
||||
|
||||
- name: Check Meta
|
||||
run: yarn node ./scripts/checker.js --name=meta --stable=true
|
||||
|
||||
- name: Check Twilio
|
||||
run: yarn node ./scripts/checker.js --name=twilio --stable=true
|
||||
|
||||
- name: Add and commit changes to gh-pages branch
|
||||
run: |
|
||||
git config --local user.email 'action@github.com'
|
||||
git config --local user.name 'GitHub Action'
|
||||
git add .
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: 'ci(providers): check provider versions'
|
||||
create_branch: true
|
||||
branch: feature/providers-major
|
||||
110
.github/workflows/ci.yml
vendored
Normal file
110
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
############ BUILD PACKAGE ############
|
||||
build-package:
|
||||
name: Build Package
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test-unit
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Build Package
|
||||
run: yarn build:full
|
||||
|
||||
- name: Build Eslint rules
|
||||
run: yarn lint:fix
|
||||
|
||||
############ UNIT TEST ############
|
||||
test-unit:
|
||||
name: Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Unit Tests
|
||||
run: yarn test
|
||||
|
||||
############ UNIT TEST ############
|
||||
check-providers:
|
||||
name: Check Providers Versions
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
commit: ${{ steps.vars.outputs.commit }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{github.event.after}}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Check Baileys
|
||||
run: yarn node ./scripts/checker.js --name=baileys --stable=true
|
||||
|
||||
- name: Check Venom
|
||||
run: yarn node ./scripts/checker.js --name=venom --stable=true
|
||||
|
||||
- name: Check web-whatsapp
|
||||
run: yarn node ./scripts/checker.js --name=web-whatsapp --stable=true
|
||||
|
||||
- name: Check Meta
|
||||
run: yarn node ./scripts/checker.js --name=meta --stable=true
|
||||
|
||||
- name: Check Twilio
|
||||
run: yarn node ./scripts/checker.js --name=twilio --stable=true
|
||||
|
||||
- name: Set output
|
||||
id: vars
|
||||
run: echo "commit=$(git log --format=%B -n 1 ${{github.event.after}})" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit & Push changes
|
||||
uses: actions-js/push@master
|
||||
with:
|
||||
branch: feature/providers-major
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
force: true
|
||||
76
.github/workflows/codeql.yml
vendored
Normal file
76
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: 'CodeQL'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [release/next]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: ['main']
|
||||
schedule:
|
||||
- cron: '21 16 * * 5'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
if: ${{ !github.event.act }}
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ['javascript']
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Use only 'java' to analyze code written in Java, Kotlin or both
|
||||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||
|
||||
# - run: |
|
||||
# echo "Run, Build Application using script"
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: '/language:${{matrix.language}}'
|
||||
17
.github/workflows/contributors.yml
vendored
Normal file
17
.github/workflows/contributors.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Revisando Colaboradores
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * *'
|
||||
|
||||
jobs:
|
||||
contrib-readme-job:
|
||||
runs-on: ubuntu-latest
|
||||
name: A job to automate contrib in readme
|
||||
steps:
|
||||
- name: Contribute List
|
||||
uses: akhilmhdh/contributors-readme-action@v2.3.6
|
||||
with:
|
||||
image_size: 50
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
47
.github/workflows/netlify-dev.yml
vendored
Normal file
47
.github/workflows/netlify-dev.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: 📄 Desplegando documentacion
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'feat/docs-**'
|
||||
- 'fix/docs-**'
|
||||
push:
|
||||
branches:
|
||||
- 'feat/docs-**'
|
||||
- 'fix/docs-**'
|
||||
|
||||
jobs:
|
||||
############ DOCUMENTATION BUILD ############
|
||||
build-documentation:
|
||||
if: ${{ !github.event.act }}
|
||||
name: Build Package
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Add netlify
|
||||
run: yarn add netlify-cli -D
|
||||
|
||||
- name: Create .env build file
|
||||
run: |
|
||||
touch packages/docs/.env
|
||||
echo VITE_GITHUB_TOKEN=${{ secrets.COLLABORATORS_TOKEN }} >> packages/docs/.env
|
||||
|
||||
- name: Build and Deploy
|
||||
run: |
|
||||
cd packages/docs
|
||||
netlify deploy --build --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
41
.github/workflows/netlify.yml
vendored
Normal file
41
.github/workflows/netlify.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: 📄 (PROD) Desplegando documentacion
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/next
|
||||
|
||||
jobs:
|
||||
############ DOCUMENTATION BUILD ############
|
||||
build-documentation-prod:
|
||||
name: Build Package
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Add netlify
|
||||
run: yarn add netlify-cli -D
|
||||
|
||||
- name: Create .env build file
|
||||
run: |
|
||||
touch packages/docs/.env
|
||||
echo VITE_GITHUB_TOKEN=${{ secrets.COLLABORATORS_TOKEN }} >> packages/docs/.env
|
||||
|
||||
- name: Build and Deploy
|
||||
run: |
|
||||
cd packages/docs
|
||||
netlify deploy --prod --build --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
64
.github/workflows/releases-dev.yml
vendored
Normal file
64
.github/workflows/releases-dev.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: 🚀 (DEV) Liberando versiones
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/next
|
||||
|
||||
jobs:
|
||||
############ RELEASE ############
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
commit: ${{ steps.vars.outputs.commit }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{github.event.after}}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Build Package
|
||||
run: yarn build:full
|
||||
|
||||
- name: Release @bot-whatsapp/bot
|
||||
run: yarn node ./scripts/release.js --name=bot --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/cli
|
||||
run: yarn node ./scripts/release.js --name=cli --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/create-bot-whatsapp
|
||||
run: yarn node ./scripts/release.js --name=create-bot-whatsapp --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/database
|
||||
run: yarn node ./scripts/release.js --name=database --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/provider
|
||||
run: yarn node ./scripts/release.js --name=provider --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/contexts
|
||||
run: yarn node ./scripts/release.js --name=contexts --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/portal
|
||||
run: yarn node ./scripts/release.js --name=portal --version= --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Commit & Push changes
|
||||
uses: actions-js/push@master
|
||||
with:
|
||||
branch: release/next
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
force: true
|
||||
75
.github/workflows/releases.yml
vendored
Normal file
75
.github/workflows/releases.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
name: 🚀⚡ Liberando versiones
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/production
|
||||
jobs:
|
||||
############ RELEASE ############
|
||||
release-prod:
|
||||
if: ${{ !github.event.act }}
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set output
|
||||
id: vars
|
||||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: 'yarn'
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- run: corepack enable
|
||||
|
||||
- name: Set User
|
||||
run: git config --global user.email "leifer.contacto@gmail.com" && git config --global user.name "Leifer Mendez"
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --immutable --network-timeout 300000
|
||||
|
||||
- name: Set CHANGELOG
|
||||
run: yarn release
|
||||
|
||||
- name: get-npm-version
|
||||
id: package-version
|
||||
uses: martinbeentjes/npm-get-version-action@main
|
||||
|
||||
- name: Build Package
|
||||
run: yarn build:full
|
||||
|
||||
- name: Release @bot-whatsapp/bot
|
||||
run: yarn node ./scripts/release.js --name=bot --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/cli
|
||||
run: yarn node ./scripts/release.js --name=cli --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/create-bot-whatsapp
|
||||
run: yarn node ./scripts/release.js --name=create-bot-whatsapp --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/database
|
||||
run: yarn node ./scripts/release.js --name=database --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/provider
|
||||
run: yarn node ./scripts/release.js --name=provider --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/contexts
|
||||
run: yarn node ./scripts/release.js --name=contexts --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release @bot-whatsapp/portal
|
||||
run: yarn node ./scripts/release.js --name=portal --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||
|
||||
- name: Release Github
|
||||
run: yarn node ./scripts/github.js --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.OCTO_TOKEN }}"
|
||||
|
||||
- name: Commit & Push changes
|
||||
uses: actions-js/push@master
|
||||
with:
|
||||
branch: release/production
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
force: true
|
||||
27
.github/workflows/stale.yml
vendored
Normal file
27
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: Revisar ISSUES abandonadas
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '55 22 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: '¿Alguna novedad sobre esta ISSUE?'
|
||||
stale-pr-message: '¿Alguna novedad sobre esta PULL REQUEST?'
|
||||
stale-issue-label: 'no-issue-activity'
|
||||
stale-pr-label: 'no-pr-activity'
|
||||
exempt-issue-assignees: 'leifermendez'
|
||||
47
.gitignore
vendored
47
.gitignore
vendored
@@ -1,3 +1,46 @@
|
||||
/node_modules
|
||||
/node_modules/*
|
||||
session.json
|
||||
/packages/repl
|
||||
/packages/*/starters
|
||||
/packages/*/node_modules
|
||||
/packages/*/dist
|
||||
/packages/*/docs/dist
|
||||
/packages/provider/src/venom/tokens
|
||||
session.json
|
||||
chats/*
|
||||
!chats/.gitkeep
|
||||
media/*
|
||||
!media/.gitkeep
|
||||
mediaSend/*
|
||||
!mediaSend/.gitkeep
|
||||
!mediaSend/nota-de-voz.mp3
|
||||
.env
|
||||
.wwebjs_auth
|
||||
/session
|
||||
/session/*
|
||||
/tokens
|
||||
/tokens/*
|
||||
packages/cli/config.json
|
||||
config.json
|
||||
.yarnrc.yml
|
||||
coverage/
|
||||
*.lcov
|
||||
log
|
||||
log/*
|
||||
*.log
|
||||
*.tgz
|
||||
lib
|
||||
tmp/
|
||||
.yarn/*
|
||||
!.yarn/releases
|
||||
!.yarn/plugins/@yarnpkg/plugin-postinstall.cjs
|
||||
.fleet/
|
||||
example-app*/
|
||||
base-*/
|
||||
!starters/apps/base-*/
|
||||
qr.svg
|
||||
package-lock.json
|
||||
yarn-error.log
|
||||
.npmrc
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
.secrets
|
||||
4
.husky/commit-msg
Executable file
4
.husky/commit-msg
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx --no -- commitlint --edit
|
||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn run fmt.staged
|
||||
4
.husky/pre-push
Executable file
4
.husky/pre-push
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npm run test
|
||||
9
.prettierignore
Normal file
9
.prettierignore
Normal file
@@ -0,0 +1,9 @@
|
||||
packages/**/lib
|
||||
packages/docs/*.json
|
||||
**/.git
|
||||
**/.svn
|
||||
**/.hg
|
||||
**/node_modules
|
||||
*.mjs
|
||||
*.cjs
|
||||
*.md
|
||||
6
.prettierrc.json
Normal file
6
.prettierrc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 4,
|
||||
"semi": false,
|
||||
"singleQuote": true
|
||||
}
|
||||
24
.vscode/bot.code-snippets
vendored
Normal file
24
.vscode/bot.code-snippets
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"Flow Bot (simple)": {
|
||||
"scope": "javascript",
|
||||
"prefix": "bot:flow",
|
||||
"description": "Crear un flujo simple",
|
||||
"body": [
|
||||
"export const flow${1} = addKeyword(['hola', 'buenas'])",
|
||||
" .addAnswer('Hola! 🚀 Bienvenido a este CHATBOT')",
|
||||
" .addAnswer('¿Como puedo ayudarte?')"
|
||||
]
|
||||
},
|
||||
"Flow Bot (completo)": {
|
||||
"scope": "javascript",
|
||||
"prefix": "bot:flow completo",
|
||||
"description": "Crear un flujo completo",
|
||||
"body": [
|
||||
"export const flow${1} = addKeyword(['categorias'])",
|
||||
" .addAnswer('⚡ Tenemos las siguientes categorias')",
|
||||
" .addAnswer(['🚀 Computadoras', '🚀 Celulares', '🚀 Otros'], {",
|
||||
" delay: 1500, //Milisegundo 1500 = 1.5segundos",
|
||||
"})"
|
||||
]
|
||||
}
|
||||
}
|
||||
3
.vscode/extensions.json
vendored
Normal file
3
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["xyc.vscode-mdx-preview"]
|
||||
}
|
||||
15
.vscode/launch.json
vendored
Normal file
15
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
// Use IntelliSense para saber los atributos posibles.
|
||||
// Mantenga el puntero para ver las descripciones de los existentes atributos.
|
||||
// Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Iniciar el programa",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"program": "${workspaceFolder}\\example-app\\app.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
14
.vscode/settings.json
vendored
Normal file
14
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"conventionalCommits.scopes": [
|
||||
"hook",
|
||||
"contributing",
|
||||
"cli",
|
||||
"bot",
|
||||
"provider",
|
||||
"adapter",
|
||||
"ci",
|
||||
"starters",
|
||||
"conflict",
|
||||
"contexts"
|
||||
]
|
||||
}
|
||||
8
.yarn/plugins/@yarnpkg/plugin-postinstall.cjs
vendored
Normal file
8
.yarn/plugins/@yarnpkg/plugin-postinstall.cjs
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/* eslint-disable */
|
||||
module.exports = {
|
||||
name: "@yarnpkg/plugin-postinstall",
|
||||
factory: function (require) {
|
||||
var plugin;(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>s});const n=require("@yarnpkg/core"),o=require("clipanion"),a={postinstall:{description:"Postinstall hook that will always run in Yarn v2",type:n.SettingsType.STRING,default:""}},r=require("@yarnpkg/shell"),l=async e=>{if(e){console.log("Running postinstall command...");const t=await r.execute(e);if(0!==t)throw new Error("postinstall command failed with exit code "+t)}};var i=function(e,t,n,o){var a,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(l=(r<3?a(l):r>3?a(t,n,l):a(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l};class c extends o.Command{async execute(){const e=(await n.Configuration.find(this.context.cwd,this.context.plugins)).get("postinstall");await l(e)}}i([o.Command.Path("postinstall")],c.prototype,"execute",null);const s={configuration:a,commands:[c],hooks:{afterAllInstalled:async e=>{const t=e.configuration.get("postinstall");await l(t)}}};plugin=t})();
|
||||
return plugin;
|
||||
}
|
||||
};
|
||||
807
.yarn/releases/yarn-3.3.0.cjs
vendored
Normal file
807
.yarn/releases/yarn-3.3.0.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.yarnrc.yml
Normal file
10
.yarnrc.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
npmPublishRegistry: 'https://registry.npmjs.org'
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-postinstall.cjs
|
||||
spec: 'https://raw.githubusercontent.com/gravitywelluk/yarn-plugin-postinstall/master/bundles/%40yarnpkg/plugin-postinstall.js'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.3.0.cjs
|
||||
postinstall: npx husky install
|
||||
534
CHANGELOG.md
Normal file
534
CHANGELOG.md
Normal file
@@ -0,0 +1,534 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [0.1.18](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.17...v0.1.18) (2023-01-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **bot:** :zap: add blacklist ([7078dc4](https://github.com/leifermendez/bot-whatsapp/commit/7078dc4c93d01bf90ef08ecb34e89a1abbe16fd2))
|
||||
* **bot:** :zap: flowDynamic buttons, media ([3c4b1c0](https://github.com/leifermendez/bot-whatsapp/commit/3c4b1c0fc4b6d98d67c67806d918d3604bb2209b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bot:** :bug: body undefined ([bb6ed4a](https://github.com/leifermendez/bot-whatsapp/commit/bb6ed4a084ae98070dfdf0c4ba1eca574c4092cc))
|
||||
* **bot:** :bug: body undefined ([9234cf1](https://github.com/leifermendez/bot-whatsapp/commit/9234cf1c5d00abdd35e62a826b3c450ab056987a))
|
||||
* **bot:** :bug: body undefined ([a118bbb](https://github.com/leifermendez/bot-whatsapp/commit/a118bbbf7f0a7023cb7f33c23f37db72adad151f))
|
||||
* **bot:** :bug: body undefined ([f54dea5](https://github.com/leifermendez/bot-whatsapp/commit/f54dea52b01063acd6122eeba1fbbe324aa7805d))
|
||||
* **bot:** :bug: body undefined ([72e0a91](https://github.com/leifermendez/bot-whatsapp/commit/72e0a910503e9643db7dfbc6e09c41c96934e1f7))
|
||||
* **bot:** :bug: body undefined ([70dd4d7](https://github.com/leifermendez/bot-whatsapp/commit/70dd4d73e814fc5636d19a887f3621c483b837c1))
|
||||
* **bot:** :bug: body undefined ([ecf0eef](https://github.com/leifermendez/bot-whatsapp/commit/ecf0eef928917d76c59bd23886cb7a4108b421f1))
|
||||
* **bot:** :bug: flowDynamic stranger behaviour ([877252b](https://github.com/leifermendez/bot-whatsapp/commit/877252bd4a8a7bbbbf083c3ceaeaeb952b0a1828))
|
||||
* **bot:** :bug: flowDynamic stranger behaviour ([f5a7de3](https://github.com/leifermendez/bot-whatsapp/commit/f5a7de3a003c012e2164e51fff26892cfc3144be))
|
||||
* **bot:** :memo: more docs ([98793d0](https://github.com/leifermendez/bot-whatsapp/commit/98793d0cfc1674830beaa3707f933c5a791eec14))
|
||||
* **cli:** :zap: refactor ([a29b9d4](https://github.com/leifermendez/bot-whatsapp/commit/a29b9d4e1f85fc163cf1d633c0857f0c8b7f03e1))
|
||||
* **cli:** :zap: refactor ([18ef4e9](https://github.com/leifermendez/bot-whatsapp/commit/18ef4e9d726575ca390ca24354825860328d3347))
|
||||
* **cli:** :zap: refactor ([3648757](https://github.com/leifermendez/bot-whatsapp/commit/3648757fa083bdb88a16bf6c2e90c828c233bdb1))
|
||||
* **cli:** :zap: refactor ([32f6a70](https://github.com/leifermendez/bot-whatsapp/commit/32f6a70f8f6fb26d8ea2a0f1a4aec4827b9d6a93))
|
||||
* **cli:** :zap: refactor ([8c825e7](https://github.com/leifermendez/bot-whatsapp/commit/8c825e7f6b7133f7cc7f3041ce331b80a9fe60e0))
|
||||
* **cli:** :zap: refactor ([0c0f437](https://github.com/leifermendez/bot-whatsapp/commit/0c0f4375b84549bee809340a85f9ce038ee2739e))
|
||||
* **cli:** :zap: refactor ([039ce5d](https://github.com/leifermendez/bot-whatsapp/commit/039ce5dd7cac8115b335ad5de05f7bd871e24140))
|
||||
* **cli:** :zap: refactor ([5e87918](https://github.com/leifermendez/bot-whatsapp/commit/5e879188b8bf9d486399b308a9a9c2612607d465))
|
||||
* **cli:** :zap: refactor ([21a7270](https://github.com/leifermendez/bot-whatsapp/commit/21a72702817bc6b344223b34ca4513a7ff45fc93))
|
||||
* **cli:** :zap: refactor ([82a99b2](https://github.com/leifermendez/bot-whatsapp/commit/82a99b2c80e6738566042ea738bbab8208a17758))
|
||||
* **cli:** :zap: refactor ([cc19974](https://github.com/leifermendez/bot-whatsapp/commit/cc19974579379777b05cb69c38cec0fce6740471))
|
||||
* **cli:** :zap: refactor ([56fcb8f](https://github.com/leifermendez/bot-whatsapp/commit/56fcb8fb72169bc21fce7c4fcdceccf2acd39c73))
|
||||
* **cli:** :zap: refactor ([f36cff1](https://github.com/leifermendez/bot-whatsapp/commit/f36cff1eefdd96be4ab531e1cb2d3b630b1a81c3))
|
||||
* **cli:** :zap: refactor ([b393c11](https://github.com/leifermendez/bot-whatsapp/commit/b393c11af6c0ebccb0a690be8b90b9df8877dad1))
|
||||
* **cli:** :zap: refactor ([6683715](https://github.com/leifermendez/bot-whatsapp/commit/6683715ad617ea1075654a475a1c62ea607c733f))
|
||||
* **contexts:** :bug: fixed [#524](https://github.com/leifermendez/bot-whatsapp/issues/524) issue ([79cc31a](https://github.com/leifermendez/bot-whatsapp/commit/79cc31a96f6a9836447cc4e6bb1e1521c54183fe))
|
||||
* **contexts:** :bug: fixed [#524](https://github.com/leifermendez/bot-whatsapp/issues/524) issue ([7067b4a](https://github.com/leifermendez/bot-whatsapp/commit/7067b4a80b7938ccfaf1ed141a37d645a1a3a062))
|
||||
* **provider:** wwebjs upgrade ([345f256](https://github.com/leifermendez/bot-whatsapp/commit/345f256a1b4a238519dafc15c9a31bc5e6bad4fe))
|
||||
* se agrego @bot-whatsapp/portal a package.json ([46a9fa6](https://github.com/leifermendez/bot-whatsapp/commit/46a9fa6793e06600335de998d2bd9d0691b02ca4))
|
||||
|
||||
### [0.1.17](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.16...v0.1.17) (2023-01-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* mod de starters para habiltar portal ([eceb170](https://github.com/leifermendez/bot-whatsapp/commit/eceb170df03721dca4183b658c863b94fa04bc84))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** pre-release ([aaec075](https://github.com/leifermendez/bot-whatsapp/commit/aaec0751408ab49483d428810d94aaf7d46acb94))
|
||||
* correccion en starters app.js para portal QR ([f430380](https://github.com/leifermendez/bot-whatsapp/commit/f430380b4f23d41702395c96c628bf13bf443278))
|
||||
* **starters:** :zap: added dockerfile ([230981e](https://github.com/leifermendez/bot-whatsapp/commit/230981e2676361149cb2a99def7f705e75009260))
|
||||
|
||||
### [0.1.16](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.15...v0.1.16) (2023-01-11)
|
||||
|
||||
### [0.1.15](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.14...v0.1.15) (2023-01-11)
|
||||
|
||||
### [0.1.14](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.13...v0.1.14) (2023-01-11)
|
||||
|
||||
### [0.1.13](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.12...v0.1.13) (2023-01-11)
|
||||
|
||||
### [0.1.12](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.10...v0.1.12) (2023-01-11)
|
||||
|
||||
### [0.1.9-pre](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.9...v0.1.9-pre) (2023-01-10)
|
||||
|
||||
### [0.1.7-pre-1](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-alpha...v0.1.7-pre-1) (2023-01-10)
|
||||
|
||||
### [0.1.7-alpha](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-pre...v0.1.7-alpha) (2023-01-10)
|
||||
|
||||
### [0.1.11](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.10...v0.1.11) (2023-01-11)
|
||||
|
||||
### [0.1.9-pre](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.9...v0.1.9-pre) (2023-01-10)
|
||||
|
||||
### [0.1.7-pre-1](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-alpha...v0.1.7-pre-1) (2023-01-10)
|
||||
|
||||
### [0.1.7-alpha](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-pre...v0.1.7-alpha) (2023-01-10)
|
||||
|
||||
### [0.1.10](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.8...v0.1.10) (2023-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* :fire: update qr package ([ecde23f](https://github.com/leifermendez/bot-whatsapp/commit/ecde23fdea65def209aa874af35a3f293e6b1a91))
|
||||
|
||||
### [0.1.8](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-pre...v0.1.8) (2023-01-10)
|
||||
|
||||
### [0.1.7](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-pre...v0.1.7) (2023-01-10)
|
||||
|
||||
### [0.1.6](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.5...v0.1.6) (2023-01-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* :zap: new portal web for qr scan ([cb2e869](https://github.com/leifermendez/bot-whatsapp/commit/cb2e8692a3f94c8b24993cd11dd564f094b0e4ef))
|
||||
* :zap: new portal web for qr scan ([9e93795](https://github.com/leifermendez/bot-whatsapp/commit/9e93795e6fce38890045389da95184fef1fbe0da))
|
||||
* :zap: new portal web for qr scan ([3c178ea](https://github.com/leifermendez/bot-whatsapp/commit/3c178ea113b140535a51f5dcd521dbb66251670e))
|
||||
* :zap: new portal web for qr scan ([1f1f564](https://github.com/leifermendez/bot-whatsapp/commit/1f1f564f4e2e3aa13b84de500fe215e0c45c2770))
|
||||
* :zap: new portal web for qr scan ([3de5f4b](https://github.com/leifermendez/bot-whatsapp/commit/3de5f4b77a10e30632ff7555f5af5d8e93cb2019))
|
||||
* :zap: qr code filename ([d794f60](https://github.com/leifermendez/bot-whatsapp/commit/d794f604ac8a835e523709dbf18c9b1609bbd00e))
|
||||
* :zap: qr portal ([246ecdc](https://github.com/leifermendez/bot-whatsapp/commit/246ecdc11a8c4e652867c842b612dc4ce73f9828))
|
||||
* :zap: qr portal ([af8b401](https://github.com/leifermendez/bot-whatsapp/commit/af8b401d075e1c35065589ede61476461ce86b4d))
|
||||
* agregamos dockerfile y webserver a starters ([f9e3bbc](https://github.com/leifermendez/bot-whatsapp/commit/f9e3bbc6655060408e4fdbe1d7e920c2ed4fca53))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* :zap: add Dockerfile, starter ([4e0d33c](https://github.com/leifermendez/bot-whatsapp/commit/4e0d33c6bb46ad259774f6d0c38c6c0b5f8ca4a9))
|
||||
* :zap: fix inject port args ([20f752e](https://github.com/leifermendez/bot-whatsapp/commit/20f752e6c1b1f7d11948fc4f2f8950f7834df7d9))
|
||||
* :zap: fix inject port args ([7a23eb0](https://github.com/leifermendez/bot-whatsapp/commit/7a23eb0cc6f93ec21c5ab34e46981ae7a93f42ff))
|
||||
* **provider:** :zap: fix send image baileys ([2ddea54](https://github.com/leifermendez/bot-whatsapp/commit/2ddea5468d235035478d4e91e63c821da19da179))
|
||||
* **provider:** :zap: fix send image baileys ([391e11c](https://github.com/leifermendez/bot-whatsapp/commit/391e11ce738cd64792b5237d69f3739b0263c198))
|
||||
* **provider:** :zap: fix send image baileys ([5d10cb9](https://github.com/leifermendez/bot-whatsapp/commit/5d10cb9026da60043e9a2f86117ebb04d0631a3f))
|
||||
* **provider:** fix error docker as root user ([5a033da](https://github.com/leifermendez/bot-whatsapp/commit/5a033da83aee1f614120bccf27c9f330500cc7b0))
|
||||
|
||||
### [0.1.4](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.5...v0.1.4) (2023-01-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* :zap: new portal web for qr scan ([cb2e869](https://github.com/leifermendez/bot-whatsapp/commit/cb2e8692a3f94c8b24993cd11dd564f094b0e4ef))
|
||||
* :zap: new portal web for qr scan ([9e93795](https://github.com/leifermendez/bot-whatsapp/commit/9e93795e6fce38890045389da95184fef1fbe0da))
|
||||
* :zap: new portal web for qr scan ([3c178ea](https://github.com/leifermendez/bot-whatsapp/commit/3c178ea113b140535a51f5dcd521dbb66251670e))
|
||||
* :zap: new portal web for qr scan ([1f1f564](https://github.com/leifermendez/bot-whatsapp/commit/1f1f564f4e2e3aa13b84de500fe215e0c45c2770))
|
||||
* :zap: new portal web for qr scan ([3de5f4b](https://github.com/leifermendez/bot-whatsapp/commit/3de5f4b77a10e30632ff7555f5af5d8e93cb2019))
|
||||
* :zap: qr code filename ([d794f60](https://github.com/leifermendez/bot-whatsapp/commit/d794f604ac8a835e523709dbf18c9b1609bbd00e))
|
||||
* :zap: qr portal ([246ecdc](https://github.com/leifermendez/bot-whatsapp/commit/246ecdc11a8c4e652867c842b612dc4ce73f9828))
|
||||
* :zap: qr portal ([af8b401](https://github.com/leifermendez/bot-whatsapp/commit/af8b401d075e1c35065589ede61476461ce86b4d))
|
||||
* agregamos dockerfile y webserver a starters ([f9e3bbc](https://github.com/leifermendez/bot-whatsapp/commit/f9e3bbc6655060408e4fdbe1d7e920c2ed4fca53))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* :zap: add Dockerfile, starter ([4e0d33c](https://github.com/leifermendez/bot-whatsapp/commit/4e0d33c6bb46ad259774f6d0c38c6c0b5f8ca4a9))
|
||||
* :zap: fix inject port args ([20f752e](https://github.com/leifermendez/bot-whatsapp/commit/20f752e6c1b1f7d11948fc4f2f8950f7834df7d9))
|
||||
* :zap: fix inject port args ([7a23eb0](https://github.com/leifermendez/bot-whatsapp/commit/7a23eb0cc6f93ec21c5ab34e46981ae7a93f42ff))
|
||||
* **provider:** :zap: fix send image baileys ([2ddea54](https://github.com/leifermendez/bot-whatsapp/commit/2ddea5468d235035478d4e91e63c821da19da179))
|
||||
* **provider:** :zap: fix send image baileys ([391e11c](https://github.com/leifermendez/bot-whatsapp/commit/391e11ce738cd64792b5237d69f3739b0263c198))
|
||||
* **provider:** :zap: fix send image baileys ([5d10cb9](https://github.com/leifermendez/bot-whatsapp/commit/5d10cb9026da60043e9a2f86117ebb04d0631a3f))
|
||||
* **provider:** fix error docker as root user ([5a033da](https://github.com/leifermendez/bot-whatsapp/commit/5a033da83aee1f614120bccf27c9f330500cc7b0))
|
||||
|
||||
### [0.1.3](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.2...v0.1.3) (2023-01-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **adapter:** :zap: send messages with dialogflow ([c20e151](https://github.com/leifermendez/bot-whatsapp/commit/c20e151e209d33de9e7425a64f003c85360f1832))
|
||||
* **baileys:** added more methods ([1b23b83](https://github.com/leifermendez/bot-whatsapp/commit/1b23b837460ce4533ff33f10f1de5e3a344a5623))
|
||||
* **bot:** :zap: http responses support ([e331c2d](https://github.com/leifermendez/bot-whatsapp/commit/e331c2dcc40eeb82a93f9d29f6a82333b8465927))
|
||||
* **bot:** :zap: http responses support ([2d2bb08](https://github.com/leifermendez/bot-whatsapp/commit/2d2bb085cd95604a84ca3fe5c4ddc84b3824ac1c))
|
||||
* **bot:** :zap: rev-03 everything work fine ([3012e02](https://github.com/leifermendez/bot-whatsapp/commit/3012e026b77ab4e99334b992d166a89189f76503))
|
||||
* **cli:** :sparkles: added bailey ([06acec2](https://github.com/leifermendez/bot-whatsapp/commit/06acec2bf29d72c2b46f4ce81fed115bab97351f))
|
||||
* **cli:** :sparkles: added bailey ([c868f73](https://github.com/leifermendez/bot-whatsapp/commit/c868f7346245bec94582b25a342febc657926c9d))
|
||||
* **conflict:** :zap: remove unused variable ([eba9229](https://github.com/leifermendez/bot-whatsapp/commit/eba92299cfd84c971f09697d027043f19eec2b7c))
|
||||
* **contexts:** :zap: add new dialogflowcx ([4d8cf62](https://github.com/leifermendez/bot-whatsapp/commit/4d8cf623ff86b3d08c8d52293d4e289dfda68e1c))
|
||||
* **contexts:** :zap: add new dialogflowcx ([9885872](https://github.com/leifermendez/bot-whatsapp/commit/98858729919b2544dace07c49badce7888ddfd82))
|
||||
* **contexts:** dialogflowcx support ([9179421](https://github.com/leifermendez/bot-whatsapp/commit/917942139f9736f1c0f8ce5f07b4e12e5768b0c7))
|
||||
* correccion de flujos en app.js de ejemplo ([99f508f](https://github.com/leifermendez/bot-whatsapp/commit/99f508f93889d70240861158bc304c25a3b2daef))
|
||||
* **docs:** master class updated ([69fd81a](https://github.com/leifermendez/bot-whatsapp/commit/69fd81a565e61b249ac50917585293d2d84e3dd4))
|
||||
* **docs:** master class updated ([d522b03](https://github.com/leifermendez/bot-whatsapp/commit/d522b03e2e6e6e3f7c467c59e3d2d6f288fe37b2))
|
||||
* **provider:** :bug: dialogflow ([4ec6f1e](https://github.com/leifermendez/bot-whatsapp/commit/4ec6f1e120879e545fa111615f2d79b792d947a5))
|
||||
* **provider:** :sparkles: added dialogflow ([2f633c7](https://github.com/leifermendez/bot-whatsapp/commit/2f633c72da24f98d6c318d1e725571b62e04604c))
|
||||
* **provider:** :sparkles: added dialogflow ([798f1ce](https://github.com/leifermendez/bot-whatsapp/commit/798f1cebdefe43624c1698a219dcb224bb842d38))
|
||||
* **provider:** :sparkles: endpoint is added to validate the webhook … ([478929d](https://github.com/leifermendez/bot-whatsapp/commit/478929d1340d46d6bf997ae8edabbaae4511172d))
|
||||
* **provider:** :sparkles: endpoint is added to validate the webhook token ([1ec1564](https://github.com/leifermendez/bot-whatsapp/commit/1ec15647dc462363d5b765f42debddbe6ef6266b))
|
||||
* **provider:** :zap: add new methods ([0b4e353](https://github.com/leifermendez/bot-whatsapp/commit/0b4e35308dace0ccdf618cb1d04987ed5200d58c))
|
||||
* **provider:** :zap: add sendfile and sendButtons ([5433610](https://github.com/leifermendez/bot-whatsapp/commit/5433610a84d7a050a387e4daf2ded1daebfc03a4))
|
||||
* **provider:** :zap: add sendfile and sendButtons ([342cbcc](https://github.com/leifermendez/bot-whatsapp/commit/342cbccff1d09f9aabe5423ad6d686d590a2448f))
|
||||
* **provider:** :zap: added new venom provider ([01fe9eb](https://github.com/leifermendez/bot-whatsapp/commit/01fe9ebc9a943f2aa086ee415153d1cccdb14ec0))
|
||||
* **provider:** :zap: added tamplate venom ([337c2e9](https://github.com/leifermendez/bot-whatsapp/commit/337c2e94bccd0ae173958fe2db08b494bdc93c28))
|
||||
* **provider:** :zap: baileysProvider ([23b2e8e](https://github.com/leifermendez/bot-whatsapp/commit/23b2e8e439ecec24450bd5cf1a3820316e643434))
|
||||
* **provider:** :zap: solution error buttons ([1b83871](https://github.com/leifermendez/bot-whatsapp/commit/1b83871cca6996c6acae3d4c8b6b42aec05ea146))
|
||||
* **provider:** :zap: solution error utils venom ([31c83f5](https://github.com/leifermendez/bot-whatsapp/commit/31c83f5d689a01490d3adb96006f54c2a5d3268b))
|
||||
* **provider:** :zap: update ([b62d21a](https://github.com/leifermendez/bot-whatsapp/commit/b62d21a0bf94466e43c25c6e8c0f5db9ae91c572))
|
||||
* **provider:** :zap: update ([0c94647](https://github.com/leifermendez/bot-whatsapp/commit/0c94647a27747c3ddf4f02926580370f0d81bdc2))
|
||||
* **provider:** meta provider is added ([b041f7d](https://github.com/leifermendez/bot-whatsapp/commit/b041f7d0c7cc6f152d3f36785d1d398a4141d57d))
|
||||
* **provider:** meta provider is added ([438607c](https://github.com/leifermendez/bot-whatsapp/commit/438607c222b91d6f8814201dabe5f7c3e7ba1abb))
|
||||
* **provider:** new added baileys ([4e0fcbd](https://github.com/leifermendez/bot-whatsapp/commit/4e0fcbd8347f8a430adb43351b5415098a5d10df))
|
||||
* **provider:** new provider - venon:zap: configuracion inicial provi… ([66f75f8](https://github.com/leifermendez/bot-whatsapp/commit/66f75f872200334bfc9eda744bed92c509dfee56))
|
||||
* **provider:** new provider - venon:zap: configuracion inicial provider venom ([fee7c2e](https://github.com/leifermendez/bot-whatsapp/commit/fee7c2e967b7fe8835b5acc243c19f7713acfbe7))
|
||||
* se agregaron los datros del adapter mongo en app.js y package.json ([8160d13](https://github.com/leifermendez/bot-whatsapp/commit/8160d13c866b8ae17b0ec8e68eee1bc0373595b0))
|
||||
* se agrego informacion al ejemplo en app.js ([954e751](https://github.com/leifermendez/bot-whatsapp/commit/954e751f700c6a39ec70c0bc5168637c0dc7e07c))
|
||||
* se agrego informacion al ejemplo en app.js ([b2f1339](https://github.com/leifermendez/bot-whatsapp/commit/b2f13396104db9ccef5b3bad1c4e19c6a4bad2d4))
|
||||
* **starters:** meta memory base template added ([11c784f](https://github.com/leifermendez/bot-whatsapp/commit/11c784f882965d6bd3a2313cf91bed9fb3aa5f26))
|
||||
* **starters:** meta memory base template added ([e8d6252](https://github.com/leifermendez/bot-whatsapp/commit/e8d625201ed86e162e0b4e82100ede1d08985555))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* :art: update ([7d6708c](https://github.com/leifermendez/bot-whatsapp/commit/7d6708c01bbdc5043a7e6ed56fe15a9618115b91))
|
||||
* :sparkles: updated starters ([5da4b7a](https://github.com/leifermendez/bot-whatsapp/commit/5da4b7a4d1e5950be94361ac439938741b9d299c))
|
||||
* actualizar app.js de ejemplo ([1746613](https://github.com/leifermendez/bot-whatsapp/commit/17466138ddcef60a23a0c87911f22045f26d3233))
|
||||
* actualizar ejemplo app.js ([60fdbf3](https://github.com/leifermendez/bot-whatsapp/commit/60fdbf3d3cd62819e618853a9dc2fd0e23fe8752))
|
||||
* **adapter:** :fire: clear log ([9ad4874](https://github.com/leifermendez/bot-whatsapp/commit/9ad4874fdafabfbf0e9e20e6b3281f702bb9fbe7))
|
||||
* **adapter:** :fire: clear log ([4d34d3a](https://github.com/leifermendez/bot-whatsapp/commit/4d34d3ab1daab4e72fb5244216c78cf836d1a164))
|
||||
* **adapter:** :fire: improvement baileys ([e6fefb4](https://github.com/leifermendez/bot-whatsapp/commit/e6fefb4049847f996f2a169b9acfc27c2428d3e6))
|
||||
* **adapter:** :fire: improvement baileys ([2d5ac26](https://github.com/leifermendez/bot-whatsapp/commit/2d5ac2664bea09e60ac85ff2612609ae21050945))
|
||||
* **adapter:** :rocket: venom update - cli - qr iamge ([041bf62](https://github.com/leifermendez/bot-whatsapp/commit/041bf6280e5f6956393716907e0669aa3ca78b4a))
|
||||
* **adapter:** :rocket: venom update - cli - qr iamge ([e37fd0d](https://github.com/leifermendez/bot-whatsapp/commit/e37fd0da3635aa1041664d490d5f9803d2c441ca))
|
||||
* **adapter:** :rocket: venom update - cli - qr iamge ([ca6afbb](https://github.com/leifermendez/bot-whatsapp/commit/ca6afbb87fceec12d4a383486ad693905e36881f))
|
||||
* **adapter:** json db change is made ([386c1bb](https://github.com/leifermendez/bot-whatsapp/commit/386c1bbbac036aa58335fb5f62e3af2493766b6b))
|
||||
* **adapter:** json db change is made ([3bdc7af](https://github.com/leifermendez/bot-whatsapp/commit/3bdc7afe8062527ff08620650d2c1177dfea83f5))
|
||||
* agregamos variables para mysql ([dcf65b8](https://github.com/leifermendez/bot-whatsapp/commit/dcf65b87bc7e7e6381e6448e83118077986898e7))
|
||||
* **bot:** :ambulance: fix callback functions ([d9aa97c](https://github.com/leifermendez/bot-whatsapp/commit/d9aa97c7819aca1446657bc0b75e9732f0f20c6b)), closes [#252](https://github.com/leifermendez/bot-whatsapp/issues/252)
|
||||
* **bot:** :ambulance: fix callback functions ([964a074](https://github.com/leifermendez/bot-whatsapp/commit/964a074aa41324bd09d0c4e2e7aa663a0602b69c))
|
||||
* **bot:** :fire: fix rev ([21407c0](https://github.com/leifermendez/bot-whatsapp/commit/21407c0e37f1ab12efecf887e699cedf05e3946a))
|
||||
* **bot:** :fire: fix rev ([484c8c3](https://github.com/leifermendez/bot-whatsapp/commit/484c8c3bdefbc7824c32a86090bafae0593ecdac))
|
||||
* **bot:** :zap: working callback Phase 1 ([952ce86](https://github.com/leifermendez/bot-whatsapp/commit/952ce86ffaa48a0d6fbc0a00a08c5d1efa14ee8e))
|
||||
* **bot:** :zap: working nested new flow ([2cbc962](https://github.com/leifermendez/bot-whatsapp/commit/2cbc96245d795de749d894a3a0d99b6550f08d9e))
|
||||
* **cli:** :art: starters ([a2be57f](https://github.com/leifermendez/bot-whatsapp/commit/a2be57f0aa42c6b5e13ad19c34abc7d9e81dc135))
|
||||
* **cli:** :art: starters ([670ecf1](https://github.com/leifermendez/bot-whatsapp/commit/670ecf121babf53e76c2ea106c0710cbe59facde))
|
||||
* **cli:** :fire: update instructions ([e585e2f](https://github.com/leifermendez/bot-whatsapp/commit/e585e2f5f644ed0188dc9cd2b3c697c9d6050669))
|
||||
* **cli:** :fire: update instructions ([ed36ce0](https://github.com/leifermendez/bot-whatsapp/commit/ed36ce0a7796320c6a4a452f29c05a3f0f7368db))
|
||||
* **cli:** :fire: update instructions ([bad1694](https://github.com/leifermendez/bot-whatsapp/commit/bad16943fc2089887d6bf0b6d90075d3bec6f9c7))
|
||||
* **cli:** :fire: update instructions ([a21633f](https://github.com/leifermendez/bot-whatsapp/commit/a21633fb7cf348cc37f4e4714f51172b49b193b5))
|
||||
* **cli:** :zap: updated ([a6f4aa8](https://github.com/leifermendez/bot-whatsapp/commit/a6f4aa8d1e809330c06c165aaf9a9f90b8922bb5))
|
||||
* **conflict:** conflict resolution ([71d43b5](https://github.com/leifermendez/bot-whatsapp/commit/71d43b585a0ce173061c84e9879915e4602db026))
|
||||
* **contexts:** :fire: added buttons ([eabef7a](https://github.com/leifermendez/bot-whatsapp/commit/eabef7a92d005cd0190196cfe75828c38885aadf))
|
||||
* **contexts:** :fire: added buttons ([1b878d2](https://github.com/leifermendez/bot-whatsapp/commit/1b878d2ba0daeb3609af74a2ebae7948456e7fb0))
|
||||
* **contexts:** :fire: added buttons ([78b0a9d](https://github.com/leifermendez/bot-whatsapp/commit/78b0a9dddc2a6e0fceb721ee7794efa2047f25fc))
|
||||
* **contexts:** :fire: added buttons ([d8309f7](https://github.com/leifermendez/bot-whatsapp/commit/d8309f77e1d9137c0bec977ed9faef633cd90552))
|
||||
* correccion en app.js para remover addChild en starters ([32db429](https://github.com/leifermendez/bot-whatsapp/commit/32db429f2946f344d949cb169a9595d657c06279))
|
||||
* fix del db provider mysql ([b59d4fc](https://github.com/leifermendez/bot-whatsapp/commit/b59d4fcdd7462cde3f68ab5746d49960b547a592))
|
||||
* provider equivocado en app.js de venom ([4e0a109](https://github.com/leifermendez/bot-whatsapp/commit/4e0a1091ee85cedfaa5a9c3d40e5cd50bc36cda3))
|
||||
* **provider:** :bug: create static site html qr ([c7e56a4](https://github.com/leifermendez/bot-whatsapp/commit/c7e56a4b13c8829f91769eeca7f1f6b3473f68cf))
|
||||
* **provider:** :bug: fix metea provider ([85f50be](https://github.com/leifermendez/bot-whatsapp/commit/85f50be9dcbf3817107898d8d2980baf05acd678))
|
||||
* **provider:** :bug: fix metea provider ([a52aaa1](https://github.com/leifermendez/bot-whatsapp/commit/a52aaa11d883bbaf526cf87720d3c3fd9f89a986))
|
||||
* **provider:** :bug: qr code accurate ([6c4845d](https://github.com/leifermendez/bot-whatsapp/commit/6c4845d733720d9916bb4008f9069ae4fd986a4b))
|
||||
* **provider:** :bug: qr code accurate ([91bfdc4](https://github.com/leifermendez/bot-whatsapp/commit/91bfdc46301207cbc5274308da6f39c7b4652c63))
|
||||
* **provider:** :fire: baileys fix ([928365d](https://github.com/leifermendez/bot-whatsapp/commit/928365dcafb3631acf6b1d0c239a906f8e1c4b0d))
|
||||
* **provider:** :fire: send message togther with media ([78aa23f](https://github.com/leifermendez/bot-whatsapp/commit/78aa23fab094059145f82e6781f9366d5d582b4f))
|
||||
* **provider:** :fire: send message togther with media ([b6bf43d](https://github.com/leifermendez/bot-whatsapp/commit/b6bf43d70fc28c6a229522b9b0de76cec43ac864))
|
||||
* **provider:** :zap: baileys fix restart ([ae83774](https://github.com/leifermendez/bot-whatsapp/commit/ae83774365027e2e86127ab7713ae9ee2df31f33))
|
||||
* **provider:** :zap: edit starter ([ff65832](https://github.com/leifermendez/bot-whatsapp/commit/ff65832012003423cc86d25cf0923452b1f8acb7))
|
||||
* **provider:** :zap: edit starter ([68dd182](https://github.com/leifermendez/bot-whatsapp/commit/68dd1820f05d04780824b318072d053eaf7db654))
|
||||
* **provider:** :zap: json space ([3cef741](https://github.com/leifermendez/bot-whatsapp/commit/3cef741c9ee30024eb42770a5f32931fcd372160))
|
||||
* **provider:** :zap: json space ([9b087e0](https://github.com/leifermendez/bot-whatsapp/commit/9b087e071019a7b6c79195a24dc7ddec498c5716))
|
||||
* **provider:** :zap: json space ([208fb4e](https://github.com/leifermendez/bot-whatsapp/commit/208fb4e9131dd5d4fd7230ba1aa11181337d9181))
|
||||
* **provider:** :zap: json space ([54a59c7](https://github.com/leifermendez/bot-whatsapp/commit/54a59c7f0d4dbaab006ce7e3c74412d8d3613ecd))
|
||||
* **provider:** qr-fix margin ([663641a](https://github.com/leifermendez/bot-whatsapp/commit/663641a1b8bf9234a88b0f3c38381ebc4bfa4bf9))
|
||||
* se quito addChild de las constantes porque no se usa ([ba2291a](https://github.com/leifermendez/bot-whatsapp/commit/ba2291a3ddac0d4101021e11d03cb222c5a4bb3b))
|
||||
* **starters:** :fire: updated staters ([4d4f15c](https://github.com/leifermendez/bot-whatsapp/commit/4d4f15ce73486d9335ad474d9e37c3b155670134))
|
||||
* **starters:** :fire: updated staters ([a30eaac](https://github.com/leifermendez/bot-whatsapp/commit/a30eaac77534d17eb980f6ec126140e9d30aa06e))
|
||||
* **starters:** :memo: update MIGRATION ([37fe323](https://github.com/leifermendez/bot-whatsapp/commit/37fe32322eb1bd41eecd151e52f17ec0588fb85e))
|
||||
* **starters:** :memo: update MIGRATION ([9b30e7d](https://github.com/leifermendez/bot-whatsapp/commit/9b30e7dcfc30bc160b56427cc6cdc2dc982bde2a))
|
||||
* **starters:** base templates are added for meta ([229e017](https://github.com/leifermendez/bot-whatsapp/commit/229e017ae20b84c9d12c7282f97b7034f5f33e6d))
|
||||
* **starters:** base templates are added for meta ([20f6651](https://github.com/leifermendez/bot-whatsapp/commit/20f665175c9b47226df41ce43e05574bd6ab1930))
|
||||
|
||||
### [0.1.2](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.1...v0.1.2) (2022-12-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cli:** :art: starters ([79e2318](https://github.com/leifermendez/bot-whatsapp/commit/79e231825613f33bfec2ae8e93139f885c199c7a))
|
||||
* **cli:** :art: starters ([87ba43a](https://github.com/leifermendez/bot-whatsapp/commit/87ba43a5535be0893a7701a3b6a085ee5d29e7c5))
|
||||
* fix dependencias ([61d0324](https://github.com/leifermendez/bot-whatsapp/commit/61d032426119341187a470035d49b8b252ca46cd))
|
||||
|
||||
### [0.1.1](https://github.com/leifermendez/bot-whatsapp/compare/v0.3.0...v0.1.1) (2022-12-12)
|
||||
|
||||
## 0.3.0 (2022-12-12)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* 🧨 NO
|
||||
|
||||
### Features
|
||||
|
||||
* (🎸) add onClick prop to component ([4ae3898](https://github.com/leifermendez/bot-whatsapp/commit/4ae389846d38c133f6bb2129ae373eed39d9d08d))
|
||||
* **adapter:** added adapter mysql ([717a7dc](https://github.com/leifermendez/bot-whatsapp/commit/717a7dc95fbc107ec6f55387aff606c47144baa4))
|
||||
* **adapter:** implementation of json file adapter ([5e1a373](https://github.com/leifermendez/bot-whatsapp/commit/5e1a3737303c843095984f6357564ea18458362f))
|
||||
* **adapter:** mysql adapter ([8d73c86](https://github.com/leifermendez/bot-whatsapp/commit/8d73c86946d07aa80e5b375b62b84a88b2892e03))
|
||||
* **adapter:** sql is added to create the table ([4b7de0f](https://github.com/leifermendez/bot-whatsapp/commit/4b7de0f6901524fa2c09271c3a99c364e6b3c260))
|
||||
* **bot:** :fire: improvement provider handler ([4154cc2](https://github.com/leifermendez/bot-whatsapp/commit/4154cc223091a46d3203d3a378cd42f61749a5fa))
|
||||
* **bot:** :zap: add send image function ([ce8a96b](https://github.com/leifermendez/bot-whatsapp/commit/ce8a96b958ff814c65d8fb4dbd5eaed5cc83a1ed))
|
||||
* **ci:** :art: add releases ([b115dc3](https://github.com/leifermendez/bot-whatsapp/commit/b115dc3654996f049837bfb6b5d039a2313df0ad))
|
||||
* **ci:** :art: relases script ([2e906bc](https://github.com/leifermendez/bot-whatsapp/commit/2e906bce79f7d854d437334e1d0c2cd270b0bbc6))
|
||||
* **ci:** update ci ([e5a9db7](https://github.com/leifermendez/bot-whatsapp/commit/e5a9db7e12340c4f5baa66e8b20585b63daa3bcf))
|
||||
* **cli:** create-starter ([3977987](https://github.com/leifermendez/bot-whatsapp/commit/397798790ef5857ca758b0df8384c6a4bfacc181))
|
||||
* **provider:** :fire: add twilii (weoking) ([4350dff](https://github.com/leifermendez/bot-whatsapp/commit/4350dff22a7de69ba6d35ecbdd67e59b810bd46f))
|
||||
* **provider:** added twilio provider ([8dd3be9](https://github.com/leifermendez/bot-whatsapp/commit/8dd3be909b36717f6b54e141a5f48d2722d4855c))
|
||||
* **release:** added ([1988948](https://github.com/leifermendez/bot-whatsapp/commit/1988948c30d922beb7b83faab96d1d59cf7f5f90))
|
||||
* **release:** added ([f4ad704](https://github.com/leifermendez/bot-whatsapp/commit/f4ad7040abf619635480c30babd6f1159c7af85a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **adapter:** conflict resolution ([4b307ef](https://github.com/leifermendez/bot-whatsapp/commit/4b307efe79c738a5c4e04ff1c07ca247d827593c))
|
||||
* **adapter:** corrections are made to the adapter ([afa6771](https://github.com/leifermendez/bot-whatsapp/commit/afa677190392d48715930ebe2b1e15c7619d730f))
|
||||
* **bot:** :zap: added delay promises ([73caf09](https://github.com/leifermendez/bot-whatsapp/commit/73caf090ba9013132e5dcb7761a10939dc9ac300))
|
||||
* **bot:** :zap: fix sensitive case ([24ac9fb](https://github.com/leifermendez/bot-whatsapp/commit/24ac9fbf48f80eeb521a36bc938af3a70dd82303))
|
||||
* **bot:** :zap: flow improvement + add utils ([a7b19d9](https://github.com/leifermendez/bot-whatsapp/commit/a7b19d9bff5ea66ff888555c3df37ae0e20b612a))
|
||||
* **bot:** update ([49698bf](https://github.com/leifermendez/bot-whatsapp/commit/49698bfda9d2a53f7b1a7e1724a796698601fbaa))
|
||||
* **ci:** :zap: balance version ([ec46cfd](https://github.com/leifermendez/bot-whatsapp/commit/ec46cfdd657c08c8e90261613f00cfc080f1e1d6))
|
||||
* **ci:** :zap: github action ([b827a0a](https://github.com/leifermendez/bot-whatsapp/commit/b827a0ab225b89bb8117c82628db0679c09b4102))
|
||||
* **ci:** :zap: github action ([4142ca4](https://github.com/leifermendez/bot-whatsapp/commit/4142ca4fd552e7005f3b1397a76b90a2e574d19d))
|
||||
* **ci:** :zap: github action ([091544a](https://github.com/leifermendez/bot-whatsapp/commit/091544ac3fac0c16925e856e1aec64bcad0ecf6d))
|
||||
* **ci:** :zap: github action ([2ce342a](https://github.com/leifermendez/bot-whatsapp/commit/2ce342a0cb15019d5084ca06dc30e342b030ea10))
|
||||
* **ci:** :zap: github action ([7817793](https://github.com/leifermendez/bot-whatsapp/commit/781779328f93ef8b0e6e0f85c6cd05ae782112fb))
|
||||
* **ci:** :zap: github action ([dfced8c](https://github.com/leifermendez/bot-whatsapp/commit/dfced8c594e9175c81e837af359631ba055b7e1a))
|
||||
* **ci:** :zap: github action ([aaa4ce8](https://github.com/leifermendez/bot-whatsapp/commit/aaa4ce837229fd51e274de3d91e1d9d615ac69fd))
|
||||
* **ci:** :zap: github action ([9ddf144](https://github.com/leifermendez/bot-whatsapp/commit/9ddf144244cd6877e7d26f576387814459f2befb))
|
||||
* **ci:** :zap: github action ([b465de5](https://github.com/leifermendez/bot-whatsapp/commit/b465de55a0e511213d1a7760a74efa102172c85e))
|
||||
* **ci:** :zap: github action ([cf1dc6f](https://github.com/leifermendez/bot-whatsapp/commit/cf1dc6fac810545e5a2b63f31f71322f37329e38))
|
||||
* **ci:** :zap: github action ([8d897f8](https://github.com/leifermendez/bot-whatsapp/commit/8d897f824e27a55ca011163092a813a7e8f426af))
|
||||
* **ci:** ci ([f55cfae](https://github.com/leifermendez/bot-whatsapp/commit/f55cfae6e4ccc1df949212999406680020d27f9c))
|
||||
* **ci:** ci ([671c5b3](https://github.com/leifermendez/bot-whatsapp/commit/671c5b37f33360e8cb754625b8dd6e83bce9014d))
|
||||
* **cli:** :bug: path ([32212fb](https://github.com/leifermendez/bot-whatsapp/commit/32212fb52d206bf6f8d753a86d9ce40aa0db2a5d))
|
||||
* **cli:** :fire: create script - templates ([2319db3](https://github.com/leifermendez/bot-whatsapp/commit/2319db3009501fe57ae21e60ad286eb68c46f4fd))
|
||||
* **cli:** :fire: create script - templates ([9cb98b5](https://github.com/leifermendez/bot-whatsapp/commit/9cb98b5e73fca3c3f5e70a8497badc31e494b943))
|
||||
* **cli:** :fire: create script - templates ([2999e0e](https://github.com/leifermendez/bot-whatsapp/commit/2999e0e753f31a8b9e6d7c117e78cdb5656e203a))
|
||||
* **cli:** :fire: create script - templates ([af716b7](https://github.com/leifermendez/bot-whatsapp/commit/af716b75372899877a81b528b58278376166d0ad))
|
||||
* **cli:** :fire: create script - templates ([c6999c8](https://github.com/leifermendez/bot-whatsapp/commit/c6999c84931083a87b5717db58003be68244707e))
|
||||
* **cli:** :fire: create script - templates ([d4b49a9](https://github.com/leifermendez/bot-whatsapp/commit/d4b49a9bd7085070f0c5964d2903f10b71bde0b3))
|
||||
* **cli:** :fire: create script - templates ([eebc3c9](https://github.com/leifermendez/bot-whatsapp/commit/eebc3c980638d88f11a0d93b8344f3ff345c7ee5))
|
||||
* **cli:** :zap: clean eslinter ([bfb69d9](https://github.com/leifermendez/bot-whatsapp/commit/bfb69d9a9574a757ae02748b6c5f5afa3eac68e6))
|
||||
* **cli:** :zap: clean eslinter ([15f6972](https://github.com/leifermendez/bot-whatsapp/commit/15f697225775a0f0e0a440cd980f7fb8f51a1056))
|
||||
* **cli:** :zap: create-starter ([d3b8310](https://github.com/leifermendez/bot-whatsapp/commit/d3b8310180d2ad813733b1d18f2c32d7d947740a))
|
||||
* **cli:** :zap: update cli copy ([7797c2b](https://github.com/leifermendez/bot-whatsapp/commit/7797c2b46133697e2a591adab2b67e66b34a1cfe))
|
||||
* **fix:** fix ([6483545](https://github.com/leifermendez/bot-whatsapp/commit/648354500b123f20044f5ac2e8a26b15f16d1b8d))
|
||||
* **fix:** fix ([28c0480](https://github.com/leifermendez/bot-whatsapp/commit/28c0480b8bfa6b24394095f57c36ef89c9aeb566))
|
||||
* **linter:** update linter and commitlint ([70a94ab](https://github.com/leifermendez/bot-whatsapp/commit/70a94ab2c6f8e4122780c77bc3a621944883e621))
|
||||
* pre-copy fix ([08e2552](https://github.com/leifermendez/bot-whatsapp/commit/08e2552907c48cfeaac843457a18bf2032e6f8aa))
|
||||
* pre-copy fix ([6617107](https://github.com/leifermendez/bot-whatsapp/commit/6617107ab824215c449e26eae6c2bb327ecfc092))
|
||||
* **starter:** pre-copy fix ([929e74c](https://github.com/leifermendez/bot-whatsapp/commit/929e74c84b667ec13cb5490b3b951cb8df15ebd1))
|
||||
|
||||
|
||||
* (💍) Is justa test! ([37d04e9](https://github.com/leifermendez/bot-whatsapp/commit/37d04e9e89d3f01fdc367654ba60fb11ab2614c4))
|
||||
|
||||
### [0.2.1](https://github.com/leifermendez/bot-whatsapp/compare/v0.2.0...v0.2.1) (2022-12-12)
|
||||
|
||||
## 0.2.0 (2022-12-12)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* 🧨 NO
|
||||
|
||||
### Features
|
||||
|
||||
* (🎸) add onClick prop to component ([4ae3898](https://github.com/leifermendez/bot-whatsapp/commit/4ae389846d38c133f6bb2129ae373eed39d9d08d))
|
||||
* **adapter:** added adapter mysql ([717a7dc](https://github.com/leifermendez/bot-whatsapp/commit/717a7dc95fbc107ec6f55387aff606c47144baa4))
|
||||
* **adapter:** implementation of json file adapter ([5e1a373](https://github.com/leifermendez/bot-whatsapp/commit/5e1a3737303c843095984f6357564ea18458362f))
|
||||
* **adapter:** mysql adapter ([8d73c86](https://github.com/leifermendez/bot-whatsapp/commit/8d73c86946d07aa80e5b375b62b84a88b2892e03))
|
||||
* **adapter:** sql is added to create the table ([4b7de0f](https://github.com/leifermendez/bot-whatsapp/commit/4b7de0f6901524fa2c09271c3a99c364e6b3c260))
|
||||
* **bot:** :fire: improvement provider handler ([4154cc2](https://github.com/leifermendez/bot-whatsapp/commit/4154cc223091a46d3203d3a378cd42f61749a5fa))
|
||||
* **bot:** :zap: add send image function ([ce8a96b](https://github.com/leifermendez/bot-whatsapp/commit/ce8a96b958ff814c65d8fb4dbd5eaed5cc83a1ed))
|
||||
* **ci:** :art: add releases ([b115dc3](https://github.com/leifermendez/bot-whatsapp/commit/b115dc3654996f049837bfb6b5d039a2313df0ad))
|
||||
* **ci:** :art: relases script ([2e906bc](https://github.com/leifermendez/bot-whatsapp/commit/2e906bce79f7d854d437334e1d0c2cd270b0bbc6))
|
||||
* **ci:** update ci ([e5a9db7](https://github.com/leifermendez/bot-whatsapp/commit/e5a9db7e12340c4f5baa66e8b20585b63daa3bcf))
|
||||
* **cli:** create-starter ([3977987](https://github.com/leifermendez/bot-whatsapp/commit/397798790ef5857ca758b0df8384c6a4bfacc181))
|
||||
* **provider:** :fire: add twilii (weoking) ([4350dff](https://github.com/leifermendez/bot-whatsapp/commit/4350dff22a7de69ba6d35ecbdd67e59b810bd46f))
|
||||
* **provider:** added twilio provider ([8dd3be9](https://github.com/leifermendez/bot-whatsapp/commit/8dd3be909b36717f6b54e141a5f48d2722d4855c))
|
||||
* **release:** added ([1988948](https://github.com/leifermendez/bot-whatsapp/commit/1988948c30d922beb7b83faab96d1d59cf7f5f90))
|
||||
* **release:** added ([f4ad704](https://github.com/leifermendez/bot-whatsapp/commit/f4ad7040abf619635480c30babd6f1159c7af85a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **adapter:** conflict resolution ([4b307ef](https://github.com/leifermendez/bot-whatsapp/commit/4b307efe79c738a5c4e04ff1c07ca247d827593c))
|
||||
* **adapter:** corrections are made to the adapter ([afa6771](https://github.com/leifermendez/bot-whatsapp/commit/afa677190392d48715930ebe2b1e15c7619d730f))
|
||||
* **bot:** :zap: added delay promises ([73caf09](https://github.com/leifermendez/bot-whatsapp/commit/73caf090ba9013132e5dcb7761a10939dc9ac300))
|
||||
* **bot:** :zap: fix sensitive case ([24ac9fb](https://github.com/leifermendez/bot-whatsapp/commit/24ac9fbf48f80eeb521a36bc938af3a70dd82303))
|
||||
* **bot:** :zap: flow improvement + add utils ([a7b19d9](https://github.com/leifermendez/bot-whatsapp/commit/a7b19d9bff5ea66ff888555c3df37ae0e20b612a))
|
||||
* **bot:** update ([49698bf](https://github.com/leifermendez/bot-whatsapp/commit/49698bfda9d2a53f7b1a7e1724a796698601fbaa))
|
||||
* **ci:** :zap: balance version ([ec46cfd](https://github.com/leifermendez/bot-whatsapp/commit/ec46cfdd657c08c8e90261613f00cfc080f1e1d6))
|
||||
* **ci:** :zap: github action ([b827a0a](https://github.com/leifermendez/bot-whatsapp/commit/b827a0ab225b89bb8117c82628db0679c09b4102))
|
||||
* **ci:** :zap: github action ([4142ca4](https://github.com/leifermendez/bot-whatsapp/commit/4142ca4fd552e7005f3b1397a76b90a2e574d19d))
|
||||
* **ci:** :zap: github action ([091544a](https://github.com/leifermendez/bot-whatsapp/commit/091544ac3fac0c16925e856e1aec64bcad0ecf6d))
|
||||
* **ci:** :zap: github action ([2ce342a](https://github.com/leifermendez/bot-whatsapp/commit/2ce342a0cb15019d5084ca06dc30e342b030ea10))
|
||||
* **ci:** :zap: github action ([7817793](https://github.com/leifermendez/bot-whatsapp/commit/781779328f93ef8b0e6e0f85c6cd05ae782112fb))
|
||||
* **ci:** :zap: github action ([dfced8c](https://github.com/leifermendez/bot-whatsapp/commit/dfced8c594e9175c81e837af359631ba055b7e1a))
|
||||
* **ci:** :zap: github action ([aaa4ce8](https://github.com/leifermendez/bot-whatsapp/commit/aaa4ce837229fd51e274de3d91e1d9d615ac69fd))
|
||||
* **ci:** :zap: github action ([9ddf144](https://github.com/leifermendez/bot-whatsapp/commit/9ddf144244cd6877e7d26f576387814459f2befb))
|
||||
* **ci:** :zap: github action ([b465de5](https://github.com/leifermendez/bot-whatsapp/commit/b465de55a0e511213d1a7760a74efa102172c85e))
|
||||
* **ci:** :zap: github action ([cf1dc6f](https://github.com/leifermendez/bot-whatsapp/commit/cf1dc6fac810545e5a2b63f31f71322f37329e38))
|
||||
* **ci:** :zap: github action ([8d897f8](https://github.com/leifermendez/bot-whatsapp/commit/8d897f824e27a55ca011163092a813a7e8f426af))
|
||||
* **ci:** ci ([f55cfae](https://github.com/leifermendez/bot-whatsapp/commit/f55cfae6e4ccc1df949212999406680020d27f9c))
|
||||
* **ci:** ci ([671c5b3](https://github.com/leifermendez/bot-whatsapp/commit/671c5b37f33360e8cb754625b8dd6e83bce9014d))
|
||||
* **cli:** :bug: path ([32212fb](https://github.com/leifermendez/bot-whatsapp/commit/32212fb52d206bf6f8d753a86d9ce40aa0db2a5d))
|
||||
* **cli:** :fire: create script - templates ([2319db3](https://github.com/leifermendez/bot-whatsapp/commit/2319db3009501fe57ae21e60ad286eb68c46f4fd))
|
||||
* **cli:** :fire: create script - templates ([9cb98b5](https://github.com/leifermendez/bot-whatsapp/commit/9cb98b5e73fca3c3f5e70a8497badc31e494b943))
|
||||
* **cli:** :fire: create script - templates ([2999e0e](https://github.com/leifermendez/bot-whatsapp/commit/2999e0e753f31a8b9e6d7c117e78cdb5656e203a))
|
||||
* **cli:** :fire: create script - templates ([af716b7](https://github.com/leifermendez/bot-whatsapp/commit/af716b75372899877a81b528b58278376166d0ad))
|
||||
* **cli:** :fire: create script - templates ([c6999c8](https://github.com/leifermendez/bot-whatsapp/commit/c6999c84931083a87b5717db58003be68244707e))
|
||||
* **cli:** :fire: create script - templates ([d4b49a9](https://github.com/leifermendez/bot-whatsapp/commit/d4b49a9bd7085070f0c5964d2903f10b71bde0b3))
|
||||
* **cli:** :fire: create script - templates ([eebc3c9](https://github.com/leifermendez/bot-whatsapp/commit/eebc3c980638d88f11a0d93b8344f3ff345c7ee5))
|
||||
* **cli:** :zap: clean eslinter ([bfb69d9](https://github.com/leifermendez/bot-whatsapp/commit/bfb69d9a9574a757ae02748b6c5f5afa3eac68e6))
|
||||
* **cli:** :zap: clean eslinter ([15f6972](https://github.com/leifermendez/bot-whatsapp/commit/15f697225775a0f0e0a440cd980f7fb8f51a1056))
|
||||
* **cli:** :zap: create-starter ([d3b8310](https://github.com/leifermendez/bot-whatsapp/commit/d3b8310180d2ad813733b1d18f2c32d7d947740a))
|
||||
* **cli:** :zap: update cli copy ([7797c2b](https://github.com/leifermendez/bot-whatsapp/commit/7797c2b46133697e2a591adab2b67e66b34a1cfe))
|
||||
* **fix:** fix ([6483545](https://github.com/leifermendez/bot-whatsapp/commit/648354500b123f20044f5ac2e8a26b15f16d1b8d))
|
||||
* **fix:** fix ([28c0480](https://github.com/leifermendez/bot-whatsapp/commit/28c0480b8bfa6b24394095f57c36ef89c9aeb566))
|
||||
* **linter:** update linter and commitlint ([70a94ab](https://github.com/leifermendez/bot-whatsapp/commit/70a94ab2c6f8e4122780c77bc3a621944883e621))
|
||||
* pre-copy fix ([08e2552](https://github.com/leifermendez/bot-whatsapp/commit/08e2552907c48cfeaac843457a18bf2032e6f8aa))
|
||||
* pre-copy fix ([6617107](https://github.com/leifermendez/bot-whatsapp/commit/6617107ab824215c449e26eae6c2bb327ecfc092))
|
||||
* **starter:** pre-copy fix ([929e74c](https://github.com/leifermendez/bot-whatsapp/commit/929e74c84b667ec13cb5490b3b951cb8df15ebd1))
|
||||
|
||||
|
||||
* (💍) Is justa test! ([37d04e9](https://github.com/leifermendez/bot-whatsapp/commit/37d04e9e89d3f01fdc367654ba60fb11ab2614c4))
|
||||
|
||||
### [0.0.3](https://github.com/leifermendez/bot-whatsapp/compare/v0.2.0...v0.0.3) (2022-12-12)
|
||||
|
||||
## 0.2.0 (2022-12-12)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* 🧨 NO
|
||||
|
||||
### Features
|
||||
|
||||
* (🎸) add onClick prop to component ([4ae3898](https://github.com/leifermendez/bot-whatsapp/commit/4ae389846d38c133f6bb2129ae373eed39d9d08d))
|
||||
* **adapter:** added adapter mysql ([717a7dc](https://github.com/leifermendez/bot-whatsapp/commit/717a7dc95fbc107ec6f55387aff606c47144baa4))
|
||||
* **adapter:** implementation of json file adapter ([5e1a373](https://github.com/leifermendez/bot-whatsapp/commit/5e1a3737303c843095984f6357564ea18458362f))
|
||||
* **adapter:** mysql adapter ([8d73c86](https://github.com/leifermendez/bot-whatsapp/commit/8d73c86946d07aa80e5b375b62b84a88b2892e03))
|
||||
* **adapter:** sql is added to create the table ([4b7de0f](https://github.com/leifermendez/bot-whatsapp/commit/4b7de0f6901524fa2c09271c3a99c364e6b3c260))
|
||||
* **bot:** :fire: improvement provider handler ([4154cc2](https://github.com/leifermendez/bot-whatsapp/commit/4154cc223091a46d3203d3a378cd42f61749a5fa))
|
||||
* **bot:** :zap: add send image function ([ce8a96b](https://github.com/leifermendez/bot-whatsapp/commit/ce8a96b958ff814c65d8fb4dbd5eaed5cc83a1ed))
|
||||
* **ci:** :art: add releases ([b115dc3](https://github.com/leifermendez/bot-whatsapp/commit/b115dc3654996f049837bfb6b5d039a2313df0ad))
|
||||
* **ci:** :art: relases script ([2e906bc](https://github.com/leifermendez/bot-whatsapp/commit/2e906bce79f7d854d437334e1d0c2cd270b0bbc6))
|
||||
* **ci:** update ci ([e5a9db7](https://github.com/leifermendez/bot-whatsapp/commit/e5a9db7e12340c4f5baa66e8b20585b63daa3bcf))
|
||||
* **cli:** create-starter ([3977987](https://github.com/leifermendez/bot-whatsapp/commit/397798790ef5857ca758b0df8384c6a4bfacc181))
|
||||
* **provider:** :fire: add twilii (weoking) ([4350dff](https://github.com/leifermendez/bot-whatsapp/commit/4350dff22a7de69ba6d35ecbdd67e59b810bd46f))
|
||||
* **provider:** added twilio provider ([8dd3be9](https://github.com/leifermendez/bot-whatsapp/commit/8dd3be909b36717f6b54e141a5f48d2722d4855c))
|
||||
* **release:** added ([1988948](https://github.com/leifermendez/bot-whatsapp/commit/1988948c30d922beb7b83faab96d1d59cf7f5f90))
|
||||
* **release:** added ([f4ad704](https://github.com/leifermendez/bot-whatsapp/commit/f4ad7040abf619635480c30babd6f1159c7af85a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **adapter:** conflict resolution ([4b307ef](https://github.com/leifermendez/bot-whatsapp/commit/4b307efe79c738a5c4e04ff1c07ca247d827593c))
|
||||
* **adapter:** corrections are made to the adapter ([afa6771](https://github.com/leifermendez/bot-whatsapp/commit/afa677190392d48715930ebe2b1e15c7619d730f))
|
||||
* **bot:** :zap: added delay promises ([73caf09](https://github.com/leifermendez/bot-whatsapp/commit/73caf090ba9013132e5dcb7761a10939dc9ac300))
|
||||
* **bot:** :zap: fix sensitive case ([24ac9fb](https://github.com/leifermendez/bot-whatsapp/commit/24ac9fbf48f80eeb521a36bc938af3a70dd82303))
|
||||
* **bot:** :zap: flow improvement + add utils ([a7b19d9](https://github.com/leifermendez/bot-whatsapp/commit/a7b19d9bff5ea66ff888555c3df37ae0e20b612a))
|
||||
* **bot:** update ([49698bf](https://github.com/leifermendez/bot-whatsapp/commit/49698bfda9d2a53f7b1a7e1724a796698601fbaa))
|
||||
* **ci:** :zap: balance version ([ec46cfd](https://github.com/leifermendez/bot-whatsapp/commit/ec46cfdd657c08c8e90261613f00cfc080f1e1d6))
|
||||
* **ci:** :zap: github action ([b827a0a](https://github.com/leifermendez/bot-whatsapp/commit/b827a0ab225b89bb8117c82628db0679c09b4102))
|
||||
* **ci:** :zap: github action ([4142ca4](https://github.com/leifermendez/bot-whatsapp/commit/4142ca4fd552e7005f3b1397a76b90a2e574d19d))
|
||||
* **ci:** :zap: github action ([091544a](https://github.com/leifermendez/bot-whatsapp/commit/091544ac3fac0c16925e856e1aec64bcad0ecf6d))
|
||||
* **ci:** :zap: github action ([2ce342a](https://github.com/leifermendez/bot-whatsapp/commit/2ce342a0cb15019d5084ca06dc30e342b030ea10))
|
||||
* **ci:** :zap: github action ([7817793](https://github.com/leifermendez/bot-whatsapp/commit/781779328f93ef8b0e6e0f85c6cd05ae782112fb))
|
||||
* **ci:** :zap: github action ([dfced8c](https://github.com/leifermendez/bot-whatsapp/commit/dfced8c594e9175c81e837af359631ba055b7e1a))
|
||||
* **ci:** :zap: github action ([aaa4ce8](https://github.com/leifermendez/bot-whatsapp/commit/aaa4ce837229fd51e274de3d91e1d9d615ac69fd))
|
||||
* **ci:** :zap: github action ([9ddf144](https://github.com/leifermendez/bot-whatsapp/commit/9ddf144244cd6877e7d26f576387814459f2befb))
|
||||
* **ci:** :zap: github action ([b465de5](https://github.com/leifermendez/bot-whatsapp/commit/b465de55a0e511213d1a7760a74efa102172c85e))
|
||||
* **ci:** :zap: github action ([cf1dc6f](https://github.com/leifermendez/bot-whatsapp/commit/cf1dc6fac810545e5a2b63f31f71322f37329e38))
|
||||
* **ci:** :zap: github action ([8d897f8](https://github.com/leifermendez/bot-whatsapp/commit/8d897f824e27a55ca011163092a813a7e8f426af))
|
||||
* **ci:** ci ([f55cfae](https://github.com/leifermendez/bot-whatsapp/commit/f55cfae6e4ccc1df949212999406680020d27f9c))
|
||||
* **ci:** ci ([671c5b3](https://github.com/leifermendez/bot-whatsapp/commit/671c5b37f33360e8cb754625b8dd6e83bce9014d))
|
||||
* **cli:** :bug: path ([32212fb](https://github.com/leifermendez/bot-whatsapp/commit/32212fb52d206bf6f8d753a86d9ce40aa0db2a5d))
|
||||
* **cli:** :fire: create script - templates ([2319db3](https://github.com/leifermendez/bot-whatsapp/commit/2319db3009501fe57ae21e60ad286eb68c46f4fd))
|
||||
* **cli:** :fire: create script - templates ([9cb98b5](https://github.com/leifermendez/bot-whatsapp/commit/9cb98b5e73fca3c3f5e70a8497badc31e494b943))
|
||||
* **cli:** :fire: create script - templates ([2999e0e](https://github.com/leifermendez/bot-whatsapp/commit/2999e0e753f31a8b9e6d7c117e78cdb5656e203a))
|
||||
* **cli:** :fire: create script - templates ([af716b7](https://github.com/leifermendez/bot-whatsapp/commit/af716b75372899877a81b528b58278376166d0ad))
|
||||
* **cli:** :fire: create script - templates ([c6999c8](https://github.com/leifermendez/bot-whatsapp/commit/c6999c84931083a87b5717db58003be68244707e))
|
||||
* **cli:** :fire: create script - templates ([d4b49a9](https://github.com/leifermendez/bot-whatsapp/commit/d4b49a9bd7085070f0c5964d2903f10b71bde0b3))
|
||||
* **cli:** :fire: create script - templates ([eebc3c9](https://github.com/leifermendez/bot-whatsapp/commit/eebc3c980638d88f11a0d93b8344f3ff345c7ee5))
|
||||
* **cli:** :zap: clean eslinter ([bfb69d9](https://github.com/leifermendez/bot-whatsapp/commit/bfb69d9a9574a757ae02748b6c5f5afa3eac68e6))
|
||||
* **cli:** :zap: clean eslinter ([15f6972](https://github.com/leifermendez/bot-whatsapp/commit/15f697225775a0f0e0a440cd980f7fb8f51a1056))
|
||||
* **cli:** :zap: create-starter ([d3b8310](https://github.com/leifermendez/bot-whatsapp/commit/d3b8310180d2ad813733b1d18f2c32d7d947740a))
|
||||
* **cli:** :zap: update cli copy ([7797c2b](https://github.com/leifermendez/bot-whatsapp/commit/7797c2b46133697e2a591adab2b67e66b34a1cfe))
|
||||
* **fix:** fix ([6483545](https://github.com/leifermendez/bot-whatsapp/commit/648354500b123f20044f5ac2e8a26b15f16d1b8d))
|
||||
* **fix:** fix ([28c0480](https://github.com/leifermendez/bot-whatsapp/commit/28c0480b8bfa6b24394095f57c36ef89c9aeb566))
|
||||
* **linter:** update linter and commitlint ([70a94ab](https://github.com/leifermendez/bot-whatsapp/commit/70a94ab2c6f8e4122780c77bc3a621944883e621))
|
||||
* pre-copy fix ([08e2552](https://github.com/leifermendez/bot-whatsapp/commit/08e2552907c48cfeaac843457a18bf2032e6f8aa))
|
||||
* pre-copy fix ([6617107](https://github.com/leifermendez/bot-whatsapp/commit/6617107ab824215c449e26eae6c2bb327ecfc092))
|
||||
* **starter:** pre-copy fix ([929e74c](https://github.com/leifermendez/bot-whatsapp/commit/929e74c84b667ec13cb5490b3b951cb8df15ebd1))
|
||||
|
||||
|
||||
* (💍) Is justa test! ([37d04e9](https://github.com/leifermendez/bot-whatsapp/commit/37d04e9e89d3f01fdc367654ba60fb11ab2614c4))
|
||||
|
||||
## 0.2.0-alpha.0 (2022-12-01)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* 🧨 NO
|
||||
|
||||
### Features
|
||||
|
||||
* (🎸) add onClick prop to component ([4ae3898](https://github.com/leifermendez/bot-whatsapp/commit/4ae389846d38c133f6bb2129ae373eed39d9d08d))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** ci ([f55cfae](https://github.com/leifermendez/bot-whatsapp/commit/f55cfae6e4ccc1df949212999406680020d27f9c))
|
||||
* **ci:** ci ([671c5b3](https://github.com/leifermendez/bot-whatsapp/commit/671c5b37f33360e8cb754625b8dd6e83bce9014d))
|
||||
* **linter:** update linter and commitlint ([70a94ab](https://github.com/leifermendez/bot-whatsapp/commit/70a94ab2c6f8e4122780c77bc3a621944883e621))
|
||||
|
||||
|
||||
* (💍) Is justa test! ([37d04e9](https://github.com/leifermendez/bot-whatsapp/commit/37d04e9e89d3f01fdc367654ba60fb11ab2614c4))
|
||||
|
||||
## 0.1.0 (2022-11-29)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* 🧨 NO
|
||||
|
||||
### Features
|
||||
|
||||
* (🎸) add onClick prop to component ([4ae3898](https://github.com/leifermendez/bot-whatsapp/commit/4ae389846d38c133f6bb2129ae373eed39d9d08d))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** ci ([f55cfae](https://github.com/leifermendez/bot-whatsapp/commit/f55cfae6e4ccc1df949212999406680020d27f9c))
|
||||
* **ci:** ci ([671c5b3](https://github.com/leifermendez/bot-whatsapp/commit/671c5b37f33360e8cb754625b8dd6e83bce9014d))
|
||||
|
||||
|
||||
* (💍) Is justa test! ([37d04e9](https://github.com/leifermendez/bot-whatsapp/commit/37d04e9e89d3f01fdc367654ba60fb11ab2614c4))
|
||||
|
||||
#### Actualización 14 Ene 2022
|
||||
|
||||
- npm update
|
||||
- remove ora and chalk
|
||||
- add env
|
||||
- add mysql
|
||||
- add dialogflow
|
||||
- add scan qr from webpage
|
||||
- update route with middleware
|
||||
- fix send message to story
|
||||
- external download
|
||||
- easy deploy heroku
|
||||
- add support for ubuntu/linux
|
||||
|
||||
https://stackoverflow.com/questions/51855169/dialogflow-403-iam-permission-dialogflow-sessions-detectintent
|
||||
128
CODE_OF_CONDUCT.md
Normal file
128
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
leifer.contacto@gmail.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
103
CONTRIBUTING.md
Normal file
103
CONTRIBUTING.md
Normal file
@@ -0,0 +1,103 @@
|
||||
# CONTRIBUTING
|
||||
|
||||
### 📄 Bienvenido/a
|
||||
Si deseas colaborar con el proyecto existen varias maneras, la primera de ellas es aportando conocimiento y mejorando el repositorio (actualizando documentación, mejorando código, revisando __[issues](https://github.com/codigoencasa/bot-whatsapp/issues)__, etc).
|
||||
|
||||
También es bien recibido los aportes económicos que se utilizaran para diferentes fines __[ver más](https://opencollective.com/bot-whatsapp)__
|
||||
|
||||
El lenguaje principal que se utilizó para desarrollar este proyecto fue __JavaScript__ con el fin de qué personas que están iniciando en el mundo de la programación puedan entender fácilmente.
|
||||
|
||||
|
||||
### 🤔 Preguntas frecuentes
|
||||
- ¿Como puedo hacer aportaciones de código en el proyecto?: [Ver Video](https://youtu.be/Lxt8Acob6aU)
|
||||
- ¿Como ejecutar el entorno de pruebas?: [Ver Video](https://youtu.be/Mf9V-dloBfk)
|
||||
- ¿Como crear un nuevo proveedor?: [Ver Video](https://youtu.be/cahK9zH3SI8)
|
||||
- ¿Que son los GithubActions?: [Ver Video](https://youtu.be/nYBEBFKLiqw)
|
||||
- ¿Canales de comunicación?: [Discord](https://link.codigoencasa.com/DISCORD)
|
||||
|
||||
-----
|
||||
|
||||

|
||||
|
||||
|
||||
__Requerimientos:__
|
||||
- Node v16 o superior __[descargar node](https://nodejs.org/es/download/)__
|
||||
- __[Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable)__ como gestor de paquetes. En el link conseguirás las intrucciones para instalar yarn.
|
||||
- __[VSCode](https://code.visualstudio.com/download)__ (recomendado): Editor de código con plugins.
|
||||
- __[Conventional Commits](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits&ssr=false#overview)__ (plugin-vscode) este plugin te ayudará a crear commit semántico.
|
||||
- Se usará la rama __dev__ *(https://github.com/leifermendez/bot-whatsapp/tree/dev)* como rama principal hasta que se haga oficialmente el lanzamiento de la V2.
|
||||
|
||||
### 🚀 Iniciando
|
||||
|
||||
__Clonar repo rama dev__
|
||||
```
|
||||
git clone --branch dev https://github.com/codigoencasa/bot-whatsapp
|
||||
```
|
||||
__Instalar dependencias__
|
||||
```
|
||||
cd bot-whatsapp
|
||||
yarn install
|
||||
```
|
||||
|
||||
__Compilar (build)__
|
||||
Para compilar la aplicación es necesario ejecutar este comando, el cual genera un directorio `lib` dentro de los paquetes del monorepo.
|
||||
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
__Example-app__
|
||||
Se ejecuta el CLI (Command Line Interface) para ayudarte a crear un app-bot de ejemplo.
|
||||
```
|
||||
yarn run cli
|
||||
```
|
||||
|
||||
Selecionas (mediante las flechas arriba y abajo) el proveedor que quieras usar y cuando estes sobre el presiona la barra de espacio, igualmente selecciona la base de datos que quieras usar.
|
||||
|
||||
Se creó un subdirecorio con el nombre del proveedor y base de datos que seleccionaste, ejemplo: `base-bailey-mysql`
|
||||
|
||||
Dentro de ese directorio necesitas editar el archivo package.json y borrar las siguientes lineas:
|
||||
```
|
||||
"@bot-whatsapp/bot": "latest",
|
||||
"@bot-whatsapp/cli": "latest",
|
||||
"@bot-whatsapp/database": "latest",
|
||||
"@bot-whatsapp/provider": "latest",
|
||||
```
|
||||
|
||||
Cambiate al directorio creado ejemplo: `base-bailey-mysql`
|
||||
```
|
||||
cd base-baileys-mysql
|
||||
```
|
||||
Ejecuta los comandos:
|
||||
```
|
||||
npm install
|
||||
npm run pre-copy
|
||||
npm start
|
||||
```
|
||||
En el caso de MySql y Mongo es necesario especificar en app.js los datos de la conexión, ejemplo de MySql:
|
||||
```
|
||||
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
|
||||
const MySQLAdapter = require('@bot-whatsapp/database/mysql')
|
||||
|
||||
/**
|
||||
* Declaramos las conexiones de MySQL
|
||||
*/
|
||||
const MYSQL_DB_HOST = 'localhost'
|
||||
const MYSQL_DB_USER = 'usr'
|
||||
const MYSQL_DB_PASSWORD = 'pass'
|
||||
const MYSQL_DB_NAME = 'bot'
|
||||
```
|
||||
<!-- __Seguir instrucciones__
|
||||
En la consola encontraras los pasos a seguir -->
|
||||
|
||||

|
||||
|
||||
|
||||
> __NOTA:__ [Eres libre de aportar informacion a este documento o arreglar ortografia 🤣](
|
||||
https://github.com/codigoencasa/bot-whatsapp/edit/dev/CONTRIBUTING.md)
|
||||
|
||||
------
|
||||
- [Discord](https://link.codigoencasa.com/DISCORD)
|
||||
- [Twitter](https://twitter.com/leifermendez)
|
||||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
|
||||
- [Telegram](https://t.me/leifermendez)
|
||||
88
EXAMPLE.md
Normal file
88
EXAMPLE.md
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
```js
|
||||
|
||||
const {
|
||||
createBot,
|
||||
createProvider,
|
||||
createFlow,
|
||||
addKeyword,
|
||||
toSerialize,
|
||||
} = require('@bot-whatsapp/bot')
|
||||
|
||||
const WebWhatsappProvider = require('@bot-whatsapp/provider/web-whatsapp')
|
||||
const MongoAdapter = require('@bot-whatsapp/database/mongo')
|
||||
|
||||
const flowArepa1 = toSerialize(
|
||||
addKeyword(['1', 'AREPA14'])
|
||||
.addAnswer('Esta es una arepa calificada ⭐⭐⭐⭐⭐')
|
||||
.addAnswer(['Ingredientes:', '10g Aguacate', '20g Huevo'].join('\n'))
|
||||
.toJson()
|
||||
)
|
||||
|
||||
const flowArepa2_2 = toSerialize(
|
||||
addKeyword('SI').addAnswer('te pongo huevo de mentira!').toJson()
|
||||
)
|
||||
|
||||
const flowArepa2 = toSerialize(
|
||||
addKeyword(['arepa2'])
|
||||
.addAnswer('Esta es una arepa calificada ⭐⭐⭐⭐')
|
||||
.addAnswer(
|
||||
['Ingredientes:', '10g perico', '20g huevo', '10g queso'].join('\n')
|
||||
)
|
||||
.addAnswer(
|
||||
'Eres Vegano SI o NO',
|
||||
{
|
||||
capture: true,
|
||||
},
|
||||
null,
|
||||
[...flowArepa2_2]
|
||||
)
|
||||
.toJson()
|
||||
)
|
||||
|
||||
const flowArepa3 = toSerialize(
|
||||
addKeyword(['arepa3'])
|
||||
.addAnswer('Esta es una arepa calificada LAMEJOR ⭐⭐⭐⭐⭐')
|
||||
.toJson()
|
||||
)
|
||||
|
||||
//////////////--MENU--PRINCIPAL--//////////////////
|
||||
|
||||
const flujoMenuArepa = addKeyword(['hola', 'ola', 'buenos'])
|
||||
.addAnswer('Bienvenido "Arepera Aji Picante 🤯🚀😅"')
|
||||
.addAnswer(
|
||||
[
|
||||
'El menú de hoy es el siguiente:',
|
||||
'👉 [1 -AREPA14] - Arepa tradicional con Aguacate y Huevo',
|
||||
'👉 [arepa2] - Arepa rellena de perico y huevo con un toque de queso',
|
||||
'👉 [arepa3] - Rellena de Jamon y Queso',
|
||||
].join('\n')
|
||||
)
|
||||
.addAnswer(
|
||||
'Esperando respuesta...',
|
||||
{
|
||||
capture: true,
|
||||
},
|
||||
() => {
|
||||
console.log('Enviar un mail!')
|
||||
},
|
||||
[...flowArepa1, ...flowArepa2, ...flowArepa3]
|
||||
)
|
||||
.addAnswer('Gracias!')
|
||||
|
||||
const main = async () => {
|
||||
const adapterDB = new MongoAdapter()
|
||||
const adapterFlow = createFlow([flujoMenuArepa])
|
||||
const adapterProvider = createProvider(WebWhatsappProvider)
|
||||
|
||||
createBot({
|
||||
flow: adapterFlow,
|
||||
provider: adapterProvider,
|
||||
database: adapterDB,
|
||||
})
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
|
||||
```
|
||||
2
GLOSSARY.md
Normal file
2
GLOSSARY.md
Normal file
@@ -0,0 +1,2 @@
|
||||
CTX: Es el objeto que representa un mensaje, con opciones, id, ref
|
||||
messageInComming: Objeto entrante del provider {body, from,to,...}
|
||||
21
LICENSE.md
Normal file
21
LICENSE.md
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Leifer Mendez
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
214
MIGRATION.md
Normal file
214
MIGRATION.md
Normal file
@@ -0,0 +1,214 @@
|
||||
# Migración
|
||||
|
||||
#### Versión (legacy)
|
||||
|
||||
En la ***versión (legacy)*** se implementaban los flujos de esta manera, en dos archivos independientes.
|
||||
|
||||
> __`initial.json`__ para establecer las palabras claves y el flujo a responder, por otro lado tambien se necesitaba implementar
|
||||
> __`response.json`__ donde se escriben los mensajes a responder.
|
||||
|
||||
```json
|
||||
//initial.json
|
||||
[
|
||||
{
|
||||
"keywords": [
|
||||
"hola",
|
||||
"ola",
|
||||
"alo"
|
||||
],
|
||||
"key": "hola"
|
||||
},
|
||||
{
|
||||
"keywords": ["productos", "info"],
|
||||
"key": "productos"
|
||||
},
|
||||
{
|
||||
"keywords": ["adios", "bye"],
|
||||
"key": "adios"
|
||||
},
|
||||
{
|
||||
"keywords": ["imagen", "foto"],
|
||||
"key": "catalogo"
|
||||
}
|
||||
]
|
||||
```
|
||||
```json
|
||||
//response.json
|
||||
{
|
||||
"hola":{
|
||||
"replyMessage":[
|
||||
"Gracias a ti! \n"
|
||||
],
|
||||
"media":null,
|
||||
"trigger":null
|
||||
},
|
||||
"adios":{
|
||||
"replyMessage":[
|
||||
"Que te vaya bien!!"
|
||||
],
|
||||
},
|
||||
"productos":{
|
||||
"replyMessage":[
|
||||
"Más productos aquí"
|
||||
],
|
||||
"trigger":null,
|
||||
"actions":{
|
||||
"title":"¿Que te interesa ver?",
|
||||
"message":"Abajo unos botons",
|
||||
"footer":"",
|
||||
"buttons":[
|
||||
{"body":"Telefonos"},
|
||||
{"body":"Computadoras"},
|
||||
{"body":"Otros"}
|
||||
]
|
||||
}
|
||||
},
|
||||
"catalogo":{
|
||||
"replyMessage":[
|
||||
"Te envio una imagen"
|
||||
],
|
||||
"media":"https://media2.giphy.com/media/VQJu0IeULuAmCwf5SL/giphy.gif",
|
||||
"trigger":null,
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
#### Versión 2 (0.2.X)
|
||||
|
||||
En esta versión es mucho más sencillo, abajo encontraras un ejemplo del mismo flujo anteriormente mostrado.
|
||||
|
||||
```js
|
||||
//app.js
|
||||
const {
|
||||
createBot,
|
||||
createProvider,
|
||||
createFlow,
|
||||
addKeyword,
|
||||
addChild,
|
||||
} = require('@bot-whatsapp/bot')
|
||||
|
||||
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
|
||||
const MockAdapter = require('@bot-whatsapp/database/mock')
|
||||
/**
|
||||
* Declarando flujos principales.
|
||||
*/
|
||||
const flowHola = addKeyword(['hola', 'ola', 'alo'])
|
||||
.addAnswer('Bienvenido a tu tienda online!')
|
||||
|
||||
const flowAdios = addKeyword(['adios', 'bye'])
|
||||
.addAnswer('Que te vaya bien!!')
|
||||
.addAnswer('Hasta luego!')
|
||||
|
||||
const flowProductos = addKeyword(['productos', 'info'])
|
||||
.addAnswer('Te envio una imagen', {
|
||||
buttons:[
|
||||
{body:"Telefonos"},
|
||||
{body:"Computadoras"},
|
||||
{body:"Otros"}
|
||||
]
|
||||
})
|
||||
|
||||
const flowCatalogo = addKeyword(['imagen', 'foto'])
|
||||
.addAnswer('Te envio una imagen', {media:'https://media2.giphy.com/media/VQJu0IeULuAmCwf5SL/giphy.gif'})
|
||||
|
||||
|
||||
const main = async () => {
|
||||
const adapterDB = new MockAdapter()
|
||||
const adapterFlow = createFlow([flowHola, flowAdios, flowProductos, flowCatalogo])
|
||||
const adapterProvider = createProvider(BaileysProvider)
|
||||
createBot({
|
||||
flow: adapterFlow,
|
||||
provider: adapterProvider,
|
||||
database: adapterDB,
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
#### Flujos hijos
|
||||
|
||||
A continuación se muestra un ejemplo de flujos hijos, estos nos sirven para crear flujos que solo se disparan cuando el flujo anterior es el especificado, ejemplo:
|
||||
|
||||
> Menu Principal (Escoge zapatos o bolsos)
|
||||
> - SubMenu 1 (Elegiste bolsos, ahora escoge piel o tela)
|
||||
> - Submenu 1.1 (piel)
|
||||
> - Submenu 2 (Elegiste zapatos, ahora escoge piel o tela)
|
||||
> - Submenu 2.1 (piel)
|
||||
|
||||
El __submenu 1__ solo se va a disparar cuando el flujo anterior sea el __principal__, e igualmente el __submenu 1.1__, solo cuando el flujo anterior sea el __submenu 1__, ejemplo:
|
||||
|
||||
```js
|
||||
/**
|
||||
* Aqui declaramos los flujos hijos, los flujos se declaran de atras para adelante, es decir que si tienes un flujo de este tipo:
|
||||
*
|
||||
* Menu Principal
|
||||
* - SubMenu 1
|
||||
* - Submenu 1.1
|
||||
* - Submenu 2
|
||||
* - Submenu 2.1
|
||||
*
|
||||
* Primero declaras los submenus 1.1 y 2.1, luego el 1 y 2 y al final el principal.
|
||||
*/
|
||||
const flowBolsos2 = addKeyword(['bolsos2', '2'])
|
||||
.addAnswer('🤯 *MUCHOS* bolsos ...')
|
||||
.addAnswer('y mas bolsos... bla bla')
|
||||
|
||||
const flowZapatos2 = addKeyword(['zapatos2', '2'])
|
||||
.addAnswer('🤯 repito que tengo *MUCHOS* zapatos.')
|
||||
.addAnswer('y algunas otras cosas.')
|
||||
|
||||
const flowZapatos = addKeyword(['1', 'zapatos', 'ZAPATOS'])
|
||||
.addAnswer('🤯 Veo que elegiste zapatos')
|
||||
.addAnswer('Tengo muchos zapatos...bla bla')
|
||||
.addAnswer(
|
||||
['Manda:', '*(2) Zapatos2*', 'para mas información'],
|
||||
{ capture: true },
|
||||
(ctx) => {
|
||||
console.log('Aqui puedes ver más info del usuario...')
|
||||
console.log('Puedes enviar un mail, hook, etc..')
|
||||
console.log(ctx)
|
||||
},
|
||||
[...addChild(flowZapatos2)]
|
||||
)
|
||||
|
||||
const flowBolsos = addKeyword(['2', 'bolsos', 'BOLSOS'])
|
||||
.addAnswer('🙌 Veo que elegiste bolsos')
|
||||
.addAnswer('Tengo muchos bolsos...bla bla')
|
||||
.addAnswer(
|
||||
['Manda:', '*(2) Bolsos2*', 'para mas información.'],
|
||||
{ capture: true },
|
||||
(ctx) => {
|
||||
console.log('Aqui puedes ver más info del usuario...')
|
||||
console.log('Puedes enviar un mail, hook, etc..')
|
||||
console.log(ctx)
|
||||
},
|
||||
[...addChild(flowBolsos2)]
|
||||
)
|
||||
|
||||
/**
|
||||
* Declarando flujo principal
|
||||
*/
|
||||
|
||||
const flowPrincipal = addKeyword(['hola', 'ole', 'alo'])
|
||||
.addAnswer(['Hola, bienvenido a mi tienda', '¿Como puedo ayudarte?'])
|
||||
.addAnswer(['Tengo:', 'Zapatos', 'Bolsos', 'etc ...'])
|
||||
.addAnswer(
|
||||
['Para continuar escribe:', '*(1) Zapatos*', '*(2) Bolsos*'],
|
||||
{ capture: true },
|
||||
(ctx) => {
|
||||
console.log('Aqui puedes ver más info del usuario...')
|
||||
console.log('Puedes enviar un mail, hook, etc..')
|
||||
console.log(ctx)
|
||||
},
|
||||
[...addChild(flowBolsos), ...addChild(flowZapatos)]
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
> Forma parte de este proyecto.
|
||||
|
||||
- [Discord](https://link.codigoencasa.com/DISCORD)
|
||||
- [Twitter](https://twitter.com/leifermendez)
|
||||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
|
||||
- [Telegram](https://t.me/leifermendez)
|
||||
227
README.md
227
README.md
@@ -1,51 +1,176 @@
|
||||
# BOT Whatsapp Gratis
|
||||
|
||||
Hola amigos este BOT se realizo en vivo en mi canal de Youtube si quieres ver como se hizo __Subscribete__
|
||||
[https://www.youtube.com/leifermendez](https://www.youtube.com/leifermendez)
|
||||
|
||||
🤖 Link video https://www.youtube.com/watch?v=A_Xu0OR_HkE
|
||||
|
||||
#### Node
|
||||
> Debes de tener instalado NODE si no sabes como instalarlo te dejo un video en el cual explico como instalar node
|
||||
__https://www.youtube.com/watch?v=6741ceWzsKQ&list=PL_WGMLcL4jzVY1y-SutA3N_PCNCAG7Y46&index=2&t=50s Minuto 0:50__
|
||||
|
||||
## Instruciones
|
||||
__Descargar o Clonar repositorio__
|
||||

|
||||
|
||||
__Instalar paquetes (npm install)__
|
||||
> Ubicate en le directorio que descargaste y via consola o terminal ejecuta el siguiente comando
|
||||
|
||||
`npm install`
|
||||
|
||||

|
||||
|
||||
__Ejecutar el script app.js__
|
||||
> Ubicate en le directorio que descargaste y via consola o terminal ejecuta el siguiente comando `node app.js` .
|
||||
Escanea el el código QR desde tu aplicación de Whatsapp
|
||||
|
||||
`node app.js`
|
||||
|
||||

|
||||
|
||||
> Ahora abre la aplicación de Whatsapp en tu dispositivo y escanea el código QR
|
||||
<img src="https://i.imgur.com/RSbPtat.png" width="500" />
|
||||
|
||||
> Cuando sale este mensaje tu BOT está __listo__ para trabajar!
|
||||

|
||||
|
||||
## Como usarlo
|
||||
> Escribe un mensaje al whatsapp que vinculaste con tu BOT
|
||||
|
||||

|
||||
|
||||
> Ahora deberías obtener un arespuesta por parte del BOT como la siguiente, ademas de esto tambien se crea un archivo excel
|
||||
con el historial de conversación con el número de tu cliente
|
||||
|
||||

|
||||

|
||||
|
||||
## Preguntar al BOT
|
||||
> Puedes interactuar con el bot ejemplo escribele __Quieromeme__ y el bot debe responderte con la imagen
|
||||
|
||||

|
||||
# Chatbot Library
|
||||

|
||||
[](http://commitizen.github.io/cz-cli/)
|
||||
[](https://github.com/codigoencasa/bot-whatsapp/actions/workflows/releases.yml)
|
||||
|
||||
|
||||
<p align="center">
|
||||
<img width="300" src="https://i.imgur.com/Oauef6t.png">
|
||||
</p>
|
||||
|
||||
|
||||
**Con esta librería, puedes construir flujos automatizados de conversación de manera agnóstica al proveedor de WhatsApp,** configurar respuestas automatizadas para preguntas frecuentes, recibir y responder mensajes de manera automatizada, y hacer un seguimiento de las interacciones con los clientes. Además, puedes configurar fácilmente disparadores que te ayudaran a expandir las funcionalidades sin límites. **[Ver más informacion](https://bot-whatsapp.netlify.app/)**
|
||||
|
||||
## Comenzar
|
||||
|
||||
```
|
||||
npm create bot-whatsapp@latest
|
||||
```
|
||||
|
||||
Entiende más a fondo sus funcionalidades explicadas en nuestra documentación.
|
||||
|
||||
- Instalacion
|
||||
- Base de datos
|
||||
- Proveedores
|
||||
|
||||
## Recursos
|
||||
- [📄 Documentación](https://bot-whatsapp.netlify.app/)
|
||||
- [🚀 Roadmap](https://github.com/orgs/codigoencasa/projects/1)
|
||||
- [💻 Discord](https://link.codigoencasa.com/DISCORD)
|
||||
- [👌 Twitter](https://twitter.com/leifermendez)
|
||||
- [🎥 Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
|
||||
|
||||
## Comunidad
|
||||
<!-- readme: collaborators,contributors -start -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/cheveguerra">
|
||||
<img src="https://avatars.githubusercontent.com/u/5891114?v=4" width="50;" alt="cheveguerra"/>
|
||||
<br />
|
||||
<sub><b>Jose Alberto Guerra Ugalde</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/leifermendez">
|
||||
<img src="https://avatars.githubusercontent.com/u/15802366?v=4" width="50;" alt="leifermendez"/>
|
||||
<br />
|
||||
<sub><b>Leifer Mendez</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/leifermendezfroged">
|
||||
<img src="https://avatars.githubusercontent.com/u/97020486?v=4" width="50;" alt="leifermendezfroged"/>
|
||||
<br />
|
||||
<sub><b>Leifer Mendez</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/vicente1992">
|
||||
<img src="https://avatars.githubusercontent.com/u/57806030?v=4" width="50;" alt="vicente1992"/>
|
||||
<br />
|
||||
<sub><b>Manuel Vicente Ortiz</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/danielcasta0398">
|
||||
<img src="https://avatars.githubusercontent.com/u/98791147?v=4" width="50;" alt="danielcasta0398"/>
|
||||
<br />
|
||||
<sub><b>Juan Daniel Castaño</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/marianarolfo">
|
||||
<img src="https://avatars.githubusercontent.com/u/68322254?v=4" width="50;" alt="marianarolfo"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/HKong31">
|
||||
<img src="https://avatars.githubusercontent.com/u/113340082?v=4" width="50;" alt="HKong31"/>
|
||||
<br />
|
||||
<sub><b>HLKong</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jzvi12">
|
||||
<img src="https://avatars.githubusercontent.com/u/10729787?v=4" width="50;" alt="jzvi12"/>
|
||||
<br />
|
||||
<sub><b>Zvi</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/JosephVTX">
|
||||
<img src="https://avatars.githubusercontent.com/u/91026290?v=4" width="50;" alt="JosephVTX"/>
|
||||
<br />
|
||||
<sub><b>Joseph Vega Callupe</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Gonzalito87">
|
||||
<img src="https://avatars.githubusercontent.com/u/100331586?v=4" width="50;" alt="Gonzalito87"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/devrlbusiness">
|
||||
<img src="https://avatars.githubusercontent.com/u/66280283?v=4" width="50;" alt="devrlbusiness"/>
|
||||
<br />
|
||||
<sub><b>Developer RL Business</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Gregoriotecnico">
|
||||
<img src="https://avatars.githubusercontent.com/u/118696506?v=4" width="50;" alt="Gregoriotecnico"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/aurik3">
|
||||
<img src="https://avatars.githubusercontent.com/u/37228512?v=4" width="50;" alt="aurik3"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jlferrete">
|
||||
<img src="https://avatars.githubusercontent.com/u/36698913?v=4" width="50;" alt="jlferrete"/>
|
||||
<br />
|
||||
<sub><b>Jose Luis Ferrete Olarte</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/6rak0">
|
||||
<img src="https://avatars.githubusercontent.com/u/12260031?v=4" width="50;" alt="6rak0"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/tonyvazgar">
|
||||
<img src="https://avatars.githubusercontent.com/u/21047090?v=4" width="50;" alt="tonyvazgar"/>
|
||||
<br />
|
||||
<sub><b>Luis Antonio Vázquez García</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/lisandroprada">
|
||||
<img src="https://avatars.githubusercontent.com/u/7232326?v=4" width="50;" alt="lisandroprada"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/rrruuuyyy">
|
||||
<img src="https://avatars.githubusercontent.com/u/33061671?v=4" width="50;" alt="rrruuuyyy"/>
|
||||
<br />
|
||||
<sub><b>Rodrigo Mendoza Cabrera</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/yond1994">
|
||||
<img src="https://avatars.githubusercontent.com/u/47557263?v=4" width="50;" alt="yond1994"/>
|
||||
<br />
|
||||
<sub><b>Yonathan Suarez</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
</table>
|
||||
<!-- readme: collaborators,contributors -end -->
|
||||
|
||||
|
||||
|
||||
21
SECURITY.md
Normal file
21
SECURITY.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 5.1.x | :white_check_mark: |
|
||||
| 5.0.x | :x: |
|
||||
| 4.0.x | :white_check_mark: |
|
||||
| < 4.0 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Use this section to tell people how to report a vulnerability.
|
||||
|
||||
Tell them where to go, how often they can expect to get an update on a
|
||||
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||
declined, etc.
|
||||
51
TODO.md
Normal file
51
TODO.md
Normal file
@@ -0,0 +1,51 @@
|
||||
### Genral
|
||||
- [X] __(doc)__ Video de como colaborar PR
|
||||
- [ ] __(doc)__ Video implementación de test y cobertura
|
||||
- [ ] __(doc)__ Video explicacion de github action
|
||||
- [ ] Crear packages list externas
|
||||
|
||||
### @bot-whatsapp/bot
|
||||
- [X] agregar export package
|
||||
- [X] Posibilidad de en el capture meter todo un nuevo CTX de FLOW .addAnswer('Marca la opcion',{capture:true, join:CTX})
|
||||
- [X] .addKeyword('1') no funciona con 1 caracter
|
||||
- [X] sensitivy viene activado por defecto
|
||||
- [X] fallback respuesta en hijo: Se puede colocar en option el ref de la answer fallback
|
||||
- [X] Cuando Envian Sticket devuelve mensaje raro
|
||||
- [x] addAnswer agregar delay
|
||||
- [ ] colocar mensaje esperando conectando whatsapp (provider)
|
||||
- [ ] createDatabase validar implementacion de funciones
|
||||
- [ ] limitar caracteres de mensajes 4000
|
||||
- [X] cuando envias numeros (5 o 1) se dispara el flujo
|
||||
|
||||
### @bot-whatsapp/database
|
||||
- [X] agregar export package
|
||||
- [X] __(doc):__ Video para explicar como implementar nuevos database
|
||||
- [X] Mongo adapter
|
||||
- [X] MySQL adapter
|
||||
- [ ] JsonFile adapter
|
||||
|
||||
### @bot-whatsapp/provider
|
||||
- [X] agregar export package
|
||||
- [ ] __(doc):__ Video para explicar como implementar nuevos providers
|
||||
- [X] WhatsappWeb provider enviar imagenes
|
||||
- [X] WhatsappWeb provider enviar audio
|
||||
- [X] WhatsappWeb botones (Tiene truco) github:leifermendez/whatsapp-web.js
|
||||
- [ ] Twilio adapter
|
||||
- [ ] Meta adapter
|
||||
|
||||
### @bot-whatsapp/cli
|
||||
- [X] Hacer comando para crear `example-app`
|
||||
|
||||
|
||||
### @bot-whatsapp/create-bot
|
||||
- [ ]
|
||||
|
||||
### Starters
|
||||
- [X] Base
|
||||
- [X] Basico
|
||||
- [ ] Enviando Imagen
|
||||
- [ ] Enviando Botones
|
||||
- [ ] Mezclando flujos hijos
|
||||
|
||||
### Extra
|
||||
- [X] Crear CI mantener fork update https://stackoverflow.com/questions/23793062/can-forks-be-synced-automatically-in-github
|
||||
6
__mocks__/mobile.mock.js
Normal file
6
__mocks__/mobile.mock.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const MOCK_MOBILE_WS = {
|
||||
from: 'XXXXXX',
|
||||
hasMedia: false,
|
||||
}
|
||||
|
||||
module.exports = { MOCK_MOBILE_WS }
|
||||
21
__mocks__/mock.provider.js
Normal file
21
__mocks__/mock.provider.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const ProviderClass = require('../packages/bot/provider/provider.class')
|
||||
class MockProvider extends ProviderClass {
|
||||
constructor() {
|
||||
super()
|
||||
}
|
||||
|
||||
delaySendMessage = (miliseconds, eventName, payload) =>
|
||||
new Promise((res) =>
|
||||
setTimeout(() => {
|
||||
this.emit(eventName, payload)
|
||||
res
|
||||
}, miliseconds)
|
||||
)
|
||||
|
||||
sendMessage = async (userId, message) => {
|
||||
console.log(`Enviando... ${userId}, ${message}`)
|
||||
return Promise.resolve({ userId, message })
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MockProvider
|
||||
41
__test__/01-case.test.js
Normal file
41
__test__/01-case.test.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const MOCK_DB = require('../packages/database/src/mock')
|
||||
const PROVIDER_DB = require('../packages/provider/src/mock')
|
||||
const {
|
||||
addKeyword,
|
||||
createBot,
|
||||
createFlow,
|
||||
createProvider,
|
||||
} = require('../packages/bot')
|
||||
|
||||
test(`[Caso - 01] Flow Basico`, async () => {
|
||||
const [VALUE_A, VALUE_B] = ['hola', 'buenas']
|
||||
|
||||
const flow = addKeyword(VALUE_A).addAnswer(VALUE_B)
|
||||
const provider = createProvider(PROVIDER_DB)
|
||||
const database = new MOCK_DB()
|
||||
|
||||
createBot({
|
||||
database,
|
||||
flow: createFlow([flow]),
|
||||
provider,
|
||||
})
|
||||
|
||||
provider.delaySendMessage(100, 'message', {
|
||||
from: '000',
|
||||
body: VALUE_A,
|
||||
})
|
||||
|
||||
await delay(100)
|
||||
|
||||
const prevMsg = database.getPrevByNumber('000')
|
||||
|
||||
assert.is(prevMsg.answer, VALUE_B)
|
||||
})
|
||||
|
||||
test.run()
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise((res) => setTimeout(res, ms))
|
||||
}
|
||||
99
__test__/02-case.test.js
Normal file
99
__test__/02-case.test.js
Normal file
@@ -0,0 +1,99 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const MOCK_DB = require('../packages/database/src/mock')
|
||||
const PROVIDER_DB = require('../packages/provider/src/mock')
|
||||
const {
|
||||
addKeyword,
|
||||
createBot,
|
||||
createFlow,
|
||||
createProvider,
|
||||
} = require('../packages/bot/index')
|
||||
|
||||
/**
|
||||
* Falsear peticion async
|
||||
* @param {*} fakeData
|
||||
* @returns
|
||||
*/
|
||||
const fakeHTTP = async (fakeData = []) => {
|
||||
console.log('⚡ Server request!')
|
||||
await delay(50)
|
||||
console.log('⚡ Server return!')
|
||||
const data = fakeData.map((u, i) => ({ body: `${i + 1} ${u}` }))
|
||||
console.log(data)
|
||||
return Promise.resolve(data)
|
||||
}
|
||||
|
||||
test(`[Caso - 02] Flow (flowDynamic)`, async () => {
|
||||
const MOCK_VALUES = [
|
||||
'Bienvenido te envio muchas marcas (5510)',
|
||||
'Seleccione marca del auto a cotizar, con el *número* correspondiente',
|
||||
'Seleccione la sub marca del auto a cotizar, con el *número* correspondiente:',
|
||||
'Los precios rondan:',
|
||||
]
|
||||
const provider = createProvider(PROVIDER_DB)
|
||||
const database = new MOCK_DB()
|
||||
|
||||
const flujoPrincipal = addKeyword(['hola'])
|
||||
.addAnswer(MOCK_VALUES[0], null, async (ctx, { flowDynamic }) => {
|
||||
console.log('execute...')
|
||||
const data = await fakeHTTP(['Ford', 'GM', 'BMW'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
.addAnswer(MOCK_VALUES[1], null, async (ctx, { flowDynamic }) => {
|
||||
const data = await fakeHTTP(['Ranger', 'Explorer'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
.addAnswer(MOCK_VALUES[2], null, async (ctx, { flowDynamic }) => {
|
||||
const data = await fakeHTTP(['Usado', 'Nuevos'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
.addAnswer(MOCK_VALUES[3], null, async (ctx, { flowDynamic }) => {
|
||||
const data = await fakeHTTP(['1000', '2000', '3000'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
|
||||
createBot({
|
||||
database,
|
||||
flow: createFlow([flujoPrincipal]),
|
||||
provider,
|
||||
})
|
||||
|
||||
provider.delaySendMessage(0, 'message', {
|
||||
from: '000',
|
||||
body: 'hola',
|
||||
})
|
||||
|
||||
await delay(1200)
|
||||
const getHistory = database.listHistory.map((i) => i.answer)
|
||||
assert.is(MOCK_VALUES[0], getHistory[0])
|
||||
|
||||
//FlowDynamic
|
||||
assert.is('1 Ford', getHistory[1])
|
||||
assert.is('2 GM', getHistory[2])
|
||||
assert.is('3 BMW', getHistory[3])
|
||||
|
||||
assert.is(MOCK_VALUES[1], getHistory[4])
|
||||
|
||||
//FlowDynamic
|
||||
assert.is('1 Ranger', getHistory[5])
|
||||
assert.is('2 Explorer', getHistory[6])
|
||||
|
||||
assert.is(MOCK_VALUES[2], getHistory[7])
|
||||
|
||||
//FlowDynamic
|
||||
assert.is('1 Usado', getHistory[8])
|
||||
assert.is('2 Nuevos', getHistory[9])
|
||||
|
||||
assert.is(MOCK_VALUES[3], getHistory[10])
|
||||
|
||||
//FlowDynamic
|
||||
assert.is('1 1000', getHistory[11])
|
||||
assert.is('2 2000', getHistory[12])
|
||||
assert.is('3 3000', getHistory[13])
|
||||
})
|
||||
|
||||
test.run()
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise((res) => setTimeout(res, ms))
|
||||
}
|
||||
44
__test__/03-case.test.js
Normal file
44
__test__/03-case.test.js
Normal file
@@ -0,0 +1,44 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const MOCK_DB = require('../packages/database/src/mock')
|
||||
const PROVIDER_DB = require('../packages/provider/src/mock')
|
||||
const {
|
||||
addKeyword,
|
||||
createBot,
|
||||
createFlow,
|
||||
createProvider,
|
||||
} = require('../packages/bot/index')
|
||||
|
||||
test(`[Caso - 03] Flow puro`, async () => {
|
||||
const MOCK_VALUES = ['Bienvenido a mi tienda', 'Como estas?']
|
||||
|
||||
const provider = createProvider(PROVIDER_DB)
|
||||
const database = new MOCK_DB()
|
||||
|
||||
const flujoPrincipal = addKeyword(['hola'])
|
||||
.addAnswer(MOCK_VALUES[0])
|
||||
.addAnswer(MOCK_VALUES[1])
|
||||
|
||||
createBot({
|
||||
database,
|
||||
flow: createFlow([flujoPrincipal]),
|
||||
provider,
|
||||
})
|
||||
|
||||
provider.delaySendMessage(0, 'message', {
|
||||
from: '000',
|
||||
body: 'hola',
|
||||
})
|
||||
|
||||
await delay(10)
|
||||
const getHistory = database.listHistory.map((i) => i.answer)
|
||||
|
||||
assert.is(MOCK_VALUES[0], getHistory[0])
|
||||
assert.is(MOCK_VALUES[1], getHistory[1])
|
||||
})
|
||||
|
||||
test.run()
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise((res) => setTimeout(res, ms))
|
||||
}
|
||||
82
__test__/04-case.test.js
Normal file
82
__test__/04-case.test.js
Normal file
@@ -0,0 +1,82 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const MOCK_DB = require('../packages/database/src/mock')
|
||||
const PROVIDER_DB = require('../packages/provider/src/mock')
|
||||
const {
|
||||
addKeyword,
|
||||
createBot,
|
||||
createFlow,
|
||||
createProvider,
|
||||
} = require('../packages/bot/index')
|
||||
|
||||
/**
|
||||
* Falsear peticion async
|
||||
* @param {*} fakeData
|
||||
* @returns
|
||||
*/
|
||||
const fakeHTTP = async (fakeData = []) => {
|
||||
console.log('⚡ Server request!')
|
||||
await delay(50)
|
||||
console.log('⚡ Server return!')
|
||||
const data = fakeData.map((u, i) => ({ body: `${i + 1} ${u}` }))
|
||||
console.log(data)
|
||||
return Promise.resolve(data)
|
||||
}
|
||||
|
||||
test(`[Caso - 04] Romper flujo (endFlow)`, async () => {
|
||||
const MOCK_VALUES = [
|
||||
'Bienvenido te envio muchas marcas (5510)',
|
||||
'Seleccione marca del auto a cotizar, con el *número* correspondiente',
|
||||
'Seleccione la sub marca del auto a cotizar, con el *número* correspondiente:',
|
||||
'Los precios rondan:',
|
||||
]
|
||||
const provider = createProvider(PROVIDER_DB)
|
||||
const database = new MOCK_DB()
|
||||
|
||||
const flujoPrincipal = addKeyword(['hola'])
|
||||
.addAnswer(MOCK_VALUES[0], null, async (ctx, { flowDynamic }) => {
|
||||
console.log('execute...')
|
||||
const data = await fakeHTTP(['Ford', 'GM', 'BMW'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
.addAnswer(MOCK_VALUES[1], null, async (ctx, { endFlow }) => {
|
||||
return endFlow()
|
||||
})
|
||||
.addAnswer(MOCK_VALUES[2], null, async (ctx, { flowDynamic }) => {
|
||||
const data = await fakeHTTP(['Usado', 'Nuevos'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
.addAnswer(MOCK_VALUES[3], null, async (ctx, { flowDynamic }) => {
|
||||
const data = await fakeHTTP(['1000', '2000', '3000'])
|
||||
return flowDynamic(data)
|
||||
})
|
||||
|
||||
createBot({
|
||||
database,
|
||||
flow: createFlow([flujoPrincipal]),
|
||||
provider,
|
||||
})
|
||||
|
||||
provider.delaySendMessage(0, 'message', {
|
||||
from: '000',
|
||||
body: 'hola',
|
||||
})
|
||||
|
||||
await delay(1200)
|
||||
const getHistory = database.listHistory.map((i) => i.answer)
|
||||
assert.is(MOCK_VALUES[0], getHistory[0])
|
||||
|
||||
//FlowDynamic
|
||||
assert.is('1 Ford', getHistory[1])
|
||||
assert.is('2 GM', getHistory[2])
|
||||
assert.is('3 BMW', getHistory[3])
|
||||
|
||||
assert.is(MOCK_VALUES[1], getHistory[4])
|
||||
assert.is(undefined, getHistory[5])
|
||||
})
|
||||
|
||||
test.run()
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise((res) => setTimeout(res, ms))
|
||||
}
|
||||
307
app.js
307
app.js
@@ -1,307 +0,0 @@
|
||||
/**
|
||||
* ⚡⚡⚡ DECLARAMOS LAS LIBRERIAS y CONSTANTES A USAR! ⚡⚡⚡
|
||||
*/
|
||||
const fs = require('fs');
|
||||
const mimeDb = require('mime-db')
|
||||
const express = require('express');
|
||||
const moment = require('moment');
|
||||
const ora = require('ora');
|
||||
const chalk = require('chalk');
|
||||
const ExcelJS = require('exceljs');
|
||||
const qrcode = require('qrcode-terminal');
|
||||
const { flowConversation } = require('./conversation')
|
||||
const { Client, MessageMedia } = require('whatsapp-web.js');
|
||||
const app = express();
|
||||
app.use(express.urlencoded({ extended: true }))
|
||||
const SESSION_FILE_PATH = './session.json';
|
||||
let client;
|
||||
let sessionData;
|
||||
|
||||
/**
|
||||
* Guardamos archivos multimedia que nuestro cliente nos envie!
|
||||
* @param {*} media
|
||||
*/
|
||||
const saveMedia = (media) => {
|
||||
|
||||
const extensionProcess = mimeDb[media.mimetype]
|
||||
const ext = extensionProcess.extensions[0]
|
||||
fs.writeFile(`./media/${media.filename}.${ext}`, media.data, { encoding: 'base64' }, function (err) {
|
||||
console.log('** Archivo Media Guardado **');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Enviamos archivos multimedia a nuestro cliente
|
||||
* @param {*} number
|
||||
* @param {*} fileName
|
||||
*/
|
||||
const sendMedia = (number, fileName) => {
|
||||
number = number.replace('@c.us', '');
|
||||
number = `${number}@c.us`
|
||||
const media = MessageMedia.fromFilePath(`./mediaSend/${fileName}`);
|
||||
client.sendMessage(number, media);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enviamos un mensaje simple (texto) a nuestro cliente
|
||||
* @param {*} number
|
||||
*/
|
||||
const sendMessage = (number = null, text = null) => {
|
||||
number = number.replace('@c.us', '');
|
||||
number = `${number}@c.us`
|
||||
const message = text || `Hola soy un BOT recuerda https://www.youtube.com/leifermendez`;
|
||||
client.sendMessage(number, message);
|
||||
readChat(number, message)
|
||||
console.log(`${chalk.red('⚡⚡⚡ Enviando mensajes....')}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Escuchamos cuando entre un mensaje
|
||||
*/
|
||||
const listenMessage = () => {
|
||||
client.on('message', async msg => {
|
||||
const { from, to, body } = msg;
|
||||
//34691015468@c.us
|
||||
console.log(msg.hasMedia);
|
||||
if (msg.hasMedia) {
|
||||
const media = await msg.downloadMedia();
|
||||
saveMedia(media);
|
||||
// do something with the media data here
|
||||
}
|
||||
|
||||
await greetCustomer(from);
|
||||
|
||||
console.log(body);
|
||||
|
||||
await replyAsk(from, body);
|
||||
|
||||
// await readChat(from, body)
|
||||
// console.log(`${chalk.red('⚡⚡⚡ Enviando mensajes....')}`);
|
||||
// console.log('Guardar este número en tu Base de Datos:', from);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Response a pregunta
|
||||
*/
|
||||
|
||||
const replyAsk = (from, answer) => new Promise((resolve, reject) => {
|
||||
console.log(`---------->`, answer);
|
||||
if (answer === 'Quieromeme') {
|
||||
sendMedia(from, 'meme-1.png')
|
||||
resolve(true)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
/**
|
||||
* Revisamos si tenemos credenciales guardadas para inciar sessio
|
||||
* este paso evita volver a escanear el QRCODE
|
||||
*/
|
||||
const withSession = () => {
|
||||
// Si exsite cargamos el archivo con las credenciales
|
||||
const spinner = ora(`Cargando ${chalk.yellow('Validando session con Whatsapp...')}`);
|
||||
sessionData = require(SESSION_FILE_PATH);
|
||||
spinner.start();
|
||||
client = new Client({
|
||||
session: sessionData
|
||||
});
|
||||
|
||||
client.on('ready', () => {
|
||||
console.log('Client is ready!');
|
||||
spinner.stop();
|
||||
|
||||
// sendMessage();
|
||||
// sendMedia();
|
||||
|
||||
connectionReady();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
client.on('auth_failure', () => {
|
||||
spinner.stop();
|
||||
console.log('** Error de autentificacion vuelve a generar el QRCODE (Borrar el archivo session.json) **');
|
||||
})
|
||||
|
||||
|
||||
client.initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generamos un QRCODE para iniciar sesion
|
||||
*/
|
||||
const withOutSession = () => {
|
||||
console.log('No tenemos session guardada');
|
||||
client = new Client();
|
||||
client.on('qr', qr => {
|
||||
qrcode.generate(qr, { small: true });
|
||||
});
|
||||
|
||||
client.on('ready', () => {
|
||||
console.log('Client is ready!');
|
||||
connectionReady();
|
||||
});
|
||||
|
||||
client.on('auth_failure', () => {
|
||||
console.log('** Error de autentificacion vuelve a generar el QRCODE **');
|
||||
})
|
||||
|
||||
|
||||
client.on('authenticated', (session) => {
|
||||
// Guardamos credenciales de de session para usar luego
|
||||
sessionData = session;
|
||||
fs.writeFile(SESSION_FILE_PATH, JSON.stringify(session), function (err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
client.initialize();
|
||||
}
|
||||
|
||||
const connectionReady = () => {
|
||||
listenMessage();
|
||||
readExcel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Difundir mensaje a clientes
|
||||
*/
|
||||
const readExcel = async () => {
|
||||
const pathExcel = `./chats/clientes-saludar.xlsx`;
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
await workbook.xlsx.readFile(pathExcel);
|
||||
const worksheet = workbook.getWorksheet(1);
|
||||
const columnNumbers = worksheet.getColumn('A');
|
||||
columnNumbers.eachCell((cell, rowNumber) => {
|
||||
const numberCustomer = cell.value
|
||||
|
||||
const columnDate = worksheet.getRow(rowNumber);
|
||||
let prevDate = columnDate.getCell(2).value;
|
||||
prevDate = moment.unix(prevDate);
|
||||
const diffMinutes = moment().diff(prevDate, 'minutes');
|
||||
|
||||
// Si ha pasado mas de 60 minuitos podemos enviar nuevamente
|
||||
if (diffMinutes > 60) {
|
||||
sendMessage(numberCustomer)
|
||||
columnDate.getCell(2).value = moment().format('X')
|
||||
columnDate.commit();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
workbook.xlsx.writeFile(pathExcel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Guardar historial de conversacion
|
||||
* @param {*} number
|
||||
* @param {*} message
|
||||
*/
|
||||
const readChat = async (number, message) => {
|
||||
const pathExcel = `./chats/${number}.xlsx`;
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
const today = moment().format('DD-MM-YYYY hh:mm')
|
||||
|
||||
if (fs.existsSync(pathExcel)) {
|
||||
/**
|
||||
* Si existe el archivo de conversacion lo actualizamos
|
||||
*/
|
||||
const workbook = new ExcelJS.Workbook();
|
||||
workbook.xlsx.readFile(pathExcel)
|
||||
.then(() => {
|
||||
const worksheet = workbook.getWorksheet(1);
|
||||
const lastRow = worksheet.lastRow;
|
||||
var getRowInsert = worksheet.getRow(++(lastRow.number));
|
||||
getRowInsert.getCell('A').value = today;
|
||||
getRowInsert.getCell('B').value = message;
|
||||
getRowInsert.commit();
|
||||
workbook.xlsx.writeFile(pathExcel);
|
||||
});
|
||||
|
||||
} else {
|
||||
/**
|
||||
* NO existe el archivo de conversacion lo creamos
|
||||
*/
|
||||
const worksheet = workbook.addWorksheet('Chats');
|
||||
worksheet.columns = [
|
||||
{ header: 'Fecha', key: 'number_customer' },
|
||||
{ header: 'Mensajes', key: 'message' }
|
||||
];
|
||||
worksheet.addRow([today, message]);
|
||||
workbook.xlsx.writeFile(pathExcel)
|
||||
.then(() => {
|
||||
|
||||
console.log("saved");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("err", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saludos a primera respuesta
|
||||
* @param {*} req
|
||||
* @param {*} res
|
||||
*/
|
||||
|
||||
const greetCustomer = (from) => new Promise((resolve, reject) => {
|
||||
from = from.replace('@c.us', '');
|
||||
|
||||
const pathExcel = `./chats/${from}@c.us.xlsx`;
|
||||
if (!fs.existsSync(pathExcel)) {
|
||||
const firstMessage = [
|
||||
'👋 Ey! que pasa bro',
|
||||
'Recuerda subscribirte a mi canal de YT',
|
||||
'https://www.youtube.com/leifermendez',
|
||||
'de regalo te dejo algunos de mis cursos',
|
||||
'🔴 Aprende ANGULAR desde cero 2021 ⮕ https://bit.ly/367tJ32',
|
||||
'✅ Aprende NODE desde cero 2021 ⮕ https://bit.ly/3od1Bl6',
|
||||
'🔵 (Socket.io) NODE (Tutorial) ⮕ https://bit.ly/3pg1Q02',
|
||||
'------',
|
||||
'------',
|
||||
'Veo que es la primera vez que nos escribes ¿Quieres que te envie un MEME?',
|
||||
'Responde Quieromeme'
|
||||
].join(' ')
|
||||
|
||||
sendMessage(from, firstMessage)
|
||||
sendMedia(from, 'curso-1-1.png')
|
||||
sendMedia(from, 'curso-2.png')
|
||||
sendMedia(from, 'curso-3.png')
|
||||
}
|
||||
resolve(true)
|
||||
})
|
||||
|
||||
/**
|
||||
* Controladores
|
||||
*/
|
||||
|
||||
const sendMessagePost = (req, res) => {
|
||||
const { message, number } = req.body
|
||||
console.log(message, number);
|
||||
sendMessage(number, message)
|
||||
res.send({ status: 'Enviado!' })
|
||||
}
|
||||
|
||||
/**
|
||||
* Rutas
|
||||
*/
|
||||
|
||||
app.post('/send', sendMessagePost);
|
||||
|
||||
/**
|
||||
* Revisamos si existe archivo con credenciales!
|
||||
*/
|
||||
(fs.existsSync(SESSION_FILE_PATH)) ? withSession() : withOutSession();
|
||||
|
||||
|
||||
app.listen(9000, () => {
|
||||
console.log('Server ready!');
|
||||
})
|
||||
91
changelog.config.js
Normal file
91
changelog.config.js
Normal file
@@ -0,0 +1,91 @@
|
||||
module.exports = {
|
||||
disableEmoji: false,
|
||||
format: '{type}{scope}: {emoji}{subject}',
|
||||
list: [
|
||||
'test',
|
||||
'feat',
|
||||
'fix',
|
||||
'chore',
|
||||
'docs',
|
||||
'refactor',
|
||||
'style',
|
||||
'ci',
|
||||
'perf',
|
||||
],
|
||||
maxMessageLength: 64,
|
||||
minMessageLength: 3,
|
||||
questions: [
|
||||
'type',
|
||||
'scope',
|
||||
'subject',
|
||||
'body',
|
||||
'breaking',
|
||||
'issues',
|
||||
'lerna',
|
||||
],
|
||||
scopes: [],
|
||||
types: {
|
||||
chore: {
|
||||
description: 'Build process or auxiliary tool changes',
|
||||
emoji: '(🤖)',
|
||||
value: 'chore',
|
||||
},
|
||||
ci: {
|
||||
description: 'CI related changes',
|
||||
emoji: '(🎡)',
|
||||
value: 'ci',
|
||||
},
|
||||
docs: {
|
||||
description: 'Documentation only changes',
|
||||
emoji: '(✏️)',
|
||||
value: 'docs',
|
||||
},
|
||||
feat: {
|
||||
description: 'A new feature',
|
||||
emoji: '(🎸)',
|
||||
value: 'feat',
|
||||
},
|
||||
fix: {
|
||||
description: 'A bug fix',
|
||||
emoji: '(🐛)',
|
||||
value: 'fix',
|
||||
},
|
||||
perf: {
|
||||
description: 'A code change that improves performance',
|
||||
emoji: '(⚡️)',
|
||||
value: 'perf',
|
||||
},
|
||||
refactor: {
|
||||
description:
|
||||
'A code change that neither fixes a bug or adds a feature',
|
||||
emoji: '(💡)',
|
||||
value: 'refactor',
|
||||
},
|
||||
release: {
|
||||
description: 'Create a release commit',
|
||||
emoji: '(🏹)',
|
||||
value: 'release',
|
||||
},
|
||||
style: {
|
||||
description:
|
||||
'Markup, white-space, formatting, missing semi-colons...',
|
||||
emoji: '(💄)',
|
||||
value: 'style',
|
||||
},
|
||||
test: {
|
||||
description: 'Adding missing tests',
|
||||
emoji: '(💍)',
|
||||
value: 'test',
|
||||
},
|
||||
messages: {
|
||||
type: "Select the type of change that you're committing:",
|
||||
customScope: 'Select the scope this component affects:',
|
||||
subject:
|
||||
'Write a short, imperative mood description of the change:\n',
|
||||
body: 'Provide a longer description of the change:\n ',
|
||||
breaking: 'List any breaking changes:\n',
|
||||
footer: 'Issues this commit closes, e.g #123:',
|
||||
confirmCommit: 'The packages that this commit has affected\n',
|
||||
},
|
||||
},
|
||||
}
|
||||
Binary file not shown.
1
commitlint.config.js
Normal file
1
commitlint.config.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = { extends: ['@commitlint/config-conventional'] }
|
||||
8
config/banner.rollup.json
Normal file
8
config/banner.rollup.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"banner.output": [
|
||||
"/** \n",
|
||||
"* NO TOCAR ESTE ARCHIVO: Es generado automaticamente, si sabes lo que haces adelante ;)\n",
|
||||
"* de lo contrario mejor ir a la documentacion o al servidor de discord link.codigoencasa.com/DISCORD\n",
|
||||
"*/"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
const flowConversation = () => { }
|
||||
|
||||
module.exports = { flowConversation }
|
||||
25
docker-compose.yml
Normal file
25
docker-compose.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
mongo:
|
||||
image: mongo
|
||||
container_name: app_enviroment
|
||||
restart: always
|
||||
ports:
|
||||
- '27019:27017'
|
||||
environment:
|
||||
MONGO_INITDB_DATABASE: bot
|
||||
expose:
|
||||
- 27019
|
||||
mysql:
|
||||
image: mysql
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: example
|
||||
MYSQL_DATABASE: bot
|
||||
container_name: app_mysql
|
||||
ports:
|
||||
- '3306:3306'
|
||||
expose:
|
||||
- 3306
|
||||
BIN
media/undefined
BIN
media/undefined
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 322 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 307 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 278 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 447 KiB |
2257
package-lock.json
generated
2257
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
124
package.json
124
package.json
@@ -1,25 +1,103 @@
|
||||
{
|
||||
"name": "test-ws-bot",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.0",
|
||||
"excel4node": "^1.7.2",
|
||||
"exceljs": "^4.2.1",
|
||||
"express": "^4.17.1",
|
||||
"file-type": "^16.3.0",
|
||||
"mime-db": "^1.46.0",
|
||||
"moment": "^2.29.1",
|
||||
"ora": "^5.4.0",
|
||||
"qrcode-terminal": "^0.12.0",
|
||||
"whatsapp-web.js": "^1.12.5",
|
||||
"xlsx": "^0.16.9"
|
||||
}
|
||||
"name": "@bot-whatsapp/root",
|
||||
"version": "0.1.18",
|
||||
"description": "Bot de wahtsapp open source para MVP o pequeños negocios",
|
||||
"main": "app.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"commit": "git-cz",
|
||||
"cli:rollup": "rollup --config ./packages/cli/rollup-cli.config.js ",
|
||||
"create-bot:rollup": "rollup --config ./packages/create-bot-whatsapp/rollup-create.config.js ",
|
||||
"bot:rollup": "rollup --config ./packages/bot/rollup-bot.config.js",
|
||||
"provider:rollup": "rollup --config ./packages/provider/rollup-provider.config.js ",
|
||||
"contexts:rollup": "rollup --config ./packages/contexts/rollup-contexts.config.js",
|
||||
"database:rollup": "rollup --config ./packages/database/rollup-database.config.js",
|
||||
"create-bot-whatsapp:rollup": "rollup --config ./packages/create-bot-whatsapp/rollup-create.config.js",
|
||||
"portal:rollup": "rollup --config ./packages/portal/rollup-portal.config.js",
|
||||
"format:check": "prettier --check ./packages",
|
||||
"format:write": "prettier --write ./packages",
|
||||
"fmt.staged": "pretty-quick --staged",
|
||||
"lint:check": "eslint ./packages",
|
||||
"lint:fix": "eslint --fix ./packages",
|
||||
"build:portal-web": "cd ./packages/portal/ && yarn run build.types && yarn run build.client && yarn run build.server && yarn run lint --fix",
|
||||
"build:full": "yarn run build:portal-web && yarn run cli:rollup && yarn run bot:rollup && yarn run provider:rollup && yarn run database:rollup && yarn run contexts:rollup && yarn run create-bot-whatsapp:rollup && yarn run portal:rollup",
|
||||
"build": "yarn run cli:rollup && yarn run bot:rollup && yarn run provider:rollup && yarn run database:rollup && yarn run contexts:rollup && yarn run create-bot-whatsapp:rollup && yarn run portal:rollup",
|
||||
"copy.lib": "node ./scripts/move.js",
|
||||
"test.unit": "node ./node_modules/uvu/bin.js packages test",
|
||||
"test.e2e": "node ./node_modules/uvu/bin.js __test__",
|
||||
"test.coverage": "node ./node_modules/c8/bin/c8.js npm run test.unit && npm run test.e2e",
|
||||
"test": "npm run test.coverage",
|
||||
"cli": "node ./packages/cli/bin/cli.js",
|
||||
"create": "node ./packages/create-bot-whatsapp/bin/create.js",
|
||||
"dev:debug": "node --inspect ./example-app/app.js",
|
||||
"dev": "node ./example-app/app.js",
|
||||
"prepare": "npx husky install",
|
||||
"preinstall": "npx only-allow yarn",
|
||||
"postinstall": "npx prettier --write .",
|
||||
"release": "standard-version -- --prerelease --global"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/create-bot-whatsapp",
|
||||
"packages/bot",
|
||||
"packages/cli",
|
||||
"packages/database",
|
||||
"packages/provider",
|
||||
"packages/contexts",
|
||||
"packages/portal",
|
||||
"packages/docs"
|
||||
],
|
||||
"keywords": [
|
||||
"whatsapp",
|
||||
"bot-whatsapp",
|
||||
"node-bot-whatsapp"
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"email": "leifer33@gmail.com",
|
||||
"name": "Leifer Mendez",
|
||||
"url": "https://leifermendez.github.io"
|
||||
},
|
||||
{
|
||||
"name": "aurik3",
|
||||
"email": "aurik3@aurik3.com",
|
||||
"url": "https://github.com/aurik3"
|
||||
}
|
||||
],
|
||||
"repository": "https://github.com/leifermendez/bot-whatsapp",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^17.3.0",
|
||||
"@commitlint/config-conventional": "^17.3.0",
|
||||
"@octokit/core": "^4.1.0",
|
||||
"@rollup/plugin-commonjs": "^23.0.2",
|
||||
"@rollup/plugin-json": "^5.0.1",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.1",
|
||||
"c8": "^7.12.0",
|
||||
"conventional-changelog": "^3.1.25",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"fs-extra": "^11.1.0",
|
||||
"git-cz": "^4.9.0",
|
||||
"husky": "^8.0.2",
|
||||
"only-allow": "^1.1.1",
|
||||
"prettier": "^2.8.0",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"prompts": "^2.4.2",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^3.2.3",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-copy": "^3.4.0",
|
||||
"semver": "^7.3.8",
|
||||
"standard-version": "^9.5.0",
|
||||
"uvu": "^0.5.6"
|
||||
},
|
||||
"packageManager": "yarn@3.3.0",
|
||||
"engines": {
|
||||
"node": ">=16",
|
||||
"npm": "please-use-yarn",
|
||||
"yarn": ">=3"
|
||||
},
|
||||
"author": "Leifer Mendez <leifer33@gmail.com>"
|
||||
}
|
||||
|
||||
110
packages/bot/USES_CASES.md
Normal file
110
packages/bot/USES_CASES.md
Normal file
@@ -0,0 +1,110 @@
|
||||
# @bot-whatsapp/io
|
||||
|
||||
### Caso de uso
|
||||
|
||||
> Una persona escribe `hola`
|
||||
|
||||
**addKeyword** recibe `string | string[]`
|
||||
|
||||
> `sensitive` false _default_
|
||||
|
||||
- [x] addKeyword
|
||||
- [x] addAnswer
|
||||
- [x] addKeyword: Opciones
|
||||
- [x] addAnswer: Opciones, media, buttons
|
||||
- [x] Retornar JSON (options)
|
||||
- [ ] Recibir JSON
|
||||
|
||||
```js
|
||||
// bootstrap.js Como iniciar el provider
|
||||
const { inout, provider, database } = require('@bot-whatsapp')
|
||||
|
||||
/**
|
||||
* async whatsapp-web, twilio, meta
|
||||
* */
|
||||
|
||||
const bootstrap = async () => {
|
||||
console.log(`Iniciando....`)
|
||||
const client = await provider.start()
|
||||
/**
|
||||
* - QR
|
||||
* - Endpoint
|
||||
* - Check Token Meta, Twilio
|
||||
* - Return events? on message
|
||||
* */
|
||||
console.log(`Fin...`)
|
||||
// Esto es opcional ? no deberia ser necesario
|
||||
client.on('message', ({number, body,...}) => {
|
||||
// Incoming message
|
||||
})
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
```js
|
||||
// flow.js Como agregar keywords y respuestas
|
||||
const { inout, provider, database } = require('@bot-whatsapp')
|
||||
|
||||
await inout
|
||||
.addKeyword('hola')
|
||||
.addAnswer('Bienvenido a tu tienda 🥲')
|
||||
.addAnswer('escribe *catalogo* o *ofertas*')
|
||||
|
||||
await inout
|
||||
.addKeyword(['catalogo', 'ofertas'])
|
||||
.addAnswer('Este es nuestro CATALOGO mas reciente!', {
|
||||
buttons: [{ body: 'Xiaomi' }, { body: 'Samsung' }],
|
||||
})
|
||||
|
||||
await inout
|
||||
.addKeyword('Xiaomi')
|
||||
.addAnswer('Estos son nuestro productos XIAOMI ....', {
|
||||
media: 'https://....',
|
||||
})
|
||||
.addAnswer('Si quieres mas info escrbie *info*')
|
||||
|
||||
await inout
|
||||
.addKeyword('chao!')
|
||||
.addAnswer('bye!')
|
||||
.addAnswer('Recuerda que tengo esta promo', {
|
||||
media: 'https://media2.giphy.com/media/VQJu0IeULuAmCwf5SL/giphy.gif',
|
||||
})
|
||||
|
||||
await inout
|
||||
.addKeyword('Modelo C', { sensitive: false })
|
||||
.addAnswer('100USD', { media: 'http//:...' })
|
||||
|
||||
await inout
|
||||
.addKeyword('hola!', { sensitive: false })
|
||||
.addAnswer('Bievenido Escribe *productos*')
|
||||
|
||||
await inout
|
||||
.addKeyword('productos', { sensitive: false })
|
||||
.addAnswer('Esto son los mas vendidos')
|
||||
.addAnswer('*PC1* Precio 10USD', { media: 'https://....' })
|
||||
.addAnswer('*PC2* Precio 10USD', { media: 'https://....' })
|
||||
|
||||
await inout
|
||||
.addKeyword('PC1', { sensitive: false })
|
||||
.addAnswer('Bievenido Escribe *productos*')
|
||||
|
||||
const answerOne = await inout.addAnswer({
|
||||
message: 'Como estas!',
|
||||
media: 'https://media2.giphy.com/media/VQJu0IeULuAmCwf5SL/giphy.gif',
|
||||
})
|
||||
|
||||
const otherAnswer = await inout.addAnswer('Aprovecho para decirte!')
|
||||
|
||||
answerOne.push(otherAnswer)
|
||||
|
||||
inout.addKeywords(['hola', 'hi', 'ola'])
|
||||
```
|
||||
|
||||
**Comunidad**
|
||||
|
||||
> Forma parte de este proyecto.
|
||||
|
||||
- [Discord](https://link.codigoencasa.com/DISCORD)
|
||||
- [Twitter](https://twitter.com/leifermendez)
|
||||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
|
||||
- [Telegram](https://t.me/leifermendez)
|
||||
263
packages/bot/core/core.class.js
Normal file
263
packages/bot/core/core.class.js
Normal file
@@ -0,0 +1,263 @@
|
||||
const { toCtx } = require('../io/methods')
|
||||
const { printer } = require('../utils/interactive')
|
||||
const { delay } = require('../utils/delay')
|
||||
const Queue = require('../utils/queue')
|
||||
const { Console } = require('console')
|
||||
const { createWriteStream } = require('fs')
|
||||
|
||||
const logger = new Console({
|
||||
stdout: createWriteStream(`${process.cwd()}/core.class.log`),
|
||||
})
|
||||
|
||||
const QueuePrincipal = new Queue()
|
||||
|
||||
/**
|
||||
* [ ] Escuchar eventos del provider asegurarte que los provider emitan eventos
|
||||
* [ ] Guardar historial en db
|
||||
* [ ] Buscar mensaje en flow
|
||||
*
|
||||
*/
|
||||
class CoreClass {
|
||||
flowClass
|
||||
databaseClass
|
||||
providerClass
|
||||
generalArgs = { blackList: [] }
|
||||
constructor(_flow, _database, _provider, _args) {
|
||||
this.flowClass = _flow
|
||||
this.databaseClass = _database
|
||||
this.providerClass = _provider
|
||||
this.generalArgs = { ...this.generalArgs, ..._args }
|
||||
|
||||
for (const { event, func } of this.listenerBusEvents()) {
|
||||
this.providerClass.on(event, func)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manejador de eventos
|
||||
*/
|
||||
listenerBusEvents = () => [
|
||||
{
|
||||
event: 'preinit',
|
||||
func: () => printer('Iniciando proveedor, espere...'),
|
||||
},
|
||||
{
|
||||
event: 'require_action',
|
||||
func: ({ instructions, title = '⚡⚡ ACCIÓN REQUERIDA ⚡⚡' }) =>
|
||||
printer(instructions, title),
|
||||
},
|
||||
{
|
||||
event: 'ready',
|
||||
func: () => printer('Proveedor conectado y listo'),
|
||||
},
|
||||
{
|
||||
event: 'auth_failure',
|
||||
func: ({ instructions }) =>
|
||||
printer(instructions, '⚡⚡ ERROR AUTH ⚡⚡'),
|
||||
},
|
||||
|
||||
{
|
||||
event: 'message',
|
||||
func: (msg) => this.handleMsg(msg),
|
||||
},
|
||||
]
|
||||
|
||||
/**
|
||||
* GLOSSARY.md
|
||||
* @param {*} messageCtxInComming
|
||||
* @returns
|
||||
*/
|
||||
handleMsg = async (messageCtxInComming) => {
|
||||
logger.log(`[handleMsg]: `, messageCtxInComming)
|
||||
const { body, from } = messageCtxInComming
|
||||
let msgToSend = []
|
||||
let fallBackFlag = false
|
||||
let endFlowFlag = false
|
||||
if (this.generalArgs.blackList.includes(from)) return
|
||||
if (!body) return
|
||||
if (!body.length) return
|
||||
|
||||
let prevMsg = await this.databaseClass.getPrevByNumber(from)
|
||||
const refToContinue = this.flowClass.findBySerialize(
|
||||
prevMsg?.refSerialize
|
||||
)
|
||||
|
||||
if (prevMsg?.ref) {
|
||||
const ctxByNumber = toCtx({
|
||||
body,
|
||||
from,
|
||||
prevRef: prevMsg.refSerialize,
|
||||
})
|
||||
this.databaseClass.save(ctxByNumber)
|
||||
}
|
||||
|
||||
// 📄 Limpiar cola de procesos
|
||||
const clearQueue = () => {
|
||||
QueuePrincipal.pendingPromise = false
|
||||
QueuePrincipal.queue = []
|
||||
}
|
||||
|
||||
// 📄 Finalizar flujo
|
||||
const endFlow = async () => {
|
||||
prevMsg = null
|
||||
endFlowFlag = true
|
||||
clearQueue()
|
||||
return
|
||||
}
|
||||
|
||||
// 📄 Esta funcion se encarga de enviar un array de mensajes dentro de este ctx
|
||||
const sendFlow = async (messageToSend, numberOrId) => {
|
||||
// [1 Paso] esto esta bien!
|
||||
|
||||
if (prevMsg?.options?.capture) await cbEveryCtx(prevMsg?.ref)
|
||||
const queue = []
|
||||
for (const ctxMessage of messageToSend) {
|
||||
if (endFlowFlag) return
|
||||
const delayMs = ctxMessage?.options?.delay || 0
|
||||
if (delayMs) await delay(delayMs)
|
||||
QueuePrincipal.enqueue(() =>
|
||||
Promise.all([
|
||||
this.sendProviderAndSave(numberOrId, ctxMessage).then(
|
||||
() => resolveCbEveryCtx(ctxMessage)
|
||||
),
|
||||
])
|
||||
)
|
||||
}
|
||||
return Promise.all(queue)
|
||||
}
|
||||
|
||||
// 📄 [options: fallBack]: esta funcion se encarga de repetir el ultimo mensaje
|
||||
const fallBack = async () => {
|
||||
fallBackFlag = true
|
||||
await this.sendProviderAndSave(from, refToContinue)
|
||||
QueuePrincipal.queue = []
|
||||
return refToContinue
|
||||
}
|
||||
|
||||
// 📄 [options: flowDynamic]: esta funcion se encarga de responder un array de respuesta esta limitado a 5 mensajes
|
||||
// para evitar bloque de whatsapp
|
||||
|
||||
const flowDynamic = async (
|
||||
listMsg = [],
|
||||
optListMsg = { limit: 5, fallback: false }
|
||||
) => {
|
||||
if (!Array.isArray(listMsg))
|
||||
throw new Error('Esto debe ser un ARRAY')
|
||||
|
||||
fallBackFlag = optListMsg.fallback
|
||||
const parseListMsg = listMsg
|
||||
.map((opt, index) => {
|
||||
const body = typeof opt === 'string' ? opt : opt.body
|
||||
const media = opt?.media ?? null
|
||||
const buttons = opt?.buttons ?? []
|
||||
|
||||
return toCtx({
|
||||
body,
|
||||
from,
|
||||
keyword: null,
|
||||
index,
|
||||
options: { media, buttons },
|
||||
})
|
||||
})
|
||||
.slice(0, optListMsg.limit)
|
||||
|
||||
if (endFlowFlag) return
|
||||
for (const msg of parseListMsg) {
|
||||
await this.sendProviderAndSave(from, msg)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 📄 Se encarga de revisar si el contexto del mensaje tiene callback o fallback
|
||||
const resolveCbEveryCtx = async (ctxMessage) => {
|
||||
if (!ctxMessage?.options?.capture)
|
||||
return await cbEveryCtx(ctxMessage?.ref)
|
||||
}
|
||||
|
||||
// 📄 Se encarga de revisar si el contexto del mensaje tiene callback y ejecutarlo
|
||||
const cbEveryCtx = async (inRef) => {
|
||||
if (!this.flowClass.allCallbacks[inRef]) return Promise.resolve()
|
||||
return this.flowClass.allCallbacks[inRef](messageCtxInComming, {
|
||||
fallBack,
|
||||
flowDynamic,
|
||||
endFlow,
|
||||
})
|
||||
}
|
||||
|
||||
// 📄🤘(tiene return) [options: nested(array)]: Si se tiene flujos hijos los implementa
|
||||
if (!fallBackFlag && prevMsg?.options?.nested?.length) {
|
||||
const nestedRef = prevMsg.options.nested
|
||||
const flowStandalone = nestedRef.map((f) => ({
|
||||
...nestedRef.find((r) => r.refSerialize === f.refSerialize),
|
||||
}))
|
||||
|
||||
msgToSend = this.flowClass.find(body, false, flowStandalone) || []
|
||||
|
||||
sendFlow(msgToSend, from)
|
||||
return
|
||||
}
|
||||
|
||||
// 📄🤘(tiene return) [options: capture (boolean)]: Si se tiene option boolean
|
||||
if (!fallBackFlag && !prevMsg?.options?.nested?.length) {
|
||||
const typeCapture = typeof prevMsg?.options?.capture
|
||||
const valueCapture = prevMsg?.options?.capture
|
||||
|
||||
if (['string', 'boolean'].includes(typeCapture) && valueCapture) {
|
||||
msgToSend = this.flowClass.find(refToContinue?.ref, true) || []
|
||||
sendFlow(msgToSend, from)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
msgToSend = this.flowClass.find(body) || []
|
||||
sendFlow(msgToSend, from)
|
||||
}
|
||||
|
||||
/**
|
||||
* Enviar mensaje con contexto atraves del proveedor de whatsapp
|
||||
* @param {*} numberOrId
|
||||
* @param {*} ctxMessage ver más en GLOSSARY.md
|
||||
* @returns
|
||||
*/
|
||||
sendProviderAndSave = (numberOrId, ctxMessage) => {
|
||||
const { answer } = ctxMessage
|
||||
return Promise.all([
|
||||
this.providerClass.sendMessage(numberOrId, answer, ctxMessage),
|
||||
this.databaseClass.save({ ...ctxMessage, from: numberOrId }),
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {*} message
|
||||
* @param {*} ref
|
||||
*/
|
||||
continue = (message, ref = false) => {
|
||||
const responde = this.flowClass.find(message, ref)
|
||||
if (responde) {
|
||||
this.providerClass.sendMessage(responde.answer)
|
||||
this.databaseClass.saveLog(responde.answer)
|
||||
this.continue(null, responde.ref)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Funcion dedicada a enviar el mensaje sin pasar por el flow
|
||||
* (dialogflow)
|
||||
* @param {*} messageToSend
|
||||
* @param {*} numberOrId
|
||||
* @returns
|
||||
*/
|
||||
sendFlowSimple = async (messageToSend, numberOrId) => {
|
||||
const queue = []
|
||||
for (const ctxMessage of messageToSend) {
|
||||
const delayMs = ctxMessage?.options?.delay || 0
|
||||
if (delayMs) await delay(delayMs)
|
||||
QueuePrincipal.enqueue(() =>
|
||||
this.sendProviderAndSave(numberOrId, ctxMessage)
|
||||
)
|
||||
}
|
||||
return Promise.all(queue)
|
||||
}
|
||||
}
|
||||
module.exports = CoreClass
|
||||
47
packages/bot/index.js
Normal file
47
packages/bot/index.js
Normal file
@@ -0,0 +1,47 @@
|
||||
const CoreClass = require('./core/core.class')
|
||||
const ProviderClass = require('./provider/provider.class')
|
||||
const FlowClass = require('./io/flow.class')
|
||||
const { addKeyword, addAnswer, addChild, toSerialize } = require('./io/methods')
|
||||
|
||||
/**
|
||||
* Crear instancia de clase Bot
|
||||
* @param {*} args
|
||||
* @returns
|
||||
*/
|
||||
const createBot = async ({ flow, database, provider }, args = {}) =>
|
||||
new CoreClass(flow, database, provider, args)
|
||||
|
||||
/**
|
||||
* Crear instancia de clase Io (Flow)
|
||||
* @param {*} args
|
||||
* @returns
|
||||
*/
|
||||
const createFlow = (args) => {
|
||||
return new FlowClass(args)
|
||||
}
|
||||
|
||||
/**
|
||||
* Crear instancia de clase Provider
|
||||
* Depdendiendo del Provider puedes pasar argumentos
|
||||
* Ver Documentacion
|
||||
* @param {*} args
|
||||
* @returns
|
||||
*/
|
||||
const createProvider = (providerClass = class {}, args = null) => {
|
||||
const providerInstance = new providerClass(args)
|
||||
if (!providerClass.prototype instanceof ProviderClass)
|
||||
throw new Error('El provider no implementa ProviderClass')
|
||||
return providerInstance
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createBot,
|
||||
createFlow,
|
||||
createProvider,
|
||||
addKeyword,
|
||||
addAnswer,
|
||||
addChild,
|
||||
toSerialize,
|
||||
ProviderClass,
|
||||
CoreClass,
|
||||
}
|
||||
65
packages/bot/io/flow.class.js
Normal file
65
packages/bot/io/flow.class.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const { toSerialize } = require('./methods/toSerialize')
|
||||
const { flatObject } = require('../utils/flattener')
|
||||
|
||||
class FlowClass {
|
||||
allCallbacks = []
|
||||
flowSerialize = []
|
||||
flowRaw = []
|
||||
constructor(_flow) {
|
||||
if (!Array.isArray(_flow)) throw new Error('Esto debe ser un ARRAY')
|
||||
this.flowRaw = _flow
|
||||
|
||||
this.allCallbacks = flatObject(_flow)
|
||||
|
||||
const mergeToJsonSerialize = Object.keys(_flow)
|
||||
.map((indexObjectFlow) => _flow[indexObjectFlow].toJson())
|
||||
.flat(2)
|
||||
|
||||
this.flowSerialize = toSerialize(mergeToJsonSerialize)
|
||||
}
|
||||
|
||||
find = (keyOrWord, symbol = false, overFlow = null) => {
|
||||
keyOrWord = `${keyOrWord}`
|
||||
let capture = false
|
||||
let messages = []
|
||||
let refSymbol = null
|
||||
overFlow = overFlow ?? this.flowSerialize
|
||||
|
||||
/** Retornar expresion regular para buscar coincidencia */
|
||||
const mapSensitive = (str, flag = false) => {
|
||||
const regexSensitive = flag ? 'g' : 'i'
|
||||
if (Array.isArray(str)) {
|
||||
return new RegExp(str.join('|'), regexSensitive)
|
||||
}
|
||||
return new RegExp(str, regexSensitive)
|
||||
}
|
||||
|
||||
const findIn = (keyOrWord, symbol = false, flow = overFlow) => {
|
||||
const sensitive = refSymbol?.options?.sensitive || false
|
||||
capture = refSymbol?.options?.capture || false
|
||||
|
||||
if (capture) return messages
|
||||
|
||||
if (symbol) {
|
||||
refSymbol = flow.find((c) => c.keyword === keyOrWord)
|
||||
if (refSymbol?.answer) messages.push(refSymbol)
|
||||
if (refSymbol?.ref) findIn(refSymbol.ref, true)
|
||||
} else {
|
||||
refSymbol = flow.find((c) => {
|
||||
return mapSensitive(c.keyword, sensitive).test(keyOrWord)
|
||||
})
|
||||
if (refSymbol?.ref) findIn(refSymbol.ref, true)
|
||||
return messages
|
||||
}
|
||||
}
|
||||
findIn(keyOrWord, symbol)
|
||||
return messages
|
||||
}
|
||||
|
||||
findBySerialize = (refSerialize) =>
|
||||
this.flowSerialize.find((r) => r.refSerialize === refSerialize)
|
||||
|
||||
findIndexByRef = (ref) => this.flowSerialize.findIndex((r) => r.ref === ref)
|
||||
}
|
||||
|
||||
module.exports = FlowClass
|
||||
111
packages/bot/io/methods/addAnswer.js
Normal file
111
packages/bot/io/methods/addAnswer.js
Normal file
@@ -0,0 +1,111 @@
|
||||
const { flatObject } = require('../../utils/flattener')
|
||||
const { generateRef } = require('../../utils/hash')
|
||||
const { addChild } = require('./addChild')
|
||||
const { toJson } = require('./toJson')
|
||||
/**
|
||||
*
|
||||
* @param answer string
|
||||
* @param options {media:string, buttons:[{"body":"😎 Cursos"}], delay:ms, capture:true default false}
|
||||
* @returns
|
||||
*/
|
||||
const addAnswer =
|
||||
(inCtx) =>
|
||||
(answer, options, cb = null, nested = []) => {
|
||||
answer = Array.isArray(answer) ? answer.join('\n') : answer
|
||||
/**
|
||||
* Todas las opciones referentes a el mensaje en concreto options:{}
|
||||
* @returns
|
||||
*/
|
||||
const getAnswerOptions = () => ({
|
||||
media:
|
||||
typeof options?.media === 'string' ? `${options?.media}` : null,
|
||||
buttons: Array.isArray(options?.buttons) ? options.buttons : [],
|
||||
capture:
|
||||
typeof options?.capture === 'boolean'
|
||||
? options?.capture
|
||||
: false,
|
||||
child:
|
||||
typeof options?.child === 'string' ? `${options?.child}` : null,
|
||||
delay: typeof options?.delay === 'number' ? options?.delay : 0,
|
||||
})
|
||||
|
||||
const getNested = () => {
|
||||
let flatNested = []
|
||||
if (Array.isArray(nested)) {
|
||||
for (const iterator of nested) {
|
||||
flatNested = [...flatNested, ...addChild(iterator)]
|
||||
}
|
||||
|
||||
return {
|
||||
nested: flatNested,
|
||||
}
|
||||
}
|
||||
return {
|
||||
nested: addChild(nested),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Esta funcion aplana y busca los callback anidados de los hijos
|
||||
* @returns
|
||||
*/
|
||||
const getCbFromNested = () =>
|
||||
flatObject(Array.isArray(nested) ? nested : [nested])
|
||||
|
||||
const callback = typeof cb === 'function' ? cb : () => null
|
||||
|
||||
const lastCtx = inCtx.hasOwnProperty('ctx') ? inCtx.ctx : inCtx
|
||||
|
||||
/**
|
||||
* Esta funcion se encarga de mapear y transformar todo antes
|
||||
* de retornar
|
||||
* @returns
|
||||
*/
|
||||
const ctxAnswer = () => {
|
||||
const ref = `ans_${generateRef()}`
|
||||
|
||||
const options = {
|
||||
...getAnswerOptions(),
|
||||
...getNested(),
|
||||
keyword: {},
|
||||
callback: !!cb,
|
||||
}
|
||||
|
||||
const json = [].concat(inCtx.json).concat([
|
||||
{
|
||||
ref,
|
||||
keyword: lastCtx.ref,
|
||||
answer,
|
||||
options,
|
||||
},
|
||||
])
|
||||
|
||||
getCbFromNested()
|
||||
const callbacks = {
|
||||
...inCtx.callbacks,
|
||||
...getCbFromNested(),
|
||||
[ref]: callback,
|
||||
}
|
||||
|
||||
return {
|
||||
...lastCtx,
|
||||
ref,
|
||||
answer,
|
||||
json,
|
||||
options,
|
||||
callbacks,
|
||||
}
|
||||
}
|
||||
|
||||
/// Retornar contexto no colocar nada más abajo de esto
|
||||
const ctx = ctxAnswer()
|
||||
|
||||
return {
|
||||
ctx,
|
||||
ref: ctx.ref,
|
||||
addAnswer: addAnswer(ctx),
|
||||
toJson: toJson(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { addAnswer }
|
||||
15
packages/bot/io/methods/addChild.js
Normal file
15
packages/bot/io/methods/addChild.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const { toSerialize } = require('./toSerialize')
|
||||
/**
|
||||
* @deprecate
|
||||
* @param answer string
|
||||
* @param options {media:string, buttons:[], capture:true default false}
|
||||
* @returns
|
||||
*/
|
||||
const addChild = (flowIn = null) => {
|
||||
if (!flowIn?.toJson) {
|
||||
throw new Error('DEBE SER UN FLOW CON toJSON()')
|
||||
}
|
||||
return toSerialize(flowIn.toJson())
|
||||
}
|
||||
|
||||
module.exports = { addChild }
|
||||
49
packages/bot/io/methods/addKeyword.js
Normal file
49
packages/bot/io/methods/addKeyword.js
Normal file
@@ -0,0 +1,49 @@
|
||||
const { generateRef } = require('../../utils/hash')
|
||||
const { addAnswer } = require('./addAnswer')
|
||||
const { toJson } = require('./toJson')
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} message `string | string[]`
|
||||
* @param {*} options {sensitive:boolean} default false
|
||||
*/
|
||||
const addKeyword = (keyword, options) => {
|
||||
const parseOptions = () => {
|
||||
const defaultProperties = {
|
||||
sensitive:
|
||||
typeof options?.sensitive === 'boolean'
|
||||
? options?.sensitive
|
||||
: false,
|
||||
}
|
||||
|
||||
return defaultProperties
|
||||
}
|
||||
|
||||
const ctxAddKeyword = () => {
|
||||
const ref = `key_${generateRef()}`
|
||||
const options = parseOptions()
|
||||
const json = [
|
||||
{
|
||||
ref,
|
||||
keyword,
|
||||
options,
|
||||
},
|
||||
]
|
||||
/**
|
||||
* Se guarda en db
|
||||
*/
|
||||
|
||||
return { ref, keyword, options, json }
|
||||
}
|
||||
|
||||
const ctx = ctxAddKeyword()
|
||||
|
||||
return {
|
||||
ctx,
|
||||
ref: ctx.ref,
|
||||
addAnswer: addAnswer(ctx),
|
||||
toJson: toJson(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { addKeyword }
|
||||
8
packages/bot/io/methods/index.js
Normal file
8
packages/bot/io/methods/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const { addAnswer } = require('./addAnswer')
|
||||
const { addKeyword } = require('./addKeyword')
|
||||
const { addChild } = require('./addChild')
|
||||
const { toSerialize } = require('./toSerialize')
|
||||
const { toCtx } = require('./toCtx')
|
||||
const { toJson } = require('./toJson')
|
||||
|
||||
module.exports = { addAnswer, addKeyword, addChild, toCtx, toJson, toSerialize }
|
||||
19
packages/bot/io/methods/toCtx.js
Normal file
19
packages/bot/io/methods/toCtx.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { generateRef, generateRefSerialize } = require('../../utils/hash')
|
||||
/**
|
||||
* @deprecate
|
||||
* @param answer string
|
||||
* @param options {media:string, buttons:[], capture:true default false}
|
||||
* @returns
|
||||
*/
|
||||
const toCtx = ({ body, from, prevRef, options = {}, index }) => {
|
||||
return {
|
||||
ref: generateRef(),
|
||||
keyword: prevRef,
|
||||
answer: body,
|
||||
options: options ?? {},
|
||||
from,
|
||||
refSerialize: generateRefSerialize({ index, answer: body }),
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { toCtx }
|
||||
6
packages/bot/io/methods/toJson.js
Normal file
6
packages/bot/io/methods/toJson.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const toJson = (inCtx) => () => {
|
||||
const lastCtx = inCtx.hasOwnProperty('ctx') ? inCtx.ctx : inCtx
|
||||
return lastCtx.json
|
||||
}
|
||||
|
||||
module.exports = { toJson }
|
||||
23
packages/bot/io/methods/toSerialize.js
Normal file
23
packages/bot/io/methods/toSerialize.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { generateRefSerialize } = require('../../utils/hash')
|
||||
|
||||
/**
|
||||
* Crear referencia serializada
|
||||
* @param {*} flowJson
|
||||
* @returns array[]
|
||||
*/
|
||||
const toSerialize = (flowJson) => {
|
||||
if (!Array.isArray(flowJson)) throw new Error('Esto debe ser un ARRAY')
|
||||
|
||||
const jsonToSerialize = flowJson.map((row, index) => ({
|
||||
...row,
|
||||
refSerialize: `${generateRefSerialize({
|
||||
index,
|
||||
keyword: row.keyword,
|
||||
answer: row.answer,
|
||||
})}`,
|
||||
}))
|
||||
|
||||
return jsonToSerialize
|
||||
}
|
||||
|
||||
module.exports = { toSerialize }
|
||||
14
packages/bot/io/rollup-cli.config.js
Normal file
14
packages/bot/io/rollup-cli.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const commonjs = require('@rollup/plugin-commonjs')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
const { join } = require('path')
|
||||
|
||||
const PATH = join(__dirname, 'lib', 'io', 'bundle.io.cjs')
|
||||
|
||||
module.exports = {
|
||||
input: 'index.js',
|
||||
output: {
|
||||
file: PATH,
|
||||
format: 'cjs',
|
||||
},
|
||||
plugins: [commonjs(), nodeResolve()],
|
||||
}
|
||||
36
packages/bot/package.json
Normal file
36
packages/bot/package.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "@bot-whatsapp/bot",
|
||||
"version": "0.0.73-alpha.0",
|
||||
"description": "",
|
||||
"main": "./lib/bundle.bot.cjs",
|
||||
"scripts": {
|
||||
"bot:rollup": "node ../../node_modules/.bin/rollup index.js --config ./rollup-cli.config.js",
|
||||
"format:check": "prettier --check .",
|
||||
"format:write": "prettier --write .",
|
||||
"lint:check": "eslint .",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"test.unit": "cross-env NODE_ENV=test node ../../node_modules/uvu/bin.js tests"
|
||||
},
|
||||
"keywords": [],
|
||||
"files": [
|
||||
"./lib/bundle.bot.cjs",
|
||||
"./provider/*",
|
||||
"./core/*",
|
||||
"./io/*"
|
||||
],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@bot-whatsapp/cli": "*",
|
||||
"@bot-whatsapp/database": "*",
|
||||
"@bot-whatsapp/provider": "*",
|
||||
"kleur": "^4.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^16.0.3"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codigoencasa/bot-whatsapp/tree/main/packages/bot"
|
||||
}
|
||||
}
|
||||
29
packages/bot/provider/provider.class.js
Normal file
29
packages/bot/provider/provider.class.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const { EventEmitter } = require('node:events')
|
||||
/**
|
||||
* Esta clase debe siempre proporcionar los siguietes metodos
|
||||
* sendMessage = Para enviar un mensaje
|
||||
*
|
||||
* @important
|
||||
* Esta clase extiende de la clase del provider OJO
|
||||
* Eventos
|
||||
* - message
|
||||
* - ready
|
||||
* - error
|
||||
* - require_action
|
||||
*/
|
||||
|
||||
const NODE_ENV = process.env.NODE_ENV || 'dev'
|
||||
class ProviderClass extends EventEmitter {
|
||||
/**
|
||||
* events: message | auth | auth_error | ...
|
||||
*
|
||||
*/
|
||||
|
||||
sendMessage = async (userId, message) => {
|
||||
if (NODE_ENV !== 'production')
|
||||
console.log('[sendMessage]', { userId, message })
|
||||
return message
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ProviderClass
|
||||
26
packages/bot/rollup-bot.config.js
Normal file
26
packages/bot/rollup-bot.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const banner = require('../../config/banner.rollup.json')
|
||||
const commonjs = require('@rollup/plugin-commonjs')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
const { join } = require('path')
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
input: join(__dirname, 'index.js'),
|
||||
output: {
|
||||
banner: banner['banner.output'].join(''),
|
||||
file: join(__dirname, 'lib', 'bundle.bot.cjs'),
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
},
|
||||
plugins: [commonjs(), nodeResolve()],
|
||||
},
|
||||
{
|
||||
input: join(__dirname, 'index.js'),
|
||||
output: {
|
||||
banner: banner['banner.output'].join(''),
|
||||
file: join(__dirname, 'lib', 'bundle.bot.cjs'),
|
||||
format: 'cjs',
|
||||
},
|
||||
plugins: [commonjs(), nodeResolve()],
|
||||
},
|
||||
]
|
||||
279
packages/bot/tests/bot.class.test.js
Normal file
279
packages/bot/tests/bot.class.test.js
Normal file
@@ -0,0 +1,279 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const FlowClass = require('../io/flow.class')
|
||||
const MockProvider = require('../../../__mocks__/mock.provider')
|
||||
const {
|
||||
createBot,
|
||||
CoreClass,
|
||||
createFlow,
|
||||
createProvider,
|
||||
ProviderClass,
|
||||
} = require('../index')
|
||||
|
||||
class MockFlow {
|
||||
allCallbacks = { ref: () => 1 }
|
||||
flowSerialize = []
|
||||
flowRaw = []
|
||||
find = (arg) => {
|
||||
if (arg) {
|
||||
return [{ answer: 'answer', ref: 'ref' }]
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
findBySerialize = () => ({})
|
||||
findIndexByRef = () => 0
|
||||
}
|
||||
|
||||
class MockDBA {
|
||||
listHistory = []
|
||||
save = () => {}
|
||||
getPrevByNumber = () => {}
|
||||
}
|
||||
|
||||
class MockDBB {
|
||||
listHistory = []
|
||||
save = () => {}
|
||||
getPrevByNumber = () => ({
|
||||
refSerialize: 'xxxxx',
|
||||
ref: 'xxxx',
|
||||
options: { callback: true },
|
||||
})
|
||||
}
|
||||
|
||||
class MockDBC {
|
||||
listHistory = []
|
||||
save = () => {}
|
||||
getPrevByNumber = () => ({
|
||||
refSerialize: 'xxxxx',
|
||||
ref: 'xxxx',
|
||||
options: { callback: true, nested: ['1', '2'] },
|
||||
})
|
||||
saveLog = () => {}
|
||||
}
|
||||
|
||||
test(`[CoreClass] Probando instanciamiento de clase`, async () => {
|
||||
const setting = {
|
||||
flow: new MockFlow(),
|
||||
database: new MockDBA(),
|
||||
provider: new MockProvider(),
|
||||
}
|
||||
const bot = await createBot(setting)
|
||||
assert.is(bot instanceof CoreClass, true)
|
||||
})
|
||||
|
||||
test(`[CoreClass createFlow] Probando instanciamiento de clase`, async () => {
|
||||
const mockCreateFlow = createFlow([])
|
||||
assert.is(mockCreateFlow instanceof FlowClass, true)
|
||||
})
|
||||
|
||||
test(`[CoreClass createProvider] Probando instanciamiento de clase`, async () => {
|
||||
const mockCreateProvider = createProvider(MockProvider)
|
||||
assert.is(mockCreateProvider instanceof ProviderClass, true)
|
||||
})
|
||||
|
||||
test(`[Bot] Eventos 'require_action,ready,auth_failure,message '`, async () => {
|
||||
let responseEvents = {}
|
||||
|
||||
const MOCK_EVENTS = {
|
||||
require_action: {
|
||||
instructions: 'Debes...',
|
||||
},
|
||||
ready: true,
|
||||
auth_failure: {
|
||||
instructions: 'Error...',
|
||||
},
|
||||
message: {
|
||||
from: 'XXXXXX',
|
||||
body: 'hola',
|
||||
hasMedia: false,
|
||||
},
|
||||
}
|
||||
|
||||
const mockProvider = new MockProvider()
|
||||
|
||||
const setting = {
|
||||
flow: new MockFlow(),
|
||||
database: new MockDBA(),
|
||||
provider: mockProvider,
|
||||
}
|
||||
await createBot(setting)
|
||||
|
||||
/// Escuchamos eventos
|
||||
mockProvider.on(
|
||||
'require_action',
|
||||
(r) => (responseEvents['require_action'] = r)
|
||||
)
|
||||
mockProvider.on('ready', (r) => (responseEvents['ready'] = r))
|
||||
mockProvider.on('auth_failure', (r) => (responseEvents['auth_failure'] = r))
|
||||
mockProvider.on('message', (r) => (responseEvents['message'] = r))
|
||||
|
||||
/// Emitimos eventos
|
||||
mockProvider.delaySendMessage(
|
||||
0,
|
||||
'require_action',
|
||||
MOCK_EVENTS.require_action
|
||||
)
|
||||
mockProvider.delaySendMessage(0, 'ready', MOCK_EVENTS.ready)
|
||||
mockProvider.delaySendMessage(0, 'auth_failure', MOCK_EVENTS.auth_failure)
|
||||
mockProvider.delaySendMessage(0, 'message', MOCK_EVENTS.message)
|
||||
|
||||
await delay(0)
|
||||
|
||||
/// Testeamos eventos
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.require_action),
|
||||
JSON.stringify(MOCK_EVENTS.require_action)
|
||||
)
|
||||
assert.is(responseEvents.ready, MOCK_EVENTS.ready)
|
||||
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.auth_failure),
|
||||
JSON.stringify(MOCK_EVENTS.auth_failure)
|
||||
)
|
||||
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.message),
|
||||
JSON.stringify(MOCK_EVENTS.message)
|
||||
)
|
||||
})
|
||||
|
||||
test(`[Bot] Probando Flujos Internos`, async () => {
|
||||
let responseEvents = {}
|
||||
|
||||
const MOCK_EVENTS = {
|
||||
require_action: {
|
||||
instructions: 'Debes...',
|
||||
},
|
||||
ready: true,
|
||||
auth_failure: {
|
||||
instructions: 'Error...',
|
||||
},
|
||||
message: {
|
||||
from: 'XXXXXX',
|
||||
body: 'hola',
|
||||
hasMedia: false,
|
||||
},
|
||||
}
|
||||
|
||||
const mockProvider = new MockProvider()
|
||||
|
||||
const setting = {
|
||||
flow: new MockFlow(),
|
||||
database: new MockDBB(),
|
||||
provider: mockProvider,
|
||||
}
|
||||
await createBot(setting)
|
||||
|
||||
/// Escuchamos eventos
|
||||
mockProvider.on(
|
||||
'require_action',
|
||||
(r) => (responseEvents['require_action'] = r)
|
||||
)
|
||||
mockProvider.on('ready', (r) => (responseEvents['ready'] = r))
|
||||
mockProvider.on('auth_failure', (r) => (responseEvents['auth_failure'] = r))
|
||||
mockProvider.on('message', (r) => (responseEvents['message'] = r))
|
||||
|
||||
/// Emitimos eventos
|
||||
mockProvider.delaySendMessage(
|
||||
0,
|
||||
'require_action',
|
||||
MOCK_EVENTS.require_action
|
||||
)
|
||||
mockProvider.delaySendMessage(0, 'ready', MOCK_EVENTS.ready)
|
||||
mockProvider.delaySendMessage(0, 'auth_failure', MOCK_EVENTS.auth_failure)
|
||||
mockProvider.delaySendMessage(0, 'message', MOCK_EVENTS.message)
|
||||
|
||||
await delay(0)
|
||||
|
||||
/// Testeamos eventos
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.require_action),
|
||||
JSON.stringify(MOCK_EVENTS.require_action)
|
||||
)
|
||||
assert.is(responseEvents.ready, MOCK_EVENTS.ready)
|
||||
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.auth_failure),
|
||||
JSON.stringify(MOCK_EVENTS.auth_failure)
|
||||
)
|
||||
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.message),
|
||||
JSON.stringify(MOCK_EVENTS.message)
|
||||
)
|
||||
})
|
||||
|
||||
test(`[Bot] Probando Flujos Nested`, async () => {
|
||||
let responseEvents = {}
|
||||
|
||||
const MOCK_EVENTS = {
|
||||
require_action: {
|
||||
instructions: 'Debes...',
|
||||
},
|
||||
ready: true,
|
||||
auth_failure: {
|
||||
instructions: 'Error...',
|
||||
},
|
||||
message: {
|
||||
from: 'XXXXXX',
|
||||
body: 'hola',
|
||||
hasMedia: false,
|
||||
},
|
||||
}
|
||||
|
||||
const mockProvider = new MockProvider()
|
||||
|
||||
const setting = {
|
||||
flow: new MockFlow(),
|
||||
database: new MockDBC(),
|
||||
provider: mockProvider,
|
||||
}
|
||||
const botInstance = await createBot(setting)
|
||||
|
||||
botInstance.sendProviderAndSave('xxxxx', 'xxxxx')
|
||||
botInstance.continue('xxxxx', 'xxxxx')
|
||||
/// Escuchamos eventos
|
||||
mockProvider.on(
|
||||
'require_action',
|
||||
(r) => (responseEvents['require_action'] = r)
|
||||
)
|
||||
mockProvider.on('ready', (r) => (responseEvents['ready'] = r))
|
||||
mockProvider.on('auth_failure', (r) => (responseEvents['auth_failure'] = r))
|
||||
mockProvider.on('message', (r) => (responseEvents['message'] = r))
|
||||
|
||||
/// Emitimos eventos
|
||||
mockProvider.delaySendMessage(
|
||||
0,
|
||||
'require_action',
|
||||
MOCK_EVENTS.require_action
|
||||
)
|
||||
mockProvider.delaySendMessage(0, 'ready', MOCK_EVENTS.ready)
|
||||
mockProvider.delaySendMessage(0, 'auth_failure', MOCK_EVENTS.auth_failure)
|
||||
mockProvider.delaySendMessage(0, 'message', MOCK_EVENTS.message)
|
||||
|
||||
await delay(0)
|
||||
|
||||
/// Testeamos eventos
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.require_action),
|
||||
JSON.stringify(MOCK_EVENTS.require_action)
|
||||
)
|
||||
assert.is(responseEvents.ready, MOCK_EVENTS.ready)
|
||||
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.auth_failure),
|
||||
JSON.stringify(MOCK_EVENTS.auth_failure)
|
||||
)
|
||||
|
||||
assert.is(
|
||||
JSON.stringify(responseEvents.message),
|
||||
JSON.stringify(MOCK_EVENTS.message)
|
||||
)
|
||||
})
|
||||
|
||||
test.run()
|
||||
|
||||
function delay(ms) {
|
||||
return new Promise((res) => setTimeout(res, ms))
|
||||
}
|
||||
28
packages/bot/tests/flow.class.test.js
Normal file
28
packages/bot/tests/flow.class.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const FlowClass = require('../io/flow.class')
|
||||
const { addKeyword } = require('../index')
|
||||
|
||||
test(`[FlowClass] Probando instanciamiento de clase`, async () => {
|
||||
const MOCK_FLOW = addKeyword('hola').addAnswer('Buenas!')
|
||||
const flowClass = new FlowClass([MOCK_FLOW])
|
||||
assert.is(flowClass instanceof FlowClass, true)
|
||||
})
|
||||
|
||||
test(`[FlowClass] Probando find`, async () => {
|
||||
const MOCK_FLOW = addKeyword('hola').addAnswer('Buenas!')
|
||||
const flowClass = new FlowClass([MOCK_FLOW])
|
||||
|
||||
flowClass.find('hola')
|
||||
assert.is(flowClass instanceof FlowClass, true)
|
||||
})
|
||||
|
||||
test(`[FlowClass] Probando findBySerialize`, async () => {
|
||||
const MOCK_FLOW = addKeyword('hola').addAnswer('Buenas!')
|
||||
const flowClass = new FlowClass([MOCK_FLOW])
|
||||
|
||||
flowClass.findBySerialize('')
|
||||
assert.is(flowClass instanceof FlowClass, true)
|
||||
})
|
||||
|
||||
test.run()
|
||||
161
packages/bot/tests/methods.test.js
Normal file
161
packages/bot/tests/methods.test.js
Normal file
@@ -0,0 +1,161 @@
|
||||
const { test } = require('uvu')
|
||||
const assert = require('uvu/assert')
|
||||
const { generateRefSerialize } = require('../utils/hash')
|
||||
const { addKeyword, addAnswer, toSerialize } = require('../io/methods')
|
||||
|
||||
test('Debere probar las propeidades', () => {
|
||||
const ARRANGE = {
|
||||
keyword: 'hola!',
|
||||
}
|
||||
const MAIN_CTX = addKeyword(ARRANGE.keyword)
|
||||
|
||||
assert.type(MAIN_CTX.addAnswer, 'function')
|
||||
assert.is(MAIN_CTX.ctx.keyword, ARRANGE.keyword)
|
||||
})
|
||||
|
||||
test('Debere probar las propeidades array', () => {
|
||||
const ARRANGE = {
|
||||
keyword: ['hola!', 'ole'],
|
||||
}
|
||||
const MAIN_CTX = addKeyword(ARRANGE.keyword)
|
||||
|
||||
assert.is(MAIN_CTX.ctx.keyword, ARRANGE.keyword)
|
||||
})
|
||||
|
||||
test('Debere probar las propeidades array en answer', () => {
|
||||
const ARRANGE = {
|
||||
keyword: ['hola!', 'ole'],
|
||||
}
|
||||
const MAIN_CTX = addKeyword(ARRANGE.keyword).addAnswer(['hola', 'chao'])
|
||||
|
||||
assert.is(MAIN_CTX.ctx.keyword, ARRANGE.keyword)
|
||||
})
|
||||
|
||||
test('Debere probar toSerialize', () => {
|
||||
const ARRANGE = {
|
||||
keyword: ['hola!', 'ole'],
|
||||
}
|
||||
const MAIN_CTX = addKeyword(ARRANGE.keyword)
|
||||
.addAnswer('Segundo!')
|
||||
.addAnswer('Segundo!')
|
||||
.toJson()
|
||||
|
||||
const [ANSWER_A] = MAIN_CTX
|
||||
|
||||
assert.is(
|
||||
toSerialize(MAIN_CTX)[0].refSerialize,
|
||||
generateRefSerialize({
|
||||
index: 0,
|
||||
answer: ANSWER_A.answer,
|
||||
keyword: ANSWER_A.keyword,
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
test('Debere probar el paso de contexto', () => {
|
||||
const ARRANGE = {
|
||||
keyword: 'hola!',
|
||||
answer: 'Bienvenido',
|
||||
}
|
||||
const CTX_A = addKeyword(ARRANGE.keyword)
|
||||
const CTX_B = addAnswer(CTX_A)(ARRANGE.answer)
|
||||
|
||||
assert.is(CTX_A.ctx.keyword, ARRANGE.keyword)
|
||||
assert.is(CTX_B.ctx.keyword, ARRANGE.keyword)
|
||||
assert.is(CTX_B.ctx.answer, ARRANGE.answer)
|
||||
})
|
||||
|
||||
test('Debere probar la anidación', () => {
|
||||
const ARRANGE = {
|
||||
keyword: 'hola!',
|
||||
answer_A: 'Bienvenido',
|
||||
answer_B: 'Continuar',
|
||||
}
|
||||
const MAIN_CTX = addKeyword(ARRANGE.keyword)
|
||||
.addAnswer(ARRANGE.answer_A)
|
||||
.addAnswer(ARRANGE.answer_B)
|
||||
|
||||
assert.is(MAIN_CTX.ctx.answer, ARRANGE.answer_B)
|
||||
})
|
||||
|
||||
test('Debere probar las poptions', () => {
|
||||
const MAIN_CTX = addKeyword('etc', { sensitive: false })
|
||||
|
||||
assert.is(MAIN_CTX.ctx.options.sensitive, false)
|
||||
})
|
||||
|
||||
test('Debere probar las addAnswer', () => {
|
||||
const MOCK_OPT = {
|
||||
media: 'http://image.mock/mock.png',
|
||||
buttons: [1],
|
||||
}
|
||||
const MAIN_CTX = addKeyword('hola').addAnswer('etc', MOCK_OPT)
|
||||
|
||||
assert.is(MAIN_CTX.ctx.options.media, MOCK_OPT.media)
|
||||
assert.is(MAIN_CTX.ctx.options.buttons.length, 1)
|
||||
})
|
||||
|
||||
test('Debere probar error las addAnswer', () => {
|
||||
const MOCK_OPT = {
|
||||
media: { a: 1, b: [] },
|
||||
buttons: 'test',
|
||||
}
|
||||
const MAIN_CTX = addKeyword('hola').addAnswer('etc', MOCK_OPT)
|
||||
|
||||
assert.is(MAIN_CTX.ctx.options.media, null)
|
||||
assert.is(MAIN_CTX.ctx.options.buttons.length, 0)
|
||||
})
|
||||
|
||||
test('Obtener toJson', () => {
|
||||
const [ctxA, ctxB, ctxC] = addKeyword('hola')
|
||||
.addAnswer('pera!')
|
||||
.addAnswer('chao')
|
||||
.toJson()
|
||||
|
||||
assert.is(ctxA.keyword, 'hola')
|
||||
assert.match(ctxA.ref, /^key_/)
|
||||
|
||||
assert.is(ctxB.answer, 'pera!')
|
||||
assert.match(ctxB.ref, /^ans_/)
|
||||
|
||||
assert.is(ctxC.answer, 'chao')
|
||||
assert.match(ctxC.ref, /^ans_/)
|
||||
})
|
||||
|
||||
test('addKeyword toJson con sensitive', () => {
|
||||
const [ctxA] = addKeyword('hola').toJson()
|
||||
assert.is(ctxA.options.sensitive, false)
|
||||
const [ctxB] = addKeyword('hola', { sensitive: true }).toJson()
|
||||
assert.is(ctxB.options.sensitive, true)
|
||||
})
|
||||
|
||||
test('addAnswer toJson con IMG', () => {
|
||||
const [, ctxB, ctxC] = addKeyword('hola')
|
||||
.addAnswer('bye!', {
|
||||
media: 'http://mock.img/file-a.png',
|
||||
})
|
||||
.addAnswer('otro!', {
|
||||
media: 'http://mock.img/file-b.png',
|
||||
})
|
||||
.toJson()
|
||||
|
||||
assert.is(ctxB.options.media, 'http://mock.img/file-a.png')
|
||||
assert.is(ctxC.options.media, 'http://mock.img/file-b.png')
|
||||
})
|
||||
|
||||
test('addAnswer toJson con BUTTONS', () => {
|
||||
const [, ctxB] = addKeyword('hola')
|
||||
.addAnswer('mis opciones!', {
|
||||
buttons: [{ body: 'BTN_1' }, { body: 'BTN_2' }],
|
||||
})
|
||||
.toJson()
|
||||
|
||||
assert.is(ctxB.options.buttons.length, 2)
|
||||
|
||||
const [btnA, btnB] = ctxB.options.buttons
|
||||
|
||||
assert.is(btnA.body, 'BTN_1')
|
||||
assert.is(btnB.body, 'BTN_2')
|
||||
})
|
||||
|
||||
test.run()
|
||||
4
packages/bot/utils/delay.js
Normal file
4
packages/bot/utils/delay.js
Normal file
@@ -0,0 +1,4 @@
|
||||
const delay = (miliseconds) =>
|
||||
new Promise((res) => setTimeout(res, miliseconds))
|
||||
|
||||
module.exports = { delay }
|
||||
25
packages/bot/utils/flattener.js
Normal file
25
packages/bot/utils/flattener.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const flatObject = (listArray = []) => {
|
||||
const cbNestedList = Array.isArray(listArray) ? listArray : []
|
||||
|
||||
if (!listArray.length) return {}
|
||||
|
||||
const cbNestedObj = cbNestedList
|
||||
.map(({ ctx }) => ctx?.callbacks)
|
||||
.filter((i) => !!i)
|
||||
const queueCb = cbNestedObj.reduce((acc, current) => {
|
||||
const getKeys = Object.keys(current)
|
||||
const parse = getKeys.map((icb, i) => ({
|
||||
[icb]: Object.values(current)[i],
|
||||
}))
|
||||
return [...acc, ...parse]
|
||||
}, [])
|
||||
|
||||
const flatObj = {}
|
||||
for (const iteration of queueCb) {
|
||||
const [keyCb] = Object.keys(iteration)
|
||||
flatObj[keyCb] = iteration[keyCb]
|
||||
}
|
||||
return flatObj
|
||||
}
|
||||
|
||||
module.exports = { flatObject }
|
||||
24
packages/bot/utils/hash.js
Normal file
24
packages/bot/utils/hash.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const crypto = require('crypto')
|
||||
|
||||
/**
|
||||
* Generamos un UUID unico con posibilidad de tener un prefijo
|
||||
* @param {*} prefix
|
||||
* @returns
|
||||
*/
|
||||
const generateRef = (prefix = false) => {
|
||||
const id = crypto.randomUUID()
|
||||
return prefix ? `${prefix}_${id}` : id
|
||||
}
|
||||
|
||||
/**
|
||||
* Genera un HASH MD5
|
||||
* @param {*} param0
|
||||
* @returns
|
||||
*/
|
||||
const generateRefSerialize = ({ index, answer, keyword }) =>
|
||||
crypto
|
||||
.createHash('md5')
|
||||
.update(JSON.stringify({ index, answer, keyword }))
|
||||
.digest('hex')
|
||||
|
||||
module.exports = { generateRef, generateRefSerialize }
|
||||
14
packages/bot/utils/interactive.js
Normal file
14
packages/bot/utils/interactive.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const { yellow, bgRed } = require('kleur')
|
||||
const NODE_ENV = process.env.NODE_ENV || 'dev'
|
||||
const printer = (message, title) => {
|
||||
if (NODE_ENV !== 'test') {
|
||||
// console.clear()
|
||||
if (title) console.log(bgRed(`${title}`))
|
||||
console.log(
|
||||
yellow(Array.isArray(message) ? message.join('\n') : message)
|
||||
)
|
||||
console.log(``)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { printer }
|
||||
46
packages/bot/utils/queue.js
Normal file
46
packages/bot/utils/queue.js
Normal file
@@ -0,0 +1,46 @@
|
||||
class Queue {
|
||||
queue = []
|
||||
pendingPromise = false
|
||||
|
||||
enqueue(promise) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.queue.push({
|
||||
promise,
|
||||
resolve,
|
||||
reject,
|
||||
})
|
||||
this.dequeue()
|
||||
})
|
||||
}
|
||||
|
||||
dequeue() {
|
||||
if (this.workingOnPromise) {
|
||||
return false
|
||||
}
|
||||
const item = this.queue.shift()
|
||||
if (!item) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
this.workingOnPromise = true
|
||||
item.promise()
|
||||
.then((value) => {
|
||||
this.workingOnPromise = false
|
||||
item.resolve(value)
|
||||
this.dequeue()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.workingOnPromise = false
|
||||
item.reject(err)
|
||||
this.dequeue()
|
||||
})
|
||||
} catch (err) {
|
||||
this.workingOnPromise = false
|
||||
item.reject(err)
|
||||
this.dequeue()
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Queue
|
||||
20
packages/cli/README.md
Normal file
20
packages/cli/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# @bot-whatsapp/cli
|
||||
|
||||
- [x] Revisar version de NODE
|
||||
- [x] Revisar OS
|
||||
- [x] Obtener Package Manager
|
||||
- [x] Revisar las libreria de WhatsappWeb para obtener version reciente
|
||||
- [x] Opcion interactiva de limpiar session
|
||||
- [x] Opcion de generar `json` con la configuracion
|
||||
- [x] Agregar `rollup` para limpiar el codigo
|
||||
|
||||
---
|
||||
|
||||
**Comunidad**
|
||||
|
||||
> Forma parte de este proyecto.
|
||||
|
||||
- [Discord](https://link.codigoencasa.com/DISCORD)
|
||||
- [Twitter](https://twitter.com/leifermendez)
|
||||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
|
||||
- [Telegram](https://t.me/leifermendez)
|
||||
3
packages/cli/bin/cli.js
Executable file
3
packages/cli/bin/cli.js
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env node
|
||||
const index = require('../lib/cli/bundle.cli.cjs')
|
||||
index.startInteractive()
|
||||
65
packages/cli/check/index.js
Normal file
65
packages/cli/check/index.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const { red, yellow, green, bgCyan } = require('kleur')
|
||||
const { exec } = require('node:child_process')
|
||||
|
||||
const checkNodeVersion = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(bgCyan('🚀 Revisando tu Node.js'))
|
||||
const version = process.version
|
||||
const majorVersion = parseInt(
|
||||
version.replace('v', '').split('.').shift()
|
||||
)
|
||||
if (majorVersion < 16) {
|
||||
console.error(
|
||||
red(
|
||||
`🔴 Se require Node.js 16 o superior. Actualmente esta ejecutando Node.js ${version}`
|
||||
)
|
||||
)
|
||||
console.log(``)
|
||||
reject('ERROR_NODE')
|
||||
}
|
||||
console.log(green(`Node.js: ${version} compatible ✅`))
|
||||
console.log(``)
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
||||
const checkOs = () => {
|
||||
return new Promise((resolve) => {
|
||||
console.log(bgCyan('🙂 Revisando tu sistema operativo'))
|
||||
const os = process.platform
|
||||
if (!os.includes('win32')) {
|
||||
const messages = [
|
||||
`El sistema operativo actual (${os}) posiblemente requiera`,
|
||||
`una configuración adicional referente al puppeteer`,
|
||||
``,
|
||||
`Recuerda pasar por el WIKI`,
|
||||
`🔗 https://github.com/leifermendez/bot-whatsapp/wiki/Instalación`,
|
||||
``,
|
||||
]
|
||||
|
||||
console.log(yellow(messages.join(' \n')))
|
||||
}
|
||||
console.log(green(`OS: compatible ✅`))
|
||||
console.log(``)
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
|
||||
const checkGit = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(bgCyan('🤓 Revisando GIT'))
|
||||
exec('git --version', (error) => {
|
||||
if (error) {
|
||||
console.error(red(`🔴 Se require instalar GIT`))
|
||||
console.log(``)
|
||||
reject('ERROR_GIT')
|
||||
} else {
|
||||
console.log(green(`Git: Compatible ✅`))
|
||||
console.log(``)
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { checkNodeVersion, checkOs, checkGit }
|
||||
19
packages/cli/clean/index.js
Normal file
19
packages/cli/clean/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const rimraf = require('rimraf')
|
||||
const { yellow } = require('kleur')
|
||||
const { join } = require('path')
|
||||
|
||||
const PATH_WW = [
|
||||
join(process.cwd(), '.wwebjs_auth'),
|
||||
join(process.cwd(), 'session.json'),
|
||||
]
|
||||
|
||||
const cleanSession = () => {
|
||||
const queue = []
|
||||
for (const PATH of PATH_WW) {
|
||||
console.log(yellow(`😬 Eliminando: ${PATH}`))
|
||||
queue.push(rimraf(PATH, () => Promise.resolve()))
|
||||
}
|
||||
return Promise.all(queue)
|
||||
}
|
||||
|
||||
module.exports = { cleanSession }
|
||||
33
packages/cli/configuration/index.js
Normal file
33
packages/cli/configuration/index.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const { writeFile } = require('fs').promises
|
||||
const { join } = require('path')
|
||||
|
||||
/**
|
||||
* JSON_TEMPLATE = {[key:string]{...pros}}
|
||||
*/
|
||||
const JSON_TEMPLATE = {
|
||||
provider: {
|
||||
vendor: '',
|
||||
},
|
||||
database: {
|
||||
host: '',
|
||||
password: '',
|
||||
port: '',
|
||||
username: '',
|
||||
db: '',
|
||||
},
|
||||
io: {
|
||||
vendor: '',
|
||||
},
|
||||
}
|
||||
|
||||
const PATH_CONFIG = join(process.cwd(), 'config.json')
|
||||
|
||||
const jsonConfig = () => {
|
||||
return writeFile(
|
||||
PATH_CONFIG,
|
||||
JSON.stringify(JSON_TEMPLATE, null, 2),
|
||||
'utf-8'
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = { jsonConfig }
|
||||
25
packages/cli/create-app/index.js
Normal file
25
packages/cli/create-app/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const fs = require('fs-extra')
|
||||
|
||||
/**
|
||||
* Copy files
|
||||
*/
|
||||
const copyFiles = async (from, to) => {
|
||||
try {
|
||||
await fs.copy(from, to)
|
||||
console.log('success!')
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copiar directorio con archivos
|
||||
* @param {*} templateName
|
||||
*/
|
||||
const copyBaseApp = async (fromDir = process.cwd(), toDir = process.cwd()) => {
|
||||
const BASEP_APP_PATH_FROM = `${fromDir}`
|
||||
const BASEP_APP_PATH_TO = `${toDir}`
|
||||
await copyFiles(BASEP_APP_PATH_FROM, BASEP_APP_PATH_TO)
|
||||
}
|
||||
|
||||
module.exports = { copyBaseApp }
|
||||
0
packages/cli/db/index.js
Normal file
0
packages/cli/db/index.js
Normal file
3
packages/cli/index.js
Normal file
3
packages/cli/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const { startInteractive } = require('./interactive')
|
||||
if (process.env.NODE_ENV === 'dev') startInteractive()
|
||||
module.exports = { startInteractive }
|
||||
24
packages/cli/install/index.js
Normal file
24
packages/cli/install/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const { readFileSync, existsSync } = require('fs')
|
||||
const { join } = require('path')
|
||||
const { installDeps, getPkgManage } = require('./tool')
|
||||
|
||||
const PATHS_DIR = [
|
||||
join(__dirname, 'pkg-to-update.json'),
|
||||
join(__dirname, '..', 'pkg-to-update.json'),
|
||||
join(__dirname, '..', '..', 'pkg-to-update.json'),
|
||||
]
|
||||
|
||||
const PKG_TO_UPDATE = () => {
|
||||
const PATH_INDEX = PATHS_DIR.findIndex((a) => existsSync(a))
|
||||
const data = readFileSync(PATHS_DIR[PATH_INDEX], 'utf-8')
|
||||
const dataParse = JSON.parse(data)
|
||||
const pkg = Object.keys(dataParse).map((n) => `${n}@${dataParse[n]}`)
|
||||
return pkg
|
||||
}
|
||||
|
||||
const installAll = async () => {
|
||||
const pkg = await getPkgManage()
|
||||
installDeps(pkg, PKG_TO_UPDATE()).runInstall()
|
||||
}
|
||||
|
||||
module.exports = { installAll }
|
||||
68
packages/cli/install/tool.js
Normal file
68
packages/cli/install/tool.js
Normal file
@@ -0,0 +1,68 @@
|
||||
const { red } = require('kleur')
|
||||
const spawn = require('cross-spawn')
|
||||
// const { detect } = require('detect-package-manager')
|
||||
const PKG_OPTION = {
|
||||
npm: 'install',
|
||||
yarn: 'add',
|
||||
pnpm: 'add',
|
||||
}
|
||||
|
||||
const getPkgManage = async () => {
|
||||
// const pkg = await detect()
|
||||
// return pkg
|
||||
return 'npm'
|
||||
}
|
||||
|
||||
const installDeps = (pkgManager, packageList) => {
|
||||
const errorMessage = `Ocurrió un error instalando ${packageList}`
|
||||
let childProcess = []
|
||||
|
||||
const installSingle = (pkgInstall) => () => {
|
||||
new Promise((resolve) => {
|
||||
try {
|
||||
childProcess = spawn(
|
||||
pkgManager,
|
||||
[PKG_OPTION[pkgManager], pkgInstall],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
}
|
||||
)
|
||||
|
||||
childProcess.on('error', (e) => {
|
||||
console.error(e)
|
||||
console.error(red(errorMessage))
|
||||
resolve()
|
||||
})
|
||||
|
||||
childProcess.on('close', (code) => {
|
||||
if (code === 0) {
|
||||
resolve()
|
||||
} else {
|
||||
console.error(code)
|
||||
console.error(red(errorMessage))
|
||||
}
|
||||
})
|
||||
|
||||
resolve()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(red(errorMessage))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof packageList === 'string') {
|
||||
childProcess.push(installSingle(packageList))
|
||||
} else {
|
||||
for (const pkg of packageList) {
|
||||
childProcess.push(installSingle(pkg))
|
||||
}
|
||||
}
|
||||
|
||||
const runInstall = () => {
|
||||
return Promise.all(childProcess.map((i) => i()))
|
||||
}
|
||||
return { runInstall }
|
||||
}
|
||||
|
||||
module.exports = { getPkgManage, installDeps }
|
||||
152
packages/cli/interactive/index.js
Normal file
152
packages/cli/interactive/index.js
Normal file
@@ -0,0 +1,152 @@
|
||||
const prompts = require('prompts')
|
||||
const { join } = require('path')
|
||||
const { yellow, red, cyan, bgMagenta, bgRed } = require('kleur')
|
||||
const { existsSync } = require('fs')
|
||||
const { copyBaseApp } = require('../create-app')
|
||||
const { checkNodeVersion, checkOs, checkGit } = require('../check')
|
||||
|
||||
const bannerDone = () => {
|
||||
console.log(``)
|
||||
console.log(
|
||||
cyan(
|
||||
[
|
||||
`[Agradecimientos]: Este es un proyecto OpenSource, si tienes intenciones de colaborar puedes hacerlo:`,
|
||||
`[😉] Comprando un cafe https://www.buymeacoffee.com/leifermendez`,
|
||||
`[⭐] Dar estrella https://github.com/codigoencasa/bot-whatsapp`,
|
||||
`[🚀] Realizando mejoras en el codigo`,
|
||||
].join('\n')
|
||||
)
|
||||
)
|
||||
console.log(``)
|
||||
}
|
||||
|
||||
const startInteractive = async () => {
|
||||
try {
|
||||
console.clear()
|
||||
await checkNodeVersion()
|
||||
checkOs()
|
||||
await checkGit()
|
||||
console.clear()
|
||||
await nextSteps()
|
||||
} catch (e) {
|
||||
console.error(bgRed(`Ups! 🙄 algo no va bien.`))
|
||||
console.error(
|
||||
bgRed(`Revisa los requerimientos minimos en la documentacion`)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const nextSteps = async () => {
|
||||
const questions = [
|
||||
{
|
||||
type: 'text',
|
||||
name: 'outDir',
|
||||
message: 'Quieres crear un bot? (Y/n)',
|
||||
},
|
||||
{
|
||||
type: 'multiselect',
|
||||
name: 'providerWs',
|
||||
message: '¿Cuál proveedor de whatsapp quieres utilizar?',
|
||||
choices: [
|
||||
{ title: 'Baileys (gratis)', value: 'baileys' },
|
||||
{ title: 'Venom (gratis)', value: 'venom' },
|
||||
{ title: 'whatsapp-web.js (gratis)', value: 'wweb' },
|
||||
{ title: 'Twilio', value: 'twilio' },
|
||||
{ title: 'Meta', value: 'meta' },
|
||||
],
|
||||
max: 1,
|
||||
hint: 'Espacio para seleccionar',
|
||||
instructions: '↑/↓',
|
||||
},
|
||||
{
|
||||
type: 'multiselect',
|
||||
name: 'providerDb',
|
||||
message: '¿Cuál base de datos quieres utilizar?',
|
||||
choices: [
|
||||
{ title: 'Memory', value: 'memory' },
|
||||
{ title: 'Json', value: 'json' },
|
||||
{ title: 'Mongo', value: 'mongo' },
|
||||
{ title: 'MySQL', value: 'mysql' },
|
||||
],
|
||||
max: 1,
|
||||
hint: 'Espacio para seleccionar',
|
||||
instructions: '↑/↓',
|
||||
},
|
||||
]
|
||||
|
||||
const onCancel = () => {
|
||||
console.log('¡Proceso cancelado!')
|
||||
return true
|
||||
}
|
||||
const response = await prompts(questions, { onCancel })
|
||||
const { outDir = '', providerDb = [], providerWs = [] } = response
|
||||
|
||||
const createApp = async (templateName = null) => {
|
||||
if (!templateName)
|
||||
throw new Error('TEMPLATE_NAME_INVALID: ', templateName)
|
||||
|
||||
const possiblesPath = [
|
||||
join(__dirname, '..', '..', 'starters', 'apps', templateName),
|
||||
join(__dirname, '..', 'starters', 'apps', templateName),
|
||||
join(__dirname, 'starters', 'apps', templateName),
|
||||
]
|
||||
|
||||
const answer = outDir.toLowerCase() || 'n'
|
||||
if (answer.includes('n')) return true
|
||||
|
||||
if (answer.includes('y')) {
|
||||
const indexOfPath = possiblesPath.find((a) => existsSync(a))
|
||||
await copyBaseApp(indexOfPath, join(process.cwd(), templateName))
|
||||
console.log(``)
|
||||
console.log(bgMagenta(`⚡⚡⚡ INSTRUCCIONES ⚡⚡⚡`))
|
||||
console.log(yellow(`cd ${templateName}`))
|
||||
console.log(yellow(`npm install`))
|
||||
console.log(yellow(`npm start`))
|
||||
console.log(``)
|
||||
|
||||
return outDir
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selccionar Provider (meta, twilio, etc...)
|
||||
* @returns
|
||||
*/
|
||||
const vendorProvider = async () => {
|
||||
const [answer] = providerWs
|
||||
if (!providerWs.length) {
|
||||
console.log(
|
||||
red(
|
||||
`Debes seleccionar un proveedor de whatsapp. Tecla [Space] para seleccionar`
|
||||
)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
return answer
|
||||
}
|
||||
|
||||
/**
|
||||
* Selecionar adaptador de base de datos
|
||||
* @returns
|
||||
*/
|
||||
const dbProvider = async () => {
|
||||
const [answer] = providerDb
|
||||
if (!providerDb.length) {
|
||||
console.log(
|
||||
red(
|
||||
`Debes seleccionar un proveedor de base de datos. Tecla [Space] para seleccionar`
|
||||
)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
return answer
|
||||
}
|
||||
|
||||
const providerAdapter = await vendorProvider()
|
||||
const dbAdapter = await dbProvider()
|
||||
const NAME_DIR = ['base', providerAdapter, dbAdapter].join('-')
|
||||
await createApp(NAME_DIR)
|
||||
bannerDone()
|
||||
}
|
||||
|
||||
module.exports = { startInteractive }
|
||||
23
packages/cli/package.json
Normal file
23
packages/cli/package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@bot-whatsapp/cli",
|
||||
"version": "0.0.72-alpha.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.3",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"detect-package-manager": "^2.0.1",
|
||||
"kleur": "^4.1.5"
|
||||
},
|
||||
"files": [
|
||||
"./starters/",
|
||||
"./lib/cli/bundle.cli.cjs"
|
||||
],
|
||||
"bin": {
|
||||
"bot": "./bin/cli.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codigoencasa/bot-whatsapp/tree/main/packages/cli"
|
||||
}
|
||||
}
|
||||
3
packages/cli/pkg-to-update.json
Normal file
3
packages/cli/pkg-to-update.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"whatsapp-web.js": "latest"
|
||||
}
|
||||
0
packages/cli/provider/index.js
Normal file
0
packages/cli/provider/index.js
Normal file
23
packages/cli/rollup-cli.config.js
Normal file
23
packages/cli/rollup-cli.config.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const banner = require('../../config/banner.rollup.json')
|
||||
const commonjs = require('@rollup/plugin-commonjs')
|
||||
const copy = require('rollup-plugin-copy')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
const { join } = require('path')
|
||||
|
||||
const PATH = join(__dirname, 'lib', 'cli', 'bundle.cli.cjs')
|
||||
|
||||
module.exports = {
|
||||
input: join(__dirname, 'index.js'),
|
||||
output: {
|
||||
banner: banner['banner.output'].join(''),
|
||||
file: PATH,
|
||||
format: 'cjs',
|
||||
},
|
||||
plugins: [
|
||||
copy({
|
||||
targets: [{ src: 'starters/*', dest: join(__dirname, 'starters') }],
|
||||
}),
|
||||
commonjs(),
|
||||
nodeResolve(),
|
||||
],
|
||||
}
|
||||
21
packages/contexts/package.json
Normal file
21
packages/contexts/package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@bot-whatsapp/contexts",
|
||||
"version": "0.0.16-alpha.0",
|
||||
"description": "",
|
||||
"main": "./lib/bundle.contexts.cjs",
|
||||
"files": [
|
||||
"./lib/"
|
||||
],
|
||||
"exports": {
|
||||
"./mock": "./lib/mock/index.cjs",
|
||||
"./dialogflow": "./lib/dialogflow/index.cjs",
|
||||
"./dialogflowcx": "./lib/dialogflow-cx/index.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bot-whatsapp/bot": "*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codigoencasa/bot-whatsapp/tree/main/packages/contexts"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user