Compare commits
1362
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8492350495 | ||
|
|
f237aeb261 | ||
|
|
f2f926dd55 | ||
|
|
933cbfe712 | ||
|
|
45d3830496 | ||
|
|
620cc30d94 | ||
|
|
402c05b6b7 | ||
|
|
9b02dd2b51 | ||
|
|
91265ed3e6 | ||
|
|
5466c23921 | ||
|
|
3264edf714 | ||
|
|
7d1cd43018 | ||
|
|
7d7826c8f3 | ||
|
|
8893c3c5fe | ||
|
|
4620f48f1e | ||
|
|
732c38a462 | ||
|
|
cc455c3632 | ||
|
|
0a3b773b5a | ||
|
|
9c3a57b238 | ||
|
|
b912266c94 | ||
|
|
da75550a27 | ||
|
|
6dadce2faa | ||
|
|
604ae13468 | ||
|
|
9a43a65718 | ||
|
|
f774563822 | ||
|
|
ffe53075ff | ||
|
|
e4f54a5d6f | ||
|
|
642199b4c4 | ||
|
|
f492b96eed | ||
|
|
116c59361b | ||
|
|
f43ed9371f | ||
|
|
00efc14aca | ||
|
|
0066a541e4 | ||
|
|
4973740abb | ||
|
|
d4f578246e | ||
|
|
04160b1f0e | ||
|
|
7936936d41 | ||
|
|
a54685c062 | ||
|
|
4ff12465de | ||
|
|
5eb54079ec | ||
|
|
1d3b0bd3de | ||
|
|
cd561af66e | ||
|
|
e1d68b0316 | ||
|
|
3bf7b1f61f | ||
|
|
0bec8c51a4 | ||
|
|
aadb7ef1c3 | ||
|
|
eaa5918d1d | ||
|
|
b4c18e2e64 | ||
|
|
a6c212f4f6 | ||
|
|
0df7c165dc | ||
|
|
0225c4fea9 | ||
|
|
be9bfa8090 | ||
|
|
203962e518 | ||
|
|
d8986bf5c4 | ||
|
|
6899962aa7 | ||
|
|
4c9da84475 | ||
|
|
5bfb5614de | ||
|
|
28bee42d54 | ||
|
|
f9ce8ddbae | ||
|
|
4871f80df8 | ||
|
|
c281ec6094 | ||
|
|
f754f61960 | ||
|
|
1ea736b752 | ||
|
|
57c586c28b | ||
|
|
b5cf565a5b | ||
|
|
f40e415914 | ||
|
|
c5564f1e69 | ||
|
|
efeabaa69e | ||
|
|
578f36eceb | ||
|
|
b449fbbb0b | ||
|
|
105c5db3b1 | ||
|
|
e262d18ffd | ||
|
|
d7fbe7e9d7 | ||
|
|
173317f0da | ||
|
|
76ea5c6f70 | ||
|
|
5e2d58ce6f | ||
|
|
8e13c4e189 | ||
|
|
105fab780f | ||
|
|
a15dde7421 | ||
|
|
824888d30c | ||
|
|
4116957e69 | ||
|
|
edcb2f44bf | ||
|
|
85d794438c | ||
|
|
b320a62709 | ||
|
|
f8784b1412 | ||
|
|
38add53425 | ||
|
|
81bbcd2ef6 | ||
|
|
3d66f23ecc | ||
|
|
a1d889a9ea | ||
|
|
74ed9881f4 | ||
|
|
1ed0140665 | ||
|
|
cd19d4b5e1 | ||
|
|
c590b771b8 | ||
|
|
dd569e0853 | ||
|
|
a6508b3414 | ||
|
|
1487e2665e | ||
|
|
920929a216 | ||
|
|
3e0ee92dd5 | ||
|
|
9f69d389ed | ||
|
|
3082c64484 | ||
|
|
944e549819 | ||
|
|
b5de54b903 | ||
|
|
611f9082e1 | ||
|
|
05cfb1113d | ||
|
|
9406d92ba4 | ||
|
|
5e52cdae71 | ||
|
|
c44e380e76 | ||
|
|
450d3d26df | ||
|
|
aada1165d1 | ||
|
|
72d091254e | ||
|
|
d1ae98dea4 | ||
|
|
f69466eaf5 | ||
|
|
1f503546a1 | ||
|
|
b5a2298fb0 | ||
|
|
153dbd2c7d | ||
|
|
c0ac8cdd42 | ||
|
|
49def88fe4 | ||
|
|
df0bce0ec2 | ||
|
|
2d7322a9c8 | ||
|
|
3d032c9f26 | ||
|
|
0ad8295868 | ||
|
|
db7d59ebfa | ||
|
|
92c49da176 | ||
|
|
fe09060da6 | ||
|
|
5a75269c05 | ||
|
|
8e05d35a08 | ||
|
|
489e92277f | ||
|
|
eddc9962d1 | ||
|
|
3df890a6c5 | ||
|
|
f8b5cc8f45 | ||
|
|
7bc8d4e16a | ||
|
|
89bd01ddcf | ||
|
|
6478d8025d | ||
|
|
b3462c8697 | ||
|
|
8024d0c476 | ||
|
|
ea158f81e8 | ||
|
|
a86593a44e | ||
|
|
ad45460328 | ||
|
|
5a281b5de0 | ||
|
|
b18b1552ec | ||
|
|
d005dffd98 | ||
|
|
05ad894821 | ||
|
|
a1cba0b622 | ||
|
|
7521e45124 | ||
|
|
3f05e1b00a | ||
|
|
8b28e9c09b | ||
|
|
115a96d838 | ||
|
|
46f706bd43 | ||
|
|
717b860f13 | ||
|
|
8cbc0fdb93 | ||
|
|
a19288d346 | ||
|
|
c468558a78 | ||
|
|
35bacb7de2 | ||
|
|
539e3c089e | ||
|
|
702481147e | ||
|
|
5324c94306 | ||
|
|
5013392681 | ||
|
|
e04b3613b7 | ||
|
|
8461d6b98e | ||
|
|
26aafc1930 | ||
|
|
74fccfb023 | ||
|
|
3270608e34 | ||
|
|
02723165b4 | ||
|
|
1aa8dd70e1 | ||
|
|
9352dd8c92 | ||
|
|
119111732f | ||
|
|
f5cf80f7dc | ||
|
|
81105509d9 | ||
|
|
447b64d061 | ||
|
|
3343c864e2 | ||
|
|
6d9c24a5f7 | ||
|
|
fff090d5bf | ||
|
|
6bd6178e4f | ||
|
|
c798881c25 | ||
|
|
f2238f35f5 | ||
|
|
11bcd3ae3c | ||
|
|
16f7d92603 | ||
|
|
cc2976ce7a | ||
|
|
b5eb7dd425 | ||
|
|
48c35d8148 | ||
|
|
a45d13cbdf | ||
|
|
e98b1fbd6c | ||
|
|
5eb7667d5d | ||
|
|
6d31e9b7d7 | ||
|
|
9d27d4fe30 | ||
|
|
88cb3f1e6c | ||
|
|
e898bd950d | ||
|
|
c7878074ba | ||
|
|
b7f2b96ece | ||
|
|
1bcf4686a4 | ||
|
|
056e282ba2 | ||
|
|
86e6d9e80f | ||
|
|
059768b156 | ||
|
|
8f5def3a10 | ||
|
|
bc437f7172 | ||
|
|
d37a1135ce | ||
|
|
43fd4ca5ba | ||
|
|
7e06aad6d1 | ||
|
|
22c97aa7fc | ||
|
|
07c6944bb2 | ||
|
|
f572137c49 | ||
|
|
a073739158 | ||
|
|
35148cadae | ||
|
|
c782e23f95 | ||
|
|
172d095b34 | ||
|
|
422c33fd2b | ||
|
|
d5a7adee8a | ||
|
|
cdde8e1633 | ||
|
|
4f8fbb6c06 | ||
|
|
a82c83130d | ||
|
|
08ae3eaa06 | ||
|
|
e0f4dd0c18 | ||
|
|
3fb698be43 | ||
|
|
bd628dde71 | ||
|
|
2f2af07175 | ||
|
|
bf0acdd0fe | ||
|
|
386ead6907 | ||
|
|
7e0b5cdb5e | ||
|
|
36705a7735 | ||
|
|
129f860b63 | ||
|
|
fd20edb52d | ||
|
|
198a2690cd | ||
|
|
28ac81cc70 | ||
|
|
80812a9993 | ||
|
|
6e4ac0fa1b | ||
|
|
6ef1d036b2 | ||
|
|
5ec3217e7a | ||
|
|
80f7ffaa8e | ||
|
|
5121e036a5 | ||
|
|
ec3410dc00 | ||
|
|
862eb4e028 | ||
|
|
b85065282d | ||
|
|
5f8ef6c315 | ||
|
|
ea5c24cd6c | ||
|
|
1542d83fd4 | ||
|
|
8ca5cd0b76 | ||
|
|
347cace378 | ||
|
|
a11d4cd78b | ||
|
|
8bb39d203e | ||
|
|
b621bae467 | ||
|
|
19339ff881 | ||
|
|
02e1f490ca | ||
|
|
57a23234e4 | ||
|
|
fc6495c51e | ||
|
|
b89c388685 | ||
|
|
454045781a | ||
|
|
2dc38e3520 | ||
|
|
5ca63261ca | ||
|
|
e8f596e844 | ||
|
|
ef5516b288 | ||
|
|
f90651c567 | ||
|
|
ec61f7d65e | ||
|
|
39283d5118 | ||
|
|
deac1094d5 | ||
|
|
a3daa13011 | ||
|
|
9adfc76ae0 | ||
|
|
62ca592934 | ||
|
|
748ca1e8f3 | ||
|
|
66bcc3f5af | ||
|
|
5ece100083 | ||
|
|
034c2438d4 | ||
|
|
eb8c6454f2 | ||
|
|
24100041c2 | ||
|
|
665b9276fd | ||
|
|
0b3a60ea28 | ||
|
|
9149adcdf8 | ||
|
|
3a4a1f87f4 | ||
|
|
d3570c2b6a | ||
|
|
59db24aa72 | ||
|
|
038969d465 | ||
|
|
8189982eb8 | ||
|
|
150f77b2a2 | ||
|
|
09e9b27b4d | ||
|
|
0f0e3e61a1 | ||
|
|
e8c77ae0bb | ||
|
|
0542663fdd | ||
|
|
1bcd24e442 | ||
|
|
15f5cd3db6 | ||
|
|
1262a9ba17 | ||
|
|
b1045f6509 | ||
|
|
9ca61a497e | ||
|
|
a28d1064cf | ||
|
|
b90a04890d | ||
|
|
fb0190f35a | ||
|
|
c02de655c8 | ||
|
|
fe1b93391d | ||
|
|
19c1716fdd | ||
|
|
068deb1546 | ||
|
|
6bedd675f1 | ||
|
|
ed1814d40d | ||
|
|
5c87e80b66 | ||
|
|
d76ee9274f | ||
|
|
f7c862aedd | ||
|
|
76185a07cd | ||
|
|
fd6f5a348d | ||
|
|
857e3e467c | ||
|
|
56eb3c0744 | ||
|
|
d0cbab98b9 | ||
|
|
744e4fa2dc | ||
|
|
eeeec548cb | ||
|
|
f57ed82f48 | ||
|
|
d6a009fd3c | ||
|
|
cbc5eacb5e | ||
|
|
2b8de38ad8 | ||
|
|
f2b273e583 | ||
|
|
d10fbc656f | ||
|
|
4dd998faf1 | ||
|
|
12d4a9b47f | ||
|
|
5675caacfe | ||
|
|
b79213f4ac | ||
|
|
f9672c185f | ||
|
|
fa727b5bfa | ||
|
|
19cb4810b7 | ||
|
|
376d657e51 | ||
|
|
785e10fa16 | ||
|
|
8576542530 | ||
|
|
41ad51eef7 | ||
|
|
d110195050 | ||
|
|
572aa35afd | ||
|
|
b28b9f8b7a | ||
|
|
a446ebb1b9 | ||
|
|
b7b5fe8d99 | ||
|
|
32ef271985 | ||
|
|
2162b83bfb | ||
|
|
8ad4a30a86 | ||
|
|
3ea218e975 | ||
|
|
fc1518c9b0 | ||
|
|
1c687eb5b8 | ||
|
|
f1163c38a7 | ||
|
|
250a2c18b8 | ||
|
|
b1669fe6ba | ||
|
|
446014f8f5 | ||
|
|
f6f3fff2a5 | ||
|
|
c99377ade2 | ||
|
|
8fb9b9d44c | ||
|
|
61da7a15d6 | ||
|
|
ad60d147ac | ||
|
|
5bd6fe813e | ||
|
|
201a487dbc | ||
|
|
35c3cee2cb | ||
|
|
2dbf1cfec0 | ||
|
|
894e32bc0b | ||
|
|
30bf3f6732 | ||
|
|
790b25990c | ||
|
|
acf3d24db0 | ||
|
|
c50d4bc7ab | ||
|
|
de649b8cd8 | ||
|
|
f4ea438bae | ||
|
|
1df95b9d62 | ||
|
|
5c3ea78b6d | ||
|
|
cc1ee098b7 | ||
|
|
11d80dc892 | ||
|
|
a3bdf08e15 | ||
|
|
45e4915cd8 | ||
|
|
526f1089bf | ||
|
|
6c31d4504c | ||
|
|
248a28b468 | ||
|
|
098ab80d4b | ||
|
|
2a478c30f4 | ||
|
|
67ba8d54f8 | ||
|
|
c5e9e9c676 | ||
|
|
5c539d837c | ||
|
|
c63db868a7 | ||
|
|
7791e09445 | ||
|
|
1879116a85 | ||
|
|
afe6894a0c | ||
|
|
9479130ea0 | ||
|
|
7f2fb7ae3d | ||
|
|
7600808fd8 | ||
|
|
5eff6838a4 | ||
|
|
933e733956 | ||
|
|
73df017948 | ||
|
|
ab004c1546 | ||
|
|
e1b639bb82 | ||
|
|
9da166478d | ||
|
|
57a4c1d7e7 | ||
|
|
56c07d0c73 | ||
|
|
14a642882d | ||
|
|
43765782a1 | ||
|
|
bce933f100 | ||
|
|
7c2166ec60 | ||
|
|
d8b3864470 | ||
|
|
5c489a36dc | ||
|
|
03fb6dc9ef | ||
|
|
5c1d8315a0 | ||
|
|
abf2fb3642 | ||
|
|
bccb2f3f1b | ||
|
|
c7f5e200ba | ||
|
|
8136a6ba2b | ||
|
|
a65d699111 | ||
|
|
faa85d013c | ||
|
|
e077ab234e | ||
|
|
6587f088ef | ||
|
|
05f8e5d14f | ||
|
|
24431b1c01 | ||
|
|
d92e34adef | ||
|
|
1719c7a2da | ||
|
|
ea023c9762 | ||
|
|
5957989d42 | ||
|
|
7a5204ec80 | ||
|
|
afcedf7276 | ||
|
|
88ea2a6395 | ||
|
|
1b1ecf3039 | ||
|
|
ad0b3e7aa1 | ||
|
|
b3cbd99d04 | ||
|
|
ed9564a6f3 | ||
|
|
67366c03f5 | ||
|
|
202ae5b22b | ||
|
|
55ec1f12cd | ||
|
|
a3598d4505 | ||
|
|
71f182bece | ||
|
|
e9c7c3bf8d | ||
|
|
00833bdb73 | ||
|
|
e94586e34a | ||
|
|
a9cd0d406d | ||
|
|
a91f6f2175 | ||
|
|
b448ab5116 | ||
|
|
f1feb86c4d | ||
|
|
2fa5d3cc6d | ||
|
|
9ddb80f3b2 | ||
|
|
863f4b3dcb | ||
|
|
7862ae0b4e | ||
|
|
427f1b12ab | ||
|
|
6dc18884a0 | ||
|
|
87940d70b9 | ||
|
|
876b150957 | ||
|
|
f1811e7534 | ||
|
|
825f1b4a87 | ||
|
|
1c67ef9a8d | ||
|
|
3681076cd0 | ||
|
|
118791958c | ||
|
|
7b00368d79 | ||
|
|
67192311b7 | ||
|
|
513e9aac18 | ||
|
|
d2a39907ed | ||
|
|
4d3b2326a0 | ||
|
|
5489cfeba6 | ||
|
|
7a757c291f | ||
|
|
c10d54621d | ||
|
|
d45ddd48f4 | ||
|
|
f1aaa38c58 | ||
|
|
411367b132 | ||
|
|
990705ff3f | ||
|
|
79639ed232 | ||
|
|
e8f28a0da6 | ||
|
|
33e49785d8 | ||
|
|
2160305573 | ||
|
|
a400c12d8f | ||
|
|
cc0fe7225d | ||
|
|
cdc8b5af63 | ||
|
|
8db15fc453 | ||
|
|
0c343e59a3 | ||
|
|
14a794a51d | ||
|
|
f992d610c8 | ||
|
|
d3df87ddf5 | ||
|
|
3840d36080 | ||
|
|
2e0e39e538 | ||
|
|
3010bb93e4 | ||
|
|
6247855fdc | ||
|
|
6feaa29437 | ||
|
|
9853f99a93 | ||
|
|
cccef388bf | ||
|
|
ac674e4793 | ||
|
|
30bf25c4d7 | ||
|
|
d2a8e311d9 | ||
|
|
e22fd8eb66 | ||
|
|
266f6685d2 | ||
|
|
9494e00084 | ||
|
|
0010deb175 | ||
|
|
8f7e932f96 | ||
|
|
6c74bd46ad | ||
|
|
ea28b7fe99 | ||
|
|
772bbc3571 | ||
|
|
1d62ee1dbf | ||
|
|
cbcef6ec87 | ||
|
|
ad95b50025 | ||
|
|
c33246083d | ||
|
|
8066e86f39 | ||
|
|
23a48b7fc6 | ||
|
|
8a58ab35fa | ||
|
|
4e8144a93d | ||
|
|
59dba187c3 | ||
|
|
aadfb226b1 | ||
|
|
7b0ba12a32 | ||
|
|
c4c176b7dd | ||
|
|
6c6c0457e1 | ||
|
|
c3686f2b88 | ||
|
|
8855c46e0a | ||
|
|
815a66587c | ||
|
|
f3025ec3dd | ||
|
|
a4a73c6df8 | ||
|
|
2704727a44 | ||
|
|
0719160bdb | ||
|
|
8122afe844 | ||
|
|
7b11b012c4 | ||
|
|
10ded62205 | ||
|
|
0c415f8077 | ||
|
|
39ab51a11c | ||
|
|
a936aa77d5 | ||
|
|
9e2745d2bf | ||
|
|
0211dfa9da | ||
|
|
f901f11693 | ||
|
|
a2fface4a8 | ||
|
|
ad4d40398e | ||
|
|
eafb9d55a0 | ||
|
|
187dd25a4d | ||
|
|
b8ef393172 | ||
|
|
c550d505ec | ||
|
|
617518c620 | ||
|
|
42d103b18d | ||
|
|
39c25ae192 | ||
|
|
1e2226512f | ||
|
|
8a76208a7f | ||
|
|
855693d108 | ||
|
|
a4af307c07 | ||
|
|
cb4a021ad7 | ||
|
|
d18c54c154 | ||
|
|
292d041f7f | ||
|
|
d38b049e43 | ||
|
|
248585ccd2 | ||
|
|
e0cf71c063 | ||
|
|
2675cbc598 | ||
|
|
eb466e97ab | ||
|
|
9f0c39a530 | ||
|
|
fbaf1b2fba | ||
|
|
8524cc9662 | ||
|
|
11dcc683cd | ||
|
|
da8f4c7af7 | ||
|
|
0d0359ce6f | ||
|
|
a219911a83 | ||
|
|
1e7d1dfec4 | ||
|
|
f6ceae0a7f | ||
|
|
5675ed0af0 | ||
|
|
2bb4c6c882 | ||
|
|
70f9a422e3 | ||
|
|
747ba72818 | ||
|
|
b8760cdcda | ||
|
|
50acdf9e2f | ||
|
|
7f0bab3530 | ||
|
|
71dfcde019 | ||
|
|
9e3a236ded | ||
|
|
94fc19c6d8 | ||
|
|
09deffd10e | ||
|
|
4733dfe959 | ||
|
|
57a82d82bd | ||
|
|
29ab2034e2 | ||
|
|
a5fa2073e6 | ||
|
|
01d7dda17a | ||
|
|
997371ba7f | ||
|
|
aa3eb1b1a1 | ||
|
|
0511c17643 | ||
|
|
afba87ca38 | ||
|
|
2439ffdb03 | ||
|
|
f348b8f7ba | ||
|
|
a6bdfa719e | ||
|
|
5fee7651de | ||
|
|
91512fc6c3 | ||
|
|
e5412ae1f0 | ||
|
|
80f8ffc81f | ||
|
|
8a541f34a7 | ||
|
|
bd55610ed4 | ||
|
|
c208df6979 | ||
|
|
403b4df77e | ||
|
|
e22b2076c8 | ||
|
|
c5086b6ff8 | ||
|
|
f8329e22ad | ||
|
|
54efdf93a9 | ||
|
|
56aec8bc45 | ||
|
|
a00b38fd01 | ||
|
|
47256b0f23 | ||
|
|
f28744c322 | ||
|
|
c1b9093d60 | ||
|
|
bbc3846975 | ||
|
|
11db10be4e | ||
|
|
3a02828758 | ||
|
|
d912c35616 | ||
|
|
49e0eecfda | ||
|
|
5d2ccbe959 | ||
|
|
7c2eed5496 | ||
|
|
77784fd955 | ||
|
|
5350f727ea | ||
|
|
c203040f3a | ||
|
|
9f2102e0e6 | ||
|
|
2aeab5fb4d | ||
|
|
3dacf39b67 | ||
|
|
bb3cf36253 | ||
|
|
26c71b82e6 | ||
|
|
b8d265f829 | ||
|
|
c6fe7bca70 | ||
|
|
b70604783b | ||
|
|
d067e5ea7f | ||
|
|
ff950b235f | ||
|
|
0f9fdda3ac | ||
|
|
32a986cc13 | ||
|
|
ab6ba2ae12 | ||
|
|
c3a203b8bb | ||
|
|
e3c910f2fc | ||
|
|
201ad526e2 | ||
|
|
592310c8ea | ||
|
|
159ce2a9de | ||
|
|
2d2a5b0447 | ||
|
|
7e86e6872c | ||
|
|
35ec33c772 | ||
|
|
6e17cab565 | ||
|
|
efc62fb167 | ||
|
|
e9d2303c57 | ||
|
|
8b285a1556 | ||
|
|
09c80b8df7 | ||
|
|
b1c54b4e1d | ||
|
|
cf24f96958 | ||
|
|
f81bd823ea | ||
|
|
a943d30fa3 | ||
|
|
0d11a0a74a | ||
|
|
adde2326ba | ||
|
|
d7dcf8020a | ||
|
|
6ec05a60bc | ||
|
|
b7434234ba | ||
|
|
be116cd92e | ||
|
|
9f8a62bd83 | ||
|
|
b6b475220c | ||
|
|
3977cfa33a | ||
|
|
2022326b5d | ||
|
|
1cd150224f | ||
|
|
9318d631f5 | ||
|
|
8179b83513 | ||
|
|
dade953a4c | ||
|
|
7410879cee | ||
|
|
aba8262dc1 | ||
|
|
babf0f3c9c | ||
|
|
824843f70f | ||
|
|
1c4e04fc19 | ||
|
|
32e430b7cf | ||
|
|
92752916f5 | ||
|
|
2c2e920c42 | ||
|
|
3ae1908c64 | ||
|
|
e898a3235a | ||
|
|
b8da4782e4 | ||
|
|
f8a005e8b8 | ||
|
|
5ffca71677 | ||
|
|
f65c149221 | ||
|
|
bba9ac16fb | ||
|
|
d0dc27347d | ||
|
|
a4918be425 | ||
|
|
9ea175af72 | ||
|
|
11c9085a6f | ||
|
|
04082339fc | ||
|
|
7e22bb3c78 | ||
|
|
0046c19e3e | ||
|
|
81a4f7cb82 | ||
|
|
38fa40506c | ||
|
|
cdf448b0ce | ||
|
|
5baf2fc840 | ||
|
|
76903714c2 | ||
|
|
7c12d24ae3 | ||
|
|
d228440ca3 | ||
|
|
4b193934b3 | ||
|
|
db57fd167f | ||
|
|
8bced0cfd3 | ||
|
|
4ab65e9347 | ||
|
|
72128b3830 | ||
|
|
3adea8ad3b | ||
|
|
77859b2ad2 | ||
|
|
ac7c4d9136 | ||
|
|
b186d22635 | ||
|
|
f30faf1eac | ||
|
|
7b5ab47845 | ||
|
|
9792a271e2 | ||
|
|
10ddfc5223 | ||
|
|
6532071a5f | ||
|
|
badf17ad72 | ||
|
|
e244e69acc | ||
|
|
1a115ffe70 | ||
|
|
bf10611862 | ||
|
|
4b91133703 | ||
|
|
c7391fae8b | ||
|
|
84975a2356 | ||
|
|
dfe6343f78 | ||
|
|
cf547534b7 | ||
|
|
bea6b06f2e | ||
|
|
a3a821c56b | ||
|
|
2d9c730189 | ||
|
|
65f065bb72 | ||
|
|
ce1e264e9f | ||
|
|
d581179af0 | ||
|
|
cfb583a378 | ||
|
|
c725360a5c | ||
|
|
782712eb97 | ||
|
|
eeb40cd1f1 | ||
|
|
50a2390696 | ||
|
|
d78c19d927 | ||
|
|
29e67f9a63 | ||
|
|
d002296c6f | ||
|
|
33f6bf2308 | ||
|
|
599634ebeb | ||
|
|
b15a2b216d | ||
|
|
f499be28cc | ||
|
|
65e725289f | ||
|
|
abbfb315b7 | ||
|
|
d3c026c322 | ||
|
|
bc4ce985fc | ||
|
|
64942f2427 | ||
|
|
eaf51dbd72 | ||
|
|
87794cff6c | ||
|
|
26db84d6e2 | ||
|
|
14929fc682 | ||
|
|
84e4627f82 | ||
|
|
a07cfe6a39 | ||
|
|
7d3370ffea | ||
|
|
5635bb1343 | ||
|
|
c0e55e3f28 | ||
|
|
21cc3f7cbd | ||
|
|
6ed55c361e | ||
|
|
6f33a1edae | ||
|
|
44f346f208 | ||
|
|
eee3b116b4 | ||
|
|
f3d911e553 | ||
|
|
7623228101 | ||
|
|
01c730c187 | ||
|
|
a86b2f6c84 | ||
|
|
a7b90592d4 | ||
|
|
dc93cd731c | ||
|
|
7c41beeb81 | ||
|
|
c26e702576 | ||
|
|
a0cfb7848b | ||
|
|
37b1a50b57 | ||
|
|
72dc5e892d | ||
|
|
e1e2833947 | ||
|
|
52d8b7c631 | ||
|
|
2efa45eb29 | ||
|
|
95dd39cf87 | ||
|
|
4f4acd686d | ||
|
|
b2e510c5ba | ||
|
|
817b1d8afa | ||
|
|
b0950f0da1 | ||
|
|
1d7245bdeb | ||
|
|
b23b489424 | ||
|
|
ecf9da582a | ||
|
|
67355c875d | ||
|
|
391c4720e3 | ||
|
|
912ec7b333 | ||
|
|
268c3f102e | ||
|
|
1d9bab14ce | ||
|
|
d8114f2386 | ||
|
|
979bcd2169 | ||
|
|
844c6e9482 | ||
|
|
647c9dc195 | ||
|
|
7b4eb04a50 | ||
|
|
88edca1a4e | ||
|
|
adcb984da3 | ||
|
|
df394d8404 | ||
|
|
3e2e454530 | ||
|
|
084d708832 | ||
|
|
7d6d779353 | ||
|
|
dff8824b1a | ||
|
|
276d26d5c1 | ||
|
|
a907a11252 | ||
|
|
3a79d2fb55 | ||
|
|
3380b37e56 | ||
|
|
6a3e7bea73 | ||
|
|
aef76f529f | ||
|
|
1ff20dae7f | ||
|
|
b421d81ba1 | ||
|
|
6b1b973ecc | ||
|
|
c2c43a6a07 | ||
|
|
e8bc44c86e | ||
|
|
eccbcbd7d1 | ||
|
|
9da7b7bcb7 | ||
|
|
def769b7c6 | ||
|
|
095dc5f462 | ||
|
|
7fee1bf4df | ||
|
|
1837bee95c | ||
|
|
d81417e847 | ||
|
|
7a1afa8a9a | ||
|
|
c1eaec74b7 | ||
|
|
485b3a43fe | ||
|
|
1b10d262ee | ||
|
|
960264cc32 | ||
|
|
0eb13a0164 | ||
|
|
532c0201e8 | ||
|
|
f8a4d3423d | ||
|
|
b57e0371a9 | ||
|
|
a9641e3f54 | ||
|
|
99dd678173 | ||
|
|
680ee2233d | ||
|
|
8107ab4f42 | ||
|
|
fd48fc006c | ||
|
|
e213eb3647 | ||
|
|
8b86e4b409 | ||
|
|
75faf05129 | ||
|
|
f142fec0c1 | ||
|
|
f397e323c2 | ||
|
|
e1eb98135a | ||
|
|
3ea96fec6f | ||
|
|
4251c2b24b | ||
|
|
27c7c8ea0b | ||
|
|
bcbe230f68 | ||
|
|
50989e9e4a | ||
|
|
00c47b2065 | ||
|
|
40772b09af | ||
|
|
216dbbc7d2 | ||
|
|
bd9fa1d162 | ||
|
|
8d7b63e885 | ||
|
|
23e229a61e | ||
|
|
45fd7e4479 | ||
|
|
af35bf32e0 | ||
|
|
180a0ff84e | ||
|
|
5cfda766a8 | ||
|
|
7481654408 | ||
|
|
65f537e7ac | ||
|
|
59d6a9ea42 | ||
|
|
f31827dd25 | ||
|
|
96cd514026 | ||
|
|
8cfea3e486 | ||
|
|
ef01b2b56c | ||
|
|
0b0360b72e | ||
|
|
03b1049241 | ||
|
|
c2934076f7 | ||
|
|
8870c95a08 | ||
|
|
d02ee2d8da | ||
|
|
7dab358863 | ||
|
|
e8809618d5 | ||
|
|
86629256ca | ||
|
|
73cbb6ecaf | ||
|
|
0bc3aa9965 | ||
|
|
7e2d6f0f8e | ||
|
|
833ae00ece | ||
|
|
1b86b2e3b1 | ||
|
|
31a95ca976 | ||
|
|
ce70fa69ac | ||
|
|
1dc087ea65 | ||
|
|
01bc9ccba2 | ||
|
|
0cbc38eb4c | ||
|
|
0f442aae54 | ||
|
|
9620a7a78b | ||
|
|
9cacfb0cfe | ||
|
|
80920eabb3 | ||
|
|
815c642304 | ||
|
|
8f2800d607 | ||
|
|
2b10dfe591 | ||
|
|
7bc5b892b9 | ||
|
|
03a1afd4d9 | ||
|
|
39443539fc | ||
|
|
e0c0bdd3f3 | ||
|
|
6bf9aaf884 | ||
|
|
0a9361f59e | ||
|
|
a0e0090afd | ||
|
|
b5f555cbe4 | ||
|
|
94c45f2bdd | ||
|
|
b1670380ee | ||
|
|
83bb2edec4 | ||
|
|
8716812610 | ||
|
|
3345eff347 | ||
|
|
5712193f72 | ||
|
|
9c67b79e44 | ||
|
|
8abdeed5a2 | ||
|
|
1326aed521 | ||
|
|
5c9597950b | ||
|
|
a3081bcf4c | ||
|
|
e6f7afd9b9 | ||
|
|
1f550b8939 | ||
|
|
e9d84c1c5d | ||
|
|
f3c35790f4 | ||
|
|
6d8919eecd | ||
|
|
94d9ddde75 | ||
|
|
d0379fd317 | ||
|
|
e1e5f65c03 | ||
|
|
9c1eee37cf | ||
|
|
dd216e93b7 | ||
|
|
779a6cc7bf | ||
|
|
29f7802cbe | ||
|
|
800d06ecc9 | ||
|
|
7edd92e26a | ||
|
|
242e9ee1ab | ||
|
|
b6128a6862 | ||
|
|
562f2670c3 | ||
|
|
c13f02a74c | ||
|
|
16055b41f6 | ||
|
|
184a66886e | ||
|
|
aea77ea0f7 | ||
|
|
e96ca81063 | ||
|
|
ed8cb75cc5 | ||
|
|
c4e14829bb | ||
|
|
83ef4815d0 | ||
|
|
7d7be12a48 | ||
|
|
b2965fa4a4 | ||
|
|
c1507c7fbe | ||
|
|
a5d85d523a | ||
|
|
4055b4c2d8 | ||
|
|
dd27f0d1ad | ||
|
|
be55e3f745 | ||
|
|
88005f2745 | ||
|
|
268270c733 | ||
|
|
f6ff35aa7b | ||
|
|
477f5c6d85 | ||
|
|
a9cfa38d06 | ||
|
|
6680d4495c | ||
|
|
1fb1b4edc1 | ||
|
|
cc350aae23 | ||
|
|
c5c76094f5 | ||
|
|
ec8d8ceacc | ||
|
|
d396b099ec | ||
|
|
e99bc425fd | ||
|
|
ed643887f9 | ||
|
|
d2a65ed71b | ||
|
|
36f5895985 | ||
|
|
2b5406e378 | ||
|
|
fd6cab202f | ||
|
|
f65189c964 | ||
|
|
905892065c | ||
|
|
3cdac9f5e3 | ||
|
|
cf5d686ca3 | ||
|
|
22fa93b002 | ||
|
|
5333d90140 | ||
|
|
a4e7d79d57 | ||
|
|
083a1f86a7 | ||
|
|
8c7f2325b2 | ||
|
|
b3f4444446 | ||
|
|
8e61bccbba | ||
|
|
70df26a046 | ||
|
|
d8bfe85888 | ||
|
|
4cc4c9d043 | ||
|
|
b016173231 | ||
|
|
38b88a589b | ||
|
|
fd7f970304 | ||
|
|
7c078b286f | ||
|
|
a7a338bf26 | ||
|
|
ce33c03bf8 | ||
|
|
24a80a903a | ||
|
|
087e86692f | ||
|
|
9ad1e92844 | ||
|
|
a8d2a8f837 | ||
|
|
b46c637e75 | ||
|
|
2a8fe5d39b | ||
|
|
05d77ba9aa | ||
|
|
a8bf27b54d | ||
|
|
070adb88e7 | ||
|
|
e0c1b7ab6b | ||
|
|
dbdb7cb16f | ||
|
|
d0064c3cf4 | ||
|
|
7fa38555d0 | ||
|
|
938aeadde8 | ||
|
|
4521a8564a | ||
|
|
f00333cc68 | ||
|
|
7cc7c94621 | ||
|
|
a23e505f7a | ||
|
|
eb54b91226 | ||
|
|
e421fd9eea | ||
|
|
36744390b8 | ||
|
|
fb42aafdef | ||
|
|
a9570d699b | ||
|
|
30d82d7d5b | ||
|
|
7a1b1f7ff0 | ||
|
|
c7cebb4f0e | ||
|
|
92b6d04051 | ||
|
|
fe1432facb | ||
|
|
c34463e63a | ||
|
|
6e36a600eb | ||
|
|
32496a9059 | ||
|
|
834718ac1b | ||
|
|
137c53f561 | ||
|
|
cbaddf7c02 | ||
|
|
2ef414d982 | ||
|
|
b857b3167d | ||
|
|
9455b2d907 | ||
|
|
f0b8d8850e | ||
|
|
aa885cab4c | ||
|
|
e4c336a120 | ||
|
|
430d7d6818 | ||
|
|
b894c69ee5 | ||
|
|
a2273e6878 | ||
|
|
de1503c2a8 | ||
|
|
5e50d7dd3d | ||
|
|
35bec1d96e | ||
|
|
cba90c8a0e | ||
|
|
a6e0cd3784 | ||
|
|
f844b3b64a | ||
|
|
a911d87849 | ||
|
|
1da9947f29 | ||
|
|
09c5bba03b | ||
|
|
c3374a69bd | ||
|
|
49b6b46082 | ||
|
|
52b28cb4e3 | ||
|
|
e7697e9c28 | ||
|
|
b44c834e98 | ||
|
|
2adb627c75 | ||
|
|
45cde78438 | ||
|
|
d1e5b32b06 | ||
|
|
87b359789b | ||
|
|
ab10c29972 | ||
|
|
dfd4e4d54d | ||
|
|
cbc8b73ef4 | ||
|
|
7669a4db3c | ||
|
|
87d6fc2581 | ||
|
|
621f1a20af | ||
|
|
22810c71aa | ||
|
|
8f923fbe4c | ||
|
|
bf8bcaab3a | ||
|
|
f9692944c3 | ||
|
|
3b7e405780 | ||
|
|
404f7912a6 | ||
|
|
9f3c91cc54 | ||
|
|
7e05489c8f | ||
|
|
1588d42088 | ||
|
|
fb7b43a30c | ||
|
|
f358d52f84 | ||
|
|
2a59cebe63 | ||
|
|
9ad99f7e6e | ||
|
|
816e9bf60f | ||
|
|
d08d9cc3b4 | ||
|
|
72f1bc6a8a | ||
|
|
ecc95c0b5b | ||
|
|
adcdf352f5 | ||
|
|
30c278b4c9 | ||
|
|
e632314360 | ||
|
|
be79ab80a0 | ||
|
|
8aaf00152e | ||
|
|
9a2dcff440 | ||
|
|
781e225025 | ||
|
|
06de4734f7 | ||
|
|
93736fdb62 | ||
|
|
f44a21dd5e | ||
|
|
7e49d8422a | ||
|
|
46aaad9387 | ||
|
|
43dcf7781e | ||
|
|
f6a266366b | ||
|
|
6cc519052c | ||
|
|
b1224f842c | ||
|
|
2b9c2dbd0e | ||
|
|
cb0720f670 | ||
|
|
c53a5df2d4 | ||
|
|
df5f0fda7a | ||
|
|
a8d442e819 | ||
|
|
273ee1745a | ||
|
|
a0277a5537 | ||
|
|
e0eefb0062 | ||
|
|
6118e21160 | ||
|
|
5f3c700834 | ||
|
|
d1ef0801a2 | ||
|
|
c3c4b384e9 | ||
|
|
c2ef41ae47 | ||
|
|
fd2ae34e2d | ||
|
|
10f01fac32 | ||
|
|
e19acec44f | ||
|
|
84073e86d8 | ||
|
|
92dee735e9 | ||
|
|
7a9112ea44 | ||
|
|
6306453ffe | ||
|
|
0898e16285 | ||
|
|
96cb7c9d6f | ||
|
|
1a3def6708 | ||
|
|
1705961d68 | ||
|
|
fc63d08b50 | ||
|
|
30ac9e5560 | ||
|
|
79004f352e | ||
|
|
4d5690bcd6 | ||
|
|
0f5520060a | ||
|
|
ce60ddced7 | ||
|
|
5e32ecfc58 | ||
|
|
afc5c770ae | ||
|
|
b14c3dacb8 | ||
|
|
a71aedd5af | ||
|
|
72c54793d1 | ||
|
|
4c5dfb56ba | ||
|
|
039be451d4 | ||
|
|
aac28af72f | ||
|
|
54fe3cf870 | ||
|
|
69d5a06066 | ||
|
|
5bbbefc026 | ||
|
|
58e20a44cf | ||
|
|
18db4519f8 | ||
|
|
7ed06a5dac | ||
|
|
1cd43c5356 | ||
|
|
b8e45d06f3 | ||
|
|
fa7044f036 | ||
|
|
f2535976d7 | ||
|
|
41d43b79d2 | ||
|
|
29363e35df | ||
|
|
388f7a6c2a | ||
|
|
688b75434d | ||
|
|
f529fbfcd5 | ||
|
|
f9e736472e | ||
|
|
18e6049878 | ||
|
|
cdbf14c392 | ||
|
|
0dea4d6762 | ||
|
|
c841c2c6bc | ||
|
|
f78866da48 | ||
|
|
e5af65a1aa | ||
|
|
fd51af9c33 | ||
|
|
eae56944b9 | ||
|
|
e37ad93b49 | ||
|
|
55516b32ca | ||
|
|
67babe0819 | ||
|
|
fc02d648f2 | ||
|
|
7ff1073be8 | ||
|
|
5ff772ef38 | ||
|
|
8a53f6b54c | ||
|
|
76dfeeb6a2 | ||
|
|
7b6170ba2e | ||
|
|
748bbd5624 | ||
|
|
14db83c833 | ||
|
|
6704ae5da4 | ||
|
|
92ac87b93d | ||
|
|
80ee398f89 | ||
|
|
88c0f2c7d6 | ||
|
|
f57dc3f4cb | ||
|
|
de0bd26466 | ||
|
|
deed317053 | ||
|
|
81aa44c545 | ||
|
|
39c6366b6a | ||
|
|
5ad53267d2 | ||
|
|
23f13fa0c3 | ||
|
|
b619a9210d | ||
|
|
fba0592c95 | ||
|
|
d569f83bcb | ||
|
|
9bbabb14ca | ||
|
|
267f75aa9e | ||
|
|
20cbf04596 | ||
|
|
f3dc04a9a0 | ||
|
|
2553c8df8d | ||
|
|
b3d366c000 | ||
|
|
67886ead73 | ||
|
|
c4f775b684 | ||
|
|
1bc5e34c9d | ||
|
|
9469f4293c | ||
|
|
bca6192327 | ||
|
|
bafd07ab9d | ||
|
|
d4fb3db23c | ||
|
|
8dae007be1 | ||
|
|
0723ec0573 | ||
|
|
eb2d58a689 | ||
|
|
f7c5b27ede | ||
|
|
f2e0ec2aa6 | ||
|
|
5e8e4f5f73 | ||
|
|
46d7472ac8 | ||
|
|
5b1b1b9b35 | ||
|
|
281beba0be | ||
|
|
0169214b3f | ||
|
|
23b774109a | ||
|
|
dd80c80b14 | ||
|
|
4799d41466 | ||
|
|
20aff4f54e | ||
|
|
6b74b9cbb2 | ||
|
|
45aa5f3dca | ||
|
|
d632491d65 | ||
|
|
d8c12c04d9 | ||
|
|
9c28aee88b | ||
|
|
9c92080d79 | ||
|
|
423a36c1b0 | ||
|
|
069e9ade9a | ||
|
|
478cb082c8 | ||
|
|
6444d222f2 | ||
|
|
1f4fee8904 | ||
|
|
cd44cc0d72 | ||
|
|
2f889aa341 | ||
|
|
b259db992e | ||
|
|
2aedf8d408 | ||
|
|
f00d0fe567 | ||
|
|
ae7eaad7ba | ||
|
|
3b2c62b4e4 | ||
|
|
eb4e78283e | ||
|
|
aac19ed53e | ||
|
|
cc97a654b9 | ||
|
|
3294832c39 | ||
|
|
5380122b7f | ||
|
|
7d9971a1a6 | ||
|
|
956460df10 | ||
|
|
01b79c9dee | ||
|
|
4d3dc3c1fc | ||
|
|
517cc26446 | ||
|
|
1b38361935 | ||
|
|
86259f9ed1 | ||
|
|
58309116b9 | ||
|
|
99f76678f7 | ||
|
|
dd20afb9e8 | ||
|
|
025792fe42 | ||
|
|
48ebaeb925 | ||
|
|
db6b6603af | ||
|
|
c187c276df | ||
|
|
3405818181 | ||
|
|
eca6a9bf47 | ||
|
|
23c1b17e2d | ||
|
|
d3bf069fd6 | ||
|
|
ee0872a472 | ||
|
|
f6e7dc0217 | ||
|
|
5d4ecbb691 | ||
|
|
96a6206c59 | ||
|
|
be6289fe22 | ||
|
|
c6e19cdf2a | ||
|
|
8f79f39723 | ||
|
|
780fce04ff | ||
|
|
780f975e7c | ||
|
|
d3f1ade376 | ||
|
|
588a3c95ea | ||
|
|
8f3f877810 | ||
|
|
c1dfd1b169 | ||
|
|
4469ee99c7 | ||
|
|
baf64da77c | ||
|
|
80b6d27611 | ||
|
|
08d30ca390 | ||
|
|
7adf7f7181 | ||
|
|
87b05e5ecd | ||
|
|
4033f4019f | ||
|
|
73823b4152 | ||
|
|
f725a977de | ||
|
|
424df55bcd | ||
|
|
1e5df05b2c | ||
|
|
18685d49dd | ||
|
|
b6197de956 | ||
|
|
d42b59dfa2 | ||
|
|
2df3a569b4 | ||
|
|
0d7fe35928 | ||
|
|
5e2e370c41 | ||
|
|
cd40e8ec48 | ||
|
|
103746b007 | ||
|
|
6bf508fc34 | ||
|
|
13dfe99d7c | ||
|
|
7c44fc3761 | ||
|
|
eb741cd9d3 | ||
|
|
8786c87f5e | ||
|
|
142942838b | ||
|
|
a9a33ae930 | ||
|
|
363e225a87 | ||
|
|
38036af25d | ||
|
|
04c5010e86 | ||
|
|
acf9d47467 | ||
|
|
ed0c83dbb2 | ||
|
|
9cf1ede9f2 | ||
|
|
80c93c226c | ||
|
|
39540f6850 | ||
|
|
6885c2ded8 | ||
|
|
1a4bae9e86 | ||
|
|
fb7f26ba6a | ||
|
|
c1fe2e975d | ||
|
|
37587029d2 | ||
|
|
c0c2f10228 | ||
|
|
1b04aa32e7 | ||
|
|
8e379fe853 | ||
|
|
c5279aa348 | ||
|
|
5a3d40169c | ||
|
|
9afff7174d | ||
|
|
f789e2d578 | ||
|
|
3d10ecf3f2 | ||
|
|
84f2988560 | ||
|
|
168cb749ee | ||
|
|
e24d57dded | ||
|
|
db4ad1b0e4 | ||
|
|
87d2252c43 | ||
|
|
2fbcd3fa57 | ||
|
|
9d2acc5a58 | ||
|
|
060418e4d6 | ||
|
|
59f0202485 | ||
|
|
1ec3f656a0 | ||
|
|
03b2b1ffda | ||
|
|
f27034652e | ||
|
|
ed2f8c7497 | ||
|
|
255315dd64 | ||
|
|
2dae62dbc2 | ||
|
|
0bf9caf2c1 | ||
|
|
7018e43f5e | ||
|
|
7c552f55a1 | ||
|
|
4a34245410 | ||
|
|
44dfb12195 | ||
|
|
08a56a6026 | ||
|
|
2905730db6 | ||
|
|
540f18cd69 | ||
|
|
c6748a8466 | ||
|
|
b3d9a3cc80 | ||
|
|
0fd12e1f1a | ||
|
|
259396c205 | ||
|
|
e98fb2063a | ||
|
|
89fdec328f | ||
|
|
59b4703152 | ||
|
|
03d177f7a7 | ||
|
|
816720f80f | ||
|
|
507d17aa69 | ||
|
|
4eb903b908 | ||
|
|
4e46b8c6b7 | ||
|
|
fc477d4f88 | ||
|
|
cd5029aaa0 | ||
|
|
e288edbfa9 | ||
|
|
f4faf0959e | ||
|
|
1cd52b8ed1 | ||
|
|
b71fd5282b | ||
|
|
28da06e485 | ||
|
|
52f15ce37c | ||
|
|
0755e4dc34 | ||
|
|
c445691bc9 | ||
|
|
489a6ed7a2 | ||
|
|
7aa52e4ff3 | ||
|
|
2697689c3c | ||
|
|
9941896c4e | ||
|
|
ba94eba05d | ||
|
|
557817ff91 | ||
|
|
a840c2034a | ||
|
|
823c920baf | ||
|
|
99b8734417 | ||
|
|
fed1b8d0ec | ||
|
|
fc3419e2c1 | ||
|
|
e43f3aac01 | ||
|
|
833691a2b7 | ||
|
|
7e4484f0b0 | ||
|
|
62a41aeb31 | ||
|
|
0c8dae7f37 | ||
|
|
65358f6404 | ||
|
|
76c191c7a8 | ||
|
|
894ccc72db | ||
|
|
22d4ad532d | ||
|
|
69f6c6c5f3 | ||
|
|
81b23b3495 | ||
|
|
0595f1b06f | ||
|
|
bb903b8eb4 | ||
|
|
046a369ce4 | ||
|
|
d12ab41b47 | ||
|
|
db0e91ac02 | ||
|
|
e34f44a620 | ||
|
|
90377568ac | ||
|
|
978c6be82c | ||
|
|
f3bc0cdda8 | ||
|
|
00ce521972 | ||
|
|
7bc3b0ec28 | ||
|
|
5a0136a1c0 | ||
|
|
563e648079 | ||
|
|
357e9a04bc | ||
|
|
b84ad7aae6 | ||
|
|
0eb238551c | ||
|
|
68bb87936a | ||
|
|
c82a2b96ab | ||
|
|
77624f63c7 | ||
|
|
36c26570ac | ||
|
|
c2bd990c9d | ||
|
|
1218ff377d | ||
|
|
c7db94c63a | ||
|
|
215ec526a1 | ||
|
|
d597b0416d | ||
|
|
6d41d04cbd | ||
|
|
c494433576 | ||
|
|
2a49b303cc | ||
|
|
9e5c550474 | ||
|
|
2837f0ab32 | ||
|
|
8450e6717b | ||
|
|
14e7655df9 | ||
|
|
b20559057d | ||
|
|
d7c79bf6ba | ||
|
|
16d5e00fc3 | ||
|
|
82450bf9c7 | ||
|
|
7bada617b7 | ||
|
|
67f6e1d9db | ||
|
|
d9e2b26e98 | ||
|
|
8c2d2d762f | ||
|
|
704f1d69fa | ||
|
|
1c5e2b68f4 | ||
|
|
af856335af | ||
|
|
3b90597478 | ||
|
|
742722be71 | ||
|
|
47e3961b3e | ||
|
|
86fcfb4c67 | ||
|
|
3d0682b004 | ||
|
|
ee90ba2b45 | ||
|
|
bf931fedf6 | ||
|
|
d5add5486c | ||
|
|
cb010fb5c6 | ||
|
|
7df98bde28 |
No files matched your search
+5
-3
@@ -1,6 +1,8 @@
|
||||
Data-Storage
|
||||
Log-Files
|
||||
My-Workspaces
|
||||
**/Data-Storage
|
||||
**/My-Data-Storage
|
||||
**/Log-Files
|
||||
**/My-Log-Files
|
||||
**/My-Workspaces
|
||||
debug.log
|
||||
|
||||
*.db
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
||||
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence, these will be requested for
|
||||
# review when someone opens a pull request.
|
||||
|
||||
* @Superalgos/foundations-project
|
||||
|
||||
# Project Teams
|
||||
/Projects/Algorithmic-Trading/ @Superalgos/algorithmic-trading-project
|
||||
/Projects/Community-Plugins/ @Superalgos/community-plugins-project
|
||||
/Projects/Data-Mining/ @Superalgos/data-mining-project
|
||||
/Projects/Ethereum/ @Superalgos/ethereum-project
|
||||
/Projects/Foundations/ @Superalgos/foundations-project
|
||||
/Projects/Governance/ @Superalgos/governance-project
|
||||
/Projects/Machine-Learning/ @Superalgos/machine-learning-project
|
||||
/Projects/Network/ @Superalgos/network-project
|
||||
/Projects/Social-Bots/ @Superalgos/social-bots-project
|
||||
/Projects/Social-Trading/ @Superalgos/social-trading-project
|
||||
/Projects/TensorFlow/ @Superalgos/tensorflow-project
|
||||
/Projects/Visual-Scripting/ @Superalgos/visual-scripting-project
|
||||
|
||||
/Projects/Education/ @Superalgos/education-project
|
||||
Docs*/ @Superalgos/education-project
|
||||
|
||||
/.github/ @Superalgos/sysadmins-team
|
||||
/Docker/ @Superalgos/sysadmins-team
|
||||
.git* @Superalgos/sysadmins-team
|
||||
.docker* @Superalgos/sysadmins-team
|
||||
package*.json @Superalgos/sysadmins-team
|
||||
@@ -2,9 +2,14 @@ name: Publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, develop]
|
||||
release:
|
||||
types: [published, created, edited]
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
- created
|
||||
- edited
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
name: Build/release Binaries
|
||||
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-release:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js, NPM and Yarn
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Get version
|
||||
id: vars
|
||||
run: echo "::set-output name=tag::$(node -p "require('./package.json').version")"
|
||||
|
||||
- name: Build/release Electron app
|
||||
uses: samuelmeuli/action-electron-builder@v1
|
||||
with:
|
||||
# GitHub token, automatically provided to the action
|
||||
# (No need to define this secret in the repo settings)
|
||||
github_token: ${{ secrets.github_token }}
|
||||
args: "-c.extraMetadata.version=${{ steps.vars.outputs.tag }} -c build/electron-builder.json -p always"
|
||||
release: true
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
name: Nightly develop Binaries
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '20 3 * * *'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download a file
|
||||
run: curl "https://raw.githubusercontent.com/${{ github.repository }}/develop/package.json" -o package.json
|
||||
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "::set-output name=date::$(date +'%Y%m%d')"
|
||||
|
||||
- name: Get version
|
||||
id: vars
|
||||
run: echo "::set-output name=tag::$(node -p "require('./package.json').version")"
|
||||
|
||||
- name: Create nightly release
|
||||
id: create_release
|
||||
uses: viperproject/create-nightly-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.vars.outputs.tag }}.${{ steps.date.outputs.date }}
|
||||
release_name: Superalgos-Beta-v${{ steps.vars.outputs.tag }} Snapshot ${{ steps.date.outputs.date }}
|
||||
keep_num: 5
|
||||
keep_tags: false
|
||||
|
||||
build-release:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: create-release
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest, ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "::set-output name=date::$(date +'%Y%m%d')"
|
||||
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: develop
|
||||
|
||||
- name: Install Node.js, NPM and Yarn
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Get version
|
||||
id: vars
|
||||
run: echo "::set-output name=tag::$(node -p "require('./package.json').version")"
|
||||
|
||||
- name: Build/release Electron app
|
||||
uses: samuelmeuli/action-electron-builder@v1
|
||||
with:
|
||||
# GitHub token, automatically provided to the action
|
||||
# (No need to define this secret in the repo settings)
|
||||
github_token: ${{ secrets.github_token }}
|
||||
args: "-c.extraMetadata.version=${{ steps.vars.outputs.tag }}.${{ steps.date.outputs.date }} -c build/electron-builder.json -p onTagOrDraft"
|
||||
|
||||
# If the commit is tagged with a version (e.g. "v1.0.0"),
|
||||
# release the app after building
|
||||
# release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
release: true
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ My-Workspaces
|
||||
My-Social-Trading-Data
|
||||
My-Network-Nodes-Data
|
||||
My-Secrets
|
||||
My-Data-Storage
|
||||
My-Log-Files
|
||||
debug.log
|
||||
.DS_Store
|
||||
*.db
|
||||
@@ -17,3 +19,4 @@ node_modules
|
||||
launch.json
|
||||
package-lock.json
|
||||
.idea
|
||||
dist
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
}
|
||||
Vendored
+11
-5
@@ -1,19 +1,25 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true,
|
||||
"**/My-Social-Trading-Data": true,
|
||||
"**/My-Network-Nodes-Data": true,
|
||||
"**/My-Workspaces": true,
|
||||
"**/My-Secrets": true,
|
||||
"**/My-Data-Storage": true,
|
||||
"**/My-Log-Files": true,
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true,
|
||||
"**/My-Social-Trading-Data": true
|
||||
"**/My-Social-Trading-Data": true,
|
||||
"**/My-Network-Nodes-Data": true,
|
||||
"**/My-Workspaces": true,
|
||||
"**/My-Secrets": true,
|
||||
"**/My-Data-Storage": true,
|
||||
"**/My-Log-Files": true,
|
||||
},
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
+61
-111
@@ -1,128 +1,78 @@
|
||||
exports.newDesktopApp = function newDesktopApp() {
|
||||
|
||||
let thisObject = {
|
||||
userProfiles: undefined,
|
||||
p2pNetworkClient: undefined,
|
||||
p2pNetwork: undefined,
|
||||
p2pNetworkPeers: undefined,
|
||||
webSocketsInterface: undefined,
|
||||
webAppInterface: undefined,
|
||||
p2pNetworkInterface: undefined,
|
||||
socialGraph: undefined,
|
||||
run: run
|
||||
}
|
||||
|
||||
DK.desktopApp = thisObject
|
||||
|
||||
return thisObject
|
||||
|
||||
async function run() {
|
||||
/*
|
||||
Heree we will store our running objects:
|
||||
*/
|
||||
DK.running = {}
|
||||
|
||||
/*
|
||||
This is the Web Sockets client that interacts with the Superalgos Network.
|
||||
*/
|
||||
DK.running.socialGraph = DK.projects.socialTrading.modules.socialGraph.newSocialTradingModulesSocialGraph()
|
||||
await DK.running.socialGraph.initialize()
|
||||
await setupNetwork()
|
||||
await setupServices()
|
||||
|
||||
/*
|
||||
This is the Web Sockets client that interacts with the Superalgos Network.
|
||||
*/
|
||||
DK.running.webSocketsClient = SA.projects.network.modules.webSocketsClient.newNetworkModulesWebSocketsClient()
|
||||
await DK.running.webSocketsClient.initialize()
|
||||
console.log('Desktop Client Connected to Network Node via Web Sockets ................... Connected to port ' + global.env.NETWORK_WEB_SOCKETS_INTERFACE_PORT)
|
||||
|
||||
/* These are the Network Interfaces by which the UI interacts with the Desktop App.*/
|
||||
|
||||
DK.running.webSocketsInterface = DK.projects.socialTrading.modules.webSocketsInterface.newDesktopModulesWebSocketsInterface()
|
||||
DK.running.webSocketsInterface.initialize()
|
||||
console.log('Desktop Client Web Sockets Interface ....................................... Listening at port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
|
||||
|
||||
|
||||
DK.running.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface()
|
||||
DK.running.httpInterface.initialize()
|
||||
console.log('Desktop Client Http Interface .............................................. Listening at port ' + global.env.DESKTOP_HTTP_INTERFACE_PORT)
|
||||
|
||||
return
|
||||
|
||||
let queryMessage
|
||||
let query
|
||||
/*
|
||||
Test Query User Profiles.
|
||||
*/
|
||||
queryMessage = {
|
||||
queryType: SA.projects.socialTrading.globals.queryTypes.USER_PROFILES,
|
||||
emitterUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId,
|
||||
initialIndex: 'Last',
|
||||
amountRequested: 10,
|
||||
direction: 'Past'
|
||||
async function setupNetwork() {
|
||||
/*
|
||||
We set up ourselves as a Network Client.
|
||||
*/
|
||||
thisObject.p2pNetworkClient = SA.projects.network.modules.p2pNetworkClient.newNetworkModulesP2PNetworkClient()
|
||||
await thisObject.p2pNetworkClient.initialize()
|
||||
/*
|
||||
We will read all user profiles plugins and get from there our network identity.
|
||||
*/
|
||||
thisObject.userProfiles = SA.projects.network.modules.userProfiles.newNetworkModulesUserProfiles()
|
||||
await thisObject.userProfiles.initialize(global.env.DESKTOP_APP_SIGNING_ACCOUNT, thisObject.p2pNetworkClient)
|
||||
/*
|
||||
We set up the P2P Network.
|
||||
*/
|
||||
thisObject.p2pNetwork = SA.projects.network.modules.p2pNetwork.newNetworkModulesP2PNetwork()
|
||||
await thisObject.p2pNetwork.initialize('Network Client')
|
||||
/*
|
||||
Set up the connections to network nodes.
|
||||
*/
|
||||
thisObject.p2pNetworkPeers = SA.projects.network.modules.p2pNetworkPeers.newNetworkModulesP2PNetworkPeers()
|
||||
await thisObject.p2pNetworkPeers.initialize(
|
||||
'Network Client',
|
||||
thisObject.p2pNetworkClient,
|
||||
thisObject.p2pNetwork,
|
||||
global.env.DESKTOP_APP_MAX_OUTGOING_PEERS
|
||||
)
|
||||
}
|
||||
|
||||
query = {
|
||||
requestType: 'Query',
|
||||
queryMessage: JSON.stringify(queryMessage)
|
||||
}
|
||||
async function setupServices() {
|
||||
/*
|
||||
This is where we will process all the messages comming from our web app.
|
||||
*/
|
||||
thisObject.webAppInterface = DK.projects.socialTrading.modules.webAppInterface.newSocialTradingModulesWebAppInterface()
|
||||
/*
|
||||
This is where we will process all the events comming from the p2p network.
|
||||
*/
|
||||
thisObject.p2pNetworkInterface = DK.projects.socialTrading.modules.p2pNetworkInterface.newSocialTradingModulesP2PNetworkInterface()
|
||||
/*
|
||||
This is the Personal Social Graph for the user running this App.
|
||||
*/
|
||||
thisObject.socialGraph = DK.projects.socialTrading.modules.socialGraph.newSocialTradingModulesSocialGraph()
|
||||
await thisObject.socialGraph.initialize()
|
||||
/*
|
||||
These are the Network Interfaces by which the Web App interacts with this Desktop Client.
|
||||
*/
|
||||
thisObject.webSocketsInterface = DK.projects.socialTrading.modules.webSocketsInterface.newDesktopModulesWebSocketsInterface()
|
||||
thisObject.webSocketsInterface.initialize()
|
||||
console.log('Desktop Client Web Sockets Interface ......................................... Listening at port ' + JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webSocketsPort)
|
||||
|
||||
await DK.webSocketsClient.sendMessage(
|
||||
JSON.stringify(query)
|
||||
)
|
||||
.then(showProfiles)
|
||||
.catch(onError)
|
||||
|
||||
async function showProfiles(profiles) {
|
||||
console.log(profiles)
|
||||
|
||||
for (let i = 0; i < profiles.length; i++) {
|
||||
let profile = profiles[i]
|
||||
|
||||
/*
|
||||
Test Following Profiles.
|
||||
*/
|
||||
let eventMessage = {
|
||||
eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
|
||||
eventType: SA.projects.socialTrading.globals.eventTypes.FOLLOW_USER_PROFILE,
|
||||
emitterUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId,
|
||||
targetUserProfileId: profile.userProfileId
|
||||
}
|
||||
|
||||
let event = {
|
||||
requestType: 'Event',
|
||||
eventMessage: JSON.stringify(eventMessage)
|
||||
}
|
||||
|
||||
await DK.webSocketsClient.sendMessage(
|
||||
JSON.stringify(event)
|
||||
)
|
||||
.then(followAdded)
|
||||
.catch(onError)
|
||||
|
||||
function followAdded() {
|
||||
console.log("User Profile " + profile.userProfileHandle + " followed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
Test Query User Profile Stats.
|
||||
*/
|
||||
queryMessage = {
|
||||
queryType: SA.projects.socialTrading.globals.queryTypes.USER_PROFILE_STATS,
|
||||
emitterUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId,
|
||||
targetUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId
|
||||
}
|
||||
|
||||
query = {
|
||||
requestType: 'Query',
|
||||
queryMessage: JSON.stringify(queryMessage)
|
||||
}
|
||||
|
||||
await DK.webSocketsClient.sendMessage(
|
||||
JSON.stringify(query)
|
||||
)
|
||||
.then(showProfilesStats)
|
||||
.catch(onError)
|
||||
|
||||
function showProfilesStats(profile) {
|
||||
console.log(profile)
|
||||
}
|
||||
|
||||
/*
|
||||
Error Handling
|
||||
*/
|
||||
function onError(errorMessage) {
|
||||
console.log('[ERROR] Query not executed. ' + errorMessage)
|
||||
thisObject.httpInterface = DK.projects.socialTrading.modules.httpInterface.newDesktopModulesHttpInterface()
|
||||
thisObject.httpInterface.initialize()
|
||||
console.log('Desktop Client Http Interface ................................................ Listening at port ' + JSON.parse(DK.desktopApp.p2pNetworkClient.node.config).webPort)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
|
||||
/* Root object*/
|
||||
/* Root objects*/
|
||||
let UI = {
|
||||
projects: {},
|
||||
schemas: { projectSchema: undefined },
|
||||
environment: undefined,
|
||||
running: {}
|
||||
clientNode: undefined,
|
||||
webApp: undefined
|
||||
}
|
||||
|
||||
let SA = { projects: {} }
|
||||
@@ -13,3 +14,4 @@ We will use this to load functions originally intended for Nodejs
|
||||
*/
|
||||
let exports = {}
|
||||
|
||||
|
||||
+14
-6
@@ -1,6 +1,11 @@
|
||||
function newWebApp() {
|
||||
/*
|
||||
In it's current state of development, the Web App only has one module.
|
||||
|
||||
Everything is being coded here until some structure emerges.
|
||||
*/
|
||||
let thisObject = {
|
||||
messageReceived: messageReceived,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
@@ -15,7 +20,7 @@ function newWebApp() {
|
||||
try {
|
||||
setupRootObject(UI, 'UI')
|
||||
setupRootObject(SA, 'SA')
|
||||
await UI.projects.socialTrading.modules.webSocketsClient.initialize()
|
||||
await UI.projects.socialTrading.modules.webSocketsWebAppClient.initialize()
|
||||
loadWUserProfileTimeline()
|
||||
loadWhoToFollow()
|
||||
setupEventHandlers()
|
||||
@@ -109,7 +114,7 @@ function newWebApp() {
|
||||
queryMessage: JSON.stringify(queryMessage)
|
||||
}
|
||||
|
||||
await UI.projects.socialTrading.modules.webSocketsClient.sendMessage(
|
||||
await UI.projects.socialTrading.modules.webSocketsWebAppClient.sendMessage(
|
||||
JSON.stringify(query)
|
||||
)
|
||||
.then(addToContentDiv)
|
||||
@@ -123,7 +128,6 @@ function newWebApp() {
|
||||
function addToContentDiv(events) {
|
||||
try {
|
||||
let contentDiv = document.getElementById('content-div')
|
||||
|
||||
/*
|
||||
Delete al current content.
|
||||
*/
|
||||
@@ -180,7 +184,7 @@ function newWebApp() {
|
||||
queryMessage: JSON.stringify(queryMessage)
|
||||
}
|
||||
|
||||
await UI.projects.socialTrading.modules.webSocketsClient.sendMessage(
|
||||
await UI.projects.socialTrading.modules.webSocketsWebAppClient.sendMessage(
|
||||
JSON.stringify(query)
|
||||
)
|
||||
.then(addWhoToFollowTable)
|
||||
@@ -357,7 +361,7 @@ function newWebApp() {
|
||||
eventMessage: JSON.stringify(eventMessage)
|
||||
}
|
||||
|
||||
await UI.projects.socialTrading.modules.webSocketsClient.sendMessage(
|
||||
await UI.projects.socialTrading.modules.webSocketsWebAppClient.sendMessage(
|
||||
JSON.stringify(event)
|
||||
)
|
||||
.then(resolve)
|
||||
@@ -393,7 +397,7 @@ function newWebApp() {
|
||||
eventMessage: JSON.stringify(eventMessage)
|
||||
}
|
||||
|
||||
await UI.projects.socialTrading.modules.webSocketsClient.sendMessage(
|
||||
await UI.projects.socialTrading.modules.webSocketsWebAppClient.sendMessage(
|
||||
JSON.stringify(event)
|
||||
)
|
||||
.then(resolve)
|
||||
@@ -406,4 +410,8 @@ function newWebApp() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function messageReceived(message) {
|
||||
window.alert(message)
|
||||
}
|
||||
}
|
||||
@@ -98,8 +98,8 @@ function newWebAppLoader() {
|
||||
|
||||
if (downloadedCounter === modulesArray.length) {
|
||||
setTimeout(() => {
|
||||
UI.running.webApp = newWebApp()
|
||||
UI.running.webApp.initialize()
|
||||
UI.webApp = newWebApp()
|
||||
UI.webApp.initialize()
|
||||
}, 500)
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,15 @@ function loadSuperalgos() {
|
||||
|
||||
function onResponse(err, file) {
|
||||
UI.environment = JSON.parse(file)
|
||||
setupClientNode()
|
||||
}
|
||||
}
|
||||
|
||||
function setupClientNode() {
|
||||
httpRequest(undefined, 'ClientNode', onResponse)
|
||||
|
||||
function onResponse(err, file) {
|
||||
UI.clientNode = JSON.parse(file)
|
||||
setupProjectsSchema()
|
||||
}
|
||||
}
|
||||
|
||||
+10
-7
@@ -10,21 +10,25 @@ exports.newDesktopRoot = function newDesktopRoot() {
|
||||
|
||||
return thisObject
|
||||
|
||||
async function run() {
|
||||
async function run(debugSettings) {
|
||||
/*
|
||||
The DK object is accesible everywhere at the Superalgos Desktop App.
|
||||
The DK object is accessible everywhere at the Superalgos Desktop App.
|
||||
It provides access to all modules built for this App.
|
||||
*/
|
||||
global.DK = {}
|
||||
/*
|
||||
The SA object is accesible everywhere at the Superalgos Desktop App.
|
||||
The SA object is accessible everywhere at the Superalgos Desktop App.
|
||||
It provides access to all modules built for Superalgos in general.
|
||||
*/
|
||||
global.SA = {}
|
||||
/* Load Environment Variables */
|
||||
let ENVIRONMENT = require('./EnvironmentForDebug.js');
|
||||
let ENVIRONMENT = require('./Environment.js');
|
||||
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
|
||||
global.env = ENVIRONMENT_MODULE
|
||||
|
||||
if (debugSettings !== undefined && debugSettings.DESKTOP_APP_SIGNING_ACCOUNT !== undefined) {
|
||||
global.env.DESKTOP_APP_SIGNING_ACCOUNT = debugSettings.DESKTOP_APP_SIGNING_ACCOUNT
|
||||
}
|
||||
/*
|
||||
First thing is to load the project schema file.
|
||||
*/
|
||||
@@ -51,17 +55,16 @@ exports.newDesktopRoot = function newDesktopRoot() {
|
||||
simpleGit: require('simple-git'),
|
||||
nodeFetch: require('node-fetch')
|
||||
}
|
||||
|
||||
/*
|
||||
Setting up Secrets.
|
||||
*/
|
||||
SA.secrets = {
|
||||
array: require('./My-Secrets/Secrets.json'),
|
||||
array: require('./My-Secrets/Secrets.json').secrets,
|
||||
map: new Map()
|
||||
}
|
||||
for (let i = 0; i < SA.secrets.array.length; i++) {
|
||||
let secret = SA.secrets.array[i]
|
||||
SA.secrets.map.set (secret.codeName, secret)
|
||||
SA.secrets.map.set (secret.signingAccountChildCodeName, secret)
|
||||
}
|
||||
|
||||
run()
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ COPY . .
|
||||
RUN apk add --no-cache --virtual .build-deps make g++ \
|
||||
&& apk add --no-cache python3 \
|
||||
&& if [ "$(uname -m)" = "x86_64" ]; then node setup noShortcuts tensorflow; else node setup noShortcuts; fi \
|
||||
&& mkdir -p Data-Storage Log-Files My-Workspaces \
|
||||
&& mkdir -p ./Platform/My-Data-Storage ./Platform/My-Log-Files ./Platform/My-Workspaces \
|
||||
&& addgroup superalgos \
|
||||
&& adduser --disabled-password --no-create-home --ingroup superalgos superalgos \
|
||||
&& chown -R superalgos:superalgos /app \
|
||||
@@ -12,5 +12,5 @@ RUN apk add --no-cache --virtual .build-deps make g++ \
|
||||
USER superalgos
|
||||
EXPOSE 34248
|
||||
EXPOSE 18041
|
||||
VOLUME ["/app/Data-Storage", "/app/Log-Files", "/app/My-Workspaces"]
|
||||
VOLUME ["/app/Platform/My-Data-Storage", "/app/Platform/My-Log-Files", "/app/Platform/My-Workspaces"]
|
||||
ENTRYPOINT ["node", "platform", "noBrowser"]
|
||||
@@ -0,0 +1,273 @@
|
||||
# Superalgos Docker Guide
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Installation](#installation)
|
||||
- [Mac OS](#mac-os)
|
||||
- [Windows](#windows)
|
||||
- [Linux and BSD](#linux-and-bsd)
|
||||
- [Running Superalgos](#running-superalgos)
|
||||
- [Using Docker-Compose](#using-docker-compose)
|
||||
- [Docker Best Practices](#docker-best-practices)
|
||||
- [Docker Development Best Practices](#docker-development-best-practices)
|
||||
- [Dockerfile Best Practices](#dockerfile-best-practices)
|
||||
- [Twelve Factor App](#twelve-factor-app)
|
||||
|
||||
## Introduction
|
||||
|
||||
This walk through is broken up into to parts: a quick-start guide to running [Superalgos](https://github.com/Superalgos/Superalgos) with Docker and a deeper, more theoretical dive into containers with the hopes of explaining some of the design decisions.
|
||||
|
||||
[Superalgos](https://github.com/Superalgos/Superalgos), at its core, is a web application which also means it can be deployed inside a container like many other web applications. One of the leading platforms for operating containers is Docker. Docker can run on many different operating systems and compute platforms. The containers provide an easy, fast, repeatable, and secure way to deploy and distribute applications. While it doesn't take much experience to run containers or Docker, there are some basics that any user should learn in order to use the technology effectively.
|
||||
|
||||
Before getting started, be aware that Docker is not the originally intended method of running the [Superalgos](https://github.com/Superalgos/Superalgos) application and as such there are some drawbacks to doing so. Namely, you won't be able contribute back to the project or configure your Governance profile. We'll discuss this more later. Therefore, you should only consider using the Docker container for production deployments.
|
||||
|
||||
It is also worth noting that [Superalgos](https://github.com/Superalgos/Superalgos) is very resource intense so it is best to get acquainted with the software by running it on a fast computer with a good amount of RAM as opposed to a tiny, slow Raspberry Pi. But, once you are ready to run a production deployment, then a more economical server is preferred.
|
||||
|
||||
Docker container images are hosted on `ghcr`. You can browse the containers in the [Packages section of the code repository](https://github.com/users/Superalgos/packages/container/package/superalgos).
|
||||
|
||||
> **Note:** The container and the application are still under heavy development and testing. Please join the [Superalgos SysAdmins Group](https://t.me/superalgossysadmins) to discuss any issues you may run into.
|
||||
|
||||
## Installation
|
||||
|
||||
First, Docker Desktop needs to be installed on a Mac or Windows computer in order to run the containers. Linux and BSD users will need Docker Engine. Docker-compose is also recommended and it should be included with Docker Desktop, but it may need to be installed separately.
|
||||
|
||||
### Mac OS
|
||||
|
||||
Docker can be downloaded from the Docker Store following the [directions in the official Docker Docs](https://docs.docker.com/desktop/mac/install/). It can also be installed from the command line using Homebrew.
|
||||
|
||||
```shell
|
||||
brew cask install docker
|
||||
brew install docker-compose
|
||||
```
|
||||
|
||||
Then, make sure Docker Desktop is running. An easy way to check is to push `Cmd + space` then type `docker.app` in the search bar. You should also see the little whale icon in the top menu bar near the clock.
|
||||
|
||||
### Windows
|
||||
|
||||
Windows requires a few more steps than Mac OS, but it can also be downloaded from the Docker Store following the [directions in the official Docker Docs](https://docs.docker.com/desktop/windows/install/). It can also be installed from the command line using Chocolatey.
|
||||
|
||||
```shell
|
||||
choco install docker-desktop
|
||||
```
|
||||
|
||||
Docker should automatically start after installation. If you don't see the whale icon in the tray by the clock, then find `Docker` in the start menu.
|
||||
|
||||
### Linux and BSD
|
||||
|
||||
On Linux and BSD systems, Docker can be installed using the preferred package manager. [Step by step instructions for many different distributions](https://docs.docker.com/engine/install/debian/) of Linux can be found in the official Docker Docs. Since [Superalgos](https://github.com/Superalgos/Superalgos) runs well on Raspberry Pi 4 single-board computers, I'm going to illustrate the commands necessary to run [Superalgos](https://github.com/Superalgos/Superalgos) on the Raspbian Linux distribution.
|
||||
|
||||
```shell
|
||||
# install the requirements
|
||||
sudo apt-get update
|
||||
sudo apt-get install \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg \
|
||||
lsb-release
|
||||
|
||||
# add the gpg keys to verify the packages
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
||||
# configure the official repository
|
||||
echo \
|
||||
"deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# install docker engine
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
|
||||
```
|
||||
|
||||
Docker should automatically start when it is done installing. You can check its status with `systemctl status docker`. To make things easier, ensure your user is added to the `docker` group. Type `id` at the command prompt and you should see something like `groups=...999(docker)`. If you don't see it listed, you can add yourself with `sudo usermod -a -G docker <username>`.
|
||||
|
||||
## Running Superalgos
|
||||
|
||||
Now that we have Docker installed and running, we can run the container. The option `--rm` will remove the instance of the container when it is exited.
|
||||
|
||||
```shell
|
||||
docker run --rm ghcr.io/superalgos/superalgos:latest
|
||||
```
|
||||
|
||||
You'll see some messages showing the container being downloaded and then some messages from the application itself showing that it is starting up and ready to accept connections. We'll stop the container now and add in a few more options so make it more useful, so press `ctrl + c` to exit.
|
||||
|
||||
We'll need to expose some ports so we can actually connect to it from our browser. Also, we'll want to create a few directories on our host file system so we can save, or persist, data between container reboots.
|
||||
|
||||
- `-d` to run the container daemonized, in the background
|
||||
- `-p` to map ports to the host system to allow connections
|
||||
- `-v` to mount local directories inside the container to persist data
|
||||
- `--name` to assign a name to the container for easier reference
|
||||
|
||||
```shell
|
||||
# create the data directories
|
||||
mkdir -p Data-Storage Log-Files My-Workspaces
|
||||
|
||||
# run the container with the extra options
|
||||
docker run \
|
||||
-d \
|
||||
--rm \
|
||||
--name superalgos \
|
||||
--user $(id -u):$(id -g) \
|
||||
-p 18041:18041 \
|
||||
-p 34248:34248 \
|
||||
-v $(pwd)/Data-Storage:/app/Platform/Data-Storage \
|
||||
-v $(pwd)/Log-Files:/app/Platform/Log-Files \
|
||||
-v $(pwd)/My-Workspaces:/app/Platform/My-Workspaces \
|
||||
ghcr.io/superalgos/superalgos:latest
|
||||
```
|
||||
|
||||
You can check the status of the container with `docker ps -a` and view the logs with `docker logs superalgos`.
|
||||
|
||||
Note that you will see one error in the log output informing you that `git` is not installed. This is intentional and is not required for the bot to function properly.
|
||||
|
||||
Now you can open your browser and load the application front end. Try loading `http://localhost:34248` if you are on the same computer that is running the container, otherwise use the host ip, for example `http://192.168.1.10:34248`.
|
||||
|
||||
If you want to stop the container, you can run `docker stop superalgos`. When you want to upgrade the container, use:
|
||||
|
||||
```shell
|
||||
docker pull ghcr.io/superalgos/superalgos:latest
|
||||
docker stop superalgos
|
||||
docker run \
|
||||
-d \
|
||||
--rm \
|
||||
--name superalgos \
|
||||
--user $(id -u):$(id -g) \
|
||||
-p 18041:18041 \
|
||||
-p 34248:34248 \
|
||||
-v $(pwd)/Data-Storage:/app/Platform/Data-Storage \
|
||||
-v $(pwd)/Log-Files:/app/Platform/Log-Files \
|
||||
-v $(pwd)/My-Workspaces:/app/Platform/My-Workspaces \
|
||||
ghcr.io/superalgos/superalgos:latest
|
||||
```
|
||||
|
||||
Let's stop the container for now (`docker stop superalgos`) and we'll run it again using `docker-compose`.
|
||||
|
||||
Continue reading the [Docker Command Line documentation](https://docs.docker.com/engine/reference/commandline/cli/) for more details.
|
||||
|
||||
### Using Docker-Compose
|
||||
|
||||
Docker-compose is a wrapper for the Docker API which makes it a little easier to maintain a declarative configuration for an application instead of using the direct command line commands. There is a sample docker-compose configuration included in the [Superalgos](https://github.com/Superalgos/Superalgos) which you can as the basis for your own configuration.
|
||||
|
||||
Let's download the sample and edit it. If you don't use `vim`, change that command for your preferred editor.
|
||||
|
||||
```shell
|
||||
wget https://raw.githubusercontent.com/Superalgos/Superalgos/master/Docker/docker-compose.yml
|
||||
vim docker-compose.yml
|
||||
```
|
||||
|
||||
Now, let's change some of the settings:
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
services:
|
||||
superalgos:
|
||||
image: ghcr.io/superalgos/superalgos:latest
|
||||
command: ["minMemo"]
|
||||
user: "$UID:$GID"
|
||||
ports:
|
||||
- '34248:34248'
|
||||
- '18041:18041'
|
||||
volumes:
|
||||
- ./Data-Storage:/app/Platform/Data-Storage
|
||||
- ./Log-Files:/app/Platform/Log-Files
|
||||
- ./My-Workspaces:/app/Platform/My-Workspaces
|
||||
restart: on-failure
|
||||
```
|
||||
|
||||
You can see we have the same ports and volumes mapped. We also get a few extra settings like `command`, `environment`, and `restart`.
|
||||
|
||||
- `command` adds an extra setting to the main startup, so the application ends up running with the full command `node platform noBrowser minMemo`. The base of that command is defined as the `ENTRYPOINT` in the `Dockerfile` that builds the container.
|
||||
- `user` defines the UID and GID the container should run as so that the data can be persisted with the correct permissions in the Data-Storage, Log-Files, and My-Workspaces directories that we created on the host. If you leave this out, the container will use the built in `superalgos` user which has `uid: 1001` and `gid: 1001`. Instead of using variables, you could also hard-code these UID and GID numbers into the configuration.
|
||||
- `restart` tells Docker to restart the container if an error occurs.
|
||||
|
||||
Save the file and exit the editor. If you are using `vim`, hit escape and then type `:wq!` or press `shift + Z + Z` (two capital Z's).
|
||||
|
||||
Now, start the container with `docker-compose up`. This will start the container in the foreground and you'll connect to the log output. Hit `ctrl + c` to exit. Going forward, you'll want to add the `-d` option to start the container and keep it running in the background.
|
||||
|
||||
```shell
|
||||
# some preliminary configuration to set up the persistent data directories
|
||||
mkdir -p Data-Storage Log-Files My-Workspaces
|
||||
export UID=$(id -u)
|
||||
export GID=$(id -g)
|
||||
|
||||
# run the container in the background
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Now you have several `docker-compose` commands at your disposal to interact with the container:
|
||||
|
||||
- `docker-compose ps` to see details of the container
|
||||
- `docker-compose logs` to see the logs
|
||||
- `docker-compose down` to stop and remove the instance of the container
|
||||
- `docker-compose pull` to pull the container, or a new version of the `latest` tag
|
||||
|
||||
Putting some of those concepts together, you can keep the running container up to date with this one-liner:
|
||||
|
||||
```shell
|
||||
docker-compose pull && docker-compose down && docker-compose up -d
|
||||
```
|
||||
|
||||
Explore the full [Docker Compose documentation](https://docs.docker.com/compose/) for more information.
|
||||
|
||||
## Docker Best Practices
|
||||
|
||||
As with any technology, there are lots of ways of doing things. A lot of them will give the same end result, but some may have fewer steps, or be more secure, or be more maintainable. That is where "best practices" come in. They aren't there to necessarily tell you what to do and what not to do, but they are there to help guide you in the right direction. A lot of times, they help you avoid making architectural mistakes that could come back and bite you further down the road.
|
||||
|
||||
One general best practice when running a production deployment is to avoid breaking changes by pinning to specific container tags. The `shasum hash` and the `release` tags are the best to use. These will generally ensure you are always running the same code and it will only upgrade when configured to do so. The other tags will change which code they are pointing to more frequently and without notice.
|
||||
|
||||
- `latest` : the absolute latest build
|
||||
- `master` : the latest master branch build
|
||||
- `develop` : the latest develop branch build
|
||||
- `<shasum hash>` : a specific git commit hash
|
||||
- `<release>` : corresponds with a Github Release (git tag), i.e. `beta-10`
|
||||
|
||||
## Docker Development Best Practices
|
||||
|
||||
Docker has many advantages which can aid in every step from development through production deployment. There are some useful tips located directly in the [Docker documentation](https://docs.docker.com/develop/dev-best-practices/). Concisely, they are to keep the build images small, a few tips on when and how to persist data, and to use CI/CD for testing and deployment. All of these tips are used in one way or another as a part of the [Superalgos](https://github.com/Superalgos/Superalgos) project.
|
||||
|
||||
- Use a minimal base image and multi-stage build. Superalgos is currently using an [alpine](https://www.alpinelinux.org/) base image but [distroless](https://github.com/GoogleContainerTools/distroless) is becoming more common and some times using a base image like [python-slim](https://hub.docker.com/_/python) is the bast that can be achieved.
|
||||
- The images are quite large (around 2 GB in size), unfortunately, because the codebase itself is large. We've recently put in a lot of effort to make these images as small as possible.
|
||||
- The images are built automatically using Github Actions when pull requests are merged.
|
||||
- With the correct configuration, data, like data mine and trading bot information, is persisted to the host using volume mounts
|
||||
|
||||
### Dockerfile Best Practices
|
||||
|
||||
Docker maintains a list of [Dockerfile best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) in their main documentation. These tips dictate many of the decisions around the Superalgos Dockerfile. Some of the tips that are used by [Superalgos](https://github.com/Superalgos/Superalgos) are listed below.
|
||||
|
||||
- Use `.dockerignore` to prevent unwanted data from entering the container. This keeps the container small but also enhances security to prevent secrets from leaking into a container by accident.
|
||||
- Don't install unnecessary packages. In lieu of multi-stage builds, build caches and build dependencies are removed before finalizing the container. Only packages that are necessary for the execution of the application are installed. This is why `git` is not present.
|
||||
- Minimize the number of layers. Many `RUN` commands are combined into one using `&&` in order to reduce the number of layers.
|
||||
- Sort multiline arguments. This mostly enhances readability and maintainability.
|
||||
- Leverage build cache. When testing locally, several of the tips above help leverage the build cache and speed up build times.
|
||||
|
||||
### Twelve Factor App
|
||||
|
||||
[Superalgos](https://github.com/Superalgos/Superalgos) is a web app but it was originally designed to be run on a local workstation or server on a trusted network. However, I don't think it would be prudent to talk about Docker best practices without mentioning the [Twelve Factor App](https://12factor.net/) manifesto. Over time, [Superalgos](https://github.com/Superalgos/Superalgos) itself may iterate and implement more and more of these principles as more people get involved and more people deploy production environments.
|
||||
|
||||
The Twelve Factors:
|
||||
|
||||
- Codebase: One codebase tracked in revision control, many deploys
|
||||
- Superalgos utilizes one GitHub repository
|
||||
- Dependencies: Explicitly declare and isolate dependencies
|
||||
- Superalgos is a node.js app and uses npm to track and install dependencies
|
||||
- Config: Store config in the environment
|
||||
- Superalgos does not use environment variables the moment for configuration. Options are passed on the command line at run time. Other configuration is hard coded into the Workspaces.
|
||||
- Backing services: Treat backing services as attached resources
|
||||
- Superalgos connects to external services via API calls over HTTP (TCP)
|
||||
- Build, release, run: Strictly separate build and run stages
|
||||
- Superalgos is deployed by end users in their own local environments
|
||||
- Processes: Execute the app as one or more stateless processes
|
||||
- Superalgos is one application
|
||||
- Port binding: Export services via port binding
|
||||
- Superalgos exposes an HTTP frontend port and a Websockets backend port (TCP)
|
||||
- Concurrency: Scale out via the process model
|
||||
- Superalgos can be clustered but the front end and backend do not necessarily scale out independently from each other
|
||||
- Disposability: Maximize robustness with fast startup and graceful shutdown
|
||||
- Superalgos is not stateless in that the data files must be persisted to disk. Also, Superalgos cannot run behind a load balancer and have requests randomly distributed to different backend servers.
|
||||
- Dev/prod parity: Keep development, staging, and production as similar as possible
|
||||
- Superalgos doesn't have its own production environment but the container makes it easy to ensure development environments are the same as what a user will see when they deploy it for themselves in their own production environment.
|
||||
- Logs: Treat logs as event streams
|
||||
- Superalgos sends its own application logs to standard out. The trading mine logs are sent to flat files (persisted through volume mounts)
|
||||
- Admin processes: Run admin/management tasks as one-off processes
|
||||
- Superalgos does not have any admin or management tasks outside of what is used to create the container at build time.
|
||||
@@ -6,14 +6,12 @@ services:
|
||||
dockerfile: ./Docker/Dockerfile
|
||||
image: ghcr.io/superalgos/superalgos:latest
|
||||
command: ["minMemo"]
|
||||
user: "$UID:$GID"
|
||||
ports:
|
||||
- '34248:34248'
|
||||
- '18041:18041'
|
||||
volumes:
|
||||
- ../Data-Storage:/app/Data-Storage
|
||||
- ../Log-Files:/app/Log-Files
|
||||
- ../My-Workspaces:/app/My-Workspaces
|
||||
environment:
|
||||
PUID: '1000'
|
||||
PGID: '1000'
|
||||
- ../Platform/My-Data-Storage:/app/Platform/My-Data-Storage
|
||||
- ../Platform/My-Log-Files:/app/Platform/My-Log-Files
|
||||
- ../Platform/My-Workspaces:/app/Platform/My-Workspaces
|
||||
restart: on-failure
|
||||
+40
-11
@@ -1,18 +1,47 @@
|
||||
const path = require("path")
|
||||
|
||||
if (process.env.PACKAGED_PATH) {
|
||||
basePath = process.env.PACKAGED_PATH
|
||||
} else {
|
||||
basePath = __dirname
|
||||
}
|
||||
exports.newEnvironment = function () {
|
||||
|
||||
let thisObject = {
|
||||
DEMO_MODE: false,
|
||||
BASE_PATH: basePath,
|
||||
WEB_SERVER_URL: 'localhost',
|
||||
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
|
||||
CLIENT_HTTP_INTERFACE_PORT: 34248,
|
||||
PATH_TO_DATA_STORAGE: './Data-Storage',
|
||||
PATH_TO_PROJECTS: './Projects',
|
||||
PATH_TO_LOG_FILES: './Log-Files',
|
||||
PATH_TO_PROJECTS_REQUIRED: './Projects',
|
||||
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
|
||||
PATH_TO_CLIENT: './Platform',
|
||||
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './My-Workspaces',
|
||||
PATH_TO_FONTS: './Platform/WebServer/Fonts'
|
||||
PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041,
|
||||
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 17041,
|
||||
DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 16041,
|
||||
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
|
||||
PLATFORM_HTTP_INTERFACE_PORT: 34248,
|
||||
DESKTOP_HTTP_INTERFACE_PORT: 33248,
|
||||
PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'),
|
||||
PATH_TO_PROJECTS: path.join(basePath, './Projects'),
|
||||
PATH_TO_LOG_FILES: path.join(basePath, './Platform/My-Log-Files'),
|
||||
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
|
||||
PATH_TO_PROJECT_SCHEMA: path.join(basePath, './Projects/ProjectsSchema.json'),
|
||||
PATH_TO_PLATFORM: path.join(basePath, './Platform'),
|
||||
PATH_TO_DESKTOP: './Desktop',
|
||||
PATH_TO_DEFAULT_WORKSPACE: path.join(basePath, './Projects/Foundations/Plugins/Workspaces'),
|
||||
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
|
||||
PATH_TO_FONTS: path.join(basePath, './Platform/WebServer/Fonts'),
|
||||
DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
|
||||
DESKTOP_APP_MAX_OUTGOING_PEERS: 1,
|
||||
MOBILE_APP_SIGNING_ACCOUNT: 'Social-Trading-Mobile-App-1',
|
||||
SERVER_APP_SIGNING_ACCOUNT: 'Social-Trading-Server-App-1',
|
||||
PLATFORM_APP_SIGNING_ACCOUNT: 'Algo-Traders-Platform-1',
|
||||
P2P_NETWORK_NODE_SIGNING_ACCOUNT: 'P2P-Network-Node-1',
|
||||
P2P_NETWORK_NODE_MAX_INCOMING_CLIENTS: 1,
|
||||
P2P_NETWORK_NODE_MAX_INCOMING_PEERS: 2,
|
||||
P2P_NETWORK_NODE_MAX_OUTGOING_PEERS: 2
|
||||
}
|
||||
|
||||
if (process.env.DATA_PATH) {
|
||||
thisObject.PATH_TO_DATA_STORAGE = path.join(process.env.DATA_PATH, '/Superalgos_Data/My-Data-Storage')
|
||||
thisObject.PATH_TO_LOG_FILES = path.join(process.env.DATA_PATH, '/Superalgos_Data/My-Log-Files')
|
||||
thisObject.PATH_TO_MY_WORKSPACES = path.join(process.env.DATA_PATH, '/Superalgos_Data/My-Workspaces')
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
exports.newEnvironment = function () {
|
||||
|
||||
let thisObject = {
|
||||
WEB_SERVER_URL: 'localhost',
|
||||
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
|
||||
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
|
||||
DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 18043,
|
||||
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
|
||||
CLIENT_HTTP_INTERFACE_PORT: 34248,
|
||||
DESKTOP_HTTP_INTERFACE_PORT: 34249,
|
||||
PATH_TO_DATA_STORAGE: './Data-Storage',
|
||||
PATH_TO_PROJECTS: './Projects',
|
||||
PATH_TO_LOG_FILES: './Log-Files',
|
||||
PATH_TO_PROJECTS_REQUIRED: './Projects',
|
||||
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
|
||||
PATH_TO_CLIENT: './Platform',
|
||||
PATH_TO_DESKTOP: './Desktop',
|
||||
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
|
||||
PATH_TO_MY_WORKSPACES: './My-Workspaces',
|
||||
PATH_TO_FONTS: './Platform/WebServer/Fonts'
|
||||
}
|
||||
|
||||
return thisObject
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "C:\\Superalgos\\Network"
|
||||
},
|
||||
{
|
||||
"path": "C:\\Superalgos\\Projects\\Network"
|
||||
},
|
||||
{
|
||||
"path": "C:\\Superalgos\\Projects\\Social-Trading"
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/Data-Storage": true,
|
||||
"**/Documentation": true,
|
||||
"**/Log-Files": true,
|
||||
"**/node_modules": true,
|
||||
"**/Deprecated-Code": true
|
||||
},
|
||||
"search.maintainFileSearchCache": true
|
||||
}
|
||||
+55
-9
@@ -1,24 +1,70 @@
|
||||
exports.newNetworkNode = function newNetworkNode() {
|
||||
|
||||
let thisObject = {
|
||||
userProfiles: undefined,
|
||||
p2pNetwork: undefined,
|
||||
p2pNetworkPeers: undefined,
|
||||
p2pNetworkNode: undefined,
|
||||
webSocketsInterface: undefined,
|
||||
socialGraphService: undefined,
|
||||
storage: undefined,
|
||||
run: run
|
||||
}
|
||||
|
||||
NT.networkNode = thisObject
|
||||
|
||||
return thisObject
|
||||
|
||||
async function run() {
|
||||
/*
|
||||
Let's start the Network Interfaces
|
||||
*/
|
||||
NT.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface()
|
||||
NT.webSocketsInterface.initialize()
|
||||
|
||||
thisObject.socialGraphService = NT.projects.socialTrading.modules.socialGraph.newNetworkModulesSocialGraph()
|
||||
await thisObject.socialGraphService.initialize()
|
||||
await setupNetwork()
|
||||
await setupServices()
|
||||
|
||||
thisObject.storage = NT.projects.socialTrading.modules.storage.newSocialTradingModulesStorage()
|
||||
thisObject.storage.initialize()
|
||||
async function setupNetwork() {
|
||||
/*
|
||||
We set up ourselves as a Network Node.
|
||||
*/
|
||||
thisObject.p2pNetworkNode = SA.projects.network.modules.p2pNetworkNode.newNetworkModulesP2PNetworkNode()
|
||||
await thisObject.p2pNetworkNode.initialize()
|
||||
/*
|
||||
We will read all user profiles plugins and get from there our network identity.
|
||||
*/
|
||||
thisObject.userProfiles = SA.projects.network.modules.userProfiles.newNetworkModulesUserProfiles()
|
||||
await thisObject.userProfiles.initialize(global.env.P2P_NETWORK_NODE_SIGNING_ACCOUNT, thisObject.p2pNetworkNode)
|
||||
/*
|
||||
Let's discover who is at the p2p network.
|
||||
*/
|
||||
thisObject.p2pNetwork = SA.projects.network.modules.p2pNetwork.newNetworkModulesP2PNetwork()
|
||||
await thisObject.p2pNetwork.initialize('Network Peer')
|
||||
/*
|
||||
Set up the connections to network nodes.
|
||||
*/
|
||||
thisObject.p2pNetworkPeers = SA.projects.network.modules.p2pNetworkPeers.newNetworkModulesP2PNetworkPeers()
|
||||
await thisObject.p2pNetworkPeers.initialize(
|
||||
'Network Peer',
|
||||
thisObject.p2pNetworkNode,
|
||||
thisObject.p2pNetwork,
|
||||
global.env.P2P_NETWORK_NODE_MAX_OUTGOING_PEERS
|
||||
)
|
||||
}
|
||||
|
||||
async function setupServices() {
|
||||
/*
|
||||
The Social Graph Service is the first and for now, the only service this Network Node provides.
|
||||
*/
|
||||
thisObject.socialGraphService = NT.projects.socialTrading.modules.socialGraph.newNetworkModulesSocialGraph()
|
||||
await thisObject.socialGraphService.initialize()
|
||||
/*
|
||||
The Sotrage deals with persisting the Social Graph.
|
||||
*/
|
||||
thisObject.storage = NT.projects.socialTrading.modules.storage.newSocialTradingModulesStorage()
|
||||
thisObject.storage.initialize()
|
||||
/*
|
||||
Other Network Nodes and Client Apps will communicate with this Network Node via it's Websocket Interface.
|
||||
*/
|
||||
thisObject.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface()
|
||||
thisObject.webSocketsInterface.initialize()
|
||||
console.log('Network Node Web Sockets Interface ........................................... Listening at port ' + JSON.parse(NT.networkNode.p2pNetworkNode.node.config).webSocketsPort)
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-6
@@ -10,21 +10,25 @@ exports.newNetworkRoot = function newNetworkRoot() {
|
||||
|
||||
return thisObject
|
||||
|
||||
async function run() {
|
||||
async function run(debugSettings) {
|
||||
/*
|
||||
The NT object is accesible everywhere at the Superalgos Network.
|
||||
The NT object is accessible everywhere at the Superalgos Network.
|
||||
It provides access to all modules built for this Network.
|
||||
*/
|
||||
global.NT = {}
|
||||
/*
|
||||
The SA object is accesible everywhere at the Superalgos Network.
|
||||
The SA object is accessible everywhere at the Superalgos Network.
|
||||
It provides access to all modules built for Superalgos in general.
|
||||
*/
|
||||
global.SA = {}
|
||||
/* Load Environment Variables */
|
||||
let ENVIRONMENT = require('./EnvironmentForDebug.js');
|
||||
let ENVIRONMENT = require('./Environment.js');
|
||||
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
|
||||
global.env = ENVIRONMENT_MODULE
|
||||
|
||||
if (debugSettings !== undefined && debugSettings.P2P_NETWORK_NODE_SIGNING_ACCOUNT !== undefined) {
|
||||
global.env.P2P_NETWORK_NODE_SIGNING_ACCOUNT = debugSettings.P2P_NETWORK_NODE_SIGNING_ACCOUNT
|
||||
}
|
||||
/*
|
||||
First thing is to load the project schema file.
|
||||
*/
|
||||
@@ -52,12 +56,12 @@ exports.newNetworkRoot = function newNetworkRoot() {
|
||||
Setting up Secrets.
|
||||
*/
|
||||
SA.secrets = {
|
||||
array: require('./My-Secrets/Secrets.json'),
|
||||
array: require('./My-Secrets/Secrets.json').secrets,
|
||||
map: new Map()
|
||||
}
|
||||
for (let i = 0; i < SA.secrets.array.length; i++) {
|
||||
let secret = SA.secrets.array[i]
|
||||
SA.secrets.map.set(secret.codeName, secret)
|
||||
SA.secrets.map.set(secret.signingAccountChildCodeName, secret)
|
||||
}
|
||||
|
||||
NT.app = require('./Network/NetwokNode.js').newNetworkNode()
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
exports.newEventServer = function newEventServer() {
|
||||
|
||||
const MODULE = "Events Server"
|
||||
const LOG_INFO = false
|
||||
|
||||
let thisObject = {
|
||||
initialize: initialize,
|
||||
finalize: finalize,
|
||||
@@ -37,7 +34,7 @@
|
||||
if (eventHandler === undefined) {
|
||||
/*
|
||||
We will only create event handlers which were not created before. Remember that someone trying to listen events
|
||||
at an event handler that does not exist, will create that eventhandler, so it is possible that the emitter
|
||||
at an event handler that does not exist, will create that event handler, so it is possible that the emitter
|
||||
when trying to create the event handler in fact was late and the event handler is already there if the listener
|
||||
arrived here first. An event handler created with this method is not destroyed if there are no listeners or they
|
||||
all leave.
|
||||
@@ -53,8 +50,8 @@
|
||||
let eventHandler = eventHandlers.get(command.eventHandlerName)
|
||||
if (eventHandler !== undefined) {
|
||||
/*
|
||||
We will only delete event handlers which have noone listening, allowing a listener to continue listening even
|
||||
when the event emitter is gone, asuming that it could come back at some point in time and resume emitting.
|
||||
We will only delete event handlers which have no one listening, allowing a listener to continue listening even
|
||||
when the event emitter is gone, assuming that it could come back at some point in time and resume emitting.
|
||||
*/
|
||||
if (eventHandler.listeners.length === 0) {
|
||||
eventHandlers.delete(command.eventHandlerName)
|
||||
@@ -71,8 +68,8 @@
|
||||
if (eventHandler === undefined) {
|
||||
/*
|
||||
We will create event handlers which were not created before if a listener tries to listen to a handler that does not
|
||||
exist before the emitter comes and create it. This is to aviod syncronization problems and also problems with emitters life
|
||||
cycles with higher frecuency that the ones of listeners. Created in this way, event handlers are marked for deletion if
|
||||
exist before the emitter comes and create it. This is to avoid synchronization problems and also problems with emitters life
|
||||
cycles with higher frequency that the ones of listeners. Created in this way, event handlers are marked for deletion if
|
||||
all listeners stop listening at one point in time.
|
||||
*/
|
||||
eventHandler = newEventHandler()
|
||||
@@ -107,7 +104,7 @@
|
||||
|
||||
if (eventHandler === undefined) {
|
||||
|
||||
/* If the event handler does not exist anymore, then there is no need to perform further actiions. */
|
||||
/* If the event handler does not exist anymore, then there is no need to perform further actions. */
|
||||
sendResponse(global.DEFAULT_OK_RESPONSE)
|
||||
return
|
||||
}
|
||||
@@ -115,7 +112,7 @@
|
||||
eventHandler.stopListening(command.eventHandlerName, command.eventType, command.callerId, command.eventSubscriptionId)
|
||||
|
||||
/*
|
||||
We check here if there are no more listeners and the event handler original emmiter is also gone, then we need to delete
|
||||
We check here if there are no more listeners and the event handler original emitter is also gone, then we need to delete
|
||||
this event handlers since chances are that is not needed anymore.
|
||||
*/
|
||||
if (eventHandler.listeners.length === 0 && eventHandler.deleteWhenAllListenersAreGone === true) {
|
||||
@@ -133,7 +130,7 @@
|
||||
eventHandler = newEventHandler()
|
||||
eventHandlers.set(command.eventHandlerName, eventHandler)
|
||||
|
||||
/* No matter if it is the listener or the emiter the one that acts first, if an event handler does not exist we just create it acan keep it there. */
|
||||
/* No matter if it is the listener or the emitter the one that acts first, if an event handler does not exist we just create it and keep it there. */
|
||||
|
||||
}
|
||||
//console.log("[INFO] Client -> Events Server -> Raising Event " + command.eventHandlerName + " " + command.eventType)
|
||||
@@ -166,7 +163,7 @@
|
||||
let thisObject = {
|
||||
name: undefined, // This is for debugging purposes only.
|
||||
deleteWhenAllListenersAreGone: false,
|
||||
listeners: [], // Here we store all the functions we will call when an event is raiseed.
|
||||
listeners: [], // Here we store all the functions we will call when an event is raised.
|
||||
listenToEvent: listenToEvent,
|
||||
stopListening: stopListening,
|
||||
raiseEvent: raiseEvent,
|
||||
@@ -184,7 +181,7 @@
|
||||
|
||||
/*
|
||||
We can not allow to have the exact same listener more than once. In case that we find a listener trying to listen again, the first record will
|
||||
be deleted and we are just going to consider the last one comming in.
|
||||
be deleted and we are just going to consider the last one coming in.
|
||||
*/
|
||||
for (let i = 0; i < thisObject.listeners.length; i++) {
|
||||
if (eventHandlerName === thisObject.listeners[i][0] && eventType === thisObject.listeners[i][1] && callerId === thisObject.listeners[i][2]) {
|
||||
|
||||
@@ -79,7 +79,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
userAgent: 'Superalgos Beta 11'
|
||||
userAgent: 'Superalgos Beta 12'
|
||||
})
|
||||
await getList()
|
||||
|
||||
@@ -207,7 +207,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
const { Octokit } = SA.nodeModules.octokit
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
userAgent: 'Superalgos Beta 11'
|
||||
userAgent: 'Superalgos Beta 12'
|
||||
})
|
||||
await getPrList()
|
||||
await mergePrs()
|
||||
@@ -295,7 +295,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
let fileContent // File content of the only file at the PR
|
||||
let userProfile // User Profile Object
|
||||
let githubUsername // The Github user name of who is submitting the Pull Request
|
||||
let mergeResponse // The response received from the call to Gihub to merge the Pull Request
|
||||
let mergeResponse // The response received from the call to Github to merge the Pull Request
|
||||
|
||||
if (await validatePrHasMoreThanOneFile() === false) { continue }
|
||||
if (await validateFileNameEqualsGithubUsername() === false) { continue }
|
||||
@@ -310,13 +310,13 @@ exports.newGithubServer = function newGithubServer() {
|
||||
if (await mergePullRequest() === false) {
|
||||
console.log('[WARN] Github Server -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.data.message)
|
||||
} else {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message)
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Merge Succeed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message)
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
await octokit.rest.issues.createComment({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: pullRequest.number,
|
||||
body: 'This Pull Request was automatically merged by the Superalgos Governance System because it was detected that the Github User " ' + githubUsername + '" who submitted it, modified its own User Profile Plugin File and nothning else but that file. All validations were successfull.'
|
||||
body: 'This Pull Request was automatically merged by the Superalgos Governance System because it was detected that the Github User " ' + githubUsername + '" who submitted it, modified its own User Profile Plugin File and nothing else but that file. All validations were successful.'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: pullRequest.number,
|
||||
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (filesChanged.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged.'
|
||||
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (filesChanged.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged. \n\n If you intentionally submitted the extra files, the way to get your work merged is by first removing your User Profile file from the Plugins folder at your local installation and executing an app.contribute again. Then wait until the PR is merged (manually reviewed) and after that you put your User Profile file again and create a new PR only with that file with an app.contribute. That last PR should be merged automatically.'
|
||||
});
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -378,7 +378,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
fileName = splittedFileName[0]
|
||||
githubUsername = pullRequest.user.login
|
||||
|
||||
if (githubUsername !== fileName) {
|
||||
if (githubUsername.toLowerCase() !== fileName.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the File Name. -> Github Username = ' + githubUsername + '-> fileName = ' + fileName)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -420,7 +420,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
*/
|
||||
let config = JSON.parse(userProfile.config)
|
||||
let messageSigned = config.signature.message
|
||||
if (messageSigned !== githubUsername) {
|
||||
if (messageSigned.toLowerCase() !== githubUsername.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Message Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -480,7 +480,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
/*
|
||||
Validation #6: The name of the User Profile node is not the Github Username.
|
||||
*/
|
||||
if (userProfile.name !== githubUsername) {
|
||||
if (userProfile.name.toLowerCase() !== githubUsername.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #6 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the User Profile node\'s name. -> Github Username = ' + githubUsername + '-> userProfile.name = ' + userProfile.name)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -508,14 +508,14 @@ exports.newGithubServer = function newGithubServer() {
|
||||
unless the existing one belongs to the same Github username.
|
||||
*/
|
||||
let userProfileIdMap = new Map()
|
||||
let pluginFileNames = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
|
||||
let pluginFileNames = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
|
||||
'Governance',
|
||||
'User-Profiles'
|
||||
)
|
||||
for (let i = 0; i < pluginFileNames.length; i++) {
|
||||
let pluginFileName = pluginFileNames[i]
|
||||
|
||||
let pluginFileContent = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
|
||||
let pluginFileContent = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
'Governance',
|
||||
'User-Profiles',
|
||||
pluginFileName
|
||||
@@ -558,13 +558,13 @@ exports.newGithubServer = function newGithubServer() {
|
||||
unless the existing one belongs to the same Github username.
|
||||
*/
|
||||
let userProfileIdMap = new Map()
|
||||
let pluginFileNames = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
|
||||
let pluginFileNames = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
|
||||
'Governance',
|
||||
'User-Profiles'
|
||||
)
|
||||
for (let i = 0; i < pluginFileNames.length; i++) {
|
||||
let pluginFileName = pluginFileNames[i]
|
||||
let pluginFileContent = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
|
||||
let pluginFileContent = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
'Governance',
|
||||
'User-Profiles',
|
||||
pluginFileName
|
||||
@@ -628,7 +628,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
*/
|
||||
let messageSigned = config.signature.message
|
||||
|
||||
if (messageSigned !== githubUsername) {
|
||||
if (messageSigned.toLowerCase() !== githubUsername.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #9 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. -> messageSigned = ' + messageSigned + '-> githubUsername = ' + githubUsername)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -743,7 +743,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: pullRequest.number,
|
||||
body: 'Hi, this is the Superalgos Governance System taking notice that you have submitted a pull request directly to the master branch.\n\nThanks for submitting a PR to the Superalgos Project. We value every contribution and everyone is welcome to send PRs. Unfortunatelly we are not merging pull requests directly into the master branch. Consider resubmitting to the develop branch intstead. For your convinienve, you can swithch branches from within the app, at the footer of the Docs tab. \n\n I will close this pull request now and look forward for your next contribution either to the develop branch or any other branch available for this purpose.'
|
||||
body: 'Hi, this is the Superalgos Governance System taking notice that you have submitted a pull request directly to the master branch.\n\nThanks for submitting a PR to the Superalgos Project. We value every contribution and everyone is welcome to send PRs. Unfortunately we are not merging pull requests directly into the master branch. Consider resubmitting to the develop branch instead. For your convenience, you can switch branches from within the app, at the footer of the Docs tab. \n\n I will close this pull request now and look forward for your next contribution either to the develop branch or any other branch available for this purpose.'
|
||||
});
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -775,6 +775,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
if (err === undefined) { return }
|
||||
console.log('[ERROR] Github Server -> mergeGithubPullRequests -> doGithub -> err.stack = ' + err.stack)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,16 +20,20 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
webhook = undefined
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
function initialize(initialWorkspace) {
|
||||
/*
|
||||
We will create an HTTP Server and leave it running forever.
|
||||
*/
|
||||
SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.CLIENT_HTTP_INTERFACE_PORT)
|
||||
SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.PLATFORM_HTTP_INTERFACE_PORT)
|
||||
/* Starting the browser now is optional */
|
||||
if (process.argv.includes("noBrowser")) {
|
||||
//Running Client only with no UI.
|
||||
} else {
|
||||
SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT)
|
||||
let queryString = ''
|
||||
if (initialWorkspace.name !== undefined) {
|
||||
queryString = '/?initialWorkspaceName=' + initialWorkspace.name + '&initialWorkspaceProject=' + initialWorkspace.project + '&initialWorkspaceType=' + initialWorkspace.type
|
||||
}
|
||||
SA.nodeModules.open('http://localhost:' + global.env.PLATFORM_HTTP_INTERFACE_PORT + queryString)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +44,11 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
let endpointOrFile = requestPath[1]
|
||||
|
||||
switch (endpointOrFile) {
|
||||
|
||||
case 'Environment':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.env), httpResponse)
|
||||
}
|
||||
break
|
||||
case 'WEB3':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
|
||||
@@ -244,7 +252,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
}
|
||||
|
||||
console.log('[INFO] httpInterface -> Webhook -> Fetch-Messages -> Exchange-Market = ' + exchange + '-' + market)
|
||||
console.log('[INFO] httpInterface -> Webhook -> Fetch-Messages -> Messeges Fetched by Webhooks Sensor Bot = ' + webhookMessages.length)
|
||||
console.log('[INFO] httpInterface -> Webhook -> Fetch-Messages -> Messages Fetched by Webhooks Sensor Bot = ' + webhookMessages.length)
|
||||
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(webhookMessages), httpResponse)
|
||||
webhookMessages = []
|
||||
@@ -292,7 +300,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
|
||||
console.log('[INFO] httpInterface -> Webhook -> New-Message -> Exchange-Market = ' + exchange + '-' + market)
|
||||
console.log('[INFO] httpInterface -> Webhook -> New-Message -> messageReceived = ' + messageReceived)
|
||||
console.log('[INFO] httpInterface -> Webhook -> New-Message -> Messeges waiting to be Fetched by Webhooks Sensor Bot = ' + webhookMessages.length)
|
||||
console.log('[INFO] httpInterface -> Webhook -> New-Message -> Messages waiting to be Fetched by Webhooks Sensor Bot = ' + webhookMessages.length)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
|
||||
}
|
||||
break
|
||||
@@ -594,7 +602,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
|
||||
function createNewDir(path) {
|
||||
try {
|
||||
fs.mkdirSync(path)
|
||||
fs.mkdirSync(path, {recursive: true})
|
||||
} catch (err) {
|
||||
if (err.message.indexOf('file already exists') < 0) {
|
||||
throw (err)
|
||||
@@ -631,7 +639,13 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
break
|
||||
case 'App':
|
||||
{
|
||||
// If running the electron app do not try to get git tool. I don't allow it.
|
||||
if (process.env.SA_MODE === 'gitDisable') {
|
||||
console.log('[WARN] No contributions on binary distributions. Do manual installation')
|
||||
break
|
||||
}
|
||||
switch (requestPath[2]) { // switch by command
|
||||
|
||||
case 'Contribute': {
|
||||
try {
|
||||
let commitMessage = unescape(requestPath[3])
|
||||
@@ -641,7 +655,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
const contributionsBranch = unescape(requestPath[7])
|
||||
let error
|
||||
|
||||
/* Unsavping # */
|
||||
/* Unsaving # */
|
||||
for (let i = 0; i < 10; i++) {
|
||||
commitMessage = commitMessage.replace('_SLASH_', '/')
|
||||
commitMessage = commitMessage.replace('_HASHTAG_', '#')
|
||||
@@ -709,7 +723,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> contributionsBranch = ' + contributionsBranch)
|
||||
console.log('')
|
||||
console.log('Torubleshooting Tips:')
|
||||
console.log('Troubleshooting Tips:')
|
||||
console.log('')
|
||||
console.log('1. Make sure that you have set up your Github Username and Token at the APIs -> Github API node at the workspace.')
|
||||
console.log('2. Make sure you are running the latest version of Git available for your OS.')
|
||||
@@ -725,7 +739,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
userAgent: 'Superalgos Beta 11'
|
||||
userAgent: 'Superalgos Beta 12'
|
||||
})
|
||||
|
||||
const repo = 'Superalgos'
|
||||
@@ -864,6 +878,9 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
await doGit()
|
||||
|
||||
if (error === undefined) {
|
||||
// Run node setup to prepare instance for branch change
|
||||
await runNodeSetup()
|
||||
// Return to UI that Branch is successfully changed
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
|
||||
} else {
|
||||
let docs = {
|
||||
@@ -889,6 +906,27 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
const git = simpleGit(options)
|
||||
try {
|
||||
await git.checkout(currentBranch)
|
||||
|
||||
// Check to see it main repo has been set as upstream
|
||||
let remotes = await git.getRemotes();
|
||||
let isUpstreamSet
|
||||
for (let remote in remotes) {
|
||||
if (remotes[remote].name === 'upstream') {
|
||||
isUpstreamSet = true
|
||||
} else {
|
||||
isUpstreamSet = false
|
||||
}
|
||||
}
|
||||
// If upstream has not been set. Set it now
|
||||
if (isUpstreamSet === false) {
|
||||
await git.addRemote('upstream', 'https://github.com/Superalgos/Superalgos');
|
||||
}
|
||||
// Pull branch from main repo
|
||||
await git.pull('upstream', currentBranch);
|
||||
// Reset branch to match main repo
|
||||
let upstreamLocation = `upstream/${currentBranch}`
|
||||
await git.reset('hard', [upstreamLocation])
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] Error changing current branch to ' + currentBranch)
|
||||
console.log(err.stack)
|
||||
@@ -896,6 +934,21 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
}
|
||||
}
|
||||
|
||||
async function runNodeSetup() {
|
||||
console.log("Running Node setup to adjust for new Branch")
|
||||
const process = SA.nodeModules.process
|
||||
const childProcess = SA.nodeModules.childProcess
|
||||
|
||||
let dir = process.cwd()
|
||||
let command = "node setup noShortcuts";
|
||||
let stdout = childProcess.execSync(command,
|
||||
{
|
||||
cwd: dir
|
||||
}).toString();
|
||||
|
||||
console.log("Node Setup has completed with the following result:", stdout)
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> App -> Update -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> App -> Update -> err.stack = ' + err.stack)
|
||||
@@ -971,6 +1024,148 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
case 'FixAppSchema': {
|
||||
/*
|
||||
We will use this process when we have moved APP SCHEMA files from one project to another, and we need to fix the
|
||||
actions where this node was referenced, so that it points to the new project where the node has moved to.
|
||||
*/
|
||||
let customResponse = {
|
||||
result: global.CUSTOM_OK_RESPONSE.result,
|
||||
message: ''
|
||||
}
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(customResponse), httpResponse)
|
||||
|
||||
console.log('Fixing App Schemas...')
|
||||
|
||||
let projects = SA.projects.foundations.utilities.filesAndDirectories.getDirectories(global.env.PATH_TO_PROJECTS)
|
||||
let PROJECTS_MAP = new Map()
|
||||
let directoryCount = 0
|
||||
let allAppSchemas = []
|
||||
let allAppSchemasFilePaths = []
|
||||
let allAppSchemasFileProjects = []
|
||||
|
||||
for (let i = 0; i < projects.length; i++) {
|
||||
let project = projects[i]
|
||||
|
||||
|
||||
|
||||
const fs = SA.nodeModules.fs
|
||||
let folder = 'App-Schema'
|
||||
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/'
|
||||
SA.projects.foundations.utilities.filesAndDirectories.getAllFilesInDirectoryAndSubdirectories(filePath + folder, onFilesReady)
|
||||
|
||||
function onFilesReady(files) {
|
||||
try {
|
||||
let SCHEMA_MAP = new Map()
|
||||
|
||||
console.log('files.length... ' + files.length)
|
||||
|
||||
for (let k = 0; k < files.length; k++) {
|
||||
let name = files[k]
|
||||
let nameSplitted = name.split(folder)
|
||||
let fileName = nameSplitted[1]
|
||||
for (let i = 0; i < 10; i++) {
|
||||
fileName = fileName.replace('\\', '/')
|
||||
}
|
||||
let fileToRead = filePath + folder + fileName
|
||||
|
||||
console.log('Reading file... ' + fileToRead)
|
||||
|
||||
let fileContent = fs.readFileSync(fileToRead)
|
||||
let schemaDocument
|
||||
try {
|
||||
schemaDocument = JSON.parse(fileContent)
|
||||
SCHEMA_MAP.set(schemaDocument.type, schemaDocument)
|
||||
allAppSchemas.push(schemaDocument)
|
||||
allAppSchemasFilePaths.push(fileToRead)
|
||||
allAppSchemasFileProjects.push(project)
|
||||
} catch (err) {
|
||||
console.log('[ERROR] sendSchema -> Error Parsing JSON File: ' + fileToRead + ' .Error = ' + err.stack)
|
||||
return
|
||||
}
|
||||
}
|
||||
PROJECTS_MAP.set(project, SCHEMA_MAP)
|
||||
directoryCount++
|
||||
|
||||
console.log('directoryCount = ' + directoryCount, 'projects.length = ' + projects.length)
|
||||
//console.log(Array.from(PROJECTS_MAP.get(project).keys()))
|
||||
if (directoryCount === projects.length) {
|
||||
fixSchemas()
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fixSchemas() {
|
||||
try {
|
||||
console.log('fixSchemas...' + allAppSchemas.length)
|
||||
let projects = SA.projects.foundations.utilities.filesAndDirectories.getDirectories(global.env.PATH_TO_PROJECTS)
|
||||
const fs = SA.nodeModules.fs
|
||||
let needFixing = 0
|
||||
for (let i = 0; i < allAppSchemas.length; i++) {
|
||||
let schemaDocument = allAppSchemas[i]
|
||||
let wasUpdated = false
|
||||
for (let j = 0; j < schemaDocument.menuItems.length; j++) {
|
||||
let menuItem = schemaDocument.menuItems[j]
|
||||
if (menuItem.relatedUiObject !== undefined && menuItem.relatedUiObjectProject === undefined) {
|
||||
needFixing++
|
||||
|
||||
let hits = 0
|
||||
let foundProject
|
||||
let multiProject = ''
|
||||
for (let k = 0; k < projects.length; k++) {
|
||||
let project = projects[k]
|
||||
|
||||
let testDocument = PROJECTS_MAP.get(project).get(menuItem.relatedUiObject)
|
||||
if (testDocument !== undefined) {
|
||||
hits++
|
||||
foundProject = project
|
||||
multiProject = multiProject + ' -> ' + project
|
||||
|
||||
let fileProject = allAppSchemasFileProjects[i]
|
||||
//console.log(fileProject, project)
|
||||
if (fileProject === project) {
|
||||
/* If the project of the file is the same as the project found, then we consider this a match*/
|
||||
hits = 1
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hits === 0) {
|
||||
console.log('Problem With No Solution #' + needFixing, ' Type: ' + schemaDocument.type, ' Action: ' + menuItem.action, ' Related UI Object: ' + menuItem.relatedUiObject)
|
||||
console.log('This Node Type was NOT FOUND at any project. ' + menuItem.relatedUiObject)
|
||||
continue
|
||||
}
|
||||
if (hits === 1) {
|
||||
console.log('Problem With One Solution #' + needFixing, ' Type: ' + schemaDocument.type, ' Action: ' + menuItem.action, ' Related UI Object: ' + menuItem.relatedUiObject, ' Found Project:' + foundProject)
|
||||
|
||||
menuItem.relatedUiObjectProject = foundProject
|
||||
wasUpdated = true
|
||||
continue
|
||||
}
|
||||
console.log('Problem With MULTIPLE Solutions #' + needFixing, ' Type: ' + schemaDocument.type, ' Action: ' + menuItem.action, ' Related UI Object: ' + menuItem.relatedUiObject, ' Found at these Projects:' + multiProject)
|
||||
}
|
||||
}
|
||||
|
||||
if (wasUpdated === true) {
|
||||
let fileContent = JSON.stringify(schemaDocument, undefined, 4)
|
||||
let filePath = allAppSchemasFilePaths[i]
|
||||
//console.log('Saving File at ' + filePath)
|
||||
//console.log(fileContent)
|
||||
//fs.writeFileSync(filePath, fileContent)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err.stack)
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
function respondWithDocsObject(docs, error) {
|
||||
@@ -1078,6 +1273,200 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
case 'UserProfile': {
|
||||
try {
|
||||
|
||||
let mess = unescape(params.commitMessage)
|
||||
const username = unescape(params.username)
|
||||
const token = unescape(params.token)
|
||||
const currentBranch = unescape(params.currentBranch)
|
||||
const contributionsBranch = unescape(params.contributionsBranch)
|
||||
|
||||
let error
|
||||
|
||||
await updateUser()
|
||||
|
||||
async function updateUser() {
|
||||
|
||||
await doGithubUser()
|
||||
if (error !== undefined) {
|
||||
|
||||
let docs = {
|
||||
project: 'Governance',
|
||||
category: 'Topic',
|
||||
type: 'Gov Error - Contribution Not Sent',
|
||||
anchor: undefined,
|
||||
placeholder: {}
|
||||
}
|
||||
console.log('respond with docs ')
|
||||
|
||||
respondWithDocsObject(docs, error)
|
||||
return
|
||||
}
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
|
||||
|
||||
}
|
||||
|
||||
async function doGithubUser() {
|
||||
|
||||
const { Octokit } = SA.nodeModules.octokit
|
||||
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
userAgent: 'Superalgos Beta 12'
|
||||
})
|
||||
|
||||
const repo = 'Superalgos'
|
||||
const owner = 'Superalgos'
|
||||
const head = username + ':' + contributionsBranch
|
||||
const base = currentBranch
|
||||
const title = 'Contribution: ' + mess
|
||||
const path = 'Projects/Governance/Plugins/User-Profiles/' + username + '.json' ;
|
||||
|
||||
const sha = await getSHA(path);
|
||||
|
||||
if (sha === undefined){
|
||||
console.log('***** Abort GOV.USERPROFILE *****')
|
||||
return
|
||||
}
|
||||
|
||||
let file = await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
'Governance',
|
||||
'User-Profiles',
|
||||
username + '.json'
|
||||
)
|
||||
|
||||
let buff = new Buffer.from(file, 'utf-8');
|
||||
let encodedFile = buff.toString('base64');
|
||||
|
||||
try {
|
||||
await octokit.repos.createOrUpdateFileContents({
|
||||
owner: username,
|
||||
repo: "Superalgos",
|
||||
path,
|
||||
message: title,
|
||||
content: encodedFile,
|
||||
sha,
|
||||
branch: base
|
||||
});
|
||||
} catch (err) {
|
||||
if (err.stack.indexOf('Error User Commit') >= 0) {
|
||||
return
|
||||
} else {
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> commitMessage = ' + mess)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> contributionsBranch = ' + contributionsBranch)
|
||||
error = err
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await octokit.pulls.create({
|
||||
owner,
|
||||
repo,
|
||||
title,
|
||||
head,
|
||||
base,
|
||||
});
|
||||
} catch (err) {
|
||||
if (err.stack.indexOf('A pull request already exists') >= 0) {
|
||||
return
|
||||
} else {
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> commitMessage = ' + mess)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> contributionsBranch = ' + contributionsBranch)
|
||||
error = err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async function getSHA(path) {
|
||||
let sha = ''
|
||||
const { graphql } = SA.nodeModules.graphql
|
||||
|
||||
try{
|
||||
|
||||
const { repository } = await graphql(
|
||||
'{ ' +
|
||||
' repository(name: "SuperAlgos", owner: "' + username + '") {' +
|
||||
' object(expression: "develop:' + path +'") {' +
|
||||
' ... on Blob {' +
|
||||
' oid' +
|
||||
' }' +
|
||||
' }' +
|
||||
' name' +
|
||||
' }' +
|
||||
'}',
|
||||
{
|
||||
headers: {
|
||||
authorization: 'token ' + token
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
if (repository.name === undefined){
|
||||
console.log('***** Token permission needed : User:READ *****')
|
||||
sha = undefined
|
||||
error = '***** Token permission needed : User:READ *****'
|
||||
return sha
|
||||
}
|
||||
|
||||
if(repository.object === null ){
|
||||
console.log("[User Not Found] -> Creating new user")
|
||||
return sha
|
||||
}
|
||||
sha = repository.object.oid
|
||||
return sha
|
||||
|
||||
} catch (err) {
|
||||
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> commitMessage = ' + mess)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> doGithub -> contributionsBranch = ' + contributionsBranch)
|
||||
return sha
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> commitMessage = ' + mess)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> Gov -> contributeUserProfile -> contributionsBranch = ' + contributionsBranch)
|
||||
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
message: err.message,
|
||||
stack: err.stack
|
||||
}
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(error), httpResponse)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
case 'payContributors': {
|
||||
console.log('----------------------------------------------------------------------------------------------')
|
||||
console.log('DISTRIBUTION PROCESS STARTED')
|
||||
@@ -1120,17 +1509,17 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
break
|
||||
case 'LegacyPlotter.js':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/LegacyPlotter.js', httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/LegacyPlotter.js', httpResponse)
|
||||
}
|
||||
break
|
||||
case 'PlotterPanel.js':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/PlotterPanel.js', httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/PlotterPanel.js', httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Images': // This means the Images folder.
|
||||
{
|
||||
let path = global.env.PATH_TO_CLIENT + '/WebServer/Images/' + requestPath[2]
|
||||
let path = global.env.PATH_TO_PLATFORM + '/WebServer/Images/' + requestPath[2]
|
||||
|
||||
if (requestPath[3] !== undefined) {
|
||||
path = path + '/' + requestPath[3]
|
||||
@@ -1212,12 +1601,12 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
break
|
||||
case 'WebServer': // This means the WebServer folder.
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/' + requestPath[2], httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'externalScripts': // This means the WebServer folder.
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/WebServer/externalScripts/' + requestPath[2], httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/WebServer/externalScripts/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Plotters': // This means the plotter folder, not to be confused with the Plotters script!
|
||||
@@ -1232,12 +1621,12 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
break
|
||||
case 'ChartLayers':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/UI/' + endpointOrFile + '/' + requestPath[2], httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/UI/' + endpointOrFile + '/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Files':
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_CLIENT + '/UI/Data-Files/' + requestPath[2], httpResponse)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithFile(global.env.PATH_TO_PLATFORM + '/UI/Data-Files/' + requestPath[2], httpResponse)
|
||||
}
|
||||
break
|
||||
case 'Fonts':
|
||||
@@ -1388,10 +1777,12 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
let project = unescape(requestPath[2])
|
||||
let folder = unescape(requestPath[3])
|
||||
|
||||
let response = await SA.projects.foundations.utilities.plugins.getPluginFileNames(
|
||||
let response = await SA.projects.communityPlugins.utilities.plugins.getPluginFileNames(
|
||||
project,
|
||||
folder
|
||||
)
|
||||
).catch(err => {
|
||||
console.log('[ERROR] httpInterface -> PluginFileNames -> err.stack = ' + err.stack)
|
||||
})
|
||||
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(response), httpResponse)
|
||||
|
||||
@@ -1420,25 +1811,28 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
let folder = unescape(requestPath[3])
|
||||
let fileName = unescape(requestPath[4])
|
||||
|
||||
/*Beta 12 Refactoring Code: Remove this before realeasing beta 12.*/
|
||||
/*Beta 12 Refactoring Code: Remove this before releasing beta 12.*/
|
||||
if (fileName === 'Superalgos-CL.json') {
|
||||
fileName = 'Superalgos-PL.json'
|
||||
}
|
||||
|
||||
let response = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
|
||||
await SA.projects.communityPlugins.utilities.plugins.getPluginFileContent(
|
||||
project,
|
||||
folder,
|
||||
fileName
|
||||
).catch(err => {
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
message: err
|
||||
)
|
||||
.then(response => {
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(response, httpResponse)
|
||||
}
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(error), httpResponse)
|
||||
return
|
||||
})
|
||||
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(response, httpResponse)
|
||||
)
|
||||
.catch(err => {
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
message: err
|
||||
}
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(error), httpResponse)
|
||||
return
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> LoadPlugin -> Method call produced an error.')
|
||||
@@ -1609,7 +2003,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
|
||||
/* Create Dir if it does not exist */
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir);
|
||||
fs.mkdirSync(dir, {recursive: true});
|
||||
}
|
||||
|
||||
fs.writeFile(filePath, fileContent, onFileWritten)
|
||||
@@ -1747,7 +2141,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
break
|
||||
default:
|
||||
{
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_CLIENT)
|
||||
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_PLATFORM)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
//console.log('[INFO] Client -> Task Manager Server -> runTask -> Task Name = ' + message.event.taskName)
|
||||
//console.log('[INFO] Client -> Task Manager Server -> runTask -> Task Id = ' + message.event.taskId)
|
||||
|
||||
let path = './TaskServerRoot.js'
|
||||
let path = global.env.BASE_PATH + '/TaskServerRoot.js'
|
||||
|
||||
/* Workarround to avoid having the same debug port at the forked process which makes it crash. */
|
||||
/* Workaround to avoid having the same debug port at the forked process which makes it crash. */
|
||||
for (let i = 0; i < process.execArgv.length; i++) {
|
||||
let argument = process.execArgv[i]
|
||||
if (argument.indexOf('--inspect') > -1) {
|
||||
@@ -94,7 +94,7 @@
|
||||
console.log(`[ERROR] Client -> Task Manager Server -> runTask -> Task Server exited with error ${err}`)
|
||||
tasksMap.delete(task.id)
|
||||
})
|
||||
/* If the Tast Server stops, we remove it from our task map */
|
||||
/* If the Task Server stops, we remove it from our task map */
|
||||
task.childProcess.on('close', (code, signal) => {
|
||||
//console.log('[INFO] Client -> Task Manager Server -> runTask -> Task Terminated. -> Task Name = ' + task.name)
|
||||
//console.log('[INFO] Client -> Task Manager Server -> runTask -> Task Terminated. -> Task Id = ' + task.id)
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
|
||||
function finalize() {
|
||||
/* Before disconnecting we will forze all eventListeners to stop listening. */
|
||||
/* Before disconnecting we will force all eventListeners to stop listening. */
|
||||
const eventListenersArray = [...eventListeners.values()]
|
||||
for (let i = 0; i < eventListenersArray.length; i++) {
|
||||
let handler = eventListenersArray[i]
|
||||
|
||||
@@ -290,7 +290,7 @@ exports.newWeb3Server = function newWeb3Server() {
|
||||
console.log('----------------------------------------------------------------------------------------------')
|
||||
|
||||
for (let i = 0; i < paymentsArray.length; i++) {
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(10000)
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(15000)
|
||||
let payment = paymentsArray[i]
|
||||
await sendTokens(
|
||||
i + 1,
|
||||
@@ -360,11 +360,13 @@ exports.newWeb3Server = function newWeb3Server() {
|
||||
transaction.sign(privateKeyBuffer)
|
||||
|
||||
console.log('Transaction:', rawTransaction)
|
||||
const result = await web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex'))
|
||||
let result
|
||||
|
||||
result = await web3.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex'))
|
||||
.catch(err => {
|
||||
console.log('[ERROR] sendSignedTransaction -> err =' + JSON.stringify(err))
|
||||
})
|
||||
|
||||
|
||||
console.log('Result:', result)
|
||||
return result
|
||||
} catch (err) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
const WEB_SOCKET = SA.nodeModules.ws
|
||||
let socketServer
|
||||
let port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
|
||||
let port = global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -36,13 +36,42 @@
|
||||
|
||||
socket.on('message', onMenssage)
|
||||
|
||||
function onMenssage(message){
|
||||
function onMenssage(message) {
|
||||
|
||||
try {
|
||||
if (LOG_INFO === true) {
|
||||
console.log('Message Received: ' + message.substring(0, 1000))
|
||||
if (global.env.DEMO_MODE === true) {
|
||||
/*
|
||||
In DEMO MODE we will accept Task / Sessions Running or Stopping if you are requesting this from localhost only.
|
||||
*/
|
||||
if (socket._socket.remoteAddress !== "::1") {
|
||||
if (
|
||||
message.toString().indexOf('"eventType":"Run Task"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Stop Task"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Run Trading Session"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Stop Trading Session"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Resume Trading Session"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Run Learning Session"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Stop Learning Session"') >= 0
|
||||
||
|
||||
message.toString().indexOf('"eventType":"Resume Learning Session"') >= 0
|
||||
) {
|
||||
console.log('Trying to execute a Task while in DEMO MODE. Some hacking has taken place!')
|
||||
console.log('Hacker IP Address is: ' + socket._socket.remoteAddress)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
console.log('Message Received: ' + message.toString().substring(0, 10000))
|
||||
}
|
||||
|
||||
let messageArray = message.toString().split('|*|')
|
||||
|
||||
let origin = messageArray[0]
|
||||
|
||||
@@ -6,7 +6,7 @@ exports.newPlatformApp = function newPlatformApp() {
|
||||
|
||||
return thisObject
|
||||
|
||||
async function run() {
|
||||
async function run(initialWorkspace) {
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
if (err.message && err.message.indexOf("EADDRINUSE") > 0) {
|
||||
@@ -20,7 +20,7 @@ exports.newPlatformApp = function newPlatformApp() {
|
||||
})
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
// Signal user that a necissary node module is missing
|
||||
// Signal user that a necessary node module is missing
|
||||
if (reason.code == 'MODULE_NOT_FOUND') {
|
||||
console.log("[ERROR] Dependency library not found. Please try running the 'node setup' command and then restart the Superalgos Platform Client.")
|
||||
console.log('[ERROR] Platform App -> reason = ' + JSON.stringify(reason))
|
||||
@@ -133,17 +133,16 @@ exports.newPlatformApp = function newPlatformApp() {
|
||||
console.log('')
|
||||
console.log('SUPERALGOS PLATFORM CLIENT INTERFACES:')
|
||||
console.log('')
|
||||
|
||||
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface()
|
||||
WEB_SOCKETS_INTERFACE.initialize()
|
||||
console.log('Web Sockets Interface ....................................... Listening at port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
|
||||
console.log('Web Sockets Interface ....................................... Listening at port ' + global.env.PLATFORM_WEB_SOCKETS_INTERFACE_PORT)
|
||||
|
||||
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface()
|
||||
HTTP_INTERFACE.initialize()
|
||||
console.log('Http Interface .............................................. Listening at port ' + global.env.CLIENT_HTTP_INTERFACE_PORT)
|
||||
HTTP_INTERFACE.initialize(initialWorkspace)
|
||||
console.log('Http Interface .............................................. Listening at port ' + global.env.PLATFORM_HTTP_INTERFACE_PORT)
|
||||
|
||||
console.log('')
|
||||
console.log("You are running Superalgos Beta 11")
|
||||
console.log("You are running Superalgos Beta 12")
|
||||
console.log('')
|
||||
console.log("What's new? These are the main new features in this version:")
|
||||
console.log('')
|
||||
|
||||
@@ -149,12 +149,12 @@ function newAnimation() {
|
||||
}
|
||||
}
|
||||
|
||||
/* We request the next frame to be drawn, and stablishing a loop */
|
||||
/* We request the next frame to be drawn, and establish a loop */
|
||||
|
||||
/* Use this code for full animation speed. */
|
||||
animationLoopHandle = window.requestAnimationFrame(animationLoop)
|
||||
|
||||
/* Use this code for max 10 frames per second animation speed, if the app is consumming too much of your CPU. */
|
||||
/* Use this code for max 10 frames per second animation speed, if the app is consuming too much of your CPU. */
|
||||
/*
|
||||
setTimeout(nextLoop, 100)
|
||||
function nextLoop () {
|
||||
|
||||
@@ -4,7 +4,7 @@ function newAppPostLoader() {
|
||||
const MODULE_NAME = 'Post Loader'
|
||||
const ERROR_LOG = true
|
||||
const logger = newWebDebugLog()
|
||||
|
||||
|
||||
|
||||
let thisObject = {
|
||||
start: start
|
||||
@@ -14,9 +14,18 @@ function newAppPostLoader() {
|
||||
|
||||
function start() {
|
||||
try {
|
||||
|
||||
|
||||
// autoSaveWhenClosingTheBrowser()
|
||||
setupProjectsSchema()
|
||||
setupEnvironment()
|
||||
|
||||
function setupEnvironment() {
|
||||
httpRequest(undefined, 'Environment', onResponse)
|
||||
|
||||
function onResponse(err, file) {
|
||||
UI.environment = JSON.parse(file)
|
||||
setupProjectsSchema()
|
||||
}
|
||||
}
|
||||
|
||||
function setupProjectsSchema() {
|
||||
httpRequest(undefined, 'ProjectsSchema', onResponse)
|
||||
|
||||
@@ -47,7 +47,7 @@ function loadSuperalgos() {
|
||||
loadDebugModule()
|
||||
|
||||
if ((browser.name !== "Chrome" && browser.name!=="Safari") || (browser.name === "Chrome" && parseInt(browser.version) < 85) || (browser.name === "Safari" && parseInt(browser.version) < 13)) {
|
||||
alert("Superalgos is officially supported on Google Chrome 85 or Safari 13.1 and above. Your browser version has been detected as potentially beneath this. If you continue you may experience some functionaility issues.\n\nDetected Browser: " + browser.name + "\nVersion: " + browser.version)
|
||||
alert("Superalgos is officially supported on Google Chrome 85 or Safari 13.1 and above. Your browser version has been detected as potentially beneath this. If you continue you may experience some functionality issues.\n\nDetected Browser: " + browser.name + "\nVersion: " + browser.version)
|
||||
}
|
||||
|
||||
function checkBrowserVersion () {
|
||||
@@ -131,7 +131,7 @@ function loadSuperalgos() {
|
||||
}
|
||||
}
|
||||
|
||||
/* And Finally, we start loading all the scripts we will inmediatelly need. */
|
||||
/* And Finally, we start loading all the scripts we will immediately need. */
|
||||
function loadModules() {
|
||||
let path = "AppLoader.js"
|
||||
REQUIREJS([path], onRequired)
|
||||
|
||||
+30
-12
@@ -172,7 +172,7 @@ function newCanvas() {
|
||||
spaceDefinitionDrawMap.set(spaceDefinition.animationDrawIndex, spaceDefinition)
|
||||
}
|
||||
|
||||
/* Build the maps that defines the secuence of execution of different events. */
|
||||
/* Build the maps that defines the sequence of execution of different events. */
|
||||
if (spaceDefinition.onMouseWheelIndex !== undefined) {
|
||||
projectInstance.events.onMouseWheelMap.set(spaceDefinition.onMouseWheelIndex, spaceInstance)
|
||||
}
|
||||
@@ -373,7 +373,7 @@ function newCanvas() {
|
||||
|
||||
if (EDITOR_ON_FOCUS === true) {
|
||||
/*
|
||||
We will fordward the event to whoever is
|
||||
We will forward the event to whoever is
|
||||
controlling the editor.
|
||||
*/
|
||||
if (window.editorController !== undefined) {
|
||||
@@ -485,6 +485,19 @@ function newCanvas() {
|
||||
return
|
||||
}
|
||||
|
||||
if (
|
||||
event.shiftKey === true &&
|
||||
(event.ctrlKey === true || event.metaKey === true) &&
|
||||
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.rescueFloatingObjectToMouse || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.rescueFloatingObjectToMouse.toLowerCase())
|
||||
|
||||
) {
|
||||
UI.projects.foundations.spaces.floatingSpace.rescueFloatingObjectToMouse(thisObject.mouse.position)
|
||||
if (event.preventDefault !== undefined) {
|
||||
event.preventDefault()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
let nodeOnFocus = await UI.projects.foundations.spaces.designSpace.workspace.getNodeThatIsOnFocus()
|
||||
if (nodeOnFocus !== undefined) {
|
||||
if (nodeOnFocus.payload.uiObject.codeEditor !== undefined) {
|
||||
@@ -502,6 +515,11 @@ function newCanvas() {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (nodeOnFocus.payload.uiObject.listSelector !== undefined) {
|
||||
if (nodeOnFocus.payload.uiObject.listSelector.visible === true) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (nodeOnFocus.payload.uiObject.conditionEditor !== undefined) {
|
||||
if (nodeOnFocus.payload.uiObject.conditionEditor.visible === true) {
|
||||
return
|
||||
@@ -637,7 +655,7 @@ function newCanvas() {
|
||||
if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true) {
|
||||
/* Shortcuts to nodes */
|
||||
if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 65 && event.keyCode <= 90)) {
|
||||
/* From here we prevent the default behaviour. Putting it earlier prevents imput box and text area to receive keystrokes */
|
||||
/* From here we prevent the default behaviour. Putting it earlier prevents input box and text area to receive keystrokes */
|
||||
event.preventDefault()
|
||||
let nodeUsingThisKey = await UI.projects.foundations.spaces.designSpace.workspace.getNodeByShortcutKey(event.key)
|
||||
|
||||
@@ -758,11 +776,11 @@ function newCanvas() {
|
||||
/*
|
||||
We will go through all the spaces defined at the project schema for each project
|
||||
and we are going to query each space to see if they have the container that is at
|
||||
the mouse position. We will order firt the spaces by the sequence order defined
|
||||
the mouse position. We will order first the spaces by the sequence order defined
|
||||
at the project schema specifically for this mouse event.
|
||||
|
||||
The order of the projects for events evaluations has intentionally been inverted,
|
||||
because the latest project is drwan the last, on top of the others, that means that
|
||||
because the latest project is drawn the last, on top of the others, that means that
|
||||
events should belong to the last first.
|
||||
*/
|
||||
for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) {
|
||||
@@ -868,11 +886,11 @@ function newCanvas() {
|
||||
/*
|
||||
We will go through all the spaces defined at the project schema for each project
|
||||
and we are going to query each space to see if they have the container that is at
|
||||
the mouse position. We will order firt the spaces by the sequence order defined
|
||||
the mouse position. We will order first the spaces by the sequence order defined
|
||||
at the project schema specifically for this mouse event.
|
||||
|
||||
The order of the projects for events evaluations has intentionally been inverted,
|
||||
because the latest project is drwan the last, on top of the others, that means that
|
||||
because the latest project is drawn the last, on top of the others, that means that
|
||||
events should belong to the last first.
|
||||
*/
|
||||
for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) {
|
||||
@@ -979,18 +997,18 @@ function newCanvas() {
|
||||
return
|
||||
}
|
||||
|
||||
/* Then we check who is the current object underneeth the mounse. */
|
||||
/* Then we check who is the current object underneath the mouse. */
|
||||
|
||||
let container
|
||||
|
||||
/*
|
||||
We will go through all the spaces defined at the project schema for each project
|
||||
and we are going to query each space to see if they have the container that is at
|
||||
the mouse position. We will order firt the spaces by the sequence order defined
|
||||
the mouse position. We will order first the spaces by the sequence order defined
|
||||
at the project schema specifically for this mouse event.
|
||||
|
||||
The order of the projects for events evaluations has intentionally been inverted,
|
||||
because the latest project is drwan the last, on top of the others, that means that
|
||||
because the latest project is drawn the last, on top of the others, that means that
|
||||
events should belong to the last first.
|
||||
*/
|
||||
for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) {
|
||||
@@ -1050,11 +1068,11 @@ function newCanvas() {
|
||||
/*
|
||||
We will go through all the spaces defined at the project schema for each project
|
||||
and we are going to query each space to see if they have the container that is at
|
||||
the mouse position. We will order firt the spaces by the sequence order defined
|
||||
the mouse position. We will order first the spaces by the sequence order defined
|
||||
at the project schema specifically for this mouse event.
|
||||
|
||||
The order of the projects for events evaluations has intentionally been inverted,
|
||||
because the latest project is drwan the last, on top of the others, that means that
|
||||
because the latest project is drawn the last, on top of the others, that means that
|
||||
events should belong to the last first.
|
||||
*/
|
||||
for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) {
|
||||
|
||||
@@ -45,7 +45,7 @@ function newDailyFiles() {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize(pMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pDatetime, pTimeFrame, pHost, pPort, pEventsServerClient, callBackFunction) {
|
||||
function initialize(pMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, pDatetime, pTimeFrame, pHost, pPort, pEventsServerClient, callBackFunction, scheme='http') {
|
||||
try {
|
||||
callBackWhenFileReceived = callBackFunction
|
||||
|
||||
@@ -55,7 +55,7 @@ function newDailyFiles() {
|
||||
let timeFrames
|
||||
|
||||
fileCloud = newFileCloud()
|
||||
fileCloud.initialize(pBot, pHost, pPort)
|
||||
fileCloud.initialize(pBot, pHost, pPort, scheme)
|
||||
|
||||
/* Config Validations */
|
||||
if (pDataset.config.validTimeFrames === undefined) {
|
||||
|
||||
@@ -17,8 +17,8 @@ function newFileCloud () {
|
||||
let fileStorage
|
||||
return thisObject
|
||||
|
||||
function initialize (pBot, pHost, pPort) {
|
||||
fileStorage = newFileStorage(pHost, pPort)
|
||||
function initialize (pBot, pHost, pPort, scheme='http') {
|
||||
fileStorage = newFileStorage(pHost, pPort, scheme)
|
||||
}
|
||||
|
||||
function getFile (pMine, pBot, pSession, pProduct, pDataset, pExchange, pMarket, ptimeFrameLabel, pDatetime, pSequence, pDataRange, pTimeFrames, callBackFunction) {
|
||||
@@ -77,7 +77,7 @@ function newFileCloud () {
|
||||
}
|
||||
|
||||
if (fileName === undefined) {
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> Inconsistant data. Check the following: ')
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> Inconsistent data. Check the following: ')
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> pMine = ' + JSON.stringify(pMine))
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> pBot = ' + JSON.stringify(pBot))
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> pDataset = ' + JSON.stringify(pDataset))
|
||||
@@ -85,7 +85,7 @@ function newFileCloud () {
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> pMarket = ' + JSON.stringify(pMarket))
|
||||
logger.write('[ERROR] getFile -> getFileRecursively -> ptimeFrameLabel = ' + JSON.stringify(ptimeFrameLabel))
|
||||
|
||||
throw ('Inconsistant data received.')
|
||||
throw ('Inconsistent data received.')
|
||||
}
|
||||
|
||||
if (pMarket !== undefined) {
|
||||
@@ -152,7 +152,7 @@ function newFileCloud () {
|
||||
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> filePath = ' + filePath) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> fileName = ' + fileName) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> Unexpected Error Ocurred.') }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> Unexpected Error Occurred.') }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> err = ' + err.stack) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> text = ' + text) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> response = ' + response) }
|
||||
|
||||
@@ -195,7 +195,7 @@ function newFileCursor() {
|
||||
/*
|
||||
|
||||
We are implementing here an algorithm designed to save bandwidth, memory and processing power at the browser.
|
||||
We say there is a saving mode where the cursor is running at a minimum size. When the end user aproaches the time period the cursor
|
||||
We say there is a saving mode where the cursor is running at a minimum size. When the end user approaches the time period the cursor
|
||||
is set, then it should exit the saving mode and go to its actual size.
|
||||
|
||||
To do this we are going to measure the distance from the Time Frame received to the one the cursors was initialized with.
|
||||
@@ -427,7 +427,7 @@ function newFileCursor() {
|
||||
let targetDate = new Date(cursorDate)
|
||||
targetDate.setUTCDate(targetDate.getUTCDate() + j)
|
||||
|
||||
/* Small algorith to allow load first the current date, then alternate between the most forwad and the most backwards ones. */
|
||||
/* Small algorithm to allow load first the current date, then alternate between the most forward and the most backwards ones. */
|
||||
if (j === 0) { j++ } else {
|
||||
if (j < 0) {
|
||||
j = -j
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function newFileStorage(host, port) {
|
||||
function newFileStorage(host, port, scheme='http') {
|
||||
const MODULE_NAME = 'File Storage'
|
||||
const INFO_LOG = false
|
||||
const logger = newWebDebugLog()
|
||||
@@ -40,12 +40,12 @@ function newFileStorage(host, port) {
|
||||
let url
|
||||
|
||||
if (host !== undefined && port !== undefined) {
|
||||
url = 'http://' + host + ':' + port + '/' + folder + filePath
|
||||
url = scheme + '://' + host + ':' + port + '/' + folder + filePath
|
||||
} else {
|
||||
url = folder + filePath
|
||||
}
|
||||
|
||||
/* Scaping # since it breaks the URL */
|
||||
/* Escaping # since it breaks the URL */
|
||||
url = url.replaceAll('#', '_HASHTAG_')
|
||||
|
||||
httpRequest(undefined, url, (response, fileContent) => {
|
||||
@@ -64,7 +64,7 @@ function newFileStorage(host, port) {
|
||||
let err = { code: 'The specified key does not exist.' }
|
||||
callBackFunction(err)
|
||||
} else {
|
||||
console.log('Error geting the file from the serever:', err)
|
||||
console.log('Error getting the file from the server:', err)
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@ function newMarketFiles() {
|
||||
pHost,
|
||||
pPort,
|
||||
pEventsServerClient,
|
||||
callBackFunction) {
|
||||
callBackFunction,
|
||||
scheme='http') {
|
||||
try {
|
||||
let timeFrames
|
||||
|
||||
@@ -94,7 +95,7 @@ function newMarketFiles() {
|
||||
eventsServerClient = pEventsServerClient
|
||||
|
||||
fileCloud = newFileCloud()
|
||||
fileCloud.initialize(pBot, pHost, pPort)
|
||||
fileCloud.initialize(pBot, pHost, pPort, scheme)
|
||||
|
||||
/* Some Validations */
|
||||
if (dataset.config.validTimeFrames === undefined) {
|
||||
|
||||
@@ -8,7 +8,7 @@ function newEventHandler() {
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
let eventHandlers = [] // Here we store all the functions we will call when an event is raiseed.
|
||||
let eventHandlers = [] // Here we store all the functions we will call when an event is raised.
|
||||
|
||||
return thisObject
|
||||
|
||||
|
||||
@@ -218,13 +218,14 @@ function newEventsServerClient(lanNetworkNode) {
|
||||
try {
|
||||
let host
|
||||
let port
|
||||
/* At this point the node does not have the payload property yet, that is why we have to do this manually */
|
||||
let extwsurl
|
||||
try {
|
||||
let config = JSON.parse(lanNetworkNode.config)
|
||||
host = config.host
|
||||
port = config.webSocketsPort
|
||||
extwsurl = config.webSocketsExternalURL
|
||||
|
||||
/* Check if we really have to stablish the connection. */
|
||||
/* Check if we really have to establish the connection. */
|
||||
if (config.autoConnect === false) { return }
|
||||
} catch (err) {
|
||||
lanNetworkNode.payload.uiObject.setErrorMessage(
|
||||
@@ -268,8 +269,12 @@ function newEventsServerClient(lanNetworkNode) {
|
||||
return
|
||||
}
|
||||
|
||||
const WEB_SOCKETS_URL = 'ws://' + host + ':' + port + ''
|
||||
let wsurl = 'ws://' + host + ':' + port + ''
|
||||
if (extwsurl !== undefined) {
|
||||
wsurl = extwsurl
|
||||
}
|
||||
|
||||
const WEB_SOCKETS_URL = wsurl
|
||||
WEB_SOCKETS_CONNECTION = new WebSocket(WEB_SOCKETS_URL)
|
||||
WEB_SOCKETS_CONNECTION.onerror = error => {
|
||||
console.log('WebSocket error:' + JSON.stringify(error))
|
||||
@@ -280,7 +285,7 @@ function newEventsServerClient(lanNetworkNode) {
|
||||
}
|
||||
}
|
||||
WEB_SOCKETS_CONNECTION.onmessage = e => {
|
||||
// console.log('Websoked Message Received: ' + e.data)
|
||||
// console.log('WEB_SOCKET Message Received: ' + e.data)
|
||||
|
||||
let message = JSON.parse(e.data)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ function newFrame() {
|
||||
let thisObject = {
|
||||
type: 'Rectangle',
|
||||
containerName: '', // This is for debugging purposes only.
|
||||
parentFrame: undefined, // Here we store the parent cointainer zoom object.
|
||||
parentFrame: undefined, // Here we store the parent container zoom object.
|
||||
radius: 0,
|
||||
offset: undefined,
|
||||
position: undefined,
|
||||
@@ -53,7 +53,7 @@ function newFrame() {
|
||||
}
|
||||
|
||||
function isInViewPort() {
|
||||
/* This function is usefull to know if the object who has this frame is currently appearing at least in part at the UI.projects.foundations.spaces.chartingSpace.viewport */
|
||||
/* This function is useful to know if the object who has this frame is currently appearing at least in part at the UI.projects.foundations.spaces.chartingSpace.viewport */
|
||||
|
||||
point1 = {
|
||||
x: 0,
|
||||
@@ -78,7 +78,7 @@ function newFrame() {
|
||||
}
|
||||
|
||||
function isCenterInViewPort() {
|
||||
/* This function is usefull to know if the object who has this frame is currently appearing at least in part at the UI.projects.foundations.spaces.chartingSpace.viewport */
|
||||
/* This function is useful to know if the object who has this frame is currently appearing at least in part at the UI.projects.foundations.spaces.chartingSpace.viewport */
|
||||
|
||||
point1 = {
|
||||
x: thisObject.width * 40 / 100,
|
||||
@@ -187,8 +187,8 @@ function newFrame() {
|
||||
}
|
||||
|
||||
function isThisPointHere(point, outsideViewPort, dontTransform, padding) {
|
||||
// The second parameter is usefull when you want to check a point that you already know is outside the viewport.
|
||||
// The padding is a distance to the borders of the container. Can be either negative (outside, to increase the cointainer size) or positive (inside to decrease the cointainer size)
|
||||
// The second parameter is useful when you want to check a point that you already know is outside the viewport.
|
||||
// The padding is a distance to the borders of the container. Can be either negative (outside, to increase the container size) or positive (inside to decrease the cointainer size)
|
||||
|
||||
if (padding === undefined) { padding = 0 }
|
||||
|
||||
@@ -199,7 +199,7 @@ function newFrame() {
|
||||
}
|
||||
|
||||
/* The point received is on the screen coordinates system, which already has zoom and displacement applied. We need to remove the zoom and displacement
|
||||
in order to have the point on the containers coordinate system and be able to compare it with its dimmensions. */
|
||||
in order to have the point on the containers coordinate system and be able to compare it with its dimensions. */
|
||||
if (dontTransform === false || dontTransform === undefined) {
|
||||
if (outsideViewPort === true) {
|
||||
checkPoint = thisObject.container.frame.unframeThisPoint(checkPoint)
|
||||
@@ -208,7 +208,7 @@ function newFrame() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Now we check if the resulting point is whin the current Frame. */
|
||||
/* Now we check if the resulting point is within the current Frame. */
|
||||
if (isNaN(checkPoint.x) || isNaN(checkPoint.y)) { return false }
|
||||
if (thisObject.type === 'Circle') {
|
||||
let distance = Math.sqrt(Math.pow(thisObject.position.x - checkPoint.x, 2) + Math.pow(thisObject.position.y - checkPoint.y, 2))
|
||||
@@ -244,7 +244,7 @@ function newFrame() {
|
||||
thisPoint = thisObject.parentFrame.frameThisPoint(thisPoint)
|
||||
}
|
||||
|
||||
/* Now we check if the resulting point is whin the current Frame. */
|
||||
/* Now we check if the resulting point is within the current Frame. */
|
||||
|
||||
if (thisObject.type === 'Circle') {
|
||||
let distance = Math.sqrt(Math.pow(thisPoint.x - checkPoint.x, 2) + Math.pow(thisPoint.y - checkPoint.y, 2))
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/* Global Constatns */
|
||||
/* Global Constants */
|
||||
|
||||
let canvas
|
||||
let PROJECTS_SCHEMA
|
||||
let SCHEMAS_BY_PROJECT = new Map()
|
||||
/* New Root object*/
|
||||
let UI = {
|
||||
projects: {}
|
||||
projects: {},
|
||||
environment: {}
|
||||
}
|
||||
|
||||
/* User Interface Colors */
|
||||
@@ -203,9 +204,9 @@ const _1_MINUTE_IN_MILISECONDS = 1 * 60 * 1000;
|
||||
|
||||
|
||||
|
||||
let NEW_SESSION_INITIAL_DATE = new Date(); // This value will be overwritten at the UI.projects.foundations.spaces.chartingSpace.viewport.initialize if the user had a prevous session with this same browser.
|
||||
let NEW_SESSION_INITIAL_DATE = new Date(); // This value will be overwritten at the UI.projects.foundations.spaces.chartingSpace.viewport.initialize if the user had a previous session with this same browser.
|
||||
let INITIAL_ZOOM_LEVEL = -28.25 // This is the zoom level at the view port in which the APP starts.
|
||||
let INITIAL_TIME_PERIOD = ONE_DAY_IN_MILISECONDS // This value will be overwritten at the UI.projects.foundations.spaces.chartingSpace.viewport.initialize if the user had a prevous session with this same browser.
|
||||
let INITIAL_TIME_PERIOD = ONE_DAY_IN_MILISECONDS // This value will be overwritten at the UI.projects.foundations.spaces.chartingSpace.viewport.initialize if the user had a previous session with this same browser.
|
||||
let VERY_LARGE_NUMBER = 100000000000000
|
||||
|
||||
const TOP_MARGIN = 0
|
||||
@@ -245,7 +246,7 @@ const PERIOD_05_MIN = "05-min";
|
||||
const PERIOD_01_MIN = "01-min";
|
||||
|
||||
/*
|
||||
We define here the size of the chartingSpace. It has to bee enough big in order to accomodate all the charts we expect to display in this space.
|
||||
We define here the size of the chartingSpace. It has to bee enough big in order to accommodate all the charts we expect to display in this space.
|
||||
*/
|
||||
|
||||
const TIME_MACHINE_WIDTH = 8;
|
||||
|
||||
@@ -8,7 +8,7 @@ function newProductStorage(name) {
|
||||
/*
|
||||
|
||||
This object will initialize children objects that will end up loading the data of each set defined at each product of the bot received at initialization.
|
||||
Once all the underlaying objects are fully initialized it will callback.
|
||||
Once all the underlying objects are fully initialized it will callback.
|
||||
|
||||
At the same time it will raise an event for each underlaying file being loaded, so that the UI can reflect the progress to the end user.
|
||||
|
||||
@@ -74,7 +74,7 @@ function newProductStorage(name) {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize(mine, bot, session, product, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, callBackFunction) {
|
||||
function initialize(mine, bot, session, product, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, callBackFunction, scheme='http') {
|
||||
try {
|
||||
datetime = pDatetime
|
||||
timeFrame = pTimeFrame
|
||||
@@ -90,7 +90,7 @@ function newProductStorage(name) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let marketFiles = newMarketFiles()
|
||||
marketFiles.initialize(mine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onMarketFileReady)
|
||||
marketFiles.initialize(mine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onMarketFileReady, scheme)
|
||||
thisObject.marketFiles.push(marketFiles)
|
||||
}
|
||||
break
|
||||
@@ -99,7 +99,7 @@ function newProductStorage(name) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let dailyFiles = newDailyFiles()
|
||||
dailyFiles.initialize(mine, bot, session, product, dataset, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, onDailyFileReady)
|
||||
dailyFiles.initialize(mine, bot, session, product, dataset, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, onDailyFileReady, scheme)
|
||||
thisObject.dailyFiles.push(dailyFiles)
|
||||
}
|
||||
break
|
||||
@@ -108,7 +108,7 @@ function newProductStorage(name) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let singleFile = newSingleFile()
|
||||
singleFile.initialize(mine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onSingleFileReady)
|
||||
singleFile.initialize(mine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onSingleFileReady, scheme)
|
||||
thisObject.singleFile.push(singleFile)
|
||||
}
|
||||
break
|
||||
@@ -117,7 +117,7 @@ function newProductStorage(name) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let fileSequences = newFileSequence()
|
||||
fileSequences.initialize(mine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onFileSequenceReady)
|
||||
fileSequences.initialize(mine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onFileSequenceReady, scheme)
|
||||
thisObject.fileSequences.push(fileSequences)
|
||||
}
|
||||
break
|
||||
|
||||
+35
-13
@@ -1,4 +1,4 @@
|
||||
function getSchemaDocument (node, project) {
|
||||
function getSchemaDocument(node, project) {
|
||||
if (node === null || node === undefined) {
|
||||
console.log('[ERROR] Can not get the schema document of a null or undefined node ')
|
||||
return
|
||||
@@ -7,13 +7,35 @@ function getSchemaDocument (node, project) {
|
||||
|
||||
let APP_SCHEMA = SCHEMAS_BY_PROJECT.get(project)
|
||||
if (APP_SCHEMA !== undefined) {
|
||||
return SCHEMAS_BY_PROJECT.get(project).map.appSchema.get(node.type)
|
||||
|
||||
let schemaDocument = SCHEMAS_BY_PROJECT.get(project).map.appSchema.get(node.type)
|
||||
/*
|
||||
As of today, we are still splitting the codebase into multiple projects and there are Menu Actions which do not
|
||||
have a well defined relatedUIObjectProject. There are a few techniques in place to try to guess it, but
|
||||
even those can fail. For that reason, we will temporally see if we can find the schema document at any of the
|
||||
available projects.
|
||||
|
||||
TODO: We need to explicitly declare the project of a relatedUIObject in order to avoid potential name collision
|
||||
between nodes belonging to more than one project.
|
||||
*/
|
||||
|
||||
if (schemaDocument === undefined) {
|
||||
for (let j = 0; j < PROJECTS_SCHEMA.length; j++) {
|
||||
let project = PROJECTS_SCHEMA[j].name
|
||||
schemaDocument = SCHEMAS_BY_PROJECT.get(project).map.appSchema.get(node.type)
|
||||
if (schemaDocument !== undefined) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return schemaDocument
|
||||
} else {
|
||||
console.log('[ERROR] Could not get APP Scchema for project ' + node.project)
|
||||
console.log('[ERROR] Could not get APP Schema for project ' + node.project)
|
||||
}
|
||||
}
|
||||
|
||||
function dynamicDecimals (value, minDecimals) {
|
||||
function dynamicDecimals(value, minDecimals) {
|
||||
if (minDecimals === undefined) {
|
||||
minDecimals = 0
|
||||
}
|
||||
@@ -26,7 +48,7 @@ function dynamicDecimals (value, minDecimals) {
|
||||
return returnValue
|
||||
}
|
||||
|
||||
function convertTimeFrameToName (pTimeFrame) {
|
||||
function convertTimeFrameToName(pTimeFrame) {
|
||||
for (let i = 0; i < dailyTimeFramesArray.length; i++) {
|
||||
let period = dailyTimeFramesArray[i]
|
||||
if (period[0] === pTimeFrame) {
|
||||
@@ -42,7 +64,7 @@ function convertTimeFrameToName (pTimeFrame) {
|
||||
}
|
||||
}
|
||||
|
||||
function nextPorwerOf10 (number) {
|
||||
function nextPorwerOf10(number) {
|
||||
for (let i = -10; i <= 10; i++) {
|
||||
if (number < Math.pow(10, i)) {
|
||||
return Math.pow(10, i)
|
||||
@@ -50,18 +72,18 @@ function nextPorwerOf10 (number) {
|
||||
}
|
||||
}
|
||||
|
||||
function pad (str, max) {
|
||||
function pad(str, max) {
|
||||
str = str.toString()
|
||||
return str.length < max ? pad('0' + str, max) : str
|
||||
}
|
||||
|
||||
function moveToUserPosition (container, currentDate, currentRate, coordinateSystem, ignoreX, ignoreY, mousePosition, fitFunction) {
|
||||
function moveToUserPosition(container, currentDate, currentRate, coordinateSystem, ignoreX, ignoreY, mousePosition, fitFunction) {
|
||||
let targetPoint = {
|
||||
x: currentDate.valueOf(),
|
||||
y: currentRate
|
||||
}
|
||||
|
||||
/* Put this point in the coordinate system of the UI.projects.foundations.spaces.chartingSpace.viewport */
|
||||
/* Put this point in the coordinate system of the UI.projects.foundations.spaces.chartingSpace.viewport */
|
||||
targetPoint = coordinateSystem.transformThisPoint(targetPoint)
|
||||
targetPoint = UI.projects.foundations.utilities.coordinateTransformations.transformThisPoint(targetPoint, container)
|
||||
|
||||
@@ -81,7 +103,7 @@ function moveToUserPosition (container, currentDate, currentRate, coordinateSyst
|
||||
container.displace(displaceVector)
|
||||
}
|
||||
|
||||
function removeTime (datetime) {
|
||||
function removeTime(datetime) {
|
||||
if (datetime === undefined) { return }
|
||||
|
||||
let dateOnly = new Date(Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS) * ONE_DAY_IN_MILISECONDS)
|
||||
@@ -89,14 +111,14 @@ function removeTime (datetime) {
|
||||
return dateOnly
|
||||
}
|
||||
|
||||
function newUniqueId () {
|
||||
function newUniqueId() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)
|
||||
return v.toString(16)
|
||||
})
|
||||
}
|
||||
|
||||
function splitTextIntoPhrases (text, wordsPerLine) {
|
||||
function splitTextIntoPhrases(text, wordsPerLine) {
|
||||
try {
|
||||
if (text.split === undefined) {
|
||||
return []
|
||||
@@ -128,7 +150,7 @@ function splitTextIntoPhrases (text, wordsPerLine) {
|
||||
}
|
||||
}
|
||||
|
||||
function getTextWidth (text) {
|
||||
function getTextWidth(text) {
|
||||
var metrics = browserCanvasContext.measureText(text)
|
||||
return metrics.width
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -128,50 +128,33 @@ cursor: pointer;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* Tooltip text */
|
||||
.docs-tooltip .docs-tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 240px;
|
||||
background-color: #0295aa;
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 15px;
|
||||
line-height: 130%;
|
||||
text-align: center;
|
||||
padding: 15px;
|
||||
border-radius: 6px;
|
||||
|
||||
/* Position the docs-tooltip text */
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
bottom: 125%;
|
||||
left: 50%;
|
||||
margin-left: -120px;
|
||||
|
||||
|
||||
/* Fade in docs-tooltip */
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
/* Tooltip Settings */
|
||||
.tippy-box[data-theme~='superalgos'] {
|
||||
background-color: #0295aa;
|
||||
color: #fff;
|
||||
font: normal normal normal 14px/1 "segoeui";
|
||||
width: 240px;
|
||||
padding: 15px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 15px;
|
||||
line-height: 130%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Tooltip arrow */
|
||||
.docs-tooltip .docs-tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #0295aa transparent transparent transparent;
|
||||
.tippy-box[data-theme~='superalgos'][data-placement^='top'] > .tippy-arrow::before {
|
||||
border-top-color: #0295aa;
|
||||
}
|
||||
.tippy-box[data-theme~='superalgos'][data-placement^='bottom'] > .tippy-arrow::before {
|
||||
border-bottom-color: #0295aa;
|
||||
}
|
||||
.tippy-box[data-theme~='superalgos'][data-placement^='left'] > .tippy-arrow::before {
|
||||
border-left-color: #0295aa;
|
||||
}
|
||||
.tippy-box[data-theme~='superalgos'][data-placement^='right'] > .tippy-arrow::before {
|
||||
border-right-color: #0295aa;
|
||||
}
|
||||
|
||||
/* Show the tooltip text when you mouse over the tooltip container */
|
||||
.docs-tooltip:hover .docs-tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
|
||||
@@ -826,6 +809,13 @@ display: table-cell;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
::placeholder, /* Chrome, Firefox, Opera, Safari 10.1+ */
|
||||
:-ms-input-placeholder, /* Internet Explorer 10-11 */
|
||||
::-ms-input-placeholder { /* Microsoft Edge */
|
||||
color: #dbdbdb;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.docs-search-results-header-tabs-container {
|
||||
display: table;
|
||||
text-align: right;
|
||||
|
||||
@@ -888,7 +888,8 @@
|
||||
#governance-tab13:checked ~ .governance-search-result-content #content13,
|
||||
#governance-tab14:checked ~ .governance-search-result-content #content14,
|
||||
#governance-tab15:checked ~ .governance-search-result-content #content15,
|
||||
#governance-tab16:checked ~ .governance-search-result-content #content16 {
|
||||
#governance-tab16:checked ~ .governance-search-result-content #content16,
|
||||
#governance-tab17:checked ~ .governance-search-result-content #content17 {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,27 @@ content: "Summary: ";
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tutorial-content-div {
|
||||
overflow-y: auto;
|
||||
overflow-x: clip;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #888;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #555;
|
||||
}
|
||||
|
||||
.tutorial-definitionTable {
|
||||
background-color: #f3f3f3;
|
||||
border-top-color: #a6e1ec;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**!
|
||||
* FlexSearch.js v0.7.2 (Bundle)
|
||||
* Copyright 2018-2021 Nextapps GmbH
|
||||
* Author: Thomas Wilkerling
|
||||
* Licence: Apache-2.0
|
||||
* https://github.com/nextapps-de/flexsearch
|
||||
*/
|
||||
(function _f(self){'use strict';try{if(module)self=module}catch(e){}self._factory=_f;var t;function u(a){return"undefined"!==typeof a?a:!0}function aa(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=v();return b}function v(){return Object.create(null)}function ba(a,b){return b.length-a.length}function x(a){return"string"===typeof a}function C(a){return"object"===typeof a}function D(a){return"function"===typeof a};function ca(a,b){var c=da;if(a&&(b&&(a=E(a,b)),this.H&&(a=E(a,this.H)),this.J&&1<a.length&&(a=E(a,this.J)),c||""===c)){a=a.split(c);if(this.filter){b=this.filter;c=a.length;const d=[];for(let e=0,f=0;e<c;e++){const g=a[e];g&&!b[g]&&(d[f++]=g)}a=d}return a}return a}const da=/[\p{Z}\p{S}\p{P}\p{C}]+/u,ea=/[\u0300-\u036f]/g;
|
||||
function fa(a,b){const c=Object.keys(a),d=c.length,e=[];let f="",g=0;for(let h=0,k,m;h<d;h++)k=c[h],(m=a[k])?(e[g++]=F(b?"(?!\\b)"+k+"(\\b|_)":k),e[g++]=m):f+=(f?"|":"")+k;f&&(e[g++]=F(b?"(?!\\b)("+f+")(\\b|_)":"("+f+")"),e[g]="");return e}function E(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function F(a){return new RegExp(a,"g")}function ha(a){let b="",c="";for(let d=0,e=a.length,f;d<e;d++)(f=a[d])!==c&&(b+=c=f);return b};var ja={encode:ia,F:!1,G:""};function ia(a){return ca.call(this,a.toLowerCase(),!1)};const ka={},G={};function la(a){I(a,"add");I(a,"append");I(a,"search");I(a,"update");I(a,"remove")}function I(a,b){a[b+"Async"]=function(){const c=this,d=arguments;var e=d[d.length-1];let f;D(e)&&(f=e,delete d[d.length-1]);e=new Promise(function(g){setTimeout(function(){c.async=!0;const h=c[b].apply(c,d);c.async=!1;g(h)})});return f?(e.then(f),this):e}};function ma(a,b,c,d){const e=a.length;let f=[],g,h,k=0;d&&(d=[]);for(let m=e-1;0<=m;m--){const n=a[m],w=n.length,q=v();let r=!g;for(let l=0;l<w;l++){const p=n[l],z=p.length;if(z)for(let B=0,A,y;B<z;B++)if(y=p[B],g){if(g[y]){if(!m)if(c)c--;else if(f[k++]=y,k===b)return f;if(m||d)q[y]=1;r=!0}if(d&&(h[y]=(A=h[y])?++A:A=1,A<e)){const H=d[A-2]||(d[A-2]=[]);H[H.length]=y}}else q[y]=1}if(d)g||(h=q);else if(!r)return[];g=q}if(d)for(let m=d.length-1,n,w;0<=m;m--){n=d[m];w=n.length;for(let q=0,r;q<w;q++)if(r=
|
||||
n[q],!g[r]){if(c)c--;else if(f[k++]=r,k===b)return f;g[r]=1}}return f}function na(a,b){const c=v(),d=v(),e=[];for(let f=0;f<a.length;f++)c[a[f]]=1;for(let f=0,g;f<b.length;f++){g=b[f];for(let h=0,k;h<g.length;h++)k=g[h],c[k]&&!d[k]&&(d[k]=1,e[e.length]=k)}return e};function J(a){this.l=!0!==a&&a;this.cache=v();this.h=[]}function oa(a,b,c){C(a)&&(a=a.query);let d=this.cache.get(a);d||(d=this.search(a,b,c),this.cache.set(a,d));return d}J.prototype.set=function(a,b){if(!this.cache[a]){var c=this.h.length;c===this.l?delete this.cache[this.h[c-1]]:c++;for(--c;0<c;c--)this.h[c]=this.h[c-1];this.h[0]=a}this.cache[a]=b};J.prototype.get=function(a){const b=this.cache[a];if(this.l&&b&&(a=this.h.indexOf(a))){const c=this.h[a-1];this.h[a-1]=this.h[a];this.h[a]=c}return b};const qa={memory:{charset:"latin:extra",D:3,B:4,m:!1},performance:{D:3,B:3,s:!1,context:{depth:2,D:1}},match:{charset:"latin:extra",G:"reverse"},score:{charset:"latin:advanced",D:20,B:3,context:{depth:3,D:9}},"default":{}};function ra(a,b,c,d,e,f){setTimeout(function(){const g=a(c,JSON.stringify(f));g&&g.then?g.then(function(){b.export(a,b,c,d,e+1)}):b.export(a,b,c,d,e+1)})};function K(a,b){if(!(this instanceof K))return new K(a);var c;if(a){x(a)?a=qa[a]:(c=a.preset)&&(a=Object.assign({},c[c],a));c=a.charset;var d=a.lang;x(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=G[c]);x(d)&&(d=ka[d])}else a={};let e,f,g=a.context||{};this.encode=a.encode||c&&c.encode||ia;this.register=b||v();this.D=e=a.resolution||9;this.G=b=c&&c.G||a.tokenize||"strict";this.depth="strict"===b&&g.depth;this.l=u(g.bidirectional);this.s=f=u(a.optimize);this.m=u(a.fastupdate);this.B=a.minlength||1;this.C=
|
||||
a.boost;this.map=f?aa(e):v();this.A=e=g.resolution||1;this.h=f?aa(e):v();this.F=c&&c.F||a.rtl;this.H=(b=a.matcher||d&&d.H)&&fa(b,!1);this.J=(b=a.stemmer||d&&d.J)&&fa(b,!0);if(c=b=a.filter||d&&d.filter){c=b;d=v();for(let h=0,k=c.length;h<k;h++)d[c[h]]=1;c=d}this.filter=c;this.cache=(b=a.cache)&&new J(b)}t=K.prototype;t.append=function(a,b){return this.add(a,b,!0)};
|
||||
t.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(b);if(d=b.length){const m=v(),n=v(),w=this.depth,q=this.D;for(let r=0;r<d;r++){let l=b[this.F?d-1-r:r];var e=l.length;if(l&&e>=this.B&&(w||!n[l])){var f=L(q,d,r),g="";switch(this.G){case "full":if(3<e){for(f=0;f<e;f++)for(var h=e;h>f;h--)if(h-f>=this.B){var k=L(q,d,r,e,f);g=l.substring(f,h);M(this,n,g,k,a,c)}break}case "reverse":if(2<e){for(h=e-1;0<h;h--)g=l[h]+g,g.length>=this.B&&M(this,n,
|
||||
g,L(q,d,r,e,h),a,c);g=""}case "forward":if(1<e){for(h=0;h<e;h++)g+=l[h],g.length>=this.B&&M(this,n,g,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),M(this,n,l,f,a,c),w&&1<d&&r<d-1)for(e=v(),g=this.A,f=l,h=Math.min(w+1,d-r),e[f]=1,k=1;k<h;k++)if((l=b[this.F?d-1-r-k:r+k])&&l.length>=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;M(this,m,p?f:l,L(g+(d/2>g?0:1),d,r,h-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this};
|
||||
function L(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):(a-1)/(b+(d||0))*(c+(e||0))+1|0:0}function M(a,b,c,d,e,f,g){let h=g?a.h:a.map;if(!b[c]||g&&!b[c][g])a.s&&(h=h[d]),g?(b=b[c]||(b[c]=v()),b[g]=1,h=h[g]||(h[g]=v())):b[c]=1,h=h[c]||(h[c]=[]),a.s||(h=h[d]||(h[d]=[])),f&&-1!==h.indexOf(e)||(h[h.length]=e,a.m&&(a=a.register[e]||(a.register[e]=[]),a[a.length]=h))}
|
||||
t.search=function(a,b,c){c||(!b&&C(a)?(c=a,a=c.query):C(b)&&(c=b));let d=[],e;let f,g=0;if(c){b=c.limit;g=c.offset||0;var h=c.context;f=c.suggest}if(a&&(a=this.encode(a),e=a.length,1<e)){c=v();var k=[];for(let n=0,w=0,q;n<e;n++)if((q=a[n])&&q.length>=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);h=this.depth&&1<e&&!1!==h;c=0;let m;h?(m=a[0],c=1):1<e&&a.sort(ba);for(let n,w;c<e;c++){w=a[c];h?(n=sa(this,d,f,b,g,2===e,w,m),f&&!1===n&&d.length||
|
||||
(m=w)):n=sa(this,d,f,b,g,1===e,w);if(n)return n;if(f&&c===e-1){k=d.length;if(!k){if(h){h=0;c=-1;continue}return d}if(1===k)return ta(d[0],b,g)}}return ma(d,b,g,f)};
|
||||
function sa(a,b,c,d,e,f,g,h){let k=[],m=h?a.h:a.map;a.s||(m=ua(m,g,h,a.l));if(m){let n=0;const w=Math.min(m.length,h?a.A:a.D);for(let q=0,r=0,l,p;q<w;q++)if(l=m[q])if(a.s&&(l=ua(l,g,h,a.l)),e&&l&&f&&(p=l.length,p<=e?(e-=p,l=null):(l=l.slice(e),e=0)),l&&(k[n++]=l,f&&(r+=l.length,r>=d)))break;if(n){if(f)return ta(k,d,0);b[b.length]=k;return}}return!c&&k}function ta(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a}
|
||||
function ua(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d<c.length;d++)e=c[d],e.splice(e.indexOf(a),1);else N(this.map,a,this.D,this.s),this.depth&&N(this.h,a,this.A,this.s);b||delete this.register[a];if(this.cache){b=this.cache;for(let d=0,e,f;d<b.h.length;d++)f=b.h[d],e=b.cache[f],-1!==e.indexOf(a)&&(b.h.splice(d--,1),delete b.cache[f])}}return this};
|
||||
function N(a,b,c,d,e){let f=0;if(a.constructor===Array)if(e)b=a.indexOf(b),-1!==b?1<a.length&&(a.splice(b,1),f++):f++;else{e=Math.min(a.length,c);for(let g=0,h;g<e;g++)if(h=a[g])f=N(h,b,c,d,e),d||f||delete a[g]}else for(let g in a)(f=N(a[g],b,c,d,e))||delete a[g];return f}t.searchCache=oa;
|
||||
t.export=function(a,b,c,d,e){let f,g;switch(e||(e=0)){case 0:f="reg";if(this.m){g=v();for(let h in this.register)g[h]=1}else g=this.register;break;case 1:f="cfg";g={doc:0,opt:this.s?1:0};break;case 2:f="map";g=this.map;break;case 3:f="ctx";g=this.h;break;default:return}ra(a,b||this,c?c+"."+f:f,d,e,g);return!0};t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};la(K.prototype);function va(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new K(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let wa=0;function O(a){if(!(this instanceof O))return new O(a);var b;a?D(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c=self.exports,d=this;this.o=xa(b,c,a.worker);this.h=v();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}P("add");P("append");P("search");P("update");P("remove");
|
||||
function P(a){O.prototype[a]=O.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;D(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++wa]=f;b.o.postMessage({task:a,id:wa,args:c})})});return e?(d.then(e),this):d}}
|
||||
function xa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+va.toString()],{type:"text/javascript"}))):new Worker(x(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function Q(a){if(!(this instanceof Q))return new Q(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=v();this.key=(c=b.key||b.id)&&S(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&v();this.I=(c=b.tag)&&S(c,this.A);this.l=c&&v();this.cache=(c=a.cache)&&new J(c);a.cache=!1;this.o=a.worker;this.async=!1;c=v();let d=b.index||b.field||b;x(d)&&(d=[d]);for(let e=0,f,g;e<d.length;e++)f=d[e],x(f)||(g=f,f=f.field),g=C(g)?Object.assign({},a,g):a,
|
||||
this.o&&(c[f]=new O(g),c[f].o||(this.o=!1)),this.o||(c[f]=new K(g,this.register)),this.K[e]=S(f,this.A),this.h[e]=f;if(this.C)for(a=b.store,x(a)&&(a=[a]),b=0;b<a.length;b++)this.C[b]=S(a[b],this.A);this.index=c}function S(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.length;e++)a=c[e],0<=a.indexOf("[]")&&(a=a.substring(0,a.length-2))&&(b[d]=!0),a&&(c[d++]=a);d<c.length&&(c.length=d);return 1<d?c:c[0]}function T(a,b){if(x(b))a=a[b];else for(let c=0;a&&c<b.length;c++)a=a[b[c]];return a}
|
||||
function U(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor===Array)for(b=b[e]=Array(a.length),e=0;e<a.length;e++)U(a,b,c,d,e);else b=b[e]||(b[e]=v()),e=c[++d],U(a,b,c,d,e)}function V(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(a.constructor===Array){if(c[d]){for(b=0;b<a.length;b++)e.add(f,a[b],!0,!0);return}a=a.join(" ")}e.add(f,a,h,!0)}else if(a.constructor===Array)for(g=0;g<a.length;g++)V(a,b,c,d,e,f,g,h);else g=b[++d],V(a,b,c,d,e,f,g,h)}t=Q.prototype;
|
||||
t.add=function(a,b,c){C(a)&&(b=a,a=T(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],x(e)&&(e=[e]),V(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=T(b,this.I),e=v();x(d)&&(d=[d]);for(let f=0,g,h;f<d.length;f++)if(g=d[f],!e[g]&&(e[g]=1,h=this.l[g]||(this.l[g]=[]),!c||-1===h.indexOf(a)))if(h[h.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=h}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
if(this.C){d=v();for(let e=0,f;e<this.C.length;e++)f=this.C[e],x(f)?d[f]=b[f]:U(b,d,f,0,f[0])}this.store[a]=d||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){C(a)&&(a=T(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.o),!this.m);b++);if(this.I&&!this.m)for(let c in this.l){b=this.l[c];const d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){c||(!b&&C(a)?(c=a,a=c.query):C(b)&&(c=b,b=0));let e=[],f=[],g,h,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{k=(g=c.pluck)||c.index||c.field;m=c.tag;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||100;w=c.offset||0;if(m&&(x(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=ya.call(this,m[l],b,w,h))e[e.length]=p,q++;return q?e:[]}x(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,z,B;l<k.length;l++){let A;
|
||||
z=k[l];x(z)||(A=z,z=z.field);if(r)r[l]=this.index[z].searchAsync(a,b,A||c);else{d?p=d[l]:p=this.index[z].search(a,b,A||c);B=p&&p.length;if(m&&B){const y=[];let H=0;n&&(y[0]=[p]);for(let X=0,pa,R;X<m.length;X++)if(pa=m[X],B=(R=this.l[pa])&&R.length)H++,y[y.length]=n?[R]:R;H&&(p=n?ma(y,b||100,w||0):na(p,y),B=p.length)}if(B)f[q]=z,e[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(z){p(l.search(a,b,c,z))})})}if(!q)return[];if(g&&(!h||!this.store))return e[0];
|
||||
for(let l=0,p;l<f.length;l++){p=e[l];p.length&&h&&(p=za.call(this,p));if(g)return p;e[l]={field:f[l],result:p}}return e};function ya(a,b,c,d){let e=this.l[a],f=e&&e.length-c;if(f&&0<f){if(f>b||c)e=e.slice(c,c+b);d&&(e=za.call(this,e));return{tag:a,result:e}}}function za(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};t.set=function(a,b){this.store[a]=b;return this};
|
||||
t.searchCache=oa;t.export=function(a,b,c,d,e){e||(e=0);d||(d=0);if(d<this.h.length){const f=this.h[d],g=this.index[f];b=this;setTimeout(function(){g.export(a,b,e?f.replace(":","-"):"",d,e++)||(d++,e=1,b.export(a,b,f,d,e))})}else{let f;switch(e){case 1:c="tag";f=this.l;break;case 2:c="store";f=this.store;break;default:return}ra(a,this,c,d,e,f)}};
|
||||
t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "tag":this.l=b;break;case "reg":this.m=!1;this.register=b;for(let d=0,e;d<this.h.length;d++)e=this.index[this.h[d]],e.register=b,e.m=!1;break;case "store":this.store=b;break;default:a=a.split(".");const c=a[0];a=a[1];c&&a&&this.index[c].import(a,b)}};la(Q.prototype);var Ba={encode:Aa,F:!1,G:""};const Ca=[F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",F("[\u00e8\u00e9\u00ea\u00eb]"),"e",F("[\u00ec\u00ed\u00ee\u00ef]"),"i",F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",F("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",F("[\u00fd\u0177\u00ff]"),"y",F("\u00f1"),"n",F("[\u00e7c]"),"k",F("\u00df"),"s",F(" & ")," and "];function Aa(a){var b=a;b.normalize&&(b=b.normalize("NFD").replace(ea,""));return ca.call(this,b.toLowerCase(),!a.normalize&&Ca)};var Ea={encode:Da,F:!1,G:"strict"};const Fa=/[^a-z0-9]+/,Ga={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};function Da(a){a=Aa.call(this,a).join(" ");const b=[];if(a){const c=a.split(Fa),d=c.length;for(let e=0,f,g=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){f=a[0];let h=Ga[f]||f,k=h;for(let m=1;m<a.length;m++){f=a[m];const n=Ga[f]||f;n&&n!==k&&(h+=n,k=n)}b[g++]=h}}return b};var Ia={encode:Ha,F:!1,G:""};const Ja=[F("ae"),"a",F("oe"),"o",F("sh"),"s",F("th"),"t",F("ph"),"f",F("pf"),"f",F("(?![aeo])h(?![aeo])"),"",F("(?!^[aeo])h(?!^[aeo])"),""];function Ha(a,b){a&&(a=Da.call(this,a).join(" "),2<a.length&&(a=E(a,Ja)),b||(1<a.length&&(a=ha(a)),a&&(a=a.split(" "))));return a};var La={encode:Ka,F:!1,G:""};const Ma=F("(?!\\b)[aeo]");function Ka(a){a&&(a=Ha.call(this,a,!0),1<a.length&&(a=a.replace(Ma,"")),1<a.length&&(a=ha(a)),a&&(a=a.split(" ")));return a};G["latin:default"]=ja;G["latin:simple"]=Ba;G["latin:balance"]=Ea;G["latin:advanced"]=Ia;G["latin:extra"]=La;const W=self;let Y;const Z={Index:K,Document:Q,Worker:O,registerCharset:function(a,b){G[a]=b},registerLanguage:function(a,b){ka[a]=b}};(Y=W.define)&&Y.amd?Y([],function(){return Z}):W.exports?W.exports=Z:W.FlexSearch=Z;}(this));
|
||||
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* @popperjs/core v2.10.2 - MIT License
|
||||
*/
|
||||
|
||||
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){function t(e,t){return{width:(e=e.getBoundingClientRect()).width/1,height:e.height/1,top:e.top/1,right:e.right/1,bottom:e.bottom/1,left:e.left/1,x:e.left/1,y:e.top/1}}function n(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function o(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function r(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function p(e){return t(f(e)).left+o(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function l(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,r,a){void 0===a&&(a=!1);var c=i(r);i(r)&&r.getBoundingClientRect();var u=f(r);e=t(e);var d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(c||!c&&!a)&&(("body"!==s(r)||l(u))&&(d=r!==n(r)&&i(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:o(r)),i(r)?((m=t(r)).x+=r.clientLeft,m.y+=r.clientTop):u&&(m.x=p(u))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function d(e){var n=t(e),o=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(n.width-o)&&(o=n.width),1>=Math.abs(n.height-r)&&(r=n.height),{x:e.offsetLeft,y:e.offsetTop,width:o,height:r}}function m(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(a(e)?e.host:null)||f(e)}function h(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:i(e)&&l(e)?e:h(m(e))}function v(e,t){var o;void 0===t&&(t=[]);var r=h(e);return e=r===(null==(o=e.ownerDocument)?void 0:o.body),o=n(r),r=e?[o].concat(o.visualViewport||[],l(r)?r:[]):r,t=t.concat(r),e?t:t.concat(v(m(r)))}function g(e){return i(e)&&"fixed"!==c(e).position?e.offsetParent:null}function b(e){for(var t=n(e),o=g(e);o&&0<=["table","td","th"].indexOf(s(o))&&"static"===c(o).position;)o=g(o);if(o&&("html"===s(o)||"body"===s(o)&&"static"===c(o).position))return t;if(!o)e:{if(o=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!i(e)||"fixed"!==c(e).position)for(e=m(e);i(e)&&0>["html","body"].indexOf(s(e));){var r=c(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||o&&"filter"===r.willChange||o&&r.filter&&"none"!==r.filter){o=e;break e}e=e.parentNode}o=null}return o||t}function y(e){function t(e){o.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){o.has(e)||(e=n.get(e))&&t(e)})),r.push(e)}var n=new Map,o=new Set,r=[];return e.forEach((function(e){n.set(e.name,e)})),e.forEach((function(e){o.has(e.name)||t(e)})),r}function w(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function x(e){return e.split("-")[0]}function O(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&a(n))do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E(e,r){if("viewport"===r){r=n(e);var a=f(e);r=r.visualViewport;var s=a.clientWidth;a=a.clientHeight;var l=0,u=0;r&&(s=r.width,a=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=r.offsetLeft,u=r.offsetTop)),e=j(e={width:s,height:a,x:l+p(e),y:u})}else i(r)?((e=t(r)).top+=r.clientTop,e.left+=r.clientLeft,e.bottom=e.top+r.clientHeight,e.right=e.left+r.clientWidth,e.width=r.clientWidth,e.height=r.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=o(u),r=null==(a=u.ownerDocument)?void 0:a.body,a=U(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),l=U(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-s.scrollLeft+p(u),s=-s.scrollTop,"rtl"===c(r||e).direction&&(u+=U(e.clientWidth,r?r.clientWidth:0)-a),e=j({width:a,height:l,x:u,y:s}));return e}function D(e,t,n){return t="clippingParents"===t?function(e){var t=v(m(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?b(e):e;return r(n)?t.filter((function(e){return r(e)&&O(e,n)&&"body"!==s(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=E(e,n),t.top=U(n.top,t.top),t.right=z(n.right,t.right),t.bottom=z(n.bottom,t.bottom),t.left=U(n.left,t.left),t}),E(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function L(e){return e.split("-")[1]}function P(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function M(e){vaLine truncated
|
||||
//# sourceMappingURL=popper.min.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t=t||self).tippy=e(t.Popper)}(this,(function(t){"use strict";var e="undefined"!=typeof window&&"undefined"!=typeof document,n=!!e&&!!window.msCrypto,r={passive:!0,capture:!0},o=function(){return document.body};function i(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function a(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function s(t,e){return"function"==typeof t?t.apply(void 0,e):t}function u(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function p(t,e){var n=Object.assign({},t);return e.forEach((function(t){delete n[t]})),n}function c(t){return[].concat(t)}function f(t,e){-1===t.indexOf(e)&&t.push(e)}function l(t){return t.split("-")[0]}function d(t){return[].slice.call(t)}function v(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function m(){return document.createElement("div")}function g(t){return["Element","Fragment"].some((function(e){return a(t,e)}))}function h(t){return a(t,"MouseEvent")}function b(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function y(t){return g(t)?[t]:function(t){return a(t,"NodeList")}(t)?d(t):Array.isArray(t)?t:d(document.querySelectorAll(t))}function w(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function x(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function E(t){var e,n=c(t)[0];return null!=n&&null!=(e=n.ownerDocument)&&e.body?n.ownerDocument:document}function O(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}function C(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var T={isTouch:!1},A=0;function L(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",D))}function D(){var t=performance.now();t-A<20&&(T.isTouch=!1,document.removeEventListener("mousemove",D)),A=t}function k(){var t=document.activeElement;if(b(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var R=Object.assign({appendTo:o,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),P=Object.keys(R);function j(t){var e=(t.plugins||[]).reduce((function(e,n){var r,o=n.name,i=n.defaultValue;o&&(e[o]=void 0!==t[o]?t[o]:null!=(r=R[o])?r:i);return e}),{});return Object.assign({},t,e)}function M(t,e){var n=Object.assign({},e,{content:s(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(j(Object.assign({},R,{plugins:e}))):P).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(t){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function V(t,e){t.innerHTML=e}function I(t){var e=m();return!0===t?e.className="tippy-arrow":(e.className="tippy-svg-arrow",g(t)?e.appendChild(t):V(e,t)),e}function S(t,e){g(e.content)?(V(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?V(t,e.content):t.textContent=e.content)}function B(t){var e=t.firstElementChild,n=d(e.children);return{box:e,content:n.find((function(t){return t.classList.contains("tippy-content")})),arrow:n.find((function(t){return t.classList.contains("tippy-arrow")||t.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function N(t){var e=m(),n=m();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=m();function o(n,r){var o=B(e),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==Line truncated
|
||||
//# sourceMappingURL=tippy-bundle.umd.min.js.map
|
||||
@@ -17,6 +17,9 @@
|
||||
<script type="text/javascript" src="AppPreLoader.js"></script>
|
||||
<script src="externalScripts/CCapture.all.min.js"></script>
|
||||
<script src="externalScripts/prism.js"></script>
|
||||
<script src="externalScripts/flexsearch.bundle.js"></script>
|
||||
<script src="externalScripts/popper.min.js"></script>
|
||||
<script src="externalScripts/tippy-bundle.umd.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadApp() {
|
||||
|
||||
+39
-6
@@ -6,15 +6,16 @@ load all node dependencies and get them ready to the actual App.
|
||||
*/
|
||||
|
||||
/*
|
||||
The PL object is accesible everywhere at the Superalgos Platform Client.
|
||||
The PL object is accessible everywhere at the Superalgos Platform Client.
|
||||
It provides access to all modules built for this Client.
|
||||
*/
|
||||
global.PL = {}
|
||||
/*
|
||||
The SA object is accesible everywhere at the Superalgos Desktop App.
|
||||
The SA object is accessible everywhere at the Superalgos Desktop App.
|
||||
It provides access to all modules built for Superalgos in general.
|
||||
*/
|
||||
global.SA = {}
|
||||
|
||||
/* Load Environment Variables */
|
||||
let ENVIRONMENT = require('./Environment.js');
|
||||
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
|
||||
@@ -47,14 +48,46 @@ SA.nodeModules = {
|
||||
http: require('http'),
|
||||
ccxt: require('ccxt'),
|
||||
octokit: require("@octokit/rest"),
|
||||
graphql: require("@octokit/graphql"),
|
||||
simpleGit: require('simple-git'),
|
||||
lookpath: require('lookpath')
|
||||
lookpath: require('lookpath'),
|
||||
process: require('process'),
|
||||
childProcess: require('child_process')
|
||||
|
||||
}
|
||||
/*
|
||||
Check if we are starting from a particular workspace.
|
||||
*/
|
||||
let initialWorkspace = {}
|
||||
|
||||
for (let i = 0; i < process.argv.length; i++) {
|
||||
let arg = process.argv[i]
|
||||
|
||||
if (arg === 'noBrowser') { continue }
|
||||
if (arg === 'minMemo') { continue }
|
||||
if (arg.indexOf(':') >= 0) { continue }
|
||||
if (arg.indexOf('/') >= 0) { continue }
|
||||
|
||||
if (initialWorkspace.project === undefined) {
|
||||
if (arg !== 'My-Workspaces') {
|
||||
initialWorkspace.type = 'Plugin'
|
||||
initialWorkspace.project = arg
|
||||
} else {
|
||||
initialWorkspace.type = 'My-Workspaces'
|
||||
initialWorkspace.project = ''
|
||||
}
|
||||
} else {
|
||||
initialWorkspace.name = arg
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
run(initialWorkspace)
|
||||
|
||||
async function run() {
|
||||
async function run(initialWorkspace) {
|
||||
PL.app = require('./Platform/PlatformApp.js').newPlatformApp()
|
||||
await PL.app.run()
|
||||
await PL.app.run(initialWorkspace)
|
||||
console.log('Superalgos Platform App is Running!')
|
||||
if(process.send) {
|
||||
process.send("Running")
|
||||
}
|
||||
}
|
||||
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
File renamed without changes.
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
File renamed without changes.
+12770
-6658
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"type": "Algorithmic-Trading Project",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"iconPathOn": "algorithmic-trading-project",
|
||||
"iconPathOff": "algorithmic-trading-project",
|
||||
"iconProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Mine",
|
||||
"relatedUiObject": "Trading Mine",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Engine",
|
||||
"relatedUiObject": "Trading Engine",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading System",
|
||||
"relatedUiObject": "Trading System",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity"
|
||||
}
|
||||
],
|
||||
"isProjectHead": true,
|
||||
"isTitleAllwaysVisible": false,
|
||||
"addLeftIcons": true,
|
||||
"isPinned": true,
|
||||
"positionLocked": true,
|
||||
"icon": "algorithmic-trading-project",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "projectDefinition",
|
||||
"type": "node",
|
||||
"childType": "Project Definition",
|
||||
"project": "Foundations",
|
||||
"autoAdd": true
|
||||
}
|
||||
]
|
||||
}
|
||||
+18
-7
@@ -7,28 +7,36 @@
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration",
|
||||
"dontShowAtFullscreen": true,
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Process Definition",
|
||||
"relatedUiObject": "Process Definition",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Product Definition",
|
||||
"relatedUiObject": "Product Definition",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Product Definition Folder",
|
||||
"relatedUiObject": "Product Definition Folder",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
@@ -54,19 +62,22 @@
|
||||
"name": "processes",
|
||||
"type": "array",
|
||||
"childType": "Process Definition",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "products",
|
||||
"type": "array",
|
||||
"childType": "Product Definition",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "productDefinitionFolders",
|
||||
"type": "array",
|
||||
"childType": "Product Definition Folder",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
}
|
||||
],
|
||||
"propertyNameAtParent": "tradingBots"
|
||||
+10
-4
@@ -5,10 +5,13 @@
|
||||
"action": "Add Missing Children",
|
||||
"label": "Add Missing Children",
|
||||
"relatedUiObject": "Trading Engine",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"relatedUiObjectProject": "Algorithmic-Trading"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
@@ -25,19 +28,22 @@
|
||||
"name": "tradingCurrent",
|
||||
"type": "node",
|
||||
"childType": "Trading Current",
|
||||
"autoAdd": true
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "tradingLast",
|
||||
"type": "node",
|
||||
"childType": "Trading Last",
|
||||
"autoAdd": true
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "exchangeOrders",
|
||||
"type": "node",
|
||||
"childType": "Exchange Orders",
|
||||
"autoAdd": true
|
||||
"autoAdd": false,
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
+14
-5
@@ -6,23 +6,30 @@
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration",
|
||||
"iconProject": "Foundations",
|
||||
"dontShowAtFullscreen": true,
|
||||
"actionFunction": "uiObject.configEditor.activate"
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"actionProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Bot",
|
||||
"relatedUiObject": "Trading Bot",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"relatedUiObjectProject": "Algorithmic-Trading",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Plotter",
|
||||
"relatedUiObject": "Plotter",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"relatedUiObjectProject": "Foundations",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
@@ -45,12 +52,14 @@
|
||||
{
|
||||
"name": "tradingBots",
|
||||
"type": "array",
|
||||
"childType": "Trading Bot"
|
||||
"childType": "Trading Bot",
|
||||
"project": "Algorithmic-Trading"
|
||||
},
|
||||
{
|
||||
"name": "plotters",
|
||||
"type": "array",
|
||||
"childType": "Plotter"
|
||||
"childType": "Plotter",
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
+11
-4
@@ -5,7 +5,9 @@
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Trading Strategy",
|
||||
"relatedUiObject": "Trading Strategy",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
@@ -13,10 +15,13 @@
|
||||
"propertyToCheckFor": "dynamicIndicators",
|
||||
"label": "Add Dynamic Indicators",
|
||||
"relatedUiObject": "Dynamic Indicators",
|
||||
"actionFunction": "payload.executeAction"
|
||||
"actionFunction": "payload.executeAction",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"relatedUiObjectProject": "Foundations"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Visual-Scripting",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
@@ -33,13 +38,15 @@
|
||||
"name": "tradingStrategies",
|
||||
"type": "array",
|
||||
"childType": "Trading Strategy",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
},
|
||||
{
|
||||
"name": "dynamicIndicators",
|
||||
"type": "node",
|
||||
"childType": "Dynamic Indicators",
|
||||
"autoAdd": true
|
||||
"autoAdd": true,
|
||||
"project": "Foundations"
|
||||
}
|
||||
]
|
||||
}
|
||||
+5
@@ -8,6 +8,11 @@
|
||||
"language": "ES",
|
||||
"text": "Un Trading Bot es un programa informático que, basado en conjuntos de datos expuestos como productos por otros bots (sensores de conteo, indicadores e incluso otros trading bots ), aplica la lógica trading definida en un Trading System para, por un lado, generar una simulación de trading completa (generando conjuntos de datos que incluyen operaciones, la acción de estrategias, validación de condiciones, etc.) y, por otro lado, gestiona la ejecución de órdenes en una sesión ya sea en vivo o no.",
|
||||
"updated": 1624375084844
|
||||
},
|
||||
{
|
||||
"language": "RU",
|
||||
"text": "Торговый бот — это компьютерная программа, которая на основе наборов данных, представленных в качестве продуктов другими ботами (датчики подсчета, индикаторы и даже другие торговые боты), применяет торговую логику, определенную в торговой системе, с одной стороны, для создания полной торговой симуляции (вывод наборов данных, которые включают сделки, действие стратегий, проверку условий и т. д.), а с другой стороны, управляет исполнением ордеров во время форвардного тестирования или реальной торговой сессии.",
|
||||
"updated": 1636194335057
|
||||
}
|
||||
]
|
||||
},
|
||||
File renamed without changes.
File renamed without changes.
+10
@@ -7,6 +7,16 @@
|
||||
"language": "ES",
|
||||
"text": "Un trading system es un marco que maneja la lógica de bajo nivel que sirve para estructurar los procesos y métodos utilizados para implementar y desplegar estrategias de trading.",
|
||||
"updated": 1624375355452
|
||||
},
|
||||
{
|
||||
"language": "RU",
|
||||
"text": "Торговая система - это структура, управляющая логикой низкого уровня, которая служит для структурирования процессов и методов, используемых для реализации и развертывания торговых стратегий.",
|
||||
"updated": 1636194401995
|
||||
},
|
||||
{
|
||||
"language": "DE",
|
||||
"text": "Ein Handelssystem ist ein Framework, der die Low-Level-Logik handhabt, die dazu dient, die Prozesse und Methoden zu strukturieren, die zur Umsetzung und Anwendung von trading strategies verwendet werden.",
|
||||
"updated": 1636658948319
|
||||
}
|
||||
]
|
||||
},
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesExchangeAPI = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesExchangeAPI = function (processIndex) {
|
||||
|
||||
let MODULE_NAME = "Exchange API";
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
logError('key.length:' + exchangeApiKey.config.codeName.length)
|
||||
logError('secret.length:' + exchangeApiKey.config.secret.length)
|
||||
logError('Double check that you copied the key at the codeName property and the secret at secret property without bringing any invisible caracter from the exchange web site, or leaving any character from the sample text. Also check that the keys are not disabled at the exchange ot that they are not restricted by IP.')
|
||||
logError('As a remainder. Binance key and secret are 64 bytes in lenght each one. ')
|
||||
logError('As a remainder. Binance key and secret are 64 bytes in length each one. ')
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-11
@@ -1,8 +1,7 @@
|
||||
exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesOrdersCalculations = function (processIndex) {
|
||||
/*
|
||||
When we are live trading, we need to syncronize with the exchange.
|
||||
When we are live trading, we need to synchronize with the exchange.
|
||||
*/
|
||||
const MODULE_NAME = 'Orders Calculations'
|
||||
|
||||
let thisObject = {
|
||||
actualSizeCalculation: actualSizeCalculation,
|
||||
@@ -49,7 +48,7 @@ exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
|
||||
If it happens that the size accepted (Actual Size) is different than the
|
||||
size requested (Size), we need to make several adjustments so that the
|
||||
accounting syncronizes with reality.
|
||||
accounting synchronizes with reality.
|
||||
*/
|
||||
|
||||
/* This calculation needs to happen only once, the first time the order is checked. */
|
||||
@@ -66,8 +65,8 @@ exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
function recalculateActualSize() {
|
||||
/*
|
||||
We will recalculate the Quoted Asset Actual Size. This will also give to it an initial value.
|
||||
In the next formula, we are unsing the rate of the order because we dont know yet the Actual Rate.
|
||||
This rate might be replaced afteerwards for the Actual Rate when this is calculated again once
|
||||
In the next formula, we are using the rate of the order because we dont know yet the Actual Rate.
|
||||
This rate might be replaced afterwards for the Actual Rate when this is calculated again once
|
||||
the Actual Rate is known.
|
||||
*/
|
||||
tradingEngineOrder.orderQuotedAsset.actualSize.value = tradingEngineOrder.orderBaseAsset.actualSize.value * tradingEngineOrder.rate.value
|
||||
@@ -134,7 +133,7 @@ exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
tradingEngineOrder.orderStatistics.actualRate.value = TS.projects.foundations.utilities.miscellaneousFunctions.truncateToThisPrecision(tradingEngineOrder.orderStatistics.actualRate.value, 10)
|
||||
|
||||
/*
|
||||
If the Actual Rate happens to be exctly the same than the order rate, then there is
|
||||
If the Actual Rate happens to be exactly the same than the order rate, then there is
|
||||
nothing else to do here. Otherwise there are adjustments to be made.
|
||||
*/
|
||||
if (tradingEngineOrder.orderStatistics.actualRate.value === tradingEngineOrder.rate.value) { return }
|
||||
@@ -147,12 +146,12 @@ exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
function recalculateActualSize() {
|
||||
/*
|
||||
Now we know the Actual Rate at which the order was filled. Since the actual rate
|
||||
is not the same as the Rate we defined for the order, we need to syncronize
|
||||
is not the same as the Rate we defined for the order, we need to synchronize
|
||||
the Actual Order Size for Quoted Asset since it was calculated with the Order Size that we
|
||||
now know it is not the one really used at the exchange. We will recalculate the
|
||||
Actual Size in Quoted Asset and not in Base Asset, since the Actual Size in Base Asset
|
||||
is the one we accepted by the exchange, so that is fixed, regardless of how we initially
|
||||
got the Order Size in Base Asset, either from direct imput from the user or calculated
|
||||
got the Order Size in Base Asset, either from direct input from the user or calculated
|
||||
from the Order Size in Quoted Asset input it by the user. So here we go.
|
||||
*/
|
||||
previousQuotedAssetActualSize = tradingEngineOrder.orderQuotedAsset.actualSize.value
|
||||
@@ -271,7 +270,7 @@ exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
async function feesPaidCalculation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, order, applyFeePercentage) {
|
||||
/*
|
||||
Within the order information received from the exchange we can not see the fees paid so we need to
|
||||
calculate them ourselves. Knwowing the Fees Paid is critical to later update the balances correctly,
|
||||
calculate them ourselves. Knowing the Fees Paid is critical to later update the balances correctly,
|
||||
since at every trade we will receive less than just the Actual Size. In fact we will receive the Actual
|
||||
Size minus the Fees Paid.
|
||||
|
||||
@@ -325,7 +324,7 @@ exports.newFoundationsBotModulesOrdersCalculations = function (processIndex) {
|
||||
/*
|
||||
This calculation is for informational purposes, so that users do not have to calculate
|
||||
it by themselves. The Amount Received out of the trade depends if we are Buying or Selling
|
||||
the Base Asset. If we are Buying, then the Amount Receiced will be in Base Asset. If we
|
||||
the Base Asset. If we are Buying, then the Amount Received will be in Base Asset. If we
|
||||
are selling then it will be in Quoted Asset.
|
||||
*/
|
||||
|
||||
+7
-8
@@ -1,8 +1,7 @@
|
||||
exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesOrdersSimulations = function (processIndex) {
|
||||
/*
|
||||
When we are backtesting or paper trading, we need to simulate what would have happened at the exchange.
|
||||
*/
|
||||
const MODULE_NAME = 'Orders Simulations'
|
||||
|
||||
let thisObject = {
|
||||
actualSizeSimulation: actualSizeSimulation,
|
||||
@@ -37,7 +36,7 @@ exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
async function actualSizeSimulation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, applyFeePercentage) {
|
||||
/*
|
||||
The Actual Size is the size the exchange accepts for the order,
|
||||
regarless of the size sent in the request to the exchange.
|
||||
regardless of the size sent in the request to the exchange.
|
||||
|
||||
While backtesting and paper trading, we do not really need to
|
||||
simulate an Actual Size. We will just copy to that field the
|
||||
@@ -82,7 +81,7 @@ exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
switch (tradingEngineOrder.type) {
|
||||
case 'Market Order': {
|
||||
|
||||
/* Actual Rate is simulated based on the Session Paremeters */
|
||||
/* Actual Rate is simulated based on the Session Parameters */
|
||||
let slippageAmount = tradingEngineOrder.rate.value * sessionParameters.slippage.config.marketOrderRate / 100
|
||||
if (slippageAmount !== 0) {
|
||||
switch (tradingSystemOrder.type) {
|
||||
@@ -198,7 +197,7 @@ exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
Until here we have got the Actual Rate based on the formula definition or based on session parameters slippage.
|
||||
The last check is about watching what happened in the market. Let's remember that the exchange will
|
||||
fill the order with the best possible matches at it's order book. That means that if the rate
|
||||
we set for the order was too low (for a sale order) or too hight (for a buy order), the actual rate
|
||||
we set for the order was too low (for a sale order) or too height (for a buy order), the actual rate
|
||||
should be better than expected.
|
||||
|
||||
We don't know what it is at the order book, but whe know that the last candle includes trades that bounced between
|
||||
@@ -304,7 +303,7 @@ exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
if (tradingEngineOrder.orderStatistics.actualRate.value === tradingEngineOrder.rate.value) { return }
|
||||
/*
|
||||
Since the Actual Rate might have changed, we need to recalculate the Size Placed, where we accumulate all the Size Placed of
|
||||
all orders of a Stage. For Base Asset there is nothing to do, since the Actual Rate does not have an inpact on it.
|
||||
all orders of a Stage. For Base Asset there is nothing to do, since the Actual Rate does not have an impact on it.
|
||||
|
||||
For Quoted Asset, we need to first unaccount what this same orded added before to Size Placed (with the precious Actual Size) and
|
||||
account with the new Actual Size.
|
||||
@@ -463,7 +462,7 @@ exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
}
|
||||
|
||||
/*
|
||||
Another way to simulate the Fees Paid is by using the Session Paremeters configuration for Fees.
|
||||
Another way to simulate the Fees Paid is by using the Session Parameters configuration for Fees.
|
||||
*/
|
||||
switch (tradingEngineOrder.type) {
|
||||
case 'Market Order': {
|
||||
@@ -511,7 +510,7 @@ exports.newFoundationsBotModulesOrdersSimulations = function (processIndex) {
|
||||
/*
|
||||
This simulation is for informational purposes, so that users do not have to calculate
|
||||
it by themselves. The Amount Received out of the trade depends if we are Buying or Selling
|
||||
the Base Asset. If we are Buying, then the Amount Receiced will be in Base Asset. If we
|
||||
the Base Asset. If we are Buying, then the Amount Received will be in Base Asset. If we
|
||||
are selling then it will be in Quoted Asset.
|
||||
*/
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesSnapshots = function(processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesSnapshots = function(processIndex) {
|
||||
/*
|
||||
This module encapsulates the snapshots functionality.
|
||||
*/
|
||||
@@ -135,7 +135,7 @@ exports.newFoundationsBotModulesSnapshots = function(processIndex) {
|
||||
function evalNode(node) {
|
||||
if (node === undefined) { return }
|
||||
|
||||
/* Here we check if there is a codition to be evaluated */
|
||||
/* Here we check if there is a condition to be evaluated */
|
||||
if (node.type === 'Condition') {
|
||||
/* We will eval this condition */
|
||||
evalCondition(node)
|
||||
@@ -154,7 +154,7 @@ exports.newFoundationsBotModulesSnapshots = function(processIndex) {
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
@@ -398,7 +398,7 @@ exports.newFoundationsBotModulesSnapshots = function(processIndex) {
|
||||
if (record[record.length - 1] === undefined && contentArray.length > 0) {
|
||||
|
||||
let rowToMutateArray = contentArray[contentArray.length - 1].split(',')
|
||||
// check if are for sure on the same tradenumber and merge the data and remove previous line incl separator
|
||||
// check if are for sure on the same trade number and merge the data and remove previous line incl separator
|
||||
if (rowToMutateArray[0] == record[0]) {
|
||||
record.pop()
|
||||
rowToMutateArray.splice(0, record.length)
|
||||
@@ -451,7 +451,7 @@ exports.newFoundationsBotModulesSnapshots = function(processIndex) {
|
||||
function onFileReceived(err, text) {
|
||||
if (err.result === TS.projects.foundations.globals.standardResponses.DEFAULT_OK_RESPONSE.result) {
|
||||
try {
|
||||
// remove the last linebreak and seperator which is introduced extra during save
|
||||
// remove the last linebreak and separator which is introduced extra during save
|
||||
text = text.replace(/\n$/, '')
|
||||
text = text.replace(/\r\n$/, '')
|
||||
writeOutput(text)
|
||||
+7
-7
@@ -1,9 +1,9 @@
|
||||
exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingEngine = function (processIndex) {
|
||||
/*
|
||||
We call the Trading Engine to the data structure that is needed in order to exevute the
|
||||
We call the Trading Engine to the data structure that is needed in order to execute the
|
||||
trading protocol with the specific rules defined at the Trading System.
|
||||
*/
|
||||
const MODULE_NAME = 'Trading Engine'
|
||||
|
||||
let thisObject = {
|
||||
mantain: mantain,
|
||||
reset: reset,
|
||||
@@ -31,7 +31,7 @@ exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
|
||||
|
||||
if (TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).IS_SESSION_FIRST_LOOP === true) {
|
||||
/*
|
||||
Here we will go through all the nodes in the Trading Engine hiriarchy and
|
||||
Here we will go through all the nodes in the Trading Engine hierarchy and
|
||||
apply the initial value to the value property when needed
|
||||
*/
|
||||
initializeNode(tradingEngine)
|
||||
@@ -116,7 +116,7 @@ exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
@@ -155,7 +155,7 @@ exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
@@ -198,7 +198,7 @@ exports.newFoundationsBotModulesTradingEngine = function (processIndex) {
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
+3
-4
@@ -1,8 +1,7 @@
|
||||
exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingEpisode = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Episodes.
|
||||
*/
|
||||
const MODULE_NAME = 'Trading Episode'
|
||||
let thisObject = {
|
||||
mantain: mantain,
|
||||
reset: reset,
|
||||
@@ -109,7 +108,7 @@ exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
|
||||
|
||||
function updateStatistics() {
|
||||
|
||||
/* Daus Calculation */
|
||||
/* Days Calculation */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeStatistics.days.value =
|
||||
tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeCounters.periods.value *
|
||||
sessionParameters.timeFrame.config.value /
|
||||
@@ -262,7 +261,7 @@ exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
|
||||
}
|
||||
|
||||
function updateDistanceToTradingEventsCounters() {
|
||||
/* Keeping Distance Counters Up-to-date while avoinding counting before the first event happens. */
|
||||
/* Keeping Distance Counters Up-to-date while avoiding counting before the first event happens. */
|
||||
if (
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.triggerOn.value > 0
|
||||
) {
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
exports.newFoundationsBotModulesTradingExecution = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingExecution = function (processIndex) {
|
||||
/*
|
||||
The Trading Execution modules manages the execution nodes and execution algoritms.
|
||||
The Trading Execution modules manages the execution nodes and execution algorithms.
|
||||
*/
|
||||
const MODULE_NAME = 'Trading Execution'
|
||||
|
||||
@@ -16,7 +16,7 @@ exports.newFoundationsBotModulesTradingExecution = function (processIndex) {
|
||||
let tradingSystem
|
||||
let sessionParameters
|
||||
|
||||
let tradingOrdersModuleObject = TS.projects.foundations.botModules.tradingOrders.newFoundationsBotModulesTradingOrders(processIndex)
|
||||
let tradingOrdersModuleObject = TS.projects.algorithmicTrading.botModules.tradingOrders.newAlgorithmicTradingBotModulesTradingOrders(processIndex)
|
||||
|
||||
return thisObject
|
||||
|
||||
+16
-16
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingOrders = function (processIndex) {
|
||||
/*
|
||||
The Trading Orders modules manages the execution of orders against the exchanges.
|
||||
*/
|
||||
@@ -16,8 +16,8 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let tradingSystem
|
||||
let sessionParameters
|
||||
|
||||
let exchangeAPIModuleObject = TS.projects.foundations.botModules.exchangeAPI.newFoundationsBotModulesExchangeAPI(processIndex)
|
||||
let announcementsModuleObject = TS.projects.foundations.botModules.announcements.newFoundationsBotModulesAnnouncements(processIndex)
|
||||
let exchangeAPIModuleObject = TS.projects.algorithmicTrading.botModules.exchangeAPI.newAlgorithmicTradingBotModulesExchangeAPI(processIndex)
|
||||
let announcementsModuleObject = TS.projects.socialBots.botModules.announcements.newSocialBotsBotModulesAnnouncements(processIndex)
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -226,7 +226,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let situationName = await checkOrderEvent(tradingSystemOrder.cancelOrderEvent, tradingSystemOrder, executionAlgorithm, executionNode)
|
||||
if (situationName !== undefined) {
|
||||
|
||||
/* Simulate Order Cancelation, if needed. */
|
||||
/* Simulate Order Cancellation, if needed. */
|
||||
simulateCancelOrder(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, 'Cancel Event')
|
||||
|
||||
/* Cancel the order at the Exchange, if needed. */
|
||||
@@ -731,8 +731,8 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
/* Close this Order */
|
||||
tradingEngineOrder.status.value = 'Closed'
|
||||
/*
|
||||
We must be carefull here not to overide an already defined exitType. It can happen
|
||||
for instance that the order was cancellerd from the but veryfing the cancellation
|
||||
We must be carefully here not to override an already defined exitType. It can happen
|
||||
for instance that the order was cancelled from the but verifying the cancellation
|
||||
was not possible because of a connection to the exchange problem. In that case
|
||||
the exit type was defined but the order was kept open until the verification could be done.
|
||||
*/
|
||||
@@ -764,7 +764,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
}
|
||||
|
||||
/*
|
||||
If the order happens to be at least partially filled, there is a syncronization work
|
||||
If the order happens to be at least partially filled, there is a synchronization work
|
||||
we need to do, that includes discovering which is the Actual Rate the order is being filled,
|
||||
the Fees Paid and many other thing we need to account for.
|
||||
*/
|
||||
@@ -843,7 +843,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let previousBaseAssetFeesPaid = tradingEngineOrder.orderBaseAsset.feesPaid.value
|
||||
let previousQuotedAssetFeesPaid = tradingEngineOrder.orderQuotedAsset.feesPaid.value
|
||||
|
||||
let ordersSimulationsModuleObject = TS.projects.foundations.botModules.ordersSimulations.newFoundationsBotModulesOrdersSimulations(processIndex)
|
||||
let ordersSimulationsModuleObject = TS.projects.algorithmicTrading.botModules.ordersSimulations.newAlgorithmicTradingBotModulesOrdersSimulations(processIndex)
|
||||
ordersSimulationsModuleObject.initialize()
|
||||
|
||||
ordersSimulationsModuleObject.actualSizeSimulation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, applyFeePercentage)
|
||||
@@ -874,7 +874,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
let previousBaseAssetFeesPaid = tradingEngineOrder.orderBaseAsset.feesPaid.value
|
||||
let previousQuotedAssetFeesPaid = tradingEngineOrder.orderQuotedAsset.feesPaid.value
|
||||
|
||||
let ordersCalculationsModuleObject = TS.projects.foundations.botModules.ordersCalculations.newFoundationsBotModulesOrdersCalculations(processIndex)
|
||||
let ordersCalculationsModuleObject = TS.projects.algorithmicTrading.botModules.ordersCalculations.newAlgorithmicTradingBotModulesOrdersCalculations(processIndex)
|
||||
ordersCalculationsModuleObject.initialize()
|
||||
|
||||
await ordersCalculationsModuleObject.actualSizeCalculation(tradingEngineStage, tradingSystemOrder, tradingEngineOrder, order, applyFeePercentage)
|
||||
@@ -1118,7 +1118,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
if (order.status === 'NotFound') {
|
||||
/*
|
||||
Some exchanges, like Coinbase Pro, deletes orders after being cancelled, and when we request information
|
||||
about them, it returns null. We will interprate this as ORDER NOT FOUND.
|
||||
about them, it returns null. We will interpret this as ORDER NOT FOUND.
|
||||
*/
|
||||
const message = 'Order Not Found at the Exchange'
|
||||
let docs = {
|
||||
@@ -1136,8 +1136,8 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
]
|
||||
)
|
||||
/*
|
||||
We must be carefull here not to overide an already defined exitType. It can happen
|
||||
for instance that the order was cancellerd from the but veryfing the cancellation
|
||||
We must be carefully here not to overide an already defined exitType. It can happen
|
||||
for instance that the order was cancelled from the but verifying the cancellation
|
||||
was not possible because of a connection to the exchange problem. In that case
|
||||
the exit type was defined but the order was kept open until the verification could be done.
|
||||
*/
|
||||
@@ -1148,7 +1148,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
|
||||
/*
|
||||
Close this Order. Note that we are not closing the order until we have the exchange
|
||||
response with the order details that we can use to syncronize with our accoounting.
|
||||
response with the order details that we can use to synchronize with our accounting.
|
||||
Otherwise if the connection to the exchange fails, we would have a closed order not
|
||||
accounted in any way.
|
||||
*/
|
||||
@@ -1182,8 +1182,8 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
async function recalculateStageSize(tradingEngineStage, tradingEngineOrder) {
|
||||
/*
|
||||
Since the order is Cancelled, we need to adjust the stage sizePlaced. Remember that the Stage
|
||||
Size Placed accumulates for each asset, the order size placed at the exchange. A cancelation means that
|
||||
only the part filled can be considered placed, so we need to substract from the stage size
|
||||
Size Placed accumulates for each asset, the order size placed at the exchange. A cancellation means that
|
||||
only the part filled can be considered placed, so we need to subtract from the stage size
|
||||
the remainder. To achieve this with the information we currently have, we are going first
|
||||
to unaccount the order actual size, and the account only the sizeFilled + the feesPaid.
|
||||
*/
|
||||
@@ -1262,7 +1262,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
tradingSystem.highlights.push(executionAlgorithm.id)
|
||||
tradingSystem.highlights.push(executionNode.id)
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(event)
|
||||
announcementsModuleObject.makeAnnouncements(event)
|
||||
return situation.name // if the event is triggered, we return the name of the situation that passed
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
exports.newFoundationsBotModulesTradingOutput = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingOutput = function (processIndex) {
|
||||
/*
|
||||
This module will load if necesary all the data outputs so that they can be appended with new
|
||||
This module will load if necessary all the data outputs so that they can be appended with new
|
||||
records if needed. After running the simulation, it will save all the data outputs.
|
||||
*/
|
||||
const MODULE_NAME = 'Trading Output'
|
||||
@@ -29,9 +29,9 @@ exports.newFoundationsBotModulesTradingOutput = function (processIndex) {
|
||||
}
|
||||
|
||||
/* Preparing everything for the Simulation */
|
||||
let tradingSimulationModuleObject = TS.projects.foundations.botModules.tradingSimulation.newFoundationsBotModulesTradingSimulation(processIndex)
|
||||
let tradingSimulationModuleObject = TS.projects.algorithmicTrading.botModules.tradingSimulation.newAlgorithmicTradingBotModulesTradingSimulation(processIndex)
|
||||
|
||||
let outputDatasets = TS.projects.foundations.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
|
||||
let outputDatasets = TS.projects.visualScripting.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
|
||||
let outputDatasetsMap = new Map()
|
||||
|
||||
await TS.projects.foundations.functionLibraries.outputManagementFunctions.readFiles(
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingPosition = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingPosition = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Positions.
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ exports.newFoundationsBotModulesTradingPosition = function (processIndex) {
|
||||
/* Updating Episode Counters */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeCounters.positions.value++
|
||||
|
||||
/* Inicializing this counter */
|
||||
/* Initializing this counter */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.takePosition.value = 1
|
||||
|
||||
/* Remember the balance we had before taking the position to later calculate profit or loss */
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingProcess = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingProcess = function (processIndex) {
|
||||
/*
|
||||
This Module will load all the process data dependencies from files and send them downstream.
|
||||
After execution, will save the time range and status report of the process.
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
let dataFiles = new Map()
|
||||
let multiTimeFrameDataFiles = new Map()
|
||||
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT = TS.projects.foundations.botModules.tradingEngine.newFoundationsBotModulesTradingEngine(processIndex)
|
||||
let tradingOutputModuleObject = TS.projects.foundations.botModules.tradingOutput.newFoundationsBotModulesTradingOutput(processIndex)
|
||||
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT = TS.projects.algorithmicTrading.botModules.tradingEngine.newAlgorithmicTradingBotModulesTradingEngine(processIndex)
|
||||
let tradingOutputModuleObject = TS.projects.algorithmicTrading.botModules.tradingOutput.newAlgorithmicTradingBotModulesTradingOutput(processIndex)
|
||||
|
||||
let currentTimeFrame = {}
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
This is the Date that is going to be used across the execution of this Trading Process.
|
||||
We need this because it has a different life cycle than the processData stored at the
|
||||
Trading Engine data structure. This date has to remain the same during the whole execution
|
||||
of the Trading Process until the end, inclusind the writing of Data Ranges and Status Reports.
|
||||
of the Trading Process until the end, including the writing of Data Ranges and Status Reports.
|
||||
The processDate of the Trading Engine data structure on the other hand can be changed during
|
||||
the simulation loop, once we discover that all candles from a certain date have benn processed.
|
||||
Here is the point where we sync one and the other.
|
||||
@@ -108,7 +108,7 @@
|
||||
Here we check if we need to get Daily Files or not. As an optimization, when
|
||||
we are running on a Time Frame of 1hs or above, we are not going to load
|
||||
dependencies on Daily Files. The way we recognize that is by checking if
|
||||
we alreaady set a value to currentTimeFrame.value. We are also not going to loop
|
||||
we already set a value to currentTimeFrame.value. We are also not going to loop
|
||||
through days if we are processing market files.
|
||||
*/
|
||||
if (currentTimeFrame.value) {
|
||||
@@ -290,7 +290,7 @@
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
/* An unhandled exception occured. in this case we return Fail and log the stack. */
|
||||
/* An unhandled exception occurred. in this case we return Fail and log the stack. */
|
||||
if (err.stack) {
|
||||
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
@@ -307,7 +307,7 @@
|
||||
return
|
||||
}
|
||||
|
||||
/* Some other handled exception occured. We return Fail and move on. */
|
||||
/* Some other handled exception occurred. We return Fail and move on. */
|
||||
if (err.result !== TS.projects.foundations.globals.standardResponses.DEFAULT_OK_RESPONSE.result) {
|
||||
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
|
||||
+12
-12
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingRecords = function (processIndex) {
|
||||
/*
|
||||
This module facilitates the appending of records to the output of the process.
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
we have a pointer to the node that have the information we need to extract.
|
||||
Later, based on the product record definition we will extract each individual value.
|
||||
*/
|
||||
let outputDatasets = TS.projects.foundations.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
|
||||
let outputDatasets = TS.projects.visualScripting.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processOutput, 'Output Dataset')
|
||||
|
||||
for (let i = 0; i < outputDatasets.length; i++) {
|
||||
let outputDatasetNode = outputDatasets[i]
|
||||
@@ -95,14 +95,14 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
*/
|
||||
for (let index = 0; index < productRoot.length; index++) {
|
||||
/*
|
||||
The Product Root Node is the root of the node hiriarchy from where we are going to extract the record values.
|
||||
The Product Root Node is the root of the node hierarchy from where we are going to extract the record values.
|
||||
*/
|
||||
let productRootNode = productRoot[index]
|
||||
let record = scanRecordDefinition(product, productRootNode, index)
|
||||
if (record !== undefined) {
|
||||
/*
|
||||
We will add the index value to the record itself, so that the plotter can know to which
|
||||
brach of the trading engine data structure it belongs.
|
||||
branch of the trading engine data structure it belongs.
|
||||
*/
|
||||
record.push(index)
|
||||
persistIndividualRecord(record, product, outputDatasetArray)
|
||||
@@ -114,7 +114,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
the record to be saved at the output file.
|
||||
*/
|
||||
/*
|
||||
The Product Root Node is the root of the node hiriarchy from where we are going to extract the record values.
|
||||
The Product Root Node is the root of the node hierarchy from where we are going to extract the record values.
|
||||
*/
|
||||
let productRootNode = productRoot
|
||||
let record = scanRecordDefinition(product, productRootNode)
|
||||
@@ -131,7 +131,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
for (let j = 0; j < product.record.properties.length; j++) {
|
||||
let recordProperty = product.record.properties[j]
|
||||
/*
|
||||
The Property Root Node is the Root of the Hiriarchy branch we must find in order
|
||||
The Property Root Node is the Root of the Hierarchy branch we must find in order
|
||||
to get the node where we are going to extract the value. Initially
|
||||
we point it to the Product Root Node, because that is the default in case
|
||||
a property does not have at its configuration a different nodePath configured
|
||||
@@ -150,7 +150,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
The Target Node is the node from where we are going to exctract the value.
|
||||
The Target Node is the node from where we are going to extract the value.
|
||||
We will use the codeName of the Record Property to match it with
|
||||
any of the properties of the Root Node to get the Target Node.
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
targetNode = propertyRootNode[recordProperty.config.childProperty]
|
||||
}
|
||||
/*
|
||||
It can happen that intead of having a Node in targetNode what we have is an
|
||||
It can happen that instead of having a Node in targetNode what we have is an
|
||||
array of nodes. We need to pick one of the elements of the array and for that
|
||||
we use the Index value we find at the configuration of the Record Property.
|
||||
*/
|
||||
@@ -187,7 +187,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
of Nodes defined in the Record Properties but not all of them exist at the Root Node.
|
||||
We filter out those cases by not extracting the value from the value property.
|
||||
*/
|
||||
let value = 0 // This is a default value, since we do not want null in files because it breakes JSON format.
|
||||
let value = 0 // This is a default value, since we do not want null in files because it brakes JSON format.
|
||||
if (targetNode !== undefined) {
|
||||
if (targetNode.type !== undefined) {
|
||||
/*
|
||||
@@ -251,14 +251,14 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
/*
|
||||
When dealing with Daily Files, we need to avoid to write an open object at the last 'candle' of the day,
|
||||
since the object will be duplicated on the next day. How do we know we are positioned at the last candle
|
||||
of the day? Easy: the end of the candle must be 1 millisecod before the next day. That happens at any
|
||||
of the day? Easy: the end of the candle must be 1 millisecond before the next day. That happens at any
|
||||
time frame.
|
||||
*/
|
||||
let currentDay = new Date(tradingEngine.tradingCurrent.tradingEpisode.candle.end.value)
|
||||
let nextDay = new Date(tradingEngine.tradingCurrent.tradingEpisode.candle.end.value + 1)
|
||||
if (currentDay.getUTCDate() !== nextDay.getUTCDate()) {
|
||||
/*
|
||||
We will save the object only if it is closed, becasuse we are at the last candle of the day.
|
||||
We will save the object only if it is closed, because we are at the last candle of the day.
|
||||
*/
|
||||
if (propertyValue === product.config.propertyValueThatClosesObject) {
|
||||
outputDatasetArray.push(record)
|
||||
@@ -275,7 +275,7 @@ exports.newFoundationsBotModulesTradingRecords = function (processIndex) {
|
||||
}
|
||||
else {
|
||||
/*
|
||||
For Market Files we will add a record everytime that proeprty value does not match this
|
||||
For Market Files we will add a record everytime that property value does not match this
|
||||
*/
|
||||
if (propertyValue !== product.config.propertyValueThatPreventsSavingObject) {
|
||||
outputDatasetArray.push(record)
|
||||
+16
-16
@@ -1,6 +1,6 @@
|
||||
exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingSimulation = function (processIndex) {
|
||||
/*
|
||||
This Module represents the trading simulacion. Escentially a loop through a set of candles and
|
||||
This Module represents the trading simulation. Essentially a loop through a set of candles and
|
||||
the execution at each loop cycle of the Trading System Protocol.
|
||||
*/
|
||||
const MODULE_NAME = 'Trading Simulation -> ' + TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].session.name
|
||||
@@ -34,13 +34,13 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
'[INFO] runSimulation -> finalDatetime = ' + sessionParameters.timeRange.config.finalDatetime)
|
||||
|
||||
/* These are the Modules we will need to run the Simulation */
|
||||
let tradingRecordsModuleObject = TS.projects.foundations.botModules.tradingRecords.newFoundationsBotModulesTradingRecords(processIndex)
|
||||
let tradingRecordsModuleObject = TS.projects.algorithmicTrading.botModules.tradingRecords.newAlgorithmicTradingBotModulesTradingRecords(processIndex)
|
||||
tradingRecordsModuleObject.initialize(outputDatasetsMap)
|
||||
|
||||
let tradingSystemModuleObject = TS.projects.foundations.botModules.tradingSystem.newFoundationsBotModulesTradingSystem(processIndex)
|
||||
let tradingSystemModuleObject = TS.projects.algorithmicTrading.botModules.tradingSystem.newAlgorithmicTradingBotModulesTradingSystem(processIndex)
|
||||
tradingSystemModuleObject.initialize()
|
||||
|
||||
let tradingEpisodeModuleObject = TS.projects.foundations.botModules.tradingEpisode.newFoundationsBotModulesTradingEpisode(processIndex)
|
||||
let tradingEpisodeModuleObject = TS.projects.algorithmicTrading.botModules.tradingEpisode.newAlgorithmicTradingBotModulesTradingEpisode(processIndex)
|
||||
tradingEpisodeModuleObject.initialize()
|
||||
|
||||
/* Setting up the candles array: The whole simulation is based on the array of candles at the time-frame defined at the session parameters. */
|
||||
@@ -134,7 +134,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
|
||||
TS.projects.foundations.globals.processModuleObjects.MODULE_OBJECTS_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_ENGINE_MODULE_OBJECT.setCurrentCandle(candle) // We move the current candle we are standing at, to the trading engine data structure to make it available to anyone, including conditions and formulas.
|
||||
|
||||
/* We emit a heart beat so that the UI can now where we are at the overal process.*/
|
||||
/* We emit a heart beat so that the UI can now where we are at the overall process.*/
|
||||
heartBeat()
|
||||
|
||||
/* Opening the Episode, if needed. */
|
||||
@@ -157,7 +157,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
|
||||
/*
|
||||
Do the stuff needed previous to the run like
|
||||
Episode Counters and Statistics update. Mantaince is done
|
||||
Episode Counters and Statistics update. Maintenance is done
|
||||
once per simulation candle.
|
||||
*/
|
||||
tradingSystemModuleObject.mantain()
|
||||
@@ -176,7 +176,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
|
||||
/*
|
||||
We check if we need to stop before appending the records so that the stop
|
||||
reason is also propery recorded. Note also that we check this after the first
|
||||
reason is also properly recorded. Note also that we check this after the first
|
||||
cycle, where orders have not been submitted to the exchange yet, but we
|
||||
had the chance to check for the status of placed orders or even cancel
|
||||
the ones that needed cancellation.
|
||||
@@ -312,7 +312,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
let currentDate = new Date(heartBeatDate)
|
||||
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
|
||||
/*
|
||||
Theere are a few tasks that we need to do only when the date changes,
|
||||
There are a few tasks that we need to do only when the date changes,
|
||||
otherwise it would be suboptimal.
|
||||
*/
|
||||
if (heartBeatDate.valueOf() !== previousHeartBeatDate) {
|
||||
@@ -328,7 +328,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.newInternalLoop(currentDate, percentage)
|
||||
}
|
||||
|
||||
/* Date only hearbeat */
|
||||
/* Date only heartbeat */
|
||||
if (sessionParameters.heartbeats.config.date === true && sessionParameters.heartbeats.config.candleIndex === false) {
|
||||
hartbeatText = hartbeatText + currentDateString
|
||||
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, hartbeatText, percentage)
|
||||
@@ -337,7 +337,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
}
|
||||
|
||||
/*
|
||||
When the Candle Index nees to be shown, then we can not send the hearbet
|
||||
When the Candle Index needs to be shown, then we can not send the heartbeat
|
||||
only when the dates changes, we have to send it for every candle.
|
||||
It might also contain the date information.
|
||||
*/
|
||||
@@ -354,7 +354,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
|
||||
function positionDataStructuresAtCurrentCandle() {
|
||||
/*
|
||||
In conditions and Formulas, we want users to have an easy sintax to refer to indicators. In order to achieve that, we need the user to have
|
||||
In conditions and Formulas, we want users to have an easy syntax to refer to indicators. In order to achieve that, we need the user to have
|
||||
easy access to the current candle for instance, or the current bollinger band, meaning the one the Simulation is currently standing at.
|
||||
For that reason we do the following processing, to have at the chart data structure the current objects of each indicator / time frame.
|
||||
*/
|
||||
@@ -372,8 +372,8 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
}
|
||||
|
||||
function positionChart(chart) {
|
||||
let dataDependencies = TS.projects.foundations.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processDependencies, 'Data Dependency')
|
||||
dataDependencies = TS.projects.foundations.utilities.nodeFunctions.filterOutNodeWihtoutReferenceParentFromNodeArray(dataDependencies)
|
||||
let dataDependencies = TS.projects.visualScripting.utilities.nodeFunctions.nodeBranchToArray(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.processDependencies, 'Data Dependency')
|
||||
dataDependencies = TS.projects.visualScripting.utilities.nodeFunctions.filterOutNodeWihtoutReferenceParentFromNodeArray(dataDependencies)
|
||||
|
||||
/* Finding the Current Element on Daily Files */
|
||||
if (TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).TRADING_PROCESSING_DAILY_FILES) {
|
||||
@@ -483,7 +483,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
Note: for Daily Files, this means that the last candle of each day will never be processed.
|
||||
|
||||
The first +1 is because array indexes are based on 0.
|
||||
The second +1 is because we need to compare the next candle (remember that the loops allways avoid the
|
||||
The second +1 is because we need to compare the next candle (remember that the loops always avoid the
|
||||
last candle of the dataset available.)
|
||||
*/
|
||||
if (tradingEngine.tradingCurrent.tradingEpisode.candle.index.value + 1 + 1 === candles.length) {
|
||||
@@ -550,7 +550,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
|
||||
}
|
||||
|
||||
function checkMinimunAndMaximunBalance() {
|
||||
/* Checks for Minimun and Maximun Balance. We do the check while not inside any strategy only. */
|
||||
/* Checks for Minimum and Maximum Balance. We do the check while not inside any strategy only. */
|
||||
if (
|
||||
tradingEngine.tradingCurrent.strategy.index.value === tradingEngine.tradingCurrent.strategy.index.config.initialValue
|
||||
) {
|
||||
+101
-98
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingStages = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Stages.
|
||||
*/
|
||||
@@ -21,12 +21,12 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
let tradingStrategyModuleObject = TS.projects.foundations.botModules.tradingStrategy.newFoundationsBotModulesTradingStrategy(processIndex)
|
||||
let tradingPositionModuleObject = TS.projects.foundations.botModules.tradingPosition.newFoundationsBotModulesTradingPosition(processIndex)
|
||||
let tradingExecutionModuleObject = TS.projects.foundations.botModules.tradingExecution.newFoundationsBotModulesTradingExecution(processIndex)
|
||||
let announcementsModuleObject = TS.projects.foundations.botModules.announcements.newFoundationsBotModulesAnnouncements(processIndex)
|
||||
let snapshotsModuleObject = TS.projects.foundations.botModules.snapshots.newFoundationsBotModulesSnapshots(processIndex)
|
||||
let tradingEpisodeModuleObject = TS.projects.foundations.botModules.tradingEpisode.newFoundationsBotModulesTradingEpisode(processIndex)
|
||||
let tradingStrategyModuleObject = TS.projects.algorithmicTrading.botModules.tradingStrategy.newAlgorithmicTradingBotModulesTradingStrategy(processIndex)
|
||||
let tradingPositionModuleObject = TS.projects.algorithmicTrading.botModules.tradingPosition.newAlgorithmicTradingBotModulesTradingPosition(processIndex)
|
||||
let tradingExecutionModuleObject = TS.projects.algorithmicTrading.botModules.tradingExecution.newAlgorithmicTradingBotModulesTradingExecution(processIndex)
|
||||
let announcementsModuleObject = TS.projects.socialBots.botModules.announcements.newSocialBotsBotModulesAnnouncements(processIndex)
|
||||
let snapshotsModuleObject = TS.projects.algorithmicTrading.botModules.snapshots.newAlgorithmicTradingBotModulesSnapshots(processIndex)
|
||||
let tradingEpisodeModuleObject = TS.projects.algorithmicTrading.botModules.tradingEpisode.newAlgorithmicTradingBotModulesTradingEpisode(processIndex)
|
||||
|
||||
let tradingEngine
|
||||
let tradingSystem
|
||||
@@ -147,8 +147,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
/* Initialize this */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.triggerOn.value = 1
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(triggerStage.triggerOn)
|
||||
announcementsModuleObject.makeAnnoucements(triggerStage)
|
||||
announcementsModuleObject.makeAnnouncements(triggerStage.triggerOn)
|
||||
|
||||
if (TS.projects.foundations.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.type === 'Backtesting Session') {
|
||||
if (sessionParameters.snapshots !== undefined) {
|
||||
@@ -159,6 +158,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
}
|
||||
|
||||
changeStageStatus('Trigger Stage', 'Open')
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
tradingSystem.highlights.push(triggerStage.id)
|
||||
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.triggerOff.value = 1
|
||||
announcementsModuleObject.makeAnnoucements(triggerStage.triggerOff)
|
||||
announcementsModuleObject.makeAnnouncements(triggerStage.triggerOff)
|
||||
changeStageStatus('Trigger Stage', 'Closed', 'Trigger Off Event')
|
||||
tradingStrategyModuleObject.closeStrategy('Trigger Off')
|
||||
}
|
||||
@@ -233,8 +233,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
|
||||
tradingPositionModuleObject.openPosition(situation.name)
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(triggerStage.takePosition)
|
||||
announcementsModuleObject.makeAnnoucements(strategy.openStage)
|
||||
announcementsModuleObject.makeAnnouncements(triggerStage.takePosition)
|
||||
|
||||
if (TS.projects.foundations.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.type === 'Backtesting Session') {
|
||||
if (sessionParameters.snapshots !== undefined) {
|
||||
@@ -423,7 +422,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
|
||||
/*
|
||||
The system allows the user not to define a Manage Stage, because the Manage Stage is optional.
|
||||
Here we are going to see if that is the case and if it is, we will inmidiatelly consider
|
||||
Here we are going to see if that is the case and if it is, we will immediately consider
|
||||
the Manage Stage as closed.
|
||||
*/
|
||||
if (manageStage === undefined) {
|
||||
@@ -436,7 +435,6 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
|
||||
/* Now we switch to the Open status. */
|
||||
changeStageStatus('Manage Stage', 'Open')
|
||||
announcementsModuleObject.makeAnnoucements(manageStage)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +485,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
tradingPositionModuleObject.applyStopLossFormula(tradingSystem.formulas, phase.formula.id)
|
||||
|
||||
if (tradingEngine.tradingCurrent.position.stopLoss.value !== previousValue) {
|
||||
announcementsModuleObject.makeAnnoucements(phase)
|
||||
announcementsModuleObject.makeAnnouncements(phase)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,7 +508,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
tradingPositionModuleObject.applyTakeProfitFormula(tradingSystem.formulas, phase.formula.id)
|
||||
|
||||
if (tradingEngine.tradingCurrent.position.takeProfit.value !== previousValue) {
|
||||
announcementsModuleObject.makeAnnoucements(phase)
|
||||
announcementsModuleObject.makeAnnouncements(phase)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -591,7 +589,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
|
||||
tradingPositionModuleObject.updateStopLoss(tradingEngine.tradingCurrent.position.stopLoss.stopLossPhase.value + 1)
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(nextPhaseEvent)
|
||||
announcementsModuleObject.makeAnnouncements(nextPhaseEvent)
|
||||
|
||||
/* Reset this counter */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.nextPhase.value = 1
|
||||
@@ -642,7 +640,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
continue
|
||||
}
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(moveToPhaseEvent)
|
||||
announcementsModuleObject.makeAnnouncements(moveToPhaseEvent)
|
||||
|
||||
/* Reset this counter */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.moveToPhase.value = 1
|
||||
@@ -698,7 +696,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
|
||||
tradingPositionModuleObject.updateTakeProfit(tradingEngine.tradingCurrent.position.takeProfit.takeProfitPhase.value + 1)
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(nextPhaseEvent)
|
||||
announcementsModuleObject.makeAnnouncements(nextPhaseEvent)
|
||||
|
||||
/* Reset this counter */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.nextPhase.value = 1
|
||||
@@ -749,7 +747,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
continue
|
||||
}
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(moveToPhaseEvent)
|
||||
announcementsModuleObject.makeAnnouncements(moveToPhaseEvent)
|
||||
|
||||
/* Reset this counter */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.moveToPhase.value = 1
|
||||
@@ -762,54 +760,50 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
}
|
||||
|
||||
function checkStopLossOrTakeProfitWasHit() {
|
||||
{
|
||||
let strategy = tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value]
|
||||
/*
|
||||
Checking what happened since the last execution. We need to know if the Stop Loss
|
||||
or our Take Profit were hit.
|
||||
*/
|
||||
let strategy = tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value]
|
||||
/*
|
||||
Checking what happened since the last execution. We need to know if the Stop Loss
|
||||
or our Take Profit were hit.
|
||||
*/
|
||||
|
||||
/* Stop Loss condition: Here we verify if the Stop Loss was hit or not. */
|
||||
if (
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.stopLoss.stopLossPosition.value === 'Above' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.max.value >= tradingEngine.tradingCurrent.position.stopLoss.value
|
||||
) ||
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.stopLoss.stopLossPosition.value === 'Below' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.min.value <= tradingEngine.tradingCurrent.position.stopLoss.value
|
||||
)
|
||||
) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] checkStopLossOrTakeProfitWasHit -> Stop Loss was hit.')
|
||||
/* Stop Loss condition: Here we verify if the Stop Loss was hit or not. */
|
||||
if (
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.stopLoss.stopLossPosition.value === 'Above' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.max.value >= tradingEngine.tradingCurrent.position.stopLoss.value
|
||||
) ||
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.stopLoss.stopLossPosition.value === 'Below' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.min.value <= tradingEngine.tradingCurrent.position.stopLoss.value
|
||||
)
|
||||
) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] checkStopLossOrTakeProfitWasHit -> Stop Loss was hit.')
|
||||
|
||||
tradingPositionModuleObject.closingPosition('Stop Loss')
|
||||
changeStageStatus('Close Stage', 'Opening')
|
||||
changeStageStatus('Manage Stage', 'Closed', 'Stop Loss Hit')
|
||||
announcementsModuleObject.makeAnnoucements(strategy.closeStage)
|
||||
return
|
||||
}
|
||||
|
||||
/* Take Profit condition: Here we verify if the Take Profit was hit or not. */
|
||||
if (
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.takeProfit.takeProfitPosition.value === 'Below' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.min.value <= tradingEngine.tradingCurrent.position.takeProfit.value
|
||||
) ||
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.takeProfit.takeProfitPosition.value === 'Above' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.max.value >= tradingEngine.tradingCurrent.position.takeProfit.value
|
||||
)
|
||||
) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] checkStopLossOrTakeProfitWasHit -> Take Profit was hit.')
|
||||
|
||||
tradingPositionModuleObject.closingPosition('Take Profit')
|
||||
changeStageStatus('Close Stage', 'Opening')
|
||||
changeStageStatus('Manage Stage', 'Closed', 'Take Profit Hit')
|
||||
announcementsModuleObject.makeAnnoucements(strategy.closeStage)
|
||||
return
|
||||
}
|
||||
tradingPositionModuleObject.closingPosition('Stop Loss')
|
||||
changeStageStatus('Close Stage', 'Opening')
|
||||
changeStageStatus('Manage Stage', 'Closed', 'Stop Loss Hit')
|
||||
return
|
||||
}
|
||||
|
||||
/* Take Profit condition: Here we verify if the Take Profit was hit or not. */
|
||||
if (
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.takeProfit.takeProfitPosition.value === 'Below' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.min.value <= tradingEngine.tradingCurrent.position.takeProfit.value
|
||||
) ||
|
||||
(
|
||||
tradingEngine.tradingCurrent.position.takeProfit.takeProfitPosition.value === 'Above' &&
|
||||
tradingEngine.tradingCurrent.tradingEpisode.candle.max.value >= tradingEngine.tradingCurrent.position.takeProfit.value
|
||||
)
|
||||
) {
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] checkStopLossOrTakeProfitWasHit -> Take Profit was hit.')
|
||||
|
||||
tradingPositionModuleObject.closingPosition('Take Profit')
|
||||
changeStageStatus('Close Stage', 'Opening')
|
||||
changeStageStatus('Manage Stage', 'Closed', 'Take Profit Hit')
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -826,7 +820,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
if (tradingEngine.tradingCurrent.strategyCloseStage.status.value === 'Opening') {
|
||||
/*
|
||||
The system allows the user not to define a close stage, because the close stage is optional.
|
||||
Here we are goint to see if that is the case and if it is, we will inmidiatelly consider
|
||||
Here we are going to see if that is the case and if it is, we will immediately consider
|
||||
the close stage as closed.
|
||||
*/
|
||||
if (tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value].closeStage === undefined) {
|
||||
@@ -1030,7 +1024,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
The Target Size is defined by the end user either in Base Asset or Quoted Asset.
|
||||
Whatever the user chooses defines also the way we check if the Target was met.
|
||||
Why? Because the counterparty target is estimated with the Target Rate and it
|
||||
is not syncronized with the reality we later learn when the exchange tell us the
|
||||
is not synchronized with the reality we later learn when the exchange tell us the
|
||||
actual rate each of the orders where executed at.
|
||||
|
||||
For the same reason that the user does not know exactly which is the rate the orders
|
||||
@@ -1047,7 +1041,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
}
|
||||
/*
|
||||
We will also implement a mechanism to allow users declare an absolute value to add
|
||||
to the Size Filled before checking it againt the Stage Target Size.
|
||||
to the Size Filled before checking it against the Stage Target Size.
|
||||
*/
|
||||
let ABSOLUTE_DUST_IN_BASE_ASSET = 0
|
||||
if (tradingSystemStage.config.absoluteDustInBaseAsset !== undefined) {
|
||||
@@ -1114,7 +1108,7 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
tradingSystem.highlights.push(closeStageEvent.id)
|
||||
tradingSystem.highlights.push(stage.id)
|
||||
|
||||
announcementsModuleObject.makeAnnoucements(closeStageEvent)
|
||||
announcementsModuleObject.makeAnnouncements(closeStageEvent)
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -1148,20 +1142,22 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
if (stage.status.value === 'Open') {
|
||||
openStage(stage)
|
||||
checkUserDefinedCode(stageName, 'Open')
|
||||
checkAnnounce(stageName, stage.status.value)
|
||||
}
|
||||
if (stage.status.value === 'Closed') {
|
||||
checkUserDefinedCode(stageName, 'Closed')
|
||||
closeStage(stage, stageName)
|
||||
checkAnnounce(stageName, stage.status.value)
|
||||
}
|
||||
|
||||
/*
|
||||
The way the begining and end of the Stages object works is as follows:
|
||||
This object begins with the last cycle, that is the current cycle diplaced
|
||||
The way the beginning and end of the Stages object works is as follows:
|
||||
This object begins with the last cycle, that is the current cycle displayed
|
||||
backwards to the current candle. And it ends at the end of the last cycle.
|
||||
During mantainance, we add the time frame of the candle, since we assume it
|
||||
During maintenance, we add the time frame of the candle, since we assume it
|
||||
will survive the 2 cycles without the end being updated. If it closes,
|
||||
then we update the end to the end of the last cycle, overrinding the
|
||||
mantainance if needed. If we assume that in the same cycle there will be
|
||||
then we update the end to the end of the last cycle, overriding the
|
||||
maintenance if needed. If we assume that in the same cycle there will be
|
||||
no closing and opening of the same type of object, then there can be no
|
||||
overlap.
|
||||
*/
|
||||
@@ -1186,7 +1182,6 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
if (stageName === 'Close Stage') {
|
||||
if (tradingEngine.tradingCurrent.position.status.value === 'Open') {
|
||||
tradingPositionModuleObject.closingPosition('Close Stage Closed')
|
||||
/* NOTE:TODO: Announcement May need added Here */
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1271,33 +1266,41 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
|
||||
/* checkUserDefinedCode(): Checks if User Defined Code exists and processes if applicable. */
|
||||
function checkUserDefinedCode(stage, status, when) {
|
||||
let tradingSystemStage = getTradingSystemStage(stage);
|
||||
let tradingSystemStage = getTradingSystemStage(stage);
|
||||
|
||||
if (tradingSystemStage !== undefined &&
|
||||
tradingSystemStage.userDefinedCode !== undefined) {
|
||||
if (status === 'Running' && when !== tradingSystemStage.userDefinedCode.config.whileAtStageWhenToRun) { return; }
|
||||
if (tradingSystemStage !== undefined &&
|
||||
tradingSystemStage.userDefinedCode !== undefined) {
|
||||
if (status === 'Running' && when !== tradingSystemStage.userDefinedCode.config.whileAtStageWhenToRun) { return; }
|
||||
|
||||
switch(status) {
|
||||
case 'Open' : {
|
||||
if (tradingSystemStage.userDefinedCode.config.runWhenEnteringStage) {
|
||||
tradingSystem.evalUserCode(tradingSystemStage, 'User Defined Code');
|
||||
switch(status) {
|
||||
case 'Open' : {
|
||||
if (tradingSystemStage.userDefinedCode.config.runWhenEnteringStage) {
|
||||
tradingSystem.evalUserCode(tradingSystemStage, 'User Defined Code');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'Running' : {
|
||||
if (tradingSystemStage.userDefinedCode.config.runWhileAtStage) {
|
||||
tradingSystem.evalUserCode(tradingSystemStage, 'User Defined Code');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'Closed' : {
|
||||
if (tradingSystemStage.userDefinedCode.config.runWhenExitingStage) {
|
||||
tradingSystem.evalUserCode(tradingSystemStage, 'User Defined Code');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'Running' : {
|
||||
if (tradingSystemStage.userDefinedCode.config.runWhileAtStage) {
|
||||
tradingSystem.evalUserCode(tradingSystemStage, 'User Defined Code');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'Closed' : {
|
||||
if (tradingSystemStage.userDefinedCode.config.runWhenExitingStage) {
|
||||
tradingSystem.evalUserCode(tradingSystemStage, 'User Defined Code');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// checkAnnounce(): Check if stage announcement should be made
|
||||
function checkAnnounce(stage, status) {
|
||||
let tradingSystemStage = getTradingSystemStage(stage);
|
||||
if (status === 'Open' || status === 'Closed') {
|
||||
announcementsModuleObject.makeAnnouncements(tradingSystemStage, status)
|
||||
}
|
||||
}
|
||||
|
||||
/* getTradingSystemStage(): takes stage name returns stage object. */
|
||||
@@ -1321,4 +1324,4 @@ exports.newFoundationsBotModulesTradingStages = function (processIndex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
exports.newFoundationsBotModulesTradingStrategy = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingStrategy = function (processIndex) {
|
||||
/*
|
||||
This module packages all functions related to Strategies.
|
||||
*/
|
||||
const MODULE_NAME = 'Trading Strategy'
|
||||
|
||||
let thisObject = {
|
||||
mantain: mantain,
|
||||
reset: reset,
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesTradingSystem = function (processIndex) {
|
||||
/*
|
||||
The Trading System is the user defined set of rules compliant with the Trading Protocol that
|
||||
defines the trading logic to be applied during each cycle of the Simulation.
|
||||
@@ -26,7 +26,7 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
let sessionParameters
|
||||
let dynamicIndicators
|
||||
|
||||
let tradingStagesModuleObject = TS.projects.foundations.botModules.tradingStages.newFoundationsBotModulesTradingStages(processIndex)
|
||||
let tradingStagesModuleObject = TS.projects.algorithmicTrading.botModules.tradingStages.newAlgorithmicTradingBotModulesTradingStages(processIndex)
|
||||
|
||||
let taskParameters = {
|
||||
market: TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName +
|
||||
@@ -221,7 +221,7 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
|
||||
} catch (err) {
|
||||
/*
|
||||
If an error ocurred during execution, it was alreeady logged and
|
||||
If an error occurred during execution, it was already logged and
|
||||
included at the errors array. That means we need to do nothing here,
|
||||
just prevent the execution to be halted for not handling exceptions.
|
||||
*/
|
||||
@@ -237,14 +237,14 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
function evalNode(node, evaluating, descendentOfNodeType, isDescendent) {
|
||||
if (node === undefined) { return }
|
||||
|
||||
/* Verify if this node is decendent of the specified node type */
|
||||
/* Verify if this node is descendent of the specified node type */
|
||||
if (isDescendent !== true) {
|
||||
if (node.type === descendentOfNodeType) {
|
||||
isDescendent = true
|
||||
}
|
||||
}
|
||||
|
||||
/* Here we check if there is a codition to be evaluated */
|
||||
/* Here we check if there is a condition to be evaluated */
|
||||
if (node.type === 'Condition' && evaluating === 'Conditions') {
|
||||
/* We will eval this condition */
|
||||
if (isDescendent === true) {
|
||||
@@ -276,7 +276,7 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
|
||||
let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoid counting each property of those as individual children.
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
@@ -348,13 +348,13 @@ exports.newFoundationsBotModulesTradingSystem = function (processIndex) {
|
||||
}
|
||||
if (errorMessage !== undefined) {
|
||||
tradingSystem.addError([node.id, errorMessage, docs])
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[ERROR] evalCondition -> errorMessage = ' + errorMessage)
|
||||
}
|
||||
if (value !== undefined) {
|
||||
tradingSystem.values.push([node.id, value])
|
||||
}
|
||||
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> value = ' + value)
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] evalCondition -> errorMessage = ' + errorMessage)
|
||||
}
|
||||
|
||||
function evalFormula(node) {
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
exports.newFoundationsBotModulesSingleMarketTradingBot = function (processIndex) {
|
||||
exports.newAlgorithmicTradingBotModulesSingleMarketTradingBot = function (processIndex) {
|
||||
|
||||
const MODULE_NAME = "Single Market Trading Bot";
|
||||
|
||||
let session = TS.projects.foundations.botModules.tradingSession.newFoundationsBotModulesTradingSession(processIndex)
|
||||
let session = TS.projects.algorithmicTrading.botModules.tradingSession.newAlgorithmicTradingBotModulesTradingSession(processIndex)
|
||||
let nextLoopTimeoutHandle;
|
||||
|
||||
let thisObject = {
|
||||
@@ -63,8 +63,8 @@
|
||||
/* We tell the UI that we are running. */
|
||||
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, undefined, undefined, "Running...")
|
||||
|
||||
/* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */
|
||||
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution.
|
||||
/* We define the datetime for the process that we are running now. This will be the official processing time for both the infrastructure and the bot. */
|
||||
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME = new Date(); // This will be considered the process date and time, so as to have it consistently all over the execution.
|
||||
|
||||
/* Main Loop Console Logging */
|
||||
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.newMainLoop()
|
||||
@@ -95,7 +95,7 @@
|
||||
return
|
||||
}
|
||||
|
||||
/* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */
|
||||
/* We will prepare first the infrastructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */
|
||||
|
||||
let processExecutionEvents
|
||||
let userBot;
|
||||
@@ -282,7 +282,7 @@
|
||||
"[INFO] run -> loop -> initializeDataDependencies -> onInizialized -> Execution finished well.")
|
||||
switch (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.framework.name) {
|
||||
case 'Low-Frequency-Trading-Process': {
|
||||
processFramework = TS.projects.foundations.botModules.tradingProcess.newFoundationsBotModulesTradingProcess(processIndex);
|
||||
processFramework = TS.projects.algorithmicTrading.botModules.tradingProcess.newAlgorithmicTradingBotModulesTradingProcess(processIndex);
|
||||
startProcessFramework();
|
||||
break;
|
||||
}
|
||||
Loaded 100 of 2168 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user