mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
Compare commits
941 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0dfe7d552 | ||
|
|
3b8b4da149 | ||
|
|
2150619d62 | ||
|
|
acb76e0630 | ||
|
|
fdb46f9329 | ||
|
|
ca587cccf6 | ||
|
|
571772069a | ||
|
|
79e7762c72 | ||
|
|
d025cfee1b | ||
|
|
7793552443 | ||
|
|
f377a84fa1 | ||
|
|
b8f2797abf | ||
|
|
50431dd55a | ||
|
|
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 | ||
|
|
6e4c30571c | ||
|
|
5988776b7e | ||
|
|
384da60953 | ||
|
|
21fab412cb | ||
|
|
eb4dfbad92 | ||
|
|
aff9ce97ee | ||
|
|
b0a3f828fb | ||
|
|
76f5736255 | ||
|
|
a82066d899 | ||
|
|
45c5287d53 | ||
|
|
dce54c7af3 | ||
|
|
ee15db0ae1 | ||
|
|
c48dbb0913 | ||
|
|
882ebdbd8f | ||
|
|
6f32d6fabe | ||
|
|
1e123f2390 | ||
|
|
b29155775e | ||
|
|
b821ed28fc | ||
|
|
fdb8959aa1 | ||
|
|
7554cb057b | ||
|
|
fab959539a | ||
|
|
afe44a6fe8 | ||
|
|
7ed526beb7 | ||
|
|
af695802e3 | ||
|
|
156f040880 | ||
|
|
cf6f04defb | ||
|
|
a890b91079 | ||
|
|
e0aabe4f9c | ||
|
|
01cd9d8fb3 | ||
|
|
af10f0f52a | ||
|
|
aa5ede5039 | ||
|
|
21e77c83fc | ||
|
|
b0310e34e2 | ||
|
|
9812b9c272 | ||
|
|
92d5f91aa6 | ||
|
|
b0368c7f17 | ||
|
|
8e1f8c869b | ||
|
|
4688cda493 | ||
|
|
761c51069a | ||
|
|
4dc285d84f | ||
|
|
0e2f8b5734 | ||
|
|
a1402c7c66 | ||
|
|
6ba3e5ab7f | ||
|
|
f740e52ebf | ||
|
|
e9454e4db7 | ||
|
|
749bb90713 | ||
|
|
eb8c296e62 | ||
|
|
dc063983ea | ||
|
|
2595c3ac31 | ||
|
|
9cb8bc5dd8 | ||
|
|
3b690f5456 | ||
|
|
7ef2e7769f | ||
|
|
4c07ac4c4c | ||
|
|
35cd7f3261 | ||
|
|
8c3e2e5eb7 | ||
|
|
d57caee0d3 | ||
|
|
6e83980784 | ||
|
|
295af1f43e | ||
|
|
ed2afe5c20 | ||
|
|
bfc7570e14 | ||
|
|
d9b9d730bb | ||
|
|
ba8a8dca7b | ||
|
|
29eb5a8435 | ||
|
|
5de92171a7 | ||
|
|
29c5e394ab | ||
|
|
07b3d11fe5 | ||
|
|
67663fba50 | ||
|
|
995ebbf577 | ||
|
|
d0e6be3e0c | ||
|
|
01370a5968 | ||
|
|
6c561b5764 | ||
|
|
2953f1bdb8 | ||
|
|
1c057cac75 | ||
|
|
0415efd33b | ||
|
|
e58dc829f5 | ||
|
|
90d10c1ff3 | ||
|
|
5b30291601 | ||
|
|
5193f073e9 | ||
|
|
6c7d8a9667 | ||
|
|
5e9bedd903 | ||
|
|
e712990c03 | ||
|
|
91487b338a | ||
|
|
3ff24d53e5 | ||
|
|
94c904fb40 | ||
|
|
5f258fbbbf | ||
|
|
56c7b7f5bd | ||
|
|
bf9ad976b9 | ||
|
|
19206d1e0d | ||
|
|
420be6d8c6 | ||
|
|
dbd2040bee | ||
|
|
1e979d71c7 | ||
|
|
6bbd4c59bc | ||
|
|
3a54d00e2b | ||
|
|
499c9a7381 | ||
|
|
cd139bdd76 | ||
|
|
60c3b5cccc | ||
|
|
540f9f933a | ||
|
|
a59943094e | ||
|
|
c400a7143c | ||
|
|
1f37d00e42 | ||
|
|
d21e824343 | ||
|
|
ff3f0ee0a0 | ||
|
|
01ff34b5d4 | ||
|
|
0cde7ede24 | ||
|
|
92cb723d0c | ||
|
|
e4bec265c1 | ||
|
|
434d8ef48c | ||
|
|
c8ba07a4ae | ||
|
|
4da6234911 | ||
|
|
38e7649ac3 | ||
|
|
ff0245f05f | ||
|
|
7a2c7edd7e | ||
|
|
98c81faedb | ||
|
|
cfb850acb2 | ||
|
|
a16aaf7a81 | ||
|
|
465c3b87a7 | ||
|
|
0e5028acd3 | ||
|
|
00c295e4bf | ||
|
|
7084ed4fb1 | ||
|
|
587134c2f8 | ||
|
|
5fac2c7633 | ||
|
|
08a518479b | ||
|
|
522f71cb91 | ||
|
|
bcdfb47939 | ||
|
|
667471e7bb | ||
|
|
d357943ebb | ||
|
|
07043fb177 | ||
|
|
3c4ec7fe1a | ||
|
|
1f8d382b1f | ||
|
|
4bd7438fca | ||
|
|
0ae9c8da17 | ||
|
|
61e8cbbcba | ||
|
|
86c5dd6494 | ||
|
|
f921562346 | ||
|
|
c5acb7fc9b | ||
|
|
643d9077fc | ||
|
|
b4709e8ee5 | ||
|
|
a1181623b7 | ||
|
|
73a6c66379 | ||
|
|
1d5daa8dfd | ||
|
|
834e1f7253 | ||
|
|
c141f4b2c0 | ||
|
|
1a87190f43 | ||
|
|
a1262aaaf3 | ||
|
|
1838f097e5 | ||
|
|
95d0ad1cad | ||
|
|
767aaa18f4 | ||
|
|
8a7228146c | ||
|
|
f9b5e473f2 | ||
|
|
3d294c5163 | ||
|
|
60231de0ed | ||
|
|
35e9df6170 | ||
|
|
13c0411533 | ||
|
|
c5e040c4a4 | ||
|
|
e00ab5dbf9 | ||
|
|
95c37cfdd1 | ||
|
|
de02e9e889 | ||
|
|
e143becb7a | ||
|
|
c0eb30472e | ||
|
|
8b320bb85f | ||
|
|
d93b9b8a23 | ||
|
|
69b53fdfb3 | ||
|
|
920d71a5a6 | ||
|
|
d4a277321c | ||
|
|
4068691078 | ||
|
|
86d7e139a4 | ||
|
|
44add751b2 | ||
|
|
c49c69f824 | ||
|
|
7bd1d8feb4 | ||
|
|
4ba7e74b58 | ||
|
|
4cda661c1b | ||
|
|
5b4a2bd71c | ||
|
|
a808e12d31 | ||
|
|
1f3f9a4037 | ||
|
|
77ac8df1e6 | ||
|
|
b53e2a3570 | ||
|
|
7539e6a616 | ||
|
|
b5a0cadcf4 | ||
|
|
b8db842788 | ||
|
|
dea5195223 | ||
|
|
c3ea2ae1b3 | ||
|
|
1fddd6f318 | ||
|
|
466a4802b6 | ||
|
|
8f2d2b189c | ||
|
|
0837cabb41 | ||
|
|
5646218be8 | ||
|
|
169551c6a8 | ||
|
|
3a1c80c189 | ||
|
|
31bcc037f1 | ||
|
|
179d530ea9 | ||
|
|
da92809299 | ||
|
|
c2ebd4b308 | ||
|
|
9b24ae0600 | ||
|
|
7cd75cebfc | ||
|
|
664485ccd5 | ||
|
|
60ac1a04f4 | ||
|
|
7c7beb5502 | ||
|
|
5aa5ec3af1 | ||
|
|
58a857cf79 | ||
|
|
712f67e983 | ||
|
|
3149dff880 | ||
|
|
d58e98e361 | ||
|
|
744855d4f5 | ||
|
|
8a9f2ff1d8 | ||
|
|
f539aedd25 | ||
|
|
05547845cb | ||
|
|
9b905563c3 | ||
|
|
894c888d87 | ||
|
|
34d4274032 | ||
|
|
b685d7ffb5 | ||
|
|
d87c469fbb | ||
|
|
d8730f1722 | ||
|
|
72fda89360 | ||
|
|
7075842954 | ||
|
|
a2c78e2c5c | ||
|
|
9c9ef1c7b4 | ||
|
|
df40accdd4 | ||
|
|
b67aa99b86 | ||
|
|
5ecb881cec | ||
|
|
fcb6a06d68 | ||
|
|
5b5ab0b044 | ||
|
|
ab04bde5fb | ||
|
|
c9e4261930 | ||
|
|
9ea8209d4e | ||
|
|
56e50cc850 | ||
|
|
fc87bcf10c | ||
|
|
b471d51cb4 | ||
|
|
b7b583ff04 | ||
|
|
475fddeec1 | ||
|
|
2af86927b0 | ||
|
|
2e58e32112 | ||
|
|
5c05963bd9 | ||
|
|
4e5e3e4675 | ||
|
|
f7c59700a5 | ||
|
|
f1a7fce277 | ||
|
|
cf53cbf1dd | ||
|
|
1a182d1b58 | ||
|
|
8bd52f349a | ||
|
|
68faa47c6f | ||
|
|
2f2a14d4b8 | ||
|
|
a2a53deb94 | ||
|
|
d50e072ea4 | ||
|
|
904eb25f64 | ||
|
|
205081c804 | ||
|
|
c4d5060a0b | ||
|
|
5bba18191f | ||
|
|
5e3538669d | ||
|
|
23c449ca0c | ||
|
|
b7344329f4 | ||
|
|
e04845335b | ||
|
|
86a330c8c3 | ||
|
|
f82e99b5ed | ||
|
|
bdf42749f3 | ||
|
|
7ccbf45569 | ||
|
|
c0b30e603a | ||
|
|
d3c957768f | ||
|
|
ed9ecf2a57 | ||
|
|
22d48b0586 | ||
|
|
edc23940d0 | ||
|
|
c72ea2ed60 | ||
|
|
4570319517 | ||
|
|
69d739400c | ||
|
|
ec7c0f0723 | ||
|
|
3de124748d | ||
|
|
41d47c5d33 | ||
|
|
132360b46b | ||
|
|
f0496cb42c | ||
|
|
1522297700 | ||
|
|
2a5ab3a5e1 | ||
|
|
358fd13c8d | ||
|
|
2305ad7405 | ||
|
|
78f5b7b288 | ||
|
|
1903c59163 | ||
|
|
b16c2d19b6 | ||
|
|
00bb1236ce | ||
|
|
82bbf4173b | ||
|
|
9f4ca279aa | ||
|
|
b890859025 | ||
|
|
56e4f4f5ac | ||
|
|
157bd3816d | ||
|
|
21588829c7 | ||
|
|
9689029c4b | ||
|
|
992d174b23 | ||
|
|
8886e95847 | ||
|
|
6d5762fac8 | ||
|
|
e9ab044e46 | ||
|
|
fda219d070 | ||
|
|
2be1aca2f3 | ||
|
|
1b318d6a30 | ||
|
|
22c4859d42 | ||
|
|
80a6361cf1 | ||
|
|
8439effeeb | ||
|
|
fafab95a07 | ||
|
|
24c8e8fc2b | ||
|
|
1923bf7dda | ||
|
|
2ee94a3a69 | ||
|
|
2fb3a3eff9 | ||
|
|
bcbbf4dc3e | ||
|
|
7dc793920f | ||
|
|
0b43eceb2d | ||
|
|
85f736139b | ||
|
|
98a6670cb4 | ||
|
|
a15be82f00 | ||
|
|
6c3809e1db | ||
|
|
33a2cd21a3 | ||
|
|
3eebce22e7 | ||
|
|
adae0625b9 | ||
|
|
5063cfb979 | ||
|
|
0835930a8a | ||
|
|
c9432990b7 | ||
|
|
9ad521822d | ||
|
|
824fb08511 | ||
|
|
cc4c15daf0 | ||
|
|
7718778013 | ||
|
|
a25260353d | ||
|
|
c1e8a4b384 | ||
|
|
3f2229d9e1 | ||
|
|
8561227622 | ||
|
|
8859e2ac40 | ||
|
|
7423b2f4fd | ||
|
|
d23e9f1bc4 | ||
|
|
516277a478 | ||
|
|
cbc7710d81 | ||
|
|
ea71e96f72 | ||
|
|
59d1cb1833 | ||
|
|
7c54ba63ce | ||
|
|
5892b5b851 | ||
|
|
02eb737b9d | ||
|
|
144e75da9e | ||
|
|
8d14a0d687 | ||
|
|
dec2c218f7 | ||
|
|
dd147a7209 | ||
|
|
c3fabcb666 | ||
|
|
35e825b376 | ||
|
|
334a38c493 | ||
|
|
8ec01c73cd | ||
|
|
0ef6634d41 | ||
|
|
f6fc24d11d | ||
|
|
ed24e32305 | ||
|
|
86df60bb74 | ||
|
|
42cf02e9a4 | ||
|
|
3add997b49 | ||
|
|
649862b01c | ||
|
|
f5228f87f0 | ||
|
|
76f3e87790 | ||
|
|
30c56cd8af | ||
|
|
16be0c1014 | ||
|
|
c82de8b6b2 | ||
|
|
d3f2b71803 | ||
|
|
f3955bcbdc | ||
|
|
90afb2a1ee | ||
|
|
2dae9b9621 | ||
|
|
521a9b0b2c | ||
|
|
2cfe9b3c03 | ||
|
|
45ee959c11 | ||
|
|
3bf8546d51 | ||
|
|
ca8b603bd9 | ||
|
|
faae11f070 | ||
|
|
b069436039 | ||
|
|
e828ef370d | ||
|
|
50a0400616 | ||
|
|
0226b1e9a8 | ||
|
|
135102d2b5 | ||
|
|
a17b8a053e | ||
|
|
fdc86bab50 | ||
|
|
f885388bf7 | ||
|
|
aa96b33bc2 | ||
|
|
e36d636f93 | ||
|
|
2e05cb1764 | ||
|
|
9404e27cba | ||
|
|
494ec0b051 | ||
|
|
36b575c286 | ||
|
|
d1992b061c | ||
|
|
a79aec85b5 | ||
|
|
76dce5197f | ||
|
|
5d80df398b | ||
|
|
a6f57d7761 | ||
|
|
a981df6282 | ||
|
|
ae8a2bfb1b | ||
|
|
15a2fe2570 | ||
|
|
8dadc7e518 | ||
|
|
c614bc3263 | ||
|
|
1e50d88166 | ||
|
|
c9cc2cb4f3 | ||
|
|
c8a5c71ec2 | ||
|
|
55356963dd | ||
|
|
0e867a995f | ||
|
|
3ca37b2f42 | ||
|
|
0c78fda531 | ||
|
|
7c60080772 | ||
|
|
bf5a31dcdb | ||
|
|
a5e38165ef | ||
|
|
fe6f19e611 | ||
|
|
576a07bcb7 | ||
|
|
4be7ac7ae1 | ||
|
|
a81b00e130 | ||
|
|
d4e27c1b76 | ||
|
|
be477f178b | ||
|
|
de95b92f90 | ||
|
|
89ed9027da | ||
|
|
1c0b55e422 | ||
|
|
10d089240a | ||
|
|
84b1f1f24e | ||
|
|
c8f59ea547 | ||
|
|
9d958e1860 | ||
|
|
ec06b940f4 | ||
|
|
f331172c7d | ||
|
|
650d9e0b27 | ||
|
|
ff1d312a43 | ||
|
|
a4acbf3aea | ||
|
|
242bea236f | ||
|
|
ca2f14a2d0 | ||
|
|
48a654630f | ||
|
|
cf5c1c1be1 | ||
|
|
0558c30b56 | ||
|
|
36c87b7fa0 | ||
|
|
d039a5f24e | ||
|
|
3e3d111d76 | ||
|
|
ecb485c8bc | ||
|
|
02ab59c9e0 | ||
|
|
8e4e0bd543 | ||
|
|
bbe0e9e425 | ||
|
|
24a3f814ed | ||
|
|
233a50dbb7 | ||
|
|
6d8f11d533 | ||
|
|
4e4beb26c6 | ||
|
|
1f092c2656 | ||
|
|
9622b046e0 | ||
|
|
f9abea83f3 | ||
|
|
b84542064c | ||
|
|
8ab2c924c4 | ||
|
|
4b9415a619 | ||
|
|
c11479de58 | ||
|
|
dddb02a286 | ||
|
|
fab4c59f9b | ||
|
|
b818f020a7 | ||
|
|
9888850c22 | ||
|
|
04209182c1 | ||
|
|
02c9dabcff | ||
|
|
c9d0b8cc40 | ||
|
|
3cb421143f | ||
|
|
fd9b79e115 | ||
|
|
53c4bb8a94 | ||
|
|
723fc42d88 | ||
|
|
1882b089ab | ||
|
|
ad7a6c4d79 | ||
|
|
48e0e797da | ||
|
|
fbb77d3e55 | ||
|
|
d1d8e54d20 | ||
|
|
f259c60b54 | ||
|
|
aa981d3cd4 | ||
|
|
f8118444f9 | ||
|
|
59da25ef55 | ||
|
|
61520bc3b3 | ||
|
|
5406b09f3a | ||
|
|
90f1bfb3e4 | ||
|
|
f30eec7737 | ||
|
|
493cd1a7e0 | ||
|
|
dfa1ab65c6 | ||
|
|
963ed32ce4 | ||
|
|
de4733e848 | ||
|
|
bfbc124e78 | ||
|
|
fcd87b3e2d | ||
|
|
7bee93bb73 | ||
|
|
c0c36d10e5 | ||
|
|
6e260ee563 | ||
|
|
b1075d956f | ||
|
|
4dd6352aec | ||
|
|
6fe8bde720 | ||
|
|
0556ab5e66 | ||
|
|
7060700225 | ||
|
|
385b79ad34 | ||
|
|
b8509c487d | ||
|
|
083dee9bdd | ||
|
|
0c2dd6aa35 | ||
|
|
743c15aacc | ||
|
|
263bff903c | ||
|
|
741dfaf2de | ||
|
|
e4e4f73638 | ||
|
|
85e4bd817b | ||
|
|
78ffac8232 | ||
|
|
b488adc330 | ||
|
|
a06bd877c9 | ||
|
|
b3834324f6 | ||
|
|
d351134b75 | ||
|
|
ea0835561c | ||
|
|
b0c0c5f56b | ||
|
|
849fad0421 | ||
|
|
eb28a3b0c9 | ||
|
|
5283b489dc | ||
|
|
d54f848572 | ||
|
|
1ac0c4f874 | ||
|
|
3850f52401 | ||
|
|
6d5f8e0562 | ||
|
|
04633bdf3a | ||
|
|
97219aa12e | ||
|
|
e825abf893 | ||
|
|
63b655cff4 | ||
|
|
0524942d11 | ||
|
|
b5d75f183a | ||
|
|
706fc647ff | ||
|
|
13e9f9f9e7 | ||
|
|
a76dcb44ae | ||
|
|
b9373806cf | ||
|
|
9de2927304 | ||
|
|
c3e1126489 | ||
|
|
3413c9ed64 | ||
|
|
dcebcb0e73 | ||
|
|
3d7a5f20e7 | ||
|
|
6a99af64a8 | ||
|
|
7d57961ab2 | ||
|
|
95a773e5c9 | ||
|
|
a912b2f23d | ||
|
|
36b581489c | ||
|
|
976684a3a8 | ||
|
|
093dfb4a39 | ||
|
|
ddf381f92d | ||
|
|
2b44f3bc76 | ||
|
|
7b1fdfabf8 | ||
|
|
070e8d9647 | ||
|
|
bf3360572a | ||
|
|
e5036318af | ||
|
|
6d2394a9da | ||
|
|
427a266c57 | ||
|
|
196264b8c2 | ||
|
|
afe24866f0 | ||
|
|
d18a20cc06 | ||
|
|
e94669de03 | ||
|
|
9c91b0459e | ||
|
|
b161db064e | ||
|
|
ec4abe0d81 | ||
|
|
af21dd4463 | ||
|
|
ef46727870 | ||
|
|
1ea0d283de | ||
|
|
ed380e09c9 | ||
|
|
b5daa83d69 | ||
|
|
c4b957427d | ||
|
|
2f3b256272 | ||
|
|
6e3d8472e1 | ||
|
|
2a9f36a027 | ||
|
|
cf3726289c | ||
|
|
c8e4a5c9e7 | ||
|
|
3851bedb57 | ||
|
|
a3951f1cce | ||
|
|
7c77ae758b | ||
|
|
20d3d61cec | ||
|
|
1b831f94a9 | ||
|
|
3f241553aa | ||
|
|
8624c83108 | ||
|
|
d49cae9cea | ||
|
|
174128447b | ||
|
|
5d213eea7e | ||
|
|
f45e25172b | ||
|
|
ec87856ef4 | ||
|
|
6feb7ad1d5 | ||
|
|
6833e84d55 | ||
|
|
154a575701 | ||
|
|
504b2e2c4a | ||
|
|
2c5292222f | ||
|
|
989da8877b | ||
|
|
70591eadd5 | ||
|
|
fead3cd7ad | ||
|
|
a7cf3cdf05 | ||
|
|
5372f71faa | ||
|
|
3b76939f17 | ||
|
|
c827d38f39 | ||
|
|
1e7586fae4 | ||
|
|
ee89111bfb | ||
|
|
288b3077b2 | ||
|
|
5c1922ac9f | ||
|
|
93f1d46104 | ||
|
|
c5daaf541a | ||
|
|
12b17b1e9e | ||
|
|
ad46ba7d0f | ||
|
|
44f592c6cb | ||
|
|
943b35fb7d | ||
|
|
f1967fd466 | ||
|
|
ce2404b18a | ||
|
|
cdd53a39f1 | ||
|
|
c646019536 | ||
|
|
c8049f0efe | ||
|
|
f2c497049b | ||
|
|
d713274ae2 | ||
|
|
a72eeb9a98 | ||
|
|
41cdd5c640 | ||
|
|
4cde65d171 | ||
|
|
27659805f6 | ||
|
|
8ab081a3fd | ||
|
|
ccbb2e2e12 | ||
|
|
2bf2ec5a6c | ||
|
|
4329675c60 | ||
|
|
412b0377e9 | ||
|
|
69e48ff4d7 | ||
|
|
4cacd1dfa2 | ||
|
|
0c8ad1b46e | ||
|
|
d3ac7b0939 | ||
|
|
e0306d4ad7 | ||
|
|
1f3d726048 | ||
|
|
f3ed7e936d | ||
|
|
547ad7221d | ||
|
|
97a258c0c6 | ||
|
|
19a154c2f4 | ||
|
|
b389ec5ea3 | ||
|
|
412375e92f | ||
|
|
4b96ada781 | ||
|
|
87b16f3325 | ||
|
|
0a0663be69 | ||
|
|
7eed076674 | ||
|
|
b5143c152b | ||
|
|
6ef8a4c018 | ||
|
|
ebd26f85bd | ||
|
|
fbfb7b3b30 | ||
|
|
cfb313b60e | ||
|
|
54e37dea20 | ||
|
|
5b14358620 | ||
|
|
c4669cbaa3 | ||
|
|
74b41c9911 | ||
|
|
d08a36174d | ||
|
|
e845b80e10 | ||
|
|
b0303ef529 | ||
|
|
68f67ec6ee | ||
|
|
20ae67f510 | ||
|
|
237749e4af | ||
|
|
15f4782947 | ||
|
|
d48efd1925 | ||
|
|
883d726622 | ||
|
|
0a0cac5f41 | ||
|
|
012a18be00 | ||
|
|
890c00d4ba | ||
|
|
bb43014230 | ||
|
|
53a995fecb | ||
|
|
8d3262d232 | ||
|
|
373ec4ac50 | ||
|
|
3fdecee95f | ||
|
|
86b9f5a8b0 | ||
|
|
873b60b00d | ||
|
|
fc58086f6e | ||
|
|
40cec31099 | ||
|
|
33733d3ab7 | ||
|
|
f08bf0be15 | ||
|
|
296cb7236f | ||
|
|
d614967d62 | ||
|
|
35648b9f37 | ||
|
|
494a980ecb | ||
|
|
810aa8c2fb | ||
|
|
027b3eaed8 | ||
|
|
dedc1e708f | ||
|
|
79956b5676 | ||
|
|
48b1aece4d | ||
|
|
eee75bd2e8 | ||
|
|
29828f8e8f | ||
|
|
ced02b42b5 | ||
|
|
3fe9218ea8 | ||
|
|
ff5ea8b311 | ||
|
|
32fae5e9e8 | ||
|
|
48b4488a58 | ||
|
|
aead6a44de | ||
|
|
f59f08fa0e | ||
|
|
119d7367da | ||
|
|
ddb99a0917 | ||
|
|
ecfba95841 | ||
|
|
597eb5a300 | ||
|
|
f3e7e6bbe7 | ||
|
|
722380e7b8 | ||
|
|
8c46e96397 | ||
|
|
f22cc37df7 | ||
|
|
dd1fc23fe8 | ||
|
|
f9f4148e8c | ||
|
|
2178f82324 | ||
|
|
79d779dee8 | ||
|
|
93c0469aa0 | ||
|
|
81d10fa605 | ||
|
|
75ef766649 | ||
|
|
fab8b77794 | ||
|
|
8b030a2323 | ||
|
|
14c420b782 | ||
|
|
637547a3fa | ||
|
|
c39c1baa4d | ||
|
|
b9edd0ecc7 | ||
|
|
2dec8f1ad6 | ||
|
|
bd97df5ee9 | ||
|
|
8a501521e8 | ||
|
|
be68391c37 | ||
|
|
89d4be504d | ||
|
|
0a2acbe4be | ||
|
|
a7a42ff4af | ||
|
|
bacf163c96 | ||
|
|
db7e083a21 | ||
|
|
8eaf44735a | ||
|
|
bfc61f8b36 | ||
|
|
4ea27e604f | ||
|
|
aef0e552a0 | ||
|
|
d36bff2a97 | ||
|
|
61696f0287 | ||
|
|
9a97fe09ee | ||
|
|
b1d0cef33b | ||
|
|
7f0c92c56b | ||
|
|
b21568806a | ||
|
|
80fb89b794 | ||
|
|
47d28b4eef | ||
|
|
a9762c5139 | ||
|
|
32439ed006 | ||
|
|
ff41904d72 | ||
|
|
39093cbc4c | ||
|
|
c7b5784123 | ||
|
|
3e22804a76 | ||
|
|
7ce98b0b28 | ||
|
|
0d11cadc18 | ||
|
|
63ab82a076 | ||
|
|
7e03f14e01 | ||
|
|
c9183f8bd4 | ||
|
|
bc2d1f1ef9 | ||
|
|
e7c053d273 | ||
|
|
3ccf553fda | ||
|
|
6d2eb7b187 | ||
|
|
7234324112 | ||
|
|
8205cdc288 | ||
|
|
29931bbddf | ||
|
|
68cd4c9a31 | ||
|
|
f4b986e1c1 | ||
|
|
c0496ebef3 | ||
|
|
6aa30a4c74 | ||
|
|
3035a948b9 | ||
|
|
7880cf62fe | ||
|
|
ff76ba7d1b | ||
|
|
06be593fe4 | ||
|
|
91e3eb8ae7 | ||
|
|
f7dd3558a7 | ||
|
|
eac5ec6e26 | ||
|
|
f273b4334e | ||
|
|
15eaf67189 | ||
|
|
983d9c4319 | ||
|
|
a88a00b60e | ||
|
|
a44f43b133 | ||
|
|
69677b15fe | ||
|
|
2573c3b8a6 | ||
|
|
0b0e9f2953 | ||
|
|
1990c9399e | ||
|
|
151641b659 | ||
|
|
36c6376220 | ||
|
|
f0e22b70f6 | ||
|
|
225e893461 | ||
|
|
064a11d872 | ||
|
|
3760835608 | ||
|
|
e7ac2ec4ed | ||
|
|
8da8dfc543 | ||
|
|
6b3c8b4bac | ||
|
|
25fe78012f | ||
|
|
147d79c65c | ||
|
|
6fddd2bd62 | ||
|
|
77c9b64dc7 | ||
|
|
47cb7c7f5e | ||
|
|
1bd769827d | ||
|
|
288ec88c2f | ||
|
|
71916b5e28 | ||
|
|
b2d4330692 | ||
|
|
253a6ef081 | ||
|
|
e1e020c1a4 | ||
|
|
2b4413a1bd | ||
|
|
dae674a7cd | ||
|
|
751bf94758 | ||
|
|
4b934a4a81 | ||
|
|
7e374e795b | ||
|
|
be378f71b0 | ||
|
|
27f74489fd | ||
|
|
ae8f4ffbbe | ||
|
|
896776516b | ||
|
|
a27525af9e | ||
|
|
83b4382787 | ||
|
|
ef1b32d586 | ||
|
|
fe3a0bc756 | ||
|
|
2259e1d44d | ||
|
|
9ca4a016eb | ||
|
|
2978a262f7 | ||
|
|
f47f3461e6 | ||
|
|
06202c31e4 | ||
|
|
925dc258a6 | ||
|
|
3670800a51 | ||
|
|
90a331b989 | ||
|
|
a4c8bdeda2 | ||
|
|
5bda254184 | ||
|
|
26621c0318 | ||
|
|
c6806256fd | ||
|
|
f00e1235f9 | ||
|
|
51bede6541 | ||
|
|
75dbaa4b77 | ||
|
|
bec6576620 | ||
|
|
44551e0e8c | ||
|
|
67553cb40e | ||
|
|
7cafbda7cd | ||
|
|
9a5a085103 | ||
|
|
cdb17ae937 | ||
|
|
c240fb9896 | ||
|
|
4b41eddf44 | ||
|
|
b51ac112a2 | ||
|
|
a1ac609b34 | ||
|
|
66e2a12f3d | ||
|
|
9f69294f7f | ||
|
|
a5fc8d5329 | ||
|
|
7bbf797caf | ||
|
|
f479c0e10e | ||
|
|
0f32154b91 | ||
|
|
f2019ee5f9 | ||
|
|
89b8e2bb08 | ||
|
|
8fb6edad67 | ||
|
|
c2e3a3fe04 | ||
|
|
b2052a6ccd | ||
|
|
a07479cd5a | ||
|
|
3820384f51 | ||
|
|
0610576e5a | ||
|
|
905eb303bc | ||
|
|
3c56d29fca | ||
|
|
946dae72d9 | ||
|
|
58f71c7300 | ||
|
|
07e9013152 | ||
|
|
29c60581a6 | ||
|
|
4bdcf32475 | ||
|
|
44c742e839 | ||
|
|
001bd1d004 | ||
|
|
6c7e2f0aa1 | ||
|
|
9fc5d328b4 | ||
|
|
f6413d095c | ||
|
|
d66ad4319e | ||
|
|
251fcaeb48 | ||
|
|
3311c6336c | ||
|
|
fc13e1fa6a | ||
|
|
9ca680f842 | ||
|
|
616829464f | ||
|
|
0267468cd5 | ||
|
|
ca0d17d93a | ||
|
|
3f656ea76f | ||
|
|
1faf2c6ecd | ||
|
|
33f2aaa650 | ||
|
|
177caec011 | ||
|
|
62650a4545 | ||
|
|
81dc907afc | ||
|
|
3ee33e1024 | ||
|
|
2326eb85f1 | ||
|
|
0885e60b80 | ||
|
|
ef40c66344 | ||
|
|
0d0464549f | ||
|
|
b68b0fe783 | ||
|
|
1c41d459f0 | ||
|
|
f65fefe7b1 | ||
|
|
0a906b5663 | ||
|
|
dd9b7bbbb5 | ||
|
|
d25a1e3ed9 | ||
|
|
05374becfd | ||
|
|
fd0bd5dd00 | ||
|
|
cd6d4fb527 | ||
|
|
8ed6851e85 | ||
|
|
a6fd3bfb00 | ||
|
|
610dd8a783 | ||
|
|
ec384fafce |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ yarn-error.log
|
|||||||
config.ini
|
config.ini
|
||||||
cert.key
|
cert.key
|
||||||
cert.crt
|
cert.crt
|
||||||
|
server-package.json
|
||||||
15
.gitpod.dockerfile
Normal file
15
.gitpod.dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM gitpod/workspace-full
|
||||||
|
|
||||||
|
RUN sudo apt-get update \
|
||||||
|
&& sudo apt-get install -yq --no-install-recommends \
|
||||||
|
libpng16-16 \
|
||||||
|
libpng-dev \
|
||||||
|
pkg-config \
|
||||||
|
autoconf \
|
||||||
|
libtool \
|
||||||
|
build-essential \
|
||||||
|
nasm \
|
||||||
|
libx11-dev \
|
||||||
|
libxkbfile-dev \
|
||||||
|
&& sudo rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
|
image:
|
||||||
|
file: .gitpod.dockerfile
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- before: nvm install 10 && nvm use 10
|
- before: nvm install 10 && nvm use 10
|
||||||
init: npm install
|
init: npm install
|
||||||
command: npm run start
|
command: npm run start-server
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- port: 8080
|
- port: 8080
|
||||||
onOpen: open-preview
|
onOpen: open-preview
|
||||||
5
.idea/.gitignore
generated
vendored
Normal file
5
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/workspace.xml
|
||||||
|
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources.local.xml
|
||||||
3
.idea/codeStyles/Project.xml
generated
3
.idea/codeStyles/Project.xml
generated
@@ -6,5 +6,8 @@
|
|||||||
<option name="TAB_SIZE" value="2" />
|
<option name="TAB_SIZE" value="2" />
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
|
<JSCodeStyleSettings version="0">
|
||||||
|
<option name="USE_EXPLICIT_JS_EXTENSION" value="TRUE" />
|
||||||
|
</JSCodeStyleSettings>
|
||||||
</code_scheme>
|
</code_scheme>
|
||||||
</component>
|
</component>
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<dataSource name="document.db">
|
<dataSource name="document.db">
|
||||||
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.14">
|
<database-model serializer="dbm" dbms="SQLITE" family-id="SQLITE" format-version="4.17">
|
||||||
<root id="1">
|
<root id="1">
|
||||||
<ServerVersion>3.16.1</ServerVersion>
|
<ServerVersion>3.16.1</ServerVersion>
|
||||||
</root>
|
</root>
|
||||||
<schema id="2" parent="1" name="main">
|
<schema id="2" parent="1" name="main">
|
||||||
<Current>1</Current>
|
<Current>1</Current>
|
||||||
<Visible>1</Visible>
|
|
||||||
</schema>
|
</schema>
|
||||||
<collation id="3" parent="1" name="BINARY"/>
|
<collation id="3" parent="1" name="BINARY"/>
|
||||||
<collation id="4" parent="1" name="NOCASE"/>
|
<collation id="4" parent="1" name="NOCASE"/>
|
||||||
@@ -14,664 +13,627 @@
|
|||||||
<table id="6" parent="2" name="api_tokens"/>
|
<table id="6" parent="2" name="api_tokens"/>
|
||||||
<table id="7" parent="2" name="attributes"/>
|
<table id="7" parent="2" name="attributes"/>
|
||||||
<table id="8" parent="2" name="branches"/>
|
<table id="8" parent="2" name="branches"/>
|
||||||
<table id="9" parent="2" name="event_log"/>
|
<table id="9" parent="2" name="note_contents"/>
|
||||||
<table id="10" parent="2" name="links"/>
|
<table id="10" parent="2" name="note_revision_contents"/>
|
||||||
<table id="11" parent="2" name="note_contents"/>
|
<table id="11" parent="2" name="note_revisions"/>
|
||||||
<table id="12" parent="2" name="note_revisions"/>
|
<table id="12" parent="2" name="notes"/>
|
||||||
<table id="13" parent="2" name="notes"/>
|
<table id="13" parent="2" name="options"/>
|
||||||
<table id="14" parent="2" name="options"/>
|
<table id="14" parent="2" name="recent_notes"/>
|
||||||
<table id="15" parent="2" name="recent_notes"/>
|
<table id="15" parent="2" name="source_ids"/>
|
||||||
<table id="16" parent="2" name="source_ids"/>
|
<table id="16" parent="2" name="sqlite_master">
|
||||||
<table id="17" parent="2" name="sqlite_master">
|
|
||||||
<System>1</System>
|
<System>1</System>
|
||||||
</table>
|
</table>
|
||||||
<table id="18" parent="2" name="sqlite_sequence">
|
<table id="17" parent="2" name="sqlite_sequence">
|
||||||
<System>1</System>
|
<System>1</System>
|
||||||
</table>
|
</table>
|
||||||
<table id="19" parent="2" name="sync"/>
|
<table id="18" parent="2" name="sync"/>
|
||||||
<column id="20" parent="6" name="apiTokenId">
|
<column id="19" parent="6" name="apiTokenId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="21" parent="6" name="token">
|
<column id="20" parent="6" name="token">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="22" parent="6" name="dateCreated">
|
<column id="21" parent="6" name="utcDateCreated">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="23" parent="6" name="isDeleted">
|
<column id="22" parent="6" name="isDeleted">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="24" parent="6" name="hash">
|
<column id="23" parent="6" name="hash">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<index id="25" parent="6" name="sqlite_autoindex_api_tokens_1">
|
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>apiTokenId</ColNames>
|
<ColNames>apiTokenId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="26" parent="6">
|
<key id="25" parent="6">
|
||||||
<ColNames>apiTokenId</ColNames>
|
<ColNames>apiTokenId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_api_tokens_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_api_tokens_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="27" parent="7" name="attributeId">
|
<column id="26" parent="7" name="attributeId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="28" parent="7" name="noteId">
|
<column id="27" parent="7" name="noteId">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="29" parent="7" name="type">
|
<column id="28" parent="7" name="type">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="30" parent="7" name="name">
|
<column id="29" parent="7" name="name">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="31" parent="7" name="value">
|
<column id="30" parent="7" name="value">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
<DefaultExpression>''</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="32" parent="7" name="position">
|
<column id="31" parent="7" name="position">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="33" parent="7" name="dateCreated">
|
<column id="32" parent="7" name="utcDateCreated">
|
||||||
<Position>7</Position>
|
<Position>7</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="34" parent="7" name="dateModified">
|
<column id="33" parent="7" name="utcDateModified">
|
||||||
<Position>8</Position>
|
<Position>8</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="35" parent="7" name="isDeleted">
|
<column id="34" parent="7" name="isDeleted">
|
||||||
<Position>9</Position>
|
<Position>9</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="36" parent="7" name="hash">
|
<column id="35" parent="7" name="hash">
|
||||||
<Position>10</Position>
|
<Position>10</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="37" parent="7" name="isInheritable">
|
<column id="36" parent="7" name="isInheritable">
|
||||||
<Position>11</Position>
|
<Position>11</Position>
|
||||||
<DataType>int|0s</DataType>
|
<DataType>int|0s</DataType>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<index id="38" parent="7" name="sqlite_autoindex_attributes_1">
|
<index id="37" parent="7" name="sqlite_autoindex_attributes_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>attributeId</ColNames>
|
<ColNames>attributeId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="39" parent="7" name="IDX_attributes_noteId_index">
|
<index id="38" parent="7" name="IDX_attributes_noteId_index">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<index id="40" parent="7" name="IDX_attributes_name_value">
|
<index id="39" parent="7" name="IDX_attributes_name_value">
|
||||||
<ColNames>name
|
<ColNames>name
|
||||||
value</ColNames>
|
value</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<index id="41" parent="7" name="IDX_attributes_name_index">
|
<index id="40" parent="7" name="IDX_attributes_value_index">
|
||||||
<ColNames>name</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
|
||||||
<index id="42" parent="7" name="IDX_attributes_value_index">
|
|
||||||
<ColNames>value</ColNames>
|
<ColNames>value</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<key id="43" parent="7">
|
<key id="41" parent="7">
|
||||||
<ColNames>attributeId</ColNames>
|
<ColNames>attributeId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_attributes_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="44" parent="8" name="branchId">
|
<column id="42" parent="8" name="branchId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="45" parent="8" name="noteId">
|
<column id="43" parent="8" name="noteId">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="46" parent="8" name="parentNoteId">
|
<column id="44" parent="8" name="parentNoteId">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="47" parent="8" name="notePosition">
|
<column id="45" parent="8" name="notePosition">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="48" parent="8" name="prefix">
|
<column id="46" parent="8" name="prefix">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="49" parent="8" name="isExpanded">
|
<column id="47" parent="8" name="isExpanded">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>BOOLEAN|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
|
<NotNull>1</NotNull>
|
||||||
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="50" parent="8" name="isDeleted">
|
<column id="48" parent="8" name="isDeleted">
|
||||||
<Position>7</Position>
|
<Position>7</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="51" parent="8" name="dateModified">
|
<column id="49" parent="8" name="utcDateModified">
|
||||||
<Position>8</Position>
|
<Position>8</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="52" parent="8" name="hash">
|
<column id="50" parent="8" name="utcDateCreated">
|
||||||
<Position>9</Position>
|
<Position>9</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
|
</column>
|
||||||
|
<column id="51" parent="8" name="hash">
|
||||||
|
<Position>10</Position>
|
||||||
|
<DataType>TEXT|0s</DataType>
|
||||||
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="53" parent="8" name="dateCreated">
|
<index id="52" parent="8" name="sqlite_autoindex_branches_1">
|
||||||
<Position>10</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
<DefaultExpression>'1970-01-01T00:00:00.000Z'</DefaultExpression>
|
|
||||||
</column>
|
|
||||||
<index id="54" parent="8" name="sqlite_autoindex_branches_1">
|
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>branchId</ColNames>
|
<ColNames>branchId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="55" parent="8" name="IDX_branches_noteId_parentNoteId">
|
<index id="53" parent="8" name="IDX_branches_noteId_parentNoteId">
|
||||||
<ColNames>noteId
|
<ColNames>noteId
|
||||||
parentNoteId</ColNames>
|
parentNoteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<index id="56" parent="8" name="IDX_branches_noteId">
|
<index id="54" parent="8" name="IDX_branches_parentNoteId">
|
||||||
<ColNames>noteId</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
|
||||||
<index id="57" parent="8" name="IDX_branches_parentNoteId">
|
|
||||||
<ColNames>parentNoteId</ColNames>
|
<ColNames>parentNoteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<key id="58" parent="8">
|
<key id="55" parent="8">
|
||||||
<ColNames>branchId</ColNames>
|
<ColNames>branchId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_branches_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="59" parent="9" name="eventId">
|
<column id="56" parent="9" name="noteId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="60" parent="9" name="noteId">
|
<column id="57" parent="9" name="content">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
|
||||||
<column id="61" parent="9" name="comment">
|
|
||||||
<Position>3</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
</column>
|
|
||||||
<column id="62" parent="9" name="dateCreated">
|
|
||||||
<Position>4</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<index id="63" parent="9" name="sqlite_autoindex_event_log_1">
|
|
||||||
<NameSurrogate>1</NameSurrogate>
|
|
||||||
<ColNames>eventId</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
|
||||||
</index>
|
|
||||||
<key id="64" parent="9">
|
|
||||||
<ColNames>eventId</ColNames>
|
|
||||||
<Primary>1</Primary>
|
|
||||||
<UnderlyingIndexName>sqlite_autoindex_event_log_1</UnderlyingIndexName>
|
|
||||||
</key>
|
|
||||||
<column id="65" parent="10" name="linkId">
|
|
||||||
<Position>1</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="66" parent="10" name="noteId">
|
|
||||||
<Position>2</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="67" parent="10" name="targetNoteId">
|
|
||||||
<Position>3</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="68" parent="10" name="type">
|
|
||||||
<Position>4</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="69" parent="10" name="hash">
|
|
||||||
<Position>5</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
<DefaultExpression>""</DefaultExpression>
|
|
||||||
</column>
|
|
||||||
<column id="70" parent="10" name="isDeleted">
|
|
||||||
<Position>6</Position>
|
|
||||||
<DataType>INTEGER|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
<DefaultExpression>0</DefaultExpression>
|
|
||||||
</column>
|
|
||||||
<column id="71" parent="10" name="dateCreated">
|
|
||||||
<Position>7</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="72" parent="10" name="dateModified">
|
|
||||||
<Position>8</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<index id="73" parent="10" name="sqlite_autoindex_links_1">
|
|
||||||
<NameSurrogate>1</NameSurrogate>
|
|
||||||
<ColNames>linkId</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
|
||||||
</index>
|
|
||||||
<index id="74" parent="10" name="IDX_links_noteId_index">
|
|
||||||
<ColNames>noteId</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
|
||||||
<index id="75" parent="10" name="IDX_links_targetNoteId_index">
|
|
||||||
<ColNames>targetNoteId</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
|
||||||
<key id="76" parent="10">
|
|
||||||
<ColNames>linkId</ColNames>
|
|
||||||
<Primary>1</Primary>
|
|
||||||
<UnderlyingIndexName>sqlite_autoindex_links_1</UnderlyingIndexName>
|
|
||||||
</key>
|
|
||||||
<column id="77" parent="11" name="noteContentId">
|
|
||||||
<Position>1</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="78" parent="11" name="noteId">
|
|
||||||
<Position>2</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="79" parent="11" name="isProtected">
|
|
||||||
<Position>3</Position>
|
|
||||||
<DataType>INT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
<DefaultExpression>0</DefaultExpression>
|
|
||||||
</column>
|
|
||||||
<column id="80" parent="11" name="content">
|
|
||||||
<Position>4</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<DefaultExpression>NULL</DefaultExpression>
|
<DefaultExpression>NULL</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="81" parent="11" name="hash">
|
<column id="58" parent="9" name="hash">
|
||||||
<Position>5</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="82" parent="11" name="dateCreated">
|
<column id="59" parent="9" name="utcDateModified">
|
||||||
<Position>6</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>'2018-05-08T23:41:15.225Z'</DefaultExpression>
|
|
||||||
</column>
|
</column>
|
||||||
<column id="83" parent="11" name="dateModified">
|
<index id="60" parent="9" name="sqlite_autoindex_note_contents_1">
|
||||||
<Position>7</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
<DefaultExpression>'2018-05-08T23:41:15.225Z'</DefaultExpression>
|
|
||||||
</column>
|
|
||||||
<index id="84" parent="11" name="sqlite_autoindex_note_contents_1">
|
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteContentId</ColNames>
|
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
|
||||||
</index>
|
|
||||||
<index id="85" parent="11" name="IDX_note_contents_noteId">
|
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="86" parent="11">
|
<key id="61" parent="9">
|
||||||
<ColNames>noteContentId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_note_contents_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="87" parent="12" name="noteRevisionId">
|
<column id="62" parent="10" name="noteRevisionId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="88" parent="12" name="noteId">
|
<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>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="89" parent="12" name="title">
|
<column id="70" parent="11" name="title">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="90" parent="12" name="content">
|
<column id="71" parent="11" name="contentLength">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="91" parent="12" name="isProtected">
|
<column id="72" parent="11" name="isErased">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="92" parent="12" name="dateModifiedFrom">
|
<column id="73" parent="11" name="isProtected">
|
||||||
<Position>6</Position>
|
<Position>6</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="93" parent="12" name="dateModifiedTo">
|
<column id="74" parent="11" name="utcDateLastEdited">
|
||||||
<Position>7</Position>
|
<Position>7</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="94" parent="12" name="type">
|
<column id="75" parent="11" name="utcDateCreated">
|
||||||
<Position>8</Position>
|
<Position>8</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
|
||||||
</column>
|
</column>
|
||||||
<column id="95" parent="12" name="mime">
|
<column id="76" parent="11" name="utcDateModified">
|
||||||
<Position>9</Position>
|
<Position>9</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>''</DefaultExpression>
|
|
||||||
</column>
|
</column>
|
||||||
<column id="96" parent="12" name="hash">
|
<column id="77" parent="11" name="dateLastEdited">
|
||||||
<Position>10</Position>
|
<Position>10</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
|
||||||
</column>
|
</column>
|
||||||
<index id="97" parent="12" name="sqlite_autoindex_note_revisions_1">
|
<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>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteRevisionId</ColNames>
|
<ColNames>noteRevisionId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="98" parent="12" name="IDX_note_revisions_noteId">
|
<index id="83" parent="11" name="IDX_note_revisions_noteId">
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<index id="99" parent="12" name="IDX_note_revisions_dateModifiedFrom">
|
<index id="84" parent="11" name="IDX_note_revisions_utcDateLastEdited">
|
||||||
<ColNames>dateModifiedFrom</ColNames>
|
<ColNames>utcDateLastEdited</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<index id="100" parent="12" name="IDX_note_revisions_dateModifiedTo">
|
<index id="85" parent="11" name="IDX_note_revisions_utcDateCreated">
|
||||||
<ColNames>dateModifiedTo</ColNames>
|
<ColNames>utcDateCreated</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<key id="101" parent="12">
|
<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>
|
<ColNames>noteRevisionId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_note_revisions_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="102" parent="13" name="noteId">
|
<column id="89" parent="12" name="noteId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="103" parent="13" name="title">
|
<column id="90" parent="12" name="title">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>"note"</DefaultExpression>
|
<DefaultExpression>"note"</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="104" parent="13" name="isProtected">
|
<column id="91" parent="12" name="contentLength">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
|
</column>
|
||||||
|
<column id="92" parent="12" name="isProtected">
|
||||||
|
<Position>4</Position>
|
||||||
|
<DataType>INT|0s</DataType>
|
||||||
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="105" parent="13" name="type">
|
<column id="93" parent="12" name="type">
|
||||||
<Position>4</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>'text'</DefaultExpression>
|
<DefaultExpression>'text'</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="106" parent="13" name="mime">
|
<column id="94" parent="12" name="mime">
|
||||||
<Position>5</Position>
|
<Position>6</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>'text/html'</DefaultExpression>
|
<DefaultExpression>'text/html'</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="107" parent="13" name="hash">
|
<column id="95" parent="12" name="hash">
|
||||||
<Position>6</Position>
|
<Position>7</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="108" parent="13" name="isDeleted">
|
<column id="96" parent="12" name="isDeleted">
|
||||||
<Position>7</Position>
|
<Position>8</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="109" parent="13" name="dateCreated">
|
<column id="97" parent="12" name="isErased">
|
||||||
<Position>8</Position>
|
|
||||||
<DataType>TEXT|0s</DataType>
|
|
||||||
<NotNull>1</NotNull>
|
|
||||||
</column>
|
|
||||||
<column id="110" parent="13" name="dateModified">
|
|
||||||
<Position>9</Position>
|
<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>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="111" parent="13" name="sqlite_autoindex_notes_1">
|
<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>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>noteId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="112" parent="13">
|
<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>
|
<ColNames>noteId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_notes_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="113" parent="14" name="name">
|
<column id="111" parent="13" name="name">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="114" parent="14" name="value">
|
<column id="112" parent="13" name="value">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="115" parent="14" name="dateModified">
|
<column id="113" parent="13" name="isSynced">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>INT|0s</DataType>
|
|
||||||
</column>
|
|
||||||
<column id="116" parent="14" name="isSynced">
|
|
||||||
<Position>4</Position>
|
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>0</DefaultExpression>
|
<DefaultExpression>0</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="117" parent="14" name="hash">
|
<column id="114" parent="13" name="hash">
|
||||||
<Position>5</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="118" parent="14" name="dateCreated">
|
<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>
|
<Position>6</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>'1970-01-01T00:00:00.000Z'</DefaultExpression>
|
|
||||||
</column>
|
</column>
|
||||||
<index id="119" parent="14" name="sqlite_autoindex_options_1">
|
<index id="117" parent="13" name="sqlite_autoindex_options_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>name</ColNames>
|
<ColNames>name</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="120" parent="14">
|
<key id="118" parent="13">
|
||||||
<ColNames>name</ColNames>
|
<ColNames>name</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_options_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="121" parent="15" name="branchId">
|
<column id="119" parent="14" name="noteId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="122" parent="15" name="notePath">
|
<column id="120" parent="14" name="notePath">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="123" parent="15" name="hash">
|
<column id="121" parent="14" name="hash">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<DefaultExpression>""</DefaultExpression>
|
<DefaultExpression>""</DefaultExpression>
|
||||||
</column>
|
</column>
|
||||||
<column id="124" parent="15" name="dateCreated">
|
<column id="122" parent="14" name="utcDateCreated">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="125" parent="15" name="isDeleted">
|
<column id="123" parent="14" name="isDeleted">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>INT|0s</DataType>
|
<DataType>INT|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<index id="126" parent="15" name="sqlite_autoindex_recent_notes_1">
|
<index id="124" parent="14" name="sqlite_autoindex_recent_notes_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>branchId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="127" parent="15">
|
<key id="125" parent="14">
|
||||||
<ColNames>branchId</ColNames>
|
<ColNames>noteId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_recent_notes_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="128" parent="16" name="sourceId">
|
<column id="126" parent="15" name="sourceId">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="129" parent="16" name="dateCreated">
|
<column id="127" parent="15" name="utcDateCreated">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="130" parent="16" name="sqlite_autoindex_source_ids_1">
|
<index id="128" parent="15" name="sqlite_autoindex_source_ids_1">
|
||||||
<NameSurrogate>1</NameSurrogate>
|
<NameSurrogate>1</NameSurrogate>
|
||||||
<ColNames>sourceId</ColNames>
|
<ColNames>sourceId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<key id="131" parent="16">
|
<index id="129" parent="15" name="IDX_source_ids_utcDateCreated">
|
||||||
|
<ColNames>utcDateCreated</ColNames>
|
||||||
|
</index>
|
||||||
|
<key id="130" parent="15">
|
||||||
<ColNames>sourceId</ColNames>
|
<ColNames>sourceId</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
|
<UnderlyingIndexName>sqlite_autoindex_source_ids_1</UnderlyingIndexName>
|
||||||
</key>
|
</key>
|
||||||
<column id="132" parent="17" name="type">
|
<column id="131" parent="16" name="type">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="133" parent="17" name="name">
|
<column id="132" parent="16" name="name">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="134" parent="17" name="tbl_name">
|
<column id="133" parent="16" name="tbl_name">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="135" parent="17" name="rootpage">
|
<column id="134" parent="16" name="rootpage">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>integer|0s</DataType>
|
<DataType>integer|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="136" parent="17" name="sql">
|
<column id="135" parent="16" name="sql">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>text|0s</DataType>
|
<DataType>text|0s</DataType>
|
||||||
</column>
|
</column>
|
||||||
<column id="137" parent="18" name="name">
|
<column id="136" parent="17" name="name">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
</column>
|
</column>
|
||||||
<column id="138" parent="18" name="seq">
|
<column id="137" parent="17" name="seq">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
</column>
|
</column>
|
||||||
<column id="139" parent="19" name="id">
|
<column id="138" parent="18" name="id">
|
||||||
<Position>1</Position>
|
<Position>1</Position>
|
||||||
<DataType>INTEGER|0s</DataType>
|
<DataType>INTEGER|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
<SequenceIdentity>1</SequenceIdentity>
|
<SequenceIdentity>1</SequenceIdentity>
|
||||||
</column>
|
</column>
|
||||||
<column id="140" parent="19" name="entityName">
|
<column id="139" parent="18" name="entityName">
|
||||||
<Position>2</Position>
|
<Position>2</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="141" parent="19" name="entityId">
|
<column id="140" parent="18" name="entityId">
|
||||||
<Position>3</Position>
|
<Position>3</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="142" parent="19" name="sourceId">
|
<column id="141" parent="18" name="sourceId">
|
||||||
<Position>4</Position>
|
<Position>4</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<column id="143" parent="19" name="syncDate">
|
<column id="142" parent="18" name="utcSyncDate">
|
||||||
<Position>5</Position>
|
<Position>5</Position>
|
||||||
<DataType>TEXT|0s</DataType>
|
<DataType>TEXT|0s</DataType>
|
||||||
<NotNull>1</NotNull>
|
<NotNull>1</NotNull>
|
||||||
</column>
|
</column>
|
||||||
<index id="144" parent="19" name="IDX_sync_entityName_entityId">
|
<index id="143" parent="18" name="IDX_sync_entityName_entityId">
|
||||||
<ColNames>entityName
|
<ColNames>entityName
|
||||||
entityId</ColNames>
|
entityId</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
<Unique>1</Unique>
|
<Unique>1</Unique>
|
||||||
</index>
|
</index>
|
||||||
<index id="145" parent="19" name="IDX_sync_syncDate">
|
<index id="144" parent="18" name="IDX_sync_utcSyncDate">
|
||||||
<ColNames>syncDate</ColNames>
|
<ColNames>utcSyncDate</ColNames>
|
||||||
<ColumnCollations></ColumnCollations>
|
|
||||||
</index>
|
</index>
|
||||||
<key id="146" parent="19">
|
<key id="145" parent="18">
|
||||||
<ColNames>id</ColNames>
|
<ColNames>id</ColNames>
|
||||||
<Primary>1</Primary>
|
<Primary>1</Primary>
|
||||||
</key>
|
</key>
|
||||||
|
|||||||
6
.idea/jsLibraryMappings.xml
generated
Normal file
6
.idea/jsLibraryMappings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<file url="PROJECT" libraries="{@types/jquery}" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
FROM node:10.15.0-alpine
|
FROM node:12.14.0-alpine
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Copy both package.json and package-lock.json
|
COPY server-package.json package.json
|
||||||
# where available (npm@5+)
|
|
||||||
COPY package.json package-lock.json ./
|
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
@@ -18,6 +16,7 @@ RUN set -x \
|
|||||||
make \
|
make \
|
||||||
nasm \
|
nasm \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
|
python \
|
||||||
&& npm install --production \
|
&& npm install --production \
|
||||||
&& apk del .build-dependencies
|
&& apk del .build-dependencies
|
||||||
|
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -15,16 +15,17 @@ Trilium Notes is a hierarchical note taking application with focus on building l
|
|||||||
* Note [attributes](https://github.com/zadam/trilium/wiki/Attributes) can be used for note organization, querying and advanced [scripting](https://github.com/zadam/trilium/wiki/Scripts)
|
* Note [attributes](https://github.com/zadam/trilium/wiki/Attributes) can be used for note organization, querying and advanced [scripting](https://github.com/zadam/trilium/wiki/Scripts)
|
||||||
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization) with self-hosted sync server
|
* [Synchronization](https://github.com/zadam/trilium/wiki/Synchronization) with self-hosted sync server
|
||||||
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes) with per-note granularity
|
* Strong [note encryption](https://github.com/zadam/trilium/wiki/Protected-notes) with per-note granularity
|
||||||
* [Relation maps](https://github.com/zadam/trilium/wiki/Relation-map) for visualizing notes and their relations
|
* [Relation maps](https://github.com/zadam/trilium/wiki/Relation-map) and [link maps](https://github.com/zadam/trilium/wiki/Link-map) for visualizing notes and their relations
|
||||||
* [Scripting](https://github.com/zadam/trilium/wiki/Scripts) - see [Advanced showcases](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
* [Scripting](https://github.com/zadam/trilium/wiki/Scripts) - see [Advanced showcases](https://github.com/zadam/trilium/wiki/Advanced-showcases)
|
||||||
* Scales well in both usability and performance upwards of 100 000 notes
|
* Scales well in both usability and performance upwards of 100 000 notes
|
||||||
* Touch optimized [mobile frontend](https://github.com/zadam/trilium/wiki/Mobile-frontend) for smartphones and tablets
|
* Touch optimized [mobile frontend](https://github.com/zadam/trilium/wiki/Mobile-frontend) for smartphones and tablets
|
||||||
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
|
* [Night theme](https://github.com/zadam/trilium/wiki/Themes)
|
||||||
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import) and [Markdown import & export](https://github.com/zadam/trilium/wiki/Markdown)
|
* [Evernote](https://github.com/zadam/trilium/wiki/Evernote-import) and [Markdown import & export](https://github.com/zadam/trilium/wiki/Markdown)
|
||||||
|
* [Web Clipper](https://github.com/zadam/trilium/wiki/Web-clipper) for easy saving of web content
|
||||||
|
|
||||||
## Builds
|
## Builds
|
||||||
|
|
||||||
Trilium is provided as either desktop application (Linux, Windows, Mac) or web application hosted on your server (Linux).
|
Trilium is provided as either desktop application (Linux and Windows) or web application hosted on your server (Linux). Mac OS desktop build is available, but it is [unsupported](https://github.com/zadam/trilium/wiki/FAQ#mac-os-support).
|
||||||
|
|
||||||
* If you want to use Trilium on the desktop, download binary release for your platform from [latest release](https://github.com/zadam/trilium/releases/latest), unzip the package and run ```trilium``` executable.
|
* If you want to use Trilium on the desktop, download binary release for your platform from [latest release](https://github.com/zadam/trilium/releases/latest), unzip the package and run ```trilium``` executable.
|
||||||
* If you want to install Trilium on server, follow [this page](https://github.com/zadam/trilium/wiki/Server-installation).
|
* If you want to install Trilium on server, follow [this page](https://github.com/zadam/trilium/wiki/Server-installation).
|
||||||
@@ -45,5 +46,12 @@ Use a browser based dev environment
|
|||||||
Or clone locally and run
|
Or clone locally and run
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
npm run start
|
npm run start-server
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Shoutouts
|
||||||
|
|
||||||
|
* [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)
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
SERIES=${VERSION:0:4}-latest
|
||||||
|
|
||||||
sudo docker build -t zadam/trilium:latest -t zadam/trilium:$VERSION .
|
cat package.json | grep -v electron > server-package.json
|
||||||
|
|
||||||
|
sudo docker build -t zadam/trilium:$VERSION -t zadam/trilium:$SERIES .
|
||||||
|
|
||||||
|
if [[ $VERSION != *"beta"* ]]; then
|
||||||
|
sudo docker tag zadam/trilium:$VERSION zadam/trilium:latest
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,17 +1,30 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SRC_DIR=./dist/trilium-linux-x64-src
|
||||||
|
|
||||||
|
if [ "$1" != "DONTCOPY" ]
|
||||||
|
then
|
||||||
|
./bin/copy-trilium.sh $SRC_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
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/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/
|
||||||
|
|
||||||
|
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
|
||||||
|
|
||||||
BUILD_DIR=./dist/trilium-linux-x64
|
BUILD_DIR=./dist/trilium-linux-x64
|
||||||
rm -rf $BUILD_DIR
|
rm -rf $BUILD_DIR
|
||||||
|
|
||||||
rm -r node_modules/sqlite3/lib/binding/*
|
|
||||||
|
|
||||||
cp -r bin/deps/linux-x64/sqlite/* node_modules/sqlite3/lib/binding/
|
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
|
|
||||||
|
|
||||||
mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
|
mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
|
||||||
|
|
||||||
cp src/public/images/app-icons/png/128x128.png $BUILD_DIR/icon.png
|
cp images/app-icons/png/128x128.png $BUILD_DIR/icon.png
|
||||||
|
|
||||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||||
rm -r $BUILD_DIR/swiftshader
|
rm -r $BUILD_DIR/swiftshader
|
||||||
@@ -22,3 +35,7 @@ VERSION=`jq -r ".version" package.json`
|
|||||||
cd dist
|
cd dist
|
||||||
|
|
||||||
tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64
|
tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
bin/build-debian.sh
|
||||||
@@ -1,27 +1,36 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SRC_DIR=./dist/trilium-mac-x64-src
|
||||||
|
|
||||||
|
if [ "$1" != "DONTCOPY" ]
|
||||||
|
then
|
||||||
|
./bin/copy-trilium.sh $SRC_DIR
|
||||||
|
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/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/
|
||||||
|
|
||||||
|
./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
|
||||||
|
|
||||||
BUILD_DIR=./dist/trilium-mac-x64
|
BUILD_DIR=./dist/trilium-mac-x64
|
||||||
rm -rf $BUILD_DIR
|
rm -rf $BUILD_DIR
|
||||||
|
|
||||||
echo "Copying required mac binaries"
|
|
||||||
|
|
||||||
rm -r node_modules/sqlite3/lib/binding/*
|
|
||||||
rm -r node_modules/mozjpeg/vendor/*
|
|
||||||
rm -r node_modules/pngquant-bin/vendor/*
|
|
||||||
rm -r node_modules/giflossy/vendor/*
|
|
||||||
|
|
||||||
cp -r bin/deps/mac-x64/sqlite/* node_modules/sqlite3/lib/binding/
|
|
||||||
cp bin/deps/mac-x64/image/cjpeg node_modules/mozjpeg/vendor/
|
|
||||||
cp bin/deps/mac-x64/image/pngquant node_modules/pngquant-bin/vendor/
|
|
||||||
cp bin/deps/mac-x64/image/gifsicle node_modules/giflossy/vendor/
|
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=src/public/images/app-icons/mac/icon.icns
|
|
||||||
|
|
||||||
# Mac build has by default useless directory level
|
# Mac build has by default useless directory level
|
||||||
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
|
mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR
|
||||||
|
|
||||||
./bin/reset-local.sh
|
|
||||||
|
|
||||||
echo "Zipping mac x64 electron distribution..."
|
echo "Zipping mac x64 electron distribution..."
|
||||||
|
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|||||||
@@ -1,38 +1,32 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PKG_DIR=dist/trilium-linux-x64-server
|
PKG_DIR=dist/trilium-linux-x64-server
|
||||||
NODE_VERSION=10.15.0
|
NODE_VERSION=12.14.0
|
||||||
|
|
||||||
rm -r $PKG_DIR
|
if [ "$1" != "DONTCOPY" ]
|
||||||
mkdir $PKG_DIR
|
then
|
||||||
cd $PKG_DIR
|
./bin/copy-trilium.sh $PKG_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd dist
|
||||||
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz
|
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz
|
||||||
tar xvfJ node-v${NODE_VERSION}-linux-x64.tar.xz
|
tar xvfJ node-v${NODE_VERSION}-linux-x64.tar.xz
|
||||||
rm node-v${NODE_VERSION}-linux-x64.tar.xz
|
rm node-v${NODE_VERSION}-linux-x64.tar.xz
|
||||||
|
|
||||||
mv node-v${NODE_VERSION}-linux-x64 node
|
|
||||||
|
|
||||||
cp -r ../../node_modules/ ./
|
|
||||||
cp -r ../../src/ ./
|
|
||||||
cp -r ../../db/ ./
|
|
||||||
cp -r ../../package.json ./
|
|
||||||
cp -r ../../package-lock.json ./
|
|
||||||
cp -r ../../README.md ./
|
|
||||||
cp -r ../../LICENSE ./
|
|
||||||
cp -r ../../config-sample.ini ./
|
|
||||||
|
|
||||||
rm -r ./node_modules/electron*
|
|
||||||
|
|
||||||
rm -r ./node_modules/sqlite3/lib/binding/*
|
|
||||||
|
|
||||||
cp -r ../../bin/deps/linux-x64/sqlite/node* ./node_modules/sqlite3/lib/binding/
|
|
||||||
|
|
||||||
printf "#/bin/sh\n./node/bin/node src/www" > trilium.sh
|
|
||||||
chmod 755 trilium.sh
|
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
VERSION=`jq -r ".version" ../package.json`
|
mv dist/node-v${NODE_VERSION}-linux-x64 $PKG_DIR/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/
|
||||||
|
|
||||||
|
printf "#!/bin/sh\n./node/bin/node src/www" > $PKG_DIR/trilium.sh
|
||||||
|
chmod 755 $PKG_DIR/trilium.sh
|
||||||
|
|
||||||
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|
||||||
|
cd dist
|
||||||
|
|
||||||
tar cJf trilium-linux-x64-server-${VERSION}.tar.xz trilium-linux-x64-server
|
tar cJf trilium-linux-x64-server-${VERSION}.tar.xz trilium-linux-x64-server
|
||||||
@@ -1,29 +1,39 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
BUILD_DIR=./dist/trilium-windows-x64
|
SRC_DIR=./dist/trilium-windows-x64-src
|
||||||
rm -rf $BUILD_DIR
|
|
||||||
|
if [ "$1" != "DONTCOPY" ]
|
||||||
|
then
|
||||||
|
./bin/copy-trilium.sh $SRC_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Copying required windows binaries"
|
echo "Copying required windows binaries"
|
||||||
|
|
||||||
rm -r node_modules/sqlite3/lib/binding/*
|
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||||
rm -r node_modules/mozjpeg/vendor/*
|
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
|
||||||
rm -r node_modules/pngquant-bin/vendor/*
|
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||||
rm -r node_modules/giflossy/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/deps/win-x64/sqlite/* node_modules/sqlite3/lib/binding/
|
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||||
cp bin/deps/win-x64/image/cjpeg.exe node_modules/mozjpeg/vendor/
|
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
|
||||||
cp bin/deps/win-x64/image/pngquant.exe node_modules/pngquant-bin/vendor/
|
cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||||
cp bin/deps/win-x64/image/gifsicle.exe node_modules/giflossy/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/
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager . --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=src/public/images/app-icons/win/icon.ico
|
./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
|
||||||
|
|
||||||
|
BUILD_DIR=./dist/trilium-windows-x64
|
||||||
|
rm -rf $BUILD_DIR
|
||||||
|
|
||||||
mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
|
mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR
|
||||||
|
|
||||||
# removing software WebGL binaries because they are pretty huge and not necessary
|
# removing software WebGL binaries because they are pretty huge and not necessary
|
||||||
rm -r $BUILD_DIR/swiftshader
|
rm -r $BUILD_DIR/swiftshader
|
||||||
|
|
||||||
./bin/reset-local.sh
|
|
||||||
|
|
||||||
echo "Zipping windows x64 electron distribution..."
|
echo "Zipping windows x64 electron distribution..."
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
|
|
||||||
|
|||||||
26
bin/build.sh
26
bin/build.sh
@@ -1,21 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
rm -r node_modules
|
|
||||||
|
|
||||||
npm install
|
|
||||||
|
|
||||||
echo "Deleting existing builds"
|
echo "Deleting existing builds"
|
||||||
|
|
||||||
rm -r dist/*
|
rm -rf dist/*
|
||||||
|
|
||||||
bin/build-win-x64.sh
|
SRC_DIR=dist/trilium-src
|
||||||
|
|
||||||
bin/build-mac-x64.sh
|
bin/copy-trilium.sh $SRC_DIR
|
||||||
|
|
||||||
# building X64 linux as the last so electron-rebuild will prepare X64 binaries for local development
|
# we'll just copy the same SRC dir to all the builds so we don't have to do npm install in each separately
|
||||||
bin/build-linux-x64.sh
|
cp -r $SRC_DIR ./dist/trilium-linux-x64-src
|
||||||
|
cp -r $SRC_DIR ./dist/trilium-linux-x64-server
|
||||||
|
cp -r $SRC_DIR ./dist/trilium-windows-x64-src
|
||||||
|
cp -r $SRC_DIR ./dist/trilium-mac-x64-src
|
||||||
|
|
||||||
# this needs to be run after linux build
|
bin/build-win-x64.sh DONTCOPY
|
||||||
bin/build-debian.sh
|
|
||||||
|
|
||||||
bin/build-server.sh
|
bin/build-mac-x64.sh DONTCOPY
|
||||||
|
|
||||||
|
bin/build-linux-x64.sh DONTCOPY
|
||||||
|
|
||||||
|
bin/build-server.sh DONTCOPY
|
||||||
|
|||||||
32
bin/copy-trilium.sh
Executable file
32
bin/copy-trilium.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]] ; then
|
||||||
|
echo "Missing argument of target directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DIR=$1
|
||||||
|
|
||||||
|
rm -rf $DIR
|
||||||
|
mkdir $DIR
|
||||||
|
|
||||||
|
echo "Copying Trilium to build directory $DIR"
|
||||||
|
|
||||||
|
cp -r images $DIR/
|
||||||
|
cp -r libraries $DIR/
|
||||||
|
cp -r src $DIR/
|
||||||
|
cp -r db $DIR/
|
||||||
|
cp -r package.json $DIR/
|
||||||
|
cp -r package-lock.json $DIR/
|
||||||
|
cp -r README.md $DIR/
|
||||||
|
cp -r LICENSE $DIR/
|
||||||
|
cp -r config-sample.ini $DIR/
|
||||||
|
cp -r electron.js $DIR/
|
||||||
|
|
||||||
|
# run in subshell (so we return to original dir)
|
||||||
|
(cd $DIR && npm install --only=prod)
|
||||||
|
|
||||||
|
rm -r $DIR/node_modules/cld/deps
|
||||||
|
|
||||||
|
find $DIR/libraries -name "*.map" -type f -delete
|
||||||
|
find $DIR/libraries -name "hunspell.lib" -type f -delete
|
||||||
BIN
bin/deps/linux-x64/image/pngquant
Executable file
BIN
bin/deps/linux-x64/image/pngquant
Executable file
Binary file not shown.
BIN
bin/deps/linux-x64/spellchecker/hunspell.a
Normal file
BIN
bin/deps/linux-x64/spellchecker/hunspell.a
Normal file
Binary file not shown.
BIN
bin/deps/linux-x64/spellchecker/spellchecker.node
Normal file
BIN
bin/deps/linux-x64/spellchecker/spellchecker.node
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/deps/linux-x64/sqlite/electron-v6.0-linux-x64/node_sqlite3.node
Executable file
BIN
bin/deps/linux-x64/sqlite/electron-v6.0-linux-x64/node_sqlite3.node
Executable file
Binary file not shown.
Binary file not shown.
BIN
bin/deps/linux-x64/sqlite/node-v72-linux-x64/node_sqlite3.node
Executable file
BIN
bin/deps/linux-x64/sqlite/node-v72-linux-x64/node_sqlite3.node
Executable file
Binary file not shown.
0
bin/deps/mac-x64/image/pngquant
Normal file → Executable file
0
bin/deps/mac-x64/image/pngquant
Normal file → Executable file
BIN
bin/deps/mac-x64/keyboard-layout-manager.node
Normal file
BIN
bin/deps/mac-x64/keyboard-layout-manager.node
Normal file
Binary file not shown.
BIN
bin/deps/mac-x64/spellchecker/hunspell.a
Normal file
BIN
bin/deps/mac-x64/spellchecker/hunspell.a
Normal file
Binary file not shown.
BIN
bin/deps/mac-x64/spellchecker/spellchecker.node
Normal file
BIN
bin/deps/mac-x64/spellchecker/spellchecker.node
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/deps/mac-x64/sqlite/electron-v6.0-darwin-x64/node_sqlite3.node
Executable file
BIN
bin/deps/mac-x64/sqlite/electron-v6.0-darwin-x64/node_sqlite3.node
Executable file
Binary file not shown.
BIN
bin/deps/win-x64/keyboard-layout-manager.node
Executable file
BIN
bin/deps/win-x64/keyboard-layout-manager.node
Executable file
Binary file not shown.
BIN
bin/deps/win-x64/spellchecker/hunspell.lib
Executable file
BIN
bin/deps/win-x64/spellchecker/hunspell.lib
Executable file
Binary file not shown.
BIN
bin/deps/win-x64/spellchecker/spellchecker.lib
Executable file
BIN
bin/deps/win-x64/spellchecker/spellchecker.lib
Executable file
Binary file not shown.
BIN
bin/deps/win-x64/spellchecker/spellchecker.node
Executable file
BIN
bin/deps/win-x64/spellchecker/spellchecker.node
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,5 +5,12 @@ if [[ $# -eq 0 ]] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo docker push zadam/trilium:latest
|
VERSION=$1
|
||||||
sudo docker push zadam/trilium:$1
|
SERIES=${VERSION:0:4}-latest
|
||||||
|
|
||||||
|
sudo docker push zadam/trilium:$VERSION
|
||||||
|
sudo docker push zadam/trilium:$SERIES
|
||||||
|
|
||||||
|
if [[ $1 != *"beta"* ]]; then
|
||||||
|
sudo docker push zadam/trilium:latest
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export GITHUB_REPO=trilium
|
||||||
|
|
||||||
if [[ $# -eq 0 ]] ; then
|
if [[ $# -eq 0 ]] ; then
|
||||||
echo "Missing argument of new version"
|
echo "Missing argument of new version"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
./node_modules/.bin/electron-rebuild --arch=x64
|
|
||||||
@@ -2,7 +2,12 @@
|
|||||||
# Instance name can be used to distinguish between different instances
|
# Instance name can be used to distinguish between different instances
|
||||||
instanceName=
|
instanceName=
|
||||||
|
|
||||||
|
# Disable automatically generating desktop icon
|
||||||
|
# noDesktopIcon=true
|
||||||
|
|
||||||
[Network]
|
[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 random free port
|
||||||
port=8080
|
port=8080
|
||||||
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
|
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
|
||||||
|
|||||||
BIN
db/demo.tar
BIN
db/demo.tar
Binary file not shown.
6
db/migrations/0127__fix_inconsistent_isProtected.sql
Normal file
6
db/migrations/0127__fix_inconsistent_isProtected.sql
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
UPDATE notes SET title = 'Recovered protected note', isProtected = 0 WHERE noteId IN (
|
||||||
|
SELECT noteId FROM notes JOIN note_contents USING(noteId)
|
||||||
|
WHERE notes.isProtected = 1
|
||||||
|
AND note_contents.isProtected = 0
|
||||||
|
AND notes.isDeleted = 0
|
||||||
|
)
|
||||||
0
db/migrations/0128__add_note_fulltext.sql
Normal file
0
db/migrations/0128__add_note_fulltext.sql
Normal file
1
db/migrations/0129__fill_note_fulltext.js
Normal file
1
db/migrations/0129__fill_note_fulltext.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = async () => {};
|
||||||
236
db/migrations/0130__rename_dates_to_utc.sql
Normal file
236
db/migrations/0130__rename_dates_to_utc.sql
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
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,
|
||||||
|
`utcSyncDate` TEXT NOT NULL);
|
||||||
|
|
||||||
|
INSERT INTO sync_mig (id, entityName, entityId, sourceId, utcSyncDate)
|
||||||
|
SELECT id, entityName, entityId, sourceId, REPLACE(syncDate, 'T', ' ') FROM sync;
|
||||||
|
|
||||||
|
DROP TABLE sync;
|
||||||
|
ALTER TABLE sync_mig RENAME TO sync;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "source_ids_mig" (
|
||||||
|
`sourceId` TEXT NOT NULL,
|
||||||
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY(`sourceId`)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO source_ids_mig (sourceId, utcDateCreated)
|
||||||
|
SELECT sourceId, REPLACE(dateCreated, 'T', ' ') FROM source_ids;
|
||||||
|
|
||||||
|
DROP TABLE source_ids;
|
||||||
|
ALTER TABLE source_ids_mig RENAME TO source_ids;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (
|
||||||
|
`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||||
|
`noteId` TEXT NOT NULL,
|
||||||
|
`title` TEXT,
|
||||||
|
`content` TEXT,
|
||||||
|
`isProtected` INT NOT NULL DEFAULT 0,
|
||||||
|
`utcDateModifiedFrom` TEXT NOT NULL,
|
||||||
|
`utcDateModifiedTo` TEXT NOT NULL,
|
||||||
|
`dateModifiedFrom` TEXT NOT NULL,
|
||||||
|
`dateModifiedTo` 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, content, isProtected, utcDateModifiedFrom, utcDateModifiedTo, dateModifiedFrom, dateModifiedTo, type, mime, hash)
|
||||||
|
SELECT noteRevisionId, noteId, title, content, isProtected, REPLACE(dateModifiedFrom, 'T', ' '), REPLACE(dateModifiedTo, 'T', ' '), REPLACE(REPLACE(dateModifiedFrom, 'T', ' '), 'Z', '+0000'), REPLACE(REPLACE(dateModifiedTo, 'T', ' '), 'Z', '+0000'), type, mime, hash FROM note_revisions;
|
||||||
|
|
||||||
|
DROP TABLE note_revisions;
|
||||||
|
ALTER TABLE note_revisions_mig RENAME TO note_revisions;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "api_tokens_mig"
|
||||||
|
(
|
||||||
|
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);
|
||||||
|
|
||||||
|
INSERT INTO api_tokens_mig (apiTokenId, token, utcDateCreated, isDeleted, hash)
|
||||||
|
SELECT apiTokenId, token, REPLACE(dateCreated, 'T', ' '), isDeleted, hash FROM api_tokens;
|
||||||
|
|
||||||
|
DROP TABLE api_tokens;
|
||||||
|
ALTER TABLE api_tokens_mig RENAME TO api_tokens;
|
||||||
|
|
||||||
|
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` BOOLEAN,
|
||||||
|
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
||||||
|
`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, REPLACE(dateModified, 'T', ' '), REPLACE(dateCreated, 'T', ' '), hash FROM branches;
|
||||||
|
|
||||||
|
DROP TABLE branches;
|
||||||
|
ALTER TABLE branches_mig RENAME TO branches;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "recent_notes_mig" (
|
||||||
|
`branchId` TEXT NOT NULL PRIMARY KEY,
|
||||||
|
`notePath` TEXT NOT NULL,
|
||||||
|
hash TEXT DEFAULT "" NOT NULL,
|
||||||
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
|
isDeleted INT
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO recent_notes_mig (branchId, notePath, hash, utcDateCreated, isDeleted)
|
||||||
|
SELECT branchId, notePath, hash, REPLACE(dateCreated, 'T', ' '), isDeleted FROM recent_notes;
|
||||||
|
|
||||||
|
DROP TABLE recent_notes;
|
||||||
|
ALTER TABLE recent_notes_mig RENAME TO recent_notes;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "event_log_mig" (
|
||||||
|
`eventId` TEXT NOT NULL PRIMARY KEY,
|
||||||
|
`noteId` TEXT,
|
||||||
|
`comment` TEXT,
|
||||||
|
`utcDateCreated` TEXT NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO event_log_mig (eventId, noteId, comment, utcDateCreated)
|
||||||
|
SELECT eventId, noteId, comment, REPLACE(dateCreated, 'T', ' ') FROM event_log;
|
||||||
|
|
||||||
|
DROP TABLE event_log;
|
||||||
|
ALTER TABLE event_log_mig RENAME TO event_log;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "options_mig"
|
||||||
|
(
|
||||||
|
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
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO options_mig (name, value, isSynced, hash, utcDateCreated, utcDateModified)
|
||||||
|
SELECT name, value, isSynced, hash, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM options;
|
||||||
|
|
||||||
|
DROP TABLE options;
|
||||||
|
ALTER TABLE options_mig RENAME TO options;
|
||||||
|
|
||||||
|
CREATE TABLE 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,
|
||||||
|
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, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' '), isDeleted, hash, isInheritable FROM attributes;
|
||||||
|
|
||||||
|
DROP TABLE attributes;
|
||||||
|
ALTER TABLE attributes_mig RENAME TO attributes;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "links_mig" (
|
||||||
|
`linkId` TEXT NOT NULL,
|
||||||
|
`noteId` TEXT NOT NULL,
|
||||||
|
`targetNoteId` TEXT NOT NULL,
|
||||||
|
`type` TEXT NOT NULL,
|
||||||
|
`hash` TEXT DEFAULT "" NOT NULL,
|
||||||
|
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
||||||
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
|
`utcDateModified` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY(`linkId`)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO links_mig (linkId, noteId, targetNoteId, type, hash, isDeleted, utcDateCreated, utcDateModified)
|
||||||
|
SELECT linkId, noteId, targetNoteId, type, hash, isDeleted, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM links;
|
||||||
|
|
||||||
|
DROP TABLE links;
|
||||||
|
ALTER TABLE links_mig RENAME TO links;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
||||||
|
`noteContentId` TEXT NOT NULL,
|
||||||
|
`noteId` TEXT NOT NULL,
|
||||||
|
`isProtected` INT NOT NULL DEFAULT 0,
|
||||||
|
`content` TEXT NULL DEFAULT NULL,
|
||||||
|
`hash` TEXT DEFAULT "" NOT NULL,
|
||||||
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
|
`utcDateModified` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY(`noteContentId`)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO note_contents_mig (noteContentId, noteId, isProtected, content, hash, utcDateCreated, utcDateModified)
|
||||||
|
SELECT noteContentId, noteId, isProtected, content, hash, REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM note_contents;
|
||||||
|
|
||||||
|
DROP TABLE note_contents;
|
||||||
|
ALTER TABLE note_contents_mig RENAME TO note_contents;
|
||||||
|
|
||||||
|
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,
|
||||||
|
`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, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
||||||
|
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, REPLACE(REPLACE(dateCreated, 'T', ' '), 'Z', '+0000'), REPLACE(REPLACE(dateModified, 'T', ' '), 'Z', '+0000'), REPLACE(dateCreated, 'T', ' '), REPLACE(dateModified, 'T', ' ') FROM notes;
|
||||||
|
|
||||||
|
DROP TABLE notes;
|
||||||
|
ALTER TABLE notes_mig RENAME TO notes;
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
||||||
|
`entityName`,
|
||||||
|
`entityId`
|
||||||
|
);
|
||||||
|
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
||||||
|
`utcSyncDate`
|
||||||
|
);
|
||||||
|
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (
|
||||||
|
`noteId`
|
||||||
|
);
|
||||||
|
CREATE INDEX `IDX_note_revisions_dateModifiedFrom` ON `note_revisions` (
|
||||||
|
`utcDateModifiedFrom`
|
||||||
|
);
|
||||||
|
CREATE INDEX `IDX_note_revisions_dateModifiedTo` ON `note_revisions` (
|
||||||
|
`utcDateModifiedTo`
|
||||||
|
);
|
||||||
|
CREATE INDEX `IDX_branches_noteId` ON `branches` (
|
||||||
|
`noteId`
|
||||||
|
);
|
||||||
|
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (
|
||||||
|
`noteId`,
|
||||||
|
`parentNoteId`
|
||||||
|
);
|
||||||
|
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||||
|
CREATE INDEX IDX_attributes_name_value
|
||||||
|
on attributes (name, value);
|
||||||
|
CREATE INDEX IDX_links_noteId_index
|
||||||
|
on links (noteId);
|
||||||
|
CREATE INDEX IDX_links_targetNoteId_index
|
||||||
|
on links (targetNoteId);
|
||||||
|
CREATE INDEX IDX_attributes_name_index
|
||||||
|
on attributes (name);
|
||||||
|
CREATE INDEX IDX_attributes_noteId_index
|
||||||
|
on attributes (noteId);
|
||||||
|
CREATE INDEX IDX_attributes_value_index
|
||||||
|
on attributes (value);
|
||||||
|
CREATE UNIQUE INDEX `IDX_note_contents_noteId` ON `note_contents` (`noteId`);
|
||||||
13
db/migrations/0131__cleanup_note_contents.sql
Normal file
13
db/migrations/0131__cleanup_note_contents.sql
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
||||||
|
`noteId` TEXT NOT NULL,
|
||||||
|
`content` TEXT NULL DEFAULT NULL,
|
||||||
|
`hash` TEXT DEFAULT "" NOT NULL,
|
||||||
|
`utcDateModified` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY(`noteId`)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO note_contents_mig (noteId, content, hash, utcDateModified)
|
||||||
|
SELECT noteId, content, hash, utcDateModified FROM note_contents;
|
||||||
|
|
||||||
|
DROP TABLE note_contents;
|
||||||
|
ALTER TABLE note_contents_mig RENAME TO note_contents;
|
||||||
5
db/migrations/0132__fill_sync.js
Normal file
5
db/migrations/0132__fill_sync.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
const syncTableService = require('../../src/services/sync_table');
|
||||||
|
|
||||||
|
module.exports = async () => {
|
||||||
|
await syncTableService.fillAllSyncRows();
|
||||||
|
};
|
||||||
1
db/migrations/0133__drop_note_fulltext.sql
Normal file
1
db/migrations/0133__drop_note_fulltext.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DROP TABLE IF EXISTS note_fulltext;
|
||||||
4
db/migrations/0134__create_openTabs_option.sql
Normal file
4
db/migrations/0134__create_openTabs_option.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
SELECT 'openTabs', '[{"notePath":"' || value || '","active": true,"tabId":"1111"}]', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0 FROM options WHERE name = 'startNotePath';
|
||||||
|
|
||||||
|
DELETE FROM options WHERE name = 'startNotePath';
|
||||||
2
db/migrations/0135__add_hideTabRowForOneTab_option.sql
Normal file
2
db/migrations/0135__add_hideTabRowForOneTab_option.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('hideTabRowForOneTab', 'false', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0);
|
||||||
12
db/migrations/0136__update_recent_notes.sql
Normal file
12
db/migrations/0136__update_recent_notes.sql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
drop table recent_notes;
|
||||||
|
|
||||||
|
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
|
||||||
|
);
|
||||||
|
|
||||||
|
delete from sync where entityName = 'recent_notes';
|
||||||
10
db/migrations/0137__links_to_attributes.sql
Normal file
10
db/migrations/0137__links_to_attributes.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
UPDATE links SET type = 'internal-link' WHERE type = 'hyper';
|
||||||
|
UPDATE links SET type = 'image-link' WHERE type = 'image';
|
||||||
|
UPDATE links SET type = 'relation-map-link' WHERE type = 'relation-map';
|
||||||
|
|
||||||
|
INSERT INTO attributes (attributeId, noteId, type, name, value, position, utcDateCreated, utcDateModified, isDeleted, hash, isInheritable)
|
||||||
|
SELECT linkId, noteId, 'relation', type, targetNoteId, 0, utcDateCreated, utcDateModified, isDeleted, hash, 0 FROM links;
|
||||||
|
|
||||||
|
UPDATE sync SET entityName = 'attributes' WHERE entityName = 'links';
|
||||||
|
|
||||||
|
DROP TABLE links;
|
||||||
5
db/migrations/0138__sidebar_sizing.sql
Normal file
5
db/migrations/0138__sidebar_sizing.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('sidebarMinWidth', '350', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
|
|
||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('sidebarWidthPercent', '25', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
2
db/migrations/0139__show_sidebar_in_new_tab.sql
Normal file
2
db/migrations/0139__show_sidebar_in_new_tab.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('showSidebarInNewTab', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
14
db/migrations/0140__widget_config.sql
Normal file
14
db/migrations/0140__widget_config.sql
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('noteInfoWidget', '{"enabled":true,"expanded":true,"position":100}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
|
|
||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('attributesWidget', '{"enabled":true,"expanded":true,"position":200}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
|
|
||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('linkMapWidget', '{"enabled":true,"expanded":true,"position":300}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
|
|
||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('noteRevisionsWidget', '{"enabled":true,"expanded":true,"position":400}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
|
|
||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('whatLinksHereWidget', '{"enabled":false,"expanded":true,"position":500}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
5
db/migrations/0141__add_code_note_mime_types.sql
Normal file
5
db/migrations/0141__add_code_note_mime_types.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('codeNotesMimeTypes', '["text/x-csrc","text/x-c++src","text/x-csharp","text/css","text/x-go","text/x-groovy","text/x-haskell","text/html","message/http","text/x-java","application/javascript;env=frontend","application/javascript;env=backend","application/json","text/x-kotlin","text/x-markdown","text/x-perl","text/x-php","text/x-python","text/x-ruby",null,"text/x-sql","text/x-swift","text/xml","text/x-yaml"]', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 1);
|
||||||
|
|
||||||
|
INSERT INTO sync (entityName, entityId, sourceId, utcSyncDate)
|
||||||
|
VALUES ('options' ,'codeNotesMimeTypes', 'SYNC_FILL', '2018-01-01T00:00:00.000Z');
|
||||||
2
db/migrations/0142__similar_notes_widget.sql
Normal file
2
db/migrations/0142__similar_notes_widget.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('similarNotesWidget', '{"enabled":true,"expanded":true,"position":600}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
1
db/migrations/0143__drop_event_log.sql
Normal file
1
db/migrations/0143__drop_event_log.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DROP TABLE event_log;
|
||||||
2
db/migrations/0144__edited_notes_widget.sql
Normal file
2
db/migrations/0144__edited_notes_widget.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('editedNotesWidget', '{"enabled":true,"expanded":true,"position":50}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
2
db/migrations/0145__calendar_widget.sql
Normal file
2
db/migrations/0145__calendar_widget.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('calendarWidget', '{"enabled":true,"expanded":true,"position":20}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
5
db/migrations/0146__add_spell_check_options.sql
Normal file
5
db/migrations/0146__add_spell_check_options.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('spellCheckEnabled', 'true', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
|
|
||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
VALUES ('spellCheckLanguageCode', 'en-US', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
|
||||||
|
SELECT 'hideTabRowForOneTab', 'false', '2019-05-01T18:31:00.874Z', '2019-05-01T18:31:00.874Z', 0
|
||||||
|
WHERE NOT EXISTS(SELECT 1 FROM options WHERE name = 'hideTabRowForOneTab');
|
||||||
22
db/migrations/0148__make_isExpanded_not_null.sql
Normal file
22
db/migrations/0148__make_isExpanded_not_null.sql
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
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,
|
||||||
|
`utcDateModified` TEXT NOT NULL,
|
||||||
|
utcDateCreated TEXT NOT NULL,
|
||||||
|
hash TEXT DEFAULT "" NOT NULL,
|
||||||
|
PRIMARY KEY(`branchId`));
|
||||||
|
|
||||||
|
INSERT INTO mig_branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated, hash)
|
||||||
|
SELECT branchId, noteId, parentNoteId, notePosition, prefix, COALESCE(isExpanded, 0), isDeleted, utcDateModified, utcDateCreated, hash FROM branches;
|
||||||
|
|
||||||
|
DROP TABLE branches;
|
||||||
|
ALTER TABLE mig_branches RENAME TO branches;
|
||||||
|
|
||||||
|
CREATE INDEX `IDX_branches_noteId` ON `branches` (`noteId`);
|
||||||
|
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||||
|
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||||
2
db/migrations/0149__space_out_positions.sql
Normal file
2
db/migrations/0149__space_out_positions.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
UPDATE branches SET notePosition = notePosition * 10;
|
||||||
|
UPDATE attributes SET position = position * 10;
|
||||||
36
db/migrations/0150__note_revision_contents.sql
Normal file
36
db/migrations/0150__note_revision_contents.sql
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||||
|
`noteId` TEXT NOT NULL,
|
||||||
|
`title` TEXT,
|
||||||
|
`contentLength` INT NOT NULL,
|
||||||
|
`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 TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||||
|
`content` TEXT,
|
||||||
|
hash TEXT DEFAULT '' NOT NULL,
|
||||||
|
`utcDateModified` TEXT NOT NULL);
|
||||||
|
|
||||||
|
INSERT INTO note_revision_contents (noteRevisionId, content, hash, utcDateModified)
|
||||||
|
SELECT noteRevisionId, content, hash, utcDateModifiedTo FROM note_revisions;
|
||||||
|
|
||||||
|
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, contentLength, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
|
||||||
|
SELECT noteRevisionId, noteId, title, COALESCE(LENGTH(content), 0), isProtected, utcDateModifiedFrom, utcDateModifiedTo, utcDateModifiedTo, dateModifiedFrom, dateModifiedTo, 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`);
|
||||||
|
|
||||||
|
INSERT INTO sync (entityName, entityId, sourceId, utcSyncDate)
|
||||||
|
SELECT 'note_revision_contents', entityId, sourceId, utcSyncDate FROM sync WHERE entityName = 'note_revisions';
|
||||||
31
db/migrations/0151__add_isErased_to_note.sql
Normal file
31
db/migrations/0151__add_isErased_to_note.sql
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
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,
|
||||||
|
`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, isErased, dateCreated, dateModified, utcDateCreated, utcDateModified)
|
||||||
|
SELECT noteId, title, isProtected, type, mime, hash, isDeleted, 0, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes;
|
||||||
|
|
||||||
|
DROP TABLE notes;
|
||||||
|
ALTER TABLE notes_mig RENAME TO notes;
|
||||||
|
|
||||||
|
UPDATE notes SET isErased = 1 WHERE isDeleted = 1
|
||||||
|
AND 1=(SELECT CASE WHEN content IS NULL THEN 1 ELSE 0 END FROM note_contents WHERE note_contents.noteId = notes.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`);
|
||||||
34
db/migrations/0152__add_contentLength_to_note.sql
Normal file
34
db/migrations/0152__add_contentLength_to_note.sql
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
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,
|
||||||
|
`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;
|
||||||
|
|
||||||
|
UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1);
|
||||||
|
|
||||||
|
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`);
|
||||||
|
|
||||||
|
-- should be OK since sync protocol changes so all instances must upgrade
|
||||||
|
UPDATE attributes SET isDeleted = 1 WHERE name = 'fileSize';
|
||||||
28
db/migrations/0153__add_isErased_to_note_revision.sql
Normal file
28
db/migrations/0153__add_isErased_to_note_revision.sql
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS "note_revisions_mig" (`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);
|
||||||
|
|
||||||
|
INSERT INTO note_revisions_mig (noteRevisionId, noteId, title, contentLength, isErased, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, type, mime, hash)
|
||||||
|
SELECT noteRevisionId, noteId, title, contentLength, 0, 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;
|
||||||
|
|
||||||
|
UPDATE note_revisions SET isErased = (SELECT isErased FROM notes WHERE notes.noteId = note_revisions.noteId);
|
||||||
|
|
||||||
|
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`);
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
UPDATE attributes SET name = 'internalLink' WHERE name = 'internal-link';
|
||||||
|
UPDATE attributes SET name = 'imageLink' WHERE name = 'image-link';
|
||||||
|
UPDATE attributes SET name = 'relationMapLink' WHERE name = 'relation-map-link';
|
||||||
5
db/migrations/0155__indexes.sql
Normal file
5
db/migrations/0155__indexes.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
DROP INDEX IF EXISTS IDX_attributes_name_index;
|
||||||
|
DROP INDEX IF EXISTS IDX_branches_noteId;
|
||||||
|
|
||||||
|
CREATE INDEX IDX_source_ids_utcDateCreated
|
||||||
|
on source_ids (utcDateCreated);
|
||||||
173
db/schema.sql
173
db/schema.sql
@@ -3,86 +3,31 @@ CREATE TABLE IF NOT EXISTS "sync" (
|
|||||||
`entityName` TEXT NOT NULL,
|
`entityName` TEXT NOT NULL,
|
||||||
`entityId` TEXT NOT NULL,
|
`entityId` TEXT NOT NULL,
|
||||||
`sourceId` TEXT NOT NULL,
|
`sourceId` TEXT NOT NULL,
|
||||||
`syncDate` TEXT NOT NULL);
|
`utcSyncDate` TEXT NOT NULL);
|
||||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_sync_syncDate` ON `sync` (
|
|
||||||
`syncDate`
|
|
||||||
);
|
|
||||||
CREATE TABLE IF NOT EXISTS "source_ids" (
|
CREATE TABLE IF NOT EXISTS "source_ids" (
|
||||||
`sourceId` TEXT NOT NULL,
|
`sourceId` TEXT NOT NULL,
|
||||||
`dateCreated` TEXT NOT NULL,
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
PRIMARY KEY(`sourceId`)
|
PRIMARY KEY(`sourceId`)
|
||||||
);
|
);
|
||||||
CREATE TABLE IF NOT EXISTS "note_revisions" (
|
CREATE INDEX IDX_source_ids_utcDateCreated
|
||||||
`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
on source_ids (utcDateCreated);
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`title` TEXT,
|
|
||||||
`content` TEXT,
|
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`dateModifiedFrom` TEXT NOT NULL,
|
|
||||||
`dateModifiedTo` 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_dateModifiedFrom` ON `note_revisions` (
|
|
||||||
`dateModifiedFrom`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateModifiedTo` ON `note_revisions` (
|
|
||||||
`dateModifiedTo`
|
|
||||||
);
|
|
||||||
CREATE TABLE IF NOT EXISTS "api_tokens"
|
CREATE TABLE IF NOT EXISTS "api_tokens"
|
||||||
(
|
(
|
||||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||||
token TEXT NOT NULL,
|
token TEXT NOT NULL,
|
||||||
dateCreated TEXT NOT NULL,
|
utcDateCreated TEXT NOT NULL,
|
||||||
isDeleted INT NOT NULL DEFAULT 0
|
isDeleted INT NOT NULL DEFAULT 0,
|
||||||
, hash TEXT DEFAULT "" NOT NULL);
|
hash TEXT DEFAULT "" NOT NULL);
|
||||||
CREATE TABLE IF NOT EXISTS "branches" (
|
|
||||||
`branchId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`parentNoteId` TEXT NOT NULL,
|
|
||||||
`notePosition` INTEGER NOT NULL,
|
|
||||||
`prefix` TEXT,
|
|
||||||
`isExpanded` BOOLEAN,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`dateModified` TEXT NOT NULL, hash TEXT DEFAULT "" NOT NULL, dateCreated TEXT NOT NULL DEFAULT '1970-01-01T00:00:00.000Z',
|
|
||||||
PRIMARY KEY(`branchId`)
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_branches_noteId` ON `branches` (
|
|
||||||
`noteId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (
|
|
||||||
`noteId`,
|
|
||||||
`parentNoteId`
|
|
||||||
);
|
|
||||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
|
||||||
CREATE TABLE IF NOT EXISTS "recent_notes" (
|
|
||||||
`branchId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`notePath` TEXT NOT NULL,
|
|
||||||
hash TEXT DEFAULT "" NOT NULL,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
isDeleted INT
|
|
||||||
);
|
|
||||||
CREATE TABLE IF NOT EXISTS "event_log" (
|
|
||||||
`eventId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`noteId` TEXT,
|
|
||||||
`comment` TEXT,
|
|
||||||
`dateCreated` TEXT NOT NULL
|
|
||||||
);
|
|
||||||
CREATE TABLE IF NOT EXISTS "options"
|
CREATE TABLE IF NOT EXISTS "options"
|
||||||
(
|
(
|
||||||
name TEXT not null PRIMARY KEY,
|
name TEXT not null PRIMARY KEY,
|
||||||
value TEXT,
|
value TEXT,
|
||||||
dateModified INT,
|
|
||||||
isSynced INTEGER default 0 not null,
|
isSynced INTEGER default 0 not null,
|
||||||
hash TEXT default "" not null,
|
hash TEXT default "" not null,
|
||||||
dateCreated TEXT default '1970-01-01T00:00:00.000Z' not null
|
utcDateCreated TEXT not null,
|
||||||
|
utcDateModified TEXT NOT NULL
|
||||||
);
|
);
|
||||||
CREATE TABLE attributes
|
CREATE TABLE IF NOT EXISTS "attributes"
|
||||||
(
|
(
|
||||||
attributeId TEXT not null primary key,
|
attributeId TEXT not null primary key,
|
||||||
noteId TEXT not null,
|
noteId TEXT not null,
|
||||||
@@ -90,53 +35,95 @@ CREATE TABLE attributes
|
|||||||
name TEXT not null,
|
name TEXT not null,
|
||||||
value TEXT default '' not null,
|
value TEXT default '' not null,
|
||||||
position INT default 0 not null,
|
position INT default 0 not null,
|
||||||
dateCreated TEXT not null,
|
utcDateCreated TEXT not null,
|
||||||
dateModified TEXT not null,
|
utcDateModified TEXT not null,
|
||||||
isDeleted INT not null,
|
isDeleted INT not null,
|
||||||
hash TEXT default "" not null, isInheritable int DEFAULT 0 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
|
CREATE INDEX IDX_attributes_name_value
|
||||||
on attributes (name, value);
|
on attributes (name, value);
|
||||||
CREATE TABLE IF NOT EXISTS "links" (
|
|
||||||
`linkId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
|
||||||
`targetNoteId` TEXT NOT NULL,
|
|
||||||
`type` TEXT NOT NULL,
|
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INTEGER NOT NULL DEFAULT 0,
|
|
||||||
`dateCreated` TEXT NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
|
||||||
PRIMARY KEY(`linkId`)
|
|
||||||
);
|
|
||||||
CREATE INDEX IDX_links_noteId_index
|
|
||||||
on links (noteId);
|
|
||||||
CREATE INDEX IDX_links_targetNoteId_index
|
|
||||||
on links (targetNoteId);
|
|
||||||
CREATE INDEX IDX_attributes_name_index
|
|
||||||
on attributes (name);
|
|
||||||
CREATE INDEX IDX_attributes_noteId_index
|
CREATE INDEX IDX_attributes_noteId_index
|
||||||
on attributes (noteId);
|
on attributes (noteId);
|
||||||
CREATE INDEX IDX_attributes_value_index
|
CREATE INDEX IDX_attributes_value_index
|
||||||
on attributes (value);
|
on attributes (value);
|
||||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||||
`noteContentId` TEXT NOT NULL,
|
|
||||||
`noteId` TEXT NOT NULL,
|
`noteId` TEXT NOT NULL,
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
`content` TEXT NULL DEFAULT NULL,
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
`hash` TEXT DEFAULT "" NOT NULL,
|
||||||
`dateCreated` TEXT NOT NULL,
|
`utcDateModified` TEXT NOT NULL,
|
||||||
`dateModified` TEXT NOT NULL,
|
PRIMARY KEY(`noteId`)
|
||||||
PRIMARY KEY(`noteContentId`)
|
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX `IDX_note_contents_noteId` ON `note_contents` (`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
|
||||||
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS "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,
|
||||||
|
`utcDateModified` TEXT NOT NULL,
|
||||||
|
utcDateCreated TEXT NOT NULL,
|
||||||
|
hash TEXT DEFAULT "" NOT NULL,
|
||||||
|
PRIMARY KEY(`branchId`));
|
||||||
|
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" (
|
CREATE TABLE IF NOT EXISTS "notes" (
|
||||||
`noteId` TEXT NOT NULL,
|
`noteId` TEXT NOT NULL,
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
`title` TEXT NOT NULL DEFAULT "note",
|
||||||
|
`contentLength` INT NOT NULL,
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
`isProtected` INT NOT NULL DEFAULT 0,
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
`type` TEXT NOT NULL DEFAULT 'text',
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
`hash` TEXT DEFAULT "" NOT NULL,
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||||
|
`isErased` INT NOT NULL DEFAULT 0,
|
||||||
`dateCreated` TEXT NOT NULL,
|
`dateCreated` TEXT NOT NULL,
|
||||||
`dateModified` TEXT NOT NULL,
|
`dateModified` TEXT NOT NULL,
|
||||||
PRIMARY KEY(`noteId`)
|
`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`);
|
||||||
|
|||||||
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '2.1'
|
||||||
|
services:
|
||||||
|
trilium:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
image: zadam/trilium
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- TRILIUM_DATA_DIR=/data
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- trilium:/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
trilium:
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>ApiToken<span class="signature">(apiTokenId, token, isDeleted, dateCreated)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>ApiToken<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.</div>
|
<div class="class-description">ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="ApiToken"><span class="type-signature"></span>new ApiToken<span class="signature">(apiTokenId, token, isDeleted, dateCreated)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="ApiToken"><span class="type-signature"></span>new ApiToken<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,10 +60,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
@@ -154,7 +159,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateCreated</code></td>
|
<td class="name"><code>utcDateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -180,8 +185,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
@@ -239,6 +242,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -282,13 +287,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, dateCreated, dateModified)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Attribute is key value pair owned by a note.</div>
|
<div class="class-description">Attribute is key value pair owned by a note.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, dateCreated, dateModified)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,10 +60,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
@@ -269,7 +274,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateCreated</code></td>
|
<td class="name"><code>utcDateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -292,7 +297,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModified</code></td>
|
<td class="name"><code>utcDateModified</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -318,8 +323,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
@@ -349,7 +352,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line24">line 24</a>
|
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line29">line 29</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -377,6 +380,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -485,6 +490,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
@@ -585,6 +592,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
@@ -685,6 +694,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
@@ -724,13 +735,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified, dateCreated)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId.
|
<div class="class-description">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.</div>
|
Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.</div>
|
||||||
@@ -46,7 +46,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified, dateCreated)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -61,10 +61,15 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
@@ -247,7 +252,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModified</code></td>
|
<td class="name"><code>utcDateModified</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -270,7 +275,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateCreated</code></td>
|
<td class="name"><code>utcDateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -296,8 +301,6 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
@@ -327,7 +330,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line24">line 24</a>
|
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line30">line 30</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -355,6 +358,8 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -463,6 +468,8 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
@@ -505,13 +512,13 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -178,6 +178,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -210,13 +212,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Link<span class="signature">(linkId, noteId, targetNoteId, type, isDeleted, dateModified, dateCreated)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>Link<span class="signature">(linkId, noteId, targetNoteId, type, isDeleted, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">This class represents link from one note to another in the form of hyperlink or image reference. Note that
|
<div class="class-description">This class represents link from one note to another in the form of hyperlink or image reference. Note that
|
||||||
this is different concept than attribute/relation.</div>
|
this is different concept than attribute/relation.</div>
|
||||||
@@ -46,7 +46,7 @@ this is different concept than attribute/relation.</div>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Link"><span class="type-signature"></span>new Link<span class="signature">(linkId, noteId, targetNoteId, type, isDeleted, dateModified, dateCreated)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="Link"><span class="type-signature"></span>new Link<span class="signature">(linkId, noteId, targetNoteId, type, isDeleted, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ this is different concept than attribute/relation.</div>
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModified</code></td>
|
<td class="name"><code>utcDateModified</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -224,7 +224,7 @@ this is different concept than attribute/relation.</div>
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateCreated</code></td>
|
<td class="name"><code>utcDateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -352,7 +352,7 @@ this is different concept than attribute/relation.</div>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,494 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>JSDoc: Class: NoteContent</title>
|
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="main">
|
|
||||||
|
|
||||||
<h1 class="page-title">Class: NoteContent</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section>
|
|
||||||
|
|
||||||
<header>
|
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>NoteContent<span class="signature">(row)</span><span class="type-signature"></span></h2>
|
|
||||||
|
|
||||||
<div class="class-description">This represents a Note which is a central object in the Trilium Notes project.</div>
|
|
||||||
|
|
||||||
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<article>
|
|
||||||
<div class="container-overview">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Constructor</h2>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="NoteContent"><span class="type-signature"></span>new NoteContent<span class="signature">(row)</span><span class="type-signature"></span></h4>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th>Name</th>
|
|
||||||
|
|
||||||
|
|
||||||
<th>Type</th>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>row</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">object containing database row from "note_contents" table</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5 class="subsection-title">Properties:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<table class="props">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th>Name</th>
|
|
||||||
|
|
||||||
|
|
||||||
<th>Type</th>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<th class="last">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>noteContentId</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">primary key</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>noteId</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">reference to owning note</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>isProtected</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">boolean</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">true if note content is protected</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>content</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">blob</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last">note content - e.g. HTML text for text notes, file payload for files</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>dateCreated</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last"></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td class="name"><code>dateModified</code></td>
|
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="description last"></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
|
||||||
<a href="entities_note_content.js.html">entities/note_content.js</a>, <a href="entities_note_content.js.html#line20">line 20</a>
|
|
||||||
</li></ul></dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<h3 class="subsection-title">Extends</h3>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li><a href="Entity.html">Entity</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3 class="subsection-title">Methods</h3>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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>>}</span></h4>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
|
||||||
<a href="entities_note_content.js.html">entities/note_content.js</a>, <a href="entities_note_content.js.html#line63">line 63</a>
|
|
||||||
</li></ul></dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl>
|
|
||||||
<dt>
|
|
||||||
Type
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
<span class="param-type">Promise.<<a href="Note.html">Note</a>></span>
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</article>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<br class="clear">
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
|
||||||
<script src="scripts/linenumber.js"> </script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.</div>
|
<div class="class-description">NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">(noteRevisionId, noteId, type, mime, title, content, isProtected, dateModifiedFrom, dateModifiedTo)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,10 +60,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
@@ -200,13 +205,36 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>content</code></td>
|
<td class="name"><code>contentLength</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -229,7 +257,7 @@
|
|||||||
<td class="type">
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
<span class="param-type">string</span>
|
<span class="param-type">boolean</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -246,7 +274,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModifiedFrom</code></td>
|
<td class="name"><code>dateLastEdited</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -269,7 +297,76 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModifiedTo</code></td>
|
<td class="name"><code>dateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>utcDateLastEdited</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>utcDateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>utcDateModified</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -295,8 +392,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
@@ -326,7 +421,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line22">line 22</a>
|
<a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line35">line 35</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -354,6 +449,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -383,6 +480,320 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="subsection-title">Methods</h3>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h4 class="name" id="getContent"><span class="type-signature">(async) </span>getContent<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#line69">line 69</a>
|
||||||
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<dt>
|
||||||
|
Type
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<span class="param-type">Promise.<*></span>
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h4 class="name" id="isStringNote"><span class="type-signature"></span>isStringNote<span class="signature">()</span><span class="type-signature"> → {boolean}</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#line55">line 55</a>
|
||||||
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="param-desc">
|
||||||
|
true if the note has string content (not binary)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<dt>
|
||||||
|
Type
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<span class="param-type">boolean</span>
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -397,13 +808,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">(name, value, isSynced, dateModified, dateCreated)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">Option represents name-value pair, either directly configurable by the user or some system property.</div>
|
<div class="class-description">Option represents name-value pair, either directly configurable by the user or some system property.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">(name, value, isSynced, dateModified, dateCreated)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,10 +60,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
@@ -154,7 +159,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModified</code></td>
|
<td class="name"><code>utcDateModified</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -177,7 +182,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateCreated</code></td>
|
<td class="name"><code>utcDateCreated</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -203,8 +208,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
@@ -234,7 +237,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line17">line 17</a>
|
<a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line22">line 22</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -262,6 +265,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -305,13 +310,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">(branchId, notePath, isDeleted, dateModified)</span><span class="type-signature"></span></h2>
|
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||||
|
|
||||||
<div class="class-description">RecentNote represents recently visited note.</div>
|
<div class="class-description">RecentNote represents recently visited note.</div>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">(branchId, notePath, isDeleted, dateModified)</span><span class="type-signature"></span></h4>
|
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,10 +60,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Parameters:</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="params">
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
@@ -85,7 +90,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>branchId</code></td>
|
<td class="name"><code>noteId</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -154,7 +159,7 @@
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="name"><code>dateModified</code></td>
|
<td class="name"><code>utcDateModified</code></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="type">
|
<td class="type">
|
||||||
@@ -180,8 +185,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dl class="details">
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
@@ -239,6 +242,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -282,13 +287,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -34,25 +34,25 @@ const dateUtils = require('../services/date_utils');
|
|||||||
/**
|
/**
|
||||||
* ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.
|
* ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.
|
||||||
*
|
*
|
||||||
* @param {string} apiTokenId - primary key
|
* @property {string} apiTokenId - primary key
|
||||||
* @param {string} token
|
* @property {string} token
|
||||||
* @param {boolean} isDeleted - true if API token is deleted
|
* @property {boolean} isDeleted - true if API token is deleted
|
||||||
* @param {string} dateCreated
|
* @property {string} utcDateCreated
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
class ApiToken extends Entity {
|
class ApiToken extends Entity {
|
||||||
static get entityName() { return "api_tokens"; }
|
static get entityName() { return "api_tokens"; }
|
||||||
static get primaryKeyName() { return "apiTokenId"; }
|
static get primaryKeyName() { return "apiTokenId"; }
|
||||||
static get hashedProperties() { return ["apiTokenId", "token", "dateCreated", "isDeleted"]; }
|
static get hashedProperties() { return ["apiTokenId", "token", "utcDateCreated", "isDeleted"]; }
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
if (!this.isDeleted) {
|
if (!this.isDeleted) {
|
||||||
this.isDeleted = false;
|
this.isDeleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.dateCreated) {
|
if (!this.utcDateCreated) {
|
||||||
this.dateCreated = dateUtils.nowDate();
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
@@ -69,13 +69,13 @@ module.exports = ApiToken;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -36,23 +36,23 @@ const sql = require('../services/sql');
|
|||||||
/**
|
/**
|
||||||
* Attribute is key value pair owned by a note.
|
* Attribute is key value pair owned by a note.
|
||||||
*
|
*
|
||||||
* @param {string} attributeId
|
* @property {string} attributeId
|
||||||
* @param {string} noteId
|
* @property {string} noteId
|
||||||
* @param {string} type
|
* @property {string} type
|
||||||
* @param {string} name
|
* @property {string} name
|
||||||
* @param {string} value
|
* @property {string} value
|
||||||
* @param {int} position
|
* @property {int} position
|
||||||
* @param {boolean} isInheritable
|
* @property {boolean} isInheritable
|
||||||
* @param {boolean} isDeleted
|
* @property {boolean} isDeleted
|
||||||
* @param {string} dateCreated
|
* @property {string} utcDateCreated
|
||||||
* @param {string} dateModified
|
* @property {string} utcDateModified
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
class Attribute extends Entity {
|
class Attribute extends Entity {
|
||||||
static get entityName() { return "attributes"; }
|
static get entityName() { return "attributes"; }
|
||||||
static get primaryKeyName() { return "attributeId"; }
|
static get primaryKeyName() { return "attributeId"; }
|
||||||
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "dateCreated"]; }
|
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; }
|
||||||
|
|
||||||
constructor(row) {
|
constructor(row) {
|
||||||
super(row);
|
super(row);
|
||||||
@@ -107,6 +107,10 @@ class Attribute extends Entity {
|
|||||||
|
|
||||||
async beforeSaving() {
|
async beforeSaving() {
|
||||||
if (!this.value) {
|
if (!this.value) {
|
||||||
|
if (this.type === 'relation') {
|
||||||
|
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
|
||||||
|
}
|
||||||
|
|
||||||
// null value isn't allowed
|
// null value isn't allowed
|
||||||
this.value = "";
|
this.value = "";
|
||||||
}
|
}
|
||||||
@@ -123,20 +127,21 @@ class Attribute extends Entity {
|
|||||||
this.isDeleted = false;
|
this.isDeleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.dateCreated) {
|
if (!this.utcDateCreated) {
|
||||||
this.dateCreated = dateUtils.nowDate();
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
if (this.isChanged) {
|
if (this.isChanged) {
|
||||||
this.dateModified = dateUtils.nowDate();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cannot be static!
|
// cannot be static!
|
||||||
updatePojo(pojo) {
|
updatePojo(pojo) {
|
||||||
delete pojo.isOwned;
|
delete pojo.isOwned;
|
||||||
|
delete pojo.__note;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,13 +155,13 @@ module.exports = Attribute;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -37,15 +37,15 @@ const sql = require('../services/sql');
|
|||||||
* Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId.
|
* 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.
|
* Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.
|
||||||
*
|
*
|
||||||
* @param {string} branchId - primary key
|
* @property {string} branchId - primary key
|
||||||
* @param {string} noteId
|
* @property {string} noteId
|
||||||
* @param {string} parentNoteId
|
* @property {string} parentNoteId
|
||||||
* @param {int} notePosition
|
* @property {int} notePosition
|
||||||
* @param {string} prefix
|
* @property {string} prefix
|
||||||
* @param {boolean} isExpanded
|
* @property {boolean} isExpanded
|
||||||
* @param {boolean} isDeleted
|
* @property {boolean} isDeleted
|
||||||
* @param {string} dateModified
|
* @property {string} utcDateModified
|
||||||
* @param {string} dateCreated
|
* @property {string} utcDateCreated
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
@@ -70,21 +70,25 @@ class Branch extends Entity {
|
|||||||
async beforeSaving() {
|
async beforeSaving() {
|
||||||
if (this.notePosition === undefined) {
|
if (this.notePosition === undefined) {
|
||||||
const maxNotePos = await sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
const maxNotePos = await sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
|
||||||
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 1;
|
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.isExpanded) {
|
||||||
|
this.isExpanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isDeleted) {
|
if (!this.isDeleted) {
|
||||||
this.isDeleted = false;
|
this.isDeleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.dateCreated) {
|
if (!this.utcDateCreated) {
|
||||||
this.dateCreated = dateUtils.nowDate();
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
if (this.isChanged) {
|
if (this.isChanged) {
|
||||||
this.dateModified = dateUtils.nowDate();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,13 +108,13 @@ module.exports = Branch;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -54,8 +54,14 @@ class Entity {
|
|||||||
|
|
||||||
this.hash = this.generateHash();
|
this.hash = this.generateHash();
|
||||||
|
|
||||||
|
if (this.forcedChange) {
|
||||||
|
this.isChanged = true;
|
||||||
|
delete this.forcedChange;
|
||||||
|
}
|
||||||
|
else {
|
||||||
this.isChanged = origHash !== this.hash;
|
this.isChanged = origHash !== this.hash;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
generateIdIfNecessary() {
|
generateIdIfNecessary() {
|
||||||
if (!this[this.constructor.primaryKeyName]) {
|
if (!this[this.constructor.primaryKeyName]) {
|
||||||
@@ -90,13 +96,13 @@ module.exports = Entity;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -41,15 +41,15 @@ const dateUtils = require('../services/date_utils');
|
|||||||
* @param {string} targetNoteId
|
* @param {string} targetNoteId
|
||||||
* @param {string} type
|
* @param {string} type
|
||||||
* @param {boolean} isDeleted
|
* @param {boolean} isDeleted
|
||||||
* @param {string} dateModified
|
* @param {string} utcDateModified
|
||||||
* @param {string} dateCreated
|
* @param {string} utcDateCreated
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
class Link extends Entity {
|
class Link extends Entity {
|
||||||
static get entityName() { return "links"; }
|
static get entityName() { return "links"; }
|
||||||
static get primaryKeyName() { return "linkId"; }
|
static get primaryKeyName() { return "linkId"; }
|
||||||
static get hashedProperties() { return ["linkId", "noteId", "targetNoteId", "type", "isDeleted", "dateCreated", "dateModified"]; }
|
static get hashedProperties() { return ["linkId", "noteId", "targetNoteId", "type", "isDeleted", "utcDateCreated", "utcDateModified"]; }
|
||||||
|
|
||||||
async getNote() {
|
async getNote() {
|
||||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||||
@@ -64,14 +64,14 @@ class Link extends Entity {
|
|||||||
this.isDeleted = false;
|
this.isDeleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.dateCreated) {
|
if (!this.utcDateCreated) {
|
||||||
this.dateCreated = dateUtils.nowDate();
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
if (this.isChanged) {
|
if (this.isChanged) {
|
||||||
this.dateModified = dateUtils.nowDate();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ module.exports = Link;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|||||||
@@ -30,19 +30,18 @@
|
|||||||
|
|
||||||
const Entity = require('./entity');
|
const Entity = require('./entity');
|
||||||
const Attribute = require('./attribute');
|
const Attribute = require('./attribute');
|
||||||
const NoteContent = require('./note_content');
|
|
||||||
const protectedSessionService = require('../services/protected_session');
|
const protectedSessionService = require('../services/protected_session');
|
||||||
const repository = require('../services/repository');
|
const repository = require('../services/repository');
|
||||||
const sql = require('../services/sql');
|
const sql = require('../services/sql');
|
||||||
|
const utils = require('../services/utils');
|
||||||
const dateUtils = require('../services/date_utils');
|
const dateUtils = require('../services/date_utils');
|
||||||
|
const syncTableService = require('../services/sync_table');
|
||||||
|
|
||||||
const LABEL = 'label';
|
const LABEL = 'label';
|
||||||
const LABEL_DEFINITION = 'label-definition';
|
const LABEL_DEFINITION = 'label-definition';
|
||||||
const RELATION = 'relation';
|
const RELATION = 'relation';
|
||||||
const RELATION_DEFINITION = 'relation-definition';
|
const RELATION_DEFINITION = 'relation-definition';
|
||||||
|
|
||||||
const STRING_MIME_TYPES = ["application/x-javascript"];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This represents a Note which is a central object in the Trilium Notes project.
|
* This represents a Note which is a central object in the Trilium Notes project.
|
||||||
*
|
*
|
||||||
@@ -50,10 +49,14 @@ const STRING_MIME_TYPES = ["application/x-javascript"];
|
|||||||
* @property {string} type - one of "text", "code", "file" or "render"
|
* @property {string} type - one of "text", "code", "file" or "render"
|
||||||
* @property {string} mime - MIME type, e.g. "text/html"
|
* @property {string} mime - MIME type, e.g. "text/html"
|
||||||
* @property {string} title - note title
|
* @property {string} title - note title
|
||||||
|
* @property {int} contentLength - length of content
|
||||||
* @property {boolean} isProtected - true if note is protected
|
* @property {boolean} isProtected - true if note is protected
|
||||||
* @property {boolean} isDeleted - true if note is deleted
|
* @property {boolean} isDeleted - true if note is deleted
|
||||||
* @property {string} dateCreated
|
* @property {boolean} isErased - true if note's content is erased after it has been deleted
|
||||||
* @property {string} dateModified
|
* @property {string} dateCreated - local date time (with offset)
|
||||||
|
* @property {string} dateModified - local date time (with offset)
|
||||||
|
* @property {string} utcDateCreated
|
||||||
|
* @property {string} utcDateModified
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
@@ -69,7 +72,7 @@ class Note extends Entity {
|
|||||||
super(row);
|
super(row);
|
||||||
|
|
||||||
this.isProtected = !!this.isProtected;
|
this.isProtected = !!this.isProtected;
|
||||||
/* true if content (meaning any kind of potentially encrypted content) is either not encrypted
|
/* true if content is either not encrypted
|
||||||
* or encrypted, but with available protected session (so effectively decrypted) */
|
* or encrypted, but with available protected session (so effectively decrypted) */
|
||||||
this.isContentAvailable = true;
|
this.isContentAvailable = true;
|
||||||
|
|
||||||
@@ -78,39 +81,56 @@ class Note extends Entity {
|
|||||||
this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
|
this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
|
||||||
|
|
||||||
if (this.isContentAvailable) {
|
if (this.isContentAvailable) {
|
||||||
protectedSessionService.decryptNote(this);
|
this.title = protectedSessionService.decryptString(this.title);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// saving ciphertexts in case we do want to update protected note outside of protected session
|
|
||||||
// (which is allowed)
|
|
||||||
this.titleCipherText = this.title;
|
|
||||||
this.title = "[protected]";
|
this.title = "[protected]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<NoteContent>} */
|
/*
|
||||||
async getNoteContent() {
|
* Note content has quite special handling - it's not a separate entity, but a lazily loaded
|
||||||
if (!this.noteContent) {
|
* part of Note entity with it's own sync. Reasons behind this hybrid design has been:
|
||||||
this.noteContent = await repository.getEntity(`SELECT * FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
*
|
||||||
|
* - 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)
|
||||||
|
* - 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)
|
||||||
|
*/
|
||||||
|
|
||||||
if (!this.noteContent) {
|
/** @returns {Promise<*>} */
|
||||||
throw new Error("Note content not found for noteId=" + this.noteId);
|
async getContent(silentNotFoundError = false) {
|
||||||
|
if (this.content === undefined) {
|
||||||
|
const res = await sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
|
||||||
|
|
||||||
|
if (!res) {
|
||||||
|
if (silentNotFoundError) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Error("Cannot find note content for noteId=" + this.noteId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.content = res.content;
|
||||||
|
|
||||||
|
if (this.isProtected) {
|
||||||
|
if (this.isContentAvailable) {
|
||||||
|
this.content = this.content === null ? null : protectedSessionService.decrypt(this.content);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.content = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isStringNote()) {
|
if (this.isStringNote()) {
|
||||||
this.noteContent.content = this.noteContent.content.toString("UTF-8");
|
this.content = this.content === null
|
||||||
|
? ""
|
||||||
|
: this.content.toString("UTF-8");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.noteContent;
|
return this.content;
|
||||||
}
|
|
||||||
|
|
||||||
/** @returns {Promise<*>} */
|
|
||||||
async getContent() {
|
|
||||||
const noteContent = await this.getNoteContent();
|
|
||||||
|
|
||||||
return noteContent.content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<*>} */
|
/** @returns {Promise<*>} */
|
||||||
@@ -122,14 +142,36 @@ class Note extends Entity {
|
|||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise} */
|
||||||
async setContent(content) {
|
async setContent(content) {
|
||||||
if (!this.noteContent) {
|
if (content === null || content === undefined) {
|
||||||
// make sure it is loaded
|
throw new Error(`Cannot set null content to note ${this.noteId}`);
|
||||||
await this.getNoteContent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.noteContent.content = content;
|
// force updating note itself so that dateModified is represented correctly even for the content
|
||||||
|
this.forcedChange = true;
|
||||||
|
this.contentLength = content.length;
|
||||||
|
await this.save();
|
||||||
|
|
||||||
await this.noteContent.save();
|
this.content = content;
|
||||||
|
|
||||||
|
const pojo = {
|
||||||
|
noteId: this.noteId,
|
||||||
|
content: content,
|
||||||
|
utcDateModified: dateUtils.utcNowDateTime(),
|
||||||
|
hash: utils.hash(this.noteId + "|" + content)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.isProtected) {
|
||||||
|
if (this.isContentAvailable) {
|
||||||
|
pojo.content = protectedSessionService.encrypt(pojo.content);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Error(`Cannot update content of noteId=${this.noteId} since we're out of protected session.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await sql.upsert("note_contents", "noteId", pojo);
|
||||||
|
|
||||||
|
await syncTableService.addNoteContentSync(this.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise} */
|
/** @returns {Promise} */
|
||||||
@@ -162,9 +204,7 @@ class Note extends Entity {
|
|||||||
|
|
||||||
/** @returns {boolean} true if the note has string content (not binary) */
|
/** @returns {boolean} true if the note has string content (not binary) */
|
||||||
isStringNote() {
|
isStringNote() {
|
||||||
return ["text", "code", "relation-map", "search"].includes(this.type)
|
return utils.isStringNote(this.type, this.mime);
|
||||||
|| this.mime.startsWith('text/')
|
|
||||||
|| STRING_MIME_TYPES.includes(this.mime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {string} JS script environment - either "frontend" or "backend" */
|
/** @returns {string} JS script environment - either "frontend" or "backend" */
|
||||||
@@ -184,11 +224,47 @@ class Note extends Entity {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async loadOwnedAttributesToCache() {
|
||||||
|
this.__ownedAttributeCache = await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
|
||||||
|
return this.__ownedAttributeCache;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Promise<Attribute[]>} attributes belonging to this specific note (excludes inherited attributes)
|
* This method is a faster variant of getAttributes() which looks for only owned attributes.
|
||||||
|
* Use when inheritance is not needed and/or in batch/performance sensitive operations.
|
||||||
|
*
|
||||||
|
* @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
|
||||||
*/
|
*/
|
||||||
async getOwnedAttributes() {
|
async getOwnedAttributes(type, name) {
|
||||||
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
|
if (!this.__ownedAttributeCache) {
|
||||||
|
await this.loadOwnedAttributesToCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type && name) {
|
||||||
|
return this.__ownedAttributeCache.filter(attr => attr.type === type && attr.name === name);
|
||||||
|
}
|
||||||
|
else if (type) {
|
||||||
|
return this.__ownedAttributeCache.filter(attr => attr.type === type);
|
||||||
|
}
|
||||||
|
else if (name) {
|
||||||
|
return this.__ownedAttributeCache.filter(attr => attr.name === name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this.__ownedAttributeCache.slice();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {Promise<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);
|
||||||
|
|
||||||
|
return attrs.length > 0 ? attrs[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,19 +275,26 @@ class Note extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} [name] - attribute name to filter
|
* @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 {Promise<Attribute[]>} all note's attributes, including inherited ones
|
||||||
*/
|
*/
|
||||||
async getAttributes(name) {
|
async getAttributes(type, name) {
|
||||||
if (!this.__attributeCache) {
|
if (!this.__attributeCache) {
|
||||||
await this.loadAttributesToCache();
|
await this.loadAttributesToCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name) {
|
if (type && name) {
|
||||||
|
return this.__attributeCache.filter(attr => attr.type === type && attr.name === name);
|
||||||
|
}
|
||||||
|
else if (type) {
|
||||||
|
return this.__attributeCache.filter(attr => attr.type === type);
|
||||||
|
}
|
||||||
|
else if (name) {
|
||||||
return this.__attributeCache.filter(attr => attr.name === name);
|
return this.__attributeCache.filter(attr => attr.name === name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return this.__attributeCache;
|
return this.__attributeCache.slice();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +303,15 @@ class Note extends Entity {
|
|||||||
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones
|
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones
|
||||||
*/
|
*/
|
||||||
async getLabels(name) {
|
async getLabels(name) {
|
||||||
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
|
return await 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
|
||||||
|
*/
|
||||||
|
async getOwnedLabels(name) {
|
||||||
|
return await this.getOwnedAttributes(LABEL, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -228,7 +319,7 @@ class Note extends Entity {
|
|||||||
* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones
|
* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones
|
||||||
*/
|
*/
|
||||||
async getLabelDefinitions(name) {
|
async getLabelDefinitions(name) {
|
||||||
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);
|
return await this.getAttributes(LABEL_DEFINITION, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -236,7 +327,30 @@ class Note extends Entity {
|
|||||||
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones
|
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones
|
||||||
*/
|
*/
|
||||||
async getRelations(name) {
|
async getRelations(name) {
|
||||||
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
|
return await 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
|
||||||
|
*/
|
||||||
|
async getOwnedRelations(name) {
|
||||||
|
return await this.getOwnedAttributes(RELATION, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} [name] - relation name to filter
|
||||||
|
* @returns {Promise<Note[]>}
|
||||||
|
*/
|
||||||
|
async getRelationTargets(name) {
|
||||||
|
const relations = await this.getRelations(name);
|
||||||
|
const targets = [];
|
||||||
|
|
||||||
|
for (const relation of relations) {
|
||||||
|
targets.push(await relation.getTargetNote());
|
||||||
|
}
|
||||||
|
|
||||||
|
return targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -244,7 +358,7 @@ class Note extends Entity {
|
|||||||
* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones
|
* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones
|
||||||
*/
|
*/
|
||||||
async getRelationDefinitions(name) {
|
async getRelationDefinitions(name) {
|
||||||
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);
|
return await this.getAttributes(RELATION_DEFINITION, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -253,6 +367,7 @@ class Note extends Entity {
|
|||||||
*/
|
*/
|
||||||
invalidateAttributeCache() {
|
invalidateAttributeCache() {
|
||||||
this.__attributeCache = null;
|
this.__attributeCache = null;
|
||||||
|
this.__ownedAttributeCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {Promise<void>} */
|
/** @returns {Promise<void>} */
|
||||||
@@ -262,29 +377,33 @@ class Note extends Entity {
|
|||||||
tree(noteId, level) AS (
|
tree(noteId, level) AS (
|
||||||
SELECT ?, 0
|
SELECT ?, 0
|
||||||
UNION
|
UNION
|
||||||
SELECT branches.parentNoteId, tree.level + 1 FROM branches
|
SELECT branches.parentNoteId, tree.level + 1
|
||||||
|
FROM branches
|
||||||
JOIN tree ON branches.noteId = tree.noteId
|
JOIN tree ON branches.noteId = tree.noteId
|
||||||
JOIN notes ON notes.noteId = branches.parentNoteId
|
WHERE branches.isDeleted = 0
|
||||||
WHERE notes.isDeleted = 0
|
|
||||||
AND branches.isDeleted = 0
|
|
||||||
),
|
),
|
||||||
treeWithAttrs(noteId, level) AS (
|
treeWithAttrs(noteId, level) AS (
|
||||||
SELECT * FROM tree
|
SELECT * FROM tree
|
||||||
UNION
|
UNION
|
||||||
SELECT attributes.value, treeWithAttrs.level + 1 FROM attributes
|
SELECT attributes.value, treeWithAttrs.level FROM attributes
|
||||||
JOIN treeWithAttrs ON treeWithAttrs.noteId = attributes.noteId
|
JOIN treeWithAttrs ON treeWithAttrs.noteId = attributes.noteId
|
||||||
WHERE attributes.isDeleted = 0
|
WHERE attributes.isDeleted = 0
|
||||||
AND attributes.type = 'relation'
|
AND attributes.type = 'relation'
|
||||||
AND attributes.name = 'template'
|
AND attributes.name = 'template'
|
||||||
AND (attributes.noteId = ? OR attributes.isInheritable = 1)
|
AND (treeWithAttrs.level = 0 OR attributes.isInheritable = 1)
|
||||||
)
|
)
|
||||||
SELECT attributes.* FROM attributes JOIN treeWithAttrs ON attributes.noteId = treeWithAttrs.noteId
|
SELECT attributes.* FROM attributes JOIN treeWithAttrs ON attributes.noteId = treeWithAttrs.noteId
|
||||||
WHERE attributes.isDeleted = 0 AND (attributes.isInheritable = 1 OR attributes.noteId = ?)
|
WHERE attributes.isDeleted = 0 AND (attributes.isInheritable = 1 OR treeWithAttrs.level = 0)
|
||||||
ORDER BY level, noteId, position`, [this.noteId, this.noteId, this.noteId]);
|
ORDER BY level, noteId, position`, [this.noteId]);
|
||||||
// attributes are ordered so that "closest" attributes are first
|
// attributes are ordered so that "closest" attributes are first
|
||||||
// we order by noteId so that attributes from same note stay together. Actual noteId ordering doesn't matter.
|
// we order by noteId so that attributes from same note stay together. Actual noteId ordering doesn't matter.
|
||||||
|
|
||||||
const filteredAttributes = attributes.filter((attr, index) => {
|
const filteredAttributes = attributes.filter((attr, index) => {
|
||||||
|
// if this exact attribute already appears then don't include it (can happen via cloning)
|
||||||
|
if (attributes.findIndex(it => it.attributeId === attr.attributeId) !== index) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (attr.isDefinition()) {
|
if (attr.isDefinition()) {
|
||||||
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);
|
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);
|
||||||
|
|
||||||
@@ -328,6 +447,15 @@ class Note extends Entity {
|
|||||||
return !!await this.getAttribute(type, name);
|
return !!await 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)
|
||||||
|
*/
|
||||||
|
async hasOwnedAttribute(type, name) {
|
||||||
|
return !!await this.getOwnedAttribute(type, name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
@@ -342,7 +470,7 @@ class Note extends Entity {
|
|||||||
/**
|
/**
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
* @returns {Promise<string>} attribute value of given type and name or null if no such attribute exists.
|
* @returns {Promise<string|null>} attribute value of given type and name or null if no such attribute exists.
|
||||||
*/
|
*/
|
||||||
async getAttributeValue(type, name) {
|
async getAttributeValue(type, name) {
|
||||||
const attr = await this.getAttribute(type, name);
|
const attr = await this.getAttribute(type, name);
|
||||||
@@ -350,6 +478,17 @@ class Note extends Entity {
|
|||||||
return attr ? attr.value : null;
|
return attr ? attr.value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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.
|
||||||
|
*/
|
||||||
|
async getOwnedAttributeValue(type, name) {
|
||||||
|
const attr = await this.getOwnedAttribute(type, name);
|
||||||
|
|
||||||
|
return attr ? attr.value : null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Based on enabled, attribute is either set or removed.
|
* Based on enabled, attribute is either set or removed.
|
||||||
*
|
*
|
||||||
@@ -369,7 +508,7 @@ class Note extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates given attribute name-value pair if it doesn't exist.
|
* Update's given attribute's value or creates it if it doesn't exist
|
||||||
*
|
*
|
||||||
* @param {string} type - attribute type (label, relation, etc.)
|
* @param {string} type - attribute type (label, relation, etc.)
|
||||||
* @param {string} name - attribute name
|
* @param {string} name - attribute name
|
||||||
@@ -377,10 +516,18 @@ class Note extends Entity {
|
|||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async setAttribute(type, name, value) {
|
async setAttribute(type, name, value) {
|
||||||
const attributes = await this.getOwnedAttributes();
|
const attributes = await this.loadOwnedAttributesToCache();
|
||||||
let attr = attributes.find(attr => attr.type === type && (value === undefined || attr.value === value));
|
let attr = attributes.find(attr => attr.type === type && attr.name === name);
|
||||||
|
|
||||||
if (!attr) {
|
if (attr) {
|
||||||
|
if (attr.value !== value) {
|
||||||
|
attr.value = value;
|
||||||
|
await attr.save();
|
||||||
|
|
||||||
|
this.invalidateAttributeCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
attr = new Attribute({
|
attr = new Attribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
@@ -403,10 +550,10 @@ class Note extends Entity {
|
|||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async removeAttribute(type, name, value) {
|
async removeAttribute(type, name, value) {
|
||||||
const attributes = await this.getOwnedAttributes();
|
const attributes = await this.loadOwnedAttributesToCache();
|
||||||
|
|
||||||
for (const attribute of attributes) {
|
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;
|
attribute.isDeleted = true;
|
||||||
await attribute.save();
|
await attribute.save();
|
||||||
|
|
||||||
@@ -415,42 +562,104 @@ class Note extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {Promise<Attribute>}
|
||||||
|
*/
|
||||||
|
async addAttribute(type, name, value = "") {
|
||||||
|
const attr = new Attribute({
|
||||||
|
noteId: this.noteId,
|
||||||
|
type: type,
|
||||||
|
name: name,
|
||||||
|
value: value
|
||||||
|
});
|
||||||
|
|
||||||
|
await attr.save();
|
||||||
|
|
||||||
|
this.invalidateAttributeCache();
|
||||||
|
|
||||||
|
return attr;
|
||||||
|
}
|
||||||
|
|
||||||
|
async addLabel(name, value = "") {
|
||||||
|
return await this.addAttribute(LABEL, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
async addRelation(name, targetNoteId) {
|
||||||
|
return await this.addAttribute(RELATION, name, targetNoteId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Promise<boolean>} true if label exists (including inherited)
|
* @returns {Promise<boolean>} true if label exists (including inherited)
|
||||||
*/
|
*/
|
||||||
async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
|
async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name - label name
|
||||||
|
* @returns {Promise<boolean>} true if label exists (excluding inherited)
|
||||||
|
*/
|
||||||
|
async hasOwnedLabel(name) { return await this.hasOwnedAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Promise<boolean>} true if relation exists (including inherited)
|
* @returns {Promise<boolean>} true if relation exists (including inherited)
|
||||||
*/
|
*/
|
||||||
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
|
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name - relation name
|
||||||
|
* @returns {Promise<boolean>} true if relation exists (excluding inherited)
|
||||||
|
*/
|
||||||
|
async hasOwnedRelation(name) { return await this.hasOwnedAttribute(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Promise<Attribute>} label if it exists, null otherwise
|
* @returns {Promise<Attribute|null>} label if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
async getLabel(name) { return await this.getAttribute(LABEL, name); }
|
async getLabel(name) { return await this.getAttribute(LABEL, name); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name - label name
|
||||||
|
* @returns {Promise<Attribute|null>} label if it exists, null otherwise
|
||||||
|
*/
|
||||||
|
async getOwnedLabel(name) { return await this.getOwnedAttribute(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Promise<Attribute>} relation if it exists, null otherwise
|
* @returns {Promise<Attribute|null>} relation if it exists, null otherwise
|
||||||
*/
|
*/
|
||||||
async getRelation(name) { return await this.getAttribute(RELATION, name); }
|
async getRelation(name) { return await this.getAttribute(RELATION, name); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name - relation name
|
||||||
|
* @returns {Promise<Attribute|null>} relation if it exists, null otherwise
|
||||||
|
*/
|
||||||
|
async getOwnedRelation(name) { return await this.getOwnedAttribute(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @returns {Promise<string>} label value if label exists, null otherwise
|
* @returns {Promise<string|null>} label value if label exists, null otherwise
|
||||||
*/
|
*/
|
||||||
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
|
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name - label name
|
||||||
|
* @returns {Promise<string|null>} label value if label exists, null otherwise
|
||||||
|
*/
|
||||||
|
async getOwnedLabelValue(name) { return await this.getOwnedAttributeValue(LABEL, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @returns {Promise<string>} relation value if relation exists, null otherwise
|
* @returns {Promise<string|null>} relation value if relation exists, null otherwise
|
||||||
*/
|
*/
|
||||||
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
|
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} name - relation name
|
||||||
|
* @returns {Promise<string|null>} relation value if relation exists, null otherwise
|
||||||
|
*/
|
||||||
|
async getOwnedRelationValue(name) { return await this.getOwnedAttributeValue(RELATION, name); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} 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 {Promise<Note>|null} target note of the relation or null (if target is empty or note was not found)
|
||||||
@@ -461,6 +670,16 @@ class Note extends Entity {
|
|||||||
return relation ? await repository.getNote(relation.value) : null;
|
return relation ? await 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)
|
||||||
|
*/
|
||||||
|
async getOwnedRelationTarget(name) {
|
||||||
|
const relation = await this.getOwnedRelation(name);
|
||||||
|
|
||||||
|
return relation ? await repository.getNote(relation.value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Based on enabled, label is either set or removed.
|
* Based on enabled, label is either set or removed.
|
||||||
*
|
*
|
||||||
@@ -482,7 +701,7 @@ class Note extends Entity {
|
|||||||
async toggleRelation(enabled, name, value) { return await this.toggleAttribute(RELATION, enabled, name, value); }
|
async toggleRelation(enabled, name, value) { return await this.toggleAttribute(RELATION, enabled, name, value); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create label name-value pair if it doesn't exist yet.
|
* Update's given label's value or creates it if it doesn't exist
|
||||||
*
|
*
|
||||||
* @param {string} name - label name
|
* @param {string} name - label name
|
||||||
* @param {string} [value] - label value
|
* @param {string} [value] - label value
|
||||||
@@ -491,7 +710,7 @@ class Note extends Entity {
|
|||||||
async setLabel(name, value) { return await this.setAttribute(LABEL, name, value); }
|
async setLabel(name, value) { return await this.setAttribute(LABEL, name, value); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create relation name-value pair if it doesn't exist yet.
|
* Update's given relation's value or creates it if it doesn't exist
|
||||||
*
|
*
|
||||||
* @param {string} name - relation name
|
* @param {string} name - relation name
|
||||||
* @param {string} [value] - relation value (noteId)
|
* @param {string} [value] - relation value (noteId)
|
||||||
@@ -604,28 +823,17 @@ class Note extends Entity {
|
|||||||
/**
|
/**
|
||||||
* Get list of links coming out of this note.
|
* Get list of links coming out of this note.
|
||||||
*
|
*
|
||||||
* @returns {Promise<Link[]>}
|
* @deprecated - not intended for general use
|
||||||
|
* @returns {Promise<Attribute[]>}
|
||||||
*/
|
*/
|
||||||
async getLinks() {
|
async getLinks() {
|
||||||
return await repository.getEntities("SELECT * FROM links WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
|
return await repository.getEntities(`
|
||||||
}
|
SELECT *
|
||||||
|
FROM attributes
|
||||||
/**
|
WHERE noteId = ? AND
|
||||||
* Get list of links targetting this note.
|
isDeleted = 0 AND
|
||||||
*
|
type = 'relation' AND
|
||||||
* @returns {Promise<Link[]>}
|
name IN ('internalLink', 'imageLink', 'relationMapLink')`, [this.noteId]);
|
||||||
*/
|
|
||||||
async getTargetLinks() {
|
|
||||||
return await repository.getEntities("SELECT * FROM links WHERE targetNoteId = ? AND isDeleted = 0", [this.noteId]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all links from this note, including deleted ones.
|
|
||||||
*
|
|
||||||
* @returns {Promise<Link[]>}
|
|
||||||
*/
|
|
||||||
async getLinksWithDeleted() {
|
|
||||||
return await repository.getEntities("SELECT * FROM links WHERE noteId = ?", [this.noteId]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -682,19 +890,58 @@ class Note extends Entity {
|
|||||||
AND parent_notes.isDeleted = 0`, [this.noteId]);
|
AND parent_notes.isDeleted = 0`, [this.noteId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {Promise<string[][]>} - array of notePaths (each represented by array of noteIds constituting the particular note path)
|
||||||
|
*/
|
||||||
|
async getAllNotePaths() {
|
||||||
|
if (this.noteId === 'root') {
|
||||||
|
return [['root']];
|
||||||
|
}
|
||||||
|
|
||||||
|
const notePaths = [];
|
||||||
|
|
||||||
|
for (const parentNote of await this.getParentNotes()) {
|
||||||
|
for (const parentPath of await parentNote.getAllNotePaths()) {
|
||||||
|
parentPath.push(this.noteId);
|
||||||
|
notePaths.push(parentPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return notePaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ancestorNoteId
|
||||||
|
* @return {Promise<boolean>} - true if ancestorNoteId occurs in at least one of the note's paths
|
||||||
|
*/
|
||||||
|
async isDescendantOfNote(ancestorNoteId) {
|
||||||
|
const notePaths = await this.getAllNotePaths();
|
||||||
|
|
||||||
|
return notePaths.some(path => path.includes(ancestorNoteId));
|
||||||
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
if (!this.isDeleted) {
|
if (!this.isDeleted) {
|
||||||
this.isDeleted = false;
|
this.isDeleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.dateCreated) {
|
if (!this.dateCreated) {
|
||||||
this.dateCreated = dateUtils.nowDate();
|
this.dateCreated = dateUtils.localNowDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.utcDateCreated) {
|
||||||
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.contentLength === undefined) {
|
||||||
|
this.contentLength = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
if (this.isChanged) {
|
if (this.isChanged) {
|
||||||
this.dateModified = dateUtils.nowDate();
|
this.dateModified = dateUtils.localNowDateTime();
|
||||||
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,18 +949,20 @@ class Note extends Entity {
|
|||||||
updatePojo(pojo) {
|
updatePojo(pojo) {
|
||||||
if (pojo.isProtected) {
|
if (pojo.isProtected) {
|
||||||
if (this.isContentAvailable) {
|
if (this.isContentAvailable) {
|
||||||
protectedSessionService.encryptNote(pojo);
|
pojo.title = protectedSessionService.encrypt(pojo.title);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// updating protected note outside of protected session means we will keep original ciphertexts
|
// updating protected note outside of protected session means we will keep original ciphertexts
|
||||||
pojo.title = pojo.titleCipherText;
|
delete pojo.title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pojo.isContentAvailable;
|
delete pojo.isContentAvailable;
|
||||||
delete pojo.__attributeCache;
|
delete pojo.__attributeCache;
|
||||||
delete pojo.titleCipherText;
|
delete pojo.__ownedAttributeCache;
|
||||||
delete pojo.noteContent;
|
delete pojo.content;
|
||||||
|
/** zero references to contentHash, probably can be removed */
|
||||||
|
delete pojo.contentHash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,13 +976,13 @@ module.exports = Note;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -1,146 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>JSDoc: Source: entities/note_content.js</title>
|
|
||||||
|
|
||||||
<script src="scripts/prettify/prettify.js"> </script>
|
|
||||||
<script src="scripts/prettify/lang-css.js"> </script>
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
||||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="main">
|
|
||||||
|
|
||||||
<h1 class="page-title">Source: entities/note_content.js</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<section>
|
|
||||||
<article>
|
|
||||||
<pre class="prettyprint source linenums"><code>"use strict";
|
|
||||||
|
|
||||||
const Entity = require('./entity');
|
|
||||||
const protectedSessionService = require('../services/protected_session');
|
|
||||||
const repository = require('../services/repository');
|
|
||||||
const dateUtils = require('../services/date_utils');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This represents a Note which is a central object in the Trilium Notes project.
|
|
||||||
*
|
|
||||||
* @property {string} noteContentId - primary key
|
|
||||||
* @property {string} noteId - reference to owning note
|
|
||||||
* @property {boolean} isProtected - true if note content is protected
|
|
||||||
* @property {blob} content - note content - e.g. HTML text for text notes, file payload for files
|
|
||||||
* @property {string} dateCreated
|
|
||||||
* @property {string} dateModified
|
|
||||||
*
|
|
||||||
* @extends Entity
|
|
||||||
*/
|
|
||||||
class NoteContent extends Entity {
|
|
||||||
static get entityName() {
|
|
||||||
return "note_contents";
|
|
||||||
}
|
|
||||||
|
|
||||||
static get primaryKeyName() {
|
|
||||||
return "noteContentId";
|
|
||||||
}
|
|
||||||
|
|
||||||
static get hashedProperties() {
|
|
||||||
return ["noteContentId", "noteId", "isProtected", "content"];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param row - object containing database row from "note_contents" table
|
|
||||||
*/
|
|
||||||
constructor(row) {
|
|
||||||
super(row);
|
|
||||||
|
|
||||||
this.isProtected = !!this.isProtected;
|
|
||||||
/* true if content (meaning any kind of potentially encrypted content) is either not encrypted
|
|
||||||
* or encrypted, but with available protected session (so effectively decrypted) */
|
|
||||||
this.isContentAvailable = true;
|
|
||||||
|
|
||||||
// check if there's noteContentId, otherwise this is a new entity which wasn't encrypted yet
|
|
||||||
if (this.isProtected && this.noteContentId) {
|
|
||||||
this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
|
|
||||||
|
|
||||||
if (this.isContentAvailable) {
|
|
||||||
protectedSessionService.decryptNoteContent(this);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// saving ciphertexts in case we do want to update protected note outside of protected session
|
|
||||||
// (which is allowed)
|
|
||||||
this.contentCipherText = this.content;
|
|
||||||
this.content = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {Promise<Note>}
|
|
||||||
*/
|
|
||||||
async getNote() {
|
|
||||||
return await repository.getNote(this.noteId);
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeSaving() {
|
|
||||||
if (!this.dateCreated) {
|
|
||||||
this.dateCreated = dateUtils.nowDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
super.beforeSaving();
|
|
||||||
|
|
||||||
if (this.isChanged) {
|
|
||||||
this.dateModified = dateUtils.nowDate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// cannot be static!
|
|
||||||
updatePojo(pojo) {
|
|
||||||
if (pojo.isProtected) {
|
|
||||||
if (this.isContentAvailable) {
|
|
||||||
protectedSessionService.encryptNoteContent(pojo);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// updating protected note outside of protected session means we will keep original ciphertext
|
|
||||||
pojo.content = pojo.contentCipherText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete pojo.isContentAvailable;
|
|
||||||
delete pojo.contentCipherText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = NoteContent;</code></pre>
|
|
||||||
</article>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<br class="clear">
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
|
||||||
<script src="scripts/linenumber.js"> </script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -31,26 +31,34 @@
|
|||||||
const Entity = require('./entity');
|
const Entity = require('./entity');
|
||||||
const protectedSessionService = require('../services/protected_session');
|
const protectedSessionService = require('../services/protected_session');
|
||||||
const repository = require('../services/repository');
|
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');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
|
* NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
|
||||||
*
|
*
|
||||||
* @param {string} noteRevisionId
|
* @property {string} noteRevisionId
|
||||||
* @param {string} noteId
|
* @property {string} noteId
|
||||||
* @param {string} type
|
* @property {string} type
|
||||||
* @param {string} mime
|
* @property {string} mime
|
||||||
* @param {string} title
|
* @property {string} title
|
||||||
* @param {string} content
|
* @property {int} contentLength
|
||||||
* @param {string} isProtected
|
* @property {boolean} isErased
|
||||||
* @param {string} dateModifiedFrom
|
* @property {boolean} isProtected
|
||||||
* @param {string} dateModifiedTo
|
* @property {string} dateLastEdited
|
||||||
|
* @property {string} dateCreated
|
||||||
|
* @property {string} utcDateLastEdited
|
||||||
|
* @property {string} utcDateCreated
|
||||||
|
* @property {string} utcDateModified
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
class NoteRevision extends Entity {
|
class NoteRevision extends Entity {
|
||||||
static get entityName() { return "note_revisions"; }
|
static get entityName() { return "note_revisions"; }
|
||||||
static get primaryKeyName() { return "noteRevisionId"; }
|
static get primaryKeyName() { return "noteRevisionId"; }
|
||||||
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "content", "isProtected", "dateModifiedFrom", "dateModifiedTo"]; }
|
static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "contentLength", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
|
||||||
|
|
||||||
constructor(row) {
|
constructor(row) {
|
||||||
super(row);
|
super(row);
|
||||||
@@ -58,7 +66,12 @@ class NoteRevision extends Entity {
|
|||||||
this.isProtected = !!this.isProtected;
|
this.isProtected = !!this.isProtected;
|
||||||
|
|
||||||
if (this.isProtected) {
|
if (this.isProtected) {
|
||||||
protectedSessionService.decryptNoteRevision(this);
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
|
this.title = protectedSessionService.decryptString(this.title);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.title = "[Protected]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,12 +79,106 @@ class NoteRevision extends Entity {
|
|||||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
/** @returns {boolean} true if the note has string content (not binary) */
|
||||||
if (this.isProtected) {
|
isStringNote() {
|
||||||
protectedSessionService.encryptNoteRevision(this);
|
return utils.isStringNote(this.type, this.mime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note revision content has quite special handling - it's not a separate entity, but a lazily loaded
|
||||||
|
* part of NoteRevision entity with it's own sync. Reason behind this hybrid design is that
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* This is the same approach as is used for Note's content.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @returns {Promise<*>} */
|
||||||
|
async getContent(silentNotFoundError = false) {
|
||||||
|
if (this.content === undefined) {
|
||||||
|
const res = await sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
|
||||||
|
|
||||||
|
if (!res) {
|
||||||
|
if (silentNotFoundError) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Error("Cannot find note revision content for noteRevisionId=" + this.noteRevisionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.content = res.content;
|
||||||
|
|
||||||
|
if (this.isProtected) {
|
||||||
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
|
this.content = protectedSessionService.decrypt(this.content);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.content = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isStringNote()) {
|
||||||
|
this.content = this.content === null
|
||||||
|
? ""
|
||||||
|
: this.content.toString("UTF-8");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
this.content = content;
|
||||||
|
|
||||||
|
const pojo = {
|
||||||
|
noteRevisionId: this.noteRevisionId,
|
||||||
|
content: content,
|
||||||
|
utcDateModified: dateUtils.utcNowDateTime(),
|
||||||
|
hash: utils.hash(this.noteRevisionId + "|" + content)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.isProtected) {
|
||||||
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
|
pojo.content = protectedSessionService.encrypt(pojo.content);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Error(`Cannot update content of noteRevisionId=${this.noteRevisionId} since we're out of protected session.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await sql.upsert("note_revision_contents", "noteRevisionId", pojo);
|
||||||
|
|
||||||
|
await syncTableService.addNoteRevisionContentSync(this.noteRevisionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeSaving() {
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
|
if (this.isChanged) {
|
||||||
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// cannot be static!
|
||||||
|
updatePojo(pojo) {
|
||||||
|
if (pojo.isProtected) {
|
||||||
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
|
pojo.title = protectedSessionService.encrypt(pojo.title);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// updating protected note outside of protected session means we will keep original ciphertexts
|
||||||
|
delete pojo.title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete pojo.content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,13 +192,13 @@ module.exports = NoteRevision;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ const dateUtils = require('../services/date_utils');
|
|||||||
/**
|
/**
|
||||||
* Option represents name-value pair, either directly configurable by the user or some system property.
|
* Option represents name-value pair, either directly configurable by the user or some system property.
|
||||||
*
|
*
|
||||||
* @param {string} name
|
* @property {string} name
|
||||||
* @param {string} value
|
* @property {string} value
|
||||||
* @param {boolean} isSynced
|
* @property {boolean} isSynced
|
||||||
* @param {string} dateModified
|
* @property {string} utcDateModified
|
||||||
* @param {string} dateCreated
|
* @property {string} utcDateCreated
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
@@ -54,10 +54,14 @@ class Option extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
|
if (!this.utcDateCreated) {
|
||||||
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
if (this.isChanged) {
|
if (this.isChanged) {
|
||||||
this.dateModified = dateUtils.nowDate();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,13 +76,13 @@ module.exports = Option;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -34,25 +34,25 @@ const dateUtils = require('../services/date_utils');
|
|||||||
/**
|
/**
|
||||||
* RecentNote represents recently visited note.
|
* RecentNote represents recently visited note.
|
||||||
*
|
*
|
||||||
* @param {string} branchId
|
* @property {string} noteId
|
||||||
* @param {string} notePath
|
* @property {string} notePath
|
||||||
* @param {boolean} isDeleted
|
* @property {boolean} isDeleted
|
||||||
* @param {string} dateModified
|
* @property {string} utcDateModified
|
||||||
*
|
*
|
||||||
* @extends Entity
|
* @extends Entity
|
||||||
*/
|
*/
|
||||||
class RecentNote extends Entity {
|
class RecentNote extends Entity {
|
||||||
static get entityName() { return "recent_notes"; }
|
static get entityName() { return "recent_notes"; }
|
||||||
static get primaryKeyName() { return "branchId"; }
|
static get primaryKeyName() { return "noteId"; }
|
||||||
static get hashedProperties() { return ["branchId", "notePath", "dateCreated", "isDeleted"]; }
|
static get hashedProperties() { return ["noteId", "notePath", "utcDateCreated", "isDeleted"]; }
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
if (!this.isDeleted) {
|
if (!this.isDeleted) {
|
||||||
this.isDeleted = false;
|
this.isDeleted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.dateCreated) {
|
if (!this.utcDateCreated) {
|
||||||
this.dateCreated = dateUtils.nowDate();
|
this.utcDateCreated = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
@@ -69,13 +69,13 @@ module.exports = RecentNote;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -102,6 +102,313 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h4 class="name" id="CreateNewNoteParams">CreateNewNoteParams</h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h5>Type:</h5>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class="param-type">object</span>
|
||||||
|
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>Name</th>
|
||||||
|
|
||||||
|
|
||||||
|
<th>Type</th>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<th class="last">Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>parentNoteId</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">MANDATORY</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>title</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">MANDATORY</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>content</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
|
||||||
|
|
||||||
|
<span class="param-type">buffer</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">MANDATORY</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>type</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">text, code, file, image, search, book, relation-map - MANDATORY</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>mime</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">value is derived from default mimes for type</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>isProtected</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">boolean</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">default is false</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>isExpanded</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">boolean</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">default is false</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>prefix</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">default is empty string</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>notePosition</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">int</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">default is last existing notePosition in a parent + 10</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
|
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
|
||||||
|
|
||||||
|
|
||||||
@@ -272,7 +579,195 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line149">line 149</a>
|
<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>
|
||||||
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h5>Type:</h5>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class="param-type">object</span>
|
||||||
|
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h5 class="subsection-title">Properties:</h5>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="props">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>Name</th>
|
||||||
|
|
||||||
|
|
||||||
|
<th>Type</th>
|
||||||
|
|
||||||
|
|
||||||
|
<th>Attributes</th>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<th class="last">Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>type</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="attributes">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">attribute type - label, relation etc.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>name</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="attributes">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">attribute name</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td class="name"><code>value</code></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="type">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="param-type">string</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="attributes">
|
||||||
|
|
||||||
|
<optional><br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td class="description last">attribute value</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dl class="details">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -558,7 +1053,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line156">line 156</a>
|
<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>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -588,13 +1083,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -50,13 +50,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*global document */
|
/*global document */
|
||||||
(function() {
|
(() => {
|
||||||
var source = document.getElementsByClassName('prettyprint source linenums');
|
const source = document.getElementsByClassName('prettyprint source linenums');
|
||||||
var i = 0;
|
let i = 0;
|
||||||
var lineNumber = 0;
|
let lineNumber = 0;
|
||||||
var lineId;
|
let lineId;
|
||||||
var lines;
|
let lines;
|
||||||
var totalLines;
|
let totalLines;
|
||||||
var anchorHash;
|
let anchorHash;
|
||||||
|
|
||||||
if (source && source[0]) {
|
if (source && source[0]) {
|
||||||
anchorHash = document.location.hash.substring(1);
|
anchorHash = document.location.hash.substring(1);
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
for (; i < totalLines; i++) {
|
for (; i < totalLines; i++) {
|
||||||
lineNumber++;
|
lineNumber++;
|
||||||
lineId = 'line' + lineNumber;
|
lineId = `line${lineNumber}`;
|
||||||
lines[i].id = lineId;
|
lines[i].id = lineId;
|
||||||
if (lineId === anchorHash) {
|
if (lineId === anchorHash) {
|
||||||
lines[i].className += ' selected';
|
lines[i].className += ' selected';
|
||||||
|
|||||||
@@ -30,16 +30,17 @@
|
|||||||
const noteService = require('./notes');
|
const noteService = require('./notes');
|
||||||
const sql = require('./sql');
|
const sql = require('./sql');
|
||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
const dateUtils = require('./date_utils');
|
|
||||||
const attributeService = require('./attributes');
|
const attributeService = require('./attributes');
|
||||||
const dateNoteService = require('./date_notes');
|
const dateNoteService = require('./date_notes');
|
||||||
const treeService = require('./tree');
|
const treeService = require('./tree');
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const repository = require('./repository');
|
const repository = require('./repository');
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
const dayjs = require('dayjs');
|
||||||
const cloningService = require('./cloning');
|
const cloningService = require('./cloning');
|
||||||
const messagingService = require('./messaging');
|
const ws = require('./ws.js');
|
||||||
const appInfo = require('./app_info');
|
const appInfo = require('./app_info');
|
||||||
|
const searchService = require('./search');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main backend API interface for scripts. It's published in the local "api" object.
|
* This is the main backend API interface for scripts. It's published in the local "api" object.
|
||||||
@@ -50,7 +51,7 @@ const appInfo = require('./app_info');
|
|||||||
function BackendScriptApi(currentNote, apiParams) {
|
function BackendScriptApi(currentNote, apiParams) {
|
||||||
/** @property {Note} note where script started executing */
|
/** @property {Note} note where script started executing */
|
||||||
this.startNote = apiParams.startNote;
|
this.startNote = apiParams.startNote;
|
||||||
/** @property {Note} note where script is currently executing */
|
/** @property {Note} note where script is currently executing. Don't mix this up with concept of active note */
|
||||||
this.currentNote = currentNote;
|
this.currentNote = currentNote;
|
||||||
/** @property {Entity} entity whose event triggered this executions */
|
/** @property {Entity} entity whose event triggered this executions */
|
||||||
this.originEntity = apiParams.originEntity;
|
this.originEntity = apiParams.originEntity;
|
||||||
@@ -60,11 +61,10 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.axios = axios;
|
this.axios = axios;
|
||||||
|
this.dayjs = dayjs;
|
||||||
|
|
||||||
this.utils = {
|
this.utils = {
|
||||||
unescapeHtml: utils.unescapeHtml,
|
unescapeHtml: utils.unescapeHtml
|
||||||
isoDateTimeStr: dateUtils.dateStr,
|
|
||||||
isoDateStr: date => dateUtils.dateStr(date).substr(0, 10)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,6 +121,30 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*/
|
*/
|
||||||
this.getEntities = repository.getEntities;
|
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
|
||||||
|
*
|
||||||
|
* @method
|
||||||
|
* @param {string} searchString
|
||||||
|
* @returns {Promise<Note[]>}
|
||||||
|
*/
|
||||||
|
this.searchForNotes = searchService.searchForNotes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* @method
|
||||||
|
* @param {string} searchString
|
||||||
|
* @returns {Promise<Note|null>}
|
||||||
|
*/
|
||||||
|
this.searchForNote = async searchString => {
|
||||||
|
const notes = await searchService.searchForNotes(searchString);
|
||||||
|
|
||||||
|
return notes.length > 0 ? notes[0] : null;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves notes with given label name & value
|
* Retrieves notes with given label name & value
|
||||||
*
|
*
|
||||||
@@ -174,6 +198,66 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*/
|
*/
|
||||||
this.toggleNoteInParent = cloningService.toggleNoteInParent;
|
this.toggleNoteInParent = cloningService.toggleNoteInParent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {object} CreateNoteAttribute
|
||||||
|
* @property {string} type - attribute type - label, relation etc.
|
||||||
|
* @property {string} name - attribute name
|
||||||
|
* @property {string} [value] - attribute value
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create text note. See also createNewNote() for more options.
|
||||||
|
*
|
||||||
|
* @param {string} parentNoteId
|
||||||
|
* @param {string} title
|
||||||
|
* @param {string} content
|
||||||
|
* @return {Promise<{note: Note, branch: Branch}>}
|
||||||
|
*/
|
||||||
|
this.createTextNote = async (parentNoteId, title, content = '') => await noteService.createNewNote({
|
||||||
|
parentNoteId,
|
||||||
|
title,
|
||||||
|
content,
|
||||||
|
type: 'text'
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
|
||||||
|
* JSON MIME type. See also createNewNote() for more options.
|
||||||
|
*
|
||||||
|
* @param {string} parentNoteId
|
||||||
|
* @param {string} title
|
||||||
|
* @param {object} content
|
||||||
|
* @return {Promise<{note: Note, branch: Branch}>}
|
||||||
|
*/
|
||||||
|
this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({
|
||||||
|
parentNoteId,
|
||||||
|
title,
|
||||||
|
content: JSON.stringify(content, null, '\t'),
|
||||||
|
type: 'code',
|
||||||
|
mime: 'application/json'
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {object} CreateNewNoteParams
|
||||||
|
* @property {string} parentNoteId - MANDATORY
|
||||||
|
* @property {string} title - MANDATORY
|
||||||
|
* @property {string|buffer} content - MANDATORY
|
||||||
|
* @property {string} type - text, code, file, image, search, book, relation-map - MANDATORY
|
||||||
|
* @property {string} mime - value is derived from default mimes for type
|
||||||
|
* @property {boolean} isProtected - default is false
|
||||||
|
* @property {boolean} isExpanded - default is false
|
||||||
|
* @property {string} prefix - default is empty string
|
||||||
|
* @property {int} notePosition - default is last existing notePosition in a parent + 10
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method
|
||||||
|
*
|
||||||
|
* @param {CreateNewNoteParams} [params]
|
||||||
|
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
||||||
|
*/
|
||||||
|
this.createNewNote = noteService.createNewNote;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} CreateNoteAttribute
|
* @typedef {object} CreateNoteAttribute
|
||||||
* @property {string} type - attribute type - label, relation etc.
|
* @property {string} type - attribute type - label, relation etc.
|
||||||
@@ -199,23 +283,38 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* @param {CreateNoteExtraOptions} [extraOptions={}]
|
* @param {CreateNoteExtraOptions} [extraOptions={}]
|
||||||
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
||||||
*/
|
*/
|
||||||
this.createNote = noteService.createNote;
|
this.createNote = async (parentNoteId, title, content = "", extraOptions= {}) => {
|
||||||
|
extraOptions.parentNoteId = parentNoteId;
|
||||||
|
extraOptions.title = title;
|
||||||
|
|
||||||
/**
|
const parentNote = await repository.getNote(parentNoteId);
|
||||||
* Creates new note according to given params and force all connected clients to refresh their tree.
|
|
||||||
*
|
|
||||||
* @method
|
|
||||||
*
|
|
||||||
* @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
|
|
||||||
*/
|
|
||||||
this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {
|
|
||||||
await noteService.createNote(parentNoteId, title, content, extraOptions);
|
|
||||||
|
|
||||||
messagingService.refreshTree();
|
// code note type can be inherited, otherwise text is default
|
||||||
|
extraOptions.type = parentNote.type === 'code' ? 'code' : 'text';
|
||||||
|
extraOptions.mime = parentNote.type === 'code' ? parentNote.mime : 'text/html';
|
||||||
|
|
||||||
|
if (extraOptions.json) {
|
||||||
|
extraOptions.content = JSON.stringify(content || {}, null, '\t');
|
||||||
|
extraOptions.type = 'code';
|
||||||
|
extraOptions.mime = 'application/json';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extraOptions.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
const {note, branch} = await 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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {note, branch};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -242,6 +341,14 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*/
|
*/
|
||||||
this.getDateNote = dateNoteService.getDateNote;
|
this.getDateNote = dateNoteService.getDateNote;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns today's day note. If such note doesn't exist, it is created.
|
||||||
|
*
|
||||||
|
* @method
|
||||||
|
* @returns {Promise<Note|null>}
|
||||||
|
*/
|
||||||
|
this.getTodayNote = dateNoteService.getTodayNote;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns note for the first date of the week of the given date.
|
* Returns note for the first date of the week of the given date.
|
||||||
*
|
*
|
||||||
@@ -284,9 +391,10 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
|
* This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix.
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
|
* @deprecated - this method is pretty confusing and serves specialized purpose only
|
||||||
* @param {string} noteId
|
* @param {string} noteId
|
||||||
* @param {string} prefix
|
* @param {string} prefix
|
||||||
* @param {string} [parentNoteId]
|
* @param {string|null} parentNoteId
|
||||||
*/
|
*/
|
||||||
this.setNoteToParent = treeService.setNoteToParent;
|
this.setNoteToParent = treeService.setNoteToParent;
|
||||||
|
|
||||||
@@ -311,7 +419,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
*
|
*
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
this.refreshTree = messagingService.refreshTree;
|
this.refreshTree = ws.refreshTree;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
* @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version
|
||||||
@@ -319,7 +427,8 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
this.getAppInfo = () => appInfo
|
this.getAppInfo = () => appInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BackendScriptApi;</code></pre>
|
module.exports = BackendScriptApi;
|
||||||
|
</code></pre>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -329,13 +438,13 @@ module.exports = BackendScriptApi;</code></pre>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Link.html">Link</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteContent.html">NoteContent</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</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="ApiToken.html">ApiToken</a></li><li><a href="Attribute.html">Attribute</a></li><li><a href="BackendScriptApi.html">BackendScriptApi</a></li><li><a href="Branch.html">Branch</a></li><li><a href="Entity.html">Entity</a></li><li><a href="Note.html">Note</a></li><li><a href="NoteRevision.html">NoteRevision</a></li><li><a href="Option.html">Option</a></li><li><a href="RecentNote.html">RecentNote</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ tr > th:last-child { border-right: 1px solid #ddd; }
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prettyprint
|
.source
|
||||||
{
|
{
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
@@ -284,7 +284,7 @@ tr > th:last-child { border-right: 1px solid #ddd; }
|
|||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.prettyprint code
|
.source code
|
||||||
{
|
{
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<dd class="tag-source"><ul class="dummy"><li>
|
||||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line2">line 2</a>
|
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line3">line 3</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -121,6 +121,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -239,7 +241,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line16">line 16</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -355,7 +357,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line12">line 12</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -413,7 +415,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line10">line 10</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -471,7 +473,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line14">line 14</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -547,7 +549,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line20">line 20</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -570,6 +572,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
@@ -647,7 +651,7 @@
|
|||||||
|
|
||||||
<dt class="tag-source">Source:</dt>
|
<dt class="tag-source">Source:</dt>
|
||||||
<dd class="tag-source"><ul class="dummy"><li>
|
<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#line25">line 25</a>
|
||||||
</li></ul></dd>
|
</li></ul></dd>
|
||||||
|
|
||||||
|
|
||||||
@@ -670,6 +674,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h5>Returns:</h5>
|
<h5>Returns:</h5>
|
||||||
|
|
||||||
|
|
||||||
@@ -719,7 +725,7 @@
|
|||||||
<br class="clear">
|
<br class="clear">
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script> prettyPrint(); </script>
|
<script> prettyPrint(); </script>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
2266
docs/frontend_api/KeyboardAction.html
Normal file
2266
docs/frontend_api/KeyboardAction.html
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user