mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 08:42:13 +02:00
Compare commits
810 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30940991e0 | ||
|
|
a6d3047007 | ||
|
|
2ae0d139ea | ||
|
|
1507583cf3 | ||
|
|
310e1b764c | ||
|
|
1d7a25f2bb | ||
|
|
3bc89a8cae | ||
|
|
ff54b5a26c | ||
|
|
07b9f38e90 | ||
|
|
f612940668 | ||
|
|
6046bda443 | ||
|
|
cd97a72ef2 | ||
|
|
c20fbcc7a4 | ||
|
|
f22e410860 | ||
|
|
3059ca848e | ||
|
|
ce8b8c3b58 | ||
|
|
78846a3f95 | ||
|
|
994f329a49 | ||
|
|
d621df58cd | ||
|
|
0e0ccd9651 | ||
|
|
cc0adea216 | ||
|
|
8ec0825a52 | ||
|
|
4d083f9663 | ||
|
|
81b3795b1c | ||
|
|
74cf9ae184 | ||
|
|
9ba4c0bfdd | ||
|
|
85e83c6822 | ||
|
|
65eedde511 | ||
|
|
7d45056ae4 | ||
|
|
f2db382087 | ||
|
|
3e99783119 | ||
|
|
de6bbbee8c | ||
|
|
0309c2d7e8 | ||
|
|
1c9bb0605b | ||
|
|
b8b98be7a0 | ||
|
|
6c037b0996 | ||
|
|
326b60c260 | ||
|
|
e13ab0b214 | ||
|
|
01f8a27dd2 | ||
|
|
081029b49a | ||
|
|
32d55fdc46 | ||
|
|
69aa680dd1 | ||
|
|
117c02d457 | ||
|
|
f74fcb3734 | ||
|
|
676d6598d7 | ||
|
|
af1edfef99 | ||
|
|
56cadf01fd | ||
|
|
6a0ef8d940 | ||
|
|
1e01942218 | ||
|
|
5dab4f8042 | ||
|
|
3e4a50d430 | ||
|
|
96d236b034 | ||
|
|
ade5e69aa0 | ||
|
|
4733c710b2 | ||
|
|
1c8922249e | ||
|
|
73c787836f | ||
|
|
ec6f3d84d7 | ||
|
|
1f2df5f3ee | ||
|
|
121a78ea8d | ||
|
|
832ab4ab24 | ||
|
|
445f3906ee | ||
|
|
c869acc0e5 | ||
|
|
0d2b2a272b | ||
|
|
d8ac1c39b7 | ||
|
|
e31dbe935c | ||
|
|
35e46cebfc | ||
|
|
891861f396 | ||
|
|
fbc38230b8 | ||
|
|
61561f9745 | ||
|
|
13e5f57160 | ||
|
|
7600085473 | ||
|
|
99641d6994 | ||
|
|
dea66cc8d8 | ||
|
|
1dd43a69a0 | ||
|
|
e539cb7ae3 | ||
|
|
5269f7a164 | ||
|
|
8e1d6b420f | ||
|
|
311f7dbb5b | ||
|
|
9ac64b5873 | ||
|
|
e54126e6bf | ||
|
|
a4acc59505 | ||
|
|
854bc297a6 | ||
|
|
69bfb48573 | ||
|
|
9ef7f720b1 | ||
|
|
2155dcad65 | ||
|
|
fb4da29ade | ||
|
|
d146d33059 | ||
|
|
978ac9155f | ||
|
|
cf9b4f0eba | ||
|
|
d26a2aa995 | ||
|
|
c8301e21eb | ||
|
|
1a24232a1c | ||
|
|
69c94835fe | ||
|
|
706a9145ac | ||
|
|
9bde6194a5 | ||
|
|
3dd8c62bc4 | ||
|
|
895a434d0e | ||
|
|
d3ec3a60df | ||
|
|
df15a2dcae | ||
|
|
5e4b24dcfb | ||
|
|
0eae73c4e5 | ||
|
|
deb3f81e5d | ||
|
|
dcb3fe6f69 | ||
|
|
4bbecb3013 | ||
|
|
52954f3702 | ||
|
|
12a7fff668 | ||
|
|
14e489a719 | ||
|
|
83f2935f41 | ||
|
|
28855d482e | ||
|
|
7c11ebdacf | ||
|
|
592c806465 | ||
|
|
7a3d0266c4 | ||
|
|
e9b7368cf1 | ||
|
|
f8c0004f85 | ||
|
|
b007cb8bbd | ||
|
|
541015766c | ||
|
|
5310087287 | ||
|
|
7649c6c566 | ||
|
|
1b2650f6df | ||
|
|
de3586d60e | ||
|
|
a0ca579c2f | ||
|
|
9bc7a115a1 | ||
|
|
aef7af0a9a | ||
|
|
e9f2e46e16 | ||
|
|
56fd18f7c9 | ||
|
|
ecccd8b536 | ||
|
|
dd2f0f37f2 | ||
|
|
600a5eafe3 | ||
|
|
9b07bf7a08 | ||
|
|
d341f6c2b0 | ||
|
|
06a030f518 | ||
|
|
b02fed6e5b | ||
|
|
310884bd73 | ||
|
|
0c625d52c2 | ||
|
|
82ab70f396 | ||
|
|
24d9c9dbc0 | ||
|
|
d9f1dc9fd2 | ||
|
|
4b503471bd | ||
|
|
b523434be3 | ||
|
|
f32b1950d9 | ||
|
|
e1c45a5c99 | ||
|
|
195655b4df | ||
|
|
9d7d65f0ef | ||
|
|
985b5410f6 | ||
|
|
d1dd57deec | ||
|
|
2ec6902537 | ||
|
|
cd130bc8ef | ||
|
|
3fcd1f694e | ||
|
|
b98b43b9f6 | ||
|
|
b59c76f771 | ||
|
|
4d2e386328 | ||
|
|
deddcbe152 | ||
|
|
e305284fe2 | ||
|
|
3163debdb8 | ||
|
|
f827237a80 | ||
|
|
c038e39620 | ||
|
|
b8c1190c9f | ||
|
|
7f5ff5068e | ||
|
|
943acc8567 | ||
|
|
81798211ea | ||
|
|
39596f6a42 | ||
|
|
36a181e77e | ||
|
|
032c03a877 | ||
|
|
500299fb2f | ||
|
|
b959e84032 | ||
|
|
30edc194f4 | ||
|
|
0a20894dd1 | ||
|
|
1045a7399f | ||
|
|
0f3ef0027b | ||
|
|
2f43bc5c65 | ||
|
|
8d9f7e125d | ||
|
|
3ac841ddc1 | ||
|
|
9fc8c6f7a2 | ||
|
|
62cd974235 | ||
|
|
a0d03238ee | ||
|
|
4303cf00cc | ||
|
|
747ea70de5 | ||
|
|
6dd4ef22df | ||
|
|
4b97c79ae2 | ||
|
|
d34b118c68 | ||
|
|
a3ff2e1067 | ||
|
|
e6ef2a7945 | ||
|
|
9bf8d5d941 | ||
|
|
f3ee93bd48 | ||
|
|
5b78fee225 | ||
|
|
dd73947b7f | ||
|
|
78998fb123 | ||
|
|
0bcfccffe0 | ||
|
|
3ab45f40ca | ||
|
|
bb2f610bc8 | ||
|
|
9b685133c4 | ||
|
|
33c4943794 | ||
|
|
a7f8aa4faa | ||
|
|
722fe30c8f | ||
|
|
500104eb81 | ||
|
|
41c3a14dfa | ||
|
|
113eda94fa | ||
|
|
c6ce43f7cc | ||
|
|
6d5bc60127 | ||
|
|
b7b7b28834 | ||
|
|
5a0b0d7c61 | ||
|
|
79bf7ce7ee | ||
|
|
4ab150bf75 | ||
|
|
951668c982 | ||
|
|
d7845407f0 | ||
|
|
8c5e3187ab | ||
|
|
d2ae1cd845 | ||
|
|
8cb64fbe66 | ||
|
|
092b858873 | ||
|
|
81d19722f6 | ||
|
|
1f7b268875 | ||
|
|
38b32a6090 | ||
|
|
373159cb29 | ||
|
|
ec86ef4c0e | ||
|
|
270231374b | ||
|
|
aac4281602 | ||
|
|
bdea1139a4 | ||
|
|
14fdfa6d17 | ||
|
|
3b22747dbf | ||
|
|
eb9e20dad5 | ||
|
|
5aa4b883ad | ||
|
|
ea38e2621f | ||
|
|
b2cb95e1fc | ||
|
|
b174b9795a | ||
|
|
9d1caa8336 | ||
|
|
52e8669960 | ||
|
|
f0505725a7 | ||
|
|
7897641ef7 | ||
|
|
761f5f35e9 | ||
|
|
241586ff4a | ||
|
|
f8fc1a9dae | ||
|
|
6bbcc0a301 | ||
|
|
0e6604aa11 | ||
|
|
ade84a23ff | ||
|
|
6ff883b54e | ||
|
|
3546d92143 | ||
|
|
e932eb1b1d | ||
|
|
cbca712af8 | ||
|
|
8490128833 | ||
|
|
b80e126540 | ||
|
|
5494a2244e | ||
|
|
23be5b1736 | ||
|
|
9f3a9bc915 | ||
|
|
84d322f476 | ||
|
|
f94fbcc2ae | ||
|
|
0e85162b50 | ||
|
|
a5927f3681 | ||
|
|
0d37587199 | ||
|
|
4674578c90 | ||
|
|
87d280edbd | ||
|
|
d44ddd6781 | ||
|
|
7271481fb7 | ||
|
|
7f05ae7415 | ||
|
|
1e84b3a0cb | ||
|
|
20c7b11ecc | ||
|
|
6666f6e817 | ||
|
|
621e1ce207 | ||
|
|
1c42c58591 | ||
|
|
6a1b0d8718 | ||
|
|
bc244bfde1 | ||
|
|
984cb41efc | ||
|
|
076386f0d4 | ||
|
|
cb11a46cc9 | ||
|
|
6c7f1b5eb9 | ||
|
|
95709f1996 | ||
|
|
eaebcc748d | ||
|
|
13c2f6e73d | ||
|
|
f746d353a7 | ||
|
|
de1760bda7 | ||
|
|
a28b870c23 | ||
|
|
eb216e52cf | ||
|
|
c19913ac58 | ||
|
|
b55bb4ceeb | ||
|
|
26ec1aa5b2 | ||
|
|
7b733c32e9 | ||
|
|
3d34118f9e | ||
|
|
69a3a898f5 | ||
|
|
74d21e7c33 | ||
|
|
aecf1c38a6 | ||
|
|
8b3041301a | ||
|
|
af77d191e3 | ||
|
|
ad58125663 | ||
|
|
63650ba791 | ||
|
|
1c5a434ee3 | ||
|
|
102e64224f | ||
|
|
854fe3084a | ||
|
|
b6c6186625 | ||
|
|
92bdd5cf03 | ||
|
|
c2e78d122a | ||
|
|
bfc061ad47 | ||
|
|
98302a887a | ||
|
|
743db411d5 | ||
|
|
9537a9a13a | ||
|
|
0931705d6a | ||
|
|
6bfd9b657a | ||
|
|
493aef5b05 | ||
|
|
185f70e893 | ||
|
|
db2ecde486 | ||
|
|
ff3b7edec8 | ||
|
|
968b050d13 | ||
|
|
4328f7fc40 | ||
|
|
6ae3c28b8b | ||
|
|
8be022e34f | ||
|
|
ce6938396a | ||
|
|
537e2d02e7 | ||
|
|
80b9e48771 | ||
|
|
e0c3437c45 | ||
|
|
e5df15a53e | ||
|
|
a0f6e979b8 | ||
|
|
e20624a635 | ||
|
|
800583ddde | ||
|
|
f0bc71bee4 | ||
|
|
ba0dd4f2b0 | ||
|
|
63b560ad93 | ||
|
|
ae0553a1e5 | ||
|
|
fd4e2737e5 | ||
|
|
15f18c6d4f | ||
|
|
a84e32fe1b | ||
|
|
c09d97310f | ||
|
|
782eb45eb3 | ||
|
|
fb37da0aca | ||
|
|
ae2608e66f | ||
|
|
29565bc24c | ||
|
|
da7860fc3f | ||
|
|
0375e8c568 | ||
|
|
60c53b32e6 | ||
|
|
4d1797e9fa | ||
|
|
1ff4bde7b9 | ||
|
|
fae6d89a18 | ||
|
|
aa429abe01 | ||
|
|
203763aa95 | ||
|
|
0b69ae195f | ||
|
|
0756a43d62 | ||
|
|
13eb3205a2 | ||
|
|
9dcd295fd0 | ||
|
|
1fb84ea302 | ||
|
|
53ea3d32dc | ||
|
|
5c9ec28a4e | ||
|
|
04c2293378 | ||
|
|
6c672c541a | ||
|
|
169db73704 | ||
|
|
e980f00f1c | ||
|
|
66a594ed99 | ||
|
|
52c35c1e4d | ||
|
|
caa4103b48 | ||
|
|
f6069ca4a7 | ||
|
|
f519748c44 | ||
|
|
27de0f0ddb | ||
|
|
5426c22740 | ||
|
|
a55d4d1e02 | ||
|
|
2f65b1ee82 | ||
|
|
730dc56316 | ||
|
|
101e697a12 | ||
|
|
1c1488bca5 | ||
|
|
0e74adbd08 | ||
|
|
35947b4010 | ||
|
|
b304ceddbb | ||
|
|
cba6c48673 | ||
|
|
63b40cde75 | ||
|
|
439f2e87a2 | ||
|
|
fc0869d9fe | ||
|
|
fb5646e8c2 | ||
|
|
7538a47be5 | ||
|
|
8568cc0c89 | ||
|
|
2457de9757 | ||
|
|
a6859631ae | ||
|
|
e737444c52 | ||
|
|
b4a2726c81 | ||
|
|
5fc60491ff | ||
|
|
a7558535a6 | ||
|
|
408d06edb9 | ||
|
|
87be913388 | ||
|
|
1a034abe96 | ||
|
|
19bdfd66b9 | ||
|
|
982d051329 | ||
|
|
b66b1db2cb | ||
|
|
12e67a065d | ||
|
|
1f3cdc08ac | ||
|
|
5ebcba9f46 | ||
|
|
15e49c1b45 | ||
|
|
b71a657dea | ||
|
|
72e573bbc4 | ||
|
|
2113ffefd9 | ||
|
|
8da42884c2 | ||
|
|
e14c54c6cc | ||
|
|
10a199f3f5 | ||
|
|
2df97392b2 | ||
|
|
fcd2ecd118 | ||
|
|
e2e5533229 | ||
|
|
cf01fce011 | ||
|
|
100152ecc1 | ||
|
|
7b68c0b3c0 | ||
|
|
a7ad9b752b | ||
|
|
2e3ed42723 | ||
|
|
864e44d1a2 | ||
|
|
08cdb33e6e | ||
|
|
27647f529f | ||
|
|
4021650ea5 | ||
|
|
6a9f76c656 | ||
|
|
c3bba74107 | ||
|
|
16b9d4794e | ||
|
|
22e16d5c5b | ||
|
|
ef340e5fa0 | ||
|
|
20aff38458 | ||
|
|
16a1051280 | ||
|
|
fe9d3d3020 | ||
|
|
a0c0041cbd | ||
|
|
d755c62a51 | ||
|
|
5756623f45 | ||
|
|
8247f504c4 | ||
|
|
f05b0a15ee | ||
|
|
1abf1df1ee | ||
|
|
f1afab0b52 | ||
|
|
a0d33bf9c1 | ||
|
|
7c16fa7b42 | ||
|
|
5ba526d12e | ||
|
|
92174be7fd | ||
|
|
ece451b660 | ||
|
|
5ca740b43c | ||
|
|
70aae7c59a | ||
|
|
bb543ef010 | ||
|
|
64bba9246b | ||
|
|
511987bd70 | ||
|
|
19162504c8 | ||
|
|
96f5173fb9 | ||
|
|
8704f47b44 | ||
|
|
45803a8cd2 | ||
|
|
c04c2a3563 | ||
|
|
e61e7f3ba0 | ||
|
|
e438050f6e | ||
|
|
9601bdec93 | ||
|
|
c631dcfd44 | ||
|
|
4cabd2562a | ||
|
|
09e997c104 | ||
|
|
eee787be1c | ||
|
|
c9b0d4fbec | ||
|
|
946f82f978 | ||
|
|
8fc3fe4a98 | ||
|
|
3d321a038b | ||
|
|
ef06d47619 | ||
|
|
c8a966a2f7 | ||
|
|
32ffdf9174 | ||
|
|
d482cb00a9 | ||
|
|
6286b8bf4c | ||
|
|
b264f4a6b9 | ||
|
|
ec7d5fe5c2 | ||
|
|
4b9d770030 | ||
|
|
a8100e9b01 | ||
|
|
b43e892295 | ||
|
|
663f151051 | ||
|
|
282373b654 | ||
|
|
43faeb6e32 | ||
|
|
8180fcf386 | ||
|
|
e2cbd4d0ac | ||
|
|
084c259197 | ||
|
|
6ecd709f29 | ||
|
|
b935cef5a0 | ||
|
|
1d5e838afa | ||
|
|
90ca4b68cf | ||
|
|
031bd26b09 | ||
|
|
1296f37081 | ||
|
|
ba1a707156 | ||
|
|
d670cca559 | ||
|
|
f7e31a4f04 | ||
|
|
bb7917551f | ||
|
|
53238aee40 | ||
|
|
187d41e25f | ||
|
|
56f79a91c1 | ||
|
|
4dd6b5f32e | ||
|
|
f48a5a650c | ||
|
|
09a2a31d2b | ||
|
|
5fd60094ab | ||
|
|
0cfc9fbb56 | ||
|
|
2fc6200c47 | ||
|
|
437e5e7004 | ||
|
|
22e2c1f25c | ||
|
|
4799ed0434 | ||
|
|
0848dfc5d6 | ||
|
|
88cf2c3cb0 | ||
|
|
ca3855d109 | ||
|
|
36570f3944 | ||
|
|
df10a1900d | ||
|
|
eca3408598 | ||
|
|
9d1a2c40c7 | ||
|
|
cd58b72a9c | ||
|
|
ceead6eaba | ||
|
|
45a665b004 | ||
|
|
2dd1cd8453 | ||
|
|
8152a7f7ea | ||
|
|
55d962eed7 | ||
|
|
ebf5c83358 | ||
|
|
69e5fba5ff | ||
|
|
139ee62106 | ||
|
|
2d89431dc1 | ||
|
|
d506e658f0 | ||
|
|
180d02c53d | ||
|
|
e500886b12 | ||
|
|
7f7bcbc0a3 | ||
|
|
397231f1df | ||
|
|
f575afa151 | ||
|
|
b26cf4e876 | ||
|
|
450488eb4f | ||
|
|
14d3228786 | ||
|
|
811fd24cd5 | ||
|
|
098fb5be78 | ||
|
|
837d065b81 | ||
|
|
fe2b001c6d | ||
|
|
b08c047da7 | ||
|
|
79ff8b1f82 | ||
|
|
7da47d6e16 | ||
|
|
6e6f3c6c38 | ||
|
|
b3b3d9a0b7 | ||
|
|
16f0fe145a | ||
|
|
eea7209aaf | ||
|
|
c4c93f1cc5 | ||
|
|
0d19f56519 | ||
|
|
85d0ded200 | ||
|
|
c5134f0dd7 | ||
|
|
9e117f34d4 | ||
|
|
72f994d079 | ||
|
|
4a6edfa660 | ||
|
|
a20c05adb2 | ||
|
|
a286aba432 | ||
|
|
a3f1302e37 | ||
|
|
9393388cc5 | ||
|
|
d249fe16d9 | ||
|
|
7f6223f4c8 | ||
|
|
dc5e2c0d40 | ||
|
|
26f6a14e93 | ||
|
|
588de5ad27 | ||
|
|
8734938a82 | ||
|
|
06e7228041 | ||
|
|
38ad431b17 | ||
|
|
e0f5d8f1f2 | ||
|
|
e947d21060 | ||
|
|
41d347a1a7 | ||
|
|
5dc6ab6bb2 | ||
|
|
3492e54a9b | ||
|
|
adf92f3dc9 | ||
|
|
02b9f77e7c | ||
|
|
396f435755 | ||
|
|
5796db03f9 | ||
|
|
4029d72967 | ||
|
|
8d2cf500a0 | ||
|
|
5bfc954076 | ||
|
|
769f468273 | ||
|
|
8d75128603 | ||
|
|
ba4795e4b3 | ||
|
|
65f9f7c830 | ||
|
|
99e56f9312 | ||
|
|
b380e6d770 | ||
|
|
9d0add605d | ||
|
|
d4737841ce | ||
|
|
d6f9971cb6 | ||
|
|
8e4733b72f | ||
|
|
07c387289a | ||
|
|
956f786d1a | ||
|
|
56b2fbfb77 | ||
|
|
bba67afc36 | ||
|
|
d1dd0d7774 | ||
|
|
c7c6a54155 | ||
|
|
12fc9863d2 | ||
|
|
4ec718a966 | ||
|
|
91b2a6e44f | ||
|
|
aa2e79bd82 | ||
|
|
cc62b26002 | ||
|
|
6113b10c74 | ||
|
|
52a952f41e | ||
|
|
257b4283e1 | ||
|
|
31b4eba73f | ||
|
|
0dec6255f6 | ||
|
|
baabf84951 | ||
|
|
359c36e023 | ||
|
|
285fe7f524 | ||
|
|
093e8e5591 | ||
|
|
73ce957b57 | ||
|
|
5dbb80457a | ||
|
|
d53b2d0e1c | ||
|
|
c4256a0dea | ||
|
|
b8fc933acb | ||
|
|
45d447bf2c | ||
|
|
a0400be8cd | ||
|
|
3688381d4a | ||
|
|
1f5287c2e6 | ||
|
|
3e97d6bba1 | ||
|
|
32c0cbc4ad | ||
|
|
90f267105f | ||
|
|
eaa9a5f1a0 | ||
|
|
70da661041 | ||
|
|
b307a74319 | ||
|
|
5c2fa28fff | ||
|
|
2f8495e5b5 | ||
|
|
d3d9c46812 | ||
|
|
9e50d068db | ||
|
|
7232a3142c | ||
|
|
a1ca2e3f37 | ||
|
|
a5d993b999 | ||
|
|
854be1ddeb | ||
|
|
fe5b93f66e | ||
|
|
f259ddecd5 | ||
|
|
680be0e468 | ||
|
|
488a2b0b57 | ||
|
|
e0871e6b16 | ||
|
|
ab5acdef09 | ||
|
|
002c23b2a5 | ||
|
|
b10134fb30 | ||
|
|
93027ec0ae | ||
|
|
481b09531f | ||
|
|
4da1dd3f6b | ||
|
|
661d44d6b0 | ||
|
|
d6dacb6493 | ||
|
|
0ad5ee5997 | ||
|
|
5ad8f00388 | ||
|
|
450311de3c | ||
|
|
1bc4f07fa3 | ||
|
|
d091c93bfc | ||
|
|
2ff9b47f1c | ||
|
|
6b470e671f | ||
|
|
14c9174e24 | ||
|
|
e4beb13982 | ||
|
|
2b006e1765 | ||
|
|
f45c7f8d30 | ||
|
|
e3a2f95fc2 | ||
|
|
d27c161665 | ||
|
|
b9d6a69f00 | ||
|
|
fac334d58a | ||
|
|
a4913cc5bf | ||
|
|
0ad1a34e10 | ||
|
|
325fa0eb7a | ||
|
|
c02c1e6808 | ||
|
|
96a4a17320 | ||
|
|
23c169c6a3 | ||
|
|
6c4a4cad50 | ||
|
|
34c1af08db | ||
|
|
128aec9869 | ||
|
|
4fc2029a61 | ||
|
|
815ae7161d | ||
|
|
3a1f5c7120 | ||
|
|
eec51342de | ||
|
|
945cef653c | ||
|
|
93154aabc7 | ||
|
|
9244e49e6b | ||
|
|
74e43f0526 | ||
|
|
1fba734fd0 | ||
|
|
197e4e67e0 | ||
|
|
02afbb19be | ||
|
|
972e6cb98f | ||
|
|
b14f918d59 | ||
|
|
c05d4a0eea | ||
|
|
3732a5c95f | ||
|
|
1e0f6ff558 | ||
|
|
6a361e5b87 | ||
|
|
c94ac75a6f | ||
|
|
b49e40780a | ||
|
|
dd01fa0a3d | ||
|
|
a2218b01d0 | ||
|
|
8d9d83d679 | ||
|
|
546c74297f | ||
|
|
9fc1e73fd3 | ||
|
|
64e713f503 | ||
|
|
f254209410 | ||
|
|
2f738f8b58 | ||
|
|
e2da9b5bc3 | ||
|
|
04bfaf754a | ||
|
|
ab328b0987 | ||
|
|
521844a5ff | ||
|
|
c4096e7000 | ||
|
|
8afe8cf7fb | ||
|
|
fa8b52fa83 | ||
|
|
a8baa76096 | ||
|
|
8d5cef72b3 | ||
|
|
ef0f0ffa0b | ||
|
|
eef4e19dc9 | ||
|
|
5af41891dc | ||
|
|
4539b9d381 | ||
|
|
c1aadd7ce7 | ||
|
|
3b76b92fcb | ||
|
|
fe0dc51bef | ||
|
|
e279da47bf | ||
|
|
5d93000484 | ||
|
|
b826a78700 | ||
|
|
eded26d92c | ||
|
|
517d00dc9a | ||
|
|
96752f1473 | ||
|
|
bbc2e306f4 | ||
|
|
03e063c35b | ||
|
|
4c6c1381c8 | ||
|
|
4814451277 | ||
|
|
0c7b2ead8c | ||
|
|
6c6b80d3c8 | ||
|
|
76f9537002 | ||
|
|
c0994ff055 | ||
|
|
86694d9627 | ||
|
|
aa95f89b49 | ||
|
|
628b971dc9 | ||
|
|
ae002c0d88 | ||
|
|
a98fc6f784 | ||
|
|
5c459eede8 | ||
|
|
d9d2b615d2 | ||
|
|
86e6bca5e1 | ||
|
|
7cfff4787c | ||
|
|
491a8f05bc | ||
|
|
f67f1a64bd | ||
|
|
a31ef122a3 | ||
|
|
0a82d940fd | ||
|
|
6ec658b9a5 | ||
|
|
4e8de2303f | ||
|
|
19625d6cef | ||
|
|
e346b12011 | ||
|
|
2b11f2f2b8 | ||
|
|
3fb62cb358 | ||
|
|
108dfaccf8 | ||
|
|
eb20a3c9a2 | ||
|
|
988d828bb6 | ||
|
|
7fd0000c68 | ||
|
|
6286653dd4 | ||
|
|
9690a5897b | ||
|
|
eefac8703d | ||
|
|
077a3aad3b | ||
|
|
3ae72726b8 | ||
|
|
90c0e42eb1 | ||
|
|
8877ce6d12 | ||
|
|
1af5dae991 | ||
|
|
ee49f3e6dd | ||
|
|
8d4b8b7881 | ||
|
|
4626520f62 | ||
|
|
7c04569a14 | ||
|
|
bd8b1ca909 | ||
|
|
13dddab5e5 | ||
|
|
771b0e4645 | ||
|
|
d99111b2f9 | ||
|
|
c2bb44f823 | ||
|
|
7ece118acd | ||
|
|
9b4ef72682 | ||
|
|
25ba824d79 | ||
|
|
9b35836dc8 | ||
|
|
809f9a38bc | ||
|
|
df08f2b188 | ||
|
|
9512b9d001 | ||
|
|
995026f65f | ||
|
|
d619d2afff | ||
|
|
1affe3cdda | ||
|
|
0bee18fa63 | ||
|
|
2ad7face9a | ||
|
|
33604bba3c | ||
|
|
9d6c34b796 | ||
|
|
052c3040fb | ||
|
|
89804ebbd1 | ||
|
|
e21572af6d | ||
|
|
3865f6cb06 | ||
|
|
296791ed25 | ||
|
|
017216b8a6 | ||
|
|
6fb6329356 | ||
|
|
477da276b2 | ||
|
|
dbf90bf114 | ||
|
|
d6fa9b3905 | ||
|
|
95573032e7 | ||
|
|
82699e5276 | ||
|
|
54b95107c3 | ||
|
|
e54b337c45 | ||
|
|
75ab4bd946 | ||
|
|
b31ffab577 | ||
|
|
8f2da2bdc5 | ||
|
|
6ae31ac0da | ||
|
|
da22f2ef51 | ||
|
|
a882507aff | ||
|
|
04c74de8e3 | ||
|
|
f13adebc04 | ||
|
|
5573d1cd6c | ||
|
|
24d15c98ef | ||
|
|
97de3ff6c7 | ||
|
|
7bcecd0a1d | ||
|
|
b050dfdc1c | ||
|
|
05a2fe6665 | ||
|
|
986479e8d5 | ||
|
|
16fad55f9f | ||
|
|
4f03f448e8 | ||
|
|
f3e72a30d3 | ||
|
|
cf319c5afb | ||
|
|
3afd4ed5b5 | ||
|
|
00a783acca | ||
|
|
3733c99b67 | ||
|
|
e9daf776de | ||
|
|
aced5f2124 | ||
|
|
74ff0adefe | ||
|
|
4cefa756d6 | ||
|
|
365e44ebf9 | ||
|
|
b7d34e878f | ||
|
|
15b2bf2071 | ||
|
|
5e85e73c0b | ||
|
|
b9b5ca3325 | ||
|
|
d89ee302fd | ||
|
|
a39db4ffc9 | ||
|
|
bbced15076 | ||
|
|
1b3cde35f3 | ||
|
|
f1dda4a7b3 | ||
|
|
f50120d19a | ||
|
|
9d50f77908 | ||
|
|
f0a3ddbf2e | ||
|
|
8a35eb47e6 | ||
|
|
6ccf8961bf | ||
|
|
fab8ca112b | ||
|
|
bb81d4cf27 | ||
|
|
931999c39f | ||
|
|
2e1e112b42 | ||
|
|
3b7a7c3c49 | ||
|
|
da78c0bfee | ||
|
|
6ff776f185 | ||
|
|
96a5de2df2 | ||
|
|
b1ce674788 |
85
.github/workflows/build.yml
vendored
85
.github/workflows/build.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -137,7 +137,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -169,7 +169,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -185,7 +185,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -200,7 +200,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -215,7 +215,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -231,7 +231,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -240,20 +240,65 @@ jobs:
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Probe/Dockerfile .
|
||||
|
||||
docker-build-ingestor:
|
||||
docker-build-probe-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Ingestor/Dockerfile .
|
||||
run: sudo docker build -f ./ProbeIngest/Dockerfile .
|
||||
|
||||
docker-build-open-telemetry-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./OpenTelemetryIngest/Dockerfile .
|
||||
|
||||
docker-build-incoming-request-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./IncomingRequestIngest/Dockerfile .
|
||||
|
||||
docker-build-fluent-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./FluentIngest/Dockerfile .
|
||||
|
||||
docker-build-status-page:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -261,7 +306,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
@@ -276,7 +321,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
4
.github/workflows/common-jobs.yaml
vendored
4
.github/workflows/common-jobs.yaml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Helm
|
||||
run: |
|
||||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- run: sudo apt-get update
|
||||
- run: sudo apt-get install -y curl gcc
|
||||
- run: sudo apt-get install -y build-essential
|
||||
|
||||
150
.github/workflows/compile.yml
vendored
150
.github/workflows/compile.yml
vendored
@@ -15,10 +15,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Accounts && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -27,10 +27,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd IsolatedVM && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -39,10 +39,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install && npm run compile && npm run dep-check
|
||||
|
||||
compile-app:
|
||||
@@ -50,10 +50,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd App && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -62,10 +62,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Home && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -74,10 +74,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Worker && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -86,10 +86,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Workflow && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -98,10 +98,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd APIReference && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -110,10 +110,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Docs && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -122,10 +122,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Copilot && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -134,10 +134,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
|
||||
- run: cd Nginx && npm install && npm run compile && npm run dep-check
|
||||
@@ -158,10 +158,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
|
||||
- run: cd AdminDashboard && npm install && npm run compile && npm run dep-check
|
||||
@@ -171,10 +171,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
|
||||
- run: cd Dashboard && npm install && npm run compile && npm run dep-check
|
||||
@@ -185,10 +185,11 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: sudo apt-get update
|
||||
- run: cd Common && npm install
|
||||
- run: cd E2E && npm install && npm run compile && npm run dep-check
|
||||
|
||||
@@ -197,24 +198,61 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Probe && npm install && npm run compile && npm run dep-check
|
||||
|
||||
compile-ingestor:
|
||||
compile-probe-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Ingestor && npm install && npm run compile && npm run dep-check
|
||||
- run: cd ProbeIngest && npm install && npm run compile && npm run dep-check
|
||||
|
||||
compile-open-telemetry-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd OpenTelemetryIngest && npm install && npm run compile && npm run dep-check
|
||||
|
||||
|
||||
compile-incoming-request-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd IncomingRequestIngest && npm install && npm run compile && npm run dep-check
|
||||
|
||||
compile-fluent-ingest:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd FluentIngest && npm install && npm run compile && npm run dep-check
|
||||
|
||||
|
||||
compile-status-page:
|
||||
@@ -222,10 +260,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
|
||||
- run: cd StatusPage && npm install && npm run compile && npm run dep-check
|
||||
@@ -235,9 +273,9 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd TestServer && npm install && npm run compile && npm run dep-check
|
||||
307
.github/workflows/release.yml
vendored
307
.github/workflows/release.yml
vendored
@@ -87,9 +87,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -147,9 +147,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -207,9 +207,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -267,9 +267,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -330,9 +330,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -390,9 +390,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -452,9 +452,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -512,9 +512,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -553,7 +553,7 @@ jobs:
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
ingestor-docker-image-deploy:
|
||||
probe-ingest-docker-image-deploy:
|
||||
needs: [generate-build-number]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -562,8 +562,8 @@ jobs:
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/ingestor
|
||||
ghcr.io/oneuptime/ingestor
|
||||
oneuptime/probe-ingest
|
||||
ghcr.io/oneuptime/probe-ingest
|
||||
tags: |
|
||||
type=raw,value=release,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true
|
||||
@@ -572,9 +572,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -585,7 +585,7 @@ jobs:
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy ingestor.
|
||||
# Build and deploy probe-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
@@ -603,7 +603,188 @@ jobs:
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./Ingestor/Dockerfile
|
||||
file: ./ProbeIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
open-telemetry-ingest-docker-image-deploy:
|
||||
needs: [generate-build-number]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/open-telemetry-ingest
|
||||
ghcr.io/oneuptime/open-telemetry-ingest
|
||||
tags: |
|
||||
type=raw,value=release,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy open-telemetry-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./OpenTelemetryIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
|
||||
incoming-request-ingest-docker-image-deploy:
|
||||
needs: [generate-build-number]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/incoming-request-ingest
|
||||
ghcr.io/oneuptime/incoming-request-ingest
|
||||
tags: |
|
||||
type=raw,value=release,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy incoming-request-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./IncomingRequestIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
fluent-ingest-docker-image-deploy:
|
||||
needs: [generate-build-number]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/fluent-ingest
|
||||
ghcr.io/oneuptime/fluent-ingest
|
||||
tags: |
|
||||
type=raw,value=release,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy fluent-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./FluentIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
@@ -632,9 +813,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -693,9 +874,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -753,9 +934,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -814,9 +995,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -874,9 +1055,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -935,9 +1116,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -995,9 +1176,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1046,10 +1227,10 @@ jobs:
|
||||
PACKAGE_VERSION: 7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
- name: Publish Infrastructure Agent
|
||||
- name: Publish NPM Packages
|
||||
run: bash ./Scripts/NPM/PublishAllPackages.sh
|
||||
|
||||
|
||||
@@ -1090,9 +1271,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
# - name: Setup Git LFS
|
||||
# run: git lfs install
|
||||
@@ -1161,9 +1342,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1228,9 +1409,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1295,9 +1476,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1363,9 +1544,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1409,7 +1590,7 @@ jobs:
|
||||
|
||||
test-e2e-release-saas:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [copilot-docker-image-deploy, docs-docker-image-deploy, api-reference-docker-image-deploy, workflow-docker-image-deploy, llm-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, ingestor-docker-image-deploy, isolated-vm-docker-image-deploy, home-docker-image-deploy, worker-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, generate-build-number, nginx-docker-image-deploy]
|
||||
needs: [open-telemetry-ingest-docker-image-deploy, copilot-docker-image-deploy, fluent-ingest-docker-image-deploy, docs-docker-image-deploy, api-reference-docker-image-deploy, workflow-docker-image-deploy, llm-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, probe-ingest-docker-image-deploy, isolated-vm-docker-image-deploy, home-docker-image-deploy, worker-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, generate-build-number, nginx-docker-image-deploy, incoming-request-ingest-docker-image-deploy]
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
@@ -1426,10 +1607,10 @@ jobs:
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: npm run prerun && bash ./Tests/Scripts/enable-billing-env-var.sh
|
||||
- name: Start Server with release tag
|
||||
run: npm run start
|
||||
@@ -1462,7 +1643,7 @@ jobs:
|
||||
test-e2e-release-self-hosted:
|
||||
runs-on: ubuntu-latest
|
||||
# After all the jobs runs
|
||||
needs: [copilot-docker-image-deploy, docs-docker-image-deploy, api-reference-docker-image-deploy, workflow-docker-image-deploy, llm-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, ingestor-docker-image-deploy, isolated-vm-docker-image-deploy, home-docker-image-deploy, worker-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, generate-build-number, nginx-docker-image-deploy]
|
||||
needs: [open-telemetry-ingest-docker-image-deploy, copilot-docker-image-deploy, incoming-request-ingest-docker-image-deploy, fluent-ingest-docker-image-deploy, docs-docker-image-deploy, api-reference-docker-image-deploy, workflow-docker-image-deploy, llm-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, probe-ingest-docker-image-deploy, isolated-vm-docker-image-deploy, home-docker-image-deploy, worker-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, generate-build-number, nginx-docker-image-deploy]
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
@@ -1479,10 +1660,10 @@ jobs:
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: npm run prerun
|
||||
- name: Start Server with release tag
|
||||
run: npm run start
|
||||
@@ -1549,15 +1730,25 @@ jobs:
|
||||
uses: actions/setup-go@v4
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
uses: goreleaser/goreleaser-action@v6.1.0
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- name: GoReleaser Version
|
||||
run: goreleaser -v
|
||||
|
||||
# This tool is used to generate .rpm and .deb packages
|
||||
- name: Install NFPM
|
||||
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
|
||||
|
||||
- name: Show GoReleaser version
|
||||
run: goreleaser -v
|
||||
|
||||
- name: Run GoReleaser
|
||||
run: cd InfrastructureAgent && export GORELEASER_CURRENT_TAG=7.0.${{needs.generate-build-number.outputs.build_number}} && goreleaser release --clean --snapshot
|
||||
|
||||
- name: Release MSI Images
|
||||
run: cd InfrastructureAgent && bash build-msi.sh 7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
# Upload binaries to github release
|
||||
- name: Release
|
||||
|
||||
353
.github/workflows/test-release.yaml
vendored
353
.github/workflows/test-release.yaml
vendored
@@ -1,5 +1,9 @@
|
||||
name: Push Test Images to Docker Hub and GitHub Container Registry
|
||||
|
||||
concurrency:
|
||||
group: test-release
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -56,9 +60,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
# - name: Setup Git LFS
|
||||
# run: git lfs install
|
||||
@@ -126,9 +130,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -188,9 +192,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -249,9 +253,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -310,9 +314,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -371,9 +375,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -432,9 +436,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -495,9 +499,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -558,9 +562,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -599,7 +603,7 @@ jobs:
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
ingestor-docker-image-deploy:
|
||||
probe-ingest-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -608,8 +612,8 @@ jobs:
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/ingestor
|
||||
ghcr.io/oneuptime/ingestor
|
||||
oneuptime/probe-ingest
|
||||
ghcr.io/oneuptime/probe-ingest
|
||||
tags: |
|
||||
type=raw,value=test,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true
|
||||
@@ -619,9 +623,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -632,7 +636,7 @@ jobs:
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy ingestor.
|
||||
# Build and deploy probe-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
@@ -650,7 +654,190 @@ jobs:
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./Ingestor/Dockerfile
|
||||
file: ./ProbeIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
incoming-request-ingest-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/incoming-request-ingest
|
||||
ghcr.io/oneuptime/incoming-request-ingest
|
||||
tags: |
|
||||
type=raw,value=test,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true
|
||||
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy incoming-request-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./IncomingRequestIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
open-telemetry-ingest-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/open-telemetry-ingest
|
||||
ghcr.io/oneuptime/open-telemetry-ingest
|
||||
tags: |
|
||||
type=raw,value=test,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true
|
||||
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy incoming-request-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./OpenTelemetryIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
fluent-ingest-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/fluent-ingest
|
||||
ghcr.io/oneuptime/fluent-ingest
|
||||
tags: |
|
||||
type=raw,value=test,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true
|
||||
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy probe-ingest.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./FluentIngest/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
@@ -680,9 +867,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -741,9 +928,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -802,9 +989,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -863,9 +1050,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -924,9 +1111,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -988,9 +1175,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1051,9 +1238,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1112,9 +1299,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1173,9 +1360,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1235,9 +1422,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1297,9 +1484,9 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
@@ -1343,14 +1530,14 @@ jobs:
|
||||
|
||||
test-helm-chart:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [llm-docker-image-deploy, copilot-docker-image-deploy, docs-docker-image-deploy, worker-docker-image-deploy, workflow-docker-image-deploy, isolated-vm-docker-image-deploy, home-docker-image-deploy, api-reference-docker-image-deploy, test-server-docker-image-deploy, test-docker-image-deploy, ingestor-docker-image-deploy, probe-docker-image-deploy, haraka-docker-image-deploy, dashboard-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, accounts-docker-image-deploy, otel-collector-docker-image-deploy, status-page-docker-image-deploy, nginx-docker-image-deploy, e2e-docker-image-deploy]
|
||||
needs: [infrastructure-agent-deploy, llm-docker-image-deploy, open-telemetry-ingest-docker-image-deploy, copilot-docker-image-deploy, docs-docker-image-deploy, worker-docker-image-deploy, workflow-docker-image-deploy, isolated-vm-docker-image-deploy, home-docker-image-deploy, api-reference-docker-image-deploy, test-server-docker-image-deploy, test-docker-image-deploy, probe-ingest-docker-image-deploy, probe-docker-image-deploy, haraka-docker-image-deploy, dashboard-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, accounts-docker-image-deploy, otel-collector-docker-image-deploy, status-page-docker-image-deploy, nginx-docker-image-deploy, e2e-docker-image-deploy, fluent-ingest-docker-image-deploy, incoming-request-ingest-docker-image-deploy]
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd HelmChart && cd Tests && bash index.sh
|
||||
|
||||
test-e2e-test-saas:
|
||||
@@ -1372,10 +1559,10 @@ jobs:
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: npm run prerun && bash ./Tests/Scripts/change-release-to-test-tag.sh
|
||||
- name: Start Server with release tag
|
||||
run: npm run start
|
||||
@@ -1425,10 +1612,10 @@ jobs:
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: npm run prerun && bash ./Tests/Scripts/change-release-to-test-tag.sh
|
||||
- name: Start Server with release tag
|
||||
run: npm run start
|
||||
@@ -1457,6 +1644,56 @@ jobs:
|
||||
# Optional. Defaults to repository settings.
|
||||
retention-days: 7
|
||||
|
||||
infrastructure-agent-deploy:
|
||||
needs: [generate-build-number]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
|
||||
- name: Install GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6.1.0
|
||||
with:
|
||||
install-only: true
|
||||
|
||||
- name: GoReleaser Version
|
||||
run: goreleaser -v
|
||||
|
||||
# This tool is used to generate .rpm and .deb packages
|
||||
- name: Install NFPM
|
||||
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
|
||||
|
||||
- name: Show GoReleaser version
|
||||
run: goreleaser -v
|
||||
|
||||
- name: Run GoReleaser
|
||||
run: cd InfrastructureAgent && export GORELEASER_CURRENT_TAG=7.0.${{needs.generate-build-number.outputs.build_number}} && goreleaser release --clean --snapshot
|
||||
|
||||
- name: Release MSI Images
|
||||
run: cd InfrastructureAgent && bash build-msi.sh 7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
|
||||
- name: Upload Release Binaries
|
||||
uses: actions/upload-artifact@v4
|
||||
# Run this on failure
|
||||
with:
|
||||
# Name of the artifact to upload.
|
||||
# Optional. Default is 'artifact'
|
||||
name: binaries
|
||||
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
# Required.
|
||||
path: |
|
||||
./InfrastructureAgent/dist
|
||||
|
||||
|
||||
# Duration after which artifact will expire in days. 0 means using default retention.
|
||||
# Minimum 1 day.
|
||||
# Maximum 90 days unless changed from the repository settings page.
|
||||
# Optional. Defaults to repository settings.
|
||||
retention-days: 7
|
||||
|
||||
|
||||
6
.github/workflows/test.common.yaml
vendored
6
.github/workflows/test.common.yaml
vendored
@@ -14,10 +14,10 @@ jobs:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
BILLING_PRIVATE_KEY: ${{secrets.TEST_BILLING_PRIVATE_KEY}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && bash test-setup.sh
|
||||
- run: cd Common && npm install && rm -rf build && npm run test
|
||||
|
||||
58
.github/workflows/test.e2e.yaml
vendored
58
.github/workflows/test.e2e.yaml
vendored
@@ -1,58 +0,0 @@
|
||||
name: E2E Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*' # excludes hotfix branches
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
# this might remove tools that are actually needed,
|
||||
# if set to "true" but frees about 6 GB
|
||||
tool-cache: false
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: npm run prerun && bash ./Tests/Scripts/enable-billing-env-var.sh
|
||||
- run: npm run dev
|
||||
- name: Wait for server to start
|
||||
run: bash ./Tests/Scripts/status-check.sh http://localhost
|
||||
- name: Run E2E Tests. Run docker container e2e in docker compose file
|
||||
run: export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker compose -f docker-compose.dev.yml logs e2e && exit 1)
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v4
|
||||
# Run this on failure
|
||||
if: failure()
|
||||
with:
|
||||
# Name of the artifact to upload.
|
||||
# Optional. Default is 'artifact'
|
||||
name: test-results
|
||||
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
# Required.
|
||||
path: |
|
||||
./E2E
|
||||
|
||||
|
||||
# Duration after which artifact will expire in days. 0 means using default retention.
|
||||
# Minimum 1 day.
|
||||
# Maximum 90 days unless changed from the repository settings page.
|
||||
# Optional. Defaults to repository settings.
|
||||
retention-days: 7
|
||||
20
.github/workflows/test.fluent-ingest.yaml
vendored
Normal file
20
.github/workflows/test.fluent-ingest.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Fluent Ingest Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*' # excludes hotfix branches
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd FluentIngest && npm install && npm run test
|
||||
21
.github/workflows/test.incoming-request-ingest.yml
vendored
Normal file
21
.github/workflows/test.incoming-request-ingest.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Incoming Request Ingest Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*' # excludes hotfix branches
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd IncomingRequestIngest && npm install && npm run test
|
||||
|
||||
21
.github/workflows/test.open-telemetry-ingest.yaml
vendored
Normal file
21
.github/workflows/test.open-telemetry-ingest.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: OpenTelemetryIngest Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*' # excludes hotfix branches
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- run: cd OpenTelemetryIngest && npm install && npm run test
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Ingestor Test
|
||||
name: ProbeIngest Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -13,9 +13,9 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Ingestor && npm install && npm run test
|
||||
node-version: latest
|
||||
- run: cd ProbeIngest && npm install && npm run test
|
||||
|
||||
6
.github/workflows/test.probe.yaml
vendored
6
.github/workflows/test.probe.yaml
vendored
@@ -13,10 +13,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Common && npm install
|
||||
- run: cd Probe && npm install
|
||||
- run: cd Probe && npm run test
|
||||
|
||||
18
.github/workflows/test.yaml
vendored
18
.github/workflows/test.yaml
vendored
@@ -13,10 +13,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd App && npm install && npm run test
|
||||
|
||||
test-home:
|
||||
@@ -24,10 +24,10 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Home && npm install && npm run test
|
||||
|
||||
test-worker:
|
||||
@@ -35,8 +35,8 @@ jobs:
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
node-version: latest
|
||||
- run: cd Worker && npm install && npm run test
|
||||
@@ -1 +1 @@
|
||||
# Description: Copilot will run this script before we commit the changes to your repository.
|
||||
# Description: Copilot will run this script before we commit the changes to your repository.
|
||||
|
||||
68
.vscode/launch.json
vendored
68
.vscode/launch.json
vendored
@@ -93,7 +93,7 @@
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Worker",
|
||||
"localRoot": "${workspaceFolder}/Workflow",
|
||||
"name": "Workflow: Debug with Docker",
|
||||
"port": 8735,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
@@ -107,7 +107,7 @@
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Worker",
|
||||
"localRoot": "${workspaceFolder}/Docs",
|
||||
"name": "Docs: Debug with Docker",
|
||||
"port": 8738,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
@@ -121,7 +121,7 @@
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Worker",
|
||||
"localRoot": "${workspaceFolder}/APIReference",
|
||||
"name": "API Reference: Debug with Docker",
|
||||
"port": 8737,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
@@ -151,7 +151,7 @@
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Probe",
|
||||
"name": "Probe: Debug with Docker",
|
||||
"port": 9655,
|
||||
"port": 9229,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
@@ -163,8 +163,8 @@
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Ingestor",
|
||||
"name": "Ingestor: Debug with Docker",
|
||||
"localRoot": "${workspaceFolder}/ProbeIngest",
|
||||
"name": "ProbeIngest: Debug with Docker",
|
||||
"port": 9932,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
@@ -175,6 +175,48 @@
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/IncomingRequestIngest",
|
||||
"name": "IncomingRequestIngest: Debug with Docker",
|
||||
"port": 9933,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/OpenTelemetryIngest",
|
||||
"name": "OpenTelemetryIngest: Debug with Docker",
|
||||
"port": 9938,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/FluentIngest",
|
||||
"name": "Fluent Ingest: Debug with Docker",
|
||||
"port": 9937,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/IsolatedVM",
|
||||
@@ -217,20 +259,6 @@
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Workers",
|
||||
"name": "Workers: Debug with Docker",
|
||||
"port": 9654,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/StatusPage",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Pull base image nodejs image.
|
||||
FROM node:21.2-alpine3.18
|
||||
FROM public.ecr.aws/docker/library/node:21.2-alpine3.18
|
||||
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
|
||||
|
||||
RUN npm config set fetch-retries 5
|
||||
|
||||
@@ -17,10 +17,11 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
const statusCheck: PromiseVoidFunction = async (): Promise<void> => {
|
||||
// Check the status of infrastructure components
|
||||
return await InfrastructureStatus.checkStatus({
|
||||
return await InfrastructureStatus.checkStatusWithRetry({
|
||||
checkClickhouseStatus: false,
|
||||
checkPostgresStatus: false,
|
||||
checkRedisStatus: false,
|
||||
retryCount: 3,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
</h2>
|
||||
|
||||
<script>
|
||||
function showPermissions(id){
|
||||
var permissionsblock = document.getElementById(id+"-permissions");
|
||||
var viewPermissionsBtn = document.getElementById(id+"-view-permissions");
|
||||
function showPermissions(id) {
|
||||
var permissionsblock = document.getElementById(id + "-permissions");
|
||||
var viewPermissionsBtn = document.getElementById(id + "-view-permissions");
|
||||
|
||||
if(permissionsblock.style.display === "none"){
|
||||
if (permissionsblock.style.display === "none") {
|
||||
permissionsblock.style.display = "block";
|
||||
viewPermissionsBtn.innerHTML = "Hide Permissions";
|
||||
}else{
|
||||
} else {
|
||||
permissionsblock.style.display = "none";
|
||||
viewPermissionsBtn.innerHTML = "View Permissions";
|
||||
}
|
||||
@@ -48,11 +48,16 @@
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none text-sm [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>
|
||||
<%= pageData.columns[Object.keys(pageData.columns)[i]].description -%> <a class="text-gray-500 hover:underline cursor-pointer text-xs" id="<%= Object.keys(pageData.columns)[i] -%>-view-permissions" onclick="showPermissions('<%= Object.keys(pageData.columns)[i] -%>')">View Permissions</a>
|
||||
<%= pageData.columns[Object.keys(pageData.columns)[i]].description -%> <a
|
||||
class="text-gray-500 hover:underline cursor-pointer text-xs"
|
||||
id="<%= Object.keys(pageData.columns)[i] -%>-view-permissions"
|
||||
onclick="showPermissions('<%= Object.keys(pageData.columns)[i] -%>')">View
|
||||
Permissions</a>
|
||||
</p>
|
||||
</dd>
|
||||
|
||||
<dd class="font-mono text-xs" style="display: none;" id="<%= Object.keys(pageData.columns)[i] -%>-permissions">
|
||||
<dd class="font-mono text-xs" style="display: none;"
|
||||
id="<%= Object.keys(pageData.columns)[i] -%>-permissions">
|
||||
|
||||
<div class="mb-3 mt-3">
|
||||
<span class="text-gray-700 text-xs">Permissions to Create: </span>
|
||||
@@ -319,8 +324,7 @@
|
||||
|
||||
<div class="[&>:first-child]:mt-0 [&>:last-child]:mb-0 xl:sticky xl:top-24">
|
||||
<%- include('../partials/code', {title: "Example Item Request" , requestUrl:
|
||||
pageData.apiPath+"/3599ee69-43a7-42d7/get-item", code: pageData.itemRequest, requestType: "POST" })
|
||||
-%>
|
||||
pageData.apiPath+"/:id/get-item", code: pageData.itemRequest, requestType: "POST" }) -%>
|
||||
<%- include('../partials/code', {title: "Example Item Response" , code: pageData.itemResponse,
|
||||
requestType: "" }) -%>
|
||||
</div>
|
||||
@@ -469,11 +473,34 @@
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="border border-gray-100 bg-gray-50 rounded-md p-4 text-sm mt-10">
|
||||
<h4 class="font-semibold text-gray-700 ">For clients that do not support PUT requests<h4>
|
||||
<p class="text-gray-500 text-xs mt-4">
|
||||
You can also update an object by sending a POST or GET request to these endpoints with the
|
||||
same
|
||||
request headers and body.
|
||||
</p>
|
||||
|
||||
<div class="flex items-center gap-x-3 mt-10"><span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
|
||||
class="font-mono text-xs text-zinc-400">
|
||||
<%= pageData.apiPath -%>/:id/update-item
|
||||
</span></div>
|
||||
<div class="flex items-center gap-x-3 mt-10"><span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-emerald-300 bg-emerald-400/10 text-emerald-500 ">GET</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
|
||||
class="font-mono text-xs text-zinc-400">
|
||||
<%= pageData.apiPath -%>/:id/update-item
|
||||
</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="[&>:first-child]:mt-0 [&>:last-child]:mb-0 xl:sticky xl:top-24">
|
||||
<%- include('../partials/code', {title: "Example Update Request" , requestUrl:
|
||||
pageData.apiPath+"/3599ee69-43a7-42d7", code: pageData.updateRequest, requestType: "PUT" }) -%>
|
||||
pageData.apiPath+"/:id", code: pageData.updateRequest, requestType: "PUT" }) -%>
|
||||
<%- include('../partials/code', {title: "Example Update Response" , code: pageData.updateResponse,
|
||||
requestType: "" }) -%>
|
||||
</div>
|
||||
@@ -498,11 +525,34 @@
|
||||
<p>This endpoint allows you to delete object by its ID. </p>
|
||||
|
||||
|
||||
<div class="border border-gray-100 bg-gray-50 rounded-md p-4 text-sm mt-10">
|
||||
<h4 class="font-semibold text-gray-700 ">For clients that do not support DELETE requests<h4>
|
||||
<p class="text-gray-500 text-xs mt-4">
|
||||
You can also delete an object by sending a POST or GET request to these endpoints with the
|
||||
same
|
||||
request headers and body.
|
||||
</p>
|
||||
|
||||
<div class="flex items-center gap-x-3 mt-10"><span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 bg-sky-400/10 text-sky-500 ">POST</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
|
||||
class="font-mono text-xs text-zinc-400">
|
||||
<%= pageData.apiPath -%>/:id/delete-item
|
||||
</span></div>
|
||||
<div class="flex items-center gap-x-3 mt-10"><span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-emerald-300 bg-emerald-400/10 text-emerald-500 ">GET</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 "></span><span
|
||||
class="font-mono text-xs text-zinc-400">
|
||||
<%= pageData.apiPath -%>/:id/delete-item
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="[&>:first-child]:mt-0 [&>:last-child]:mb-0 xl:sticky xl:top-24">
|
||||
<%- include('../partials/code', {title: "Example Delete Request" , requestUrl:
|
||||
pageData.apiPath+"/3599ee69-43a7-42d7", code: pageData.deleteRequest, requestType: "DELETE" }) -%>
|
||||
pageData.apiPath+"/:id", code: pageData.deleteRequest, requestType: "DELETE" }) -%>
|
||||
<%- include('../partials/code', {title: "Example Delete Response" , code: pageData.deleteResponse,
|
||||
requestType: "" }) -%>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Pull base image nodejs image.
|
||||
FROM node:21.7.3-alpine3.18
|
||||
FROM public.ecr.aws/docker/library/node:21.7.3-alpine3.18
|
||||
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
|
||||
|
||||
RUN npm config set fetch-retries 5
|
||||
|
||||
185
Accounts/package-lock.json
generated
185
Accounts/package-lock.json
generated
@@ -9,10 +9,9 @@
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"Common": "file:../Common",
|
||||
|
||||
"css-loader": "^6.11.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"express": "^4.19.2",
|
||||
"express": "^4.20.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
@@ -117,6 +116,7 @@
|
||||
"../CommonServer": {
|
||||
"name": "@oneuptime/common-server",
|
||||
"version": "1.0.0",
|
||||
"extraneous": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clickhouse/client": "^0.2.10",
|
||||
@@ -725,9 +725,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "1.20.2",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
|
||||
"integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==",
|
||||
"version": "1.20.3",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
|
||||
"integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"content-type": "~1.0.5",
|
||||
@@ -737,7 +738,7 @@
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.4.24",
|
||||
"on-finished": "2.4.1",
|
||||
"qs": "6.11.0",
|
||||
"qs": "6.13.0",
|
||||
"raw-body": "2.5.2",
|
||||
"type-is": "~1.6.18",
|
||||
"unpipe": "1.0.0"
|
||||
@@ -751,6 +752,7 @@
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
@@ -758,7 +760,23 @@
|
||||
"node_modules/body-parser/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/body-parser/node_modules/qs": {
|
||||
"version": "6.13.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
|
||||
"integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
@@ -821,6 +839,7 @@
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
@@ -829,6 +848,7 @@
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
|
||||
"integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.0",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -956,10 +976,6 @@
|
||||
"resolved": "../Common",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/CommonServer": {
|
||||
"resolved": "../CommonServer",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
@@ -981,6 +997,7 @@
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@@ -1068,6 +1085,7 @@
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
|
||||
"integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.0",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -1084,6 +1102,7 @@
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
@@ -1092,6 +1111,7 @@
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
|
||||
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8",
|
||||
"npm": "1.2.8000 || >= 1.4.16"
|
||||
@@ -1159,6 +1179,7 @@
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
|
||||
"integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-intrinsic": "^1.2.4"
|
||||
},
|
||||
@@ -1170,6 +1191,7 @@
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
@@ -1235,6 +1257,7 @@
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@@ -1248,36 +1271,37 @@
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.19.2",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
|
||||
"integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz",
|
||||
"integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "1.20.2",
|
||||
"body-parser": "1.20.3",
|
||||
"content-disposition": "0.5.4",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "0.6.0",
|
||||
"cookie-signature": "1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"encodeurl": "~1.0.2",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"finalhandler": "1.2.0",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "2.0.0",
|
||||
"merge-descriptors": "1.0.1",
|
||||
"merge-descriptors": "1.0.3",
|
||||
"methods": "~1.1.2",
|
||||
"on-finished": "2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "0.1.7",
|
||||
"path-to-regexp": "0.1.10",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "6.11.0",
|
||||
"range-parser": "~1.2.1",
|
||||
"safe-buffer": "5.2.1",
|
||||
"send": "0.18.0",
|
||||
"serve-static": "1.15.0",
|
||||
"send": "0.19.0",
|
||||
"serve-static": "1.16.0",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"type-is": "~1.6.18",
|
||||
@@ -1296,6 +1320,15 @@
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/express/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
@@ -1383,6 +1416,7 @@
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@@ -1405,6 +1439,7 @@
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
@@ -1413,6 +1448,7 @@
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
|
||||
"integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2",
|
||||
@@ -1448,6 +1484,7 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
|
||||
"integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-intrinsic": "^1.1.3"
|
||||
},
|
||||
@@ -1473,6 +1510,7 @@
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
|
||||
"integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.0"
|
||||
},
|
||||
@@ -1484,6 +1522,7 @@
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
|
||||
"integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
@@ -1495,6 +1534,7 @@
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
||||
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
@@ -1506,6 +1546,7 @@
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
@@ -1517,6 +1558,7 @@
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
@@ -1532,6 +1574,7 @@
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
},
|
||||
@@ -1559,7 +1602,8 @@
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
@@ -1724,14 +1768,19 @@
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
|
||||
"integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-stream": {
|
||||
"version": "2.0.0",
|
||||
@@ -1762,6 +1811,7 @@
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
},
|
||||
@@ -1902,9 +1952,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||
"integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==",
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
|
||||
"integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
@@ -1929,9 +1983,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
|
||||
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
@@ -2078,6 +2133,7 @@
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.4"
|
||||
},
|
||||
@@ -2100,6 +2156,7 @@
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
@@ -2108,6 +2165,7 @@
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
|
||||
"integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
@@ -2207,7 +2265,8 @@
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sass-loader": {
|
||||
"version": "13.3.3",
|
||||
@@ -2285,9 +2344,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "0.18.0",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
|
||||
"integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
|
||||
"version": "0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
|
||||
"integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
@@ -2311,6 +2371,7 @@
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
@@ -2318,7 +2379,8 @@
|
||||
"node_modules/send/node_modules/debug/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.1",
|
||||
@@ -2329,9 +2391,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
|
||||
"integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz",
|
||||
"integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "~1.0.2",
|
||||
"escape-html": "~1.0.3",
|
||||
@@ -2342,10 +2405,50 @@
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static/node_modules/debug/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/serve-static/node_modules/send": {
|
||||
"version": "0.18.0",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
|
||||
"integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"destroy": "1.2.0",
|
||||
"encodeurl": "~1.0.2",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "2.0.0",
|
||||
"mime": "1.6.0",
|
||||
"ms": "2.1.3",
|
||||
"on-finished": "2.4.1",
|
||||
"range-parser": "~1.2.1",
|
||||
"statuses": "2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/set-function-length": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
|
||||
"integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"define-data-property": "^1.1.4",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -2361,12 +2464,14 @@
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
|
||||
"integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -2551,6 +2656,7 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
@@ -2633,6 +2739,7 @@
|
||||
"version": "1.6.18",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "~2.1.24"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"Common": "file:../Common",
|
||||
"css-loader": "^6.11.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"express": "^4.19.2",
|
||||
"express": "^4.20.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
||||
2
Accounts/public/assets/js/tailwind-3.4.5.js
Normal file
2
Accounts/public/assets/js/tailwind-3.4.5.js
Normal file
File diff suppressed because one or more lines are too long
@@ -73,7 +73,7 @@
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="/accounts/assets/js/tailwind-3.4.5.js"></script>
|
||||
|
||||
<title>OneUptime Accounts</title>
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ const LoginPage: () => JSX.Element = () => {
|
||||
<div>
|
||||
<Link to={new Route("/accounts/login")}>
|
||||
<div className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm">
|
||||
Use username and password insead.
|
||||
Use username and password instead.
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -179,7 +179,7 @@ const RegisterPage: () => JSX.Element = () => {
|
||||
]);
|
||||
|
||||
if (error) {
|
||||
return <ErrorMessage error={error} />;
|
||||
return <ErrorMessage message={error} />;
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Pull base image nodejs image.
|
||||
FROM node:21.7.3-alpine3.18
|
||||
FROM public.ecr.aws/docker/library/node:21.7.3-alpine3.18
|
||||
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
|
||||
|
||||
RUN npm config set fetch-retries 5
|
||||
|
||||
2
AdminDashboard/public/assets/js/tailwind-3.4.5.js
Normal file
2
AdminDashboard/public/assets/js/tailwind-3.4.5.js
Normal file
File diff suppressed because one or more lines are too long
@@ -66,7 +66,7 @@
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="/admin/assets/js/tailwind-3.4.5.js"></script>
|
||||
|
||||
<script src="/admin/env.js"></script>
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ const DashboardProjectPicker: FunctionComponent<ComponentProps> = (
|
||||
minLength: 6,
|
||||
},
|
||||
footerElement: getFooter(),
|
||||
fieldType: FormFieldSchemaType.RadioButton,
|
||||
fieldType: FormFieldSchemaType.OptionChooserButton,
|
||||
radioButtonOptions: SubscriptionPlan.getSubscriptionPlans(
|
||||
getAllEnvVars(),
|
||||
).map((plan: SubscriptionPlan): RadioButton => {
|
||||
|
||||
@@ -41,7 +41,7 @@ const Logout: FunctionComponent = (): ReactElement => {
|
||||
]}
|
||||
>
|
||||
{!error ? <PageLoader isVisible={true} /> : <></>}
|
||||
{error ? <ErrorMessage error={error} /> : <></>}
|
||||
{error ? <ErrorMessage message={error} /> : <></>}
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ const Projects: FunctionComponent = (): ReactElement => {
|
||||
minLength: 6,
|
||||
},
|
||||
footerElement: getFooter(),
|
||||
fieldType: FormFieldSchemaType.RadioButton,
|
||||
fieldType: FormFieldSchemaType.OptionChooserButton,
|
||||
radioButtonOptions: SubscriptionPlan.getSubscriptionPlans(
|
||||
getAllEnvVars(),
|
||||
).map((plan: SubscriptionPlan): RadioButton => {
|
||||
|
||||
@@ -61,7 +61,7 @@ const Settings: FunctionComponent = (): ReactElement => {
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return <ErrorMessage error={error} />;
|
||||
return <ErrorMessage message={error} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -99,7 +99,7 @@ const Settings: FunctionComponent = (): ReactElement => {
|
||||
},
|
||||
title: "Description",
|
||||
fieldType: FormFieldSchemaType.LongText,
|
||||
required: true,
|
||||
required: false,
|
||||
placeholder: "This probe is to monitor all the internal services.",
|
||||
},
|
||||
|
||||
@@ -170,6 +170,7 @@ const Settings: FunctionComponent = (): ReactElement => {
|
||||
field: {
|
||||
description: true,
|
||||
},
|
||||
noValueMessage: "-",
|
||||
title: "Description",
|
||||
type: FieldType.Text,
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Pull base image nodejs image.
|
||||
FROM node:21.2-alpine3.18
|
||||
FROM public.ecr.aws/docker/library/node:21.2-alpine3.18
|
||||
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
|
||||
|
||||
RUN npm config set fetch-retries 5
|
||||
|
||||
@@ -10,9 +10,10 @@ import GlobalConfigAPI from "Common/Server/API/GlobalConfigAPI";
|
||||
import MonitorGroupAPI from "Common/Server/API/MonitorGroupAPI";
|
||||
import NotificationAPI from "Common/Server/API/NotificationAPI";
|
||||
import TelemetryAPI from "Common/Server/API/TelemetryAPI";
|
||||
import Ingestor from "Common/Server/API/ProbeAPI";
|
||||
import ProbeAPI from "Common/Server/API/ProbeAPI";
|
||||
import ProjectAPI from "Common/Server/API/ProjectAPI";
|
||||
import ProjectSsoAPI from "Common/Server/API/ProjectSSO";
|
||||
|
||||
// Import API
|
||||
import ResellerPlanAPI from "Common/Server/API/ResellerPlanAPI";
|
||||
import ShortLinkAPI from "Common/Server/API/ShortLinkAPI";
|
||||
@@ -21,6 +22,7 @@ import StatusPageDomainAPI from "Common/Server/API/StatusPageDomainAPI";
|
||||
import StatusPageSubscriberAPI from "Common/Server/API/StatusPageSubscriberAPI";
|
||||
import UserCallAPI from "Common/Server/API/UserCallAPI";
|
||||
import UserTwoFactorAuthAPI from "Common/Server/API/UserTwoFactorAuthAPI";
|
||||
import MonitorTest from "Common/Models/DatabaseModels/MonitorTest";
|
||||
// User Notification methods.
|
||||
import UserEmailAPI from "Common/Server/API/UserEmailAPI";
|
||||
import UserNotificationLogTimelineAPI from "Common/Server/API/UserOnCallLogTimelineAPI";
|
||||
@@ -59,6 +61,11 @@ import AlertNoteTemplateService, {
|
||||
import AlertOwnerTeamService, {
|
||||
Service as AlertOwnerTeamServiceType,
|
||||
} from "Common/Server/Services/AlertOwnerTeamService";
|
||||
|
||||
import DashboardService, {
|
||||
Service as DashboardServiceType,
|
||||
} from "Common/Server/Services/DashboardService";
|
||||
|
||||
import AlertOwnerUserService, {
|
||||
Service as AlertOwnerUserServiceType,
|
||||
} from "Common/Server/Services/AlertOwnerUserService";
|
||||
@@ -105,6 +112,9 @@ import IncidentSeverityService, {
|
||||
import IncidentStateService, {
|
||||
Service as IncidentStateServiceType,
|
||||
} from "Common/Server/Services/IncidentStateService";
|
||||
import MonitorTestService, {
|
||||
Service as MonitorTestServiceType,
|
||||
} from "Common/Server/Services/MonitorTestService";
|
||||
import IncidentStateTimelineService, {
|
||||
Service as IncidentStateTimelineServiceType,
|
||||
} from "Common/Server/Services/IncidentStateTimelineService";
|
||||
@@ -146,9 +156,6 @@ import MonitorGroupOwnerUserService, {
|
||||
import MonitorGroupResourceService, {
|
||||
Service as MonitorGroupResourceServiceType,
|
||||
} from "Common/Server/Services/MonitorGroupResourceService";
|
||||
import MonitorMetricsByMinuteService, {
|
||||
MonitorMetricsByMinuteService as MonitorMetricsByMinuteServiceType,
|
||||
} from "Common/Server/Services/MonitorMetricsByMinuteService";
|
||||
import MonitorOwnerTeamService, {
|
||||
Service as MonitorOwnerTeamServiceType,
|
||||
} from "Common/Server/Services/MonitorOwnerTeamService";
|
||||
@@ -366,7 +373,6 @@ import FeatureSet from "Common/Server/Types/FeatureSet";
|
||||
import Express, { ExpressApplication } from "Common/Server/Utils/Express";
|
||||
import Log from "Common/Models/AnalyticsModels/Log";
|
||||
import Metric from "Common/Models/AnalyticsModels/Metric";
|
||||
import MonitorMetricsByMinute from "Common/Models/AnalyticsModels/MonitorMetricsByMinute";
|
||||
import Span from "Common/Models/AnalyticsModels/Span";
|
||||
import ApiKey from "Common/Models/DatabaseModels/ApiKey";
|
||||
import ApiKeyPermission from "Common/Models/DatabaseModels/ApiKeyPermission";
|
||||
@@ -374,6 +380,7 @@ import CallLog from "Common/Models/DatabaseModels/CallLog";
|
||||
import Domain from "Common/Models/DatabaseModels/Domain";
|
||||
import EmailLog from "Common/Models/DatabaseModels/EmailLog";
|
||||
import EmailVerificationToken from "Common/Models/DatabaseModels/EmailVerificationToken";
|
||||
import Dashboard from "Common/Models/DatabaseModels/Dashboard";
|
||||
|
||||
import Alert from "Common/Models/DatabaseModels/Alert";
|
||||
import AlertCustomField from "Common/Models/DatabaseModels/AlertCustomField";
|
||||
@@ -489,6 +496,45 @@ import ScheduledMaintenanceTemplateOwnerUserService, {
|
||||
} from "Common/Server/Services/ScheduledMaintenanceTemplateOwnerUserService";
|
||||
import TableView from "Common/Models/DatabaseModels/TableView";
|
||||
|
||||
import IncidentFeed from "Common/Models/DatabaseModels/IncidentFeed";
|
||||
import AlertFeed from "Common/Models/DatabaseModels/AlertFeed";
|
||||
import ScheduledMaintenanceFeed from "Common/Models/DatabaseModels/ScheduledMaintenanceFeed";
|
||||
|
||||
import IncidentFeedService, {
|
||||
Service as IncidentFeedServiceType,
|
||||
} from "Common/Server/Services/IncidentFeedService";
|
||||
|
||||
import AlertFeedService, {
|
||||
Service as AlertFeedServiceType,
|
||||
} from "Common/Server/Services/AlertFeedService";
|
||||
|
||||
import ScheduledMaintenanceFeedService, {
|
||||
Service as ScheduledMaintenanceFeedServiceType,
|
||||
} from "Common/Server/Services/ScheduledMaintenanceFeedService";
|
||||
|
||||
import SlackAPI from "Common/Server/API/SlackAPI";
|
||||
|
||||
import WorkspaceProjectAuthToken from "Common/Models/DatabaseModels/WorkspaceProjectAuthToken";
|
||||
import WorkspaceProjectAuthTokenService, {
|
||||
Service as WorkspaceProjectAuthTokenServiceType,
|
||||
} from "Common/Server/Services/WorkspaceProjectAuthTokenService";
|
||||
|
||||
import WorkspaceUserAuthToken from "Common/Models/DatabaseModels/WorkspaceUserAuthToken";
|
||||
|
||||
import WorkspaceUserAuthTokenService, {
|
||||
Service as WorkspaceUserAuthTokenServiceType,
|
||||
} from "Common/Server/Services/WorkspaceUserAuthTokenService";
|
||||
|
||||
import WorkspaceSetting from "Common/Models/DatabaseModels/WorkspaceSetting";
|
||||
import WorkspaceSettingService, {
|
||||
Service as WorkspaceSettingServiceType,
|
||||
} from "Common/Server/Services/WorkspaceSettingService";
|
||||
|
||||
import WorkspaceNotificationRule from "Common/Models/DatabaseModels/WorkspaceNotificationRule";
|
||||
import WorkspaceNotificationRuleService, {
|
||||
Service as WorkspaceNotificationRuleServiceType,
|
||||
} from "Common/Server/Services/WorkspaceNotificationRuleService";
|
||||
|
||||
const BaseAPIFeatureSet: FeatureSet = {
|
||||
init: async (): Promise<void> => {
|
||||
const app: ExpressApplication = Express.getExpressApp();
|
||||
@@ -511,6 +557,60 @@ const BaseAPIFeatureSet: FeatureSet = {
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
// notification rule
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<
|
||||
WorkspaceNotificationRule,
|
||||
WorkspaceNotificationRuleServiceType
|
||||
>(
|
||||
WorkspaceNotificationRule,
|
||||
WorkspaceNotificationRuleService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<MonitorTest, MonitorTestServiceType>(
|
||||
MonitorTest,
|
||||
MonitorTestService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
//service provider setting
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<WorkspaceSetting, WorkspaceSettingServiceType>(
|
||||
WorkspaceSetting,
|
||||
WorkspaceSettingService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<IncidentFeed, IncidentFeedServiceType>(
|
||||
IncidentFeed,
|
||||
IncidentFeedService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<AlertFeed, AlertFeedServiceType>(
|
||||
AlertFeed,
|
||||
AlertFeedService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<
|
||||
ScheduledMaintenanceFeed,
|
||||
ScheduledMaintenanceFeedServiceType
|
||||
>(ScheduledMaintenanceFeed, ScheduledMaintenanceFeedService).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<AlertNoteTemplate, AlertNoteTemplateServiceType>(
|
||||
@@ -519,6 +619,26 @@ const BaseAPIFeatureSet: FeatureSet = {
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<
|
||||
WorkspaceProjectAuthToken,
|
||||
WorkspaceProjectAuthTokenServiceType
|
||||
>(
|
||||
WorkspaceProjectAuthToken,
|
||||
WorkspaceProjectAuthTokenService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
// user auth token
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<WorkspaceUserAuthToken, WorkspaceUserAuthTokenServiceType>(
|
||||
WorkspaceUserAuthToken,
|
||||
WorkspaceUserAuthTokenService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAPI<Alert, AlertServiceType>(Alert, AlertService).getRouter(),
|
||||
@@ -640,18 +760,18 @@ const BaseAPIFeatureSet: FeatureSet = {
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAnalyticsAPI<Metric, MetricServiceType>(
|
||||
Metric,
|
||||
MetricService,
|
||||
new BaseAPI<Dashboard, DashboardServiceType>(
|
||||
Dashboard,
|
||||
DashboardService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new BaseAnalyticsAPI<
|
||||
MonitorMetricsByMinute,
|
||||
MonitorMetricsByMinuteServiceType
|
||||
>(MonitorMetricsByMinute, MonitorMetricsByMinuteService).getRouter(),
|
||||
new BaseAnalyticsAPI<Metric, MetricServiceType>(
|
||||
Metric,
|
||||
MetricService,
|
||||
).getRouter(),
|
||||
);
|
||||
|
||||
app.use(
|
||||
@@ -1313,6 +1433,7 @@ const BaseAPIFeatureSet: FeatureSet = {
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new ResellerPlanAPI().getRouter(),
|
||||
);
|
||||
app.use(`/${APP_NAME.toLocaleLowerCase()}`, new SlackAPI().getRouter());
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
new GlobalConfigAPI().getRouter(),
|
||||
@@ -1344,7 +1465,7 @@ const BaseAPIFeatureSet: FeatureSet = {
|
||||
);
|
||||
app.use(`/${APP_NAME.toLocaleLowerCase()}`, new UserEmailAPI().getRouter());
|
||||
app.use(`/${APP_NAME.toLocaleLowerCase()}`, new UserSMSAPI().getRouter());
|
||||
app.use(`/${APP_NAME.toLocaleLowerCase()}`, new Ingestor().getRouter());
|
||||
app.use(`/${APP_NAME.toLocaleLowerCase()}`, new ProbeAPI().getRouter());
|
||||
|
||||
app.use(
|
||||
`/${APP_NAME.toLocaleLowerCase()}`,
|
||||
|
||||
@@ -36,6 +36,7 @@ import ProjectSSO from "Common/Models/DatabaseModels/ProjectSso";
|
||||
import TeamMember from "Common/Models/DatabaseModels/TeamMember";
|
||||
import User from "Common/Models/DatabaseModels/User";
|
||||
import xml2js from "xml2js";
|
||||
import Name from "Common/Types/Name";
|
||||
|
||||
const router: ExpressRouter = Express.getRouter();
|
||||
|
||||
@@ -45,106 +46,112 @@ const router: ExpressRouter = Express.getRouter();
|
||||
router.get(
|
||||
"/service-provider-login",
|
||||
async (req: ExpressRequest, res: ExpressResponse): Promise<void> => {
|
||||
if (!req.query["email"]) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Email is required"),
|
||||
);
|
||||
}
|
||||
try {
|
||||
if (!req.query["email"]) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Email is required"),
|
||||
);
|
||||
}
|
||||
|
||||
const email: Email = new Email(req.query["email"] as string);
|
||||
const email: Email = new Email(req.query["email"] as string);
|
||||
|
||||
if (!email) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Email is required"),
|
||||
);
|
||||
}
|
||||
if (!email) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Email is required"),
|
||||
);
|
||||
}
|
||||
|
||||
// get sso config for this user.
|
||||
// get sso config for this user.
|
||||
|
||||
const user: User | null = await UserService.findOneBy({
|
||||
query: { email: email },
|
||||
select: {
|
||||
_id: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("No SSO config found for this user"),
|
||||
);
|
||||
}
|
||||
|
||||
const userId: ObjectID = user.id!;
|
||||
|
||||
if (!userId) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("No SSO config found for this user"),
|
||||
);
|
||||
}
|
||||
|
||||
const projectUserBelongsTo: Array<ObjectID> = (
|
||||
await TeamMemberService.findBy({
|
||||
query: { userId: userId },
|
||||
const user: User | null = await UserService.findOneBy({
|
||||
query: { email: email },
|
||||
select: {
|
||||
projectId: true,
|
||||
_id: true,
|
||||
},
|
||||
limit: LIMIT_PER_PROJECT,
|
||||
skip: 0,
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
})
|
||||
).map((teamMember: TeamMember) => {
|
||||
return teamMember.projectId!;
|
||||
});
|
||||
});
|
||||
|
||||
if (projectUserBelongsTo.length === 0) {
|
||||
return Response.sendErrorResponse(
|
||||
if (!user) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("No SSO config found for this user"),
|
||||
);
|
||||
}
|
||||
|
||||
const userId: ObjectID = user.id!;
|
||||
|
||||
if (!userId) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("No SSO config found for this user"),
|
||||
);
|
||||
}
|
||||
|
||||
const projectUserBelongsTo: Array<ObjectID> = (
|
||||
await TeamMemberService.findBy({
|
||||
query: { userId: userId },
|
||||
select: {
|
||||
projectId: true,
|
||||
},
|
||||
limit: LIMIT_PER_PROJECT,
|
||||
skip: 0,
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
})
|
||||
).map((teamMember: TeamMember) => {
|
||||
return teamMember.projectId!;
|
||||
});
|
||||
|
||||
if (projectUserBelongsTo.length === 0) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("No SSO config found for this user"),
|
||||
);
|
||||
}
|
||||
|
||||
const projectSSOList: Array<ProjectSSO> = await ProjectSSOService.findBy({
|
||||
query: {
|
||||
projectId: QueryHelper.any(projectUserBelongsTo),
|
||||
isEnabled: true,
|
||||
},
|
||||
limit: LIMIT_PER_PROJECT,
|
||||
skip: 0,
|
||||
select: {
|
||||
name: true,
|
||||
description: true,
|
||||
_id: true,
|
||||
projectId: true,
|
||||
project: {
|
||||
name: true,
|
||||
} as Select<Project>,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
return Response.sendEntityArrayResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("No SSO config found for this user"),
|
||||
projectSSOList,
|
||||
projectSSOList.length,
|
||||
ProjectSSO,
|
||||
);
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
|
||||
Response.sendErrorResponse(req, res, err as Exception);
|
||||
}
|
||||
|
||||
const projectSSOList: Array<ProjectSSO> = await ProjectSSOService.findBy({
|
||||
query: {
|
||||
projectId: QueryHelper.any(projectUserBelongsTo),
|
||||
isEnabled: true,
|
||||
},
|
||||
limit: LIMIT_PER_PROJECT,
|
||||
skip: 0,
|
||||
select: {
|
||||
name: true,
|
||||
description: true,
|
||||
_id: true,
|
||||
projectId: true,
|
||||
project: {
|
||||
name: true,
|
||||
} as Select<Project>,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
return Response.sendEntityArrayResponse(
|
||||
req,
|
||||
res,
|
||||
projectSSOList,
|
||||
projectSSOList.length,
|
||||
ProjectSSO,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -153,7 +160,7 @@ router.get(
|
||||
async (
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
next: NextFunction,
|
||||
_next: NextFunction,
|
||||
): Promise<void> => {
|
||||
try {
|
||||
if (!req.params["projectId"]) {
|
||||
@@ -227,7 +234,9 @@ router.get(
|
||||
|
||||
return Response.redirect(req, res, samlRequestUrl);
|
||||
} catch (err) {
|
||||
return next(err);
|
||||
logger.error(err);
|
||||
|
||||
Response.sendErrorResponse(req, res, err as Exception);
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -275,6 +284,7 @@ const loginUserWithSso: LoginUserWithSsoFunction = async (
|
||||
|
||||
let issuerUrl: string = "";
|
||||
let email: Email | null = null;
|
||||
let fullName: Name | null = null;
|
||||
|
||||
if (!req.params["projectId"]) {
|
||||
return Response.sendErrorResponse(
|
||||
@@ -364,6 +374,7 @@ const loginUserWithSso: LoginUserWithSsoFunction = async (
|
||||
|
||||
issuerUrl = SSOUtil.getIssuer(response);
|
||||
email = SSOUtil.getEmail(response);
|
||||
fullName = SSOUtil.getUserFullName(response);
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof Exception) {
|
||||
return Response.sendErrorResponse(req, res, err);
|
||||
@@ -412,6 +423,7 @@ const loginUserWithSso: LoginUserWithSsoFunction = async (
|
||||
|
||||
alreadySavedUser = await UserService.createByEmail({
|
||||
email,
|
||||
name: fullName || undefined,
|
||||
isEmailVerified: true,
|
||||
generateRandomPassword: true,
|
||||
props: {
|
||||
@@ -522,7 +534,8 @@ const loginUserWithSso: LoginUserWithSsoFunction = async (
|
||||
);
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
Response.sendErrorResponse(req, res, new ServerException());
|
||||
|
||||
Response.sendErrorResponse(req, res, err as Exception);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -27,8 +27,10 @@ import StatusPagePrivateUser from "Common/Models/DatabaseModels/StatusPagePrivat
|
||||
import StatusPageSSO from "Common/Models/DatabaseModels/StatusPageSso";
|
||||
import xml2js from "xml2js";
|
||||
|
||||
// Initialize Express router.
|
||||
const router: ExpressRouter = Express.getRouter();
|
||||
|
||||
// Define a GET route for SSO in a status page context.
|
||||
router.get(
|
||||
"/status-page-sso/:statusPageId/:statusPageSsoId",
|
||||
async (
|
||||
@@ -37,6 +39,7 @@ router.get(
|
||||
next: NextFunction,
|
||||
): Promise<void> => {
|
||||
try {
|
||||
// Check if statusPageId parameter is present.
|
||||
if (!req.params["statusPageId"]) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
@@ -45,6 +48,7 @@ router.get(
|
||||
);
|
||||
}
|
||||
|
||||
// Check if statusPageSsoId parameter is present.
|
||||
if (!req.params["statusPageSsoId"]) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
@@ -53,14 +57,16 @@ router.get(
|
||||
);
|
||||
}
|
||||
|
||||
// Create ObjectID instance from statusPageId parameter.
|
||||
const statusPageId: ObjectID = new ObjectID(req.params["statusPageId"]);
|
||||
|
||||
// Find SSO record in the database with specific query parameters.
|
||||
const statusPageSSO: StatusPageSSO | null =
|
||||
await StatusPageSsoService.findOneBy({
|
||||
query: {
|
||||
statusPageId: statusPageId,
|
||||
_id: req.params["statusPageSsoId"],
|
||||
isEnabled: true,
|
||||
statusPageId: statusPageId, // Ensure that statusPageId matches.
|
||||
_id: req.params["statusPageSsoId"], // Ensure SSO ID matches.
|
||||
isEnabled: true, // Ensure the SSO is enabled.
|
||||
},
|
||||
select: {
|
||||
signOnURL: true,
|
||||
@@ -235,6 +241,7 @@ router.post(
|
||||
if (statusPageSSO.issuerURL.toString() !== issuerUrl) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
|
||||
res,
|
||||
new BadRequestException("Issuer URL does not match"),
|
||||
);
|
||||
@@ -285,6 +292,7 @@ router.post(
|
||||
res,
|
||||
CookieUtil.getUserTokenKey(alreadySavedUser.statusPageId!),
|
||||
token,
|
||||
|
||||
{
|
||||
httpOnly: true,
|
||||
maxAge: OneUptimeDate.getMillisecondsInDays(new PositiveNumber(30)),
|
||||
|
||||
@@ -8,6 +8,7 @@ import logger from "Common/Server/Utils/Logger";
|
||||
import xmlCrypto, { FileKeyInfo } from "xml-crypto";
|
||||
import xmldom from "xmldom";
|
||||
import zlib from "zlib";
|
||||
import Name from "Common/Types/Name";
|
||||
|
||||
export default class SSOUtil {
|
||||
public static createSAMLRequestUrl(data: {
|
||||
@@ -138,6 +139,88 @@ export default class SSOUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static getUserFullName(payload: JSONObject): Name | null {
|
||||
if (!payload["saml2p:Response"] && !payload["samlp:Response"]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
payload =
|
||||
(payload["saml2p:Response"] as JSONObject) ||
|
||||
(payload["samlp:Response"] as JSONObject) ||
|
||||
(payload["Response"] as JSONObject);
|
||||
|
||||
const samlAssertion: JSONArray =
|
||||
(payload["saml2:Assertion"] as JSONArray) ||
|
||||
(payload["saml:Assertion"] as JSONArray) ||
|
||||
(payload["Assertion"] as JSONArray);
|
||||
|
||||
if (!samlAssertion || samlAssertion.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const samlAttributeStatement: JSONArray =
|
||||
((samlAssertion[0] as JSONObject)[
|
||||
"saml2:AttributeStatement"
|
||||
] as JSONArray) ||
|
||||
((samlAssertion[0] as JSONObject)[
|
||||
"saml:AttributeStatement"
|
||||
] as JSONArray) ||
|
||||
((samlAssertion[0] as JSONObject)["AttributeStatement"] as JSONArray);
|
||||
|
||||
if (!samlAttributeStatement || samlAttributeStatement.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const samlAttribute: JSONArray =
|
||||
((samlAttributeStatement[0] as JSONObject)[
|
||||
"saml2:Attribute"
|
||||
] as JSONArray) ||
|
||||
((samlAttributeStatement[0] as JSONObject)[
|
||||
"saml:Attribute"
|
||||
] as JSONArray) ||
|
||||
((samlAttributeStatement[0] as JSONObject)["Attribute"] as JSONArray);
|
||||
|
||||
if (!samlAttribute || samlAttribute.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// get displayName attribute.
|
||||
// {
|
||||
// "$": {
|
||||
// "Name": "http://schemas.microsoft.com/identity/claims/displayname"
|
||||
// },
|
||||
// "AttributeValue": [
|
||||
// "Nawaz Dhandala"
|
||||
// ]
|
||||
// },
|
||||
|
||||
for (let i: number = 0; i < samlAttribute.length; i++) {
|
||||
const attribute: JSONObject = samlAttribute[i] as JSONObject;
|
||||
if (
|
||||
attribute["$"] &&
|
||||
(attribute["$"] as JSONObject)["Name"]?.toString()
|
||||
) {
|
||||
const name: string | undefined = (attribute["$"] as JSONObject)[
|
||||
"Name"
|
||||
]?.toString();
|
||||
if (
|
||||
name &&
|
||||
name === "http://schemas.microsoft.com/identity/claims/displayname" &&
|
||||
attribute["AttributeValue"] &&
|
||||
Array.isArray(attribute["AttributeValue"]) &&
|
||||
attribute["AttributeValue"].length > 0
|
||||
) {
|
||||
const fullName: Name = new Name(
|
||||
attribute["AttributeValue"][0]!.toString() as string,
|
||||
);
|
||||
return fullName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static getEmail(payload: JSONObject): Email {
|
||||
if (!payload["saml2p:Response"] && !payload["samlp:Response"]) {
|
||||
throw new BadRequestException("SAML Response not found.");
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{{> Start this}}
|
||||
|
||||
{{> CustomLogo this}}
|
||||
{{> EmailTitle title=(concat statusPageName " - Please confirm your subscription" ) }}
|
||||
|
||||
{{> InfoBlock info="You will be the first to hear from us when there are any incidents, announcements or scheduled maintenance events."}}
|
||||
|
||||
{{> ButtonBlock buttonUrl=confirmationUrl buttonText="Confirm Subscription"}}
|
||||
|
||||
{{> InfoBlock info="You can also view the status page by visiting this link:"}}
|
||||
{{> InfoBlock info=statusPageUrl}}
|
||||
|
||||
{{> UnsubscribeBlock this}}
|
||||
|
||||
{{> VerticalSpace this}}
|
||||
|
||||
{{> End this}}
|
||||
@@ -39,7 +39,7 @@
|
||||
{{> InfoBlock info="No resources have been added to this status page yet."}}
|
||||
{{/ifCond}}
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
@@ -3,16 +3,15 @@
|
||||
{{> CustomLogo this}}
|
||||
{{> EmailTitle title=(concat "You have been subscribed to status page - " statusPageName) }}
|
||||
|
||||
{{> InfoBlock info=(concat "You have been subscribed to status page - " statusPageName)}}
|
||||
{{> InfoBlock info="You will be the first to hear from us when there are any incidents, announcements or scheduled maintenance events."}}
|
||||
|
||||
{{> ButtonBlock buttonUrl=statusPageUrl buttonText="Go to Status Page"}}
|
||||
|
||||
{{> InfoBlock info="You can also view the status page by visiting these link:"}}
|
||||
{{> InfoBlock info="You can also view the status page by visiting this link:"}}
|
||||
{{> InfoBlock info=statusPageUrl}}
|
||||
|
||||
{{> UnsubscribeBlock this}}
|
||||
|
||||
{{> VerticalSpace this}}
|
||||
|
||||
{{> End this}}
|
||||
{{> End this}}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{> DetailBoxField title="" text=announcementDescription }}
|
||||
{{> DetailBoxEnd this }}
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{{> DetailBoxEnd this }}
|
||||
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{> DetailBoxEnd this }}
|
||||
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{> Start this}}
|
||||
|
||||
{{> CustomLogo this}}
|
||||
{{> EmailTitle title=(concat "Incident: " incidentTitle) }}
|
||||
{{> EmailTitle title=emailTitle }}
|
||||
|
||||
{{> InfoBlock info="Incident state has changed. Here are the details: "}}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{> DetailBoxField title="" text=incidentDescription }}
|
||||
{{> DetailBoxEnd this }}
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
{{> InfoBlock info=statusPageUrl}}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{{> DetailBoxEnd this }}
|
||||
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{> DetailBoxField title="" text=eventDescription }}
|
||||
{{> DetailBoxEnd this }}
|
||||
|
||||
{{> InfoBlock info=(concat "This is an automated email sent to you because you are subscribed to " statusPageName) }}
|
||||
{{> InfoBlock info=(concat subscriberEmailNotificationFooterText "") }}
|
||||
|
||||
|
||||
{{> InfoBlock info="You can visit the status page here:"}}
|
||||
|
||||
38
App/Index.ts
38
App/Index.ts
@@ -24,10 +24,42 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
const statusCheck: PromiseVoidFunction = async (): Promise<void> => {
|
||||
// Check the status of infrastructure components
|
||||
return await InfrastructureStatus.checkStatus({
|
||||
return await InfrastructureStatus.checkStatusWithRetry({
|
||||
checkClickhouseStatus: true,
|
||||
checkPostgresStatus: true,
|
||||
checkRedisStatus: true,
|
||||
retryCount: 3,
|
||||
});
|
||||
};
|
||||
|
||||
const globalCacheCheck: PromiseVoidFunction = async (): Promise<void> => {
|
||||
// Check the status of cache
|
||||
return await InfrastructureStatus.checkStatusWithRetry({
|
||||
checkClickhouseStatus: false,
|
||||
checkPostgresStatus: false,
|
||||
checkRedisStatus: true,
|
||||
retryCount: 3,
|
||||
});
|
||||
};
|
||||
|
||||
const analyticsDatabaseCheck: PromiseVoidFunction =
|
||||
async (): Promise<void> => {
|
||||
// Check the status of analytics database
|
||||
return await InfrastructureStatus.checkStatusWithRetry({
|
||||
checkClickhouseStatus: true,
|
||||
checkPostgresStatus: false,
|
||||
checkRedisStatus: false,
|
||||
retryCount: 3,
|
||||
});
|
||||
};
|
||||
|
||||
const databaseCheck: PromiseVoidFunction = async (): Promise<void> => {
|
||||
// Check the status of database
|
||||
return await InfrastructureStatus.checkStatusWithRetry({
|
||||
checkClickhouseStatus: false,
|
||||
checkPostgresStatus: true,
|
||||
checkRedisStatus: false,
|
||||
retryCount: 3,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -37,6 +69,9 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
statusOptions: {
|
||||
liveCheck: statusCheck,
|
||||
readyCheck: statusCheck,
|
||||
globalCacheCheck: globalCacheCheck,
|
||||
analyticsDatabaseCheck: analyticsDatabaseCheck,
|
||||
databaseCheck: databaseCheck,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -68,6 +103,7 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
}
|
||||
};
|
||||
|
||||
// Call the initialization function and handle errors
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.error("Exiting node process");
|
||||
|
||||
1778
Clickhouse/config.xml
Normal file
1778
Clickhouse/config.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
||||
import AnalyticsBaseModel from "./AnalyticsBaseModel/AnalyticsBaseModel";
|
||||
import Log from "./Log";
|
||||
import Metric from "./Metric";
|
||||
import MonitorMetricsByMinute from "./MonitorMetricsByMinute";
|
||||
import Span from "./Span";
|
||||
import TelemetryAttribute from "./TelemetryAttribute";
|
||||
import ExceptionInstance from "./ExceptionInstance";
|
||||
@@ -10,7 +9,6 @@ const AnalyticsModels: Array<{ new (): AnalyticsBaseModel }> = [
|
||||
Log,
|
||||
Span,
|
||||
Metric,
|
||||
MonitorMetricsByMinute,
|
||||
TelemetryAttribute,
|
||||
ExceptionInstance,
|
||||
];
|
||||
|
||||
@@ -19,6 +19,13 @@ export enum MetricPointType {
|
||||
ExponentialHistogram = "ExponentialHistogram",
|
||||
}
|
||||
|
||||
export enum ServiceType {
|
||||
OpenTelemetry = "OpenTelemetry",
|
||||
Monitor = "Monitor",
|
||||
Alert = "Alert",
|
||||
Incident = "Incident",
|
||||
}
|
||||
|
||||
export default class Metric extends AnalyticsBaseModel {
|
||||
public constructor() {
|
||||
super({
|
||||
@@ -78,10 +85,11 @@ export default class Metric extends AnalyticsBaseModel {
|
||||
},
|
||||
}),
|
||||
|
||||
// this can also be the monitor id or the telemetry service id.
|
||||
new AnalyticsTableColumn({
|
||||
key: "serviceId",
|
||||
title: "Service ID",
|
||||
description: "ID of the Service which created the log",
|
||||
description: "ID of the Service which created the Metric",
|
||||
required: true,
|
||||
type: TableColumnType.ObjectID,
|
||||
accessControl: {
|
||||
@@ -101,6 +109,30 @@ export default class Metric extends AnalyticsBaseModel {
|
||||
},
|
||||
}),
|
||||
|
||||
// this can also be the monitor id or the telemetry service id.
|
||||
new AnalyticsTableColumn({
|
||||
key: "serviceType",
|
||||
title: "Service Type",
|
||||
description: "Type of the service that this telemetry belongs to",
|
||||
required: false,
|
||||
type: TableColumnType.Text,
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadTelemetryServiceLog,
|
||||
],
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateTelemetryServiceLog,
|
||||
],
|
||||
update: [],
|
||||
},
|
||||
}),
|
||||
|
||||
// add name and description
|
||||
|
||||
new AnalyticsTableColumn({
|
||||
@@ -539,6 +571,10 @@ export default class Metric extends AnalyticsBaseModel {
|
||||
return this.getColumnValue("serviceId") as ObjectID | undefined;
|
||||
}
|
||||
|
||||
public get serviceType(): ServiceType | undefined {
|
||||
return this.getColumnValue("serviceType") as ServiceType | undefined;
|
||||
}
|
||||
|
||||
public get name(): string | undefined {
|
||||
return this.getColumnValue("name") as string | undefined;
|
||||
}
|
||||
@@ -595,6 +631,10 @@ export default class Metric extends AnalyticsBaseModel {
|
||||
this.setColumnValue("serviceId", v);
|
||||
}
|
||||
|
||||
public set serviceType(v: ServiceType | undefined) {
|
||||
this.setColumnValue("serviceType", v);
|
||||
}
|
||||
|
||||
public get time(): Date | undefined {
|
||||
return this.getColumnValue("time") as Date | undefined;
|
||||
}
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
import AnalyticsBaseModel from "./AnalyticsBaseModel/AnalyticsBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import AnalyticsTableEngine from "../../Types/AnalyticsDatabase/AnalyticsTableEngine";
|
||||
import AnalyticsTableColumn from "../../Types/AnalyticsDatabase/TableColumn";
|
||||
import TableColumnType from "../../Types/AnalyticsDatabase/TableColumnType";
|
||||
import BrowserType from "../../Types/BrowserType";
|
||||
import { JSONObject } from "../../Types/JSON";
|
||||
import { CheckOn } from "../../Types/Monitor/CriteriaFilter";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import ScreenSizeType from "../../Types/ScreenSizeType";
|
||||
|
||||
export interface MonitorMetricsMiscData {
|
||||
diskPath?: string;
|
||||
probeId?: string;
|
||||
browserType?: BrowserType;
|
||||
screenSizeType?: ScreenSizeType;
|
||||
}
|
||||
|
||||
export default class MonitorMetricsByMinute extends AnalyticsBaseModel {
|
||||
public constructor() {
|
||||
super({
|
||||
tableName: "MonitorMetrics",
|
||||
tableEngine: AnalyticsTableEngine.MergeTree,
|
||||
singularName: "Monitor Metric",
|
||||
pluralName: "Monitor Metrics",
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
create: [],
|
||||
update: [],
|
||||
delete: [],
|
||||
},
|
||||
crudApiPath: new Route("/monitor-metrics"),
|
||||
tableColumns: [
|
||||
new AnalyticsTableColumn({
|
||||
key: "projectId",
|
||||
title: "Project ID",
|
||||
description: "ID of project",
|
||||
required: true,
|
||||
type: TableColumnType.ObjectID,
|
||||
isTenantId: true,
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
create: [],
|
||||
update: [],
|
||||
},
|
||||
}),
|
||||
|
||||
new AnalyticsTableColumn({
|
||||
key: "monitorId",
|
||||
title: "Monitor ID",
|
||||
description: "ID of the Monitor which this metric belongs to",
|
||||
required: true,
|
||||
type: TableColumnType.ObjectID,
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
create: [],
|
||||
update: [],
|
||||
},
|
||||
}),
|
||||
|
||||
new AnalyticsTableColumn({
|
||||
key: "metricType",
|
||||
title: "Metric Type",
|
||||
description: "Type of metric",
|
||||
required: true,
|
||||
type: TableColumnType.Text,
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
create: [],
|
||||
update: [],
|
||||
},
|
||||
}),
|
||||
|
||||
new AnalyticsTableColumn({
|
||||
key: "metricValue",
|
||||
title: "Metric Value",
|
||||
description: "Value of the metric",
|
||||
required: true,
|
||||
type: TableColumnType.Number,
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
create: [],
|
||||
update: [],
|
||||
},
|
||||
}),
|
||||
|
||||
new AnalyticsTableColumn({
|
||||
key: "miscData",
|
||||
title: "Misc Data",
|
||||
description: "Misc data for the metric (if any)",
|
||||
required: false,
|
||||
type: TableColumnType.JSON,
|
||||
accessControl: {
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
create: [],
|
||||
update: [],
|
||||
},
|
||||
}),
|
||||
],
|
||||
sortKeys: ["projectId", "monitorId", "createdAt"],
|
||||
primaryKeys: ["projectId", "monitorId"],
|
||||
});
|
||||
}
|
||||
|
||||
public get projectId(): ObjectID | undefined {
|
||||
return this.getColumnValue("projectId") as ObjectID | undefined;
|
||||
}
|
||||
|
||||
public set projectId(v: ObjectID | undefined) {
|
||||
this.setColumnValue("projectId", v);
|
||||
}
|
||||
|
||||
public get monitorId(): ObjectID | undefined {
|
||||
return this.getColumnValue("monitorId") as ObjectID | undefined;
|
||||
}
|
||||
|
||||
public set monitorId(v: ObjectID | undefined) {
|
||||
this.setColumnValue("monitorId", v);
|
||||
}
|
||||
|
||||
public get metricType(): CheckOn | undefined {
|
||||
return this.getColumnValue("metricType") as CheckOn | undefined;
|
||||
}
|
||||
|
||||
public set metricType(v: CheckOn | undefined) {
|
||||
this.setColumnValue("metricType", v);
|
||||
}
|
||||
|
||||
public get metricValue(): number | undefined {
|
||||
return this.getColumnValue("metricValue") as number | undefined;
|
||||
}
|
||||
|
||||
public set metricValue(v: number | undefined) {
|
||||
this.setColumnValue("metricValue", v);
|
||||
}
|
||||
|
||||
public get miscData(): MonitorMetricsMiscData | undefined {
|
||||
return this.getColumnValue("miscData") as
|
||||
| MonitorMetricsMiscData
|
||||
| undefined;
|
||||
}
|
||||
|
||||
public set miscData(v: MonitorMetricsMiscData | undefined) {
|
||||
this.setColumnValue("miscData", v as JSONObject);
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import { TelemetryQuery } from "../../Types/Telemetry/TelemetryQuery";
|
||||
import { WorkspaceChannel } from "../../Server/Utils/Workspace/WorkspaceBase";
|
||||
|
||||
@EnableDocumentation()
|
||||
@AccessControlColumn("labels")
|
||||
@@ -801,7 +802,6 @@ export default class Alert extends BaseModel {
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
@@ -1007,4 +1007,51 @@ export default class Alert extends BaseModel {
|
||||
nullable: true,
|
||||
})
|
||||
public telemetryQuery?: TelemetryQuery = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlert,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlert,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.Number,
|
||||
title: "Alert Number",
|
||||
description: "Alert Number",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Number,
|
||||
nullable: true,
|
||||
})
|
||||
public alertNumber?: number = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.JSON,
|
||||
title: "Post Updates To Workspace Channel Name",
|
||||
description: "Post Updates To Workspace Channel Name",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
nullable: true,
|
||||
})
|
||||
public postUpdatesToWorkspaceChannels?: Array<WorkspaceChannel> = undefined;
|
||||
}
|
||||
|
||||
526
Common/Models/DatabaseModels/AlertFeed.ts
Normal file
526
Common/Models/DatabaseModels/AlertFeed.ts
Normal file
@@ -0,0 +1,526 @@
|
||||
import Alert from "./Alert";
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import CanAccessIfCanReadOn from "../../Types/Database/CanAccessIfCanReadOn";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
||||
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import Color from "../../Types/Color";
|
||||
|
||||
export enum AlertFeedEventType {
|
||||
PublicNote = "PublicNote",
|
||||
SubscriberNotificationSent = "SubscriberNotificationSent",
|
||||
OwnerNotificationSent = "OwnerNotificationSent",
|
||||
OwnerUserAdded = "OwnerUserAdded",
|
||||
OwnerTeamAdded = "OwnerTeamAdded",
|
||||
AlertCreated = "AlertCreated",
|
||||
AlertStateChanged = "AlertStateChanged",
|
||||
PrivateNote = "PrivateNote",
|
||||
AlertUpdated = "AlertUpdated",
|
||||
RootCause = "RootCause",
|
||||
RemediationNotes = "RemediationNotes",
|
||||
OwnerUserRemoved = "OwnerUserRemoved",
|
||||
OwnerTeamRemoved = "OwnerTeamRemoved",
|
||||
OnCallPolicy = "OnCallPolicy",
|
||||
OnCallNotification = "OnCallNotification",
|
||||
}
|
||||
|
||||
@EnableDocumentation()
|
||||
@CanAccessIfCanReadOn("alert")
|
||||
@TenantColumn("projectId")
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
delete: [],
|
||||
update: [],
|
||||
})
|
||||
@EnableWorkflow({
|
||||
create: true,
|
||||
delete: true,
|
||||
update: true,
|
||||
read: true,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/alert-feed"))
|
||||
@Entity({
|
||||
name: "AlertFeed",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "AlertFeed",
|
||||
singularName: "Alert Feed",
|
||||
pluralName: "Alert Feeds",
|
||||
icon: IconProp.List,
|
||||
tableDescription:
|
||||
"Log of the entire alert state change. This is a log of all the alert state changes, public notes, more etc.",
|
||||
})
|
||||
export default class AlertFeed extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "alertId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Alert,
|
||||
title: "Alert",
|
||||
description: "Relation to Alert in which this resource belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Alert;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "alertId" })
|
||||
public alert?: Alert = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
title: "Alert ID",
|
||||
description: "Relation to Alert ID in which this resource belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: true,
|
||||
title: "Log (in Markdown)",
|
||||
description: "Log of the entire alert state change in Markdown",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Markdown,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
})
|
||||
public feedInfoInMarkdown?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
title: "More Information (in Markdown)",
|
||||
description: "More information in Markdown",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Markdown,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public moreInformationInMarkdown?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ShortText,
|
||||
required: true,
|
||||
title: "Alert Feed Event",
|
||||
description: "Alert Feed Event",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ShortText,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
})
|
||||
public alertFeedEventType?: AlertFeedEventType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Color,
|
||||
required: true,
|
||||
title: "Color",
|
||||
description: "Display color for the alert log",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Color,
|
||||
length: ColumnLength.Color,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
transformer: Color.getDatabaseTransformer(),
|
||||
})
|
||||
public displayColor?: Color = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "userId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "User",
|
||||
description:
|
||||
"Relation to User who this feed belongs to (if this feed belongs to a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "userId" })
|
||||
public user?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "User ID",
|
||||
description:
|
||||
"User who this feed belongs to (if this feed belongs to a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public userId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateAlertFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadAlertFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Feed Posted At",
|
||||
description: "Date and time when the feed was posted",
|
||||
type: TableColumnType.Date,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Date,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public postedAt?: Date = undefined;
|
||||
}
|
||||
@@ -41,7 +41,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: false,
|
||||
read: true,
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "CallLog",
|
||||
|
||||
@@ -58,7 +58,6 @@ import CopilotActionProp from "../../Types/Copilot/CopilotActionProps/Index";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: true,
|
||||
read: false,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/copilot-action"))
|
||||
@TableMetadata({
|
||||
|
||||
@@ -54,7 +54,6 @@ import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: true,
|
||||
read: false,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/copilot-action-type-prority"))
|
||||
@TableMetadata({
|
||||
|
||||
@@ -40,7 +40,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: true,
|
||||
read: false,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/copilot-pull-request"))
|
||||
@TableMetadata({
|
||||
|
||||
426
Common/Models/DatabaseModels/Dashboard.ts
Normal file
426
Common/Models/DatabaseModels/Dashboard.ts
Normal file
@@ -0,0 +1,426 @@
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import Route from "../../Types/API/Route";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
||||
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
||||
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import UniqueColumnBy from "../../Types/Database/UniqueColumnBy";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
JoinTable,
|
||||
ManyToMany,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import AccessControlColumn from "../../Types/Database/AccessControlColumn";
|
||||
import Label from "./Label";
|
||||
import DashboardViewConfig from "../../Types/Dashboard/DashboardViewConfig";
|
||||
|
||||
@AccessControlColumn("labels")
|
||||
@EnableDocumentation()
|
||||
@TenantColumn("projectId")
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
delete: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.DeleteDashboard,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.EditDashboard,
|
||||
],
|
||||
})
|
||||
@EnableWorkflow({
|
||||
create: true,
|
||||
delete: true,
|
||||
update: true,
|
||||
read: true,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/dashboard"))
|
||||
@SlugifyColumn("name", "slug")
|
||||
@TableMetadata({
|
||||
tableName: "Dashboard",
|
||||
singularName: "Dashboard",
|
||||
pluralName: "Dashboards",
|
||||
icon: IconProp.Window,
|
||||
tableDescription:
|
||||
"Create and manage Dashboards to visualize your data in a single place",
|
||||
})
|
||||
@Entity({
|
||||
name: "Dashboard",
|
||||
})
|
||||
export default class Dashboard extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.EditDashboard,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: true,
|
||||
type: TableColumnType.ShortText,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Name",
|
||||
description: "Any friendly name of this object",
|
||||
})
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: ColumnType.ShortText,
|
||||
length: ColumnLength.ShortText,
|
||||
})
|
||||
@UniqueColumnBy("projectId")
|
||||
public name?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
required: true,
|
||||
unique: true,
|
||||
type: TableColumnType.Slug,
|
||||
title: "Slug",
|
||||
description: "Friendly globally unique name for your object",
|
||||
})
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: ColumnType.Slug,
|
||||
length: ColumnLength.Slug,
|
||||
})
|
||||
public slug?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.EditDashboard,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.LongText,
|
||||
title: "Description",
|
||||
description: "Friendly description that will help you remember",
|
||||
})
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
})
|
||||
public description?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditDashboard,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.EntityArray,
|
||||
modelType: Label,
|
||||
title: "Labels",
|
||||
description:
|
||||
"Relation to Labels Array where this object is categorized in.",
|
||||
})
|
||||
@ManyToMany(
|
||||
() => {
|
||||
return Label;
|
||||
},
|
||||
{ eager: false },
|
||||
)
|
||||
@JoinTable({
|
||||
name: "DashboardLabel",
|
||||
inverseJoinColumn: {
|
||||
name: "labelId",
|
||||
referencedColumnName: "_id",
|
||||
},
|
||||
joinColumn: {
|
||||
name: "dashboardId",
|
||||
referencedColumnName: "_id",
|
||||
},
|
||||
})
|
||||
public labels?: Array<Label> = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.CreateDashboard,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadDashboard,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.EditDashboard,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: true,
|
||||
type: TableColumnType.JSON,
|
||||
title: "Dashboard View Config",
|
||||
description: "Configuration of Dashboard View",
|
||||
})
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: ColumnType.JSON,
|
||||
})
|
||||
public dashboardViewConfig?: DashboardViewConfig = undefined;
|
||||
}
|
||||
@@ -42,7 +42,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: false,
|
||||
read: true,
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "EmailLog",
|
||||
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import { TelemetryQuery } from "../../Types/Telemetry/TelemetryQuery";
|
||||
import { WorkspaceChannel } from "../../Server/Utils/Workspace/WorkspaceBase";
|
||||
|
||||
@EnableDocumentation()
|
||||
@AccessControlColumn("labels")
|
||||
@@ -853,9 +854,13 @@ export default class Incident extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectIncident,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectIncident,
|
||||
],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
@@ -1087,4 +1092,51 @@ export default class Incident extends BaseModel {
|
||||
nullable: true,
|
||||
})
|
||||
public telemetryQuery?: TelemetryQuery = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectIncident,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectIncident,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.Number,
|
||||
title: "Incident Number",
|
||||
description: "Incident Number",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Number,
|
||||
nullable: true,
|
||||
})
|
||||
public incidentNumber?: number = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.JSON,
|
||||
title: "Post Updates To Workspace Channel Name",
|
||||
description: "Post Updates To Workspace Channel Name",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
nullable: true,
|
||||
})
|
||||
public postUpdatesToWorkspaceChannels?: Array<WorkspaceChannel> = undefined;
|
||||
}
|
||||
|
||||
526
Common/Models/DatabaseModels/IncidentFeed.ts
Normal file
526
Common/Models/DatabaseModels/IncidentFeed.ts
Normal file
@@ -0,0 +1,526 @@
|
||||
import Incident from "./Incident";
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import CanAccessIfCanReadOn from "../../Types/Database/CanAccessIfCanReadOn";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
||||
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import Color from "../../Types/Color";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
|
||||
export enum IncidentFeedEventType {
|
||||
PublicNote = "PublicNote",
|
||||
SubscriberNotificationSent = "SubscriberNotificationSent",
|
||||
OwnerNotificationSent = "OwnerNotificationSent",
|
||||
OwnerUserAdded = "OwnerUserAdded",
|
||||
OwnerTeamAdded = "OwnerTeamAdded",
|
||||
IncidentCreated = "IncidentCreated",
|
||||
IncidentStateChanged = "IncidentStateChanged",
|
||||
PrivateNote = "PrivateNote",
|
||||
IncidentUpdated = "IncidentUpdated",
|
||||
RootCause = "RootCause",
|
||||
RemediationNotes = "RemediationNotes",
|
||||
OwnerUserRemoved = "OwnerUserRemoved",
|
||||
OwnerTeamRemoved = "OwnerTeamRemoved",
|
||||
OnCallPolicy = "OnCallPolicy",
|
||||
OnCallNotification = "OnCallNotification",
|
||||
}
|
||||
|
||||
@EnableDocumentation()
|
||||
@CanAccessIfCanReadOn("incident")
|
||||
@TenantColumn("projectId")
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
delete: [],
|
||||
update: [],
|
||||
})
|
||||
@EnableWorkflow({
|
||||
create: true,
|
||||
delete: true,
|
||||
update: true,
|
||||
read: true,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/incident-feed"))
|
||||
@Entity({
|
||||
name: "IncidentFeed",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "IncidentFeed",
|
||||
singularName: "Incident Feed",
|
||||
pluralName: "Incident Feeds",
|
||||
icon: IconProp.List,
|
||||
tableDescription:
|
||||
"Log of the entire incident state change. This is a log of all the incident state changes, public notes, more etc.",
|
||||
})
|
||||
export default class IncidentFeed extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "incidentId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Incident,
|
||||
title: "Incident",
|
||||
description: "Relation to Incident in which this resource belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Incident;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "incidentId" })
|
||||
public incident?: Incident = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
title: "Incident ID",
|
||||
description: "Relation to Incident ID in which this resource belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public incidentId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: true,
|
||||
title: "Log (in Markdown)",
|
||||
description: "Log of the entire incident state change in Markdown",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Markdown,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
})
|
||||
public feedInfoInMarkdown?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
title: "More Information (in Markdown)",
|
||||
description: "More information in Markdown",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Markdown,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public moreInformationInMarkdown?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ShortText,
|
||||
required: true,
|
||||
title: "Incident Feed Event",
|
||||
description: "Incident Feed Event",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ShortText,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
})
|
||||
public incidentFeedEventType?: IncidentFeedEventType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateIncidentFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadIncidentFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Color,
|
||||
required: true,
|
||||
title: "Color",
|
||||
description: "Display color for the incident log",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Color,
|
||||
length: ColumnLength.Color,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
transformer: Color.getDatabaseTransformer(),
|
||||
})
|
||||
public displayColor?: Color = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "userId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "User",
|
||||
description:
|
||||
"Relation to User who this feed belongs to (if this feed belongs to a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "userId" })
|
||||
public user?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "User ID",
|
||||
description:
|
||||
"User who this feed belongs to (if this feed belongs to a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public userId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Feed Posted At",
|
||||
description: "Date and time when the feed was posted",
|
||||
type: TableColumnType.Date,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Date,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public postedAt?: Date = undefined;
|
||||
}
|
||||
@@ -507,7 +507,6 @@ export default class IncidentStateTimeline extends BaseModel {
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
|
||||
@@ -20,6 +20,7 @@ import GreenlockCertificate from "./GreenlockCertificate";
|
||||
import GreenlockChallenge from "./GreenlockChallenge";
|
||||
// Incidents
|
||||
import Incident from "./Incident";
|
||||
import IncidentFeed from "./IncidentFeed";
|
||||
import IncidentCustomField from "./IncidentCustomField";
|
||||
import IncidentInternalNote from "./IncidentInternalNote";
|
||||
import IncidentNoteTemplate from "./IncidentNoteTemplate";
|
||||
@@ -142,6 +143,7 @@ import ScheduledMaintenanceTemplateOwnerTeam from "./ScheduledMaintenanceTemplat
|
||||
import ScheduledMaintenanceTemplateOwnerUser from "./ScheduledMaintenanceTemplateOwnerUser";
|
||||
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
|
||||
import AlertState from "./AlertState";
|
||||
import Alert from "./Alert";
|
||||
import AlertCustomField from "./AlertCustomField";
|
||||
@@ -151,12 +153,25 @@ import AlertOwnerTeam from "./AlertOwnerTeam";
|
||||
import AlertOwnerUser from "./AlertOwnerUser";
|
||||
import AlertSeverity from "./AlertSeverity";
|
||||
import AlertNoteTemplate from "./AlertNoteTemplate";
|
||||
import AlertFeed from "./AlertFeed";
|
||||
|
||||
import TableView from "./TableView";
|
||||
import Dashboard from "./Dashboard";
|
||||
|
||||
import MonitorTest from "./MonitorTest";
|
||||
import ScheduledMaintenanceFeed from "./ScheduledMaintenanceFeed";
|
||||
|
||||
import WorkspaceUserAuthToken from "./WorkspaceUserAuthToken";
|
||||
import WorkspaceProjectAuthToken from "./WorkspaceProjectAuthToken";
|
||||
import WorkspaceSetting from "./WorkspaceSetting";
|
||||
import WorkspaceNotificationRule from "./WorkspaceNotificationRule";
|
||||
|
||||
const AllModelTypes: Array<{
|
||||
new (): BaseModel;
|
||||
}> = [
|
||||
User,
|
||||
WorkspaceUserAuthToken,
|
||||
WorkspaceProjectAuthToken,
|
||||
Probe,
|
||||
Project,
|
||||
EmailVerificationToken,
|
||||
@@ -184,6 +199,7 @@ const AllModelTypes: Array<{
|
||||
|
||||
IncidentState,
|
||||
Incident,
|
||||
IncidentFeed,
|
||||
IncidentCustomField,
|
||||
IncidentStateTimeline,
|
||||
IncidentInternalNote,
|
||||
@@ -198,6 +214,7 @@ const AllModelTypes: Array<{
|
||||
|
||||
AlertState,
|
||||
Alert,
|
||||
AlertFeed,
|
||||
AlertCustomField,
|
||||
AlertStateTimeline,
|
||||
AlertInternalNote,
|
||||
@@ -229,6 +246,7 @@ const AllModelTypes: Array<{
|
||||
ScheduledMaintenancePublicNote,
|
||||
ScheduledMaintenanceInternalNote,
|
||||
ScheduledMaintenanceCustomField,
|
||||
ScheduledMaintenanceFeed,
|
||||
|
||||
BillingPaymentMethods,
|
||||
BillingInvoice,
|
||||
@@ -327,6 +345,14 @@ const AllModelTypes: Array<{
|
||||
TelemetryException,
|
||||
|
||||
TableView,
|
||||
|
||||
// Dashboards
|
||||
Dashboard,
|
||||
|
||||
MonitorTest,
|
||||
|
||||
WorkspaceSetting,
|
||||
WorkspaceNotificationRule,
|
||||
];
|
||||
|
||||
const modelTypeMap: { [key: string]: { new (): BaseModel } } = {};
|
||||
|
||||
@@ -455,7 +455,6 @@ export default class MonitorStatusTimeline extends BaseModel {
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
|
||||
478
Common/Models/DatabaseModels/MonitorTest.ts
Normal file
478
Common/Models/DatabaseModels/MonitorTest.ts
Normal file
@@ -0,0 +1,478 @@
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
||||
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import MonitorSteps from "../../Types/Monitor/MonitorSteps";
|
||||
import MonitorType from "../../Types/Monitor/MonitorType";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import { MonitorStepProbeResponse } from "./MonitorProbe";
|
||||
import Probe from "./Probe";
|
||||
|
||||
@TenantColumn("projectId")
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
delete: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.DeleteProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@EnableWorkflow({
|
||||
create: true,
|
||||
delete: true,
|
||||
update: true,
|
||||
read: true,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/monitor-test"))
|
||||
@SlugifyColumn("name", "slug")
|
||||
@Entity({
|
||||
name: "MonitorTest",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "MonitorTest",
|
||||
singularName: "Monitor Test",
|
||||
pluralName: "Monitor Tests",
|
||||
icon: IconProp.AltGlobe,
|
||||
tableDescription:
|
||||
"Monitor Test allows you to test monitor configurations before you save them.",
|
||||
})
|
||||
export default class MonitorTest extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
required: true,
|
||||
type: TableColumnType.MonitorType,
|
||||
title: "Monitor Type",
|
||||
description: "What is the type of this monitor? Website? API? etc.",
|
||||
})
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: ColumnType.ShortText,
|
||||
length: ColumnLength.ShortText,
|
||||
})
|
||||
public monitorType?: MonitorType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.JSON,
|
||||
required: false,
|
||||
title: "Monitor Steps",
|
||||
description: "What would you like to monitor and what is the criteria?",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
nullable: true,
|
||||
transformer: MonitorSteps.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorSteps?: MonitorSteps = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "probeId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Probe,
|
||||
title: "Probe",
|
||||
description: "Relation to Probe Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Probe;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "probeId" })
|
||||
public probe?: Probe = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Probe ID",
|
||||
description: "ID of your OneUptime Probe in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public probeId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@TableColumn({ type: TableColumnType.Date })
|
||||
@Column({
|
||||
type: ColumnType.Date,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public testedAt?: Date = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.JSON,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public monitorStepProbeResponse?: MonitorStepProbeResponse = undefined;
|
||||
|
||||
@Index()
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectMonitor,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectMonitor,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectMonitor,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: true,
|
||||
type: TableColumnType.Boolean,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
default: true,
|
||||
})
|
||||
public isInQueue?: boolean = undefined;
|
||||
}
|
||||
@@ -216,6 +216,7 @@ export default class OnCallDutyPolicyExecutionLog extends BaseModel {
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Triggered By Incident ID",
|
||||
required: false,
|
||||
description:
|
||||
"ID of the incident which triggered this on-call escalation policy.",
|
||||
})
|
||||
@@ -270,6 +271,7 @@ export default class OnCallDutyPolicyExecutionLog extends BaseModel {
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Triggered By Alert ID",
|
||||
required: false,
|
||||
description:
|
||||
"ID of the incident which triggered this on-call escalation policy.",
|
||||
})
|
||||
|
||||
@@ -26,6 +26,7 @@ import OnCallDutyExecutionLogTimelineStatus from "../../Types/OnCallDutyPolicy/O
|
||||
import Permission from "../../Types/Permission";
|
||||
import UserNotificationEventType from "../../Types/UserNotification/UserNotificationEventType";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import Alert from "./Alert";
|
||||
|
||||
@TableBillingAccessControl({
|
||||
create: PlanType.Growth,
|
||||
@@ -216,18 +217,74 @@ export default class OnCallDutyPolicyExecutionLogTimeline extends BaseModel {
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Incident ID",
|
||||
description: "ID of your OneUptime Incident in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public triggeredByIncidentId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectOnCallDutyPolicyExecutionLogTimeline,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "triggeredByAlertId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Alert,
|
||||
title: "Alert",
|
||||
description: "Relation to Alert Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Alert;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "triggeredByAlertId" })
|
||||
public triggeredByAlert?: Alert = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectOnCallDutyPolicyExecutionLogTimeline,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Alert ID",
|
||||
description: "ID of your OneUptime Alert in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public triggeredByAlertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -35,6 +35,7 @@ import {
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import Recurring from "../../Types/Events/Recurring";
|
||||
import { WorkspaceChannel } from "../../Server/Utils/Workspace/WorkspaceBase";
|
||||
|
||||
@EnableDocumentation()
|
||||
@AccessControlColumn("labels")
|
||||
@@ -950,4 +951,51 @@ export default class ScheduledMaintenance extends BaseModel {
|
||||
nullable: true,
|
||||
})
|
||||
public nextSubscriberNotificationBeforeTheEventAt?: Date = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectScheduledMaintenance,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectScheduledMaintenance,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.Number,
|
||||
title: "Scheduled Maintenance Number",
|
||||
description: "Scheduled Maintenance Number",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Number,
|
||||
nullable: true,
|
||||
})
|
||||
public scheduledMaintenanceNumber?: number = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
required: false,
|
||||
type: TableColumnType.JSON,
|
||||
title: "Post Updates To Workspace Channel Name",
|
||||
description: "Post Updates To Workspace Channel Name",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
nullable: true,
|
||||
})
|
||||
public postUpdatesToWorkspaceChannels?: Array<WorkspaceChannel> = undefined;
|
||||
}
|
||||
|
||||
530
Common/Models/DatabaseModels/ScheduledMaintenanceFeed.ts
Normal file
530
Common/Models/DatabaseModels/ScheduledMaintenanceFeed.ts
Normal file
@@ -0,0 +1,530 @@
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import CanAccessIfCanReadOn from "../../Types/Database/CanAccessIfCanReadOn";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
||||
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import Color from "../../Types/Color";
|
||||
|
||||
export enum ScheduledMaintenanceFeedEventType {
|
||||
PublicNote = "PublicNote",
|
||||
SubscriberNotificationSent = "SubscriberNotificationSent",
|
||||
OwnerNotificationSent = "OwnerNotificationSent",
|
||||
OwnerUserAdded = "OwnerUserAdded",
|
||||
OwnerTeamAdded = "OwnerTeamAdded",
|
||||
ScheduledMaintenanceCreated = "ScheduledMaintenanceCreated",
|
||||
ScheduledMaintenanceStateChanged = "ScheduledMaintenanceStateChanged",
|
||||
PrivateNote = "PrivateNote",
|
||||
ScheduledMaintenanceUpdated = "ScheduledMaintenanceUpdated",
|
||||
RootCause = "RootCause",
|
||||
RemediationNotes = "RemediationNotes",
|
||||
OwnerUserRemoved = "OwnerUserRemoved",
|
||||
OwnerTeamRemoved = "OwnerTeamRemoved",
|
||||
OnCallPolicy = "OnCallPolicy",
|
||||
OnCallNotification = "OnCallNotification",
|
||||
}
|
||||
|
||||
@EnableDocumentation()
|
||||
@CanAccessIfCanReadOn("scheduledMaintenance")
|
||||
@TenantColumn("projectId")
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
delete: [],
|
||||
update: [],
|
||||
})
|
||||
@EnableWorkflow({
|
||||
create: true,
|
||||
delete: true,
|
||||
update: true,
|
||||
read: true,
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/scheduled-maintenance-feed"))
|
||||
@Entity({
|
||||
name: "ScheduledMaintenanceFeed",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "ScheduledMaintenanceFeed",
|
||||
singularName: "Scheduled Maintenance Feed",
|
||||
pluralName: "Scheduled Maintenance Feed",
|
||||
icon: IconProp.List,
|
||||
tableDescription:
|
||||
"Log of the entire scheduled maintenance state change. This is a log of all the scheduled maintenance state changes, public notes, more etc.",
|
||||
})
|
||||
export default class ScheduledMaintenanceFeed extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "scheduledMaintenanceId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: ScheduledMaintenance,
|
||||
title: "ScheduledMaintenance",
|
||||
description:
|
||||
"Relation to ScheduledMaintenance in which this resource belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return ScheduledMaintenance;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "scheduledMaintenanceId" })
|
||||
public scheduledMaintenance?: ScheduledMaintenance = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
title: "ScheduledMaintenance ID",
|
||||
description:
|
||||
"Relation to ScheduledMaintenance ID in which this resource belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public scheduledMaintenanceId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: true,
|
||||
title: "Log (in Markdown)",
|
||||
description:
|
||||
"Log of the entire scheduled maintenance state change in Markdown",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Markdown,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
})
|
||||
public feedInfoInMarkdown?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Markdown,
|
||||
required: false,
|
||||
title: "More Information (in Markdown)",
|
||||
description: "More information in Markdown",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Markdown,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public moreInformationInMarkdown?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ShortText,
|
||||
required: true,
|
||||
title: "ScheduledMaintenance Log Event",
|
||||
description: "ScheduledMaintenance Log Event",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ShortText,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
})
|
||||
public scheduledMaintenanceFeedEventType?: ScheduledMaintenanceFeedEventType =
|
||||
undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.Color,
|
||||
required: true,
|
||||
title: "Color",
|
||||
description: "Display color for this log",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Color,
|
||||
length: ColumnLength.Color,
|
||||
nullable: false,
|
||||
unique: false,
|
||||
transformer: Color.getDatabaseTransformer(),
|
||||
})
|
||||
public displayColor?: Color = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "userId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "User",
|
||||
description:
|
||||
"Relation to User who this feed belongs to (if this feed belongs to a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "userId" })
|
||||
public user?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "User ID",
|
||||
description:
|
||||
"User who this feed belongs to (if this feed belongs to a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public userId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateScheduledMaintenanceFeed,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceFeed,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Feed Posted At",
|
||||
description: "Date and time when the feed was posted",
|
||||
type: TableColumnType.Date,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Date,
|
||||
nullable: true,
|
||||
unique: false,
|
||||
})
|
||||
public postedAt?: Date = undefined;
|
||||
}
|
||||
@@ -789,7 +789,12 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceTemplate,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditScheduledMaintenanceNoteTemplate,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
@@ -816,7 +821,12 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceTemplate,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditScheduledMaintenanceNoteTemplate,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
@@ -845,7 +855,12 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceTemplate,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditScheduledMaintenanceNoteTemplate,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: true,
|
||||
@@ -873,7 +888,12 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceTemplate,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditScheduledMaintenanceNoteTemplate,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: true,
|
||||
@@ -902,7 +922,12 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadScheduledMaintenanceTemplate,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditScheduledMaintenanceNoteTemplate,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: true,
|
||||
|
||||
@@ -41,7 +41,6 @@ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
create: true,
|
||||
delete: false,
|
||||
update: false,
|
||||
read: true,
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "SmsLog",
|
||||
|
||||
@@ -1061,6 +1061,44 @@ export default class StatusPage extends BaseModel {
|
||||
})
|
||||
public allowSubscribersToChooseResources?: boolean = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectStatusPage,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectStatusPage,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectStatusPage,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: true,
|
||||
type: TableColumnType.Boolean,
|
||||
title: "Allow Subscribers to subscribe to event types",
|
||||
description:
|
||||
"Can subscribers choose which event type like Announcements, Incidents, Scheduled Events to subscribe to?",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
default: false,
|
||||
})
|
||||
@ColumnBillingAccessControl({
|
||||
read: PlanType.Free,
|
||||
update: PlanType.Scale,
|
||||
create: PlanType.Free,
|
||||
})
|
||||
public allowSubscribersToChooseEventTypes?: boolean = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
@@ -1935,4 +1973,37 @@ export default class StatusPage extends BaseModel {
|
||||
default: UptimePrecision.TWO_DECIMAL,
|
||||
})
|
||||
public overallUptimePercentPrecision?: UptimePrecision = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateProjectStatusPage,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadProjectStatusPage,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditProjectStatusPage,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.VeryLongText,
|
||||
title: "Subscriber Email Notification Footer Text",
|
||||
description: "Text to send to subscribers in the footer of the email.",
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: ColumnType.VeryLongText,
|
||||
})
|
||||
public subscriberEmailNotificationFooterText?: string = undefined;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,12 @@ export default class StatusPageAnnouncement extends BaseModel {
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadStatusPageAnnouncement,
|
||||
],
|
||||
update: [],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditStatusPageAnnouncement,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
ManyToMany,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import StatusPageEventType from "../../Types/StatusPage/StatusPageEventType";
|
||||
|
||||
@EnableDocumentation()
|
||||
@EnableWorkflow({
|
||||
@@ -433,6 +434,63 @@ export default class StatusPageSubscriber extends BaseModel {
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateStatusPageSubscriber,
|
||||
Permission.Public,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadStatusPageSubscriber,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditStatusPageSubscriber,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: true,
|
||||
type: TableColumnType.Boolean,
|
||||
title: "Is Subscription Confirmed",
|
||||
description:
|
||||
"Has subscriber confirmed their subscription? (for example, by clicking on a confirmation link in an email)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
default: false,
|
||||
})
|
||||
public isSubscriptionConfirmed?: boolean = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateStatusPageSubscriber,
|
||||
],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: false,
|
||||
type: TableColumnType.ShortText,
|
||||
title: "Subscription Confirmation Token",
|
||||
description:
|
||||
"Token used to confirm subscription. This is a random token that is sent to the subscriber's email address to confirm their subscription.",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ShortText,
|
||||
nullable: true,
|
||||
})
|
||||
public subscriptionConfirmationToken?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
@@ -528,6 +586,40 @@ export default class StatusPageSubscriber extends BaseModel {
|
||||
})
|
||||
public isSubscribedToAllResources?: boolean = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateStatusPageSubscriber,
|
||||
Permission.Public,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadStatusPageSubscriber,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditStatusPageSubscriber,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
isDefaultValueColumn: true,
|
||||
type: TableColumnType.Boolean,
|
||||
title: "Is Subscribed to All Event Types",
|
||||
description:
|
||||
"Is Subscriber Subscribed to All Event Types (like Incidents, Scheduled Events, Announcements) on this status page?",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.Boolean,
|
||||
default: true,
|
||||
})
|
||||
public isSubscribedToAllEventTypes?: boolean = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
@@ -575,4 +667,39 @@ export default class StatusPageSubscriber extends BaseModel {
|
||||
},
|
||||
})
|
||||
public statusPageResources?: Array<StatusPageResource> = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateStatusPageSubscriber,
|
||||
Permission.Public,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadStatusPageSubscriber,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditStatusPageSubscriber,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.JSON,
|
||||
title: "Subscribed to Event Types",
|
||||
description:
|
||||
"Which event types is the subscriber subscribed to (like Incidents, Scheduled Events, Announcements)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
nullable: true,
|
||||
default: [],
|
||||
})
|
||||
public statusPageEventTypes?: Array<StatusPageEventType> = undefined;
|
||||
}
|
||||
|
||||
@@ -221,14 +221,14 @@ export default class TelemetryException extends DatabaseBaseModel {
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.LongText,
|
||||
type: TableColumnType.VeryLongText,
|
||||
canReadOnRelationQuery: false,
|
||||
title: "Exception Message",
|
||||
description: "Exception message that was thrown by the telemetry service",
|
||||
})
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: ColumnType.LongText,
|
||||
type: ColumnType.VeryLongText,
|
||||
})
|
||||
public message?: string = undefined;
|
||||
|
||||
@@ -252,7 +252,7 @@ export default class TelemetryException extends DatabaseBaseModel {
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.LongText,
|
||||
type: TableColumnType.VeryLongText,
|
||||
canReadOnRelationQuery: false,
|
||||
title: "Stack Trace",
|
||||
description:
|
||||
@@ -260,7 +260,7 @@ export default class TelemetryException extends DatabaseBaseModel {
|
||||
})
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: ColumnType.LongText,
|
||||
type: ColumnType.VeryLongText,
|
||||
})
|
||||
public stackTrace?: string = undefined;
|
||||
|
||||
@@ -284,7 +284,7 @@ export default class TelemetryException extends DatabaseBaseModel {
|
||||
})
|
||||
@TableColumn({
|
||||
required: false,
|
||||
type: TableColumnType.LongText,
|
||||
type: TableColumnType.VeryLongText,
|
||||
canReadOnRelationQuery: false,
|
||||
title: "Exception Type",
|
||||
description:
|
||||
@@ -292,7 +292,7 @@ export default class TelemetryException extends DatabaseBaseModel {
|
||||
})
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: ColumnType.LongText,
|
||||
type: ColumnType.VeryLongText,
|
||||
})
|
||||
public exceptionType?: string = undefined;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import IncidentSeverity from "./IncidentSeverity";
|
||||
import AlertSeverity from "./AlertSeverity";
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import UserCall from "./UserCall";
|
||||
@@ -450,6 +451,55 @@ class UserNotificationRule extends BaseModel {
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public incidentSeverityId?: ObjectID = undefined;
|
||||
|
||||
// alert severity.
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "alertSeverityId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: AlertSeverity,
|
||||
title: "Alert Severity",
|
||||
description:
|
||||
"Relation to Alert Severity Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return AlertSeverity;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "alertSeverityId" })
|
||||
public alertSeverity?: AlertSeverity = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Alert Severity ID",
|
||||
description: "ID of Alert Severity in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public alertSeverityId?: ObjectID = undefined;
|
||||
}
|
||||
|
||||
export default UserNotificationRule;
|
||||
|
||||
@@ -28,6 +28,7 @@ import Permission from "../../Types/Permission";
|
||||
import UserNotificationEventType from "../../Types/UserNotification/UserNotificationEventType";
|
||||
import UserNotificationExecutionStatus from "../../Types/UserNotification/UserNotificationExecutionStatus";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import Alert from "./Alert";
|
||||
|
||||
@EnableDocumentation()
|
||||
@TenantColumn("projectId")
|
||||
@@ -368,16 +369,62 @@ export default class UserOnCallLog extends BaseModel {
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Triggered By Incident ID",
|
||||
required: false,
|
||||
description:
|
||||
"ID of the incident which triggered this on-call escalation policy.",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public triggeredByIncidentId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "triggeredByAlertId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Alert,
|
||||
title: "Triggered By Alert",
|
||||
description: "Relation to Alert which triggered this on-call duty policy.",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Alert;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "triggeredByAlertId" })
|
||||
public triggeredByAlert?: Alert = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Triggered By Alert ID",
|
||||
required: false,
|
||||
description:
|
||||
"ID of the Alert which triggered this on-call escalation policy.",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public triggeredByAlertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import OnCallDutyPolicy from "./OnCallDutyPolicy";
|
||||
import OnCallDutyPolicyEscalationRule from "./OnCallDutyPolicyEscalationRule";
|
||||
import OnCallDutyPolicyExecutionLog from "./OnCallDutyPolicyExecutionLog";
|
||||
@@ -325,18 +326,64 @@ export default class UserOnCallLogTimeline extends BaseModel {
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Incident ID",
|
||||
description: "ID of your OneUptime Incident in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public triggeredByIncidentId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "triggeredByAlertId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Alert,
|
||||
title: "Alert",
|
||||
description: "Relation to Alert Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Alert;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "triggeredByAlertId" })
|
||||
public triggeredByAlert?: Alert = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Alert ID",
|
||||
description: "ID of your OneUptime Alert in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public triggeredByAlertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [Permission.CurrentUser],
|
||||
|
||||
461
Common/Models/DatabaseModels/WorkspaceNotificationRule.ts
Normal file
461
Common/Models/DatabaseModels/WorkspaceNotificationRule.ts
Normal file
@@ -0,0 +1,461 @@
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import AllowAccessIfSubscriptionIsUnpaid from "../../Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
|
||||
import BaseNotificationRule from "../../Types/Workspace/NotificationRules/BaseNotificationRule";
|
||||
import NotificationRuleEventType from "../../Types/Workspace/NotificationRules/EventType";
|
||||
import Permission from "../../Types/Permission";
|
||||
|
||||
@TenantColumn("projectId")
|
||||
@AllowAccessIfSubscriptionIsUnpaid()
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
delete: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.DeleteWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/workspace-notification-rule"))
|
||||
@Entity({
|
||||
name: "WorkspaceNotificationRule",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "WorkspaceNotificationRule",
|
||||
singularName: "Workspace Notification Rule",
|
||||
pluralName: "Workspace Notification Rules",
|
||||
icon: IconProp.Logs,
|
||||
tableDescription: "Notification Rule for Third Party Workspaces",
|
||||
})
|
||||
class WorkspaceNotificationRule extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Rule Name",
|
||||
description: "Name of the Notification Rule",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public name?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Rule Description",
|
||||
description: "Description of the Notification Rule",
|
||||
required: false,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: true,
|
||||
})
|
||||
public description?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Notification Rules",
|
||||
description: "Notification Rules for the Workspace",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.JSON,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public notificationRule?: BaseNotificationRule = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Event Type",
|
||||
description:
|
||||
"Event Type for the Workspace like Incident Created, Monitor Status Updated, etc.",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.ShortText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ShortText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public eventType?: NotificationRuleEventType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Type",
|
||||
description: "Type of Workspace - slack, microsoft teams etc.",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public workspaceType?: WorkspaceType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
// deleted by userId
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.CreateWorkspaceNotificationRule,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationRule,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectMember,
|
||||
Permission.EditWorkspaceNotificationRule,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
}
|
||||
|
||||
export default WorkspaceNotificationRule;
|
||||
379
Common/Models/DatabaseModels/WorkspaceProjectAuthToken.ts
Normal file
379
Common/Models/DatabaseModels/WorkspaceProjectAuthToken.ts
Normal file
@@ -0,0 +1,379 @@
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import AllowAccessIfSubscriptionIsUnpaid from "../../Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
|
||||
import Permission from "../../Types/Permission";
|
||||
|
||||
export interface MiscData {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface SlackMiscData extends MiscData {
|
||||
teamId: string;
|
||||
teamName: string;
|
||||
botUserId: string;
|
||||
}
|
||||
|
||||
@TenantColumn("projectId")
|
||||
@AllowAccessIfSubscriptionIsUnpaid()
|
||||
@TableAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
delete: [Permission.ProjectOwner, Permission.ProjectAdmin],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/workspace-project-auth-token"))
|
||||
@Entity({
|
||||
name: "WorkspaceProjectAuthToken",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "WorkspaceProjectAuthToken",
|
||||
singularName: "Workspace Project Auth Token",
|
||||
pluralName: "Workspace Project Auth Tokens",
|
||||
icon: IconProp.Lock,
|
||||
tableDescription: "Third Party Auth Token for the Project",
|
||||
})
|
||||
class WorkspaceProjectAuthToken extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Auth Token",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.VeryLongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.VeryLongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public authToken?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Type",
|
||||
description: "Type of Workspace - slack, microsoft teams etc.",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public workspaceType?: WorkspaceType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Project ID in Workspace",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public workspaceProjectId?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Misc Data",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.JSON,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public miscData?: MiscData = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
update: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
}
|
||||
|
||||
export default WorkspaceProjectAuthToken;
|
||||
230
Common/Models/DatabaseModels/WorkspaceSetting.ts
Normal file
230
Common/Models/DatabaseModels/WorkspaceSetting.ts
Normal file
@@ -0,0 +1,230 @@
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import AllowAccessIfSubscriptionIsUnpaid from "../../Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
|
||||
|
||||
export interface Settings {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface SlackSettings extends Settings {
|
||||
teamId: string;
|
||||
teamName: string;
|
||||
botUserId: string;
|
||||
}
|
||||
|
||||
@TenantColumn("projectId")
|
||||
@AllowAccessIfSubscriptionIsUnpaid()
|
||||
@TableAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
delete: [],
|
||||
update: [],
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/workspace-setting"))
|
||||
@Entity({
|
||||
name: "WorkspaceSetting",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "WorkspaceSetting",
|
||||
singularName: "Workspace Setting",
|
||||
pluralName: "Workspace Settings",
|
||||
icon: IconProp.Settings,
|
||||
tableDescription: "Settings for Third Party Workspaces",
|
||||
})
|
||||
class WorkspaceSetting extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Settings",
|
||||
description: "Settings for the Workspace",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.JSON,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public settings?: SlackSettings = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Type",
|
||||
description: "Type of Workspace - slack, microsoft teams etc.",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public workspaceType?: WorkspaceType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
// deleted by userId
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
}
|
||||
|
||||
export default WorkspaceSetting;
|
||||
312
Common/Models/DatabaseModels/WorkspaceUserAuthToken.ts
Normal file
312
Common/Models/DatabaseModels/WorkspaceUserAuthToken.ts
Normal file
@@ -0,0 +1,312 @@
|
||||
import Project from "./Project";
|
||||
import User from "./User";
|
||||
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
||||
import Route from "../../Types/API/Route";
|
||||
import AllowAccessIfSubscriptionIsUnpaid from "../../Types/Database/AccessControl/AllowAccessIfSubscriptionIsUnpaid";
|
||||
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
||||
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
||||
import ColumnLength from "../../Types/Database/ColumnLength";
|
||||
import ColumnType from "../../Types/Database/ColumnType";
|
||||
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
||||
import CurrentUserCanAccessRecordBy from "../../Types/Database/CurrentUserCanAccessRecordBy";
|
||||
import TableColumn from "../../Types/Database/TableColumn";
|
||||
import TableColumnType from "../../Types/Database/TableColumnType";
|
||||
import TableMetadata from "../../Types/Database/TableMetadata";
|
||||
import TenantColumn from "../../Types/Database/TenantColumn";
|
||||
import IconProp from "../../Types/Icon/IconProp";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import Permission from "../../Types/Permission";
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
|
||||
|
||||
export interface MiscData {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface SlackMiscData extends MiscData {
|
||||
userId: string;
|
||||
}
|
||||
|
||||
@TenantColumn("projectId")
|
||||
@AllowAccessIfSubscriptionIsUnpaid()
|
||||
@TableAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
delete: [Permission.CurrentUser],
|
||||
update: [Permission.CurrentUser],
|
||||
})
|
||||
@CrudApiEndpoint(new Route("/workspace-user-auth-token"))
|
||||
@Entity({
|
||||
name: "WorkspaceUserAuthToken",
|
||||
})
|
||||
@TableMetadata({
|
||||
tableName: "WorkspaceUserAuthToken",
|
||||
singularName: "Workspace User Auth Token",
|
||||
pluralName: "Workspace User Auth Tokens",
|
||||
icon: IconProp.Lock,
|
||||
tableDescription: "Third Party Auth Token for the User",
|
||||
})
|
||||
@CurrentUserCanAccessRecordBy("userId")
|
||||
class WorkspaceUserAuthToken extends BaseModel {
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "projectId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Project,
|
||||
title: "Project",
|
||||
description: "Relation to Project Resource in which this object belongs",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Project;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "projectId" })
|
||||
public project?: Project = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: true,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Project ID",
|
||||
description: "ID of your OneUptime Project in which this object belongs",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: false,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public projectId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Auth Token",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.VeryLongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.VeryLongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public authToken?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "User ID in Service",
|
||||
description: "User ID in the Workspace",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public workspaceUserId?: string = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Workspace Type",
|
||||
description: "Type of Workspace - slack, microsoft teams etc.",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.LongText,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.LongText,
|
||||
length: ColumnLength.LongText,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public workspaceType?: WorkspaceType = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
title: "Misc Data",
|
||||
required: true,
|
||||
unique: false,
|
||||
type: TableColumnType.JSON,
|
||||
canReadOnRelationQuery: true,
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.JSON,
|
||||
unique: false,
|
||||
nullable: false,
|
||||
})
|
||||
public miscData?: MiscData = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "user",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "User",
|
||||
description: "Relation to User who this email belongs to",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "userId" })
|
||||
public user?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "User ID",
|
||||
description: "User ID who this email belongs to",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
@Index()
|
||||
public userId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "createdByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: User,
|
||||
title: "Created by User",
|
||||
description:
|
||||
"Relation to User who created this object (if this object was created by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "createdByUserId" })
|
||||
public createdByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [Permission.CurrentUser],
|
||||
read: [Permission.CurrentUser],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Created by User ID",
|
||||
description:
|
||||
"User ID who created this object (if this object was created by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public createdByUserId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "deletedByUserId",
|
||||
type: TableColumnType.Entity,
|
||||
title: "Deleted by User",
|
||||
description:
|
||||
"Relation to User who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
{
|
||||
cascade: false,
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "SET NULL",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "deletedByUserId" })
|
||||
public deletedByUser?: User = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
title: "Deleted by User ID",
|
||||
description:
|
||||
"User ID who deleted this object (if this object was deleted by a User)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public deletedByUserId?: ObjectID = undefined;
|
||||
}
|
||||
|
||||
export default WorkspaceUserAuthToken;
|
||||
@@ -131,6 +131,30 @@ export default class BaseAPI<
|
||||
},
|
||||
);
|
||||
|
||||
router.post(
|
||||
`${new this.entityType().getCrudApiPath()?.toString()}/:id/update-item`,
|
||||
UserMiddleware.getUserMiddleware,
|
||||
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
||||
try {
|
||||
await this.updateItem(req, res);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
router.get(
|
||||
`${new this.entityType().getCrudApiPath()?.toString()}/:id/update-item`,
|
||||
UserMiddleware.getUserMiddleware,
|
||||
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
||||
try {
|
||||
await this.updateItem(req, res);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Delete
|
||||
router.delete(
|
||||
`${new this.entityType().getCrudApiPath()?.toString()}/:id`,
|
||||
@@ -144,6 +168,30 @@ export default class BaseAPI<
|
||||
},
|
||||
);
|
||||
|
||||
router.post(
|
||||
`${new this.entityType().getCrudApiPath()?.toString()}/:id/delete-item`,
|
||||
UserMiddleware.getUserMiddleware,
|
||||
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
||||
try {
|
||||
await this.deleteItem(req, res);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
router.get(
|
||||
`${new this.entityType().getCrudApiPath()?.toString()}/:id/delete-item`,
|
||||
UserMiddleware.getUserMiddleware,
|
||||
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
||||
try {
|
||||
await this.deleteItem(req, res);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
this.router = router;
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@@ -291,6 +291,17 @@ export default class BaseAnalyticsAPI<
|
||||
) as any;
|
||||
}
|
||||
|
||||
let groupBy: GroupBy<AnalyticsDataModel> | null =
|
||||
req.body["groupBy"] || null;
|
||||
|
||||
if (groupBy && Object.keys(groupBy).length > 0) {
|
||||
groupBy = JSONFunctions.deserialize(groupBy as JSONObject) as any;
|
||||
}
|
||||
|
||||
if (groupBy && Object.keys(groupBy).length === 0) {
|
||||
groupBy = null;
|
||||
}
|
||||
|
||||
if (!aggregateBy) {
|
||||
throw new BadRequestException("AggregateBy is required");
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
import Response from "../Utils/Response";
|
||||
import BaseAPI from "./BaseAPI";
|
||||
import BaseModel from "Common/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
|
||||
import SubscriptionStatus from "Common/Types/Billing/SubscriptionStatus";
|
||||
import BadDataException from "Common/Types/Exception/BadDataException";
|
||||
import { JSONObject } from "Common/Types/JSON";
|
||||
import Permission, { UserPermission } from "Common/Types/Permission";
|
||||
@@ -127,37 +126,8 @@ export default class UserAPI extends BaseAPI<
|
||||
},
|
||||
});
|
||||
|
||||
// refresh subscription status.
|
||||
const subscriptionState: SubscriptionStatus =
|
||||
await BillingService.getSubscriptionStatus(
|
||||
project.paymentProviderSubscriptionId as string,
|
||||
);
|
||||
|
||||
const meteredSubscriptionState: SubscriptionStatus =
|
||||
await BillingService.getSubscriptionStatus(
|
||||
project.paymentProviderMeteredSubscriptionId as string,
|
||||
);
|
||||
|
||||
// if subscription is cancelled, create a new subscription and update project.
|
||||
|
||||
if (
|
||||
meteredSubscriptionState === SubscriptionStatus.Canceled ||
|
||||
subscriptionState === SubscriptionStatus.Canceled
|
||||
) {
|
||||
await ProjectService.reactiveSubscription(project.id!);
|
||||
}
|
||||
|
||||
await ProjectService.updateOneById({
|
||||
id: project.id!,
|
||||
data: {
|
||||
paymentProviderSubscriptionStatus: subscriptionState,
|
||||
paymentProviderMeteredSubscriptionStatus:
|
||||
meteredSubscriptionState,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
ignoreHooks: true,
|
||||
},
|
||||
await BillingInvoiceService.refreshSubscriptionStatus({
|
||||
projectId: project.id!,
|
||||
});
|
||||
|
||||
return Response.sendEmptySuccessResponse(req, res);
|
||||
|
||||
@@ -13,7 +13,7 @@ import LIMIT_MAX from "Common/Types/Database/LimitMax";
|
||||
import PositiveNumber from "Common/Types/PositiveNumber";
|
||||
import Probe from "Common/Models/DatabaseModels/Probe";
|
||||
|
||||
export default class Ingestor extends BaseAPI<Probe, ProbeServiceType> {
|
||||
export default class ProbeAPI extends BaseAPI<Probe, ProbeServiceType> {
|
||||
public constructor() {
|
||||
super(Probe, ProbeService);
|
||||
|
||||
|
||||
368
Common/Server/API/SlackAPI.ts
Normal file
368
Common/Server/API/SlackAPI.ts
Normal file
@@ -0,0 +1,368 @@
|
||||
import Express, {
|
||||
ExpressRequest,
|
||||
ExpressResponse,
|
||||
ExpressRouter,
|
||||
} from "../Utils/Express";
|
||||
import Response from "../Utils/Response";
|
||||
import SlackAuthorization from "../Middleware/SlackAuthorization";
|
||||
import BadRequestException from "../../Types/Exception/BadRequestException";
|
||||
import logger from "../Utils/Logger";
|
||||
import { JSONObject } from "../../Types/JSON";
|
||||
import BadDataException from "../../Types/Exception/BadDataException";
|
||||
import {
|
||||
AppApiClientUrl,
|
||||
DashboardClientUrl,
|
||||
SlackAppClientId,
|
||||
SlackAppClientSecret,
|
||||
} from "../EnvironmentConfig";
|
||||
import SlackAppManifest from "../Utils/Workspace/Slack/app-manifest.json";
|
||||
import URL from "../../Types/API/URL";
|
||||
import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
|
||||
import HTTPResponse from "../../Types/API/HTTPResponse";
|
||||
import API from "../../Utils/API";
|
||||
import WorkspaceProjectAuthTokenService from "../Services/WorkspaceProjectAuthTokenService";
|
||||
import ObjectID from "../../Types/ObjectID";
|
||||
import WorkspaceUserAuthTokenService from "../Services/WorkspaceUserAuthTokenService";
|
||||
import WorkspaceType from "../../Types/Workspace/WorkspaceType";
|
||||
|
||||
export default class SlackAPI {
|
||||
public getRouter(): ExpressRouter {
|
||||
const router: ExpressRouter = Express.getRouter();
|
||||
|
||||
router.get(
|
||||
"/slack/app-manifest",
|
||||
(req: ExpressRequest, res: ExpressResponse) => {
|
||||
// return app manifest for slack app
|
||||
return Response.sendJsonObjectResponse(req, res, SlackAppManifest);
|
||||
},
|
||||
);
|
||||
|
||||
router.get(
|
||||
"/slack/auth/:projectId/:userId",
|
||||
async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
if (!SlackAppClientId) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadDataException("Slack App Client ID is not set"),
|
||||
);
|
||||
}
|
||||
|
||||
if (!SlackAppClientSecret) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadDataException("Slack App Client Secret is not set"),
|
||||
);
|
||||
}
|
||||
|
||||
const projectId: string | undefined =
|
||||
req.params["projectId"]?.toString();
|
||||
const userId: string | undefined = req.params["userId"]?.toString();
|
||||
|
||||
if (!projectId) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadDataException("Invalid ProjectID in request"),
|
||||
);
|
||||
}
|
||||
|
||||
if (!userId) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadDataException("Invalid UserID in request"),
|
||||
);
|
||||
}
|
||||
|
||||
// if there's an error query param.
|
||||
const error: string | undefined = req.query["error"]?.toString();
|
||||
|
||||
const slackIntegrationPageUrl: URL = URL.fromString(
|
||||
DashboardClientUrl.toString() +
|
||||
`/${projectId.toString()}/settings/slack-integration`,
|
||||
);
|
||||
|
||||
if (error) {
|
||||
return Response.redirect(
|
||||
req,
|
||||
res,
|
||||
slackIntegrationPageUrl.addQueryParam("error", error),
|
||||
);
|
||||
}
|
||||
|
||||
// slack returns the code on successful auth.
|
||||
const code: string | undefined = req.query["code"]?.toString();
|
||||
|
||||
if (!code) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Invalid request"),
|
||||
);
|
||||
}
|
||||
|
||||
// get access token from slack api.
|
||||
|
||||
const redirectUri: URL = URL.fromString(
|
||||
`${AppApiClientUrl.toString()}/slack/auth/${projectId}/${userId}`,
|
||||
);
|
||||
|
||||
const requestBody: JSONObject = {
|
||||
code: code,
|
||||
client_id: SlackAppClientId,
|
||||
client_secret: SlackAppClientSecret,
|
||||
redirect_uri: redirectUri.toString(),
|
||||
};
|
||||
|
||||
logger.debug("Slack Auth Request Body: ");
|
||||
logger.debug(requestBody);
|
||||
|
||||
// send the request to slack api to get the access token https://slack.com/api/oauth.v2.access
|
||||
|
||||
const response: HTTPErrorResponse | HTTPResponse<JSONObject> =
|
||||
await API.post(
|
||||
URL.fromString("https://slack.com/api/oauth.v2.access"),
|
||||
requestBody,
|
||||
{
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
);
|
||||
|
||||
if (response instanceof HTTPErrorResponse) {
|
||||
throw response;
|
||||
}
|
||||
|
||||
const responseBody: JSONObject = response.data;
|
||||
|
||||
logger.debug("Slack Auth Request Body: ");
|
||||
logger.debug(responseBody);
|
||||
|
||||
let slackTeamId: string | undefined = undefined;
|
||||
let slackBotAccessToken: string | undefined = undefined;
|
||||
let slackUserId: string | undefined = undefined;
|
||||
let slackTeamName: string | undefined = undefined;
|
||||
let botUserId: string | undefined = undefined;
|
||||
let slackUserAccessToken: string | undefined = undefined;
|
||||
|
||||
// ReponseBody is in this format.
|
||||
// {
|
||||
// "ok": true,
|
||||
// "access_token": "sample-token",
|
||||
// "token_type": "bot",
|
||||
// "scope": "commands,incoming-webhook",
|
||||
// "bot_user_id": "U0KRQLJ9H",
|
||||
// "app_id": "A0KRD7HC3",
|
||||
// "team": {
|
||||
// "name": "Slack Pickleball Team",
|
||||
// "id": "T9TK3CUKW"
|
||||
// },
|
||||
// "enterprise": {
|
||||
// "name": "slack-pickleball",
|
||||
// "id": "E12345678"
|
||||
// },
|
||||
// "authed_user": {
|
||||
// "id": "U1234",
|
||||
// "scope": "chat:write",
|
||||
// "access_token": "sample-token",
|
||||
// "token_type": "user"
|
||||
// }
|
||||
// }
|
||||
|
||||
if (responseBody["ok"] !== true) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Invalid request"),
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
responseBody["team"] &&
|
||||
(responseBody["team"] as JSONObject)["id"]
|
||||
) {
|
||||
slackTeamId = (responseBody["team"] as JSONObject)["id"]?.toString();
|
||||
}
|
||||
|
||||
if (responseBody["access_token"]) {
|
||||
slackBotAccessToken = responseBody["access_token"]?.toString();
|
||||
}
|
||||
|
||||
if (
|
||||
responseBody["authed_user"] &&
|
||||
(responseBody["authed_user"] as JSONObject)["id"]
|
||||
) {
|
||||
slackUserId = (responseBody["authed_user"] as JSONObject)[
|
||||
"id"
|
||||
]?.toString();
|
||||
}
|
||||
|
||||
if (
|
||||
responseBody["authed_user"] &&
|
||||
(responseBody["authed_user"] as JSONObject)["access_token"]
|
||||
) {
|
||||
slackUserAccessToken = (responseBody["authed_user"] as JSONObject)[
|
||||
"access_token"
|
||||
]?.toString();
|
||||
}
|
||||
|
||||
if (
|
||||
responseBody["team"] &&
|
||||
(responseBody["team"] as JSONObject)["name"]
|
||||
) {
|
||||
slackTeamName = (responseBody["team"] as JSONObject)[
|
||||
"name"
|
||||
]?.toString();
|
||||
}
|
||||
|
||||
if (responseBody["bot_user_id"]) {
|
||||
botUserId = responseBody["bot_user_id"]?.toString();
|
||||
}
|
||||
|
||||
await WorkspaceProjectAuthTokenService.refreshAuthToken({
|
||||
projectId: new ObjectID(projectId),
|
||||
workspaceType: WorkspaceType.Slack,
|
||||
authToken: slackBotAccessToken || "",
|
||||
workspaceProjectId: slackTeamId || "",
|
||||
miscData: {
|
||||
teamId: slackTeamId || "",
|
||||
teamName: slackTeamName || "",
|
||||
botUserId: botUserId || "",
|
||||
},
|
||||
});
|
||||
|
||||
await WorkspaceUserAuthTokenService.refreshAuthToken({
|
||||
projectId: new ObjectID(projectId),
|
||||
userId: new ObjectID(userId),
|
||||
workspaceType: WorkspaceType.Slack,
|
||||
authToken: slackUserAccessToken || "",
|
||||
workspaceUserId: slackUserId || "",
|
||||
miscData: {
|
||||
userId: slackUserId || "",
|
||||
},
|
||||
});
|
||||
|
||||
// return back to dashboard after successful auth.
|
||||
Response.redirect(req, res, slackIntegrationPageUrl);
|
||||
},
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/slack/interactive",
|
||||
SlackAuthorization.isAuthorizedSlackRequest,
|
||||
(req: ExpressRequest, res: ExpressResponse) => {
|
||||
return Response.sendJsonObjectResponse(req, res, {
|
||||
response_action: "clear",
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
// options load endpoint.
|
||||
|
||||
router.post(
|
||||
"/slack/options-load",
|
||||
SlackAuthorization.isAuthorizedSlackRequest,
|
||||
(req: ExpressRequest, res: ExpressResponse) => {
|
||||
return Response.sendJsonObjectResponse(req, res, {
|
||||
response_action: "clear",
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/slack/command",
|
||||
SlackAuthorization.isAuthorizedSlackRequest,
|
||||
(req: ExpressRequest, res: ExpressResponse) => {
|
||||
return Response.sendJsonObjectResponse(req, res, {
|
||||
response_action: "clear",
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
router.post(
|
||||
"/slack/events",
|
||||
SlackAuthorization.isAuthorizedSlackRequest,
|
||||
(req: ExpressRequest, res: ExpressResponse) => {
|
||||
// respond to slack challenge
|
||||
|
||||
const body: any = req.body;
|
||||
|
||||
if (body.challenge) {
|
||||
return Response.sendJsonObjectResponse(req, res, {
|
||||
challenge: body.challenge,
|
||||
});
|
||||
}
|
||||
|
||||
// if event is "create-incident" then show the incident create modal with title and description and add a button to submit the form.
|
||||
|
||||
if (body.event && body.event.type === "create-incident") {
|
||||
return Response.sendJsonObjectResponse(req, res, {
|
||||
type: "modal",
|
||||
title: {
|
||||
type: "plain_text",
|
||||
text: "Create Incident",
|
||||
},
|
||||
blocks: [
|
||||
{
|
||||
type: "input",
|
||||
block_id: "title",
|
||||
element: {
|
||||
type: "plain_text_input",
|
||||
action_id: "title",
|
||||
placeholder: {
|
||||
type: "plain_text",
|
||||
text: "Incident Title",
|
||||
},
|
||||
},
|
||||
label: {
|
||||
type: "plain_text",
|
||||
text: "Title",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
block_id: "description",
|
||||
element: {
|
||||
type: "plain_text_input",
|
||||
action_id: "description",
|
||||
placeholder: {
|
||||
type: "plain_text",
|
||||
text: "Incident Description",
|
||||
},
|
||||
},
|
||||
label: {
|
||||
type: "plain_text",
|
||||
text: "Description",
|
||||
},
|
||||
},
|
||||
// button
|
||||
{
|
||||
type: "actions",
|
||||
elements: [
|
||||
{
|
||||
type: "button",
|
||||
text: {
|
||||
type: "plain_text",
|
||||
text: "Submit",
|
||||
},
|
||||
style: "primary",
|
||||
value: "submit",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new BadRequestException("Invalid request"),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
return router;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import BadRequestException from "../../Types/Exception/BadRequestException";
|
||||
import LocalCache from "../Infrastructure/LocalCache";
|
||||
import Express, {
|
||||
ExpressRequest,
|
||||
@@ -13,6 +14,9 @@ import ServerException from "Common/Types/Exception/ServerException";
|
||||
export interface StatusAPIOptions {
|
||||
readyCheck: () => Promise<void>;
|
||||
liveCheck: () => Promise<void>;
|
||||
globalCacheCheck?: (() => Promise<void>) | undefined;
|
||||
analyticsDatabaseCheck?: (() => Promise<void>) | undefined;
|
||||
databaseCheck?: (() => Promise<void>) | undefined;
|
||||
}
|
||||
|
||||
export default class StatusAPI {
|
||||
@@ -103,7 +107,7 @@ export default class StatusAPI {
|
||||
async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
try {
|
||||
logger.debug("Live check");
|
||||
await options.readyCheck();
|
||||
await options.liveCheck();
|
||||
logger.info("Live check: ok");
|
||||
stausLiveSuccess.add(1);
|
||||
|
||||
@@ -123,6 +127,94 @@ export default class StatusAPI {
|
||||
},
|
||||
);
|
||||
|
||||
// Global cache check
|
||||
router.get(
|
||||
"/status/global-cache",
|
||||
async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
try {
|
||||
logger.debug("Global cache check");
|
||||
if (options.globalCacheCheck) {
|
||||
await options.globalCacheCheck();
|
||||
} else {
|
||||
throw new BadRequestException("Global cache check not implemented");
|
||||
}
|
||||
logger.info("Global cache check: ok");
|
||||
|
||||
Response.sendJsonObjectResponse(req, res, {
|
||||
status: "ok",
|
||||
});
|
||||
} catch (e) {
|
||||
Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
e instanceof Exception
|
||||
? e
|
||||
: new ServerException("Global cache is not ready"),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Analytics database check
|
||||
router.get(
|
||||
"/status/analytics-database",
|
||||
async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
try {
|
||||
logger.debug("Analytics database check");
|
||||
if (options.analyticsDatabaseCheck) {
|
||||
await options.analyticsDatabaseCheck();
|
||||
} else {
|
||||
throw new BadRequestException(
|
||||
"Analytics database check not implemented",
|
||||
);
|
||||
}
|
||||
logger.info("Analytics database check: ok");
|
||||
|
||||
Response.sendJsonObjectResponse(req, res, {
|
||||
status: "ok",
|
||||
});
|
||||
} catch (e) {
|
||||
Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
e instanceof Exception
|
||||
? e
|
||||
: new ServerException("Analytics database is not ready"),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Database check
|
||||
router.get(
|
||||
"/status/database",
|
||||
async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
try {
|
||||
logger.debug("Database check");
|
||||
|
||||
if (options.databaseCheck) {
|
||||
await options.databaseCheck();
|
||||
} else {
|
||||
throw new BadRequestException("Database check not implemented");
|
||||
}
|
||||
|
||||
logger.info("Database check: ok");
|
||||
|
||||
Response.sendJsonObjectResponse(req, res, {
|
||||
status: "ok",
|
||||
});
|
||||
} catch (e) {
|
||||
Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
e instanceof Exception
|
||||
? e
|
||||
: new ServerException("Database is not ready"),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return router;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ import StatusPageHistoryChartBarColorRule from "Common/Models/DatabaseModels/Sta
|
||||
import StatusPageResource from "Common/Models/DatabaseModels/StatusPageResource";
|
||||
import StatusPageSSO from "Common/Models/DatabaseModels/StatusPageSso";
|
||||
import StatusPageSubscriber from "Common/Models/DatabaseModels/StatusPageSubscriber";
|
||||
import StatusPageEventType from "../../Types/StatusPage/StatusPageEventType";
|
||||
import StatusPageResourceUptimeUtil from "../../Utils/StatusPage/ResourceUptime";
|
||||
import MonitorService from "../Services/MonitorService";
|
||||
|
||||
export default class StatusPageAPI extends BaseAPI<
|
||||
StatusPage,
|
||||
@@ -81,6 +84,66 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
public constructor() {
|
||||
super(StatusPage, StatusPageService);
|
||||
|
||||
// confirm subscription api
|
||||
this.router.get(
|
||||
`${new this.entityType()
|
||||
.getCrudApiPath()
|
||||
?.toString()}/confirm-subscription/:statusPageSubscriberId`,
|
||||
async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
const token: string = req.query["verification-token"] as string;
|
||||
|
||||
const statusPageSubscriberId: ObjectID = new ObjectID(
|
||||
req.params["statusPageSubscriberId"] as string,
|
||||
);
|
||||
|
||||
const subscriber: StatusPageSubscriber | null =
|
||||
await StatusPageSubscriberService.findOneBy({
|
||||
query: {
|
||||
_id: statusPageSubscriberId,
|
||||
subscriptionConfirmationToken: token,
|
||||
},
|
||||
select: {
|
||||
isSubscriptionConfirmed: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!subscriber) {
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new NotFoundException(
|
||||
"Subscriber not found or confirmation token is invalid",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// check if subscription confirmed already.
|
||||
|
||||
if (subscriber.isSubscriptionConfirmed) {
|
||||
return Response.sendEmptySuccessResponse(req, res);
|
||||
}
|
||||
|
||||
await StatusPageSubscriberService.updateOneById({
|
||||
id: statusPageSubscriberId,
|
||||
data: {
|
||||
isSubscriptionConfirmed: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
await StatusPageSubscriberService.sendYouHaveSubscribedEmail({
|
||||
subscriberId: statusPageSubscriberId,
|
||||
});
|
||||
|
||||
return Response.sendEmptySuccessResponse(req, res);
|
||||
},
|
||||
);
|
||||
|
||||
// CNAME verification api
|
||||
this.router.get(
|
||||
`${new this.entityType()
|
||||
@@ -250,6 +313,7 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
enableSmsSubscribers: true,
|
||||
isPublicStatusPage: true,
|
||||
allowSubscribersToChooseResources: true,
|
||||
allowSubscribersToChooseEventTypes: true,
|
||||
requireSsoForLogin: true,
|
||||
coverImageFile: {
|
||||
file: true,
|
||||
@@ -455,6 +519,128 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
this.router.post(
|
||||
`${new this.entityType()
|
||||
.getCrudApiPath()
|
||||
?.toString()}/overview/:statusPageId/uptime-percent`,
|
||||
UserMiddleware.getUserMiddleware,
|
||||
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
||||
try {
|
||||
|
||||
// This reosurce ID can be of a status page resource OR a status page group.
|
||||
const statusPageResourceId: ObjectID = new ObjectID(
|
||||
req.params["statusPageResourceId"] as string,
|
||||
);
|
||||
|
||||
const statusPageId: ObjectID = new ObjectID(
|
||||
req.params["statusPageId"] as string,
|
||||
);
|
||||
|
||||
if(!statusPageId || !statusPageResourceId){
|
||||
throw new BadDataException("Status Page or Resource not found");
|
||||
}
|
||||
|
||||
// get start and end date from request body.
|
||||
// if no end date is provided then it will be current date.
|
||||
// if no start date is provided then it will be 14 days ago from end date.
|
||||
|
||||
let startDate: Date = OneUptimeDate.getSomeDaysAgo(14)
|
||||
let endDate: Date = OneUptimeDate.getCurrentDate();
|
||||
|
||||
if(req.body["startDate"]){
|
||||
startDate = OneUptimeDate.fromString(req.body["startDate"] as string);
|
||||
}
|
||||
|
||||
if(req.body["endDate"]){
|
||||
endDate = OneUptimeDate.fromString(req.body["endDate"] as string);
|
||||
}
|
||||
|
||||
const monitorStatusTimelines: Array<MonitorStatusTimeline> = [];
|
||||
|
||||
|
||||
// get monitor or group.
|
||||
|
||||
// get status page group.
|
||||
|
||||
const monitorsInResource: Array<ObjectID> = [];
|
||||
|
||||
const statusPageGroup: StatusPageGroup | null = await StatusPageGroupService.findOneBy({
|
||||
query: {
|
||||
_id: statusPageResourceId,
|
||||
statusPageId: statusPageId,
|
||||
},
|
||||
select: {
|
||||
_id: true,
|
||||
statusPageId: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if(statusPageGroup){
|
||||
// get all monitors in group.
|
||||
const groupResources: Array<StatusPageResource> = await StatusPageResourceService.findBy({
|
||||
query: {
|
||||
statusPageGroupId: statusPageResourceId,
|
||||
},
|
||||
select: {
|
||||
monitorId: true,
|
||||
monitorGroupId: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
limit: LIMIT_PER_PROJECT,
|
||||
skip: 0,
|
||||
});
|
||||
|
||||
monitorsInGroup.push(...groupResources.map((resource: StatusPageResource) => {
|
||||
return resource.monitorId!;
|
||||
}).filter((id: ObjectID) => {
|
||||
return Boolean(id);
|
||||
}));
|
||||
|
||||
|
||||
}
|
||||
|
||||
const monitor: Monitor | null = await MonitorService.findOneBy({
|
||||
query: {
|
||||
_id: statusPageResourceId,
|
||||
},
|
||||
select: {
|
||||
_id: true,
|
||||
name: true,
|
||||
monitorGroupId: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const uptimePercent: number | null = null;
|
||||
StatusPageResourceUptimeUtil.calculateAvgUptimePercentOfStatusPageGroup(
|
||||
{
|
||||
statusPageGroup: data.group,
|
||||
monitorStatusTimelines: monitorStatusTimelines,
|
||||
precision:
|
||||
data.group.uptimePercentPrecision ||
|
||||
UptimePrecision.ONE_DECIMAL,
|
||||
downtimeMonitorStatuses:
|
||||
statusPage?.downtimeMonitorStatuses || [],
|
||||
statusPageResources: statusPageResources,
|
||||
monitorsInGroup: monitorsInGroup,
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
|
||||
next(err);
|
||||
|
||||
}
|
||||
});
|
||||
this.router.post(
|
||||
`${new this.entityType()
|
||||
.getCrudApiPath()
|
||||
@@ -1031,7 +1217,18 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
},
|
||||
});
|
||||
|
||||
const overallStatus: MonitorStatus | null =
|
||||
this.getOverallMonitorStatus(
|
||||
statusPageResources,
|
||||
monitorStatuses,
|
||||
monitorGroupCurrentStatuses,
|
||||
);
|
||||
|
||||
const response: JSONObject = {
|
||||
overallStatus: overallStatus
|
||||
? BaseModel.toJSON(overallStatus, MonitorStatus)
|
||||
: null,
|
||||
|
||||
scheduledMaintenanceEventsPublicNotes: BaseModel.toJSONArray(
|
||||
scheduledMaintenanceEventsPublicNotes,
|
||||
ScheduledMaintenancePublicNote,
|
||||
@@ -1750,6 +1947,7 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
enableEmailSubscribers: true,
|
||||
enableSmsSubscribers: true,
|
||||
allowSubscribersToChooseResources: true,
|
||||
allowSubscribersToChooseEventTypes: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
@@ -1838,6 +2036,15 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
req.body.data["statusPageEventTypes"] &&
|
||||
!statusPage.allowSubscribersToChooseEventTypes
|
||||
) {
|
||||
throw new BadDataException(
|
||||
"Subscribers are not allowed to choose event types for this status page.",
|
||||
);
|
||||
}
|
||||
|
||||
statusPageSubscriber.statusPageId = objectId;
|
||||
statusPageSubscriber.sendYouHaveSubscribedMessage = true;
|
||||
statusPageSubscriber.projectId = statusPage.projectId!;
|
||||
@@ -1845,6 +2052,10 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
req.body.data["isSubscribedToAllResources"],
|
||||
);
|
||||
|
||||
statusPageSubscriber.isSubscribedToAllEventTypes = Boolean(
|
||||
req.body.data["isSubscribedToAllEventTypes"],
|
||||
);
|
||||
|
||||
if (
|
||||
req.body.data["statusPageResources"] &&
|
||||
req.body.data["statusPageResources"].length > 0
|
||||
@@ -1854,6 +2065,15 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
] as Array<StatusPageResource>;
|
||||
}
|
||||
|
||||
if (
|
||||
req.body.data["statusPageEventTypes"] &&
|
||||
req.body.data["statusPageEventTypes"].length > 0
|
||||
) {
|
||||
statusPageSubscriber.statusPageEventTypes = req.body.data[
|
||||
"statusPageEventTypes"
|
||||
] as Array<StatusPageEventType>;
|
||||
}
|
||||
|
||||
if (isUpdate) {
|
||||
// check isUnsubscribed is set to false.
|
||||
|
||||
@@ -2199,4 +2419,54 @@ export default class StatusPageAPI extends BaseAPI<
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public getOverallMonitorStatus(
|
||||
statusPageResources: Array<StatusPageResource>,
|
||||
monitorStatuses: Array<MonitorStatus>,
|
||||
monitorGroupCurrentStatuses: Dictionary<ObjectID>,
|
||||
): MonitorStatus | null {
|
||||
let currentStatus: MonitorStatus | null =
|
||||
monitorStatuses.length > 0 && monitorStatuses[0]
|
||||
? monitorStatuses[0]
|
||||
: null;
|
||||
|
||||
const dict: Dictionary<number> = {};
|
||||
|
||||
for (const resource of statusPageResources) {
|
||||
if (resource.monitor?.currentMonitorStatusId) {
|
||||
if (
|
||||
!Object.keys(dict).includes(
|
||||
resource.monitor?.currentMonitorStatusId.toString() || "",
|
||||
)
|
||||
) {
|
||||
dict[resource.monitor?.currentMonitorStatusId?.toString()] = 1;
|
||||
} else {
|
||||
dict[resource.monitor!.currentMonitorStatusId!.toString()]!++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check status of monitor groups.
|
||||
|
||||
for (const groupId in monitorGroupCurrentStatuses) {
|
||||
const statusId: ObjectID | undefined =
|
||||
monitorGroupCurrentStatuses[groupId];
|
||||
|
||||
if (statusId) {
|
||||
if (!Object.keys(dict).includes(statusId.toString() || "")) {
|
||||
dict[statusId.toString()] = 1;
|
||||
} else {
|
||||
dict[statusId.toString()]!++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const monitorStatus of monitorStatuses) {
|
||||
if (monitorStatus._id && dict[monitorStatus._id]) {
|
||||
currentStatus = monitorStatus;
|
||||
}
|
||||
}
|
||||
|
||||
return currentStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ export default class UserNotificationLogTimelineAPI extends BaseAPI<
|
||||
_id: true,
|
||||
projectId: true,
|
||||
triggeredByIncidentId: true,
|
||||
triggeredByAlertId: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
@@ -115,6 +116,7 @@ export default class UserNotificationLogTimelineAPI extends BaseAPI<
|
||||
_id: true,
|
||||
projectId: true,
|
||||
triggeredByIncidentId: true,
|
||||
triggeredByAlertId: true,
|
||||
},
|
||||
props: {
|
||||
isRoot: true,
|
||||
@@ -147,16 +149,38 @@ export default class UserNotificationLogTimelineAPI extends BaseAPI<
|
||||
const host: Hostname = await DatabaseConfig.getHost();
|
||||
const httpProtocol: Protocol = await DatabaseConfig.getHttpProtocol();
|
||||
|
||||
return Response.redirect(
|
||||
if (timelineItem.triggeredByIncidentId) {
|
||||
return Response.redirect(
|
||||
req,
|
||||
res,
|
||||
new URL(
|
||||
httpProtocol,
|
||||
host,
|
||||
DashboardRoute.addRoute(
|
||||
`/${timelineItem.projectId?.toString()}/incidents/${timelineItem.triggeredByIncidentId!.toString()}`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (timelineItem.triggeredByAlertId) {
|
||||
return Response.redirect(
|
||||
req,
|
||||
res,
|
||||
new URL(
|
||||
httpProtocol,
|
||||
host,
|
||||
DashboardRoute.addRoute(
|
||||
`/${timelineItem.projectId?.toString()}/alerts/${timelineItem.triggeredByAlertId!.toString()}`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Response.sendErrorResponse(
|
||||
req,
|
||||
res,
|
||||
new URL(
|
||||
httpProtocol,
|
||||
host,
|
||||
DashboardRoute.addRoute(
|
||||
`/${timelineItem.projectId?.toString()}/incidents/${timelineItem.triggeredByIncidentId!.toString()}`,
|
||||
),
|
||||
),
|
||||
new BadDataException("Invalid item Id"),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -30,6 +30,14 @@ export default class DatabaseConfig {
|
||||
return globalConfig.getColumnValue(key);
|
||||
}
|
||||
|
||||
public static async getHomeUrl(): Promise<URL> {
|
||||
const host: Hostname = await DatabaseConfig.getHost();
|
||||
|
||||
const httpProtocol: Protocol = await DatabaseConfig.getHttpProtocol();
|
||||
|
||||
return new URL(httpProtocol, host);
|
||||
}
|
||||
|
||||
public static async getHost(): Promise<Hostname> {
|
||||
return Promise.resolve(new Hostname(process.env["HOST"] || "localhost"));
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
AccountsRoute,
|
||||
AdminDashboardRoute,
|
||||
DashboardRoute,
|
||||
AppApiRoute,
|
||||
} from "Common/ServiceRoute";
|
||||
import BillingConfig from "./BillingConfig";
|
||||
import Hostname from "Common/Types/API/Hostname";
|
||||
@@ -18,6 +19,7 @@ export enum ConfigLogLevel {
|
||||
WARN = "WARN",
|
||||
ERROR = "ERROR",
|
||||
DEBUG = "DEBUG",
|
||||
OFF = "OFF",
|
||||
}
|
||||
|
||||
export const getAllEnvVars: () => JSONObject = (): JSONObject => {
|
||||
@@ -88,9 +90,27 @@ export const AppApiHostname: Hostname = Hostname.fromString(
|
||||
}`,
|
||||
);
|
||||
|
||||
export const IngestorHostname: Hostname = Hostname.fromString(
|
||||
`${process.env["SERVER_INGESTOR_HOSTNAME"] || "localhost"}:${
|
||||
process.env["INGESTOR_PORT"] || 80
|
||||
export const ProbeIngestHostname: Hostname = Hostname.fromString(
|
||||
`${process.env["SERVER_PROBE_INGEST_HOSTNAME"] || "localhost"}:${
|
||||
process.env["PROBE_INGEST_PORT"] || 80
|
||||
}`,
|
||||
);
|
||||
|
||||
export const OpenTelemetryIngestHostname: Hostname = Hostname.fromString(
|
||||
`${process.env["SERVER_OPEN_TELEMETRY_INGEST_HOSTNAME"] || "localhost"}:${
|
||||
process.env["OPEN_TELEMETRY_INGEST_PORT"] || 80
|
||||
}`,
|
||||
);
|
||||
|
||||
export const IncomingRequestIngestHostname: Hostname = Hostname.fromString(
|
||||
`${process.env["SERVER_INCOMING_REQUEST_INGEST_HOSTNAME"] || "localhost"}:${
|
||||
process.env["INCOMING_REQUEST_INGEST_PORT"] || 80
|
||||
}`,
|
||||
);
|
||||
|
||||
export const FluentIngestHostname: Hostname = Hostname.fromString(
|
||||
`${process.env["SERVER_FLUENT_INGEST_HOSTNAME"] || "localhost"}:${
|
||||
process.env["FLUENT_INGEST_PORT"] || 80
|
||||
}`,
|
||||
);
|
||||
|
||||
@@ -162,6 +182,10 @@ export const ShouldRedisTlsEnable: boolean = Boolean(
|
||||
RedisTlsCa || (RedisTlsCert && RedisTlsKey),
|
||||
);
|
||||
|
||||
export const RedisIPFamily: number = process.env["REDIS_IP_FAMILY"]
|
||||
? Number(process.env["REDIS_IP_FAMILY"])
|
||||
: 4;
|
||||
|
||||
export const IsProduction: boolean =
|
||||
process.env["ENVIRONMENT"] === "production";
|
||||
|
||||
@@ -179,6 +203,9 @@ export const AnalyticsHost: string = process.env["ANALYTICS_HOST"] || "";
|
||||
export const DisableAutomaticIncidentCreation: boolean =
|
||||
process.env["DISABLE_AUTOMATIC_INCIDENT_CREATION"] === "true";
|
||||
|
||||
export const DisableAutomaticAlertCreation: boolean =
|
||||
process.env["DISABLE_AUTOMATIC_ALERT_CREATION"] === "true";
|
||||
|
||||
export const ClickhouseHost: Hostname = Hostname.fromString(
|
||||
process.env["CLICKHOUSE_HOST"] || "clickhouse",
|
||||
);
|
||||
@@ -233,6 +260,10 @@ export const WorkflowScriptTimeoutInMS: number = process.env[
|
||||
? parseInt(process.env["WORKFLOW_SCRIPT_TIMEOUT_IN_MS"].toString())
|
||||
: 5000;
|
||||
|
||||
export const WorkflowTimeoutInMs: number = process.env["WORKFLOW_TIMEOUT_IN_MS"]
|
||||
? parseInt(process.env["WORKFLOW_TIMEOUT_IN_MS"].toString())
|
||||
: 5000;
|
||||
|
||||
export const AllowedActiveMonitorCountInFreePlan: number = process.env[
|
||||
"ALLOWED_ACTIVE_MONITOR_COUNT_IN_FREE_PLAN"
|
||||
]
|
||||
@@ -253,8 +284,19 @@ export const AllowedSubscribersCountInFreePlan: number = process.env[
|
||||
? parseInt(process.env["ALLOWED_SUBSCRIBERS_COUNT_IN_FREE_PLAN"].toString())
|
||||
: 100;
|
||||
|
||||
export const NotificationWebhookOnCreateUser: string =
|
||||
process.env["NOTIFICATION_WEBHOOK_ON_CREATED_USER"] || "";
|
||||
export const NotificationSlackWebhookOnCreateUser: string =
|
||||
process.env["NOTIFICATION_SLACK_WEBHOOK_ON_CREATED_USER"] || "";
|
||||
|
||||
export const NotificationSlackWebhookOnCreateProject: string =
|
||||
process.env["NOTIFICATION_SLACK_WEBHOOK_ON_CREATED_PROJECT"] || "";
|
||||
|
||||
// notification delete project
|
||||
export const NotificationSlackWebhookOnDeleteProject: string =
|
||||
process.env["NOTIFICATION_SLACK_WEBHOOK_ON_DELETED_PROJECT"] || "";
|
||||
|
||||
// notification subscripton update.
|
||||
export const NotificationSlackWebhookOnSubscriptionUpdate: string =
|
||||
process.env["NOTIFICATION_SLACK_WEBHOOK_ON_SUBSCRIPTION_UPDATE"] || "";
|
||||
|
||||
export const AdminDashboardClientURL: URL = new URL(
|
||||
HttpProtocol,
|
||||
@@ -262,6 +304,8 @@ export const AdminDashboardClientURL: URL = new URL(
|
||||
AdminDashboardRoute,
|
||||
);
|
||||
|
||||
export const AppApiClientUrl: URL = new URL(HttpProtocol, Host, AppApiRoute);
|
||||
|
||||
export const DashboardClientUrl: URL = new URL(
|
||||
HttpProtocol,
|
||||
Host,
|
||||
@@ -276,3 +320,10 @@ export const AccountsClientUrl: URL = new URL(
|
||||
|
||||
export const DisableTelemetry: boolean =
|
||||
process.env["DISABLE_TELEMETRY"] === "true";
|
||||
|
||||
export const SlackAppClientId: string | null =
|
||||
process.env["SLACK_APP_CLIENT_ID"] || null;
|
||||
export const SlackAppClientSecret: string | null =
|
||||
process.env["SLACK_APP_CLIENT_SECRET"] || null;
|
||||
export const SlackAppSigningSecret: string | null =
|
||||
process.env["SLACK_APP_SIGNING_SECRET"] || null;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { NodeClickHouseClientConfigOptions } from "@clickhouse/client/dist/config";
|
||||
import {
|
||||
ClickHouseIsHostHttps,
|
||||
ClickhouseDatabase,
|
||||
@@ -10,14 +11,17 @@ import {
|
||||
ClickhouseUsername,
|
||||
ShouldClickhouseSslEnable,
|
||||
} from "../EnvironmentConfig";
|
||||
import { NodeClickHouseClientConfigOptions } from "@clickhouse/client/dist/client";
|
||||
import Hostname from "../../Types/API/Hostname";
|
||||
|
||||
export type ClickHouseClientConfigOptions = NodeClickHouseClientConfigOptions;
|
||||
|
||||
const hostProtocol: string = ClickHouseIsHostHttps ? "https" : "http";
|
||||
|
||||
const clickhouseHost: Hostname = ClickhouseHost || new Hostname("clickhouse");
|
||||
const clickhousePort: string = (ClickhousePort || 8123).toString();
|
||||
|
||||
const options: ClickHouseClientConfigOptions = {
|
||||
host: `${hostProtocol}://${ClickhouseHost.toString()}:${ClickhousePort.toNumber()}`,
|
||||
url: `${hostProtocol}://${clickhouseHost.toString()}:${clickhousePort}`,
|
||||
username: ClickhouseUsername,
|
||||
password: ClickhousePassword,
|
||||
database: ClickhouseDatabase,
|
||||
|
||||
@@ -4,12 +4,16 @@ import {
|
||||
dataSourceOptions,
|
||||
testDataSourceOptions,
|
||||
} from "./ClickhouseConfig";
|
||||
import { ClickHouseClient, PingResult, createClient } from "@clickhouse/client";
|
||||
import { PingResult, createClient, ClickHouseClient } from "@clickhouse/client";
|
||||
import DatabaseNotConnectedException from "Common/Types/Exception/DatabaseNotConnectedException";
|
||||
import Sleep from "Common/Types/Sleep";
|
||||
import Stream from "stream";
|
||||
import API from "../../Utils/API";
|
||||
import URL from "../../Types/API/URL";
|
||||
import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
|
||||
import HTTPResponse from "../../Types/API/HTTPResponse";
|
||||
import { JSONObject } from "../../Types/JSON";
|
||||
|
||||
export type ClickhouseClient = ClickHouseClient<Stream.Readable>;
|
||||
export type ClickhouseClient = ClickHouseClient;
|
||||
|
||||
export default class ClickhouseDatabase {
|
||||
private dataSource!: ClickhouseClient | null;
|
||||
@@ -101,7 +105,23 @@ export default class ClickhouseDatabase {
|
||||
public async checkConnnectionStatus(): Promise<boolean> {
|
||||
// Ping clickhouse to check if the connection is still alive
|
||||
try {
|
||||
const result: PingResult | undefined = await this.getDataSource()?.ping();
|
||||
logger.debug(
|
||||
"Checking Clickhouse Connection Status - pinging clickhouse",
|
||||
);
|
||||
|
||||
const dbUrl: string | undefined = this.getDatasourceOptions().url as
|
||||
| string
|
||||
| undefined;
|
||||
|
||||
if (!dbUrl) {
|
||||
throw new DatabaseNotConnectedException("Clickhouse URL not found");
|
||||
}
|
||||
|
||||
const result: HTTPErrorResponse | HTTPResponse<JSONObject> =
|
||||
await API.get(URL.fromString(dbUrl.toString()));
|
||||
|
||||
logger.debug("Clickhouse Connection Status Result");
|
||||
logger.debug(result);
|
||||
|
||||
if (!result) {
|
||||
throw new DatabaseNotConnectedException(
|
||||
@@ -109,13 +129,24 @@ export default class ClickhouseDatabase {
|
||||
);
|
||||
}
|
||||
|
||||
if (result?.success === false) {
|
||||
if (result instanceof HTTPErrorResponse) {
|
||||
throw new DatabaseNotConnectedException(
|
||||
"Clickhouse Database is not connected",
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
if (
|
||||
result.data &&
|
||||
((result.data as JSONObject)["data"] as string) &&
|
||||
((result.data as JSONObject)["data"] as string).toString().trim() ===
|
||||
"Ok."
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
throw new DatabaseNotConnectedException(
|
||||
"Clickhouse Database is not connected",
|
||||
);
|
||||
} catch (err) {
|
||||
logger.error("Clickhouse Connection Lost");
|
||||
logger.error(err);
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MigrationName1729682875503 implements MigrationInterface {
|
||||
public name = "MigrationName1729682875503";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "Dashboard" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "dashboardViewConfig" jsonb NOT NULL, CONSTRAINT "PK_98ee748c8a7a18d6f9ca995eaf4" PRIMARY KEY ("_id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE INDEX "IDX_7f0fc9402b8d4151c46e3015a3" ON "Dashboard" ("projectId") `,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "DashboardLabel" ("dashboardId" uuid NOT NULL, "labelId" uuid NOT NULL, CONSTRAINT "PK_bf2648028a4eab3f57aad76dab6" PRIMARY KEY ("dashboardId", "labelId"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE INDEX "IDX_ce2113f43c6d88a632318414d0" ON "DashboardLabel" ("dashboardId") `,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE INDEX "IDX_31a32c8d6d1d1cb734c7711050" ON "DashboardLabel" ("labelId") `,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_7f0fc9402b8d4151c46e3015a30" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_501b2bb8e0cb03f309211cbfa5f" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "Dashboard" ADD CONSTRAINT "FK_0debc7bed011eac37da40e875cb" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "DashboardLabel" ADD CONSTRAINT "FK_ce2113f43c6d88a632318414d0d" FOREIGN KEY ("dashboardId") REFERENCES "Dashboard"("_id") ON DELETE CASCADE ON UPDATE CASCADE`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "DashboardLabel" ADD CONSTRAINT "FK_31a32c8d6d1d1cb734c77110509" FOREIGN KEY ("labelId") REFERENCES "Label"("_id") ON DELETE CASCADE ON UPDATE CASCADE`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "DashboardLabel" DROP CONSTRAINT "FK_31a32c8d6d1d1cb734c77110509"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "DashboardLabel" DROP CONSTRAINT "FK_ce2113f43c6d88a632318414d0d"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_0debc7bed011eac37da40e875cb"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_501b2bb8e0cb03f309211cbfa5f"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "Dashboard" DROP CONSTRAINT "FK_7f0fc9402b8d4151c46e3015a30"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`DROP INDEX "public"."IDX_31a32c8d6d1d1cb734c7711050"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`DROP INDEX "public"."IDX_ce2113f43c6d88a632318414d0"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "DashboardLabel"`);
|
||||
await queryRunner.query(
|
||||
`DROP INDEX "public"."IDX_7f0fc9402b8d4151c46e3015a3"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "Dashboard"`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MigrationName1730117995642 implements MigrationInterface {
|
||||
public name = "MigrationName1730117995642";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "StatusPage" ADD "allowSubscribersToChooseEventTypes" boolean NOT NULL DEFAULT false`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "StatusPageSubscriber" ADD "isSubscribedToAllEventTypes" boolean NOT NULL DEFAULT true`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "StatusPageSubscriber" ADD "statusPageEventTypes" jsonb DEFAULT '[]'`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "StatusPageSubscriber" DROP COLUMN "statusPageEventTypes"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "StatusPageSubscriber" DROP COLUMN "isSubscribedToAllEventTypes"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "StatusPage" DROP COLUMN "allowSubscribersToChooseEventTypes"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MigrationName1730209089495 implements MigrationInterface {
|
||||
public name = "MigrationName1730209089495";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "MonitorTest" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "monitorType" character varying(100) NOT NULL, "monitorSteps" jsonb, "probeId" uuid NOT NULL, "testedAt" TIMESTAMP WITH TIME ZONE, "lastMonitoringLog" jsonb, CONSTRAINT "PK_7ce3477c7bb3d7b8961c8465935" PRIMARY KEY ("_id"))`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE INDEX "IDX_6de87954a2a0587defe52aeb86" ON "MonitorTest" ("projectId") `,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`CREATE INDEX "IDX_fd6b1e330eb08de988307b6052" ON "MonitorTest" ("probeId") `,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_6de87954a2a0587defe52aeb86c" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_f94c5a7356b7b55785e3a3dac5b" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_b92a71b1f5f6c072455cd242ed6" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_fd6b1e330eb08de988307b60524" FOREIGN KEY ("probeId") REFERENCES "Probe"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_fd6b1e330eb08de988307b60524"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_b92a71b1f5f6c072455cd242ed6"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_f94c5a7356b7b55785e3a3dac5b"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_6de87954a2a0587defe52aeb86c"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`DROP INDEX "public"."IDX_fd6b1e330eb08de988307b6052"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`DROP INDEX "public"."IDX_6de87954a2a0587defe52aeb86"`,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE "MonitorTest"`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MigrationName1730223198692 implements MigrationInterface {
|
||||
public name = "MigrationName1730223198692";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP COLUMN "lastMonitoringLog"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD "monitorStepProbeResponse" jsonb`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD "isInQueue" boolean DEFAULT true`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP COLUMN "isInQueue"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" DROP COLUMN "monitorStepProbeResponse"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "MonitorTest" ADD "lastMonitoringLog" jsonb`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user