mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 15:56:29 +01:00
Compare commits
1488 Commits
v0.38.2
...
v0.46.2-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19821b634f | ||
|
|
cde41b268e | ||
|
|
cb6d35236c | ||
|
|
7572ee284b | ||
|
|
d0eaf623a8 | ||
|
|
25c2db6c3a | ||
|
|
5a173ff14e | ||
|
|
7fab75b085 | ||
|
|
0f065536d0 | ||
|
|
d0747abded | ||
|
|
f62b4a581e | ||
|
|
dcf1c62ec1 | ||
|
|
93d55b3e7b | ||
|
|
90c6852423 | ||
|
|
208baa56e9 | ||
|
|
ddf8438b22 | ||
|
|
6008dc891f | ||
|
|
cc887a00f2 | ||
|
|
fbbd51d0b1 | ||
|
|
081b8b126a | ||
|
|
7a6bb81345 | ||
|
|
1d5714c411 | ||
|
|
56506d33a7 | ||
|
|
c94fb7a62d | ||
|
|
4160da70be | ||
|
|
2cfd093cae | ||
|
|
859465841d | ||
|
|
0c9a11db6f | ||
|
|
4cbf9c2e86 | ||
|
|
1f7997eeed | ||
|
|
8e730c6ecf | ||
|
|
600a312b2a | ||
|
|
ec2e973165 | ||
|
|
faeb55bc90 | ||
|
|
23ebe360a6 | ||
|
|
d905335935 | ||
|
|
f49f510459 | ||
|
|
e78b495bd3 | ||
|
|
5542c9dc57 | ||
|
|
2388da7cfb | ||
|
|
3b4fa0c5fc | ||
|
|
1af98056bb | ||
|
|
c0edcc1bfe | ||
|
|
597e595c32 | ||
|
|
e212a37c84 | ||
|
|
c41448f5da | ||
|
|
aab49946f8 | ||
|
|
cc4d04416b | ||
|
|
66c5606d46 | ||
|
|
50bcf45113 | ||
|
|
08cba1e1ce | ||
|
|
f528799fed | ||
|
|
a78c8ddad7 | ||
|
|
3cc93157bf | ||
|
|
3dbd80d5a6 | ||
|
|
076b4a6651 | ||
|
|
378987e61c | ||
|
|
5eb850bf59 | ||
|
|
4914160590 | ||
|
|
00c106aba6 | ||
|
|
5e6d2c8336 | ||
|
|
d45a59aa4e | ||
|
|
9f19cf8046 | ||
|
|
c0dfd23191 | ||
|
|
b9539117d8 | ||
|
|
d616a77d6b | ||
|
|
5b679930de | ||
|
|
3d7beefad0 | ||
|
|
8850de51f5 | ||
|
|
18b13657fd | ||
|
|
43ac712fca | ||
|
|
bf231d31a2 | ||
|
|
7dd19c0366 | ||
|
|
0040334e89 | ||
|
|
96a5cb23f3 | ||
|
|
067ca9ab16 | ||
|
|
be65e2e62f | ||
|
|
bed7bdfd00 | ||
|
|
cd5be59413 | ||
|
|
2a67d9eae2 | ||
|
|
0f05d6258e | ||
|
|
45516fa7b4 | ||
|
|
70708b36ef | ||
|
|
fb3d5f25ac | ||
|
|
397f0d1326 | ||
|
|
6469937393 | ||
|
|
48cb4d2ab9 | ||
|
|
3a94b04ef4 | ||
|
|
d406df48a8 | ||
|
|
9447d3f9b5 | ||
|
|
2ac78c2e03 | ||
|
|
17073096cf | ||
|
|
6068bd7c44 | ||
|
|
56a35b85a6 | ||
|
|
9d7d79ef94 | ||
|
|
eb1a6b78ff | ||
|
|
60d000b9cb | ||
|
|
61ddd8afc6 | ||
|
|
69bdcdd74a | ||
|
|
17c6f53397 | ||
|
|
1c51419db5 | ||
|
|
1ba1f28006 | ||
|
|
6b306ac426 | ||
|
|
ae26f22114 | ||
|
|
552d213817 | ||
|
|
8fb7dd451e | ||
|
|
01a82bed09 | ||
|
|
77bc5f9944 | ||
|
|
6081c3540e | ||
|
|
0a10764ed4 | ||
|
|
ba33a0d330 | ||
|
|
aea81c9872 | ||
|
|
8019e23ee4 | ||
|
|
5eb9b8fe42 | ||
|
|
d19a929237 | ||
|
|
67e0e0888e | ||
|
|
810fd9e819 | ||
|
|
2dc742f5b8 | ||
|
|
48b7108da0 | ||
|
|
806ab22fa8 | ||
|
|
fbabdef272 | ||
|
|
a1f67e830d | ||
|
|
ee78413ecb | ||
|
|
b936a63db3 | ||
|
|
80354d09fb | ||
|
|
87925f72a3 | ||
|
|
898c941333 | ||
|
|
8b0a1e546d | ||
|
|
ec351137d4 | ||
|
|
cf5127dcec | ||
|
|
345de752d1 | ||
|
|
9c2b98915e | ||
|
|
7b0fd639f6 | ||
|
|
6408a47a8a | ||
|
|
f2ca9276d6 | ||
|
|
872e81fe1f | ||
|
|
480aec1667 | ||
|
|
35ea877c7d | ||
|
|
41ca4b8d2e | ||
|
|
8375a1b5ab | ||
|
|
48b697f408 | ||
|
|
c33d496cf3 | ||
|
|
200982655f | ||
|
|
d67e1552ee | ||
|
|
ce09e4a1eb | ||
|
|
7bf6ec3ff2 | ||
|
|
1f923403de | ||
|
|
cb2361e9c4 | ||
|
|
d7e46263be | ||
|
|
138903cf28 | ||
|
|
3fa2535862 | ||
|
|
5bb490e1ff | ||
|
|
f2e44e5617 | ||
|
|
58a93f748b | ||
|
|
e1e185e5db | ||
|
|
199b49c1f7 | ||
|
|
cbc1f63732 | ||
|
|
3f2e8717b3 | ||
|
|
e06c5703ee | ||
|
|
cd858a73c1 | ||
|
|
69353f12b5 | ||
|
|
fe3bb2c5f6 | ||
|
|
6afc299efb | ||
|
|
369274ead7 | ||
|
|
7f8b19aee4 | ||
|
|
cd653b9f0c | ||
|
|
9fcd659df4 | ||
|
|
c08c4531db | ||
|
|
f8bec35893 | ||
|
|
04e6431c09 | ||
|
|
7aadd57d2f | ||
|
|
02d9752abf | ||
|
|
1d64129572 | ||
|
|
e89057a771 | ||
|
|
95760f1d28 | ||
|
|
75c3bd8ae3 | ||
|
|
4f27254e64 | ||
|
|
479d6ba964 | ||
|
|
577dc95ab8 | ||
|
|
a266d6a3d5 | ||
|
|
749b6cb57e | ||
|
|
9f472b353a | ||
|
|
4c614aee90 | ||
|
|
f17be0ef9b | ||
|
|
b0b2951ff6 | ||
|
|
1f3d73b9fd | ||
|
|
7dde78e98a | ||
|
|
bdfd760b9d | ||
|
|
8c0662ab82 | ||
|
|
cc3addebd4 | ||
|
|
7133e60267 | ||
|
|
fc4edf4aa7 | ||
|
|
eaf93a70cd | ||
|
|
a1b2e22ba5 | ||
|
|
f8936f3bc8 | ||
|
|
015c9d2ccd | ||
|
|
95ccfd2521 | ||
|
|
6c15d299e0 | ||
|
|
b093569ec5 | ||
|
|
f8089ba370 | ||
|
|
053162fef2 | ||
|
|
71bbf2eb16 | ||
|
|
f723433970 | ||
|
|
1cc7917b6e | ||
|
|
cdc2721ac1 | ||
|
|
4a15127e58 | ||
|
|
c5ec57e08e | ||
|
|
d0578971f7 | ||
|
|
1b0bb22273 | ||
|
|
bf653a9a5c | ||
|
|
5467dc62cd | ||
|
|
96eff4c410 | ||
|
|
3a12181a57 | ||
|
|
fccce2ff1e | ||
|
|
c949dcb449 | ||
|
|
8b99f065d5 | ||
|
|
6d7b9e0db3 | ||
|
|
248fa780e8 | ||
|
|
20c7c657da | ||
|
|
0a896cc19c | ||
|
|
0bb548d0d1 | ||
|
|
de1584eab8 | ||
|
|
60e2026850 | ||
|
|
5098dda376 | ||
|
|
35e47f866a | ||
|
|
199d89c1a6 | ||
|
|
be543737a9 | ||
|
|
0b6fa4ab06 | ||
|
|
8f1b2fa226 | ||
|
|
5010175b84 | ||
|
|
0ac42608f7 | ||
|
|
4633c68a0c | ||
|
|
33571e0ef3 | ||
|
|
31876d2cf9 | ||
|
|
81c6043cb6 | ||
|
|
7f3ef2cb8b | ||
|
|
1982d054ef | ||
|
|
16c4b8aa43 | ||
|
|
e56979c482 | ||
|
|
4078b32e9d | ||
|
|
90d33f56c3 | ||
|
|
b0e5ab7533 | ||
|
|
526bd81b50 | ||
|
|
58555b3660 | ||
|
|
b7b1324dd0 | ||
|
|
a1fb84f14d | ||
|
|
bc520edd19 | ||
|
|
5f4f0d3086 | ||
|
|
a68c61b2f0 | ||
|
|
2a6978c349 | ||
|
|
1c5425c9eb | ||
|
|
2338a13749 | ||
|
|
6df6fe03fa | ||
|
|
e318acc977 | ||
|
|
b0217ee04c | ||
|
|
2a54ce803e | ||
|
|
642bf9d113 | ||
|
|
31746e7baf | ||
|
|
48b1703725 | ||
|
|
72d6440de7 | ||
|
|
eaed7ec86f | ||
|
|
02043d9109 | ||
|
|
b9c0823abf | ||
|
|
61f30373d4 | ||
|
|
9889166afc | ||
|
|
8ae82f5b69 | ||
|
|
26442f418a | ||
|
|
35d5036aaa | ||
|
|
14f5b46ece | ||
|
|
23a432e7d8 | ||
|
|
ac636b6649 | ||
|
|
52b8162d01 | ||
|
|
167b6974fe | ||
|
|
984ecaf99c | ||
|
|
21b73a86b2 | ||
|
|
7d8277699c | ||
|
|
4bd86a6dfa | ||
|
|
5bbec118e4 | ||
|
|
928ed7a034 | ||
|
|
473229f03a | ||
|
|
882b6be580 | ||
|
|
e5fa1e0ed5 | ||
|
|
af1fd5bd06 | ||
|
|
c737a3adc9 | ||
|
|
1047aecfbd | ||
|
|
314e0a453f | ||
|
|
8ec476ba96 | ||
|
|
8e2bf7795c | ||
|
|
a346ba7038 | ||
|
|
fd6b2f1e7f | ||
|
|
6662b9dbf9 | ||
|
|
c0a29ede05 | ||
|
|
845907b8d2 | ||
|
|
b12008e313 | ||
|
|
a108ef91a0 | ||
|
|
4fd9e7f14f | ||
|
|
b5480b4137 | ||
|
|
47d61c416d | ||
|
|
6c57b2220f | ||
|
|
99f01b9ccf | ||
|
|
d5a9abd911 | ||
|
|
a3a2bc0a74 | ||
|
|
7859aca006 | ||
|
|
402e5c4d81 | ||
|
|
5157fc15e9 | ||
|
|
1403acd808 | ||
|
|
4bd87b1796 | ||
|
|
ce33eb3abd | ||
|
|
f988935a33 | ||
|
|
9b05d30b47 | ||
|
|
e258de329c | ||
|
|
044bcf6f05 | ||
|
|
9e97fdcc49 | ||
|
|
2c028f7c45 | ||
|
|
435200ec5a | ||
|
|
3d808d638a | ||
|
|
8e8148ce42 | ||
|
|
af41e5d115 | ||
|
|
4f75b6aaaf | ||
|
|
82f410f695 | ||
|
|
2bc06959c3 | ||
|
|
b898973ee6 | ||
|
|
a2b0d8a379 | ||
|
|
06a4eab7d5 | ||
|
|
25df1a054c | ||
|
|
8c4ff7ed2a | ||
|
|
609829653e | ||
|
|
bb0ee0b36c | ||
|
|
5f20d033a8 | ||
|
|
b70ee742e8 | ||
|
|
93d0324177 | ||
|
|
0afd3c65aa | ||
|
|
8901c3ec91 | ||
|
|
c671b0a345 | ||
|
|
9f424836e2 | ||
|
|
7f5af4b959 | ||
|
|
4281111344 | ||
|
|
37e111d8a9 | ||
|
|
4202af96c8 | ||
|
|
d0efd67d5e | ||
|
|
aeb6c34d27 | ||
|
|
a3f4fc7762 | ||
|
|
6517188b39 | ||
|
|
c4acecd510 | ||
|
|
c7d8bddf24 | ||
|
|
29c1d05540 | ||
|
|
55f04436c0 | ||
|
|
4ce2eaa919 | ||
|
|
489e064932 | ||
|
|
1369603ed9 | ||
|
|
79431d8b4b | ||
|
|
4591899df0 | ||
|
|
dc64d333b6 | ||
|
|
283808d691 | ||
|
|
a4bf69fe6a | ||
|
|
6c7853319c | ||
|
|
2b1aa0d386 | ||
|
|
dfa7d3f186 | ||
|
|
24ae24a1ac | ||
|
|
00d860bfae | ||
|
|
a9f49e7f25 | ||
|
|
fcf80f1e57 | ||
|
|
dc94e1a1bf | ||
|
|
313b9dba61 | ||
|
|
32e3560dce | ||
|
|
7bd7323097 | ||
|
|
0cb46f8f9b | ||
|
|
c2b64bad80 | ||
|
|
991b335c3e | ||
|
|
fd2d49de4f | ||
|
|
b990239219 | ||
|
|
a7c13ceacc | ||
|
|
f23454ffa3 | ||
|
|
631a11509a | ||
|
|
b2b3c80192 | ||
|
|
bf9bfe920a | ||
|
|
ad878c078e | ||
|
|
8a019d617f | ||
|
|
4a76b7a9a5 | ||
|
|
1ac1bf12a2 | ||
|
|
b50638e85c | ||
|
|
893b6053d2 | ||
|
|
a1ec6fe0aa | ||
|
|
18cc9f2475 | ||
|
|
04ea8dd4b3 | ||
|
|
28cb3976e5 | ||
|
|
a665d193eb | ||
|
|
cabb78b3e4 | ||
|
|
d953d96fa6 | ||
|
|
c71ac0302a | ||
|
|
4eb9ca7b46 | ||
|
|
42daf181d3 | ||
|
|
badb678b69 | ||
|
|
140f0a5dbd | ||
|
|
5933b17b47 | ||
|
|
761912c3bd | ||
|
|
10ce26799d | ||
|
|
91a2bb9b26 | ||
|
|
287ef9b522 | ||
|
|
99f35b2588 | ||
|
|
32d609e796 | ||
|
|
8a435a2149 | ||
|
|
8855f29a49 | ||
|
|
384a9474c0 | ||
|
|
a7f510783d | ||
|
|
1a262fe680 | ||
|
|
0c4deda091 | ||
|
|
71894c34aa | ||
|
|
8313116b7f | ||
|
|
90622d71f8 | ||
|
|
620e896a89 | ||
|
|
a9a9edf658 | ||
|
|
5e2077e6ae | ||
|
|
51eb9f18f7 | ||
|
|
a0e4a416cd | ||
|
|
8f018cc7c6 | ||
|
|
4a470ff9e5 | ||
|
|
4b8ca31091 | ||
|
|
03e4c49f89 | ||
|
|
4f92fbf8a5 | ||
|
|
dd020baee5 | ||
|
|
cba9b92202 | ||
|
|
d163289003 | ||
|
|
c45f590e9f | ||
|
|
fbb36d652f | ||
|
|
2706f1b02f | ||
|
|
8f68b4f298 | ||
|
|
6710476768 | ||
|
|
de30095737 | ||
|
|
9de51c8b9e | ||
|
|
748979eafd | ||
|
|
8ad7318bd8 | ||
|
|
e2fcc6711a | ||
|
|
5f6dd18489 | ||
|
|
a577485e42 | ||
|
|
1fcb99fa60 | ||
|
|
bdebb35f62 | ||
|
|
2b1383205b | ||
|
|
995f4f2582 | ||
|
|
15796b6870 | ||
|
|
12943ca151 | ||
|
|
0e795b2978 | ||
|
|
0eef18a799 | ||
|
|
6518d113c6 | ||
|
|
ea524403f7 | ||
|
|
1d5a53fee6 | ||
|
|
395eb92d93 | ||
|
|
71323500b7 | ||
|
|
7f9bcc162e | ||
|
|
27052143ab | ||
|
|
50d3ddbed5 | ||
|
|
7ee50113d7 | ||
|
|
07bd5129ca | ||
|
|
ec7021b436 | ||
|
|
c75439a4b5 | ||
|
|
d21cb78baa | ||
|
|
c371873b7e | ||
|
|
6220b02ef0 | ||
|
|
4e15bc0bb1 | ||
|
|
2f720df9d2 | ||
|
|
d57a303251 | ||
|
|
13b9f5231c | ||
|
|
71ed24344c | ||
|
|
0c8a2a23a7 | ||
|
|
5738f2a5b3 | ||
|
|
d345c4850f | ||
|
|
eeacd8118f | ||
|
|
f5216e4799 | ||
|
|
85d13b1d62 | ||
|
|
f5f48ef6c4 | ||
|
|
f1ed114167 | ||
|
|
70995a7691 | ||
|
|
a82b8cdb37 | ||
|
|
33511c0c10 | ||
|
|
04c93d6736 | ||
|
|
5e11806110 | ||
|
|
1e1709ca6a | ||
|
|
37602cfcae | ||
|
|
0ca0996751 | ||
|
|
63ebb46049 | ||
|
|
847766b434 | ||
|
|
056c40c0d0 | ||
|
|
bff5b015ea | ||
|
|
ee4ce3ffd8 | ||
|
|
a73733d0fc | ||
|
|
0c5f842626 | ||
|
|
8b4cf474bd | ||
|
|
80f269d844 | ||
|
|
75c9db6432 | ||
|
|
69e36d2677 | ||
|
|
eb4d86f41d | ||
|
|
b0bf88c487 | ||
|
|
032ffa8367 | ||
|
|
7400c91a4f | ||
|
|
fbdf089d5d | ||
|
|
a7505682ed | ||
|
|
b148f3d032 | ||
|
|
874972a3d3 | ||
|
|
6d095b7250 | ||
|
|
ceb762e56b | ||
|
|
0c72d29684 | ||
|
|
29efe3a492 | ||
|
|
5bdfb6e11f | ||
|
|
11c63b7778 | ||
|
|
befec48506 | ||
|
|
15d94e91db | ||
|
|
7787fa1758 | ||
|
|
0bd9b849b2 | ||
|
|
918e827d91 | ||
|
|
42ecc0e15b | ||
|
|
a37fa0cb3f | ||
|
|
647863b489 | ||
|
|
e8114fcc4f | ||
|
|
0745d9ec0b | ||
|
|
5e75d2380a | ||
|
|
32c88c7481 | ||
|
|
0aef99b98e | ||
|
|
bf548f9d38 | ||
|
|
a15f8d7e11 | ||
|
|
574b71de63 | ||
|
|
408ed8dbf0 | ||
|
|
98f1bc51a5 | ||
|
|
f3efb22a50 | ||
|
|
5fd58def11 | ||
|
|
b793f8cb88 | ||
|
|
058edcfe15 | ||
|
|
5d500de527 | ||
|
|
81207f3d27 | ||
|
|
21575d862b | ||
|
|
9359f05335 | ||
|
|
7fb22d41a0 | ||
|
|
2823bf3488 | ||
|
|
172f3689fa | ||
|
|
5a8c3f6a2b | ||
|
|
416b7088c5 | ||
|
|
3f69a3c572 | ||
|
|
268910ed3b | ||
|
|
8259b4a32c | ||
|
|
9873dd1242 | ||
|
|
f4266754d8 | ||
|
|
30e84321f9 | ||
|
|
020a8766c8 | ||
|
|
dc288fb18c | ||
|
|
26dfa1ffdb | ||
|
|
d4e1900f89 | ||
|
|
4cd1a0ee7d | ||
|
|
355780c595 | ||
|
|
ef996f3919 | ||
|
|
445902d081 | ||
|
|
31d85ed8cc | ||
|
|
c8af250caa | ||
|
|
b7b13c1d8b | ||
|
|
b05b9196a0 | ||
|
|
fbe3995398 | ||
|
|
6aa61ca306 | ||
|
|
87161cfe0d | ||
|
|
6a3e27eb62 | ||
|
|
b7947a40ea | ||
|
|
1d813c82e4 | ||
|
|
46e373e822 | ||
|
|
a6c79c934c | ||
|
|
08c612c876 | ||
|
|
ed6181a85e | ||
|
|
0533b95562 | ||
|
|
5b4826fd08 | ||
|
|
60e213433b | ||
|
|
153de63f4d | ||
|
|
4d4d9f2000 | ||
|
|
0b38e24185 | ||
|
|
d037420acb | ||
|
|
20b4b059e3 | ||
|
|
28ebca1268 | ||
|
|
a89629b3de | ||
|
|
eec850c11f | ||
|
|
52e0f838a9 | ||
|
|
d1f70efdb4 | ||
|
|
5b1e229d7d | ||
|
|
5c55278c59 | ||
|
|
3c224e80ee | ||
|
|
5741b380f0 | ||
|
|
7335844ae3 | ||
|
|
53c361945b | ||
|
|
03d7ee9abb | ||
|
|
3670fbff49 | ||
|
|
f24e27dadd | ||
|
|
53b39e2e82 | ||
|
|
c20577909c | ||
|
|
a87b710626 | ||
|
|
625483a8f2 | ||
|
|
121c819b79 | ||
|
|
77a3bdce1f | ||
|
|
827f8b42a0 | ||
|
|
b815e10ff3 | ||
|
|
c2789bf355 | ||
|
|
e8d63b5647 | ||
|
|
53c6542af6 | ||
|
|
d9c246f8a7 | ||
|
|
803694d113 | ||
|
|
f6f9f0d2c0 | ||
|
|
47a9516ada | ||
|
|
bd8b83898f | ||
|
|
97109efb6c | ||
|
|
b4d9fdaeda | ||
|
|
1810116a34 | ||
|
|
3e89855aa3 | ||
|
|
eaac65142f | ||
|
|
ae909d1079 | ||
|
|
935e5de493 | ||
|
|
8d0df6ddb9 | ||
|
|
3b148eb6f8 | ||
|
|
4e8d1dac67 | ||
|
|
7779fd1dfe | ||
|
|
960d7dede3 | ||
|
|
e663d7da1b | ||
|
|
02cc52af66 | ||
|
|
f60af1f05e | ||
|
|
224fbdc8cd | ||
|
|
8561201abc | ||
|
|
3c1a809276 | ||
|
|
ddf0a89e1f | ||
|
|
4b101baf00 | ||
|
|
782127dd91 | ||
|
|
7900622f38 | ||
|
|
864271d5ef | ||
|
|
5a5ea4f474 | ||
|
|
749791f6d1 | ||
|
|
5ca3e9a0bc | ||
|
|
f4a4e746bf | ||
|
|
4fc8bace94 | ||
|
|
47a22f6e8d | ||
|
|
17d7ff3ff1 | ||
|
|
3582013a33 | ||
|
|
95bbdb3b6b | ||
|
|
e1dd933ec0 | ||
|
|
8a57960c6e | ||
|
|
a7b62b30cb | ||
|
|
c9cbc2db02 | ||
|
|
c92526372c | ||
|
|
5f4a84d967 | ||
|
|
ef59810f89 | ||
|
|
099e90ed64 | ||
|
|
9b15437ff6 | ||
|
|
a3a2f1a2b4 | ||
|
|
3261fea67f | ||
|
|
b19589033d | ||
|
|
2217c5a3e0 | ||
|
|
b60efbbf5a | ||
|
|
e9bfe4521e | ||
|
|
79d9d79055 | ||
|
|
a36022d8c1 | ||
|
|
0eb77e43e2 | ||
|
|
e1d4be814f | ||
|
|
aa4a645670 | ||
|
|
2c9565b4b3 | ||
|
|
c5cc6b91c1 | ||
|
|
3109233d4f | ||
|
|
60e8bd98b9 | ||
|
|
32ecb43b5c | ||
|
|
f03e4bc7d7 | ||
|
|
4e5ddaf7d1 | ||
|
|
35469f6f2d | ||
|
|
4c7b1d6543 | ||
|
|
df69b1d8dd | ||
|
|
9d46c7253b | ||
|
|
a94ae81c30 | ||
|
|
9f527f0330 | ||
|
|
68d8b1c8a9 | ||
|
|
0ab9d02434 | ||
|
|
3d324b954d | ||
|
|
f028b88cce | ||
|
|
64dc522b27 | ||
|
|
3d02f82c77 | ||
|
|
528418aecb | ||
|
|
5dd73562da | ||
|
|
62cacf85ed | ||
|
|
443f389d73 | ||
|
|
08edc521e4 | ||
|
|
f54f6d09b0 | ||
|
|
3219441fdf | ||
|
|
1c97310e92 | ||
|
|
0ecb2f3662 | ||
|
|
055db32510 | ||
|
|
054420225f | ||
|
|
448a3254a3 | ||
|
|
b2c0eaeaf8 | ||
|
|
1b0a2b41da | ||
|
|
50b976990c | ||
|
|
9f2545395d | ||
|
|
67bffbf30b | ||
|
|
51dae378a3 | ||
|
|
a0b3bc858d | ||
|
|
2e24111c2b | ||
|
|
69d529ada1 | ||
|
|
bfa69a3dc3 | ||
|
|
5b862c3d29 | ||
|
|
dee4083bf3 | ||
|
|
18749092ff | ||
|
|
c4cc48dfc9 | ||
|
|
ef847b9904 | ||
|
|
3e189d5c10 | ||
|
|
46d3160da4 | ||
|
|
78a2c1753e | ||
|
|
f0b608ddec | ||
|
|
582429e762 | ||
|
|
bf073690e0 | ||
|
|
c012620338 | ||
|
|
5e18e7dc67 | ||
|
|
51f094f87f | ||
|
|
262a4fa3c7 | ||
|
|
c778e87683 | ||
|
|
dd62b306fd | ||
|
|
1f05638609 | ||
|
|
92e49214c7 | ||
|
|
9615e25a67 | ||
|
|
a574fce13f | ||
|
|
238df0fb40 | ||
|
|
89356918f1 | ||
|
|
263b65997c | ||
|
|
2b757bfccd | ||
|
|
99d66ea89f | ||
|
|
c78ca4c9db | ||
|
|
b245b249d3 | ||
|
|
a0395e9866 | ||
|
|
89aa4fbc73 | ||
|
|
74a7802088 | ||
|
|
a89b6711d1 | ||
|
|
b2549b2834 | ||
|
|
959c4cbe64 | ||
|
|
d03d3603d2 | ||
|
|
22302e8200 | ||
|
|
f117ae4915 | ||
|
|
c34a9b96e4 | ||
|
|
f0acfaf147 | ||
|
|
e1c2573778 | ||
|
|
56d6384ae1 | ||
|
|
5f699cc28c | ||
|
|
969f31dde2 | ||
|
|
027afab6b1 | ||
|
|
6207203b35 | ||
|
|
88348c560c | ||
|
|
30062d687f | ||
|
|
ffc96ad6b2 | ||
|
|
2af2b45062 | ||
|
|
eabe4775bd | ||
|
|
da9b321aa0 | ||
|
|
7b0aa7ab0b | ||
|
|
f700e6e12b | ||
|
|
a87e59cecb | ||
|
|
a04aa6fd36 | ||
|
|
a7d9870846 | ||
|
|
c18d8d2d1b | ||
|
|
f745e21e0d | ||
|
|
5f2361ebd5 | ||
|
|
9791dab97d | ||
|
|
85d986534d | ||
|
|
00faf758e8 | ||
|
|
6ba2e5cf73 | ||
|
|
fb3876d28b | ||
|
|
fb975849b9 | ||
|
|
16fef78344 | ||
|
|
e0b4b369dc | ||
|
|
0df7851214 | ||
|
|
5d47c2b23e | ||
|
|
d09b021487 | ||
|
|
910bda860c | ||
|
|
2d92b4931a | ||
|
|
212b719ee9 | ||
|
|
1db892d22f | ||
|
|
535dcb6d12 | ||
|
|
4426362799 | ||
|
|
2c609e8136 | ||
|
|
11b73b79ed | ||
|
|
28dc6b93ca | ||
|
|
e70c862e72 | ||
|
|
b3e66d5a83 | ||
|
|
e8cd821e57 | ||
|
|
401a3f0ecb | ||
|
|
e73dffad0b | ||
|
|
ef1d062745 | ||
|
|
f245d51746 | ||
|
|
be7ac74235 | ||
|
|
ad48b59893 | ||
|
|
e817acba4e | ||
|
|
4ae965c5cb | ||
|
|
58fa0832f6 | ||
|
|
1502b9ce66 | ||
|
|
ed9fbae65d | ||
|
|
01a7af965c | ||
|
|
99120be46d | ||
|
|
915b1d1a45 | ||
|
|
e68aed2057 | ||
|
|
eedeaca37d | ||
|
|
7307ca385f | ||
|
|
c1fd9825aa | ||
|
|
9de7d3fc53 | ||
|
|
3c5db844ba | ||
|
|
e7330c1104 | ||
|
|
ec4586b164 | ||
|
|
91e5f24798 | ||
|
|
38723e0189 | ||
|
|
8c88ce6f65 | ||
|
|
0def5f9a63 | ||
|
|
4d22959e28 | ||
|
|
50a28d8c51 | ||
|
|
e25b633ec4 | ||
|
|
ac10701b55 | ||
|
|
75bd395669 | ||
|
|
5e353a5612 | ||
|
|
c0cd321118 | ||
|
|
d65624d8d2 | ||
|
|
6b359b7796 | ||
|
|
13f9d037dc | ||
|
|
1911d64c1c | ||
|
|
1c388c9805 | ||
|
|
6a957eff17 | ||
|
|
5aaa429203 | ||
|
|
d4c3f1b3f2 | ||
|
|
ae934720bc | ||
|
|
753c181979 | ||
|
|
55b210d7c5 | ||
|
|
dc2d5a0a79 | ||
|
|
c753f228ac | ||
|
|
a1a744bb00 | ||
|
|
077d19b44b | ||
|
|
b5627b138a | ||
|
|
cb4d0624b5 | ||
|
|
e2490f9975 | ||
|
|
9ede77aead | ||
|
|
8ce2afff8a | ||
|
|
a2e1fb35b8 | ||
|
|
bb03a8714a | ||
|
|
ae772288e2 | ||
|
|
355ffd3d02 | ||
|
|
3d12341ff1 | ||
|
|
4ea934509e | ||
|
|
3db84daf94 | ||
|
|
714881ad99 | ||
|
|
ee053b9fdf | ||
|
|
cd48135394 | ||
|
|
a06662f4ce | ||
|
|
2e6395ad88 | ||
|
|
75d8627f1c | ||
|
|
a8d12f723f | ||
|
|
08dbf90a8c | ||
|
|
32dde426fd | ||
|
|
b26100479d | ||
|
|
faf4daa577 | ||
|
|
2526715aa4 | ||
|
|
04c573e212 | ||
|
|
99aa481ace | ||
|
|
ef37bc1a99 | ||
|
|
58f4f5d1e6 | ||
|
|
b72dc977e6 | ||
|
|
81bf84f2de | ||
|
|
fa5d982a55 | ||
|
|
e77e0ce675 | ||
|
|
32eaafd024 | ||
|
|
60c2049729 | ||
|
|
dcd371b5b1 | ||
|
|
e3071e630a | ||
|
|
78ea0b4ba9 | ||
|
|
f07025f741 | ||
|
|
5f1f65a3c2 | ||
|
|
a3e2369599 | ||
|
|
1ec446137d | ||
|
|
108afe8896 | ||
|
|
a287bb59ea | ||
|
|
7992f32d34 | ||
|
|
b07accfd9d | ||
|
|
ccb5f3ee18 | ||
|
|
29e6b63f82 | ||
|
|
2818854c4b | ||
|
|
d75b770fb9 | ||
|
|
37da0adb8a | ||
|
|
13117d2e68 | ||
|
|
4f50864ec8 | ||
|
|
30b9ef8604 | ||
|
|
b063b4c528 | ||
|
|
b51f5ac6fd | ||
|
|
e08b0141a4 | ||
|
|
9d8b8e26a1 | ||
|
|
cb70109ee7 | ||
|
|
2e0fb8aaf1 | ||
|
|
ac4e6077bd | ||
|
|
8e8fa48241 | ||
|
|
e541abbd60 | ||
|
|
940a70adc5 | ||
|
|
9a662f76da | ||
|
|
88e8eb7e9c | ||
|
|
b365c186a1 | ||
|
|
15bc9dce1c | ||
|
|
552fc5261a | ||
|
|
83c9e6e846 | ||
|
|
2e837642e2 | ||
|
|
c70a842bc6 | ||
|
|
d20415c979 | ||
|
|
c3438e0f3f | ||
|
|
64c9734f05 | ||
|
|
48c843c087 | ||
|
|
1bb895bb83 | ||
|
|
0e4eec10b9 | ||
|
|
a3661cb763 | ||
|
|
115879ec4a | ||
|
|
f1ce0c7774 | ||
|
|
df11b076bc | ||
|
|
54ecd2ee75 | ||
|
|
2369bcf9fc | ||
|
|
5d8808a2ad | ||
|
|
62b993f06f | ||
|
|
8aa5608085 | ||
|
|
b452d7e5c5 | ||
|
|
a0f8caeccd | ||
|
|
edb9bc9229 | ||
|
|
9b9d6d86d0 | ||
|
|
7f2755d4a0 | ||
|
|
3b268cc8eb | ||
|
|
768ac83e14 | ||
|
|
6dfe335707 | ||
|
|
c7125d2b50 | ||
|
|
e8a33a5ee7 | ||
|
|
deb0b24c4c | ||
|
|
cafcb67a8a | ||
|
|
4c6e9480e4 | ||
|
|
109bead1c7 | ||
|
|
ae1220b970 | ||
|
|
b89a2df462 | ||
|
|
8b5536ee3a | ||
|
|
647790885d | ||
|
|
227c3e4dcc | ||
|
|
4eb2407c73 | ||
|
|
43e12fbea2 | ||
|
|
2a3091f788 | ||
|
|
742df25bc2 | ||
|
|
7ac2206e9b | ||
|
|
9be1d1f697 | ||
|
|
ed52f93bbb | ||
|
|
3466a19397 | ||
|
|
fe53e2351c | ||
|
|
5c35b870eb | ||
|
|
90d091aedb | ||
|
|
0a05a40186 | ||
|
|
7482ed063b | ||
|
|
70e343f2fc | ||
|
|
358f3a7291 | ||
|
|
6161b1c193 | ||
|
|
94b57dadd7 | ||
|
|
81fbefb9cd | ||
|
|
6d6695e3a9 | ||
|
|
4c308ad68f | ||
|
|
989a003d2f | ||
|
|
ccdb41841e | ||
|
|
0a94622413 | ||
|
|
5769587305 | ||
|
|
ffbfccb701 | ||
|
|
56ce23fc36 | ||
|
|
cba7e5a59f | ||
|
|
86cf8f3202 | ||
|
|
907cdd8fcb | ||
|
|
7ea53d468e | ||
|
|
586d6b4557 | ||
|
|
8f68ff1932 | ||
|
|
a1ea2c9115 | ||
|
|
e8ce81a133 | ||
|
|
aff12950f0 | ||
|
|
75c58cbf79 | ||
|
|
87a1e98fa2 | ||
|
|
d1eacbb574 | ||
|
|
71d248cd87 | ||
|
|
ac608b9334 | ||
|
|
32020d78b5 | ||
|
|
ff853c7d0a | ||
|
|
8526cb2315 | ||
|
|
dc89f72e75 | ||
|
|
657ff16267 | ||
|
|
ed759f5585 | ||
|
|
a86177bb59 | ||
|
|
9f1b3cc892 | ||
|
|
8473f72ec8 | ||
|
|
666d202a3a | ||
|
|
988fae50cb | ||
|
|
98bbd17920 | ||
|
|
dadcc93ae3 | ||
|
|
48e19d0149 | ||
|
|
f97c9e3619 | ||
|
|
61167f6646 | ||
|
|
29cec8112e | ||
|
|
48aadc8309 | ||
|
|
b2508db9af | ||
|
|
87510fd72b | ||
|
|
339f212e4c | ||
|
|
3c311cd2a4 | ||
|
|
b5bf581bd9 | ||
|
|
242f139be4 | ||
|
|
6c76d862d2 | ||
|
|
62bc05134e | ||
|
|
50d3928dd5 | ||
|
|
44d641617e | ||
|
|
f3b84e5185 | ||
|
|
34b8979016 | ||
|
|
6c188982b3 | ||
|
|
1175a8ee49 | ||
|
|
9c04ef9fb7 | ||
|
|
6cc3e3cdf6 | ||
|
|
f8bd55374f | ||
|
|
3ccb1c6ac1 | ||
|
|
d34d265d01 | ||
|
|
c063f75f48 | ||
|
|
2d1f3b7633 | ||
|
|
3772d97dfa | ||
|
|
5c0355718f | ||
|
|
081693f263 | ||
|
|
8d312515dd | ||
|
|
7bd05415fa | ||
|
|
8d7687f354 | ||
|
|
42128c007f | ||
|
|
dfb97d64f7 | ||
|
|
b1bed18331 | ||
|
|
ae50c9847d | ||
|
|
6201dd70a0 | ||
|
|
451c408063 | ||
|
|
3bbb213f82 | ||
|
|
bab657e43d | ||
|
|
4b24d9562c | ||
|
|
a73739d03e | ||
|
|
4485650cbc | ||
|
|
58f610b2c6 | ||
|
|
5024454914 | ||
|
|
ca0e36ea81 | ||
|
|
c9b2ff05e9 | ||
|
|
0973498fe9 | ||
|
|
189202b1f6 | ||
|
|
cc298b1e7a | ||
|
|
f8bd6183bf | ||
|
|
ef60cb5395 | ||
|
|
b10c083560 | ||
|
|
8eeb395523 | ||
|
|
084882a50e | ||
|
|
7c04521e9c | ||
|
|
0a0de7312c | ||
|
|
37255243f7 | ||
|
|
b4b22d9353 | ||
|
|
d3eb640aa2 | ||
|
|
78d431387b | ||
|
|
c4bc53da59 | ||
|
|
34de8fb874 | ||
|
|
5a6ab68144 | ||
|
|
c4e5b35187 | ||
|
|
2e55d544f1 | ||
|
|
b778985b5e | ||
|
|
f9a79fa00f | ||
|
|
ef61e22f1f | ||
|
|
8a92786012 | ||
|
|
a856463173 | ||
|
|
cb168218fb | ||
|
|
978575498c | ||
|
|
8584de27ab | ||
|
|
a36d6bf9be | ||
|
|
9b17e9976e | ||
|
|
d927865cbd | ||
|
|
6de0b19569 | ||
|
|
84d7097b1a | ||
|
|
8ccc48c25d | ||
|
|
438da7cfbb | ||
|
|
af5c4b5859 | ||
|
|
04360381b6 | ||
|
|
45e2dc96fb | ||
|
|
ff426fc1fc | ||
|
|
6dfc2755e7 | ||
|
|
789f12ac8f | ||
|
|
9a1a76605a | ||
|
|
debce78c7f | ||
|
|
48c57c7ce7 | ||
|
|
4a89df7ebf | ||
|
|
6295a1825d | ||
|
|
280955b3a2 | ||
|
|
72cc54a83f | ||
|
|
c3b44b9a91 | ||
|
|
8a9875ecfa | ||
|
|
9230b07adb | ||
|
|
5a6066dcd1 | ||
|
|
d4d54c5f01 | ||
|
|
141d4593ca | ||
|
|
a7ddc33b6d | ||
|
|
173030e02e | ||
|
|
8ae78a9e23 | ||
|
|
babc27f824 | ||
|
|
2c7eb723d5 | ||
|
|
40247a591e | ||
|
|
3a4d32f163 | ||
|
|
7f2c859b94 | ||
|
|
a5764c269f | ||
|
|
6a1bfdeab9 | ||
|
|
6de0f75931 | ||
|
|
fcf72262bd | ||
|
|
114017147f | ||
|
|
a717ee00fb | ||
|
|
f5e27278ab | ||
|
|
2cc0442ef2 | ||
|
|
687a466a35 | ||
|
|
20c24e26cc | ||
|
|
3bafc396fc | ||
|
|
08606f7d88 | ||
|
|
3fa3e912a4 | ||
|
|
44219e7ccc | ||
|
|
48abd765c6 | ||
|
|
2d38706ba8 | ||
|
|
8d45662bee | ||
|
|
dc4024b6de | ||
|
|
5b67854cbe | ||
|
|
72745aca29 | ||
|
|
e6e41adad0 | ||
|
|
bcbf1b79c3 | ||
|
|
1d78432df4 | ||
|
|
c6d912dcb7 | ||
|
|
eb287917c1 | ||
|
|
da53c1eaa8 | ||
|
|
c67613a557 | ||
|
|
0ca107ff48 | ||
|
|
73bf2dcb02 | ||
|
|
719f10981e | ||
|
|
1774f48d07 | ||
|
|
deb67d6275 | ||
|
|
bafd829ff6 | ||
|
|
e7aa84435b | ||
|
|
493d088d80 | ||
|
|
5f4d963580 | ||
|
|
5114f3f782 | ||
|
|
53f5df4e88 | ||
|
|
e4039ea5e1 | ||
|
|
95fef8d2e5 | ||
|
|
7105b61aab | ||
|
|
78a50be663 | ||
|
|
3d3ad3b99b | ||
|
|
0d9cdcac85 | ||
|
|
c4f7bb37db | ||
|
|
81ec85083a | ||
|
|
62da383623 | ||
|
|
8513e0201c | ||
|
|
abd60581be | ||
|
|
aff02184f8 | ||
|
|
8909d175d0 | ||
|
|
091eb8f791 | ||
|
|
e10d23289e | ||
|
|
26599f057c | ||
|
|
4e0e2e8926 | ||
|
|
9c631e4398 | ||
|
|
687539cc95 | ||
|
|
03e0c98066 | ||
|
|
77f358b846 | ||
|
|
4c82e882e0 | ||
|
|
0f4ba43463 | ||
|
|
f15239c006 | ||
|
|
ed1b5e3843 | ||
|
|
607bdfef92 | ||
|
|
4f744564f2 | ||
|
|
f64b343d8d | ||
|
|
47b803920b | ||
|
|
8888d04878 | ||
|
|
49398f5374 | ||
|
|
95d1952896 | ||
|
|
3ab2b41e8c | ||
|
|
e5155130e7 | ||
|
|
724ba352e6 | ||
|
|
1239293435 | ||
|
|
16f42dd4ab | ||
|
|
350331e2ef | ||
|
|
a2d6a5c3e9 | ||
|
|
cb35284d37 | ||
|
|
2af37640d8 | ||
|
|
4bd298a55b | ||
|
|
cd4b1235a7 | ||
|
|
5e3c85f891 | ||
|
|
b2a3e1cc04 | ||
|
|
d71763aedb | ||
|
|
368d0c55da | ||
|
|
637010577b | ||
|
|
7bcae9981b | ||
|
|
3752cf8cba | ||
|
|
7270bf287d | ||
|
|
d821ea4095 | ||
|
|
41d1d83dc2 | ||
|
|
a2fe110400 | ||
|
|
fdc99bb6f9 | ||
|
|
36eac6badd | ||
|
|
7cac2521ef | ||
|
|
e8a9e49e9e | ||
|
|
fb55cdaea6 | ||
|
|
b9b2cc8364 | ||
|
|
8dfdd090f5 | ||
|
|
fe7705524a | ||
|
|
8e77d729e5 | ||
|
|
2b1b7774f8 | ||
|
|
2d58019d6e | ||
|
|
fe31f08c0d | ||
|
|
d9fb36a9a6 | ||
|
|
52f4876f2d | ||
|
|
ad7a55d305 | ||
|
|
2e3534dfb7 | ||
|
|
d288c1b052 | ||
|
|
f2cf361acf | ||
|
|
e7af24c139 | ||
|
|
9797942b8e | ||
|
|
32d60a7eb9 | ||
|
|
4330dc47a0 | ||
|
|
8ca9ad3497 | ||
|
|
a679fedb58 | ||
|
|
880f4ad711 | ||
|
|
e000fb4579 | ||
|
|
22c042e21f | ||
|
|
2c3f07521d | ||
|
|
e06f3ef97e | ||
|
|
7e41a2750c | ||
|
|
b2a48a1f3a | ||
|
|
e1bf4dcbc9 | ||
|
|
6d847d22d3 | ||
|
|
9337564075 | ||
|
|
2fa41b44c5 | ||
|
|
8d2c2202fa | ||
|
|
380bb0cd01 | ||
|
|
789f62267c | ||
|
|
25553c9e67 | ||
|
|
81a54cd4a0 | ||
|
|
1d2fc773c2 | ||
|
|
7767edd82f | ||
|
|
99ea238c3f | ||
|
|
826c434630 | ||
|
|
4401a8e1e8 | ||
|
|
4ce4ac9584 | ||
|
|
88bd65c679 | ||
|
|
9eab3026bb | ||
|
|
7abaedbf31 | ||
|
|
402718d293 | ||
|
|
990a84c202 | ||
|
|
d8e181a828 | ||
|
|
4ec671d199 | ||
|
|
9f4a514562 | ||
|
|
18ee239362 | ||
|
|
08687b76ea | ||
|
|
60d07a6871 | ||
|
|
81f4966a1a | ||
|
|
9acf723a9a | ||
|
|
47f7f5f4d9 | ||
|
|
14d6372bd8 | ||
|
|
6d912c4897 | ||
|
|
62e1284790 | ||
|
|
d79ae261e1 | ||
|
|
92f6558e55 | ||
|
|
8d49249ed7 | ||
|
|
d1bb62c40e | ||
|
|
42017fde5f | ||
|
|
786bbbc160 | ||
|
|
0cc013c13f | ||
|
|
c5475765e5 | ||
|
|
9ea91f821c | ||
|
|
b757dfcf79 | ||
|
|
44ddcdd852 | ||
|
|
66204811cf | ||
|
|
822a8509b3 | ||
|
|
9f62490a75 | ||
|
|
b63ecba695 | ||
|
|
d5ae3802d1 | ||
|
|
7c6cd63a53 | ||
|
|
62a80ef016 | ||
|
|
27ab55d26a | ||
|
|
34150e7177 | ||
|
|
b946599320 | ||
|
|
3cd4be4e48 | ||
|
|
96e2b9bc18 | ||
|
|
adb8caa8a2 | ||
|
|
0054a32dc7 | ||
|
|
513ce1a183 | ||
|
|
9f38ea6ee7 | ||
|
|
0e13678f7c | ||
|
|
f0cbca2838 | ||
|
|
f6f7836b8e | ||
|
|
7651c53363 | ||
|
|
0f25c8a95f | ||
|
|
1a49894adf | ||
|
|
bd8c078fb9 | ||
|
|
6e060b87b8 | ||
|
|
2375b170ba | ||
|
|
eeedb91ef7 | ||
|
|
05b51c0f68 | ||
|
|
8bf794f13b | ||
|
|
48b401164a | ||
|
|
b65631be7e | ||
|
|
439b45b0b8 | ||
|
|
976b2aa6f5 | ||
|
|
88213c1bbd | ||
|
|
d2e3aedf7f | ||
|
|
368d3b1b97 | ||
|
|
9301679707 | ||
|
|
865f7e1ee1 | ||
|
|
c243d2e85c | ||
|
|
97a35d6fba | ||
|
|
3f0974d3d2 | ||
|
|
48a7c0235f | ||
|
|
ac7d5f2e81 | ||
|
|
516e6c35da | ||
|
|
7cad386a56 | ||
|
|
60c908cd63 | ||
|
|
52a907651e | ||
|
|
3254b551d8 | ||
|
|
7a62d1636b | ||
|
|
7d9b720ea8 | ||
|
|
ba500a3a80 | ||
|
|
606d5afcab | ||
|
|
4b66765cc1 | ||
|
|
8651e47118 | ||
|
|
34bc02965f | ||
|
|
eacefeb08b | ||
|
|
11a61325f9 | ||
|
|
370c63986d | ||
|
|
d103b16d9a | ||
|
|
c63bb7ce8a | ||
|
|
af5c623671 | ||
|
|
55d1f9e9f0 | ||
|
|
96a7b4e45e | ||
|
|
c83ca78565 | ||
|
|
c5eac8f438 | ||
|
|
9bc1f5af45 | ||
|
|
423a70d102 | ||
|
|
562c729ed6 | ||
|
|
0760dc742b | ||
|
|
1098d75ce0 | ||
|
|
bd8e5f255b | ||
|
|
8da094cd3c | ||
|
|
44dc3c28de | ||
|
|
828cce0d78 | ||
|
|
49c0d3199d | ||
|
|
416d733510 | ||
|
|
6de4914ea6 | ||
|
|
9f1e777e6d | ||
|
|
adb9ce5e93 | ||
|
|
746181689f | ||
|
|
a99c016818 | ||
|
|
37f279fab0 | ||
|
|
ab535bf147 | ||
|
|
1876664dfb | ||
|
|
1690248e24 | ||
|
|
cbeb8ea17e | ||
|
|
e355b449c4 | ||
|
|
4fdea77c57 | ||
|
|
9a13edd490 | ||
|
|
6d276582cb | ||
|
|
493730dff6 | ||
|
|
b00a9f4415 | ||
|
|
b25c1d6fa8 | ||
|
|
c9113ae752 | ||
|
|
0ec11d29ba | ||
|
|
a6cd25071e | ||
|
|
97b13ae91d | ||
|
|
0178232f26 | ||
|
|
cc138ef9f8 | ||
|
|
1552c3804d | ||
|
|
7963de0abc | ||
|
|
f98a20928c | ||
|
|
209b1610f6 | ||
|
|
bd0f7d3680 | ||
|
|
f852e1de81 | ||
|
|
c9770573b2 | ||
|
|
23701219e1 | ||
|
|
c9bc4ad108 | ||
|
|
8b9c235465 | ||
|
|
20fdeee048 | ||
|
|
657d01da95 | ||
|
|
17e2627a34 | ||
|
|
bf7541bfb9 | ||
|
|
9d81bf030d | ||
|
|
f25d735b9d | ||
|
|
4d16018f6c | ||
|
|
5e11840137 | ||
|
|
61474defff | ||
|
|
b12e38c231 | ||
|
|
d1f679ab90 | ||
|
|
0f8a7bad06 | ||
|
|
9e031dcd60 | ||
|
|
51c3f98dde | ||
|
|
a79a063d17 | ||
|
|
5e91b1b5e0 | ||
|
|
7877443fb4 | ||
|
|
759e47bfcf | ||
|
|
67bdffb27b | ||
|
|
3386dace3b | ||
|
|
f3a2e2cbde | ||
|
|
3cf3fc13b9 | ||
|
|
2b69abf8ab | ||
|
|
3e49a7dbfa | ||
|
|
4c7c3105e8 | ||
|
|
f782d2bef9 | ||
|
|
ccaa9eae3a | ||
|
|
24c5388e0c | ||
|
|
1cd2711097 | ||
|
|
f0dfe7d552 | ||
|
|
3b8b4da149 | ||
|
|
2150619d62 | ||
|
|
acb76e0630 | ||
|
|
fdb46f9329 | ||
|
|
ca587cccf6 | ||
|
|
571772069a | ||
|
|
79e7762c72 | ||
|
|
d025cfee1b | ||
|
|
7793552443 | ||
|
|
f377a84fa1 | ||
|
|
b8f2797abf | ||
|
|
54d89a9f47 | ||
|
|
1699646b39 | ||
|
|
94a0a31f17 | ||
|
|
10219fb9dd | ||
|
|
50431dd55a | ||
|
|
17b23d92ef | ||
|
|
14f3c783f2 | ||
|
|
c1d0a1e07b | ||
|
|
1d3608b7bf | ||
|
|
d0c655f66a | ||
|
|
ac75fd2ca3 | ||
|
|
3b98428c8c | ||
|
|
7d877d0fef | ||
|
|
cb79f2c7eb | ||
|
|
547a5714ae | ||
|
|
82420fe5f6 | ||
|
|
395913d1bb | ||
|
|
f3a29b55ba | ||
|
|
232321f3a4 | ||
|
|
51dddb0bbb | ||
|
|
8b9bf6e46f | ||
|
|
631a75deec | ||
|
|
3f1d0e5872 | ||
|
|
0fe91d0184 | ||
|
|
2f711a12f8 | ||
|
|
64f32ba38f | ||
|
|
7db4859fb9 | ||
|
|
eee9fcae5c | ||
|
|
9c4a976342 | ||
|
|
e4a09c6207 | ||
|
|
d467db2227 | ||
|
|
b8d6ff0542 | ||
|
|
a9b8e65c9b | ||
|
|
bb8b563ece | ||
|
|
05a8ffb944 | ||
|
|
2502646a64 | ||
|
|
3d95d69f80 | ||
|
|
df751f5d67 | ||
|
|
4f06b6de78 | ||
|
|
d2177cd517 | ||
|
|
0affcf5ad2 | ||
|
|
7a416b107b | ||
|
|
1ff124dab7 | ||
|
|
4cb511bad0 | ||
|
|
73c8d145fa | ||
|
|
ab79f24729 | ||
|
|
cec71f65b3 | ||
|
|
f75c008154 | ||
|
|
474baa7d95 | ||
|
|
a155b6e8d5 | ||
|
|
229974e543 | ||
|
|
6fc19bfb93 | ||
|
|
ccaa108faa | ||
|
|
0a72383495 | ||
|
|
d389100611 | ||
|
|
ea7257a5b2 | ||
|
|
0ebc947fbd | ||
|
|
c89514f9bb | ||
|
|
e0368e395c | ||
|
|
6986c201dd | ||
|
|
bcf163f8a1 | ||
|
|
15aaead7b9 | ||
|
|
d29c5c4758 | ||
|
|
81e2baeee5 | ||
|
|
4cececafc9 | ||
|
|
7c8e7a3f4b | ||
|
|
613d5f93e8 | ||
|
|
4f5b23fbf8 | ||
|
|
a37b9cfc7b | ||
|
|
2bc18bc214 | ||
|
|
f31a998c5d | ||
|
|
5552917533 | ||
|
|
a9702aa6a2 | ||
|
|
d1941cc650 | ||
|
|
f98fa4098f | ||
|
|
5350496ed4 | ||
|
|
b62d79044a | ||
|
|
0db3722ec2 | ||
|
|
d47403c0e7 | ||
|
|
77311954a1 | ||
|
|
b7cf4fe96b | ||
|
|
6d9b702d4c | ||
|
|
882ebdbd8f |
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [zadam]
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
dist/
|
||||
src/public/app-dist/
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
*.db
|
||||
|
||||
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -2,4 +2,5 @@
|
||||
/workspace.xml
|
||||
|
||||
# Datasource local storage ignored files
|
||||
/dataSources.local.xml
|
||||
/dataSources.local.xml
|
||||
/dataSources/
|
||||
|
||||
7
.idea/dataSources.xml
generated
7
.idea/dataSources.xml
generated
@@ -1,14 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="document.db" uuid="a2c75661-f9e2-478f-a69f-6a9409e69997">
|
||||
<data-source source="LOCAL" name="document.db" uuid="4e69c96a-8a2b-43f5-9b40-d1608f75f7a4">
|
||||
<driver-ref>sqlite.xerial</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/../trilium-data/document.db</jdbc-url>
|
||||
<driver-properties>
|
||||
<property name="enable_load_extension" value="true" />
|
||||
</driver-properties>
|
||||
<jdbc-url>jdbc:sqlite:$USER_HOME$/trilium-data/document.db</jdbc-url>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,641 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataSource name="document.db">
|
||||
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.17">
|
||||
<root id="1">
|
||||
<ServerVersion>3.25.1</ServerVersion>
|
||||
</root>
|
||||
<schema id="2" parent="1" name="main">
|
||||
<Current>1</Current>
|
||||
</schema>
|
||||
<collation id="3" parent="1" name="BINARY"/>
|
||||
<collation id="4" parent="1" name="NOCASE"/>
|
||||
<collation id="5" parent="1" name="RTRIM"/>
|
||||
<table id="6" parent="2" name="api_tokens"/>
|
||||
<table id="7" parent="2" name="attributes"/>
|
||||
<table id="8" parent="2" name="branches"/>
|
||||
<table id="9" parent="2" name="note_contents"/>
|
||||
<table id="10" parent="2" name="note_revision_contents"/>
|
||||
<table id="11" parent="2" name="note_revisions"/>
|
||||
<table id="12" parent="2" name="notes"/>
|
||||
<table id="13" parent="2" name="options"/>
|
||||
<table id="14" parent="2" name="recent_notes"/>
|
||||
<table id="15" parent="2" name="source_ids"/>
|
||||
<table id="16" parent="2" name="sqlite_master">
|
||||
<System>1</System>
|
||||
</table>
|
||||
<table id="17" parent="2" name="sqlite_sequence">
|
||||
<System>1</System>
|
||||
</table>
|
||||
<table id="18" parent="2" name="sync"/>
|
||||
<column id="19" parent="6" name="apiTokenId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="20" parent="6" name="token">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="21" parent="6" name="utcDateCreated">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="22" parent="6" name="isDeleted">
|
||||
<Position>4</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="23" parent="6" name="hash">
|
||||
<Position>5</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>apiTokenId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="25" parent="6">
|
||||
<ColNames>apiTokenId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_api_tokens_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="26" parent="7" name="attributeId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="27" parent="7" name="noteId">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="28" parent="7" name="type">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="29" parent="7" name="name">
|
||||
<Position>4</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="30" parent="7" name="value">
|
||||
<Position>5</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>''</DefaultExpression>
|
||||
</column>
|
||||
<column id="31" parent="7" name="position">
|
||||
<Position>6</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="32" parent="7" name="utcDateCreated">
|
||||
<Position>7</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="33" parent="7" name="utcDateModified">
|
||||
<Position>8</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="34" parent="7" name="isDeleted">
|
||||
<Position>9</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="35" parent="7" name="hash">
|
||||
<Position>10</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<column id="36" parent="7" name="isInheritable">
|
||||
<Position>11</Position>
|
||||
<DataType>int|0s</DataType>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<index id="37" parent="7" name="sqlite_autoindex_attributes_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>attributeId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="38" parent="7" name="IDX_attributes_noteId_index">
|
||||
<ColNames>noteId</ColNames>
|
||||
</index>
|
||||
<index id="39" parent="7" name="IDX_attributes_name_value">
|
||||
<ColNames>name
|
||||
value</ColNames>
|
||||
</index>
|
||||
<index id="40" parent="7" name="IDX_attributes_value_index">
|
||||
<ColNames>value</ColNames>
|
||||
</index>
|
||||
<key id="41" parent="7">
|
||||
<ColNames>attributeId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="42" parent="8" name="branchId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="43" parent="8" name="noteId">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="44" parent="8" name="parentNoteId">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="45" parent="8" name="notePosition">
|
||||
<Position>4</Position>
|
||||
<DataType>INTEGER|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="46" parent="8" name="prefix">
|
||||
<Position>5</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
</column>
|
||||
<column id="47" parent="8" name="isExpanded">
|
||||
<Position>6</Position>
|
||||
<DataType>INTEGER|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="48" parent="8" name="isDeleted">
|
||||
<Position>7</Position>
|
||||
<DataType>INTEGER|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="49" parent="8" name="utcDateModified">
|
||||
<Position>8</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="50" parent="8" name="utcDateCreated">
|
||||
<Position>9</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="51" parent="8" name="hash">
|
||||
<Position>10</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<index id="52" parent="8" name="sqlite_autoindex_branches_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>branchId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="53" parent="8" name="IDX_branches_noteId_parentNoteId">
|
||||
<ColNames>noteId
|
||||
parentNoteId</ColNames>
|
||||
</index>
|
||||
<index id="54" parent="8" name="IDX_branches_parentNoteId">
|
||||
<ColNames>parentNoteId</ColNames>
|
||||
</index>
|
||||
<key id="55" parent="8">
|
||||
<ColNames>branchId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="56" parent="9" name="noteId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="57" parent="9" name="content">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<DefaultExpression>NULL</DefaultExpression>
|
||||
</column>
|
||||
<column id="58" parent="9" name="hash">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<column id="59" parent="9" name="utcDateModified">
|
||||
<Position>4</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="60" parent="9" name="sqlite_autoindex_note_contents_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="61" parent="9">
|
||||
<ColNames>noteId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="62" parent="10" name="noteRevisionId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="63" parent="10" name="content">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
</column>
|
||||
<column id="64" parent="10" name="hash">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>''</DefaultExpression>
|
||||
</column>
|
||||
<column id="65" parent="10" name="utcDateModified">
|
||||
<Position>4</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="66" parent="10" name="sqlite_autoindex_note_revision_contents_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="67" parent="10">
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_note_revision_contents_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="68" parent="11" name="noteRevisionId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="69" parent="11" name="noteId">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="70" parent="11" name="title">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
</column>
|
||||
<column id="71" parent="11" name="contentLength">
|
||||
<Position>4</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="72" parent="11" name="isErased">
|
||||
<Position>5</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="73" parent="11" name="isProtected">
|
||||
<Position>6</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="74" parent="11" name="utcDateLastEdited">
|
||||
<Position>7</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="75" parent="11" name="utcDateCreated">
|
||||
<Position>8</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="76" parent="11" name="utcDateModified">
|
||||
<Position>9</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="77" parent="11" name="dateLastEdited">
|
||||
<Position>10</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="78" parent="11" name="dateCreated">
|
||||
<Position>11</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="79" parent="11" name="type">
|
||||
<Position>12</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>''</DefaultExpression>
|
||||
</column>
|
||||
<column id="80" parent="11" name="mime">
|
||||
<Position>13</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>''</DefaultExpression>
|
||||
</column>
|
||||
<column id="81" parent="11" name="hash">
|
||||
<Position>14</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>''</DefaultExpression>
|
||||
</column>
|
||||
<index id="82" parent="11" name="sqlite_autoindex_note_revisions_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="83" parent="11" name="IDX_note_revisions_noteId">
|
||||
<ColNames>noteId</ColNames>
|
||||
</index>
|
||||
<index id="84" parent="11" name="IDX_note_revisions_utcDateLastEdited">
|
||||
<ColNames>utcDateLastEdited</ColNames>
|
||||
</index>
|
||||
<index id="85" parent="11" name="IDX_note_revisions_utcDateCreated">
|
||||
<ColNames>utcDateCreated</ColNames>
|
||||
</index>
|
||||
<index id="86" parent="11" name="IDX_note_revisions_dateLastEdited">
|
||||
<ColNames>dateLastEdited</ColNames>
|
||||
</index>
|
||||
<index id="87" parent="11" name="IDX_note_revisions_dateCreated">
|
||||
<ColNames>dateCreated</ColNames>
|
||||
</index>
|
||||
<key id="88" parent="11">
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="89" parent="12" name="noteId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="90" parent="12" name="title">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>"note"</DefaultExpression>
|
||||
</column>
|
||||
<column id="91" parent="12" name="contentLength">
|
||||
<Position>3</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="92" parent="12" name="isProtected">
|
||||
<Position>4</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="93" parent="12" name="type">
|
||||
<Position>5</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>'text'</DefaultExpression>
|
||||
</column>
|
||||
<column id="94" parent="12" name="mime">
|
||||
<Position>6</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>'text/html'</DefaultExpression>
|
||||
</column>
|
||||
<column id="95" parent="12" name="hash">
|
||||
<Position>7</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<column id="96" parent="12" name="isDeleted">
|
||||
<Position>8</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="97" parent="12" name="isErased">
|
||||
<Position>9</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="98" parent="12" name="dateCreated">
|
||||
<Position>10</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="99" parent="12" name="dateModified">
|
||||
<Position>11</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="100" parent="12" name="utcDateCreated">
|
||||
<Position>12</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="101" parent="12" name="utcDateModified">
|
||||
<Position>13</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="102" parent="12" name="sqlite_autoindex_notes_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="103" parent="12" name="IDX_notes_title">
|
||||
<ColNames>title</ColNames>
|
||||
</index>
|
||||
<index id="104" parent="12" name="IDX_notes_type">
|
||||
<ColNames>type</ColNames>
|
||||
</index>
|
||||
<index id="105" parent="12" name="IDX_notes_isDeleted">
|
||||
<ColNames>isDeleted</ColNames>
|
||||
</index>
|
||||
<index id="106" parent="12" name="IDX_notes_dateCreated">
|
||||
<ColNames>dateCreated</ColNames>
|
||||
</index>
|
||||
<index id="107" parent="12" name="IDX_notes_dateModified">
|
||||
<ColNames>dateModified</ColNames>
|
||||
</index>
|
||||
<index id="108" parent="12" name="IDX_notes_utcDateCreated">
|
||||
<ColNames>utcDateCreated</ColNames>
|
||||
</index>
|
||||
<index id="109" parent="12" name="IDX_notes_utcDateModified">
|
||||
<ColNames>utcDateModified</ColNames>
|
||||
</index>
|
||||
<key id="110" parent="12">
|
||||
<ColNames>noteId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="111" parent="13" name="name">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="112" parent="13" name="value">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
</column>
|
||||
<column id="113" parent="13" name="isSynced">
|
||||
<Position>3</Position>
|
||||
<DataType>INTEGER|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="114" parent="13" name="hash">
|
||||
<Position>4</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<column id="115" parent="13" name="utcDateCreated">
|
||||
<Position>5</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="116" parent="13" name="utcDateModified">
|
||||
<Position>6</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="117" parent="13" name="sqlite_autoindex_options_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>name</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="118" parent="13">
|
||||
<ColNames>name</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="119" parent="14" name="noteId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="120" parent="14" name="notePath">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="121" parent="14" name="hash">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>""</DefaultExpression>
|
||||
</column>
|
||||
<column id="122" parent="14" name="utcDateCreated">
|
||||
<Position>4</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="123" parent="14" name="isDeleted">
|
||||
<Position>5</Position>
|
||||
<DataType>INT|0s</DataType>
|
||||
</column>
|
||||
<index id="124" parent="14" name="sqlite_autoindex_recent_notes_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="125" parent="14">
|
||||
<ColNames>noteId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="126" parent="15" name="sourceId">
|
||||
<Position>1</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="127" parent="15" name="utcDateCreated">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="128" parent="15" name="sqlite_autoindex_source_ids_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>sourceId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="129" parent="15" name="IDX_source_ids_utcDateCreated">
|
||||
<ColNames>utcDateCreated</ColNames>
|
||||
</index>
|
||||
<key id="130" parent="15">
|
||||
<ColNames>sourceId</ColNames>
|
||||
<Primary>1</Primary>
|
||||
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
|
||||
</key>
|
||||
<column id="131" parent="16" name="type">
|
||||
<Position>1</Position>
|
||||
<DataType>text|0s</DataType>
|
||||
</column>
|
||||
<column id="132" parent="16" name="name">
|
||||
<Position>2</Position>
|
||||
<DataType>text|0s</DataType>
|
||||
</column>
|
||||
<column id="133" parent="16" name="tbl_name">
|
||||
<Position>3</Position>
|
||||
<DataType>text|0s</DataType>
|
||||
</column>
|
||||
<column id="134" parent="16" name="rootpage">
|
||||
<Position>4</Position>
|
||||
<DataType>int|0s</DataType>
|
||||
</column>
|
||||
<column id="135" parent="16" name="sql">
|
||||
<Position>5</Position>
|
||||
<DataType>text|0s</DataType>
|
||||
</column>
|
||||
<column id="136" parent="17" name="name">
|
||||
<Position>1</Position>
|
||||
</column>
|
||||
<column id="137" parent="17" name="seq">
|
||||
<Position>2</Position>
|
||||
</column>
|
||||
<column id="138" parent="18" name="id">
|
||||
<Position>1</Position>
|
||||
<DataType>INTEGER|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<SequenceIdentity>1</SequenceIdentity>
|
||||
</column>
|
||||
<column id="139" parent="18" name="entityName">
|
||||
<Position>2</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="140" parent="18" name="entityId">
|
||||
<Position>3</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="141" parent="18" name="sourceId">
|
||||
<Position>4</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="142" parent="18" name="utcSyncDate">
|
||||
<Position>5</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="143" parent="18" name="IDX_sync_entityName_entityId">
|
||||
<ColNames>entityName
|
||||
entityId</ColNames>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="144" parent="18" name="IDX_sync_utcSyncDate">
|
||||
<ColNames>utcSyncDate</ColNames>
|
||||
</index>
|
||||
<key id="145" parent="18">
|
||||
<ColNames>id</ColNames>
|
||||
<Primary>1</Primary>
|
||||
</key>
|
||||
</database-model>
|
||||
</dataSource>
|
||||
@@ -1,2 +0,0 @@
|
||||
#n:main
|
||||
!<md> [0, 0, null, null, -2147483648, -2147483648]
|
||||
1
.idea/inspectionProfiles/Project_Default.xml
generated
1
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,6 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JSUnfilteredForInLoop" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
|
||||
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
@@ -2,5 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
18
.vscode/launch.json
vendored
Normal file
18
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "start-server",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"env": {
|
||||
"TRILIUM_ENV": "dev"
|
||||
},
|
||||
"outputCapture": "std",
|
||||
"program": "${workspaceFolder}/src/www"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:12.13.1-alpine
|
||||
FROM node:12.19.0-alpine
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
@@ -23,5 +23,7 @@ RUN set -x \
|
||||
# Bundle app source
|
||||
COPY . .
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 8080
|
||||
CMD [ "node", "./src/www" ]
|
||||
|
||||
58
README-ZH_CN.md
Normal file
58
README-ZH_CN.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Trilium注意事项
|
||||
|
||||
[](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
Trilium Notes是一个分层的笔记应用程序,专注于建立大型个人知识库。请参阅[屏幕截图](https://github.com/zadam/trilium/wiki/Screenshot-tour)以快速了解:
|
||||
|
||||

|
||||
|
||||
## 特性
|
||||
|
||||
* 笔记可以排列成任意深的树。单个笔记可以放在树中的多个位置(请参阅[克隆](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||
* 丰富的所见即所得笔记编辑功能,包括带有markdown[自动格式化功能的](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)表格,图像和[数学](https://github.com/zadam/trilium/wiki/Text-notes#math-support)
|
||||
* 支持编辑[使用源代码的笔记](https://github.com/zadam/trilium/wiki/Code-notes),包括语法高亮显示
|
||||
* 笔记之间快速[导航](https://github.com/zadam/trilium/wiki/Note-navigation),全文搜索和[笔记挂起](https://github.com/zadam/trilium/wiki/Note-hoisting)
|
||||
* 无缝[笔记版本控制](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||
* 笔记[属性](https://github.com/zadam/trilium/wiki/Attributes)可用于笔记组织,查询和高级[脚本编写](https://github.com/zadam/trilium/wiki/Scripts)
|
||||
* [同步](https://github.com/zadam/trilium/wiki/Synchronization)与自托管同步服务器
|
||||
* 具有按笔记粒度的强大的[笔记加密](https://github.com/zadam/trilium/wiki/Protected-notes)
|
||||
* [关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map),用于可视化笔记及其关系
|
||||
* [脚本](https://github.com/zadam/trilium/wiki/Scripts)-请参阅[高级展示](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||
* 可用性和性能均能很好地扩展至超过10万个笔记
|
||||
* 针对智能手机和平板电脑进行触摸优化的[移动前端](https://github.com/zadam/trilium/wiki/Mobile-frontend)
|
||||
* [夜间主题](https://github.com/zadam/trilium/wiki/Themes)
|
||||
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import)和[Markdown导入导出](https://github.com/zadam/trilium/wiki/Markdown)
|
||||
* [Web Clipper](https://github.com/zadam/trilium/wiki/Web-clipper)可轻松保存Web内容
|
||||
|
||||
## 构建
|
||||
|
||||
Trilium是作为桌面应用程序(Linux和Windows)或服务器上托管的Web应用程序(Linux)提供的。Mac OS桌面版本可用,但[不受支持](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support)。
|
||||
|
||||
* 如果要在桌面上使用Trilium,请从[最新版本](https://github.com/zadam/trilium/releases/latest)下载适用于您平台的二进制[版本](https://github.com/zadam/trilium/releases/latest),解压缩该软件包并运行`trilium`可执行文件。
|
||||
* 如果要在服务器上安装Trilium,请遵循[此页面](https://github.com/zadam/trilium/wiki/Server-installation)。
|
||||
* 当前仅支持(经过测试)最新的Chrome和Firefox浏览器。
|
||||
|
||||
## 文档
|
||||
|
||||
[有关文档页面的完整列表,请参见Wiki。](https://github.com/zadam/trilium/wiki/)
|
||||
|
||||
您还可以阅读[个人知识库模式](https://github.com/zadam/trilium/wiki/Patterns-of-personal-knowledge-base),以获取有关如何使用Trilium的灵感。
|
||||
|
||||
## 贡献
|
||||
|
||||
使用基于浏览器的开发环境
|
||||
|
||||
[](https://gitpod.io/#https://github.com/zadam/trilium)
|
||||
|
||||
或在本地克隆并运行
|
||||
|
||||
```
|
||||
npm install
|
||||
npm run start-server
|
||||
```
|
||||
|
||||
## 致谢
|
||||
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - 市场上最好的所见即所得编辑器,互动性强且聆听能力强的团队
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - 一个非常丰富的关于树的库,强大的没有对手。没有它,Trilium Notes将不会如此。
|
||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - 支持大量语言的代码编辑器
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb)强大的可视化连接库。- 用于[关系图](https://github.com/zadam/trilium/wiki/Relation-map)和[链接图](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
@@ -8,7 +8,7 @@ Trilium Notes is a hierarchical note taking application with focus on building l
|
||||
## Features
|
||||
|
||||
* Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes))
|
||||
* Rich WYSIWYG note editing including e.g. tables and images with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-editor#autoformat)
|
||||
* Rich WYSIWYG note editing including e.g. tables, images and [math](https://github.com/zadam/trilium/wiki/Text-notes#math-support) with markdown [autoformat](https://github.com/zadam/trilium/wiki/Text-notes#autoformat)
|
||||
* Support for editing [notes with source code](https://github.com/zadam/trilium/wiki/Code-notes), including syntax highlighting
|
||||
* Fast and easy [navigation between notes](https://github.com/zadam/trilium/wiki/Note-navigation), full text search and [note hoisting](https://github.com/zadam/trilium/wiki/Note-hoisting)
|
||||
* Seamless [note versioning](https://github.com/zadam/trilium/wiki/Note-revisions)
|
||||
@@ -54,4 +54,4 @@ npm run start-server
|
||||
* [CKEditor 5](https://github.com/ckeditor/ckeditor5) - best WYSIWYG editor on the market, very interactive and listening team
|
||||
* [FancyTree](https://github.com/mar10/fancytree) - very feature rich tree library without real competition. Trilium Notes would not be the same without it.
|
||||
* [CodeMirror](https://github.com/codemirror/CodeMirror) - code editor with support for huge amount of languages
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
* [jsPlumb](https://github.com/jsplumb/jsplumb) - visual connectivity library without competition. Used in [relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map)
|
||||
|
||||
13
SECURITY.md
Normal file
13
SECURITY.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
In the (still active) 0.X phase of the project only the latest stable minor release is getting bugfixes (including security ones).
|
||||
|
||||
So e.g. if the latest stable version is 0.42.3 and the latest beta version is 0.43.0-beta, then 0.42 line will still get security fixes but older versions (like 0.41.X) won't get any fixes.
|
||||
|
||||
Description above is a general rule and may be altered on case by case basis.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
You can report low severity vulnerabilities as GitHub issues, more severe vulnerabilities should be reported to the email zadam.apps@gmail.com
|
||||
BIN
bin/better-sqlite3/linux-desktop-better_sqlite3.node
Normal file
BIN
bin/better-sqlite3/linux-desktop-better_sqlite3.node
Normal file
Binary file not shown.
BIN
bin/better-sqlite3/linux-server-better_sqlite3.node
Normal file
BIN
bin/better-sqlite3/linux-server-better_sqlite3.node
Normal file
Binary file not shown.
BIN
bin/better-sqlite3/mac-better_sqlite3.node
Normal file
BIN
bin/better-sqlite3/mac-better_sqlite3.node
Normal file
Binary file not shown.
BIN
bin/better-sqlite3/win-better_sqlite3.node
Normal file
BIN
bin/better-sqlite3/win-better_sqlite3.node
Normal file
Binary file not shown.
@@ -5,7 +5,7 @@ SERIES=${VERSION:0:4}-latest
|
||||
|
||||
cat package.json | grep -v electron > server-package.json
|
||||
|
||||
sudo docker build -t zadam/trilium:$VERSION -t zadam/trilium:$SERIES .
|
||||
sudo docker build -t zadam/trilium:$VERSION --network host -t zadam/trilium:$SERIES .
|
||||
|
||||
if [[ $VERSION != *"beta"* ]]; then
|
||||
sudo docker tag zadam/trilium:$VERSION zadam/trilium:latest
|
||||
|
||||
@@ -7,15 +7,13 @@ then
|
||||
./bin/copy-trilium.sh $SRC_DIR
|
||||
fi
|
||||
|
||||
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
||||
|
||||
echo "Copying required linux-x64 binaries"
|
||||
|
||||
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||
cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||
|
||||
cp -r bin/deps/linux-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp bin/deps/linux-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||
cp bin/deps/linux-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
||||
echo "Packaging linux x64 electron build"
|
||||
|
||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
|
||||
|
||||
@@ -29,6 +27,9 @@ cp images/app-icons/png/128x128.png $BUILD_DIR/icon.png
|
||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||
rm -r $BUILD_DIR/swiftshader
|
||||
|
||||
cp bin/tpl/portable-trilium.sh $BUILD_DIR/
|
||||
chmod 755 $BUILD_DIR/portable-trilium.sh
|
||||
|
||||
echo "Packaging linux x64 electron distribution..."
|
||||
VERSION=`jq -r ".version" package.json`
|
||||
|
||||
@@ -38,4 +39,4 @@ tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64
|
||||
|
||||
cd ..
|
||||
|
||||
bin/build-debian.sh
|
||||
bin/build-debian.sh
|
||||
|
||||
@@ -9,19 +9,11 @@ fi
|
||||
|
||||
echo "Copying required mac binaries"
|
||||
|
||||
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
||||
cp -r bin/better-sqlite3/mac-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||
|
||||
cp -r bin/deps/mac-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp bin/deps/mac-x64/image/cjpeg $SRC_DIR/node_modules/mozjpeg/vendor/
|
||||
cp bin/deps/mac-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||
cp bin/deps/mac-x64/image/gifsicle $SRC_DIR/node_modules/giflossy/vendor/
|
||||
cp bin/deps/mac-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
||||
cp bin/deps/mac-x64/keyboard-layout-manager.node $SRC_DIR/node_modules/keyboard-layout/build/Release/
|
||||
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
||||
|
||||
echo "Packaging mac x64 electron build"
|
||||
|
||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PKG_DIR=dist/trilium-linux-x64-server
|
||||
NODE_VERSION=12.13.1
|
||||
NODE_VERSION=12.19.0
|
||||
|
||||
if [ "$1" != "DONTCOPY" ]
|
||||
then
|
||||
@@ -16,11 +16,12 @@ cd ..
|
||||
|
||||
mv dist/node-v${NODE_VERSION}-linux-x64 $PKG_DIR/node
|
||||
|
||||
rm -r $PKG_DIR/node/lib/node_modules/npm
|
||||
rm -r $PKG_DIR/node/include/node
|
||||
|
||||
rm -r $PKG_DIR/node_modules/electron*
|
||||
|
||||
rm -r $PKG_DIR/node_modules/sqlite3/lib/binding/*
|
||||
|
||||
cp -r ./bin/deps/linux-x64/sqlite/node* $PKG_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||
|
||||
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
|
||||
chmod 755 $PKG_DIR/trilium.sh
|
||||
|
||||
@@ -9,20 +9,11 @@ fi
|
||||
|
||||
echo "Copying required windows binaries"
|
||||
|
||||
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
||||
rm -r $SRC_DIR/node_modules/cld/build/Release/*
|
||||
cp -r bin/better-sqlite3/win-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||
|
||||
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
|
||||
cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||
cp bin/deps/win-x64/image/gifsicle.exe $SRC_DIR/node_modules/giflossy/vendor/
|
||||
cp bin/deps/win-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
||||
cp bin/deps/win-x64/keyboard-layout-manager.node $SRC_DIR/node_modules/keyboard-layout/build/Release/
|
||||
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
||||
|
||||
echo "Packaging windows x64 electron build"
|
||||
|
||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
|
||||
|
||||
@@ -34,6 +25,8 @@ mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
|
||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||
rm -r $BUILD_DIR/swiftshader
|
||||
|
||||
cp bin/tpl/portable-trilium.bat $BUILD_DIR/
|
||||
|
||||
echo "Zipping windows x64 electron distribution..."
|
||||
VERSION=`jq -r ".version" package.json`
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ if [[ $# -eq 0 ]] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
npm run webpack
|
||||
|
||||
DIR=$1
|
||||
|
||||
rm -rf $DIR
|
||||
@@ -22,11 +24,28 @@ cp -r README.md $DIR/
|
||||
cp -r LICENSE $DIR/
|
||||
cp -r config-sample.ini $DIR/
|
||||
cp -r electron.js $DIR/
|
||||
cp webpack-* $DIR/
|
||||
|
||||
# run in subshell (so we return to original dir)
|
||||
(cd $DIR && npm install --only=prod)
|
||||
|
||||
rm -r $DIR/node_modules/cld/deps
|
||||
# cleanup of useless files in dependencies
|
||||
rm -r $DIR/node_modules/image-q/demo
|
||||
rm -r $DIR/node_modules/better-sqlite3/Release
|
||||
rm -r $DIR/node_modules/better-sqlite3/deps/sqlite3.tar.gz
|
||||
rm -r $DIR/node_modules/@jimp/plugin-print/fonts
|
||||
rm -r $DIR/node_modules/jimp/browser
|
||||
rm -r $DIR/node_modules/jimp/fonts
|
||||
|
||||
# delete all tests (there are often large images as test file for jimp etc.)
|
||||
find $DIR/node_modules -name test -exec rm -rf {} \;
|
||||
find $DIR/node_modules -name docs -exec rm -rf {} \;
|
||||
find $DIR/node_modules -name demo -exec rm -rf {} \;
|
||||
|
||||
find $DIR/libraries -name "*.map" -type f -delete
|
||||
find $DIR/libraries -name "hunspell.lib" -type f -delete
|
||||
|
||||
rm -r $DIR/src/public/app
|
||||
|
||||
sed -i -e 's/app\/desktop.js/app-dist\/desktop.js/g' $DIR/src/views/desktop.ejs
|
||||
sed -i -e 's/app\/mobile.js/app-dist\/mobile.js/g' $DIR/src/views/mobile.ejs
|
||||
sed -i -e 's/app\/setup.js/app-dist\/setup.js/g' $DIR/src/views/setup.ejs
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,5 +12,4 @@ fi
|
||||
mkdir -p "$DIR"
|
||||
cd "$DIR"
|
||||
|
||||
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 2000 -nodes
|
||||
|
||||
openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.crt -keyout key.key
|
||||
|
||||
4
bin/tpl/portable-trilium.bat
Normal file
4
bin/tpl/portable-trilium.bat
Normal file
@@ -0,0 +1,4 @@
|
||||
SET DIR=%~dp0
|
||||
SET TRILIUM_DATA_DIR=%DIR%\trilium-data
|
||||
cd %DIR%
|
||||
start trilium.exe
|
||||
7
bin/tpl/portable-trilium.sh
Executable file
7
bin/tpl/portable-trilium.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
DIR=`dirname "$0"`
|
||||
export TRILIUM_DATA_DIR="$DIR/trilium-data"
|
||||
|
||||
"$DIR/trilium"
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
[General]
|
||||
# Instance name can be used to distinguish between different instances
|
||||
# Instance name can be used to distinguish between different instances using backend api.getInstanceName()
|
||||
instanceName=
|
||||
|
||||
# set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password)
|
||||
noAuthentication=false
|
||||
|
||||
# set to true to disable backups (e.g. because of limited space on server)
|
||||
noBackup=false
|
||||
|
||||
# Disable automatically generating desktop icon
|
||||
# noDesktopIcon=true
|
||||
|
||||
[Network]
|
||||
# host setting is relevant only for web deployments - set the host on which the server will listen
|
||||
# host=0.0.0.0
|
||||
# port setting is relevant only for web deployments, desktop builds run on random free port
|
||||
# port setting is relevant only for web deployments, desktop builds run on a fixed port (changeable with TRILIUM_PORT environment variable)
|
||||
port=8080
|
||||
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
|
||||
https=false
|
||||
|
||||
BIN
db/demo.tar
BIN
db/demo.tar
Binary file not shown.
BIN
db/demo.zip
Normal file
BIN
db/demo.zip
Normal file
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
const syncTableService = require('../../src/services/sync_table');
|
||||
const syncTableService = require('../../src/services/entity_changes.js');
|
||||
|
||||
// options has not been filled so far which caused problems with clean-slate sync.
|
||||
module.exports = async () => await syncTableService.fillAllSyncRows();
|
||||
module.exports = async () => await syncTableService.fillAllSyncRows();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const syncTableService = require('../../src/services/sync_table');
|
||||
const syncTableService = require('../../src/services/entity_changes.js');
|
||||
|
||||
module.exports = async () => {
|
||||
await syncTableService.fillAllSyncRows();
|
||||
};
|
||||
};
|
||||
|
||||
81
db/migrations/0156__add_deleteId.sql
Normal file
81
db/migrations/0156__add_deleteId.sql
Normal file
@@ -0,0 +1,81 @@
|
||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`contentLength` INT NOT NULL,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
|
||||
INSERT INTO notes_mig (noteId, title, contentLength, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
||||
SELECT noteId, title, -1, isProtected, type, mime, hash, isDeleted, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
||||
|
||||
DROP TABLE notes;
|
||||
ALTER TABLE notes_mig RENAME TO notes;
|
||||
|
||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "branches_mig" (
|
||||
`branchId` TEXT NOT NULL,
|
||||
`noteId` TEXT NOT NULL,
|
||||
`parentNoteId` TEXT NOT NULL,
|
||||
`notePosition` INTEGER NOT NULL,
|
||||
`prefix` TEXT,
|
||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
hash TEXT DEFAULT "" NOT NULL,
|
||||
PRIMARY KEY(`branchId`));
|
||||
|
||||
INSERT INTO branches_mig (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
|
||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash FROM branches;
|
||||
|
||||
DROP TABLE branches;
|
||||
ALTER TABLE branches_mig RENAME TO branches;
|
||||
|
||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "attributes_mig"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
hash TEXT default "" not null,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
|
||||
INSERT INTO attributes_mig (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
|
||||
SELECT attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable FROM attributes;
|
||||
|
||||
DROP TABLE attributes;
|
||||
ALTER TABLE attributes_mig RENAME TO attributes;
|
||||
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
1
db/migrations/0157__fix_contentLength.sql
Normal file
1
db/migrations/0157__fix_contentLength.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);
|
||||
22
db/migrations/0158__add_isSynced_to_sync.sql
Normal file
22
db/migrations/0158__add_isSynced_to_sync.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE IF NOT EXISTS "sync_mig" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER default 0 not null,
|
||||
`utcSyncDate` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO sync_mig (id, entityName, entityId, sourceId, isSynced, utcSyncDate)
|
||||
SELECT id, entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
|
||||
|
||||
DROP TABLE sync;
|
||||
|
||||
ALTER TABLE sync_mig RENAME TO sync;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
||||
`utcSyncDate`
|
||||
);
|
||||
4
db/migrations/0159__fix_isSynced_in_sync_rows.sql
Normal file
4
db/migrations/0159__fix_isSynced_in_sync_rows.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
UPDATE sync SET isSynced = 1 WHERE entityName != 'options' OR (
|
||||
entityName = 'options'
|
||||
AND 1 = (SELECT isSynced FROM options WHERE name = sync.entityId)
|
||||
)
|
||||
2
db/migrations/0160__migrate_attr_definitions.sql
Normal file
2
db/migrations/0160__migrate_attr_definitions.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
UPDATE attributes SET type = 'label', name = 'label:' || name WHERE type = 'label-definition';
|
||||
UPDATE attributes SET type = 'label', name = 'relation:' || name WHERE type = 'relation-definition';
|
||||
79
db/migrations/0161__attr_def_short.js
Normal file
79
db/migrations/0161__attr_def_short.js
Normal file
@@ -0,0 +1,79 @@
|
||||
const sql = require('../../src/services/sql');
|
||||
|
||||
module.exports = () => {
|
||||
for (const attr of sql.getRows("SELECT * FROM attributes WHERE name LIKE 'label:%'")) {
|
||||
let obj;
|
||||
|
||||
try {
|
||||
obj = JSON.parse(attr.value);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Parsing attribute definition "${attr.value}" of ${attr.attributeId} failed with error "${e.message}", setting to default value.`);
|
||||
|
||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?',
|
||||
["multi,text", attr.attributeId]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
const tokens = [];
|
||||
|
||||
if (obj.isPromoted) {
|
||||
tokens.push('promoted');
|
||||
}
|
||||
|
||||
if (obj.multiplicityType === 'singlevalue') {
|
||||
tokens.push('single');
|
||||
} else if (obj.multiplicityType === 'multivalue') {
|
||||
tokens.push('multi');
|
||||
}
|
||||
|
||||
if (obj.labelType) {
|
||||
tokens.push(obj.labelType);
|
||||
}
|
||||
|
||||
if (obj.numberPrecision) {
|
||||
tokens.push('precision='+obj.numberPrecision);
|
||||
}
|
||||
|
||||
const newValue = tokens.join(',');
|
||||
|
||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?', [newValue, attr.attributeId]);
|
||||
}
|
||||
|
||||
for (const attr of sql.getRows("SELECT * FROM attributes WHERE name LIKE 'relation:%'")) {
|
||||
let obj;
|
||||
|
||||
try {
|
||||
obj = JSON.parse(attr.value);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Parsing attribute definition "${attr.value}" of ${attr.attributeId} failed with error "${e.message}", setting to default value.`);
|
||||
|
||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?',
|
||||
["multi", attr.attributeId]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
const tokens = [];
|
||||
|
||||
if (obj.isPromoted) {
|
||||
tokens.push('promoted');
|
||||
}
|
||||
|
||||
if (obj.multiplicityType === 'singlevalue') {
|
||||
tokens.push('single');
|
||||
} else if (obj.multiplicityType === 'multivalue') {
|
||||
tokens.push('multi');
|
||||
}
|
||||
|
||||
if (obj.inverseRelation) {
|
||||
tokens.push('inverse=' + obj.inverseRelation);
|
||||
}
|
||||
|
||||
const newValue = tokens.join(',');
|
||||
|
||||
sql.execute('UPDATE attributes SET value = ? WHERE attributeId = ?', [newValue, attr.attributeId]);
|
||||
}
|
||||
};
|
||||
1
db/migrations/0162__drop_source_ids.sql
Normal file
1
db/migrations/0162__drop_source_ids.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE source_ids;
|
||||
1
db/migrations/0163__rename_sync_to_entity_changes.sql
Normal file
1
db/migrations/0163__rename_sync_to_entity_changes.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE sync RENAME TO entity_changes;
|
||||
22
db/migrations/0164__rename_utcSyncDate.sql
Normal file
22
db/migrations/0164__rename_utcSyncDate.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER default 0 not null,
|
||||
`utcChangedDate` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO mig_entity_changes (id, entityName, entityId, sourceId, isSynced, utcChangedDate)
|
||||
SELECT id, entityName, entityId, sourceId, isSynced, utcSyncDate FROM entity_changes;
|
||||
|
||||
DROP TABLE entity_changes;
|
||||
|
||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_entityChanges_utcChangedDate` ON "entity_changes" (
|
||||
`utcChangedDate`
|
||||
);
|
||||
55
db/migrations/0165__move_contentLength.sql
Normal file
55
db/migrations/0165__move_contentLength.sql
Normal file
@@ -0,0 +1,55 @@
|
||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
|
||||
INSERT INTO notes_mig (noteId, title, isProtected, type, mime, hash, isDeleted, deleteId, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
||||
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, deleteId, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
||||
|
||||
DROP TABLE notes;
|
||||
ALTER TABLE notes_mig RENAME TO notes;
|
||||
|
||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
hash TEXT DEFAULT '' NOT NULL);
|
||||
|
||||
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
|
||||
SELECT noteRevisionId, noteId, title, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash FROM note_revisions;
|
||||
|
||||
DROP TABLE note_revisions;
|
||||
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
|
||||
|
||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||
20
db/migrations/0166__add_dateModified_to_note_content.sql
Normal file
20
db/migrations/0166__add_dateModified_to_note_content.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
);
|
||||
|
||||
INSERT INTO note_contents_mig (noteId, content, hash, dateModified, utcDateModified)
|
||||
SELECT noteId,
|
||||
content,
|
||||
hash,
|
||||
COALESCE((SELECT dateModified FROM notes WHERE noteId = note_contents.noteId), utcDateModified),
|
||||
utcDateModified
|
||||
FROM note_contents;
|
||||
|
||||
DROP TABLE note_contents;
|
||||
|
||||
ALTER TABLE note_contents_mig RENAME TO note_contents;
|
||||
1
db/migrations/0167__remove_activateParentNote.sql
Normal file
1
db/migrations/0167__remove_activateParentNote.sql
Normal file
@@ -0,0 +1 @@
|
||||
DELETE FROM options WHERE name = 'keyboardShortcutsActivateParentNote';
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE attributes SET name = 'archived' WHERE name = 'hideInAutocomplete';
|
||||
20
db/migrations/0169__convert_h1_to_h2.js
Normal file
20
db/migrations/0169__convert_h1_to_h2.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const repository = require('../../src/services/repository');
|
||||
|
||||
module.exports = () => {
|
||||
for (const note of repository.getEntities("SELECT * FROM notes WHERE type = 'text' AND isProtected = 0")) {
|
||||
try {
|
||||
let origContent = note.getContent();
|
||||
|
||||
const newContent = origContent
|
||||
.replace(/<h1/ig, "<h2")
|
||||
.replace(/<\/h1/ig, "</h2");
|
||||
|
||||
if (newContent !== origContent) {
|
||||
note.setContent(newContent);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Changing note content for note ${note.noteId} failed with: ${e.message} ${e.stack}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
14
db/migrations/0170__fix_branch_ordering.js
Normal file
14
db/migrations/0170__fix_branch_ordering.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const repository = require('../../src/services/repository');
|
||||
const sql = require('../../src/services/sql');
|
||||
|
||||
module.exports = () => {
|
||||
for (const note of repository.getEntities("SELECT * FROM notes")) {
|
||||
let position = 0;
|
||||
|
||||
for (const branch of note.getChildBranches()) {
|
||||
sql.execute(`UPDATE branches SET notePosition = ? WHERE branchId = ?`, [position, branch.branchId]);
|
||||
|
||||
position += 10;
|
||||
}
|
||||
}
|
||||
};
|
||||
15
db/migrations/0171__cleanup_options.sql
Normal file
15
db/migrations/0171__cleanup_options.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
DELETE FROM options WHERE name IN (
|
||||
'noteInfoWidget',
|
||||
'attributesWidget',
|
||||
'linkMapWidget',
|
||||
'noteRevisionsWidget',
|
||||
'whatLinksHereWidget',
|
||||
'codeNotesMimeTypes',
|
||||
'similarNotesWidget',
|
||||
'editedNotesWidget',
|
||||
'calendarWidget',
|
||||
'sidebarMinWidth',
|
||||
'sidebarWidthPercent',
|
||||
'showSidebarInNewTab',
|
||||
'hoistedNoteId'
|
||||
);
|
||||
69
db/migrations/0173__isErased_in_entity_changes.sql
Normal file
69
db/migrations/0173__isErased_in_entity_changes.sql
Normal file
@@ -0,0 +1,69 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`hash` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isErased` INT NOT NULL,
|
||||
`utcDateChanged` TEXT NOT NULL,
|
||||
`isSynced` INTEGER NOT NULL);
|
||||
|
||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, utcDateChanged, isErased)
|
||||
SELECT id, entityName, entityId, '', sourceId, isSynced, utcChangedDate, 0 FROM entity_changes;
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (SELECT isErased FROM notes WHERE noteId = entityId) WHERE entityName = 'notes';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'notes';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (SELECT isErased FROM notes WHERE noteId = entityId) WHERE entityName = 'note_contents';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (
|
||||
SELECT isErased
|
||||
FROM attributes
|
||||
JOIN notes USING(noteId)
|
||||
WHERE attributeId = entityId
|
||||
) WHERE entityName = 'attributes';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM attributes WHERE attributeId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'attributes';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (
|
||||
SELECT isErased
|
||||
FROM branches
|
||||
JOIN notes USING(noteId)
|
||||
WHERE branchId = entityId
|
||||
) WHERE entityName = 'branches';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM branches WHERE branchId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'branches';
|
||||
|
||||
UPDATE mig_entity_changes SET isErased = (
|
||||
SELECT isErased
|
||||
FROM note_revisions
|
||||
WHERE noteRevisionId = entityId
|
||||
) WHERE entityName = 'note_revisions';
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_revisions WHERE noteRevisionId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_revisions';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateCreated FROM api_tokens WHERE apiTokenId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'api_tokens';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_contents WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_contents';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM note_revision_contents WHERE noteRevisionId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'note_revision_contents';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM options WHERE name = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'options';
|
||||
|
||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateCreated FROM recent_notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'options';
|
||||
|
||||
DROP TABLE entity_changes;
|
||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
|
||||
DELETE FROM attributes WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
||||
DELETE FROM branches WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
||||
DELETE FROM note_contents WHERE noteId IN (SELECT noteId FROM notes WHERE isErased = 1);
|
||||
DELETE FROM note_revision_contents WHERE noteRevisionId IN (
|
||||
SELECT noteRevisionId FROM note_revisions WHERE isErased = 1
|
||||
);
|
||||
DELETE FROM note_revisions WHERE isErased = 1;
|
||||
DELETE FROM notes WHERE isErased = 1;
|
||||
|
||||
UPDATE entity_changes SET isErased = COALESCE((SELECT isErased FROM entity_changes AS sub WHERE sub.entityId = entity_changes.entityId AND sub.entityName = 'note_revisions'), 0) WHERE entityName = 'note_revision_contents';
|
||||
198
db/migrations/0174__move_hash_to_entity_changes.sql
Normal file
198
db/migrations/0174__move_hash_to_entity_changes.sql
Normal file
@@ -0,0 +1,198 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`hash` TEXT NOT NULL,
|
||||
`isErased` INT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER NOT NULL,
|
||||
`utcDateChanged` TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, isErased, utcDateChanged)
|
||||
SELECT id, entityName, entityId, '', sourceId, isSynced, isErased, utcDateChanged FROM entity_changes;
|
||||
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM api_tokens WHERE apiTokenId = entityId), '') WHERE entityName = 'api_tokens';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM attributes WHERE attributeId = entityId), '') WHERE entityName = 'attributes';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM branches WHERE branchId = entityId), '') WHERE entityName = 'branches';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM notes WHERE noteId = entityId), '') WHERE entityName = 'notes';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_contents WHERE noteId = entityId), '') WHERE entityName = 'note_contents';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_revisions WHERE noteRevisionId = entityId), '') WHERE entityName = 'note_revisions';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM note_revision_contents WHERE noteRevisionId = entityId), '') WHERE entityName = 'note_revision_contents';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM options WHERE name = entityId), '') WHERE entityName = 'options';
|
||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM recent_notes WHERE noteId = entityId), '') WHERE entityName = 'recent_notes';
|
||||
|
||||
DROP TABLE entity_changes;
|
||||
ALTER TABLE mig_entity_changes RENAME TO entity_changes;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_api_tokens"
|
||||
(
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
isDeleted INT NOT NULL DEFAULT 0);
|
||||
|
||||
INSERT INTO mig_api_tokens (apiTokenId, token, utcDateCreated, isDeleted)
|
||||
SELECT apiTokenId, token, utcDateCreated, isDeleted FROM api_tokens;
|
||||
|
||||
DROP TABLE api_tokens;
|
||||
ALTER TABLE mig_api_tokens RENAME TO api_tokens;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
|
||||
INSERT INTO mig_attributes (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, deleteId, isInheritable)
|
||||
SELECT attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, deleteId, isInheritable FROM attributes;
|
||||
|
||||
DROP TABLE attributes;
|
||||
ALTER TABLE mig_attributes RENAME TO attributes;
|
||||
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_branches" (
|
||||
`branchId` TEXT NOT NULL,
|
||||
`noteId` TEXT NOT NULL,
|
||||
`parentNoteId` TEXT NOT NULL,
|
||||
`notePosition` INTEGER NOT NULL,
|
||||
`prefix` TEXT,
|
||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
PRIMARY KEY(`branchId`));
|
||||
|
||||
INSERT INTO mig_branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, deleteId, utcDateModified, utcDateCreated)
|
||||
SELECT branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, deleteId, utcDateModified, utcDateCreated FROM branches;
|
||||
|
||||
DROP TABLE branches;
|
||||
ALTER TABLE mig_branches RENAME TO branches;
|
||||
|
||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
|
||||
INSERT INTO mig_notes (noteId, title, isProtected, type, mime, isDeleted, deleteId, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
||||
SELECT noteId, title, isProtected, type, mime, isDeleted, deleteId, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
||||
|
||||
DROP TABLE notes;
|
||||
ALTER TABLE mig_notes RENAME TO notes;
|
||||
|
||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
);
|
||||
|
||||
INSERT INTO mig_note_contents (noteId, content, dateModified, utcDateModified)
|
||||
SELECT noteId, content, dateModified, utcDateModified FROM note_contents;
|
||||
|
||||
DROP TABLE note_contents;
|
||||
ALTER TABLE mig_note_contents RENAME TO note_contents;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
`title` TEXT,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO mig_note_revisions (noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated)
|
||||
SELECT noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated FROM note_revisions;
|
||||
|
||||
DROP TABLE note_revisions;
|
||||
ALTER TABLE mig_note_revisions RENAME TO note_revisions;
|
||||
|
||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`content` TEXT,
|
||||
`utcDateModified` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO mig_note_revision_contents (noteRevisionId, content, utcDateModified)
|
||||
SELECT noteRevisionId, content, utcDateModified FROM note_revision_contents;
|
||||
|
||||
DROP TABLE note_revision_contents;
|
||||
ALTER TABLE mig_note_revision_contents RENAME TO note_revision_contents;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_options"
|
||||
(
|
||||
name TEXT not null PRIMARY KEY,
|
||||
value TEXT,
|
||||
isSynced INTEGER default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO mig_options (name, value, isSynced, utcDateCreated, utcDateModified)
|
||||
SELECT name, value, isSynced, utcDateCreated, utcDateModified FROM options;
|
||||
|
||||
DROP TABLE options;
|
||||
ALTER TABLE mig_options RENAME TO options;
|
||||
|
||||
CREATE TABLE mig_recent_notes
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
utcDateCreated TEXT not null,
|
||||
isDeleted INT NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
INSERT INTO mig_recent_notes (noteId, notePath, utcDateCreated, isDeleted)
|
||||
SELECT noteId, notePath, utcDateCreated, isDeleted FROM recent_notes;
|
||||
|
||||
DROP TABLE recent_notes;
|
||||
ALTER TABLE mig_recent_notes RENAME TO recent_notes;
|
||||
@@ -0,0 +1,2 @@
|
||||
UPDATE options SET name = 'eraseEntitiesAfterTimeInSeconds' WHERE name = 'eraseNotesAfterTimeInSeconds';
|
||||
UPDATE entity_changes SET entityId = 'eraseEntitiesAfterTimeInSeconds' WHERE entityName = 'options' AND entityId = 'eraseNotesAfterTimeInSeconds';
|
||||
25
db/migrations/0176__remove_utcDateCreated_in_attributes.sql
Normal file
25
db/migrations/0176__remove_utcDateCreated_in_attributes.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
CREATE TABLE IF NOT EXISTS "mig_attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
|
||||
INSERT INTO mig_attributes (attributeId, noteId, type, name, value, position, utcDateModified, isDeleted, deleteId, isInheritable)
|
||||
SELECT attributeId, noteId, type, name, value, position, utcDateModified, isDeleted, deleteId, isInheritable FROM attributes;
|
||||
|
||||
DROP TABLE attributes;
|
||||
ALTER TABLE mig_attributes RENAME TO attributes;
|
||||
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
5
db/migrations/0177__cleanup_keyboard_shortcuts.sql
Normal file
5
db/migrations/0177__cleanup_keyboard_shortcuts.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
DELETE FROM options WHERE name = 'keyboardShortcutsCreateNoteIntoInbox'; -- in case there is already one which shouldn't (except for in-dev documents)
|
||||
UPDATE options SET name = 'keyboardShortcutsCreateNoteIntoInbox' WHERE name = 'keyboardShortcutsCreateNoteIntoDayNote';
|
||||
|
||||
DELETE FROM options WHERE name = 'keyboardShortcutsShowAttributes';
|
||||
DELETE FROM entity_changes WHERE entityName = 'options' AND entityId = 'keyboardShortcutsShowAttributes';
|
||||
1
db/migrations/0178__drop_isDeleted_index.sql
Normal file
1
db/migrations/0178__drop_isDeleted_index.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP INDEX IDX_notes_isDeleted;
|
||||
1
db/migrations/0179__VACUUM.sql
Normal file
1
db/migrations/0179__VACUUM.sql
Normal file
@@ -0,0 +1 @@
|
||||
VACUUM
|
||||
2
db/migrations/0180__rename_quickSearch_shortcut.sql
Normal file
2
db/migrations/0180__rename_quickSearch_shortcut.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
UPDATE options SET name = 'keyboardShortcutsQuickSearch' WHERE name = 'keyboardShortcutsSearchNotes';
|
||||
UPDATE entity_changes SET entityId = 'keyboardShortcutsQuickSearch' WHERE entityId = 'keyboardShortcutsSearchNotes' AND entityName = 'options';
|
||||
5
db/migrations/0181__fix_entityChanges_isSynced.sql
Normal file
5
db/migrations/0181__fix_entityChanges_isSynced.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
UPDATE entity_changes SET isSynced = COALESCE((
|
||||
SELECT options.isSynced
|
||||
FROM options
|
||||
WHERE options.name = entity_changes.entityId
|
||||
), 0) WHERE entityName = 'options';
|
||||
@@ -0,0 +1,14 @@
|
||||
DELETE FROM entity_changes WHERE entityName = 'recent_notes';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_recent_notes"
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
utcDateCreated TEXT not null
|
||||
);
|
||||
|
||||
INSERT INTO mig_recent_notes (noteId, notePath, utcDateCreated)
|
||||
SELECT noteId, notePath, utcDateCreated FROM recent_notes;
|
||||
|
||||
DROP TABLE recent_notes;
|
||||
ALTER TABLE mig_recent_notes RENAME TO recent_notes;
|
||||
25
db/migrations/0183__migrate_saved_search_notes.js
Normal file
25
db/migrations/0183__migrate_saved_search_notes.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const repository = require('../../src/services/repository');
|
||||
|
||||
module.exports = () => {
|
||||
for (const note of repository.getEntities("SELECT * FROM notes WHERE type = 'search' AND isProtected = 0 AND isDeleted = 0")) {
|
||||
try {
|
||||
let origContent = note.getJsonContent();
|
||||
|
||||
if (!origContent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
note.addLabel('searchString', origContent.searchString);
|
||||
|
||||
note.setContent('');
|
||||
|
||||
note.mime = 'text/plain';
|
||||
note.save();
|
||||
|
||||
console.log(`Migrated search note ${note.noteId}`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Changing note content for note ${note.noteId} failed with: ${e.message} ${e.stack}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
188
db/schema.sql
188
db/schema.sql
@@ -1,73 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS "sync" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`utcSyncDate` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "source_ids" (
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
PRIMARY KEY(`sourceId`)
|
||||
);
|
||||
CREATE INDEX IDX_source_ids_utcDateCreated
|
||||
on source_ids (utcDateCreated);
|
||||
CREATE TABLE IF NOT EXISTS "entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`hash` TEXT NOT NULL,
|
||||
`isErased` INT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER NOT NULL,
|
||||
`utcDateChanged` TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "api_tokens"
|
||||
(
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
isDeleted INT NOT NULL DEFAULT 0,
|
||||
hash TEXT DEFAULT "" NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "options"
|
||||
(
|
||||
name TEXT not null PRIMARY KEY,
|
||||
value TEXT,
|
||||
isSynced INTEGER default 0 not null,
|
||||
hash TEXT default "" not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
hash TEXT default "" not null,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
||||
`utcSyncDate`
|
||||
);
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
);
|
||||
CREATE TABLE recent_notes
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
hash TEXT default "" not null,
|
||||
utcDateCreated TEXT not null,
|
||||
isDeleted INT
|
||||
);
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
token TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
isDeleted INT NOT NULL DEFAULT 0);
|
||||
CREATE TABLE IF NOT EXISTS "branches" (
|
||||
`branchId` TEXT NOT NULL,
|
||||
`noteId` TEXT NOT NULL,
|
||||
@@ -76,54 +22,90 @@ CREATE TABLE IF NOT EXISTS "branches" (
|
||||
`prefix` TEXT,
|
||||
`isExpanded` INTEGER NOT NULL DEFAULT 0,
|
||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
utcDateCreated TEXT NOT NULL,
|
||||
hash TEXT DEFAULT "" NOT NULL,
|
||||
PRIMARY KEY(`branchId`));
|
||||
CREATE TABLE IF NOT EXISTS "notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
`title` TEXT,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`content` TEXT,
|
||||
`utcDateModified` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "options"
|
||||
(
|
||||
name TEXT not null PRIMARY KEY,
|
||||
value TEXT,
|
||||
isSynced INTEGER default 0 not null,
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "attributes"
|
||||
(
|
||||
attributeId TEXT not null primary key,
|
||||
noteId TEXT not null,
|
||||
type TEXT not null,
|
||||
name TEXT not null,
|
||||
value TEXT default '' not null,
|
||||
position INT default 0 not null,
|
||||
utcDateModified TEXT not null,
|
||||
isDeleted INT not null,
|
||||
`deleteId` TEXT DEFAULT NULL,
|
||||
isInheritable int DEFAULT 0 NULL);
|
||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`content` TEXT,
|
||||
hash TEXT DEFAULT '' NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
`contentLength` INT NOT NULL,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`type` TEXT NOT NULL DEFAULT 'text',
|
||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||
`hash` TEXT DEFAULT "" NOT NULL,
|
||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
`dateModified` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
PRIMARY KEY(`noteId`));
|
||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT,
|
||||
`contentLength` INT NOT NULL,
|
||||
`isErased` INT NOT NULL DEFAULT 0,
|
||||
`isProtected` INT NOT NULL DEFAULT 0,
|
||||
`utcDateLastEdited` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
`utcDateModified` TEXT NOT NULL,
|
||||
`dateLastEdited` TEXT NOT NULL,
|
||||
`dateCreated` TEXT NOT NULL,
|
||||
type TEXT DEFAULT '' NOT NULL,
|
||||
mime TEXT DEFAULT '' NOT NULL,
|
||||
hash TEXT DEFAULT '' NOT NULL);
|
||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||
CREATE INDEX IDX_attributes_name_value
|
||||
on attributes (name, value);
|
||||
CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
CREATE TABLE IF NOT EXISTS "recent_notes"
|
||||
(
|
||||
noteId TEXT not null primary key,
|
||||
notePath TEXT not null,
|
||||
utcDateCreated TEXT not null
|
||||
);
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -274,13 +274,16 @@
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateCreated</code></td>
|
||||
<td class="name"><code>deleteId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
|
||||
@@ -290,7 +293,7 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">ID identifying delete transaction</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -352,7 +355,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line29">line 29</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line25">line 25</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -419,7 +422,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> → {Promise.<(<a href="Note.html">Note</a>|null)>}</span></h4>
|
||||
<h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -467,7 +470,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line46">line 46</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line43">line 43</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -503,7 +506,10 @@
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise.<(<a href="Note.html">Note</a>|null)></span>
|
||||
<span class="param-type"><a href="Note.html">Note</a></span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -521,7 +527,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getTargetNote"><span class="type-signature">(async) </span>getTargetNote<span class="signature">()</span><span class="type-signature"> → {Promise.<(<a href="Note.html">Note</a>|null)>}</span></h4>
|
||||
<h4 class="name" id="getTargetNote"><span class="type-signature"></span>getTargetNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -569,7 +575,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line57">line 57</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line50">line 50</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -605,7 +611,10 @@
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise.<(<a href="Note.html">Note</a>|null)></span>
|
||||
<span class="param-type"><a href="Note.html">Note</a></span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -671,7 +680,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line76">line 76</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line65">line 65</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -741,7 +750,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -107,7 +107,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
|
||||
|
||||
<td class="description last">primary key</td>
|
||||
<td class="description last">primary key, immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
<td class="description last">immutable</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -250,6 +250,32 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>deleteId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">ID identifying delete transaction</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateModified</code></td>
|
||||
@@ -330,7 +356,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line30">line 30</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line24">line 24</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -397,7 +423,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
||||
<h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -445,7 +471,112 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line38">line 38</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line31">line 31</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="Note.html">Note</a></span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getParentNote"><span class="type-signature"></span>getParentNote<span class="signature">()</span><span class="type-signature"> → {<a href="Note.html">Note</a>|null}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line36">line 36</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -518,7 +649,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_entity.js.html">entities/entity.js</a>, <a href="entities_entity.js.html#line9">line 9</a>
|
||||
<a href="entities_entity.js.html">entities/entity.js</a>, <a href="entities_entity.js.html#line10">line 10</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -198,52 +198,6 @@
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>contentLength</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">int</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>isErased</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
@@ -421,7 +375,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line35">line 35</a>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line27">line 27</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -488,7 +442,7 @@
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getContent"><span class="type-signature">(async) </span>getContent<span class="signature">()</span><span class="type-signature"> → {Promise.<*>}</span></h4>
|
||||
<h4 class="name" id="getContent"><span class="type-signature"></span>getContent<span class="signature">()</span><span class="type-signature"> → {*}</span></h4>
|
||||
|
||||
|
||||
|
||||
@@ -536,7 +490,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line69">line 69</a>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line66">line 66</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -572,7 +526,7 @@
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise.<*></span>
|
||||
<span class="param-type">*</span>
|
||||
|
||||
|
||||
</dd>
|
||||
@@ -638,7 +592,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line55">line 55</a>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line52">line 52</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -691,108 +645,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="setContent"><span class="type-signature">(async) </span>setContent<span class="signature">()</span><span class="type-signature"> → {Promise}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line104">line 104</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Promise</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -814,7 +666,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line22">line 22</a>
|
||||
<a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line17">line 17</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -136,30 +136,7 @@
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>isDeleted</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">boolean</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateModified</code></td>
|
||||
<td class="name"><code>utcDateCreated</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
@@ -214,7 +191,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_recent_note.js.html">entities/recent_note.js</a>, <a href="entities_recent_note.js.html#line16">line 16</a>
|
||||
<a href="entities_recent_note.js.html">entities/recent_note.js</a>, <a href="entities_recent_note.js.html#line15">line 15</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -293,7 +270,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -75,7 +75,7 @@ module.exports = ApiToken;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -28,23 +28,24 @@
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>"use strict";
|
||||
|
||||
|
||||
const Entity = require('./entity');
|
||||
const repository = require('../services/repository');
|
||||
const dateUtils = require('../services/date_utils');
|
||||
const sql = require('../services/sql');
|
||||
const promotedAttributeDefinitionParser = require("../services/promoted_attribute_definition_parser");
|
||||
|
||||
/**
|
||||
* Attribute is key value pair owned by a note.
|
||||
*
|
||||
* @property {string} attributeId
|
||||
* @property {string} noteId
|
||||
* @property {string} type
|
||||
* @property {string} name
|
||||
* @property {string} attributeId - immutable
|
||||
* @property {string} noteId - immutable
|
||||
* @property {string} type - immutable
|
||||
* @property {string} name - immutable
|
||||
* @property {string} value
|
||||
* @property {int} position
|
||||
* @property {boolean} isInheritable
|
||||
* @property {boolean} isInheritable - immutable
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string} utcDateCreated
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} utcDateModified
|
||||
*
|
||||
* @extends Entity
|
||||
@@ -52,37 +53,29 @@ const sql = require('../services/sql');
|
||||
class Attribute extends Entity {
|
||||
static get entityName() { return "attributes"; }
|
||||
static get primaryKeyName() { return "attributeId"; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; }
|
||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
|
||||
this.isInheritable = !!this.isInheritable;
|
||||
}
|
||||
|
||||
if (this.isDefinition()) {
|
||||
try {
|
||||
this.value = JSON.parse(this.value);
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
isAutoLink() {
|
||||
return this.type === 'relation' && ['internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'].includes(this.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
async getNote() {
|
||||
if (!this.__note) {
|
||||
this.__note = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
}
|
||||
|
||||
return this.__note;
|
||||
getNote() {
|
||||
return this.repository.getNote(this.noteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
async getTargetNote() {
|
||||
getTargetNote() {
|
||||
if (this.type !== 'relation') {
|
||||
throw new Error(`Attribute ${this.attributeId} is not relation`);
|
||||
}
|
||||
@@ -91,21 +84,31 @@ class Attribute extends Entity {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!this.__targetNote) {
|
||||
this.__targetNote = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
|
||||
}
|
||||
|
||||
return this.__targetNote;
|
||||
return this.repository.getNote(this.value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
isDefinition() {
|
||||
return this.type === 'label-definition' || this.type === 'relation-definition';
|
||||
return this.type === 'label' && (this.name.startsWith('label:') || this.name.startsWith('relation:'));
|
||||
}
|
||||
|
||||
async beforeSaving() {
|
||||
getDefinition() {
|
||||
return promotedAttributeDefinitionParser.parse(this.value);
|
||||
}
|
||||
|
||||
getDefinedName() {
|
||||
if (this.type === 'label' && this.name.startsWith('label:')) {
|
||||
return this.name.substr(6);
|
||||
} else if (this.type === 'label' && this.name.startsWith('relation:')) {
|
||||
return this.name.substr(9);
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
if (!this.value) {
|
||||
if (this.type === 'relation') {
|
||||
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
|
||||
@@ -116,7 +119,7 @@ class Attribute extends Entity {
|
||||
}
|
||||
|
||||
if (this.position === undefined) {
|
||||
this.position = 1 + await sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM attributes WHERE noteId = ?`, [this.noteId]);
|
||||
this.position = 1 + sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM attributes WHERE noteId = ?`, [this.noteId]);
|
||||
}
|
||||
|
||||
if (!this.isInheritable) {
|
||||
@@ -127,25 +130,27 @@ class Attribute extends Entity {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
if (!this.utcDateCreated) {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
updatePojo(pojo) {
|
||||
delete pojo.isOwned;
|
||||
delete pojo.__note;
|
||||
createClone(type, name, value, isInheritable) {
|
||||
return new Attribute({
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
value: value,
|
||||
position: this.position,
|
||||
isInheritable: isInheritable,
|
||||
isDeleted: false,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Attribute;</code></pre>
|
||||
module.exports = Attribute;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -161,7 +166,7 @@ module.exports = Attribute;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -30,20 +30,20 @@
|
||||
|
||||
const Entity = require('./entity');
|
||||
const dateUtils = require('../services/date_utils');
|
||||
const repository = require('../services/repository');
|
||||
const sql = require('../services/sql');
|
||||
|
||||
/**
|
||||
* Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId.
|
||||
* Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.
|
||||
*
|
||||
* @property {string} branchId - primary key
|
||||
* @property {string} noteId
|
||||
* @property {string} parentNoteId
|
||||
* @property {string} branchId - primary key, immutable
|
||||
* @property {string} noteId - immutable
|
||||
* @property {string} parentNoteId - immutable
|
||||
* @property {int} notePosition
|
||||
* @property {string} prefix
|
||||
* @property {boolean} isExpanded
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} utcDateModified
|
||||
* @property {string} utcDateCreated
|
||||
*
|
||||
@@ -53,23 +53,21 @@ class Branch extends Entity {
|
||||
static get entityName() { return "branches"; }
|
||||
static get primaryKeyName() { return "branchId"; }
|
||||
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
||||
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; }
|
||||
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "deleteId", "prefix"]; }
|
||||
|
||||
constructor(row = {}) {
|
||||
super(row);
|
||||
|
||||
// used to detect move in note tree
|
||||
this.origParentNoteId = this.parentNoteId;
|
||||
/** @returns {Note|null} */
|
||||
getNote() {
|
||||
return this.repository.getNote(this.noteId);
|
||||
}
|
||||
|
||||
/** @returns {Note|null} */
|
||||
async getNote() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
getParentNote() {
|
||||
return this.repository.getNote(this.parentNoteId);
|
||||
}
|
||||
|
||||
async beforeSaving() {
|
||||
if (this.notePosition === undefined) {
|
||||
const maxNotePos = await sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
||||
beforeSaving() {
|
||||
if (this.notePosition === undefined || this.notePosition === null) {
|
||||
const maxNotePos = sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
||||
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
|
||||
}
|
||||
|
||||
@@ -87,18 +85,25 @@ class Branch extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
updatePojo(pojo) {
|
||||
delete pojo.origParentNoteId;
|
||||
createClone(parentNoteId, notePosition) {
|
||||
return new Branch({
|
||||
noteId: this.noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
notePosition: notePosition,
|
||||
prefix: this.prefix,
|
||||
isExpanded: this.isExpanded,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Branch;</code></pre>
|
||||
module.exports = Branch;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -114,7 +119,7 @@ module.exports = Branch;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<pre class="prettyprint source linenums"><code>"use strict";
|
||||
|
||||
const utils = require('../services/utils');
|
||||
let repo = null;
|
||||
|
||||
class Entity {
|
||||
/**
|
||||
@@ -42,25 +43,13 @@ class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if ('isDeleted' in this) {
|
||||
if ('isDeleted' in this && this.constructor.entityName !== 'recent_notes') {
|
||||
this.isDeleted = !!this.isDeleted;
|
||||
}
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
this.generateIdIfNecessary();
|
||||
|
||||
const origHash = this.hash;
|
||||
|
||||
this.hash = this.generateHash();
|
||||
|
||||
if (this.forcedChange) {
|
||||
this.isChanged = true;
|
||||
delete this.forcedChange;
|
||||
}
|
||||
else {
|
||||
this.isChanged = origHash !== this.hash;
|
||||
}
|
||||
}
|
||||
|
||||
generateIdIfNecessary() {
|
||||
@@ -79,14 +68,27 @@ class Entity {
|
||||
return utils.hash(contentToHash).substr(0, 10);
|
||||
}
|
||||
|
||||
async save() {
|
||||
await require('../services/repository').updateEntity(this);
|
||||
getUtcDateChanged() {
|
||||
return this.utcDateModified;
|
||||
}
|
||||
|
||||
get repository() {
|
||||
if (!repo) {
|
||||
repo = require('../services/repository');
|
||||
}
|
||||
|
||||
return repo;
|
||||
}
|
||||
|
||||
save() {
|
||||
this.repository.updateEntity(this);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Entity;</code></pre>
|
||||
module.exports = Entity;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -102,7 +104,7 @@ module.exports = Entity;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -31,16 +31,13 @@
|
||||
const Entity = require('./entity');
|
||||
const Attribute = require('./attribute');
|
||||
const protectedSessionService = require('../services/protected_session');
|
||||
const repository = require('../services/repository');
|
||||
const sql = require('../services/sql');
|
||||
const utils = require('../services/utils');
|
||||
const dateUtils = require('../services/date_utils');
|
||||
const syncTableService = require('../services/sync_table');
|
||||
const entityChangesService = require('../services/entity_changes.js');
|
||||
|
||||
const LABEL = 'label';
|
||||
const LABEL_DEFINITION = 'label-definition';
|
||||
const RELATION = 'relation';
|
||||
const RELATION_DEFINITION = 'relation-definition';
|
||||
|
||||
/**
|
||||
* This represents a Note which is a central object in the Trilium Notes project.
|
||||
@@ -49,10 +46,9 @@ const RELATION_DEFINITION = 'relation-definition';
|
||||
* @property {string} type - one of "text", "code", "file" or "render"
|
||||
* @property {string} mime - MIME type, e.g. "text/html"
|
||||
* @property {string} title - note title
|
||||
* @property {int} contentLength - length of content
|
||||
* @property {boolean} isProtected - true if note is protected
|
||||
* @property {boolean} isDeleted - true if note is deleted
|
||||
* @property {boolean} isErased - true if note's content is erased after it has been deleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} dateCreated - local date time (with offset)
|
||||
* @property {string} dateModified - local date time (with offset)
|
||||
* @property {string} utcDateCreated
|
||||
@@ -63,7 +59,7 @@ const RELATION_DEFINITION = 'relation-definition';
|
||||
class Note extends Entity {
|
||||
static get entityName() { return "notes"; }
|
||||
static get primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "title", "type", "isProtected", "isDeleted"]; }
|
||||
static get hashedProperties() { return ["noteId", "title", "type", "mime", "isProtected", "isDeleted", "deleteId"]; }
|
||||
|
||||
/**
|
||||
* @param row - object containing database row from "notes" table
|
||||
@@ -94,16 +90,16 @@ class Note extends Entity {
|
||||
* part of Note entity with it's own sync. Reasons behind this hybrid design has been:
|
||||
*
|
||||
* - content can be quite large and it's not necessary to load it / fill memory for any note access even if we don't need a content, especially for bulk operations like search
|
||||
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and sync rows)
|
||||
* - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
|
||||
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
|
||||
*/
|
||||
|
||||
/** @returns {Promise<*>} */
|
||||
async getContent(silentNotFoundError = false) {
|
||||
/** @returns {*} */
|
||||
getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = await sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
const row = sql.getRow(`SELECT content FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||
|
||||
if (!res) {
|
||||
if (!row) {
|
||||
if (silentNotFoundError) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -112,7 +108,7 @@ class Note extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
this.content = row.content;
|
||||
|
||||
if (this.isProtected) {
|
||||
if (this.isContentAvailable) {
|
||||
@@ -122,42 +118,59 @@ class Note extends Entity {
|
||||
this.content = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isStringNote()) {
|
||||
this.content = this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
return this.content;
|
||||
if (this.isStringNote()) {
|
||||
return this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
else {
|
||||
return this.content;
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise<*>} */
|
||||
async getJsonContent() {
|
||||
const content = await this.getContent();
|
||||
/** @returns {{contentLength, dateModified, utcDateModified}} */
|
||||
getContentMetadata() {
|
||||
return sql.getRow(`
|
||||
SELECT
|
||||
LENGTH(content) AS contentLength,
|
||||
dateModified,
|
||||
utcDateModified
|
||||
FROM note_contents
|
||||
WHERE noteId = ?`, [this.noteId]);
|
||||
}
|
||||
|
||||
/** @returns {*} */
|
||||
getJsonContent() {
|
||||
const content = this.getContent();
|
||||
|
||||
if (!content || !content.trim()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return JSON.parse(content);
|
||||
}
|
||||
|
||||
/** @returns {Promise} */
|
||||
async setContent(content) {
|
||||
setContent(content) {
|
||||
if (content === null || content === undefined) {
|
||||
throw new Error(`Cannot set null content to note ${this.noteId}`);
|
||||
}
|
||||
|
||||
// force updating note itself so that dateModified is represented correctly even for the content
|
||||
this.forcedChange = true;
|
||||
this.contentLength = content.length;
|
||||
await this.save();
|
||||
if (this.isStringNote()) {
|
||||
content = content.toString();
|
||||
}
|
||||
else {
|
||||
content = Buffer.isBuffer(content) ? content : Buffer.from(content);
|
||||
}
|
||||
|
||||
this.content = content;
|
||||
|
||||
const pojo = {
|
||||
noteId: this.noteId,
|
||||
content: content,
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteId + "|" + content)
|
||||
dateModified: dateUtils.localNowDateTime(),
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -169,14 +182,21 @@ class Note extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
await sql.upsert("note_contents", "noteId", pojo);
|
||||
sql.upsert("note_contents", "noteId", pojo);
|
||||
|
||||
await syncTableService.addNoteContentSync(this.noteId);
|
||||
const hash = utils.hash(this.noteId + "|" + content.toString());
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_contents',
|
||||
entityId: this.noteId,
|
||||
hash: hash,
|
||||
isErased: false,
|
||||
utcDateChanged: this.getUtcDateChanged()
|
||||
}, null);
|
||||
}
|
||||
|
||||
/** @returns {Promise} */
|
||||
async setJsonContent(content) {
|
||||
await this.setContent(JSON.stringify(content, null, '\t'));
|
||||
setJsonContent(content) {
|
||||
this.setContent(JSON.stringify(content, null, '\t'));
|
||||
}
|
||||
|
||||
/** @returns {boolean} true if this note is the root of the note tree. Root note has "root" noteId */
|
||||
@@ -224,8 +244,8 @@ class Note extends Entity {
|
||||
return null;
|
||||
}
|
||||
|
||||
async loadOwnedAttributesToCache() {
|
||||
this.__ownedAttributeCache = await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
|
||||
loadOwnedAttributesToCache() {
|
||||
this.__ownedAttributeCache = this.repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
|
||||
return this.__ownedAttributeCache;
|
||||
}
|
||||
|
||||
@@ -235,11 +255,11 @@ class Note extends Entity {
|
||||
*
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Promise<Attribute[]>} note's "owned" attributes - excluding inherited ones
|
||||
* @returns {Attribute[]} note's "owned" attributes - excluding inherited ones
|
||||
*/
|
||||
async getOwnedAttributes(type, name) {
|
||||
getOwnedAttributes(type, name) {
|
||||
if (!this.__ownedAttributeCache) {
|
||||
await this.loadOwnedAttributesToCache();
|
||||
this.loadOwnedAttributesToCache();
|
||||
}
|
||||
|
||||
if (type && name) {
|
||||
@@ -257,31 +277,31 @@ class Note extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Attribute>} attribute belonging to this specific note (excludes inherited attributes)
|
||||
* @returns {Attribute} attribute belonging to this specific note (excludes inherited attributes)
|
||||
*
|
||||
* This method can be significantly faster than the getAttribute()
|
||||
*/
|
||||
async getOwnedAttribute(type, name) {
|
||||
const attrs = await this.getOwnedAttributes(type, name);
|
||||
getOwnedAttribute(type, name) {
|
||||
const attrs = this.getOwnedAttributes(type, name);
|
||||
|
||||
return attrs.length > 0 ? attrs[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Attribute[]>} relations targetting this specific note
|
||||
* @returns {Attribute[]} relations targetting this specific note
|
||||
*/
|
||||
async getTargetRelations() {
|
||||
return await repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [this.noteId]);
|
||||
getTargetRelations() {
|
||||
return this.repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [this.noteId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's attributes, including inherited ones
|
||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
async getAttributes(type, name) {
|
||||
getAttributes(type, name) {
|
||||
if (!this.__attributeCache) {
|
||||
await this.loadAttributesToCache();
|
||||
this.loadAttributesToCache();
|
||||
}
|
||||
|
||||
if (type && name) {
|
||||
@@ -300,67 +320,51 @@ class Note extends Entity {
|
||||
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones
|
||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
||||
*/
|
||||
async getLabels(name) {
|
||||
return await this.getAttributes(LABEL, name);
|
||||
getLabels(name) {
|
||||
return this.getAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), excluding inherited ones
|
||||
* @returns {Attribute[]} all note's labels (attributes with type label), excluding inherited ones
|
||||
*/
|
||||
async getOwnedLabels(name) {
|
||||
return await this.getOwnedAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones
|
||||
*/
|
||||
async getLabelDefinitions(name) {
|
||||
return await this.getAttributes(LABEL_DEFINITION, name);
|
||||
getOwnedLabels(name) {
|
||||
return this.getOwnedAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones
|
||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||
*/
|
||||
async getRelations(name) {
|
||||
return await this.getAttributes(RELATION, name);
|
||||
getRelations(name) {
|
||||
return this.getAttributes(RELATION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), excluding inherited ones
|
||||
* @returns {Attribute[]} all note's relations (attributes with type relation), excluding inherited ones
|
||||
*/
|
||||
async getOwnedRelations(name) {
|
||||
return await this.getOwnedAttributes(RELATION, name);
|
||||
getOwnedRelations(name) {
|
||||
return this.getOwnedAttributes(RELATION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<Note[]>}
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
async getRelationTargets(name) {
|
||||
const relations = await this.getRelations(name);
|
||||
getRelationTargets(name) {
|
||||
const relations = this.getRelations(name);
|
||||
const targets = [];
|
||||
|
||||
for (const relation of relations) {
|
||||
targets.push(await relation.getTargetNote());
|
||||
targets.push(relation.getTargetNote());
|
||||
}
|
||||
|
||||
return targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones
|
||||
*/
|
||||
async getRelationDefinitions(name) {
|
||||
return await this.getAttributes(RELATION_DEFINITION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear note's attributes cache to force fresh reload for next attribute request.
|
||||
* Cache is note instance scoped.
|
||||
@@ -370,9 +374,8 @@ class Note extends Entity {
|
||||
this.__ownedAttributeCache = null;
|
||||
}
|
||||
|
||||
/** @returns {Promise<void>} */
|
||||
async loadAttributesToCache() {
|
||||
const attributes = await repository.getEntities(`
|
||||
loadAttributesToCache() {
|
||||
const attributes = this.repository.getEntities(`
|
||||
WITH RECURSIVE
|
||||
tree(noteId, level) AS (
|
||||
SELECT ?, 0
|
||||
@@ -404,6 +407,7 @@ class Note extends Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME: this code is quite questionable, one problem is that other caches (TreeCache, NoteCache) have nothing like that
|
||||
if (attr.isDefinition()) {
|
||||
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);
|
||||
|
||||
@@ -411,15 +415,15 @@ class Note extends Entity {
|
||||
return firstDefinitionIndex === index;
|
||||
}
|
||||
else {
|
||||
const definitionAttr = attributes.find(el => el.type === attr.type + '-definition' && el.name === attr.name);
|
||||
const definitionAttr = attributes.find(el => el.type === 'label' && el.name === attr.type + ':' + attr.name);
|
||||
|
||||
if (!definitionAttr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const definition = definitionAttr.value;
|
||||
const definition = definitionAttr.getDefinition();
|
||||
|
||||
if (definition.multiplicityType === 'multivalue') {
|
||||
if (definition.multiplicity === 'multi') {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -431,38 +435,34 @@ class Note extends Entity {
|
||||
}
|
||||
});
|
||||
|
||||
for (const attr of filteredAttributes) {
|
||||
attr.isOwned = attr.noteId === this.noteId;
|
||||
}
|
||||
|
||||
this.__attributeCache = filteredAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<boolean>} true if note has an attribute with given type and name (including inherited)
|
||||
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
|
||||
*/
|
||||
async hasAttribute(type, name) {
|
||||
return !!await this.getAttribute(type, name);
|
||||
hasAttribute(type, name) {
|
||||
return !!this.getAttribute(type, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<boolean>} true if note has an attribute with given type and name (excluding inherited)
|
||||
* @returns {boolean} true if note has an attribute with given type and name (excluding inherited)
|
||||
*/
|
||||
async hasOwnedAttribute(type, name) {
|
||||
return !!await this.getOwnedAttribute(type, name);
|
||||
hasOwnedAttribute(type, name) {
|
||||
return !!this.getOwnedAttribute(type, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<Attribute>} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
*/
|
||||
async getAttribute(type, name) {
|
||||
const attributes = await this.getAttributes();
|
||||
getAttribute(type, name) {
|
||||
const attributes = this.getAttributes();
|
||||
|
||||
return attributes.find(attr => attr.type === type && attr.name === name);
|
||||
}
|
||||
@@ -470,10 +470,10 @@ class Note extends Entity {
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<string|null>} attribute value of given type and name or null if no such attribute exists.
|
||||
* @returns {string|null} attribute value of given type and name or null if no such attribute exists.
|
||||
*/
|
||||
async getAttributeValue(type, name) {
|
||||
const attr = await this.getAttribute(type, name);
|
||||
getAttributeValue(type, name) {
|
||||
const attr = this.getAttribute(type, name);
|
||||
|
||||
return attr ? attr.value : null;
|
||||
}
|
||||
@@ -481,10 +481,10 @@ class Note extends Entity {
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<string|null>} attribute value of given type and name or null if no such attribute exists.
|
||||
* @returns {string|null} attribute value of given type and name or null if no such attribute exists.
|
||||
*/
|
||||
async getOwnedAttributeValue(type, name) {
|
||||
const attr = await this.getOwnedAttribute(type, name);
|
||||
getOwnedAttributeValue(type, name) {
|
||||
const attr = this.getOwnedAttribute(type, name);
|
||||
|
||||
return attr ? attr.value : null;
|
||||
}
|
||||
@@ -496,14 +496,13 @@ class Note extends Entity {
|
||||
* @param {boolean} enabled - toggle On or Off
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value (optional)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async toggleAttribute(type, enabled, name, value) {
|
||||
toggleAttribute(type, enabled, name, value) {
|
||||
if (enabled) {
|
||||
await this.setAttribute(type, name, value);
|
||||
this.setAttribute(type, name, value);
|
||||
}
|
||||
else {
|
||||
await this.removeAttribute(type, name, value);
|
||||
this.removeAttribute(type, name, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,16 +512,15 @@ class Note extends Entity {
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value (optional)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async setAttribute(type, name, value) {
|
||||
const attributes = await this.loadOwnedAttributesToCache();
|
||||
setAttribute(type, name, value) {
|
||||
const attributes = this.loadOwnedAttributesToCache();
|
||||
let attr = attributes.find(attr => attr.type === type && attr.name === name);
|
||||
|
||||
if (attr) {
|
||||
if (attr.value !== value) {
|
||||
attr.value = value;
|
||||
await attr.save();
|
||||
attr.save();
|
||||
|
||||
this.invalidateAttributeCache();
|
||||
}
|
||||
@@ -535,7 +533,7 @@ class Note extends Entity {
|
||||
value: value !== undefined ? value : ""
|
||||
});
|
||||
|
||||
await attr.save();
|
||||
attr.save();
|
||||
|
||||
this.invalidateAttributeCache();
|
||||
}
|
||||
@@ -547,15 +545,14 @@ class Note extends Entity {
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value (optional)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async removeAttribute(type, name, value) {
|
||||
const attributes = await this.loadOwnedAttributesToCache();
|
||||
removeAttribute(type, name, value) {
|
||||
const attributes = this.loadOwnedAttributesToCache();
|
||||
|
||||
for (const attribute of attributes) {
|
||||
if (attribute.type === type && (value === undefined || value === attribute.value)) {
|
||||
if (attribute.type === type && attribute.name === name && (value === undefined || value === attribute.value)) {
|
||||
attribute.isDeleted = true;
|
||||
await attribute.save();
|
||||
attribute.save();
|
||||
|
||||
this.invalidateAttributeCache();
|
||||
}
|
||||
@@ -563,121 +560,123 @@ class Note extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Promise<Attribute>}
|
||||
* @return {Attribute}
|
||||
*/
|
||||
async addAttribute(type, name, value = "") {
|
||||
addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
|
||||
const attr = new Attribute({
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
value: value
|
||||
value: value,
|
||||
isInheritable: isInheritable,
|
||||
position: position
|
||||
});
|
||||
|
||||
await attr.save();
|
||||
attr.save();
|
||||
|
||||
this.invalidateAttributeCache();
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
async addLabel(name, value = "") {
|
||||
return await this.addAttribute(LABEL, name, value);
|
||||
addLabel(name, value = "", isInheritable = false) {
|
||||
return this.addAttribute(LABEL, name, value, isInheritable);
|
||||
}
|
||||
|
||||
async addRelation(name, targetNoteId) {
|
||||
return await this.addAttribute(RELATION, name, targetNoteId);
|
||||
addRelation(name, targetNoteId, isInheritable = false) {
|
||||
return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<boolean>} true if label exists (including inherited)
|
||||
* @returns {boolean} true if label exists (including inherited)
|
||||
*/
|
||||
async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
|
||||
hasLabel(name) { return this.hasAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<boolean>} true if label exists (excluding inherited)
|
||||
* @returns {boolean} true if label exists (excluding inherited)
|
||||
*/
|
||||
async hasOwnedLabel(name) { return await this.hasOwnedAttribute(LABEL, name); }
|
||||
hasOwnedLabel(name) { return this.hasOwnedAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<boolean>} true if relation exists (including inherited)
|
||||
* @returns {boolean} true if relation exists (including inherited)
|
||||
*/
|
||||
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
|
||||
hasRelation(name) { return this.hasAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<boolean>} true if relation exists (excluding inherited)
|
||||
* @returns {boolean} true if relation exists (excluding inherited)
|
||||
*/
|
||||
async hasOwnedRelation(name) { return await this.hasOwnedAttribute(RELATION, name); }
|
||||
hasOwnedRelation(name) { return this.hasOwnedAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<Attribute|null>} label if it exists, null otherwise
|
||||
* @returns {Attribute|null} label if it exists, null otherwise
|
||||
*/
|
||||
async getLabel(name) { return await this.getAttribute(LABEL, name); }
|
||||
getLabel(name) { return this.getAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<Attribute|null>} label if it exists, null otherwise
|
||||
* @returns {Attribute|null} label if it exists, null otherwise
|
||||
*/
|
||||
async getOwnedLabel(name) { return await this.getOwnedAttribute(LABEL, name); }
|
||||
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<Attribute|null>} relation if it exists, null otherwise
|
||||
* @returns {Attribute|null} relation if it exists, null otherwise
|
||||
*/
|
||||
async getRelation(name) { return await this.getAttribute(RELATION, name); }
|
||||
getRelation(name) { return this.getAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<Attribute|null>} relation if it exists, null otherwise
|
||||
* @returns {Attribute|null} relation if it exists, null otherwise
|
||||
*/
|
||||
async getOwnedRelation(name) { return await this.getOwnedAttribute(RELATION, name); }
|
||||
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<string|null>} label value if label exists, null otherwise
|
||||
* @returns {string|null} label value if label exists, null otherwise
|
||||
*/
|
||||
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
|
||||
getLabelValue(name) { return this.getAttributeValue(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<string|null>} label value if label exists, null otherwise
|
||||
* @returns {string|null} label value if label exists, null otherwise
|
||||
*/
|
||||
async getOwnedLabelValue(name) { return await this.getOwnedAttributeValue(LABEL, name); }
|
||||
getOwnedLabelValue(name) { return this.getOwnedAttributeValue(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<string|null>} relation value if relation exists, null otherwise
|
||||
* @returns {string|null} relation value if relation exists, null otherwise
|
||||
*/
|
||||
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
|
||||
getRelationValue(name) { return this.getAttributeValue(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<string|null>} relation value if relation exists, null otherwise
|
||||
* @returns {string|null} relation value if relation exists, null otherwise
|
||||
*/
|
||||
async getOwnedRelationValue(name) { return await this.getOwnedAttributeValue(RELATION, name); }
|
||||
getOwnedRelationValue(name) { return this.getOwnedAttributeValue(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {Promise<Note>|null} target note of the relation or null (if target is empty or note was not found)
|
||||
* @returns {Note|null} target note of the relation or null (if target is empty or note was not found)
|
||||
*/
|
||||
async getRelationTarget(name) {
|
||||
const relation = await this.getRelation(name);
|
||||
getRelationTarget(name) {
|
||||
const relation = this.getRelation(name);
|
||||
|
||||
return relation ? await repository.getNote(relation.value) : null;
|
||||
return relation ? this.repository.getNote(relation.value) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {Promise<Note>|null} target note of the relation or null (if target is empty or note was not found)
|
||||
* @returns {Note|null} target note of the relation or null (if target is empty or note was not found)
|
||||
*/
|
||||
async getOwnedRelationTarget(name) {
|
||||
const relation = await this.getOwnedRelation(name);
|
||||
getOwnedRelationTarget(name) {
|
||||
const relation = this.getOwnedRelation(name);
|
||||
|
||||
return relation ? await repository.getNote(relation.value) : null;
|
||||
return relation ? this.repository.getNote(relation.value) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -686,9 +685,8 @@ class Note extends Entity {
|
||||
* @param {boolean} enabled - toggle On or Off
|
||||
* @param {string} name - label name
|
||||
* @param {string} [value] - label value (optional)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async toggleLabel(enabled, name, value) { return await this.toggleAttribute(LABEL, enabled, name, value); }
|
||||
toggleLabel(enabled, name, value) { return this.toggleAttribute(LABEL, enabled, name, value); }
|
||||
|
||||
/**
|
||||
* Based on enabled, relation is either set or removed.
|
||||
@@ -696,51 +694,46 @@ class Note extends Entity {
|
||||
* @param {boolean} enabled - toggle On or Off
|
||||
* @param {string} name - relation name
|
||||
* @param {string} [value] - relation value (noteId)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async toggleRelation(enabled, name, value) { return await this.toggleAttribute(RELATION, enabled, name, value); }
|
||||
toggleRelation(enabled, name, value) { return this.toggleAttribute(RELATION, enabled, name, value); }
|
||||
|
||||
/**
|
||||
* Update's given label's value or creates it if it doesn't exist
|
||||
*
|
||||
* @param {string} name - label name
|
||||
* @param {string} [value] - label value
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async setLabel(name, value) { return await this.setAttribute(LABEL, name, value); }
|
||||
setLabel(name, value) { return this.setAttribute(LABEL, name, value); }
|
||||
|
||||
/**
|
||||
* Update's given relation's value or creates it if it doesn't exist
|
||||
*
|
||||
* @param {string} name - relation name
|
||||
* @param {string} [value] - relation value (noteId)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async setRelation(name, value) { return await this.setAttribute(RELATION, name, value); }
|
||||
setRelation(name, value) { return this.setAttribute(RELATION, name, value); }
|
||||
|
||||
/**
|
||||
* Remove label name-value pair, if it exists.
|
||||
*
|
||||
* @param {string} name - label name
|
||||
* @param {string} [value] - label value
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async removeLabel(name, value) { return await this.removeAttribute(LABEL, name, value); }
|
||||
removeLabel(name, value) { return this.removeAttribute(LABEL, name, value); }
|
||||
|
||||
/**
|
||||
* Remove relation name-value pair, if it exists.
|
||||
*
|
||||
* @param {string} name - relation name
|
||||
* @param {string} [value] - relation value (noteId)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async removeRelation(name, value) { return await this.removeAttribute(RELATION, name, value); }
|
||||
removeRelation(name, value) { return this.removeAttribute(RELATION, name, value); }
|
||||
|
||||
/**
|
||||
* @return {Promise<string[]>} return list of all descendant noteIds of this note. Returning just noteIds because number of notes can be huge. Includes also this note's noteId
|
||||
* @return {string[]} return list of all descendant noteIds of this note. Returning just noteIds because number of notes can be huge. Includes also this note's noteId
|
||||
*/
|
||||
async getDescendantNoteIds() {
|
||||
return await sql.getColumn(`
|
||||
getDescendantNoteIds() {
|
||||
return sql.getColumn(`
|
||||
WITH RECURSIVE
|
||||
tree(noteId) AS (
|
||||
SELECT ?
|
||||
@@ -760,9 +753,9 @@ class Note extends Entity {
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value
|
||||
* @returns {Promise<Note[]>}
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
async getDescendantNotesWithAttribute(type, name, value) {
|
||||
getDescendantNotesWithAttribute(type, name, value) {
|
||||
const params = [this.noteId, name];
|
||||
let valueCondition = "";
|
||||
|
||||
@@ -771,7 +764,7 @@ class Note extends Entity {
|
||||
valueCondition = " AND attributes.value = ?";
|
||||
}
|
||||
|
||||
const notes = await repository.getEntities(`
|
||||
const notes = this.repository.getEntities(`
|
||||
WITH RECURSIVE
|
||||
tree(noteId) AS (
|
||||
SELECT ?
|
||||
@@ -798,63 +791,63 @@ class Note extends Entity {
|
||||
*
|
||||
* @param {string} name - label name
|
||||
* @param {string} [value] - label value
|
||||
* @returns {Promise<Note[]>}
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
async getDescendantNotesWithLabel(name, value) { return await this.getDescendantNotesWithAttribute(LABEL, name, value); }
|
||||
getDescendantNotesWithLabel(name, value) { return this.getDescendantNotesWithAttribute(LABEL, name, value); }
|
||||
|
||||
/**
|
||||
* Finds descendant notes with given relation name and value. Only own relations are considered, not inherited ones
|
||||
*
|
||||
* @param {string} name - relation name
|
||||
* @param {string} [value] - relation value
|
||||
* @returns {Promise<Note[]>}
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
async getDescendantNotesWithRelation(name, value) { return await this.getDescendantNotesWithAttribute(RELATION, name, value); }
|
||||
getDescendantNotesWithRelation(name, value) { return this.getDescendantNotesWithAttribute(RELATION, name, value); }
|
||||
|
||||
/**
|
||||
* Returns note revisions of this note.
|
||||
*
|
||||
* @returns {Promise<NoteRevision[]>}
|
||||
* @returns {NoteRevision[]}
|
||||
*/
|
||||
async getRevisions() {
|
||||
return await repository.getEntities("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId]);
|
||||
getRevisions() {
|
||||
return this.repository.getEntities("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of links coming out of this note.
|
||||
*
|
||||
* @deprecated - not intended for general use
|
||||
* @returns {Promise<Attribute[]>}
|
||||
* @returns {Attribute[]}
|
||||
*/
|
||||
async getLinks() {
|
||||
return await repository.getEntities(`
|
||||
getLinks() {
|
||||
return this.repository.getEntities(`
|
||||
SELECT *
|
||||
FROM attributes
|
||||
WHERE noteId = ? AND
|
||||
isDeleted = 0 AND
|
||||
type = 'relation' AND
|
||||
name IN ('internalLink', 'imageLink', 'relationMapLink')`, [this.noteId]);
|
||||
isDeleted = 0 AND
|
||||
type = 'relation' AND
|
||||
name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink')`, [this.noteId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Branch[]>}
|
||||
* @returns {Branch[]}
|
||||
*/
|
||||
async getBranches() {
|
||||
return await repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
|
||||
getBranches() {
|
||||
return this.repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} - true if note has children
|
||||
*/
|
||||
async hasChildren() {
|
||||
return (await this.getChildNotes()).length > 0;
|
||||
hasChildren() {
|
||||
return this.getChildNotes().length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note[]>} child notes of this note
|
||||
* @returns {Note[]} child notes of this note
|
||||
*/
|
||||
async getChildNotes() {
|
||||
return await repository.getEntities(`
|
||||
getChildNotes() {
|
||||
return this.repository.getEntities(`
|
||||
SELECT notes.*
|
||||
FROM branches
|
||||
JOIN notes USING(noteId)
|
||||
@@ -865,10 +858,10 @@ class Note extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Branch[]>} child branches of this note
|
||||
* @returns {Branch[]} child branches of this note
|
||||
*/
|
||||
async getChildBranches() {
|
||||
return await repository.getEntities(`
|
||||
getChildBranches() {
|
||||
return this.repository.getEntities(`
|
||||
SELECT branches.*
|
||||
FROM branches
|
||||
WHERE branches.isDeleted = 0
|
||||
@@ -877,10 +870,10 @@ class Note extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Note[]>} parent notes of this note (note can have multiple parents because of cloning)
|
||||
* @returns {Note[]} parent notes of this note (note can have multiple parents because of cloning)
|
||||
*/
|
||||
async getParentNotes() {
|
||||
return await repository.getEntities(`
|
||||
getParentNotes() {
|
||||
return this.repository.getEntities(`
|
||||
SELECT parent_notes.*
|
||||
FROM
|
||||
branches AS child_tree
|
||||
@@ -891,17 +884,17 @@ class Note extends Entity {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Promise<string[][]>} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
||||
* @return {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
||||
*/
|
||||
async getAllNotePaths() {
|
||||
getAllNotePaths() {
|
||||
if (this.noteId === 'root') {
|
||||
return [['root']];
|
||||
}
|
||||
|
||||
const notePaths = [];
|
||||
|
||||
for (const parentNote of await this.getParentNotes()) {
|
||||
for (const parentPath of await parentNote.getAllNotePaths()) {
|
||||
for (const parentNote of this.getParentNotes()) {
|
||||
for (const parentPath of parentNote.getAllNotePaths()) {
|
||||
parentPath.push(this.noteId);
|
||||
notePaths.push(parentPath);
|
||||
}
|
||||
@@ -910,12 +903,22 @@ class Note extends Entity {
|
||||
return notePaths;
|
||||
}
|
||||
|
||||
getRelationDefinitions() {
|
||||
return this.getLabels()
|
||||
.filter(l => l.name.startsWith("relation:"));
|
||||
}
|
||||
|
||||
getLabelDefinitions() {
|
||||
return this.getLabels()
|
||||
.filter(l => l.name.startsWith("relation:"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ancestorNoteId
|
||||
* @return {Promise<boolean>} - true if ancestorNoteId occurs in at least one of the note's paths
|
||||
* @return {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
|
||||
*/
|
||||
async isDescendantOfNote(ancestorNoteId) {
|
||||
const notePaths = await this.getAllNotePaths();
|
||||
isDescendantOfNote(ancestorNoteId) {
|
||||
const notePaths = this.getAllNotePaths();
|
||||
|
||||
return notePaths.some(path => path.includes(ancestorNoteId));
|
||||
}
|
||||
@@ -933,16 +936,10 @@ class Note extends Entity {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
if (this.contentLength === undefined) {
|
||||
this.contentLength = -1;
|
||||
}
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.dateModified = dateUtils.localNowDateTime();
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
@@ -966,7 +963,8 @@ class Note extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Note;</code></pre>
|
||||
module.exports = Note;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -982,7 +980,7 @@ module.exports = Note;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
|
||||
const Entity = require('./entity');
|
||||
const protectedSessionService = require('../services/protected_session');
|
||||
const repository = require('../services/repository');
|
||||
const utils = require('../services/utils');
|
||||
const sql = require('../services/sql');
|
||||
const dateUtils = require('../services/date_utils');
|
||||
const syncTableService = require('../services/sync_table');
|
||||
const entityChangesService = require('../services/entity_changes.js');
|
||||
|
||||
/**
|
||||
* NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
|
||||
@@ -44,8 +43,6 @@ const syncTableService = require('../services/sync_table');
|
||||
* @property {string} type
|
||||
* @property {string} mime
|
||||
* @property {string} title
|
||||
* @property {int} contentLength
|
||||
* @property {boolean} isErased
|
||||
* @property {boolean} isProtected
|
||||
* @property {string} dateLastEdited
|
||||
* @property {string} dateCreated
|
||||
@@ -58,7 +55,7 @@ const syncTableService = require('../services/sync_table');
|
||||
class NoteRevision extends Entity {
|
||||
static get entityName() { return "note_revisions"; }
|
||||
static get primaryKeyName() { return "noteRevisionId"; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "contentLength", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||
|
||||
constructor(row) {
|
||||
super(row);
|
||||
@@ -75,8 +72,8 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
async getNote() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
getNote() {
|
||||
return this.repository.getNote(this.noteId);
|
||||
}
|
||||
|
||||
/** @returns {boolean} true if the note has string content (not binary) */
|
||||
@@ -93,10 +90,10 @@ class NoteRevision extends Entity {
|
||||
* This is the same approach as is used for Note's content.
|
||||
*/
|
||||
|
||||
/** @returns {Promise<*>} */
|
||||
async getContent(silentNotFoundError = false) {
|
||||
/** @returns {*} */
|
||||
getContent(silentNotFoundError = false) {
|
||||
if (this.content === undefined) {
|
||||
const res = await sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||
const res = sql.getRow(`SELECT content FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||
|
||||
if (!res) {
|
||||
if (silentNotFoundError) {
|
||||
@@ -108,7 +105,6 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
|
||||
this.content = res.content;
|
||||
|
||||
if (this.isProtected) {
|
||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||
this.content = protectedSessionService.decrypt(this.content);
|
||||
@@ -117,31 +113,25 @@ class NoteRevision extends Entity {
|
||||
this.content = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isStringNote()) {
|
||||
this.content = this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
return this.content;
|
||||
if (this.isStringNote()) {
|
||||
return this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
else {
|
||||
return this.content;
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise} */
|
||||
async setContent(content) {
|
||||
// force updating note itself so that utcDateModified is represented correctly even for the content
|
||||
this.forcedChange = true;
|
||||
this.contentLength = content === null ? 0 : content.length;
|
||||
await this.save();
|
||||
|
||||
setContent(content) {
|
||||
this.content = content;
|
||||
|
||||
const pojo = {
|
||||
noteRevisionId: this.noteRevisionId,
|
||||
content: content,
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteRevisionId + "|" + content)
|
||||
utcDateModified: dateUtils.utcNowDateTime()
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -153,17 +143,23 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
await sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||
sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||
|
||||
await syncTableService.addNoteRevisionContentSync(this.noteRevisionId);
|
||||
const hash = utils.hash(this.noteRevisionId + "|" + content);
|
||||
|
||||
entityChangesService.addEntityChange({
|
||||
entityName: 'note_revision_contents',
|
||||
entityId: this.noteRevisionId,
|
||||
hash: hash,
|
||||
isErased: false,
|
||||
utcDateChanged: this.getUtcDateChanged()
|
||||
}, null);
|
||||
}
|
||||
|
||||
beforeSaving() {
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
@@ -182,7 +178,8 @@ class NoteRevision extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NoteRevision;</code></pre>
|
||||
module.exports = NoteRevision;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -198,7 +195,7 @@ module.exports = NoteRevision;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -60,13 +60,12 @@ class Option extends Entity {
|
||||
|
||||
super.beforeSaving();
|
||||
|
||||
if (this.isChanged) {
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Option;</code></pre>
|
||||
module.exports = Option;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -82,7 +81,7 @@ module.exports = Option;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -36,21 +36,15 @@ const dateUtils = require('../services/date_utils');
|
||||
*
|
||||
* @property {string} noteId
|
||||
* @property {string} notePath
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string} utcDateModified
|
||||
* @property {string} utcDateCreated
|
||||
*
|
||||
* @extends Entity
|
||||
*/
|
||||
class RecentNote extends Entity {
|
||||
static get entityName() { return "recent_notes"; }
|
||||
static get primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "notePath", "utcDateCreated", "isDeleted"]; }
|
||||
|
||||
beforeSaving() {
|
||||
if (!this.isDeleted) {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
if (!this.utcDateCreated) {
|
||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||
}
|
||||
@@ -59,7 +53,8 @@ class RecentNote extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RecentNote;</code></pre>
|
||||
module.exports = RecentNote;
|
||||
</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
@@ -75,7 +70,7 @@ module.exports = RecentNote;</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line212">line 212</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line215">line 215</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line173">line 173</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line176">line 176</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line233">line 233</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line236">line 236</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1053,7 +1053,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line240">line 240</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line243">line 243</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1089,7 +1089,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -38,9 +38,9 @@ const repository = require('./repository');
|
||||
const axios = require('axios');
|
||||
const dayjs = require('dayjs');
|
||||
const cloningService = require('./cloning');
|
||||
const ws = require('./ws.js');
|
||||
const appInfo = require('./app_info');
|
||||
const searchService = require('./search');
|
||||
const searchService = require('./search/services/search');
|
||||
const SearchContext = require("./search/search_context.js");
|
||||
|
||||
/**
|
||||
* This is the main backend API interface for scripts. It's published in the local "api" object.
|
||||
@@ -78,38 +78,31 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
/**
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getNote = repository.getNote;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} branchId
|
||||
* @returns {Promise<Branch|null>}
|
||||
* @returns {Branch|null}
|
||||
*/
|
||||
this.getBranch = repository.getBranch;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} attributeId
|
||||
* @returns {Promise<Attribute|null>}
|
||||
* @returns {Attribute|null}
|
||||
*/
|
||||
this.getAttribute = repository.getAttribute;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} imageId
|
||||
* @returns {Promise<Image|null>}
|
||||
*/
|
||||
this.getImage = repository.getImage;
|
||||
|
||||
/**
|
||||
* Retrieves first entity from the SQL's result set.
|
||||
*
|
||||
* @method
|
||||
* @param {string} SQL query
|
||||
* @param {Array.<?>} array of params
|
||||
* @returns {Promise<Entity|null>}
|
||||
* @returns {Entity|null}
|
||||
*/
|
||||
this.getEntity = repository.getEntity;
|
||||
|
||||
@@ -117,30 +110,40 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} SQL query
|
||||
* @param {Array.<?>} array of params
|
||||
* @returns {Promise<Entity[]>}
|
||||
* @returns {Entity[]}
|
||||
*/
|
||||
this.getEntities = repository.getEntities;
|
||||
|
||||
/**
|
||||
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
||||
* "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||
*
|
||||
* @method
|
||||
* @param {string} searchString
|
||||
* @returns {Promise<Note[]>}
|
||||
* @param {string} query
|
||||
* @param {Object} [searchParams]
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
this.searchForNotes = searchService.searchForNotes;
|
||||
this.searchForNotes = (query, searchParams = {}) => {
|
||||
if (searchParams.includeArchivedNotes === undefined) {
|
||||
searchParams.includeArchivedNotes = true;
|
||||
}
|
||||
|
||||
const noteIds = searchService.findNotesWithQuery(query, new SearchContext(searchParams))
|
||||
.map(sr => sr.noteId);
|
||||
|
||||
return repository.getNotes(noteIds);
|
||||
};
|
||||
|
||||
/**
|
||||
* This is a powerful search method - you can search by attributes and their values, e.g.:
|
||||
* "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||
*
|
||||
* @method
|
||||
* @param {string} searchString
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.searchForNote = async searchString => {
|
||||
const notes = await searchService.searchForNotes(searchString);
|
||||
this.searchForNote = searchString => {
|
||||
const notes = searchService.searchNoteEntities(searchString);
|
||||
|
||||
return notes.length > 0 ? notes[0] : null;
|
||||
};
|
||||
@@ -151,7 +154,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value
|
||||
* @returns {Promise<Note[]>}
|
||||
* @returns {Note[]}
|
||||
*/
|
||||
this.getNotesWithLabel = attributeService.getNotesWithLabel;
|
||||
|
||||
@@ -161,7 +164,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} name - attribute name
|
||||
* @param {string} [value] - attribute value
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getNoteWithLabel = attributeService.getNoteWithLabel;
|
||||
|
||||
@@ -172,7 +175,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @param {string} noteId
|
||||
* @param {string} parentNoteId
|
||||
* @param {string} prefix - if branch will be create between note and parent note, set this prefix
|
||||
* @returns {Promise<void>}
|
||||
* @returns {void}
|
||||
*/
|
||||
this.ensureNoteIsPresentInParent = cloningService.ensureNoteIsPresentInParent;
|
||||
|
||||
@@ -182,7 +185,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @param {string} parentNoteId
|
||||
* @returns {Promise<void>}
|
||||
* @returns {void}
|
||||
*/
|
||||
this.ensureNoteIsAbsentFromParent = cloningService.ensureNoteIsAbsentFromParent;
|
||||
|
||||
@@ -194,7 +197,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @param {string} noteId
|
||||
* @param {string} parentNoteId
|
||||
* @param {string} prefix - if branch will be create between note and parent note, set this prefix
|
||||
* @returns {Promise<void>}
|
||||
* @returns {void}
|
||||
*/
|
||||
this.toggleNoteInParent = cloningService.toggleNoteInParent;
|
||||
|
||||
@@ -211,9 +214,9 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @param {string} parentNoteId
|
||||
* @param {string} title
|
||||
* @param {string} content
|
||||
* @return {Promise<{note: Note, branch: Branch}>}
|
||||
* @return {{note: Note, branch: Branch}}
|
||||
*/
|
||||
this.createTextNote = async (parentNoteId, title, content = '') => await noteService.createNewNote({
|
||||
this.createTextNote = (parentNoteId, title, content = '') => noteService.createNewNote({
|
||||
parentNoteId,
|
||||
title,
|
||||
content,
|
||||
@@ -227,12 +230,12 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @param {string} parentNoteId
|
||||
* @param {string} title
|
||||
* @param {object} content
|
||||
* @return {Promise<{note: Note, branch: Branch}>}
|
||||
* @return {{note: Note, branch: Branch}}
|
||||
*/
|
||||
this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({
|
||||
this.createDataNote = (parentNoteId, title, content = {}) => noteService.createNewNote({
|
||||
parentNoteId,
|
||||
title,
|
||||
content: JSON.stringify(content),
|
||||
content: JSON.stringify(content, null, '\t'),
|
||||
type: 'code',
|
||||
mime: 'application/json'
|
||||
});
|
||||
@@ -254,7 +257,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
*
|
||||
* @param {CreateNewNoteParams} [params]
|
||||
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
||||
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
|
||||
*/
|
||||
this.createNewNote = noteService.createNewNote;
|
||||
|
||||
@@ -276,18 +279,19 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @deprecated please use createTextNote() with similar API for simpler use cases or createNewNote() for more complex needs
|
||||
*
|
||||
* @param {string} parentNoteId - create new note under this parent
|
||||
* @param {string} title
|
||||
* @param {string} [content=""]
|
||||
* @param {CreateNoteExtraOptions} [extraOptions={}]
|
||||
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
||||
* @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
|
||||
*/
|
||||
this.createNote = async (parentNoteId, title, content = "", extraOptions= {}) => {
|
||||
this.createNote = (parentNoteId, title, content = "", extraOptions= {}) => {
|
||||
extraOptions.parentNoteId = parentNoteId;
|
||||
extraOptions.title = title;
|
||||
|
||||
const parentNote = await repository.getNote(parentNoteId);
|
||||
const parentNote = repository.getNote(parentNoteId);
|
||||
|
||||
// code note type can be inherited, otherwise text is default
|
||||
extraOptions.type = parentNote.type === 'code' ? 'code' : 'text';
|
||||
@@ -302,19 +306,21 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
extraOptions.content = content;
|
||||
}
|
||||
|
||||
const {note, branch} = await noteService.createNewNote(extraOptions);
|
||||
return sql.transactional(() => {
|
||||
const {note, branch} = noteService.createNewNote(extraOptions);
|
||||
|
||||
for (const attr of extraOptions.attributes || []) {
|
||||
await attributeService.createAttribute({
|
||||
noteId: note.noteId,
|
||||
type: attr.type,
|
||||
name: attr.name,
|
||||
value: attr.value,
|
||||
isInheritable: !!attr.isInheritable
|
||||
});
|
||||
}
|
||||
for (const attr of extraOptions.attributes || []) {
|
||||
attributeService.createAttribute({
|
||||
noteId: note.noteId,
|
||||
type: attr.type,
|
||||
name: attr.name,
|
||||
value: attr.value,
|
||||
isInheritable: !!attr.isInheritable
|
||||
});
|
||||
}
|
||||
|
||||
return {note, branch};
|
||||
return {note, branch};
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -328,7 +334,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* Returns root note of the calendar.
|
||||
*
|
||||
* @method
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
|
||||
|
||||
@@ -337,7 +343,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} date in YYYY-MM-DD format
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getDateNote = dateNoteService.getDateNote;
|
||||
|
||||
@@ -345,7 +351,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* Returns today's day note. If such note doesn't exist, it is created.
|
||||
*
|
||||
* @method
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getTodayNote = dateNoteService.getTodayNote;
|
||||
|
||||
@@ -355,7 +361,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* @method
|
||||
* @param {string} date in YYYY-MM-DD format
|
||||
* @param {object} options - "startOfTheWeek" - either "monday" (default) or "sunday"
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getWeekNote = dateNoteService.getWeekNote;
|
||||
|
||||
@@ -364,7 +370,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} date in YYYY-MM format
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getMonthNote = dateNoteService.getMonthNote;
|
||||
|
||||
@@ -373,14 +379,13 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
*
|
||||
* @method
|
||||
* @param {string} year in YYYY format
|
||||
* @returns {Promise<Note|null>}
|
||||
* @returns {Note|null}
|
||||
*/
|
||||
this.getYearNote = dateNoteService.getYearNote;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} parentNoteId - this note's child notes will be sorted
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
this.sortNotesAlphabetically = treeService.sortNotesAlphabetically;
|
||||
|
||||
@@ -402,24 +407,19 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
* This functions wraps code which is supposed to be running in transaction. If transaction already
|
||||
* exists, then we'll use that transaction.
|
||||
*
|
||||
* This method is required only when script has label manualTransactionHandling, all other scripts are
|
||||
* transactional by default.
|
||||
*
|
||||
* @method
|
||||
* @param {function} func
|
||||
* @returns {Promise<?>} result of func callback
|
||||
* @returns {?} result of func callback
|
||||
*/
|
||||
this.transactional = sql.transactional;
|
||||
|
||||
this.sql = sql;
|
||||
|
||||
/**
|
||||
* Trigger tree refresh in all connected clients. This is required when some tree change happens in
|
||||
* the backend.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
* @method
|
||||
* @deprecated - this is now no-op since all the changes should be gracefully handled per widget
|
||||
*/
|
||||
this.refreshTree = ws.refreshTree;
|
||||
this.refreshTree = () => {};
|
||||
|
||||
/**
|
||||
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
||||
@@ -444,7 +444,7 @@ module.exports = BackendScriptApi;
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line3">line 3</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line2">line 2</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -183,7 +183,123 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line6">line 6</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line11">line 11</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="fromSearchNote"><span class="type-signature"></span>fromSearchNote<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line23">line 23</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -241,7 +357,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -299,7 +415,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line8">line 8</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line13">line 13</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -357,7 +473,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line13">line 13</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -415,7 +531,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line11">line 11</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line15">line 15</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -473,7 +589,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line15">line 15</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line19">line 19</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -549,7 +665,211 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line29">line 29</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getNoteFromCache"><span class="type-signature"></span>getNoteFromCache<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line34">line 34</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line39">line 39</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -651,7 +971,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line26">line 26</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line44">line 44</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -719,13 +1039,13 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3>Global</h3><ul><li><a href="global.html#decorateWidget">decorateWidget</a></li><li><a href="global.html#doRenderBody">doRenderBody</a></li><li><a href="global.html#widgetCollapsedStateChangedEvent">widgetCollapsedStateChangedEvent</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user