mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 08:42:13 +02:00
Compare commits
374 Commits
fix-small-
...
owners-in-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51d28b0af5 | ||
|
|
06375f478e | ||
|
|
4090fc9bd1 | ||
|
|
008655b6eb | ||
|
|
73bf0a26c7 | ||
|
|
fb3153cf2e | ||
|
|
193508c0c7 | ||
|
|
64fa6e68ea | ||
|
|
c6de2b7514 | ||
|
|
489757dc96 | ||
|
|
3c9216755a | ||
|
|
5c78bbb456 | ||
|
|
965d731b25 | ||
|
|
18595722f0 | ||
|
|
1dfa269d2d | ||
|
|
c833806441 | ||
|
|
8a3099d85d | ||
|
|
04bf2bd1e4 | ||
|
|
f5e79ebd2e | ||
|
|
e4bb7b4019 | ||
|
|
31b0d6cb06 | ||
|
|
d5ef79de33 | ||
|
|
e7fd6dae3a | ||
|
|
6eec2b54f7 | ||
|
|
8dbb768056 | ||
|
|
01d26b08a2 | ||
|
|
6e432d67e7 | ||
|
|
d77381652a | ||
|
|
26d69b4a07 | ||
|
|
d6fd7a47e5 | ||
|
|
2beb2414e6 | ||
|
|
05540db978 | ||
|
|
1a40e9af8e | ||
|
|
63c89f5b1a | ||
|
|
f7b1f5fa9a | ||
|
|
e1f3b454ce | ||
|
|
fa04df806c | ||
|
|
749d1f0228 | ||
|
|
fde6c94351 | ||
|
|
3810821fc2 | ||
|
|
74aa7c60b4 | ||
|
|
39d56d13d5 | ||
|
|
2148ec7462 | ||
|
|
303c68476e | ||
|
|
cb797be1be | ||
|
|
d314c6fdbd | ||
|
|
82ca306fbe | ||
|
|
095a29b39d | ||
|
|
e04c2f328c | ||
|
|
24b35de5b2 | ||
|
|
278aea59d5 | ||
|
|
ed42c36bbf | ||
|
|
b4e1404828 | ||
|
|
6a4cea838e | ||
|
|
48edfd9812 | ||
|
|
d35a1673fc | ||
|
|
ba4b990434 | ||
|
|
61e590e161 | ||
|
|
5baf3f0496 | ||
|
|
1ab1b4dcab | ||
|
|
89239d60ee | ||
|
|
a666782384 | ||
|
|
ba1c5152db | ||
|
|
d38dc693cb | ||
|
|
b306f82e68 | ||
|
|
a2f083bd12 | ||
|
|
f15c20f6e5 | ||
|
|
4257f1c576 | ||
|
|
e494fabd48 | ||
|
|
b1c8d6f7e8 | ||
|
|
725824dfc2 | ||
|
|
991adc4874 | ||
|
|
82bd0741d0 | ||
|
|
80190fa156 | ||
|
|
bc1d2f8335 | ||
|
|
74cc556f7c | ||
|
|
dec65d701a | ||
|
|
ed8f9ea839 | ||
|
|
d9724cfd37 | ||
|
|
996a1fa2f9 | ||
|
|
e3421a72df | ||
|
|
6868fc299e | ||
|
|
4362923ff6 | ||
|
|
99f532ec7a | ||
|
|
593660c805 | ||
|
|
d959853ee3 | ||
|
|
cad5ba0af5 | ||
|
|
c1a97ede84 | ||
|
|
69031d1700 | ||
|
|
774a01ae36 | ||
|
|
9cd36ead37 | ||
|
|
6d82ffa2ad | ||
|
|
55fdea387e | ||
|
|
82b607f3e9 | ||
|
|
c973b3b93b | ||
|
|
0c0dd7fd73 | ||
|
|
b5a8ab0ae2 | ||
|
|
d085b20290 | ||
|
|
7d683d4ebc | ||
|
|
0a898a012d | ||
|
|
8885919b7e | ||
|
|
baf2c2c3af | ||
|
|
433b246d64 | ||
|
|
e831941744 | ||
|
|
6d79759f09 | ||
|
|
683e261c98 | ||
|
|
3b322b155e | ||
|
|
81cf9ab572 | ||
|
|
1a3e22db5d | ||
|
|
c83ec93fb8 | ||
|
|
a12239c27e | ||
|
|
e25995c617 | ||
|
|
a6d608e63f | ||
|
|
7a8a102ca0 | ||
|
|
83e34da353 | ||
|
|
7fc5c9d18d | ||
|
|
3a649bf150 | ||
|
|
d8616b6e37 | ||
|
|
e8cd9d8b6a | ||
|
|
54868715c7 | ||
|
|
3d881156cd | ||
|
|
0137c906d4 | ||
|
|
6f8239cd73 | ||
|
|
64ef6541f7 | ||
|
|
4e02846e21 | ||
|
|
adbbd6fe48 | ||
|
|
07af319969 | ||
|
|
fd7b2d3db2 | ||
|
|
71bea4e8ff | ||
|
|
29772bfaaa | ||
|
|
e30ca1ddfd | ||
|
|
4320be66f1 | ||
|
|
fde3af7ab0 | ||
|
|
d895636a44 | ||
|
|
cab5b5840e | ||
|
|
7f47a7344b | ||
|
|
edfed79272 | ||
|
|
64314de142 | ||
|
|
8c2a8ab303 | ||
|
|
81c2daa44b | ||
|
|
b004d19efa | ||
|
|
0605fb820d | ||
|
|
2555e22bdf | ||
|
|
6d818e22cd | ||
|
|
ddd6b03852 | ||
|
|
bdeff997af | ||
|
|
00b3726407 | ||
|
|
fbc0577f0b | ||
|
|
63c7e30af3 | ||
|
|
7e897d7d34 | ||
|
|
e74d0a9599 | ||
|
|
1d1c969169 | ||
|
|
72ebe62b86 | ||
|
|
53c0f9e025 | ||
|
|
b75b6434c0 | ||
|
|
f3dd60e284 | ||
|
|
6d88109fdd | ||
|
|
d4c4a1c83d | ||
|
|
99c9b58c81 | ||
|
|
bca11364a2 | ||
|
|
c961215677 | ||
|
|
2d1942c789 | ||
|
|
3d72b17091 | ||
|
|
d5b5cfbb50 | ||
|
|
3d29a103eb | ||
|
|
c959b0845f | ||
|
|
4aab4314c5 | ||
|
|
4fe92a1096 | ||
|
|
e110aeb1b5 | ||
|
|
9ccbc50849 | ||
|
|
79a4209745 | ||
|
|
ba1e5487c2 | ||
|
|
74d57bbc27 | ||
|
|
18665f81fd | ||
|
|
d27b2585c2 | ||
|
|
ef4cd85274 | ||
|
|
80be077c3a | ||
|
|
0897007f9b | ||
|
|
cc076f0994 | ||
|
|
8b6ac3341a | ||
|
|
c48dca0925 | ||
|
|
024777937e | ||
|
|
2fe8518828 | ||
|
|
9ed3413fa6 | ||
|
|
6aa7b8648a | ||
|
|
a1bcb45122 | ||
|
|
27420261a0 | ||
|
|
d873bafedb | ||
|
|
746de4ea9a | ||
|
|
0721970cc2 | ||
|
|
2e2356e163 | ||
|
|
e9394326c7 | ||
|
|
c19d203737 | ||
|
|
78cd09f0ab | ||
|
|
cef0b827eb | ||
|
|
a108c208d6 | ||
|
|
0702b9331b | ||
|
|
47b0d754a0 | ||
|
|
ce32efd51d | ||
|
|
32a5a79805 | ||
|
|
0af4a71062 | ||
|
|
3dc1dbfe25 | ||
|
|
027b9004b2 | ||
|
|
46f9157170 | ||
|
|
0128657720 | ||
|
|
f20e7d3fe9 | ||
|
|
5e5264f065 | ||
|
|
e217da7ba1 | ||
|
|
65570dad6e | ||
|
|
f300e51c2e | ||
|
|
9877a68830 | ||
|
|
72dfc21110 | ||
|
|
9c0f3bf01d | ||
|
|
56cc52391e | ||
|
|
2d51e781c0 | ||
|
|
73b60b582c | ||
|
|
1d3641c74b | ||
|
|
3668c604f9 | ||
|
|
a9e84e6ed0 | ||
|
|
3290c266e7 | ||
|
|
c9c38ccfe6 | ||
|
|
101397cf35 | ||
|
|
db6f43af73 | ||
|
|
8c468f145d | ||
|
|
4cc7972251 | ||
|
|
f33fc59ab1 | ||
|
|
b2291437a8 | ||
|
|
19417ac5d7 | ||
|
|
127d98f6e4 | ||
|
|
33b4e7ffd7 | ||
|
|
6b34e0c559 | ||
|
|
e94bc7634c | ||
|
|
2f9fbdaa09 | ||
|
|
69e7444ffb | ||
|
|
5849184d69 | ||
|
|
d741ee1c95 | ||
|
|
0fdc64e38d | ||
|
|
4a1635ff67 | ||
|
|
7be95ed6d8 | ||
|
|
05666eb730 | ||
|
|
accc3109d2 | ||
|
|
0c1425f430 | ||
|
|
35ada4671d | ||
|
|
27f38db033 | ||
|
|
371cfe2403 | ||
|
|
705d25cbdf | ||
|
|
42ec184a68 | ||
|
|
fb038e1662 | ||
|
|
a1dc8008ba | ||
|
|
d633d22e8d | ||
|
|
aa5b9b3a5a | ||
|
|
3ce957a093 | ||
|
|
b5b10b81a4 | ||
|
|
a9d65681bf | ||
|
|
8442bc9411 | ||
|
|
421824a3e6 | ||
|
|
15d5b4e548 | ||
|
|
495120b83b | ||
|
|
09ebc154ea | ||
|
|
fea85e8f69 | ||
|
|
091b3512fb | ||
|
|
eadcb10e4d | ||
|
|
a3dc5580f2 | ||
|
|
72de7c9e35 | ||
|
|
90daef4691 | ||
|
|
7eeffa4da3 | ||
|
|
ecd4769c6c | ||
|
|
42183efcef | ||
|
|
9059fa530e | ||
|
|
7f32989720 | ||
|
|
527026d7b4 | ||
|
|
34101de6d0 | ||
|
|
5d82d7d619 | ||
|
|
1f7b124594 | ||
|
|
6d5d9416f8 | ||
|
|
d0d2162a51 | ||
|
|
69d93e4330 | ||
|
|
0cb2a98047 | ||
|
|
5fc4fa60ed | ||
|
|
24c30f884e | ||
|
|
4f823062c5 | ||
|
|
95f324fa80 | ||
|
|
6cab95c41b | ||
|
|
46bbc2cf96 | ||
|
|
b354cd0f25 | ||
|
|
173d2c7cde | ||
|
|
cf795c1633 | ||
|
|
ab31200f45 | ||
|
|
d5d4da389f | ||
|
|
b288dbb694 | ||
|
|
ccdc3f92dd | ||
|
|
af3a6b2f3f | ||
|
|
99da78d7db | ||
|
|
254bae0956 | ||
|
|
2c1f094acd | ||
|
|
49563e9cbe | ||
|
|
bf506e23d7 | ||
|
|
f9645979c2 | ||
|
|
cf2ff65de5 | ||
|
|
6a248478d2 | ||
|
|
bc593b18e0 | ||
|
|
6182d84d57 | ||
|
|
87ee6674c7 | ||
|
|
78f2b0b4c5 | ||
|
|
70bcc80b5e | ||
|
|
8bffd8a9b7 | ||
|
|
0e6a365046 | ||
|
|
ad70f1e09d | ||
|
|
4ff2b5a2da | ||
|
|
39801c9c0d | ||
|
|
75bb276349 | ||
|
|
72ca3ac51e | ||
|
|
d1decf9143 | ||
|
|
ddaea04182 | ||
|
|
d0ca7d9067 | ||
|
|
837de39cf7 | ||
|
|
4fb07bfa83 | ||
|
|
b292c61341 | ||
|
|
46cf642b8f | ||
|
|
9e1fa1e008 | ||
|
|
1631836e29 | ||
|
|
c1b2e1ef83 | ||
|
|
0806fbe36e | ||
|
|
1ba205b4d6 | ||
|
|
3381931fed | ||
|
|
57e3a50e41 | ||
|
|
4238dbd651 | ||
|
|
3beb60362d | ||
|
|
856f46cfce | ||
|
|
4de9193e28 | ||
|
|
bf0f2d2f79 | ||
|
|
f0483c9df6 | ||
|
|
fa524ed2e1 | ||
|
|
9e272ff85b | ||
|
|
7b3249155e | ||
|
|
fe655b0e3a | ||
|
|
9e987fd899 | ||
|
|
f428ae12aa | ||
|
|
7d75f9eed2 | ||
|
|
5cd0fc9853 | ||
|
|
73c1eb2b78 | ||
|
|
939aee7713 | ||
|
|
0a57be6b6b | ||
|
|
d3526b4cab | ||
|
|
dbccb323b4 | ||
|
|
067f2a5885 | ||
|
|
140fe6d026 | ||
|
|
c54532a6a8 | ||
|
|
a8297c99d3 | ||
|
|
14cb2da5e2 | ||
|
|
0c021a2417 | ||
|
|
096671aa27 | ||
|
|
632dc7c356 | ||
|
|
23c34a2e84 | ||
|
|
83ac03cb94 | ||
|
|
08a03bebf5 | ||
|
|
16f667b329 | ||
|
|
d7337be9f9 | ||
|
|
f0ea9928f4 | ||
|
|
9154f2f8f0 | ||
|
|
81305e1305 | ||
|
|
ddda137c12 | ||
|
|
0d44b0ca13 | ||
|
|
001a4b153b | ||
|
|
4556a7e322 | ||
|
|
bf7707b2a9 | ||
|
|
a834045b00 | ||
|
|
155af6e9a8 | ||
|
|
59ae6d7e56 | ||
|
|
d4c3e287a6 | ||
|
|
3c5e169b58 | ||
|
|
f4000b1dd3 | ||
|
|
89fd950af9 | ||
|
|
4fca7fc0ee |
25
.github/workflows/compile.accounts.yaml
vendored
25
.github/workflows/compile.accounts.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Accounts
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Accounts && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.alert.yaml
vendored
24
.github/workflows/compile.alert.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Alert
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Alert && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.api-reference.yaml
vendored
24
.github/workflows/compile.api-reference.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile ApiReference
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ApiReference && npm install && npm run compile
|
||||
|
||||
23
.github/workflows/compile.common-server.yaml
vendored
23
.github/workflows/compile.common-server.yaml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Compile CommonServer
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install && npm run compile
|
||||
|
||||
23
.github/workflows/compile.common-ui.yaml
vendored
23
.github/workflows/compile.common-ui.yaml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Compile UI Common
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonUI && npm install --force && npm run compile
|
||||
|
||||
22
.github/workflows/compile.common.yaml
vendored
22
.github/workflows/compile.common.yaml
vendored
@@ -1,22 +0,0 @@
|
||||
name: Compile Common
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.dashboard-api.yaml
vendored
25
.github/workflows/compile.dashboard-api.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile DashboardAPI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd DashboardAPI && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.dashboard.yaml
vendored
25
.github/workflows/compile.dashboard.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Dashboard
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Dashboard && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.file.yaml
vendored
24
.github/workflows/compile.file.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile File Service
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd File && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.helmchart.yaml
vendored
24
.github/workflows/compile.helmchart.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile HelmChart
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd HelmChart && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.home.yaml
vendored
24
.github/workflows/compile.home.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Home
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Home && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.identity.yaml
vendored
24
.github/workflows/compile.identity.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Identity
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Identity && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.integration.yaml
vendored
24
.github/workflows/compile.integration.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Integration
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Integration && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.licensing.yaml
vendored
24
.github/workflows/compile.licensing.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Licensing
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Licensing && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.mail.yaml
vendored
24
.github/workflows/compile.mail.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Mail
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Mail && npm install && npm run compile
|
||||
|
||||
23
.github/workflows/compile.model.yaml
vendored
23
.github/workflows/compile.model.yaml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Compile Model
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.probe-api.yaml
vendored
24
.github/workflows/compile.probe-api.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile ProbeAPI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ProbeAPI && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.realtime.yaml
vendored
24
.github/workflows/compile.realtime.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Realtime
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Realtime && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.status-page.yaml
vendored
25
.github/workflows/compile.status-page.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Status Page
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd StatusPage && npm install && npm run compile
|
||||
|
||||
25
.github/workflows/compile.workers.yaml
vendored
25
.github/workflows/compile.workers.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Compile Workers
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Workers && npm install && npm run compile
|
||||
|
||||
24
.github/workflows/compile.workflow.yaml
vendored
24
.github/workflows/compile.workflow.yaml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Compile Workflow
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Workflow && npm install && npm run compile
|
||||
|
||||
334
.github/workflows/compile.yml
vendored
Normal file
334
.github/workflows/compile.yml
vendored
Normal file
@@ -0,0 +1,334 @@
|
||||
name: Compile
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
compile-accounts:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Accounts && npm install && npm run compile
|
||||
|
||||
compile-alert:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Alert && npm install && npm run compile
|
||||
|
||||
compile-api-reference:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ApiReference && npm install && npm run compile
|
||||
|
||||
compile-common-server:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install && npm run compile
|
||||
|
||||
compile-common-ui:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonUI && npm install --force && npm run compile
|
||||
|
||||
compile-common:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
compile-dashboard-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd DashboardAPI && npm install && npm run compile
|
||||
|
||||
compile-dashboard:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Dashboard && npm install && npm run compile
|
||||
|
||||
compile-file:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd File && npm install && npm run compile
|
||||
|
||||
compile-helm-chart:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd HelmChart && npm install && npm run compile
|
||||
|
||||
compile-home:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Home && npm install && npm run compile
|
||||
|
||||
compile-identity:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Identity && npm install && npm run compile
|
||||
|
||||
compile-integrations:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Integration && npm install && npm run compile
|
||||
|
||||
compile-licensing:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Licensing && npm install && npm run compile
|
||||
|
||||
compile-mail:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Mail && npm install && npm run compile
|
||||
|
||||
compile-model:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd Model && npm install && npm run compile
|
||||
|
||||
compile-probe:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Probe && npm install && npm run compile
|
||||
|
||||
compile-probe-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd ProbeAPI && npm install && npm run compile
|
||||
|
||||
|
||||
compile-realtime:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Realtime && npm install && npm run compile
|
||||
|
||||
compile-status-page:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd StatusPage && npm install && npm run compile
|
||||
|
||||
compile-workers:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd CommonUI && npm install --force
|
||||
- run: cd Workers && npm install && npm run compile
|
||||
|
||||
compile-workflow:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd Workflow && npm install && npm run compile
|
||||
|
||||
compile-test-server:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
- run: cd Common && npm install
|
||||
- run: cd Model && npm install
|
||||
- run: cd CommonServer && npm install
|
||||
- run: cd TestServer && npm install && npm run compile
|
||||
25
.github/workflows/docker-build.accounts.yaml
vendored
25
.github/workflows/docker-build.accounts.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Accounts Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Accounts/Dockerfile .
|
||||
25
.github/workflows/docker-build.alert.yaml
vendored
25
.github/workflows/docker-build.alert.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Alert Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Alert/Dockerfile .
|
||||
24
.github/workflows/docker-build.api-reference.yml
vendored
24
.github/workflows/docker-build.api-reference.yml
vendored
@@ -1,24 +0,0 @@
|
||||
name: API Docs Docker Build
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ApiReference/Dockerfile .
|
||||
@@ -1,26 +0,0 @@
|
||||
name: DashboardAPI Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./DashboardAPI/Dockerfile .
|
||||
25
.github/workflows/docker-build.dashboard.yaml
vendored
25
.github/workflows/docker-build.dashboard.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Dashboard Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Dashboard/Dockerfile .
|
||||
25
.github/workflows/docker-build.file.yaml
vendored
25
.github/workflows/docker-build.file.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: File Service Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for file
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./File/Dockerfile .
|
||||
25
.github/workflows/docker-build.haraka.yaml
vendored
25
.github/workflows/docker-build.haraka.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Haraka Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build images
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Haraka/Dockerfile .
|
||||
25
.github/workflows/docker-build.helm-chart.yml
vendored
25
.github/workflows/docker-build.helm-chart.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Helm Chart Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./HelmChart/Dockerfile .
|
||||
25
.github/workflows/docker-build.home.yaml
vendored
25
.github/workflows/docker-build.home.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Home Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Home/Dockerfile .
|
||||
25
.github/workflows/docker-build.identity.yaml
vendored
25
.github/workflows/docker-build.identity.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Identity Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for identity
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Identity/Dockerfile .
|
||||
25
.github/workflows/docker-build.integration.yaml
vendored
25
.github/workflows/docker-build.integration.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Integration Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Integration/Dockerfile .
|
||||
25
.github/workflows/docker-build.licensing.yaml
vendored
25
.github/workflows/docker-build.licensing.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Licensing Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Licensing/Dockerfile .
|
||||
25
.github/workflows/docker-build.mail.yaml
vendored
25
.github/workflows/docker-build.mail.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Mail Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Mail/Dockerfile .
|
||||
25
.github/workflows/docker-build.nginx.yml
vendored
25
.github/workflows/docker-build.nginx.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: NGINX Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Nginx/Dockerfile ./Nginx
|
||||
25
.github/workflows/docker-build.probe-api.yaml
vendored
25
.github/workflows/docker-build.probe-api.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Probe-api Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ProbeAPI/Dockerfile .
|
||||
25
.github/workflows/docker-build.status-page.yaml
vendored
25
.github/workflows/docker-build.status-page.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Status Page Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./StatusPage/Dockerfile .
|
||||
26
.github/workflows/docker-build.workers.yaml
vendored
26
.github/workflows/docker-build.workers.yaml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Workers Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workers/Dockerfile .
|
||||
25
.github/workflows/docker-build.workflow.yaml
vendored
25
.github/workflows/docker-build.workflow.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Workflow Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define job to build docker image
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workflow/Dockerfile .
|
||||
329
.github/workflows/docker-build.yml
vendored
Normal file
329
.github/workflows/docker-build.yml
vendored
Normal file
@@ -0,0 +1,329 @@
|
||||
name: Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
docker-build-accounts:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Accounts/Dockerfile .
|
||||
|
||||
docker-build-alert:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Alert/Dockerfile .
|
||||
|
||||
docker-build-api-reference:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ApiReference/Dockerfile .
|
||||
|
||||
docker-build-dashboard-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for accounts service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./DashboardAPI/Dockerfile .
|
||||
|
||||
docker-build-dashboard:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Dashboard/Dockerfile .
|
||||
|
||||
docker-build-file:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for file
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./File/Dockerfile .
|
||||
|
||||
docker-build-haraka:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build images
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Haraka/Dockerfile .
|
||||
|
||||
docker-build-helm-chart:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./HelmChart/Dockerfile .
|
||||
|
||||
docker-build-home:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Home/Dockerfile .
|
||||
|
||||
docker-build-identity:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for identity
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Identity/Dockerfile .
|
||||
|
||||
docker-build-integrations:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Integration/Dockerfile .
|
||||
|
||||
docker-build-licensing:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for licensing
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Licensing/Dockerfile .
|
||||
|
||||
docker-build-mail:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Mail/Dockerfile .
|
||||
|
||||
docker-build-nginx:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Nginx/Dockerfile ./Nginx
|
||||
|
||||
docker-build-probe:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Probe/Dockerfile .
|
||||
|
||||
docker-build-probe-api:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image probe api
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./ProbeAPI/Dockerfile .
|
||||
|
||||
docker-build-realtime:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Realtime/Dockerfile .
|
||||
|
||||
docker-build-status-page:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./StatusPage/Dockerfile .
|
||||
|
||||
docker-build-workers:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workers/Dockerfile .
|
||||
|
||||
docker-build-workflow:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Workflow/Dockerfile .
|
||||
|
||||
|
||||
docker-build-test-server:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for mail service
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./TestServer/Dockerfile .
|
||||
25
.github/workflows/github-build.realtime.yaml
vendored
25
.github/workflows/github-build.realtime.yaml
vendored
@@ -1,25 +0,0 @@
|
||||
name: Realtime Docker Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'hotfix-*'
|
||||
- 'release'
|
||||
|
||||
jobs:
|
||||
# define jobs to build docker imag
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Preinstall
|
||||
run: npm run prerun
|
||||
|
||||
# build image for home
|
||||
- name: build docker image
|
||||
run: sudo docker build -f ./Realtime/Dockerfile .
|
||||
31
.github/workflows/playwright.yml
vendored
Normal file
31
.github/workflows/playwright.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BASE_URL: http://localhost
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run Server in Docker
|
||||
run: npm run dev
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: cd Playwright && npm install && npx playwright install && npx playwright test
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
@@ -1,20 +1,58 @@
|
||||
name: Test Image Deploy to DockerHub
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "release"
|
||||
|
||||
jobs:
|
||||
|
||||
workflow-test:
|
||||
generate-build-number:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
build_number: ${{ steps.buildnumber.outputs.build_number }}
|
||||
steps:
|
||||
- name: Generate build number
|
||||
id: buildnumber
|
||||
uses: onyxmueller/build-tag-number@v1.0.2
|
||||
with:
|
||||
token: ${{secrets.github_token}}
|
||||
- run: echo "Build number is ${{ steps.buildnumber.outputs.build_number }}"
|
||||
|
||||
github-release:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- run: echo "${{needs.generate-build-number.outputs.build_number}}"
|
||||
- name: "Build Changelog"
|
||||
id: build_changelog
|
||||
uses: mikepenz/release-changelog-builder-action@v3.7.1
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{env.ONEUPTIME_VERSION}}
|
||||
artifactErrorsFailBuild: true
|
||||
body: |
|
||||
${{steps.build_changelog.outputs.changelog}}
|
||||
|
||||
|
||||
test-server-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -24,16 +62,42 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:6.0.$CI_PIPELINE_ID-test --tag oneuptime/workflow:test --push -f ./Workflow/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/test-server:$ONEUPTIME_VERSION --tag oneuptime/test-server:release --push -f ./TestServer/Dockerfile .
|
||||
|
||||
workers-test:
|
||||
|
||||
workflow-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:$ONEUPTIME_VERSION --tag oneuptime/workflow:release --push -f ./Workflow/Dockerfile .
|
||||
|
||||
workers-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -43,16 +107,19 @@ jobs:
|
||||
# Build and deploy workers.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:6.0.$CI_PIPELINE_ID-test --tag oneuptime/workers:test --push -f ./Workers/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:$ONEUPTIME_VERSION --tag oneuptime/workers:release --push -f ./Workers/Dockerfile .
|
||||
|
||||
staus-page-test:
|
||||
staus-page-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -62,16 +129,19 @@ jobs:
|
||||
# Build and deploy status-page.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:6.0.$CI_PIPELINE_ID-test --tag oneuptime/status-page:test --push -f ./StatusPage/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:$ONEUPTIME_VERSION --tag oneuptime/status-page:release --push -f ./StatusPage/Dockerfile .
|
||||
|
||||
realtime-test:
|
||||
realtime-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -81,17 +151,20 @@ jobs:
|
||||
# Build and deploy realtime.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:6.0.$CI_PIPELINE_ID-test --tag oneuptime/realtime:test --push -f ./Realtime/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:$ONEUPTIME_VERSION --tag oneuptime/realtime:release --push -f ./Realtime/Dockerfile .
|
||||
|
||||
|
||||
probe-api-test:
|
||||
probe-api-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -101,16 +174,19 @@ jobs:
|
||||
# Build and deploy probe-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:6.0.$CI_PIPELINE_ID-test --tag oneuptime/probe-api:test --push -f ./ProbeAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:$ONEUPTIME_VERSION --tag oneuptime/probe-api:release --push -f ./ProbeAPI/Dockerfile .
|
||||
|
||||
nginx-test:
|
||||
nginx-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -120,17 +196,20 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:6.0.$CI_PIPELINE_ID-test --tag oneuptime/nginx:test --push -f ./Nginx/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:$ONEUPTIME_VERSION --tag oneuptime/nginx:release --push -f ./Nginx/Dockerfile .
|
||||
|
||||
|
||||
mail-test:
|
||||
mail-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -139,17 +218,20 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:6.0.$CI_PIPELINE_ID-test --tag oneuptime/mail:test --push -f ./Mail/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:$ONEUPTIME_VERSION --tag oneuptime/mail:release --push -f ./Mail/Dockerfile .
|
||||
|
||||
|
||||
licensing-test:
|
||||
licensing-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -159,16 +241,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:6.0.$CI_PIPELINE_ID-test --tag oneuptime/licensing:test --push -f ./Licensing/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:$ONEUPTIME_VERSION --tag oneuptime/licensing:release --push -f ./Licensing/Dockerfile .
|
||||
|
||||
integrations-test:
|
||||
integrations-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -178,19 +263,20 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:6.0.$CI_PIPELINE_ID-test --tag oneuptime/integrations:test --push -f ./Integration/Dockerfile .
|
||||
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:$ONEUPTIME_VERSION --tag oneuptime/integrations:release --push -f ./Integration/Dockerfile .
|
||||
|
||||
|
||||
|
||||
identity-test:
|
||||
probe-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -200,17 +286,19 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:6.0.$CI_PIPELINE_ID-test --tag oneuptime/identity:test --push -f ./Identity/Dockerfile .
|
||||
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe:$ONEUPTIME_VERSION --tag oneuptime/probe:release --push -f ./Probe/Dockerfile .
|
||||
|
||||
home-test:
|
||||
identity-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -220,17 +308,20 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:6.0.$CI_PIPELINE_ID-test --tag oneuptime/home:test --push -f ./Home/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:$ONEUPTIME_VERSION --tag oneuptime/identity:release --push -f ./Identity/Dockerfile .
|
||||
|
||||
|
||||
helm-chart-test:
|
||||
home-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -240,17 +331,20 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:6.0.$CI_PIPELINE_ID-test --tag oneuptime/helm-chart:test --push -f ./HelmChart/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:$ONEUPTIME_VERSION --tag oneuptime/home:release --push -f ./Home/Dockerfile .
|
||||
|
||||
|
||||
haraka-test:
|
||||
helm-chart-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -260,16 +354,42 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:6.0.$CI_PIPELINE_ID-test --tag oneuptime/haraka:test --push -f ./Haraka/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:$ONEUPTIME_VERSION --tag oneuptime/helm-chart:release --push -f ./HelmChart/Dockerfile .
|
||||
|
||||
|
||||
file-test:
|
||||
haraka-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:$ONEUPTIME_VERSION --tag oneuptime/haraka:release --push -f ./Haraka/Dockerfile .
|
||||
|
||||
file-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -278,18 +398,21 @@ jobs:
|
||||
# Build and deploy file.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:6.0.$CI_PIPELINE_ID-test --tag oneuptime/file:test --push -f ./File/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:$ONEUPTIME_VERSION --tag oneuptime/file:release --push -f ./File/Dockerfile .
|
||||
|
||||
|
||||
|
||||
dashboard-test:
|
||||
dashboard-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -299,19 +422,22 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:6.0.$CI_PIPELINE_ID-test --tag oneuptime/dashboard:test --push -f ./Dashboard/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:$ONEUPTIME_VERSION --tag oneuptime/dashboard:release --push -f ./Dashboard/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
dashboard-api-test:
|
||||
dashboard-api-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -321,19 +447,22 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:6.0.$CI_PIPELINE_ID-test --tag oneuptime/dashboard-api:test --push -f ./DashboardAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:$ONEUPTIME_VERSION --tag oneuptime/dashboard-api:release --push -f ./DashboardAPI/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
api-reference-test:
|
||||
api-reference-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -343,19 +472,22 @@ jobs:
|
||||
# Build and deploy api-reference.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:6.0.$CI_PIPELINE_ID-test --tag oneuptime/api-reference:test --push -f ./ApiReference/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:$ONEUPTIME_VERSION --tag oneuptime/api-reference:release --push -f ./ApiReference/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
alert-test:
|
||||
alert-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -365,19 +497,22 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:6.0.$CI_PIPELINE_ID-test --tag oneuptime/alert:test --push -f ./Alert/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:$ONEUPTIME_VERSION --tag oneuptime/alert:release --push -f ./Alert/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
accounts-test:
|
||||
accounts-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
@@ -387,6 +522,6 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:6.0.$CI_PIPELINE_ID-test --tag oneuptime/accounts:test --push -f ./Accounts/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:$ONEUPTIME_VERSION --tag oneuptime/accounts:release --push -f ./Accounts/Dockerfile .
|
||||
|
||||
|
||||
@@ -1,38 +1,31 @@
|
||||
name: Release Image Deploy to DockerHub
|
||||
name: Test Image Deploy to DockerHub
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "release"
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
|
||||
github-release:
|
||||
generate-build-number:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
ONEUPTIME_VERSION: 6.0.${{github.run_number}}
|
||||
outputs:
|
||||
build_number: ${{ steps.buildnumber.outputs.build_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: release
|
||||
- name: "Build Changelog"
|
||||
id: build_changelog
|
||||
uses: mikepenz/release-changelog-builder-action@v3.7.1
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{env.ONEUPTIME_VERSION}}
|
||||
artifactErrorsFailBuild: true
|
||||
body: |
|
||||
${{steps.build_changelog.outputs.changelog}}
|
||||
- name: Generate build number
|
||||
id: buildnumber
|
||||
uses: onyxmueller/build-tag-number@v1.0.2
|
||||
with:
|
||||
token: ${{secrets.github_token}}
|
||||
- run: echo "Build number is ${{ steps.buildnumber.outputs.build_number }}"
|
||||
|
||||
workflow-release:
|
||||
test-server-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -44,14 +37,35 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:6.0.$CI_PIPELINE_ID --tag oneuptime/workflow:release --push -f ./Workflow/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/test-server:$ONEUPTIME_VERSION-test --tag oneuptime/test-server:test --push -f ./TestServer/Dockerfile .
|
||||
|
||||
workers-release:
|
||||
workflow-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workflow:$ONEUPTIME_VERSION-test --tag oneuptime/workflow:test --push -f ./Workflow/Dockerfile .
|
||||
|
||||
workers-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -63,14 +77,15 @@ jobs:
|
||||
# Build and deploy workers.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:6.0.$CI_PIPELINE_ID --tag oneuptime/workers:release --push -f ./Workers/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/workers:$ONEUPTIME_VERSION-test --tag oneuptime/workers:test --push -f ./Workers/Dockerfile .
|
||||
|
||||
staus-page-release:
|
||||
staus-page-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -82,14 +97,15 @@ jobs:
|
||||
# Build and deploy status-page.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:6.0.$CI_PIPELINE_ID --tag oneuptime/status-page:release --push -f ./StatusPage/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/status-page:$ONEUPTIME_VERSION-test --tag oneuptime/status-page:test --push -f ./StatusPage/Dockerfile .
|
||||
|
||||
realtime-release:
|
||||
realtime-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -101,15 +117,16 @@ jobs:
|
||||
# Build and deploy realtime.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:6.0.$CI_PIPELINE_ID --tag oneuptime/realtime:release --push -f ./Realtime/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/realtime:$ONEUPTIME_VERSION-test --tag oneuptime/realtime:test --push -f ./Realtime/Dockerfile .
|
||||
|
||||
|
||||
probe-api-release:
|
||||
probe-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -121,14 +138,35 @@ jobs:
|
||||
# Build and deploy probe-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:6.0.$CI_PIPELINE_ID --tag oneuptime/probe-api:release --push -f ./ProbeAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe:$ONEUPTIME_VERSION-test --tag oneuptime/probe:test --push -f ./Probe/Dockerfile .
|
||||
|
||||
nginx-release:
|
||||
probe-api-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- run: npm run prerun
|
||||
- run: sudo docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
|
||||
# Build and deploy probe-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/probe-api:$ONEUPTIME_VERSION-test --tag oneuptime/probe-api:test --push -f ./ProbeAPI/Dockerfile .
|
||||
|
||||
nginx-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -140,15 +178,16 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:6.0.$CI_PIPELINE_ID --tag oneuptime/nginx:release --push -f ./Nginx/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/nginx:$ONEUPTIME_VERSION-test --tag oneuptime/nginx:test --push -f ./Nginx/Dockerfile .
|
||||
|
||||
|
||||
mail-release:
|
||||
mail-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -159,15 +198,16 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:6.0.$CI_PIPELINE_ID --tag oneuptime/mail:release --push -f ./Mail/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/mail:$ONEUPTIME_VERSION-test --tag oneuptime/mail:test --push -f ./Mail/Dockerfile .
|
||||
|
||||
|
||||
licensing-release:
|
||||
licensing-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -179,14 +219,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:6.0.$CI_PIPELINE_ID --tag oneuptime/licensing:release --push -f ./Licensing/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/licensing:$ONEUPTIME_VERSION-test --tag oneuptime/licensing:test --push -f ./Licensing/Dockerfile .
|
||||
|
||||
integrations-release:
|
||||
integrations-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -198,17 +239,18 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:6.0.$CI_PIPELINE_ID --tag oneuptime/integrations:release --push -f ./Integration/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/integrations:$ONEUPTIME_VERSION-test --tag oneuptime/integrations:test --push -f ./Integration/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
identity-release:
|
||||
identity-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -220,15 +262,16 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:6.0.$CI_PIPELINE_ID --tag oneuptime/identity:release --push -f ./Identity/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/identity:$ONEUPTIME_VERSION-test --tag oneuptime/identity:test --push -f ./Identity/Dockerfile .
|
||||
|
||||
|
||||
home-release:
|
||||
home-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -240,15 +283,16 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:6.0.$CI_PIPELINE_ID --tag oneuptime/home:release --push -f ./Home/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/home:$ONEUPTIME_VERSION-test --tag oneuptime/home:test --push -f ./Home/Dockerfile .
|
||||
|
||||
|
||||
helm-chart-release:
|
||||
helm-chart-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -260,15 +304,16 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:6.0.$CI_PIPELINE_ID --tag oneuptime/helm-chart:release --push -f ./HelmChart/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/helm-chart:$ONEUPTIME_VERSION-test --tag oneuptime/helm-chart:test --push -f ./HelmChart/Dockerfile .
|
||||
|
||||
|
||||
haraka-release:
|
||||
haraka-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -280,14 +325,15 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:6.0.$CI_PIPELINE_ID --tag oneuptime/haraka:release --push -f ./Haraka/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/haraka:$ONEUPTIME_VERSION-test --tag oneuptime/haraka:test --push -f ./Haraka/Dockerfile .
|
||||
|
||||
file-release:
|
||||
file-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -298,16 +344,17 @@ jobs:
|
||||
# Build and deploy file.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:6.0.$CI_PIPELINE_ID --tag oneuptime/file:release --push -f ./File/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/file:$ONEUPTIME_VERSION-test --tag oneuptime/file:test --push -f ./File/Dockerfile .
|
||||
|
||||
|
||||
|
||||
dashboard-release:
|
||||
dashboard-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -319,17 +366,18 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:6.0.$CI_PIPELINE_ID --tag oneuptime/dashboard:release --push -f ./Dashboard/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard:$ONEUPTIME_VERSION-test --tag oneuptime/dashboard:test --push -f ./Dashboard/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
dashboard-api-release:
|
||||
dashboard-api-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -341,17 +389,18 @@ jobs:
|
||||
# Build and deploy dashboard-api.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:6.0.$CI_PIPELINE_ID --tag oneuptime/dashboard-api:release --push -f ./DashboardAPI/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/dashboard-api:$ONEUPTIME_VERSION-test --tag oneuptime/dashboard-api:test --push -f ./DashboardAPI/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
api-reference-release:
|
||||
api-reference-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -363,17 +412,18 @@ jobs:
|
||||
# Build and deploy api-reference.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:6.0.$CI_PIPELINE_ID --tag oneuptime/api-reference:release --push -f ./ApiReference/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:$ONEUPTIME_VERSION-test --tag oneuptime/api-reference:test --push -f ./ApiReference/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
alert-release:
|
||||
alert-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -385,17 +435,18 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:6.0.$CI_PIPELINE_ID --tag oneuptime/alert:release --push -f ./Alert/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/alert:$ONEUPTIME_VERSION-test --tag oneuptime/alert:test --push -f ./Alert/Dockerfile .
|
||||
|
||||
|
||||
|
||||
|
||||
accounts-release:
|
||||
accounts-test-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
|
||||
DOCKERHUB_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
ONEUPTIME_VERSION: "7.0.${{needs.generate-build-number.outputs.build_number}}"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
@@ -407,6 +458,6 @@ jobs:
|
||||
# Build and deploy accounts.
|
||||
- run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
|
||||
- run: sudo docker buildx create --use
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:6.0.$CI_PIPELINE_ID --tag oneuptime/accounts:release --push -f ./Accounts/Dockerfile .
|
||||
- run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/accounts:$ONEUPTIME_VERSION-test --tag oneuptime/accounts:test --push -f ./Accounts/Dockerfile .
|
||||
|
||||
|
||||
42
.vscode/launch.json
vendored
42
.vscode/launch.json
vendored
@@ -41,6 +41,48 @@
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/TestServer",
|
||||
"name": "Test Server: Debug with Docker",
|
||||
"port": 9141,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Probe",
|
||||
"name": "Dashboard API: Debug with Docker",
|
||||
"port": 9655,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/ProbeAPI",
|
||||
"name": "Probe API: Debug with Docker",
|
||||
"port": 9932,
|
||||
"remoteRoot": "/usr/src/app",
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "node",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"localRoot": "${workspaceFolder}/Workflow",
|
||||
|
||||
@@ -34,9 +34,10 @@ const VerifyEmail: FunctionComponent = () => {
|
||||
emailverificationToken,
|
||||
EmailVerificationToken,
|
||||
FormType.Create,
|
||||
apiUrl,
|
||||
{},
|
||||
{}
|
||||
{
|
||||
overrideRequestUrl: apiUrl,
|
||||
}
|
||||
);
|
||||
} catch (err) {
|
||||
setError(API.getFriendlyMessage(err));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose">
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose">
|
||||
<h1>Authentication</h1>
|
||||
<p class="lead">You'll need to authenticate your requests to access any of the endpoints in the OneUptime API. In
|
||||
this guide, we'll look at how authentication works. OneUptime offers one way to authenticate your API requests
|
||||
@@ -11,7 +11,7 @@
|
||||
</h2>
|
||||
<p> Please head over to <b>Project Settings</b> > <b>API Keys</b>. Create a new API Key. Please note: New API Keys
|
||||
have no permissions assigned to them, so you will have to assign a permission before you can use it.</p>
|
||||
<a class="mt-5 inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-500"
|
||||
<a class="mt-5 inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 "
|
||||
href="/reference/permissions">
|
||||
Read more about permissions
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true" class="mt-0.5 h-5 w-5 relative top-px -mr-1">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<h1>Data Types</h1>
|
||||
<p class="lead">In this guide, we will look at how to work with OneUptime Data Types when querying the OneUptime
|
||||
API. </p>
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Select</dt>
|
||||
<dd><code class="inline-code">select</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Select</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Select</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Dictionary of fieldName - boolean as JSON Object. Here's an example. If the
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Sort</dt>
|
||||
<dd><code class="inline-code">sort</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Sort</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Sort</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Dictionary of fieldName - 'DESC' / 'ASC' as JSON Object. Here's an example. If
|
||||
@@ -106,13 +106,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of Equal To Query</p>
|
||||
@@ -144,13 +144,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of Not Equal To Query</p>
|
||||
@@ -182,13 +182,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of is null query</p>
|
||||
@@ -220,13 +220,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of is not null query</p>
|
||||
@@ -257,13 +257,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of greater than query</p>
|
||||
@@ -295,13 +295,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of greater or equal than query</p>
|
||||
@@ -333,13 +333,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of less than query</p>
|
||||
@@ -371,13 +371,13 @@
|
||||
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Here is an example of less or equal than query</p>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<h1 class="font-bold text-xl mb-5">Errors</h1>
|
||||
<p class="lead">In this guide, we will talk about what happens when something goes wrong while you work with the API. Mistakes happen, and mostly they will be yours, not ours. Let's look at some status codes and error types you might encounter.</p>
|
||||
<p>You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the status code and error message to figure out what has gone wrong and do some rudimentary debugging (before contacting support).</p>
|
||||
<div class="my-6 flex gap-2.5 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 p-4 leading-6 text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/5 dark:text-emerald-200 dark:[--tw-prose-links:theme(colors.white)] dark:[--tw-prose-links-hover:theme(colors.emerald.300)]">
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" class="mt-1 h-4 w-4 flex-none fill-emerald-500 stroke-white dark:fill-emerald-200/20 dark:stroke-emerald-200">
|
||||
<div class="my-6 flex gap-2.5 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 p-4 leading-6 text-emerald-900 ">
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" class="mt-1 h-4 w-4 flex-none fill-emerald-500 stroke-white ">
|
||||
<circle cx="8" cy="8" r="8" stroke-width="0"></circle>
|
||||
<path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6.75 7.75h1.5v3.5"></path>
|
||||
<circle cx="8" cy="4" r=".5" fill="none"></circle>
|
||||
@@ -22,13 +22,13 @@
|
||||
</h2>
|
||||
<p>Here is a list of the different categories of status codes returned by the OneUptime API. Use these to understand if a request was successful.</p>
|
||||
<div class="my-6">
|
||||
<ul role="list" class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
<ul role="list" class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">2xx</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>A 2xx status code indicates a successful response.</p>
|
||||
@@ -40,7 +40,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">4xx</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>A 4xx status code indicates a client error — this means it's a <em>you</em>
|
||||
@@ -54,7 +54,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">429</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p> Request limit exceeded. Request limits are 100 operations per second per project (this includes all the API keys in the project).
|
||||
@@ -67,7 +67,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">5xx</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>A 5xx status code indicates a server error — you won't be seeing a lot of these.</p>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<div class="absolute inset-0 -z-10 mx-0 max-w-none overflow-hidden">
|
||||
<div
|
||||
class="absolute left-1/2 top-0 ml-[-38rem] h-[25rem] w-[81.25rem] dark:[mask-image:linear-gradient(white,transparent)]">
|
||||
class="absolute left-1/2 top-0 ml-[-38rem] h-[25rem] w-[81.25rem]">
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-r from-[#36b49f] to-[#DBFF75] opacity-40 [mask-image:radial-gradient(farthest-side_at_top,white,transparent)] dark:from-[#36b49f]/30 dark:to-[#DBFF75]/30 dark:opacity-100">
|
||||
class="absolute inset-0 bg-gradient-to-r from-[#36b49f] to-[#DBFF75] opacity-40 [mask-image:radial-gradient(farthest-side_at_top,white,transparent)]">
|
||||
<svg aria-hidden="true"
|
||||
class="absolute inset-x-0 inset-y-[-50%] h-[200%] w-full skew-y-[-18deg] fill-black/40 stroke-black/50 mix-blend-overlay dark:fill-white/2.5 dark:stroke-white/5">
|
||||
class="absolute inset-x-0 inset-y-[-50%] h-[200%] w-full skew-y-[-18deg] fill-black/40 stroke-black/50 mix-blend-overlay /5">
|
||||
<defs>
|
||||
<pattern id=":r6s:" width="72" height="56" patternUnits="userSpaceOnUse" x="-12"
|
||||
y="4">
|
||||
@@ -23,7 +23,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
<svg viewBox="0 0 1113 440" aria-hidden="true"
|
||||
class="absolute top-0 left-1/2 ml-[-19rem] w-[69.5625rem] fill-white blur-[26px] dark:hidden">
|
||||
class="absolute top-0 left-1/2 ml-[-19rem] w-[69.5625rem] fill-white blur-[26px] ">
|
||||
<path d="M.016 439.5s-9.5-300 434-300S882.516 20 882.516 20V0h230.004v439.5H.016Z">
|
||||
</path>
|
||||
</svg>
|
||||
@@ -43,9 +43,9 @@
|
||||
<div
|
||||
class="absolute mt-1 ml-[calc(-1*var(--width))] hidden w-[var(--width)] opacity-0 transition [--width:calc(2.625rem+0.5px+50%-min(50%,calc(theme(maxWidth.lg)+theme(spacing.8))))] group-hover:opacity-100 group-focus:opacity-100 md:block lg:z-50 2xl:[--width:theme(spacing.10)]">
|
||||
<div
|
||||
class="group/anchor block h-5 w-5 rounded-lg bg-zinc-50 ring-1 ring-inset ring-zinc-300 transition hover:ring-zinc-500 dark:bg-zinc-800 dark:ring-zinc-700 dark:hover:bg-zinc-700 dark:hover:ring-zinc-600">
|
||||
class="group/anchor block h-5 w-5 rounded-lg bg-zinc-50 ring-1 ring-inset ring-zinc-300 transition hover:ring-zinc-500 ">
|
||||
<svg viewBox="0 0 20 20" fill="none" stroke-linecap="round" aria-hidden="true"
|
||||
class="h-5 w-5 stroke-zinc-500 transition dark:stroke-zinc-400 dark:group-hover/anchor:stroke-white">
|
||||
class="h-5 w-5 stroke-zinc-500 transition ">
|
||||
<path
|
||||
d="m6.5 11.5-.964-.964a3.535 3.535 0 1 1 5-5l.964.964m2 2 .964.964a3.536 3.536 0 0 1-5 5L8.5 13.5m0-5 3 3">
|
||||
</path>
|
||||
@@ -56,14 +56,14 @@
|
||||
</span>
|
||||
</h2>
|
||||
<div
|
||||
class="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
|
||||
class="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 sm:grid-cols-2 xl:grid-cols-4">
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold text-zinc-900 dark:text-white">Authentication</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Learn how to authenticate your
|
||||
<h3 class="text-sm font-semibold text-zinc-900 ">Authentication</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 ">Learn how to authenticate your
|
||||
API
|
||||
requests.</p>
|
||||
<p class="mt-4">
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-500"
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 "
|
||||
href="/reference/authentication">
|
||||
Read more
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
@@ -75,11 +75,11 @@
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold text-zinc-900 dark:text-white">Pagination</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Understand how to work with
|
||||
<h3 class="text-sm font-semibold text-zinc-900 ">Pagination</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 ">Understand how to work with
|
||||
paginated responses.</p>
|
||||
<p class="mt-4">
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-500"
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 "
|
||||
href="/reference/pagination">
|
||||
Read more
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
@@ -91,12 +91,12 @@
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold text-zinc-900 dark:text-white">Errors</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Read about the different types
|
||||
<h3 class="text-sm font-semibold text-zinc-900 ">Errors</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 ">Read about the different types
|
||||
of
|
||||
errors returned by the API.</p>
|
||||
<p class="mt-4">
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-500"
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 "
|
||||
href="/reference/errors">
|
||||
Read more
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
@@ -108,11 +108,11 @@
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold text-zinc-900 dark:text-white">Permissions</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Learn how API Key Permissions
|
||||
<h3 class="text-sm font-semibold text-zinc-900 ">Permissions</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 ">Learn how API Key Permissions
|
||||
work.</p>
|
||||
<p class="mt-4">
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-500"
|
||||
<a class="inline-flex gap-0.5 justify-center overflow-hidden font-medium transition text-emerald-500 hover:text-emerald-600 "
|
||||
href="/reference/permissions">
|
||||
Read more
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
@@ -130,16 +130,16 @@
|
||||
class="group text-inherit no-underline hover:text-inherit">Featured Resources</span>
|
||||
</h2>
|
||||
<div
|
||||
class="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
|
||||
class="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 sm:grid-cols-2 xl:grid-cols-4">
|
||||
|
||||
<% for(var i=0; i<pageData.featuredResources.length; i++) {%>
|
||||
<div
|
||||
class="cursor-pointer group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5">
|
||||
class="cursor-pointer group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 ">
|
||||
<div class="pointer-events-none">
|
||||
<div
|
||||
class="absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50">
|
||||
<svg aria-hidden="true"
|
||||
class="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5">
|
||||
class="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 /2.5">
|
||||
<defs>
|
||||
<pattern id=":r6t:" width="72" height="56" patternUnits="userSpaceOnUse"
|
||||
x="50%" y="16">
|
||||
@@ -154,7 +154,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div
|
||||
class="absolute inset-0 rounded-2xl bg-gradient-to-r from-[#D7EDEA] to-[#F4FBDF] opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#202D2E] dark:to-[#303428]"
|
||||
class="absolute inset-0 rounded-2xl bg-gradient-to-r from-[#D7EDEA] to-[#F4FBDF] opacity-0 transition duration-300 group-hover:opacity-100"
|
||||
data-projection-id="35"
|
||||
style="-webkit-mask-image: radial-gradient(180px at 0px 0px, white, transparent);">
|
||||
</div>
|
||||
@@ -163,7 +163,7 @@
|
||||
data-projection-id="36"
|
||||
style="-webkit-mask-image: radial-gradient(180px at 0px 0px, white, transparent);">
|
||||
<svg aria-hidden="true"
|
||||
class="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10">
|
||||
class="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 /10">
|
||||
<defs>
|
||||
<pattern id=":r6u:" width="72" height="56" patternUnits="userSpaceOnUse"
|
||||
x="50%" y="16">
|
||||
@@ -179,15 +179,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="absolute inset-0 rounded-2xl ring-1 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20">
|
||||
class="absolute inset-0 rounded-2xl ring-1 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 ">
|
||||
</div>
|
||||
<div class="relative rounded-2xl px-4 pt-16 pb-4">
|
||||
|
||||
<h3 class="mt-4 text-sm font-semibold leading-7 text-zinc-900 dark:text-white"><a
|
||||
<h3 class="mt-4 text-sm font-semibold leading-7 text-zinc-900 "><a
|
||||
href="/reference/<%= pageData.featuredResources[i].path -%>"><span
|
||||
class="absolute inset-0 rounded-2xl"></span> <%= pageData.featuredResources[i].name -%></a>
|
||||
</h3>
|
||||
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400"><%= pageData.featuredResources[i].description -%></p>
|
||||
<p class="mt-1 text-sm text-zinc-600 "><%= pageData.featuredResources[i].description -%></p>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<h1>
|
||||
<%= pageData.title -%>
|
||||
</h1>
|
||||
@@ -26,7 +26,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code"> <%= pageData.tablePermissions.read[i].permission -%></code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"><%= pageData.tablePermissions.read[i].title -%></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "><%= pageData.tablePermissions.read[i].title -%></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full text-sm flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p><%= pageData.tablePermissions.read[i].description -%></p>
|
||||
@@ -57,7 +57,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code"> <%= pageData.tablePermissions.create[i].permission -%></code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"><%= pageData.tablePermissions.create[i].title -%></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "><%= pageData.tablePermissions.create[i].title -%></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full text-sm flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p><%= pageData.tablePermissions.create[i].description -%></p>
|
||||
@@ -90,7 +90,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code"> <%= pageData.tablePermissions.update[i].permission -%></code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"><%= pageData.tablePermissions.update[i].title -%></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "><%= pageData.tablePermissions.update[i].title -%></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none text-sm [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p><%= pageData.tablePermissions.update[i].description -%></p>
|
||||
@@ -122,7 +122,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code"> <%= pageData.tablePermissions.delete[i].permission -%></code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"><%= pageData.tablePermissions.delete[i].title -%></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "><%= pageData.tablePermissions.delete[i].title -%></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full text-sm flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p><%= pageData.tablePermissions.delete[i].description -%></p>
|
||||
@@ -146,14 +146,14 @@
|
||||
<h3>Properties</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 w-full list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 w-full list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<% for(var i=0; i<Object.keys(pageData.columns).length; i++) {%>
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0 mt-5">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code"><%= Object.keys(pageData.columns)[i] -%></code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">
|
||||
<dd class="font-mono text-xs text-zinc-400 ">
|
||||
|
||||
<%= pageData.columns[Object.keys(pageData.columns)[i]].type -%>
|
||||
|
||||
@@ -242,10 +242,10 @@
|
||||
<div class="mt-10">
|
||||
<hr>
|
||||
<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 dark:ring-emerald-400/30 bg-emerald-400/10 text-emerald-500 dark:text-emerald-400">GET</span> <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="font-mono text-xs text-zinc-400">or</span> <span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 dark:ring-sky-400/30 bg-sky-400/10 text-sky-500 dark:text-sky-400">POST</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600"></span><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 -%>/get-list</span></div>
|
||||
<div class="-mt-20">
|
||||
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span class="group text-inherit no-underline hover:text-inherit">List</span></h2>
|
||||
@@ -257,14 +257,14 @@
|
||||
<h3>Optional Query Params</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Limit</dt>
|
||||
<dd><code class="inline-code">limit</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Number of objects to fetch. By default 10, you can increase this count up to 100</p>
|
||||
@@ -276,7 +276,7 @@
|
||||
<dt class="sr-only">Skip</dt>
|
||||
<dd><code class="inline-code">skip</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Number of objects to skip. This can be useful in pagination</p>
|
||||
@@ -288,13 +288,13 @@
|
||||
<h3>Optional Request Body</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>If you would like to filter on <%= pageData.title -%>. You can specify include a query here. For more information, <a class="link" target="_blank" href="/reference/data-types#queries">please check out writing queries here.</a></p>
|
||||
@@ -307,7 +307,7 @@
|
||||
<dt class="sr-only">Select</dt>
|
||||
<dd><code class="inline-code">select</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">select</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">select</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p> By default you will only retrieve ID of objects, to retrieve more fields you need to select them. For more information, <a class="link" target="_blank" href="/reference/data-types#select">please check how to select here.</a></p>
|
||||
@@ -319,7 +319,7 @@
|
||||
<dt class="sr-only">Sort</dt>
|
||||
<dd><code class="inline-code">sort</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">sort</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">sort</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p> Objects will be sorted based on created date by default. You can change the sort order by passing <a class="link" target="_blank" href="/reference/data-types#select">please check how to select here.</a></p>
|
||||
@@ -341,10 +341,10 @@
|
||||
<div class="mt-10">
|
||||
<hr>
|
||||
<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 dark:ring-emerald-400/30 bg-emerald-400/10 text-emerald-500 dark:text-emerald-400">GET</span> <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="font-mono text-xs text-zinc-400">or</span> <span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-sky-300 dark:ring-sky-400/30 bg-sky-400/10 text-sky-500 dark:text-sky-400">POST</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600"></span><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/get-item</span></div>
|
||||
<div class="-mt-20">
|
||||
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span class="group text-inherit no-underline hover:text-inherit"
|
||||
@@ -356,14 +356,14 @@
|
||||
<h3>Required Query Params</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">ID</dt>
|
||||
<dd><code class="inline-code">id</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">text</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">text</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>ID of the Object</p>
|
||||
@@ -375,14 +375,14 @@
|
||||
<h3>Optional Request Body</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Select</dt>
|
||||
<dd><code class="inline-code">select</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">select</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">select</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p> By default you will only retrieve ID of objects, to retrieve more fields you need to select them. For more information, <a class="link" target="_blank" href="/reference/data-types#select">please check how to select here.</a></p>
|
||||
@@ -408,8 +408,8 @@
|
||||
<div class="mt-10">
|
||||
<hr>
|
||||
<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 dark:ring-sky-400/30 bg-sky-400/10 text-sky-500 dark:text-sky-400">POST</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600"></span><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 -%>/count</span></div>
|
||||
<div class="-mt-20">
|
||||
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span class="group text-inherit no-underline hover:text-inherit"
|
||||
@@ -423,13 +423,13 @@
|
||||
<h3>Optional Request Body</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Query</dt>
|
||||
<dd><code class="inline-code">query</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">query</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">query</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>If you would like to filter on <%= pageData.title -%>. You can specify include a query here. For more information, <a class="link" target="_blank" href="/reference/data-types#queries">please check out writing queries here.</a></p>
|
||||
@@ -454,8 +454,8 @@
|
||||
<div class="mt-10">
|
||||
<hr>
|
||||
<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 dark:ring-sky-400/30 bg-sky-400/10 text-sky-500 dark:text-sky-400">POST</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600"></span><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 -%></span></div>
|
||||
<div class="-mt-20">
|
||||
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span class="group text-inherit no-underline hover:text-inherit"
|
||||
@@ -469,13 +469,13 @@
|
||||
<h3>Request Body</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Data</dt>
|
||||
<dd><code class="inline-code">data</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">JSON</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">JSON</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Object to update as JSON</p>
|
||||
@@ -501,8 +501,8 @@
|
||||
<div class="mt-10">
|
||||
<hr>
|
||||
<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-amber-300 dark:ring-amber-400/30 bg-amber-400/10 text-amber-500 dark:text-amber-400">PUT</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600"></span><span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-amber-300 bg-amber-400/10 text-amber-500 ">PUT</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</span></div>
|
||||
<div class="-mt-20">
|
||||
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span class="group text-inherit no-underline hover:text-inherit"
|
||||
@@ -516,13 +516,13 @@
|
||||
<h3>Request Body</h3>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Data</dt>
|
||||
<dd><code class="inline-code">data</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">JSON</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">JSON</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Object to update as JSON</p>
|
||||
@@ -547,8 +547,8 @@
|
||||
<div class="mt-10">
|
||||
<hr>
|
||||
<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-red-300 dark:ring-red-400/30 bg-red-400/10 text-red-500 dark:text-red-400">DELETE</span><span
|
||||
class="h-0.5 w-0.5 rounded-full bg-zinc-300 dark:bg-zinc-600"></span><span
|
||||
class="font-mono text-[0.625rem] font-semibold leading-6 rounded-lg px-1.5 ring-1 ring-inset ring-red-300 bg-red-400/10 text-red-500 ">DELETE</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</span></div>
|
||||
<div class="-mt-20">
|
||||
<h2 id="list-all-contacts" class="mt-2 scroll-mt-32"><span class="group text-inherit no-underline hover:text-inherit"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<h1>Pagination</h1>
|
||||
<p class="lead">In this guide, we will look at how to work with paginated responses when querying the OneUptime
|
||||
API. By default, all responses limit results to ten. </p>
|
||||
@@ -21,13 +21,13 @@
|
||||
</h2>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">limit</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Number of items you need to fetch. More items will lead to slower responses. Max limit is
|
||||
@@ -40,7 +40,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">skip</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Number of items to skip. This can be useful when you are paginating items.</p>
|
||||
@@ -54,13 +54,13 @@
|
||||
</h2>
|
||||
<div class="my-6">
|
||||
<ul role="list"
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 dark:divide-white/5">
|
||||
class="m-0 max-w-[calc(theme(maxWidth.lg)-theme(spacing.8))] list-none divide-y divide-zinc-900/5 p-0 ">
|
||||
<li class="m-0 px-0 py-4 first:pt-0 last:pb-0">
|
||||
<dl class="m-0 flex flex-wrap items-center gap-x-3 gap-y-2">
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">data</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">JSON Array</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">JSON Array</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>List of items fetched.</p>
|
||||
@@ -72,7 +72,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">count</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Total number of items in the database</p>
|
||||
@@ -84,7 +84,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">limit</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Number of items you need to fetch. More items will lead to slower responses. Max limit is
|
||||
@@ -97,7 +97,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code">skip</code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500">Number</dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 ">Number</dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p>Number of items to skip. This can be useful when you are paginating items.</p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<h1>Permissions</h1>
|
||||
<p class="lead"> Your API Token needs permissions to create, update, read or delete any resource. If you do not have permissions to make a request a <code class="inline-code">4xx</code> status will be sent as response. You can manage permissions for your API Key in Project Settings > API Keys. </p>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dt class="sr-only">Name</dt>
|
||||
<dd><code class="inline-code"> <%= pageData.permissions[i].permission -%></code></dd>
|
||||
<dt class="sr-only">Type</dt>
|
||||
<dd class="font-mono text-xs text-zinc-400 dark:text-zinc-500"><%= pageData.permissions[i].title -%></dd>
|
||||
<dd class="font-mono text-xs text-zinc-400 "><%= pageData.permissions[i].title -%></dd>
|
||||
<dt class="sr-only">Description</dt>
|
||||
<dd class="w-full flex-none [&>:first-child]:mt-0 [&>:last-child]:mb-0">
|
||||
<p><%= pageData.permissions[i].description -%></p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<main class="py-16">
|
||||
<article class="prose dark:prose-invert">
|
||||
<article class="prose ">
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<html lang="en" class="js-focus-visible ctshmsrlsm idc0_345">
|
||||
<%- include('../partials/head') -%>
|
||||
|
||||
<body onload="applyStyles()" class="bg-white antialiased dark:bg-zinc-900" data-new-gr-c-s-check-loaded="14.1095.0"
|
||||
<body onload="applyStyles()" class="bg-white antialiased " data-new-gr-c-s-check-loaded="14.1095.0"
|
||||
data-gr-ext-installed="">
|
||||
<div id="__next">
|
||||
<div class="lg:ml-72 xl:ml-80">
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<div class="not-prose my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md dark:ring-1 dark:ring-white/10">
|
||||
<div class="flex min-h-[calc(theme(spacing.12)+1px)] flex-wrap items-start gap-x-4 border-b border-zinc-700 bg-zinc-800 px-4 dark:border-zinc-800 dark:bg-transparent">
|
||||
<div class="not-prose my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md ">
|
||||
<div class="flex min-h-[calc(theme(spacing.12)+1px)] flex-wrap items-start gap-x-4 border-b border-zinc-700 bg-zinc-800 px-4 ">
|
||||
<h4 class="mr-auto text-xs font-semibold text-white mt-5"><%= title -%></h4>
|
||||
</div>
|
||||
<div class="group dark:bg-white/2.5">
|
||||
<div class="group ">
|
||||
|
||||
|
||||
<% if(requestType && requestUrl){ %>
|
||||
|
||||
<div class="flex h-9 items-center gap-2 border-b-white/7.5 bg-zinc-900 bg-white/2.5 px-4 dark:border-b-white/5 dark:bg-white/1 mb-2">
|
||||
<div class="flex h-9 items-center gap-2 border-b-white/7.5 bg-zinc-900 bg-white/2.5 px-4 ">
|
||||
<% if( requestType === "GET"){ %>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-emerald-500 dark:text-emerald-400">GET</span></div>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-emerald-500 ">GET</span></div>
|
||||
<% } %>
|
||||
<% if( requestType === "POST"){ %>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-sky-500 dark:text-sky-400">POST</span></div>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-sky-500 ">POST</span></div>
|
||||
<% } %>
|
||||
<% if( requestType === "DELETE"){ %>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-red-500 dark:text-red-400">DELETE</span></div>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-red-500 ">DELETE</span></div>
|
||||
<% } %>
|
||||
<% if( requestType === "PUT"){ %>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-amber-500 dark:text-amber-400">PUT</span></div>
|
||||
<div class="dark flex"><span class="font-mono text-sm font-semibold leading-6 text-amber-500 ">PUT</span></div>
|
||||
<% } %>
|
||||
<span class="h-0.5 w-0.5 rounded-full bg-zinc-500"></span><span class="font-mono text-sm text-zinc-300"><%= requestUrl -%></span>
|
||||
</div>
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
|
||||
<div
|
||||
class="flex flex-col items-center justify-between gap-5 border-t border-zinc-900/5 pt-8 dark:border-white/5 sm:flex-row">
|
||||
<p class="text-xs text-zinc-600 dark:text-zinc-400">
|
||||
class="flex flex-col items-center justify-between gap-5 border-t border-zinc-900/5 pt-8 sm:flex-row">
|
||||
<p class="text-xs text-zinc-600 ">
|
||||
OneUptime documentation is under MIT license. Please feel free to contribute and improve it on GitHub.
|
||||
</p>
|
||||
<div class="flex gap-4">
|
||||
<a class="group" href="https://twitter.com/OneUptimeHQ" target="_blank">
|
||||
<span class="sr-only">Follow us on Twitter</span>
|
||||
<svg viewBox="0 0 20 20" aria-hidden="true"
|
||||
class="h-5 w-5 fill-zinc-700 transition group-hover:fill-zinc-900 dark:group-hover:fill-zinc-500">
|
||||
class="h-5 w-5 fill-zinc-700 transition group-hover:fill-zinc-900 :fill-zinc-500">
|
||||
<path
|
||||
d="M16.712 6.652c.01.146.01.29.01.436 0 4.449-3.267 9.579-9.242 9.579v-.003a8.963 8.963 0 0 1-4.98-1.509 6.379 6.379 0 0 0 4.807-1.396c-1.39-.027-2.608-.966-3.035-2.337.487.097.99.077 1.467-.059-1.514-.316-2.606-1.696-2.606-3.3v-.041c.45.26.956.404 1.475.42C3.18 7.454 2.74 5.486 3.602 3.947c1.65 2.104 4.083 3.382 6.695 3.517a3.446 3.446 0 0 1 .94-3.217 3.172 3.172 0 0 1 4.596.148 6.38 6.38 0 0 0 2.063-.817 3.357 3.357 0 0 1-1.428 1.861 6.283 6.283 0 0 0 1.865-.53 6.735 6.735 0 0 1-1.62 1.744Z">
|
||||
</path>
|
||||
@@ -19,7 +19,7 @@
|
||||
<a class="group" href="https://github.com/oneuptime/oneuptime" target="_blank">
|
||||
<span class="sr-only">Follow us on GitHub</span>
|
||||
<svg viewBox="0 0 20 20" aria-hidden="true"
|
||||
class="h-5 w-5 fill-zinc-700 transition group-hover:fill-zinc-900 dark:group-hover:fill-zinc-500">
|
||||
class="h-5 w-5 fill-zinc-700 transition group-hover:fill-zinc-900 :fill-zinc-500">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M10 1.667c-4.605 0-8.334 3.823-8.334 8.544 0 3.78 2.385 6.974 5.698 8.106.417.075.573-.182.573-.406 0-.203-.011-.875-.011-1.592-2.093.397-2.635-.522-2.802-1.002-.094-.246-.5-1.005-.854-1.207-.291-.16-.708-.556-.01-.567.656-.01 1.124.62 1.281.876.75 1.292 1.948.93 2.427.705.073-.555.291-.93.531-1.143-1.854-.213-3.791-.95-3.791-4.218 0-.929.322-1.698.854-2.296-.083-.214-.375-1.09.083-2.265 0 0 .698-.224 2.292.876a7.576 7.576 0 0 1 2.083-.288c.709 0 1.417.096 2.084.288 1.593-1.11 2.291-.875 2.291-.875.459 1.174.167 2.05.084 2.263.53.599.854 1.357.854 2.297 0 3.278-1.948 4.005-3.802 4.219.302.266.563.78.563 1.58 0 1.143-.011 2.061-.011 2.35 0 .224.156.491.573.405a8.365 8.365 0 0 0 4.11-3.116 8.707 8.707 0 0 0 1.567-4.99c0-4.721-3.73-8.545-8.334-8.545Z">
|
||||
</path>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<header class="contents lg:pointer-events-none lg:fixed lg:inset-0 lg:z-40 lg:flex">
|
||||
<div
|
||||
class="contents lg:pointer-events-auto lg:block lg:w-72 lg:overflow-y-auto lg:border-r lg:border-zinc-900/10 lg:px-6 lg:pt-4 lg:pb-8 lg:dark:border-white/10 xl:w-80">
|
||||
class="contents lg:pointer-events-auto lg:block lg:w-72 lg:overflow-y-auto lg:border-r lg:border-zinc-900/10 lg:px-6 lg:pt-4 lg:pb-8 xl:w-80">
|
||||
<div class="hidden lg:flex">
|
||||
<a aria-label="Home" href="/">
|
||||
<svg class="h-6 -ml-48" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
@@ -101,26 +101,26 @@
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
<div class="fixed inset-x-0 top-0 z-50 flex h-14 border-b-2 items-center justify-between gap-12 px-4 transition sm:px-6 lg:left-72 lg:z-30 lg:px-8 xl:left-80 backdrop-blur-sm dark:backdrop-blur lg:left-72 xl:left-80 bg-white/[var(--bg-opacity-light)] dark:bg-zinc-900/[var(--bg-opacity-dark)]"
|
||||
style="--bg-opacity-light:0.5; --bg-opacity-dark:0.2;">
|
||||
<div class="absolute inset-x-0 top-full h-px transition bg-zinc-900/7.5 dark:bg-white/7.5"></div>
|
||||
<div class="fixed inset-x-0 top-0 z-50 flex h-14 border-b-2 items-center justify-between gap-12 px-4 transition sm:px-6 lg:left-72 lg:z-30 lg:px-8 xl:left-80 backdrop-blur-sm lg:left-72 xl:left-80 bg-white/[var(--bg-opacity-light)] /[var(--bg-opacity-dark)]"
|
||||
style="--bg-opacity-light:0.5; ">
|
||||
<div class="absolute inset-x-0 top-full h-px transition bg-zinc-900/7.5 "></div>
|
||||
<div class="hidden lg:block lg:max-w-md lg:flex-auto">
|
||||
<!-- <button type="button"
|
||||
class="hidden h-8 w-full items-center gap-2 rounded-full bg-white pl-2 pr-3 text-sm text-zinc-500 ring-1 ring-zinc-900/10 transition hover:ring-zinc-900/20 dark:bg-white/5 dark:text-zinc-400 dark:ring-inset dark:ring-white/10 dark:hover:ring-white/20 lg:flex focus:[&:not(:focus-visible)]:outline-none">
|
||||
class="hidden h-8 w-full items-center gap-2 rounded-full bg-white pl-2 pr-3 text-sm text-zinc-500 ring-1 ring-zinc-900/10 transition hover:ring-zinc-900/20 lg:flex focus:[&:not(:focus-visible)]:outline-none">
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true" class="h-5 w-5 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25"></path>
|
||||
</svg>
|
||||
Find something...<kbd class="ml-auto text-2xs text-zinc-400 dark:text-zinc-500"><kbd
|
||||
Find something...<kbd class="ml-auto text-2xs text-zinc-400 "><kbd
|
||||
class="font-sans">⌘</kbd><kbd class="font-sans">K</kbd></kbd>
|
||||
</button> -->
|
||||
</div>
|
||||
<div class="flex items-center gap-5 lg:hidden">
|
||||
<button type="button"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 dark:hover:bg-white/5"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 "
|
||||
aria-label="Toggle navigation">
|
||||
<svg viewBox="0 0 10 9" fill="none" stroke-linecap="round" aria-hidden="true"
|
||||
class="w-2.5 stroke-zinc-900 dark:stroke-white">
|
||||
class="w-2.5 stroke-zinc-900 ">
|
||||
<path d="M.5 1h9M.5 8h9M.5 4.5h9"></path>
|
||||
</svg>
|
||||
</button>
|
||||
@@ -129,7 +129,7 @@
|
||||
<path class="fill-emerald-400"
|
||||
d="M16 8a5 5 0 0 0-5-5H5a5 5 0 0 0-5 5v13.927a1 1 0 0 0 1.623.782l3.684-2.93a4 4 0 0 1 2.49-.87H11a5 5 0 0 0 5-5V8Z">
|
||||
</path>
|
||||
<path class="fill-zinc-900 dark:fill-white"
|
||||
<path class="fill-zinc-900 "
|
||||
d="M26.538 18h2.654v-3.999h2.576c2.672 0 4.456-1.723 4.456-4.333V9.65c0-2.61-1.784-4.333-4.456-4.333h-5.23V18Zm4.58-10.582c1.52 0 2.416.8 2.416 2.241v.018c0 1.441-.896 2.25-2.417 2.25h-1.925V7.418h1.925ZM38.051 18h2.566v-5.414c0-1.371.923-2.206 2.382-2.206.396 0 .791.061 1.178.15V8.287a3.843 3.843 0 0 0-.958-.123c-1.257 0-2.136.615-2.443 1.661h-.159V8.323h-2.566V18Zm11.55.202c2.979 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.773-5.036-2.953 0-4.772 1.916-4.772 5.036v.018c0 3.146 1.793 5.036 4.772 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.144-3.023 1.354 0 2.145 1.134 2.145 3.023v.018c0 1.907-.782 3.023-2.145 3.023Zm10.52 1.846c.492 0 .967-.053 1.283-.114v-1.907a6.057 6.057 0 0 1-.755.044c-.87 0-1.24-.387-1.24-1.257v-4.544h1.995V8.323H59.41V6.012h-2.592v2.311h-1.495v1.934h1.495v5.133c0 1.88.949 2.645 3.304 2.645Zm7.287.167c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.954 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.372 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023Zm10.767 2.013c2.522 0 4.034-1.353 4.297-3.463l.01-.053h-2.374l-.017.036c-.229.966-.853 1.467-1.908 1.467-1.37 0-2.135-1.08-2.135-3.04v-.018c0-1.934.755-3.006 2.135-3.006 1.099 0 1.74.615 1.908 1.556l.008.017h2.391v-.026c-.228-2.162-1.749-3.56-4.315-3.56-3.033 0-4.738 1.837-4.738 5.019v.017c0 3.217 1.714 5.054 4.738 5.054Zm10.257 0c2.98 0 4.772-1.88 4.772-5.036v-.018c0-3.128-1.82-5.036-4.772-5.036-2.953 0-4.773 1.916-4.773 5.036v.018c0 3.146 1.793 5.036 4.773 5.036Zm0-2.013c-1.371 0-2.145-1.116-2.145-3.023v-.018c0-1.89.782-3.023 2.145-3.023 1.353 0 2.144 1.134 2.144 3.023v.018c0 1.907-.782 3.023-2.144 3.023ZM95.025 18h2.566V4.623h-2.566V18Z">
|
||||
</path>
|
||||
</svg>
|
||||
@@ -138,26 +138,26 @@
|
||||
<div class="flex items-center gap-5">
|
||||
<nav class="hidden md:block">
|
||||
<ul role="list" class="flex items-center gap-8">
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
|
||||
href="/">Home</a></li>
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
|
||||
target="_blank"
|
||||
href="https://oneuptimesupport.slack.com/join/shared_invite/zt-1kavkds2f-gegm_wePorvwvM3M_SaoCQ#/shared-invite/email">Chat
|
||||
with us on Slack</a></li>
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
|
||||
href="/support">Support</a></li>
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
|
||||
href="https://github.com/oneuptime/oneuptime">GitHub</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="hidden md:block md:h-5 md:w-px md:bg-zinc-900/10 md:dark:bg-white/15"></div>
|
||||
<div class="hidden md:block md:h-5 md:w-px md:bg-zinc-900/10 md:"></div>
|
||||
<div class="flex gap-4">
|
||||
<div class="contents lg:hidden">
|
||||
<button type="button"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 dark:hover:bg-white/5 lg:hidden focus:[&:not(:focus-visible)]:outline-none"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 lg:hidden focus:[&:not(:focus-visible)]:outline-none"
|
||||
aria-label="Find something...">
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
class="h-5 w-5 stroke-zinc-900 dark:stroke-white">
|
||||
class="h-5 w-5 stroke-zinc-900 ">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25">
|
||||
</path>
|
||||
@@ -165,51 +165,51 @@
|
||||
</button>
|
||||
</div>
|
||||
<!-- <button type="button"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 dark:hover:bg-white/5"
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md transition hover:bg-zinc-900/5 "
|
||||
aria-label="Toggle dark mode">
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
class="h-5 w-5 stroke-zinc-900 dark:hidden">
|
||||
class="h-5 w-5 stroke-zinc-900 ">
|
||||
<path d="M12.5 10a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"></path>
|
||||
<path stroke-linecap="round"
|
||||
d="M10 5.5v-1M13.182 6.818l.707-.707M14.5 10h1M13.182 13.182l.707.707M10 15.5v-1M6.11 13.889l.708-.707M4.5 10h1M6.11 6.111l.708.707">
|
||||
</path>
|
||||
</svg>
|
||||
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"
|
||||
class="hidden h-5 w-5 stroke-white dark:block">
|
||||
class="hidden h-5 w-5 stroke-white ">
|
||||
<path d="M15.224 11.724a5.5 5.5 0 0 1-6.949-6.949 5.5 5.5 0 1 0 6.949 6.949Z"></path>
|
||||
</svg>
|
||||
</button> -->
|
||||
</div>
|
||||
<div class="hidden min-[416px]:contents"><a
|
||||
class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-1 dark:ring-inset dark:ring-emerald-400/20 dark:hover:bg-emerald-400/10 dark:hover:text-emerald-300 dark:hover:ring-emerald-300"
|
||||
class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 "
|
||||
href="/dashboard">Sign in</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="hidden lg:mt-10 lg:block">
|
||||
<ul role="list">
|
||||
<li class="md:hidden"><a
|
||||
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 "
|
||||
href="/">API</a></li>
|
||||
<li class="md:hidden"><a
|
||||
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 "
|
||||
href="/#">Documentation</a></li>
|
||||
<li class="md:hidden"><a
|
||||
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="block py-1 text-sm text-zinc-600 transition hover:text-zinc-900 "
|
||||
href="/#">Support</a></li>
|
||||
<li class="relative mt-6 md:mt-0">
|
||||
<h6 class="text-sm font-semibold text-zinc-900 dark:text-white">Guides</h6>
|
||||
<h6 class="text-sm font-semibold text-zinc-900 ">Guides</h6>
|
||||
<div class="relative mt-3 pl-2">
|
||||
<div class="absolute inset-x-0 top-0 bg-zinc-800/2.5 will-change-transform dark:bg-white/2.5"
|
||||
<div class="absolute inset-x-0 top-0 bg-zinc-800/2.5 will-change-transform "
|
||||
data-projection-id="32"
|
||||
style="height: 64px; top: 0px; border-radius: 8px; opacity: 1; transform: none; transform-origin: 50% 50% 0px;">
|
||||
</div>
|
||||
<div class="absolute inset-y-0 left-2 w-px bg-zinc-900/10 dark:bg-white/5"
|
||||
<div class="absolute inset-y-0 left-2 w-px bg-zinc-900/10 "
|
||||
style="transform: none; transform-origin: 50% 50% 0px;"></div>
|
||||
<div class="absolute left-2 h-6 w-px bg-emerald-500" data-projection-id="33"
|
||||
style="top: 4px; opacity: 1;"></div>
|
||||
<ul role="list" class="border-l border-transparent">
|
||||
<li class="relative">
|
||||
<a class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-900 dark:text-white"
|
||||
<a class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-900 "
|
||||
href="/reference/introduction" aria-current="page"><span
|
||||
class="truncate">Introduction</span></a>
|
||||
|
||||
@@ -217,19 +217,19 @@
|
||||
|
||||
|
||||
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
|
||||
href="/reference/authentication"><span class="truncate">Authentication</span></a></li>
|
||||
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
|
||||
href="/reference/pagination"><span class="truncate">Pagination</span></a></li>
|
||||
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
|
||||
href="/reference/permissions"><span class="truncate">Permissions</span></a></li>
|
||||
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
|
||||
href="/reference/data-types"><span class="truncate">Data Types</span></a></li>
|
||||
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
|
||||
href="/reference/errors"><span class="truncate">Errors</span></a></li>
|
||||
|
||||
|
||||
@@ -237,15 +237,15 @@
|
||||
</div>
|
||||
</li>
|
||||
<li class="relative mt-6">
|
||||
<h6 class="text-sm font-semibold text-zinc-900 dark:text-white"
|
||||
<h6 class="text-sm font-semibold text-zinc-900 "
|
||||
style="transform: none; transform-origin: 50% 50% 0px;">Resources</h6>
|
||||
<div class="relative mt-3 pl-2">
|
||||
<div class="absolute inset-y-0 left-2 w-px bg-zinc-900/10 dark:bg-white/5"
|
||||
<div class="absolute inset-y-0 left-2 w-px bg-zinc-900/10 "
|
||||
style="transform: none; transform-origin: 50% 50% 0px;"></div>
|
||||
<ul role="list" class="border-l border-transparent">
|
||||
<% for(var i=0; i<resources.length; i++) {%>
|
||||
<li class="relative" style="transform: none; transform-origin: 50% 50% 0px;"><a
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
||||
class="flex justify-between gap-2 py-1 pr-3 text-sm transition pl-4 text-zinc-600 hover:text-zinc-900 "
|
||||
href="/reference/<%= resources[i].path -%>"><span class="truncate">
|
||||
<%= resources[i].name -%>
|
||||
</span></a></li>
|
||||
@@ -255,7 +255,7 @@
|
||||
</div>
|
||||
</li>
|
||||
<li class="sticky bottom-0 z-10 mt-6 min-[416px]:hidden"><a
|
||||
class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 dark:bg-emerald-500 dark:text-white dark:hover:bg-emerald-400 w-full"
|
||||
class="inline-flex gap-0.5 justify-center overflow-hidden text-sm font-medium transition rounded-full bg-zinc-900 py-1 px-3 text-white hover:bg-zinc-700 :bg-emerald-400 w-full"
|
||||
href="/#">Sign in</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -5,4 +5,5 @@ SUBSCRIPTION_PLAN_BASIC={{ .Env.SUBSCRIPTION_PLAN_BASIC }}
|
||||
SUBSCRIPTION_PLAN_GROWTH={{ .Env.SUBSCRIPTION_PLAN_GROWTH }}
|
||||
SUBSCRIPTION_PLAN_SCALE={{ .Env.SUBSCRIPTION_PLAN_SCALE }}
|
||||
SUBSCRIPTION_PLAN_ENTERPRISE={{ .Env.SUBSCRIPTION_PLAN_ENTERPRISE }}
|
||||
METERED_PLAN_ACTIVE_MONITORING={{ .Env.METERED_PLAN_ACTIVE_MONITORING }}
|
||||
DOMAIN={{ .Env.DOMAIN }}
|
||||
298
Common/Tests/Types/Billing/SubscriptionPlan.test.ts
Normal file
298
Common/Tests/Types/Billing/SubscriptionPlan.test.ts
Normal file
@@ -0,0 +1,298 @@
|
||||
import SubscriptionPlan, {
|
||||
PlanSelect,
|
||||
} from '../../../Types/Billing/SubscriptionPlan';
|
||||
import { JSONObject } from '../../../Types/JSON';
|
||||
import BadDataException from '../../../Types/Exception/BadDataException';
|
||||
|
||||
describe('SubscriptionPlan', () => {
|
||||
const monthlyPlanId: string = 'monthly_plan_id';
|
||||
const yearlyPlanId: string = 'yearly_plan_id';
|
||||
const name: string = 'Test Plan';
|
||||
const monthlySubscriptionAmountInUSD: number = 0;
|
||||
const yearlySubscriptionAmountInUSD: number = 0;
|
||||
const order: number = 1;
|
||||
const trialPeriodInDays: number = 30;
|
||||
const env: JSONObject = {
|
||||
SUBSCRIPTION_PLAN_1: 'Free,monthly_plan_id,yearly_plan_id,0,0,1,7',
|
||||
SUBSCRIPTION_PLAN_2:
|
||||
'Growth,growth_monthly_plan_id,growth_yearly_plan_id,9,99,2,14',
|
||||
};
|
||||
|
||||
describe('constructor', () => {
|
||||
it('should create a new SubscriptionPlan object', () => {
|
||||
const plan: SubscriptionPlan = new SubscriptionPlan(
|
||||
monthlyPlanId,
|
||||
yearlyPlanId,
|
||||
name,
|
||||
monthlySubscriptionAmountInUSD,
|
||||
yearlySubscriptionAmountInUSD,
|
||||
order,
|
||||
trialPeriodInDays
|
||||
);
|
||||
expect(plan.getMonthlyPlanId()).toEqual(monthlyPlanId);
|
||||
expect(plan.getYearlyPlanId()).toEqual(yearlyPlanId);
|
||||
expect(plan.getName()).toEqual(name);
|
||||
expect(plan.getPlanOrder()).toEqual(order);
|
||||
expect(plan.getTrialPeriod()).toEqual(trialPeriodInDays);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getMonthlyPlanId', () => {
|
||||
it('should return the monthly plan ID', () => {
|
||||
const getMonthlyPlanId: string = 'monthly_plan_id';
|
||||
expect(getMonthlyPlanId).toEqual(monthlyPlanId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getYearlyPlanId', () => {
|
||||
it('should return the yearly plan ID', () => {
|
||||
const getYearlyPlanId: string = 'yearly_plan_id';
|
||||
expect(getYearlyPlanId).toEqual(yearlyPlanId);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPlanOrder', () => {
|
||||
it('should return the plan order', () => {
|
||||
const getPlanOrder: number = 1;
|
||||
expect(getPlanOrder).toEqual(order);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getTrialPeriod', () => {
|
||||
it('should return the trial period in days', () => {
|
||||
const getTrialPeriod: number = 30;
|
||||
expect(getTrialPeriod).toEqual(trialPeriodInDays);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getName', () => {
|
||||
it('should return the plan name', () => {
|
||||
const getName: string = 'Test Plan';
|
||||
expect(getName).toEqual(name);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isFreePlan', () => {
|
||||
it('should return true if plan is free with monthlyId', () => {
|
||||
const isFreePlan: boolean = SubscriptionPlan.isFreePlan(
|
||||
'monthly_plan_id',
|
||||
env
|
||||
);
|
||||
expect(isFreePlan).toBe(true);
|
||||
});
|
||||
it('should return true if plan is free with yearlyId', () => {
|
||||
const isFreePlan: boolean = SubscriptionPlan.isFreePlan(
|
||||
'yearly_plan_id',
|
||||
env
|
||||
);
|
||||
expect(isFreePlan).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('isCustomPricingPlan', () => {
|
||||
it('should return false if plan is not custom pricing', () => {
|
||||
const isCustomPricingPlan: boolean =
|
||||
SubscriptionPlan.isCustomPricingPlan(monthlyPlanId, env);
|
||||
expect(isCustomPricingPlan).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getSubscriptionPlans', () => {
|
||||
it('should return an array of SubscriptionPlan objects', () => {
|
||||
const subscriptionPlans: SubscriptionPlan[] =
|
||||
SubscriptionPlan.getSubscriptionPlans(env);
|
||||
|
||||
expect(subscriptionPlans.length).toBe(2);
|
||||
expect(subscriptionPlans?.[0]?.getName()).toBe('Free');
|
||||
expect(subscriptionPlans?.[0]?.getYearlyPlanId()).toBe(
|
||||
'yearly_plan_id'
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('isValidPlanId', () => {
|
||||
it('should return true if plan ID is valid', () => {
|
||||
const isValidPlanId: boolean = SubscriptionPlan.isValidPlanId(
|
||||
'growth_monthly_plan_id',
|
||||
env
|
||||
);
|
||||
expect(isValidPlanId).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('getPlanSelect', () => {
|
||||
it('should return the plan name if valid planId is passed', () => {
|
||||
new SubscriptionPlan(
|
||||
monthlyPlanId,
|
||||
'yearly_plan_id',
|
||||
PlanSelect.Free,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
30
|
||||
);
|
||||
const result: PlanSelect = SubscriptionPlan.getPlanSelect(
|
||||
monthlyPlanId,
|
||||
env
|
||||
);
|
||||
expect(result).toBe(PlanSelect.Free);
|
||||
});
|
||||
it('should throw an error if invalid PlanId is passed', () => {
|
||||
SubscriptionPlan.getSubscriptionPlanById = jest
|
||||
.fn()
|
||||
.mockReturnValue(undefined);
|
||||
expect(() => {
|
||||
SubscriptionPlan.getPlanSelect('invalid-plan-id', env);
|
||||
}).toThrow(BadDataException);
|
||||
});
|
||||
});
|
||||
describe('getYearlySubscriptionAmountInUSD', () => {
|
||||
it('should return the yearly subscription amount', () => {
|
||||
const getYearlySubscriptionAmountInUSD: number = 0;
|
||||
expect(getYearlySubscriptionAmountInUSD).toEqual(
|
||||
yearlySubscriptionAmountInUSD
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('getMonthlySubscriptionAmountInUSD', () => {
|
||||
it('should return the yearly subscription amount', () => {
|
||||
const getMonthlySubscriptionAmountInUSD: number = 0;
|
||||
expect(getMonthlySubscriptionAmountInUSD).toEqual(
|
||||
monthlySubscriptionAmountInUSD
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('isFeatureAccessibleOnCurrentPlan', () => {
|
||||
it('should return false if the feature is not accessible on current plan', () => {
|
||||
const env: JSONObject = {
|
||||
SUBSCRIPTION_PLAN_1:
|
||||
'Free,monthly_plan_id,yearly_plan_id,0,0,1,7',
|
||||
SUBSCRIPTION_PLAN_2:
|
||||
'Growth,growth_monthly_plan_id,growth_yearly_plan_id,9,99,2,14',
|
||||
};
|
||||
const featureSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
'growth_monthly_plan_id',
|
||||
'growth_yearly_plan_id',
|
||||
PlanSelect.Growth,
|
||||
9,
|
||||
99,
|
||||
2,
|
||||
14
|
||||
);
|
||||
const currentSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
'monthly_plan_id',
|
||||
'yearly_plan_id',
|
||||
PlanSelect.Free,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
7
|
||||
);
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
||||
PlanSelect.Growth,
|
||||
PlanSelect.Free,
|
||||
env
|
||||
);
|
||||
expect(featureSubscriptionPlan.getPlanOrder()).toBeGreaterThan(
|
||||
currentSubscriptionPlan.getPlanOrder()
|
||||
);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
it('should return true if the feature is on the current plan', () => {
|
||||
const env: JSONObject = {
|
||||
SUBSCRIPTION_PLAN_1:
|
||||
'Free,monthly_plan_id,yearly_plan_id,0,0,3,7',
|
||||
SUBSCRIPTION_PLAN_2:
|
||||
'Growth,growth_monthly_plan_id,growth_yearly_plan_id,9,99,2,14',
|
||||
};
|
||||
const featureSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
'growth_monthly_plan_id',
|
||||
'growth_yearly_plan_id',
|
||||
PlanSelect.Growth,
|
||||
9,
|
||||
99,
|
||||
2,
|
||||
14
|
||||
);
|
||||
const currentSubscriptionPlan: SubscriptionPlan =
|
||||
new SubscriptionPlan(
|
||||
monthlyPlanId,
|
||||
'yearly_plan_id',
|
||||
PlanSelect.Free,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
7
|
||||
);
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
|
||||
PlanSelect.Growth,
|
||||
PlanSelect.Free,
|
||||
env
|
||||
);
|
||||
expect(featureSubscriptionPlan.getPlanOrder()).toBeLessThan(
|
||||
currentSubscriptionPlan.getPlanOrder()
|
||||
);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
describe('getSubscriptionPlanFromPlanSelect', () => {
|
||||
it('should return the correct SubscriptionPlan when a valid planSelect is provided', () => {
|
||||
const plan: SubscriptionPlan =
|
||||
SubscriptionPlan.getSubscriptionPlanFromPlanSelect(
|
||||
PlanSelect.Growth,
|
||||
env
|
||||
);
|
||||
expect(plan).toEqual(plan);
|
||||
expect(plan.getName()).toEqual(PlanSelect.Growth);
|
||||
});
|
||||
it('should throw a BadDataException when an invalid planSelect is provided', () => {
|
||||
const planSelect: PlanSelect = PlanSelect.Scale;
|
||||
SubscriptionPlan.getSubscriptionPlans = jest
|
||||
.fn()
|
||||
.mockReturnValue([]);
|
||||
expect(() => {
|
||||
SubscriptionPlan.getSubscriptionPlanFromPlanSelect(
|
||||
planSelect,
|
||||
env
|
||||
);
|
||||
}).toThrow(BadDataException);
|
||||
});
|
||||
});
|
||||
describe('isYearlyPlan', () => {
|
||||
it('should return true if yearly plan exists', () => {
|
||||
const planId: string = 'growth_yearly_plan_id';
|
||||
const plan: SubscriptionPlan = new SubscriptionPlan(
|
||||
'monthly-plan-id',
|
||||
planId,
|
||||
'Growth',
|
||||
10,
|
||||
100,
|
||||
2,
|
||||
7
|
||||
);
|
||||
SubscriptionPlan.getSubscriptionPlanById(planId, env);
|
||||
expect(plan?.getYearlyPlanId()).toBe(planId);
|
||||
});
|
||||
});
|
||||
describe('isUnpaid', () => {
|
||||
it('should return true if the subscription status is unpaid', () => {
|
||||
const subscriptionStatus: string =
|
||||
'incomplete' ||
|
||||
'ncomplete_expired' ||
|
||||
'past_due' ||
|
||||
'canceled' ||
|
||||
'unpaid';
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isUnpaid(subscriptionStatus);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
it('should return false if the subscription status is active', () => {
|
||||
const subscriptionStatus: string = 'active';
|
||||
const result: boolean =
|
||||
SubscriptionPlan.isUnpaid(subscriptionStatus);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -38,11 +38,7 @@ describe('IP()', () => {
|
||||
});
|
||||
|
||||
test('should return a string', () => {
|
||||
expect(IP.toDatabase('127.0.0.1')).toBe('127.0.0.1');
|
||||
});
|
||||
|
||||
test('should return null', () => {
|
||||
expect(IP.toDatabase('')).toBeNull();
|
||||
expect(IP.toDatabase(new IP('127.0.0.1'))).toBe('127.0.0.1');
|
||||
});
|
||||
|
||||
test('should be an instance IP', () => {
|
||||
|
||||
@@ -3,6 +3,7 @@ import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import Port from '../Port';
|
||||
import Typeof from '../Typeof';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
|
||||
export default class Hostname extends DatabaseProperty {
|
||||
private _route: string = '';
|
||||
@@ -50,6 +51,21 @@ export default class Hostname extends DatabaseProperty {
|
||||
}
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Hostname,
|
||||
value: (this as Hostname).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Hostname {
|
||||
if (json['_type'] === ObjectType.Hostname) {
|
||||
return new Hostname((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
let hostame: string = this.hostname;
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
export default class Route {
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
|
||||
export default class Route extends DatabaseProperty {
|
||||
private _route: string = '';
|
||||
public get route(): string {
|
||||
return this._route;
|
||||
@@ -14,6 +18,7 @@ export default class Route {
|
||||
}
|
||||
|
||||
public constructor(route?: string | Route) {
|
||||
super();
|
||||
if (route && route instanceof Route) {
|
||||
route = route.toString();
|
||||
}
|
||||
@@ -23,6 +28,21 @@ export default class Route {
|
||||
}
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Route,
|
||||
value: (this as Route).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Route {
|
||||
if (json['_type'] === ObjectType.Route) {
|
||||
return new Route((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public addRoute(route: Route | string): Route {
|
||||
if (typeof route === 'string') {
|
||||
route = new Route(route);
|
||||
@@ -36,7 +56,7 @@ export default class Route {
|
||||
return this;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.route;
|
||||
}
|
||||
|
||||
@@ -48,4 +68,22 @@ export default class Route {
|
||||
this.route = this.route.replace(paramName, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public static override toDatabase(
|
||||
value: Route | FindOperator<Route>
|
||||
): string | null {
|
||||
if (value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static override fromDatabase(_value: string): Route | null {
|
||||
if (_value) {
|
||||
return new Route(_value);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,10 @@ export default class StatusCode {
|
||||
statusCode = parseInt(statusCode as string);
|
||||
}
|
||||
|
||||
if (statusCode >= 100 && statusCode <= 599) {
|
||||
if (
|
||||
(statusCode as number) >= 100 &&
|
||||
(statusCode as number) <= 599
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { FindOperator } from 'typeorm';
|
||||
import Dictionary from '../Dictionary';
|
||||
import Typeof from '../Typeof';
|
||||
import Email from '../Email';
|
||||
import { JSONObject } from '../JSON';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
|
||||
export default class URL extends DatabaseProperty {
|
||||
@@ -182,23 +182,19 @@ export default class URL extends DatabaseProperty {
|
||||
return URL.fromString(this.toString().split('?')[0] || '');
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
value: this.toString(),
|
||||
_type: 'URL',
|
||||
_type: ObjectType.URL,
|
||||
value: (this as URL).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static fromJSON(json: JSONObject): URL {
|
||||
if (json && json['_type'] !== 'URL') {
|
||||
throw new BadDataException('Invalid JSON for URL');
|
||||
public static override fromJSON(json: JSONObject): URL {
|
||||
if (json['_type'] === ObjectType.URL) {
|
||||
return URL.fromString((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
if (json && json['value'] && typeof json['value'] === Typeof.String) {
|
||||
throw new BadDataException('Invalid JSON for URL');
|
||||
}
|
||||
|
||||
return URL.fromString(json['value'] as string);
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public addRoute(route: Route | string): URL {
|
||||
|
||||
@@ -26,4 +26,29 @@ export default class ArrayUtil {
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
public static distinctByFieldName(
|
||||
array: Array<any>,
|
||||
fieldName: string
|
||||
): Array<any> {
|
||||
// Get the distinct values by field name of the array
|
||||
const distinctValues: Array<any> = array
|
||||
.map((item: any) => {
|
||||
return item[fieldName];
|
||||
})
|
||||
.filter((value: any, index: number, self: Array<any>) => {
|
||||
return self.indexOf(value) === index;
|
||||
});
|
||||
|
||||
// Create a new array with the distinct values
|
||||
const distinctArray: Array<any> = [];
|
||||
for (const value of distinctValues) {
|
||||
const item: any = array.find((item: any) => {
|
||||
return item[fieldName] === value;
|
||||
});
|
||||
distinctArray.push(item);
|
||||
}
|
||||
|
||||
return distinctArray;
|
||||
}
|
||||
}
|
||||
|
||||
35
Common/Types/Billing/MeteredPlan.ts
Normal file
35
Common/Types/Billing/MeteredPlan.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export default class MeteredPlan {
|
||||
private monthlyPriceId: string;
|
||||
private yearlyPriceId: string;
|
||||
private unitName: string;
|
||||
private pricePerUnit: number;
|
||||
|
||||
public constructor(
|
||||
monthlyPriceId: string,
|
||||
yearlyPriceId: string,
|
||||
pricePerUnit: number,
|
||||
unitName: string
|
||||
) {
|
||||
this.monthlyPriceId = monthlyPriceId;
|
||||
this.yearlyPriceId = yearlyPriceId;
|
||||
|
||||
this.pricePerUnit = pricePerUnit;
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
public getMonthlyPriceId(): string {
|
||||
return this.monthlyPriceId;
|
||||
}
|
||||
|
||||
public getYearlyPriceId(): string {
|
||||
return this.yearlyPriceId;
|
||||
}
|
||||
|
||||
public getPricePerUnit(): number {
|
||||
return this.pricePerUnit;
|
||||
}
|
||||
|
||||
public getUnitName(): string {
|
||||
return this.unitName;
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export default class SubscriptionPlan {
|
||||
}
|
||||
|
||||
public static getSubscriptionPlans(
|
||||
env: JSONObject
|
||||
env?: JSONObject | undefined
|
||||
): Array<SubscriptionPlan> {
|
||||
const plans: Array<SubscriptionPlan> = [];
|
||||
|
||||
@@ -144,7 +144,7 @@ export default class SubscriptionPlan {
|
||||
|
||||
public static getSubscriptionPlanById(
|
||||
planId: string,
|
||||
env: JSONObject
|
||||
env?: JSONObject | undefined
|
||||
): SubscriptionPlan | undefined {
|
||||
const plans: Array<SubscriptionPlan> = this.getSubscriptionPlans(env);
|
||||
return plans.find((plan: SubscriptionPlan) => {
|
||||
@@ -155,11 +155,17 @@ export default class SubscriptionPlan {
|
||||
});
|
||||
}
|
||||
|
||||
public static isValidPlanId(planId: string, env: JSONObject): boolean {
|
||||
public static isValidPlanId(
|
||||
planId: string,
|
||||
env?: JSONObject | undefined
|
||||
): boolean {
|
||||
return Boolean(this.getSubscriptionPlanById(planId, env));
|
||||
}
|
||||
|
||||
public static getPlanSelect(planId: string, env: JSONObject): PlanSelect {
|
||||
public static getPlanSelect(
|
||||
planId: string,
|
||||
env?: JSONObject | undefined
|
||||
): PlanSelect {
|
||||
const plan: SubscriptionPlan | undefined = this.getSubscriptionPlanById(
|
||||
planId,
|
||||
env
|
||||
@@ -173,7 +179,7 @@ export default class SubscriptionPlan {
|
||||
|
||||
public static getSubscriptionPlanFromPlanSelect(
|
||||
planSelect: PlanSelect,
|
||||
env: JSONObject
|
||||
env?: JSONObject | undefined
|
||||
): SubscriptionPlan {
|
||||
const plan: SubscriptionPlan | undefined = this.getSubscriptionPlans(
|
||||
env
|
||||
@@ -191,7 +197,7 @@ export default class SubscriptionPlan {
|
||||
public static isFeatureAccessibleOnCurrentPlan(
|
||||
featurePlan: PlanSelect,
|
||||
currentPlan: PlanSelect,
|
||||
env: JSONObject
|
||||
env?: JSONObject | undefined
|
||||
): boolean {
|
||||
const featureSubscriptionPlan: SubscriptionPlan | undefined =
|
||||
this.getSubscriptionPlanFromPlanSelect(featurePlan, env);
|
||||
@@ -208,7 +214,10 @@ export default class SubscriptionPlan {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static isYearlyPlan(planId: string, env: JSONObject): boolean {
|
||||
public static isYearlyPlan(
|
||||
planId: string,
|
||||
env?: JSONObject | undefined
|
||||
): boolean {
|
||||
const plan: SubscriptionPlan | undefined = this.getSubscriptionPlanById(
|
||||
planId,
|
||||
env
|
||||
|
||||
11
Common/Types/Billing/SubscriptionStatus.ts
Normal file
11
Common/Types/Billing/SubscriptionStatus.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
enum SubscriptionStatus {
|
||||
Incomplete = 'incomplete',
|
||||
IncompleteExpired = 'incomplete_expired',
|
||||
Trialing = 'trialing',
|
||||
Active = 'active',
|
||||
PastDue = 'past_due',
|
||||
Canceled = 'canceled',
|
||||
Unpaid = 'unpaid',
|
||||
}
|
||||
|
||||
export default SubscriptionStatus;
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export interface RGB {
|
||||
red: number;
|
||||
@@ -26,6 +27,21 @@ export default class Color extends DatabaseProperty {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Color,
|
||||
value: (this as Color).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Color {
|
||||
if (json['_type'] === ObjectType.Color) {
|
||||
return new Color((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public static override toDatabase(
|
||||
value: Color | FindOperator<Color>
|
||||
): string | null {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
import Typeof from '../Typeof';
|
||||
|
||||
export default class CompareBase {
|
||||
export default class CompareBase extends SerializableObject {
|
||||
private _value!: number | Date;
|
||||
public get value(): number | Date {
|
||||
return this._value;
|
||||
@@ -11,10 +12,11 @@ export default class CompareBase {
|
||||
}
|
||||
|
||||
public constructor(value: number | Date) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ import { FindOperator } from 'typeorm';
|
||||
import { ValueTransformer } from 'typeorm/decorator/options/ValueTransformer';
|
||||
import NotImplementedException from '../Exception/NotImplementedException';
|
||||
import { JSONArray, JSONObject } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class DatabaseProperty {
|
||||
public constructor() {}
|
||||
export default class DatabaseProperty extends SerializableObject {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected static fromDatabase(
|
||||
_value: string | number | JSONObject | JSONArray
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export default class EqualToOrNull {
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class EqualToOrNull extends SerializableObject {
|
||||
private _value!: string;
|
||||
public get value(): string {
|
||||
return this._value;
|
||||
@@ -8,10 +12,26 @@ export default class EqualToOrNull {
|
||||
}
|
||||
|
||||
public constructor(value: string) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.EqualToOrNull,
|
||||
value: (this as EqualToOrNull).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): EqualToOrNull {
|
||||
if (json['_type'] === ObjectType.EqualToOrNull) {
|
||||
return new EqualToOrNull(json['value'] as string);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class GreaterThan extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.GreaterThan,
|
||||
value: (this as GreaterThan).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): GreaterThan {
|
||||
if (json['_type'] === ObjectType.GreaterThan) {
|
||||
return new GreaterThan(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class GreaterThanOrEqual extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.GreaterThanOrEqual,
|
||||
value: (this as GreaterThanOrEqual).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): GreaterThanOrEqual {
|
||||
if (json['_type'] === ObjectType.GreaterThanOrEqual) {
|
||||
return new GreaterThanOrEqual(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import OneUptimeDate from '../Date';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class InBetween {
|
||||
export default class InBetween extends SerializableObject {
|
||||
private _startValue!: number | Date | string;
|
||||
public get startValue(): number | Date | string {
|
||||
return this._startValue;
|
||||
@@ -21,11 +24,31 @@ export default class InBetween {
|
||||
startValue: number | Date | string,
|
||||
endValue: number | Date | string
|
||||
) {
|
||||
super();
|
||||
this.endValue = endValue;
|
||||
this.startValue = startValue;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.InBetween,
|
||||
startValue: (this as InBetween).startValue,
|
||||
endValue: (this as InBetween).endValue,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): InBetween {
|
||||
if (json['_type'] === ObjectType.InBetween) {
|
||||
return new InBetween(
|
||||
json['startValue'] as number | Date | string,
|
||||
json['endValue'] as number | Date | string
|
||||
);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
let startValue: number | Date | string = this.startValue;
|
||||
let endValue: number | Date | string = this.endValue;
|
||||
|
||||
|
||||
28
Common/Types/Database/IsNull.ts
Normal file
28
Common/Types/Database/IsNull.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class IsNull extends SerializableObject {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.IsNull,
|
||||
value: null,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): IsNull {
|
||||
if (json['_type'] === ObjectType.IsNull) {
|
||||
return new IsNull();
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class LessThan extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.LessThan,
|
||||
value: (this as LessThan).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): LessThan {
|
||||
if (json['_type'] === ObjectType.LessThan) {
|
||||
return new LessThan(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import CompareBase from './CompareBase';
|
||||
|
||||
export default class LessThanOrEqual extends CompareBase {
|
||||
public constructor(value: number | Date) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.LessThanOrEqual,
|
||||
value: (this as LessThanOrEqual).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): LessThanOrEqual {
|
||||
if (json['_type'] === ObjectType.LessThanOrEqual) {
|
||||
return new LessThanOrEqual(json['value'] as number | Date);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export default class NotEqual {
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class NotEqual extends SerializableObject {
|
||||
private _value!: string;
|
||||
public get value(): string {
|
||||
return this._value;
|
||||
@@ -8,10 +12,26 @@ export default class NotEqual {
|
||||
}
|
||||
|
||||
public constructor(value: string) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.NotEqual,
|
||||
value: (this as NotEqual).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): NotEqual {
|
||||
if (json['_type'] === ObjectType.NotEqual) {
|
||||
return new NotEqual(json['value'] as string);
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,28 @@
|
||||
export default class NotNull {
|
||||
public constructor() {}
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
public toString(): string {
|
||||
export default class NotNull extends SerializableObject {
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.NotNull,
|
||||
value: null,
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): NotNull {
|
||||
if (json['_type'] === ObjectType.NotNull) {
|
||||
return new NotNull();
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,39 @@
|
||||
export default class Search {
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import SerializableObject from '../SerializableObject';
|
||||
|
||||
export default class Search extends SerializableObject {
|
||||
private _searchValue!: string;
|
||||
|
||||
public get value(): string {
|
||||
return this._searchValue;
|
||||
}
|
||||
|
||||
public set value(v: string) {
|
||||
this._searchValue = v;
|
||||
}
|
||||
|
||||
public constructor(value: string) {
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Search,
|
||||
value: (this as Search).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Search {
|
||||
if (json['_type'] === ObjectType.Search) {
|
||||
return new Search((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject } from './JSON';
|
||||
import PositiveNumber from './PositiveNumber';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
@@ -27,6 +29,7 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static getSecondsTo(date: Date): number {
|
||||
date = this.fromString(date);
|
||||
const dif: number = date.getTime() - this.getCurrentDate().getTime();
|
||||
const Seconds_from_T1_to_T2: number = dif / 1000;
|
||||
return Math.abs(Seconds_from_T1_to_T2);
|
||||
@@ -43,10 +46,12 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static timezoneOffsetDate(date: Date): Date {
|
||||
date = this.fromString(date);
|
||||
return this.addRemoveMinutes(date, date.getTimezoneOffset());
|
||||
}
|
||||
|
||||
public static toDateTimeLocalString(date: Date): string {
|
||||
date = this.fromString(date);
|
||||
const ten: Function = (i: number): string => {
|
||||
return (i < 10 ? '0' : '') + i;
|
||||
},
|
||||
@@ -61,6 +66,7 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static addRemoveMinutes(date: Date, minutes: number): Date {
|
||||
date = this.fromString(date);
|
||||
return moment(date).add(minutes, 'minutes').toDate();
|
||||
}
|
||||
|
||||
@@ -93,6 +99,7 @@ export default class OneUptimeDate {
|
||||
date: Date,
|
||||
days: PositiveNumber | number
|
||||
): Date {
|
||||
date = this.fromString(date);
|
||||
if (!(days instanceof PositiveNumber)) {
|
||||
days = new PositiveNumber(days);
|
||||
}
|
||||
@@ -105,6 +112,7 @@ export default class OneUptimeDate {
|
||||
date: Date,
|
||||
days: PositiveNumber | number
|
||||
): Date {
|
||||
date = this.fromString(date);
|
||||
if (!(days instanceof PositiveNumber)) {
|
||||
days = new PositiveNumber(days);
|
||||
}
|
||||
@@ -115,6 +123,7 @@ export default class OneUptimeDate {
|
||||
date: Date,
|
||||
days: PositiveNumber | number
|
||||
): Date {
|
||||
date = this.fromString(date);
|
||||
if (!(days instanceof PositiveNumber)) {
|
||||
days = new PositiveNumber(days);
|
||||
}
|
||||
@@ -212,6 +221,8 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static getGreaterDate(a: Date, b: Date): Date {
|
||||
a = this.fromString(a);
|
||||
b = this.fromString(b);
|
||||
if (this.isAfter(a, b)) {
|
||||
return a;
|
||||
}
|
||||
@@ -220,6 +231,8 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static getLesserDate(a: Date, b: Date): Date {
|
||||
a = this.fromString(a);
|
||||
b = this.fromString(b);
|
||||
if (this.isBefore(a, b)) {
|
||||
return a;
|
||||
}
|
||||
@@ -228,6 +241,8 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static getSecondsBetweenDates(start: Date, end: Date): number {
|
||||
start = this.fromString(start);
|
||||
end = this.fromString(end);
|
||||
const duration: moment.Duration = moment.duration(
|
||||
moment(end).diff(moment(start))
|
||||
);
|
||||
@@ -264,6 +279,15 @@ export default class OneUptimeDate {
|
||||
return b.diff(a, 'days');
|
||||
}
|
||||
|
||||
public static getNumberOfMinutesBetweenDates(
|
||||
startDate: Date,
|
||||
endDate: Date
|
||||
): number {
|
||||
const a: moment.Moment = moment(startDate);
|
||||
const b: moment.Moment = moment(endDate);
|
||||
return b.diff(a, 'minutes');
|
||||
}
|
||||
|
||||
public static getNumberOfDaysBetweenDatesInclusive(
|
||||
startDate: Date,
|
||||
endDate: Date
|
||||
@@ -280,10 +304,12 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static getStartOfDay(date: Date): Date {
|
||||
date = this.fromString(date);
|
||||
return moment(date).startOf('day').toDate();
|
||||
}
|
||||
|
||||
public static getEndOfDay(date: Date): Date {
|
||||
date = this.fromString(date);
|
||||
return moment(date).endOf('day').toDate();
|
||||
}
|
||||
|
||||
@@ -292,18 +318,26 @@ export default class OneUptimeDate {
|
||||
startDate: Date,
|
||||
endDate: Date
|
||||
): boolean {
|
||||
date = this.fromString(date);
|
||||
startDate = this.fromString(startDate);
|
||||
endDate = this.fromString(endDate);
|
||||
return moment(date).isBetween(startDate, endDate);
|
||||
}
|
||||
|
||||
public static isAfter(date: Date, startDate: Date): boolean {
|
||||
date = this.fromString(date);
|
||||
startDate = this.fromString(startDate);
|
||||
return moment(date).isAfter(startDate);
|
||||
}
|
||||
|
||||
public static hasExpired(expiratinDate: Date): boolean {
|
||||
expiratinDate = this.fromString(expiratinDate);
|
||||
return !moment(this.getCurrentDate()).isBefore(expiratinDate);
|
||||
}
|
||||
|
||||
public static isBefore(date: Date, endDate: Date): boolean {
|
||||
date = this.fromString(date);
|
||||
endDate = this.fromString(endDate);
|
||||
return moment(date).isBefore(endDate);
|
||||
}
|
||||
|
||||
@@ -315,6 +349,8 @@ export default class OneUptimeDate {
|
||||
date: string | Date,
|
||||
onlyShowDate?: boolean
|
||||
): string {
|
||||
date = this.fromString(date);
|
||||
|
||||
let formatstring: string = 'MMM DD YYYY, HH:mm';
|
||||
|
||||
if (onlyShowDate) {
|
||||
@@ -332,6 +368,8 @@ export default class OneUptimeDate {
|
||||
date: string | Date,
|
||||
onlyShowDate?: boolean
|
||||
): string {
|
||||
date = this.fromString(date);
|
||||
|
||||
let formatstring: string = 'MMM DD YYYY, HH:mm';
|
||||
|
||||
if (onlyShowDate) {
|
||||
@@ -352,22 +390,44 @@ export default class OneUptimeDate {
|
||||
}
|
||||
|
||||
public static getDateString(date: Date): string {
|
||||
date = this.fromString(date);
|
||||
return this.getDateAsLocalFormattedString(date, true);
|
||||
}
|
||||
|
||||
public static isInThePast(date: string | Date): boolean {
|
||||
date = this.fromString(date);
|
||||
return moment(date).isBefore(new Date());
|
||||
}
|
||||
|
||||
public static isInTheFuture(date: string | Date): boolean {
|
||||
date = this.fromString(date);
|
||||
return moment(date).isAfter(new Date());
|
||||
}
|
||||
|
||||
public static fromString(date: string): Date {
|
||||
return moment(date).toDate();
|
||||
public static fromString(date: string | JSONObject | Date): Date {
|
||||
if (date instanceof Date) {
|
||||
return date;
|
||||
}
|
||||
|
||||
if (typeof date === 'string') {
|
||||
return moment(date).toDate();
|
||||
}
|
||||
|
||||
if (
|
||||
date &&
|
||||
date['value'] &&
|
||||
typeof date['value'] === 'string' &&
|
||||
date['_type'] &&
|
||||
(date['_type'] === 'Date' || date['_type'] === 'DateTime')
|
||||
) {
|
||||
return moment(date['value']).toDate();
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid date');
|
||||
}
|
||||
|
||||
public static asDateForDatabaseQuery(date: string | Date): string {
|
||||
date = this.fromString(date);
|
||||
const formatstring: string = 'YYYY-MM-DD';
|
||||
return moment(date).local().format(formatstring);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { FindOperator } from 'typeorm/find-options/FindOperator';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
export default class Domain extends DatabaseProperty {
|
||||
private _domain: string = '';
|
||||
@@ -64,6 +65,21 @@ export default class Domain extends DatabaseProperty {
|
||||
return null;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Domain,
|
||||
value: (this as Domain).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Domain {
|
||||
if (json['_type'] === ObjectType.Domain) {
|
||||
return new Domain((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
protected static override fromDatabase(_value: string): Domain | null {
|
||||
if (_value) {
|
||||
return new Domain(_value);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { FindOperator } from 'typeorm';
|
||||
import Hostname from './API/Hostname';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
|
||||
const nonBusinessEmailDomains: Array<string> = [
|
||||
'gmail',
|
||||
@@ -55,6 +56,21 @@ export default class Email extends DatabaseProperty {
|
||||
return true;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.Email,
|
||||
value: (this as Email).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): Email {
|
||||
if (json['_type'] === ObjectType.Email) {
|
||||
return new Email((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return this.email;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ enum ExceptionCode {
|
||||
APIException = 2,
|
||||
DatabaseNotConnectedException = 3,
|
||||
BadOperationException = 5,
|
||||
WebRequestException = 6,
|
||||
BadDataException = 400,
|
||||
BadRequestException = 400,
|
||||
ServerException = 500,
|
||||
|
||||
8
Common/Types/Exception/WebsiteRequestException.ts
Normal file
8
Common/Types/Exception/WebsiteRequestException.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import Exception from './Exception';
|
||||
import ExceptionCode from './ExceptionCode';
|
||||
|
||||
export default class WebsiteRequestException extends Exception {
|
||||
public constructor(message: string) {
|
||||
super(ExceptionCode.WebRequestException, message);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import BadOperationException from './Exception/BadOperationException';
|
||||
import ObjectID from './ObjectID';
|
||||
import CryptoJS from 'crypto-js';
|
||||
import { JSONObject, ObjectType } from './JSON';
|
||||
import BadDataException from './Exception/BadDataException';
|
||||
|
||||
export default class HashedString extends DatabaseProperty {
|
||||
private isHashed: boolean = false;
|
||||
@@ -22,6 +24,21 @@ export default class HashedString extends DatabaseProperty {
|
||||
this.isHashed = isValueHashed;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.HashedString,
|
||||
value: (this as HashedString).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): HashedString {
|
||||
if (json['_type'] === ObjectType.HashedString) {
|
||||
return new HashedString((json['value'] as string) || '');
|
||||
}
|
||||
|
||||
throw new BadDataException('Invalid JSON: ' + JSON.stringify(json));
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import { JSONObject } from '../JSON';
|
||||
@@ -28,6 +29,17 @@ export default class IP extends DatabaseProperty {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public static fromString(ip: string): IP {
|
||||
return new IP(ip);
|
||||
}
|
||||
|
||||
public static isIP(ip: string): boolean {
|
||||
if (IP.isIPv4(ip) || IP.isIPv6(ip)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override toString(): string {
|
||||
return this.ip;
|
||||
}
|
||||
@@ -60,7 +72,7 @@ export default class IP extends DatabaseProperty {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static fromJSON(json: JSONObject): IP {
|
||||
public static override fromJSON(json: JSONObject): IP {
|
||||
if (json && json['_type'] !== 'IP') {
|
||||
throw new BadDataException('Invalid JSON for IP');
|
||||
}
|
||||
@@ -72,17 +84,20 @@ export default class IP extends DatabaseProperty {
|
||||
return new IP(json['value'] as string);
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
public override toJSON(): JSONObject {
|
||||
return {
|
||||
value: this.toString(),
|
||||
_type: 'IP',
|
||||
};
|
||||
}
|
||||
|
||||
public static override toDatabase(_value: string): string | null {
|
||||
public static override toDatabase(
|
||||
_value: IP | FindOperator<IP>
|
||||
): string | null {
|
||||
if (_value) {
|
||||
return _value.toString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,11 @@ enum IconProp {
|
||||
User = 'User',
|
||||
Disc = 'Disc',
|
||||
Settings = 'Settings',
|
||||
Criteria = 'Criteria',
|
||||
Notification = 'Notification',
|
||||
Help = 'Help',
|
||||
JSON = 'JSON',
|
||||
Signal = 'Soignal',
|
||||
Database = 'Database',
|
||||
ChevronDown = 'ChevronDown',
|
||||
ChevronRight = 'ChevronRight',
|
||||
|
||||
@@ -21,11 +21,16 @@ import NotNull from './Database/NotNull';
|
||||
import { BaseEntity } from 'typeorm';
|
||||
import EqualToOrNull from './Database/EqualToOrNull';
|
||||
import NotEqual from './Database/NotEqual';
|
||||
import { CheckOn, FilterType } from './Monitor/CriteriaFilter';
|
||||
|
||||
export enum ObjectType {
|
||||
ObjectID = 'ObjectID',
|
||||
Name = 'Name',
|
||||
EqualToOrNull = 'EqualToOrNull',
|
||||
MonitorSteps = 'MonitorSteps',
|
||||
MonitorStep = 'MonitorStep',
|
||||
MonitorCriteria = 'MonitorCriteria',
|
||||
MonitorCriteriaInstance = 'MonitorCriteriaInstance',
|
||||
NotEqual = 'NotEqual',
|
||||
Email = 'Email',
|
||||
Phone = 'Phone',
|
||||
@@ -83,6 +88,10 @@ export type JSONValue =
|
||||
| Buffer
|
||||
| Permission
|
||||
| Array<Permission>
|
||||
| CheckOn
|
||||
| Array<CheckOn>
|
||||
| FilterType
|
||||
| Array<FilterType>
|
||||
| Search
|
||||
| Domain
|
||||
| Array<Domain>
|
||||
|
||||
@@ -1,32 +1,13 @@
|
||||
import ObjectID from './ObjectID';
|
||||
import Version from './Version';
|
||||
import Email from './Email';
|
||||
import Phone from './Phone';
|
||||
import Color from './Color';
|
||||
import Route from './API/Route';
|
||||
import URL from './API/URL';
|
||||
import Name from './Name';
|
||||
import Search from './Database/Search';
|
||||
import Typeof from './Typeof';
|
||||
import Port from './Port';
|
||||
import Hostname from './API/Hostname';
|
||||
import HashedString from './HashedString';
|
||||
import DatabaseProperty from './Database/DatabaseProperty';
|
||||
import OneUptimeDate from './Date';
|
||||
import BaseModel from '../Models/BaseModel';
|
||||
import GreaterThan from './Database/GreaterThan';
|
||||
import JSON5 from 'json5';
|
||||
import GreaterThanOrEqual from './Database/GreaterThanOrEqual';
|
||||
import LessThan from './Database/LessThan';
|
||||
import LessThanOrEqual from './Database/LessThanOrEqual';
|
||||
import InBetween from './Database/InBetween';
|
||||
import Domain from './Domain';
|
||||
import NotNull from './Database/NotNull';
|
||||
import { JSONArray, JSONObject, JSONValue, ObjectType } from './JSON';
|
||||
import { TableColumnMetadata } from '../Types/Database/TableColumn';
|
||||
import TableColumnType from '../Types/Database/TableColumnType';
|
||||
import EqualToOrNull from './Database/EqualToOrNull';
|
||||
import NotEqual from './Database/NotEqual';
|
||||
import SerializableObject from './SerializableObject';
|
||||
import SerializableObjectDictionary from './SerializableObjectDictionary';
|
||||
import JSON5 from 'json5';
|
||||
|
||||
export default class JSONFunctions {
|
||||
public static toJSON(
|
||||
@@ -271,112 +252,8 @@ export default class JSONFunctions {
|
||||
_type: ObjectType.Buffer,
|
||||
value: val as Uint8Array,
|
||||
};
|
||||
} else if (val && val instanceof Name) {
|
||||
return {
|
||||
_type: ObjectType.Name,
|
||||
value: (val as Name).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Domain) {
|
||||
return {
|
||||
_type: ObjectType.Domain,
|
||||
value: (val as Domain).toString(),
|
||||
};
|
||||
} else if (val && val instanceof ObjectID) {
|
||||
return {
|
||||
_type: ObjectType.ObjectID,
|
||||
value: (val as ObjectID).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Phone) {
|
||||
return {
|
||||
_type: ObjectType.Phone,
|
||||
value: (val as Phone).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Email) {
|
||||
return {
|
||||
_type: ObjectType.Email,
|
||||
value: (val as Email).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Port) {
|
||||
return {
|
||||
_type: ObjectType.Port,
|
||||
value: (val as Port).toString(),
|
||||
};
|
||||
} else if (val && val instanceof HashedString) {
|
||||
return {
|
||||
_type: ObjectType.HashedString,
|
||||
value: (val as HashedString).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Hostname) {
|
||||
return {
|
||||
_type: ObjectType.Hostname,
|
||||
value: (val as Hostname).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Version) {
|
||||
return {
|
||||
_type: ObjectType.Version,
|
||||
value: (val as Version).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Route) {
|
||||
return {
|
||||
_type: ObjectType.Route,
|
||||
value: (val as Route).toString(),
|
||||
};
|
||||
} else if (val && val instanceof URL) {
|
||||
return {
|
||||
_type: ObjectType.URL,
|
||||
value: (val as URL).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Color) {
|
||||
return {
|
||||
_type: ObjectType.Color,
|
||||
value: (val as Color).toString(),
|
||||
};
|
||||
} else if (val && val instanceof Search) {
|
||||
return {
|
||||
_type: ObjectType.Search,
|
||||
value: (val as Search).toString(),
|
||||
};
|
||||
} else if (val && val instanceof LessThan) {
|
||||
return {
|
||||
_type: ObjectType.LessThan,
|
||||
value: (val as LessThan).value,
|
||||
};
|
||||
} else if (val && val instanceof InBetween) {
|
||||
return {
|
||||
_type: ObjectType.InBetween,
|
||||
startValue: (val as InBetween).startValue,
|
||||
endValue: (val as InBetween).endValue,
|
||||
};
|
||||
} else if (val && val instanceof NotNull) {
|
||||
return {
|
||||
_type: ObjectType.NotNull,
|
||||
value: null,
|
||||
};
|
||||
} else if (val && val instanceof GreaterThan) {
|
||||
return {
|
||||
_type: ObjectType.GreaterThan,
|
||||
value: (val as GreaterThan).value,
|
||||
};
|
||||
} else if (val && val instanceof EqualToOrNull) {
|
||||
return {
|
||||
_type: ObjectType.EqualToOrNull,
|
||||
value: (val as EqualToOrNull).value.toString(),
|
||||
};
|
||||
} else if (val && val instanceof NotEqual) {
|
||||
return {
|
||||
_type: ObjectType.NotEqual,
|
||||
value: (val as NotEqual).value.toString(),
|
||||
};
|
||||
} else if (val && val instanceof LessThanOrEqual) {
|
||||
return {
|
||||
_type: ObjectType.LessThanOrEqual,
|
||||
value: (val as LessThanOrEqual).value,
|
||||
};
|
||||
} else if (val && val instanceof GreaterThanOrEqual) {
|
||||
return {
|
||||
_type: ObjectType.GreaterThanOrEqual,
|
||||
value: (val as GreaterThanOrEqual).value,
|
||||
};
|
||||
} else if (val && val instanceof SerializableObject) {
|
||||
return val.toJSON();
|
||||
} else if (val && val instanceof Date) {
|
||||
return {
|
||||
_type: ObjectType.DateTime,
|
||||
@@ -431,226 +308,11 @@ export default class JSONFunctions {
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Name
|
||||
SerializableObjectDictionary[(val as JSONObject)['_type'] as string]
|
||||
) {
|
||||
return new Name((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Domain
|
||||
) {
|
||||
return new Domain((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) ===
|
||||
ObjectType.EqualToOrNull
|
||||
) {
|
||||
return new EqualToOrNull((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.NotEqual
|
||||
) {
|
||||
return new NotEqual((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.ObjectID
|
||||
) {
|
||||
return new ObjectID((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Phone
|
||||
) {
|
||||
return new Phone((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Email
|
||||
) {
|
||||
return new Email((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Version
|
||||
) {
|
||||
return new Name((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Route
|
||||
) {
|
||||
return new Route((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.URL
|
||||
) {
|
||||
return URL.fromString((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Port
|
||||
) {
|
||||
return new Port((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Hostname
|
||||
) {
|
||||
return new Hostname((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.HashedString
|
||||
) {
|
||||
return new HashedString((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.DateTime
|
||||
) {
|
||||
return OneUptimeDate.fromString(
|
||||
(val as JSONObject)['value'] as string
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Color
|
||||
) {
|
||||
return new Color((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
typeof (val as JSONObject)['value'] === Typeof.String &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.Search
|
||||
) {
|
||||
return new Search((val as JSONObject)['value'] as string);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date) &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.LessThan
|
||||
) {
|
||||
return new LessThan((val as JSONObject)['value'] as number | Date);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date ||
|
||||
typeof (val as JSONObject)['value'] === Typeof.String) &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.GreaterThan
|
||||
) {
|
||||
return new GreaterThan(
|
||||
(val as JSONObject)['value'] as number | Date
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date ||
|
||||
typeof (val as JSONObject)['value'] === Typeof.String) &&
|
||||
((val as JSONObject)['_type'] as string) ===
|
||||
ObjectType.LessThanOrEqual
|
||||
) {
|
||||
return new LessThanOrEqual(
|
||||
(val as JSONObject)['value'] as number | Date
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] === null &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.NotNull
|
||||
) {
|
||||
return new NotNull();
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['value'] &&
|
||||
(typeof (val as JSONObject)['value'] === Typeof.Number ||
|
||||
(val as JSONObject)['value'] instanceof Date ||
|
||||
typeof (val as JSONObject)['value'] === Typeof.String) &&
|
||||
((val as JSONObject)['_type'] as string) ===
|
||||
ObjectType.GreaterThanOrEqual
|
||||
) {
|
||||
return new GreaterThanOrEqual(
|
||||
(val as JSONObject)['value'] as number | Date
|
||||
);
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
(val as JSONObject)['_type'] &&
|
||||
(val as JSONObject)['startValue'] &&
|
||||
(typeof (val as JSONObject)['startValue'] === Typeof.Number ||
|
||||
typeof (val as JSONObject)['endValue'] === Typeof.String ||
|
||||
(val as JSONObject)['startValue'] instanceof Date) &&
|
||||
(val as JSONObject)['endValue'] &&
|
||||
(typeof (val as JSONObject)['endValue'] === Typeof.Number ||
|
||||
typeof (val as JSONObject)['endValue'] === Typeof.String ||
|
||||
(val as JSONObject)['endValue'] instanceof Date) &&
|
||||
((val as JSONObject)['_type'] as string) === ObjectType.InBetween
|
||||
) {
|
||||
return new InBetween(
|
||||
(val as JSONObject)['startValue'] as number | Date,
|
||||
(val as JSONObject)['endValue'] as number | Date
|
||||
);
|
||||
return SerializableObjectDictionary[
|
||||
(val as JSONObject)['_type'] as string
|
||||
].fromJSON(val);
|
||||
} else if (val instanceof Date) {
|
||||
return val;
|
||||
} else if (typeof val === Typeof.Object) {
|
||||
|
||||
36
Common/Types/Monitor/CriteriaFilter.ts
Normal file
36
Common/Types/Monitor/CriteriaFilter.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export enum CheckOn {
|
||||
ResponseTime = 'Response Time (in ms)',
|
||||
ResponseStatusCode = 'Response Staus Code',
|
||||
ResponseHeader = 'Response Header',
|
||||
ResponseHeaderValue = 'Response Header Value',
|
||||
ResponseBody = 'Response Body',
|
||||
IsOnline = 'Is Online',
|
||||
}
|
||||
|
||||
export interface CriteriaFilter {
|
||||
checkOn: CheckOn;
|
||||
filterType: FilterType | undefined;
|
||||
value: string | number | undefined;
|
||||
}
|
||||
|
||||
export enum FilterType {
|
||||
EqualTo = 'Equal To',
|
||||
NotEqualTo = 'Not Equal To',
|
||||
GreaterThan = 'Greater Than',
|
||||
LessThan = 'Less Than',
|
||||
GreaterThanOrEqualTo = 'Greater Than Or Equal To',
|
||||
LessThanOrEqualTo = 'Less Than Or Equal To',
|
||||
Contains = 'Contains',
|
||||
NotContains = 'Not Contains',
|
||||
StartsWith = 'Starts With',
|
||||
EndsWith = 'Ends With',
|
||||
IsEmpty = 'Is Empty',
|
||||
IsNotEmpty = 'Is Not Empty',
|
||||
True = 'True',
|
||||
False = 'False',
|
||||
}
|
||||
|
||||
export enum FilterCondition {
|
||||
All = 'All',
|
||||
Any = 'Any',
|
||||
}
|
||||
7
Common/Types/Monitor/CriteriaIncident.ts
Normal file
7
Common/Types/Monitor/CriteriaIncident.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export interface CriteriaIncident {
|
||||
title: string;
|
||||
description: string;
|
||||
incidentSeverityId?: ObjectID | undefined;
|
||||
}
|
||||
@@ -1,43 +1,119 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONArray, JSONObject } from '../JSON';
|
||||
import { JSONArray, JSONObject, ObjectType } from '../JSON';
|
||||
import MonitorCriteriaInstance from './MonitorCriteriaInstance';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import MonitorType from './MonitorType';
|
||||
import ObjectID from '../ObjectID';
|
||||
import JSONFunctions from '../JSONFunctions';
|
||||
|
||||
export interface MonitorCriteriaType {
|
||||
monitorCriteriaInstanceArray: Array<MonitorCriteriaInstance>;
|
||||
}
|
||||
|
||||
export default class MonitorCriteria extends DatabaseProperty {
|
||||
public monitorCriteria: MonitorCriteriaType | undefined = undefined;
|
||||
public data: MonitorCriteriaType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
this.data = {
|
||||
monitorCriteriaInstanceArray: [new MonitorCriteriaInstance()],
|
||||
};
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
if (!this.monitorCriteria) {
|
||||
return {
|
||||
_type: 'MonitorCriteria',
|
||||
value: {},
|
||||
};
|
||||
public static getDefaultMonitorCriteria(arg: {
|
||||
monitorType: MonitorType;
|
||||
onlineMonitorStatusId: ObjectID;
|
||||
offlineMonitorStatusId: ObjectID;
|
||||
defaultIncidentSeverityId: ObjectID;
|
||||
}): MonitorCriteria {
|
||||
const monitorCriteria: MonitorCriteria = new MonitorCriteria();
|
||||
|
||||
monitorCriteria.data = {
|
||||
monitorCriteriaInstanceArray: [
|
||||
MonitorCriteriaInstance.getDefaultOfflineMonitorCriteriaInstance(
|
||||
{
|
||||
monitorType: arg.monitorType,
|
||||
monitorStatusId: arg.offlineMonitorStatusId,
|
||||
incidentSeverityId: arg.defaultIncidentSeverityId,
|
||||
}
|
||||
),
|
||||
MonitorCriteriaInstance.getDefaultOnlineMonitorCriteriaInstance(
|
||||
{
|
||||
monitorType: arg.monitorType,
|
||||
monitorStatusId: arg.onlineMonitorStatusId,
|
||||
}
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
return monitorCriteria;
|
||||
}
|
||||
|
||||
public static getValidationError(
|
||||
value: MonitorCriteria,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Criteria is required';
|
||||
}
|
||||
|
||||
if (value.data.monitorCriteriaInstanceArray.length === 0) {
|
||||
return 'Monitor Criteria is required';
|
||||
}
|
||||
|
||||
for (const criteria of value.data.monitorCriteriaInstanceArray) {
|
||||
if (
|
||||
MonitorCriteriaInstance.getValidationError(
|
||||
criteria,
|
||||
monitorType
|
||||
)
|
||||
) {
|
||||
return MonitorCriteriaInstance.getValidationError(
|
||||
criteria,
|
||||
monitorType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static getNewMonitorCriteriaAsJSON(): JSONObject {
|
||||
return {
|
||||
_type: 'MonitorCriteria',
|
||||
value: {
|
||||
monitorCriteriaInstanceArray: [
|
||||
new MonitorCriteriaInstance().toJSON(),
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
if (!this.data) {
|
||||
return MonitorCriteria.getNewMonitorCriteriaAsJSON();
|
||||
}
|
||||
|
||||
return JSONFunctions.serialize({
|
||||
_type: ObjectType.MonitorCriteria,
|
||||
value: {
|
||||
monitorCriteriaInstanceArray:
|
||||
this.monitorCriteria.monitorCriteriaInstanceArray.map(
|
||||
this.data.monitorCriteriaInstanceArray.map(
|
||||
(criteria: MonitorCriteriaInstance) => {
|
||||
return criteria.toJSON();
|
||||
}
|
||||
),
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorCriteria {
|
||||
if (!json || json['_type'] !== 'MonitorCriteria') {
|
||||
public static override fromJSON(json: JSONObject): MonitorCriteria {
|
||||
if (json instanceof MonitorCriteria) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json || json['_type'] !== ObjectType.MonitorCriteria) {
|
||||
throw new BadDataException('Invalid monitor criteria');
|
||||
}
|
||||
|
||||
@@ -57,15 +133,17 @@ export default class MonitorCriteria extends DatabaseProperty {
|
||||
json['value'] as JSONObject
|
||||
)['monitorCriteriaInstanceArray'] as JSONArray;
|
||||
|
||||
this.monitorCriteria = {
|
||||
const monitorCriteria: MonitorCriteria = new MonitorCriteria();
|
||||
|
||||
monitorCriteria.data = {
|
||||
monitorCriteriaInstanceArray: monitorCriteriaInstanceArray.map(
|
||||
(json: JSONObject) => {
|
||||
return new MonitorCriteriaInstance().fromJSON(json);
|
||||
return MonitorCriteriaInstance.fromJSON(json);
|
||||
}
|
||||
),
|
||||
};
|
||||
|
||||
return this;
|
||||
return monitorCriteria;
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
@@ -73,10 +151,12 @@ export default class MonitorCriteria extends DatabaseProperty {
|
||||
}
|
||||
|
||||
protected static override toDatabase(
|
||||
_value: MonitorCriteria | FindOperator<MonitorCriteria>
|
||||
value: MonitorCriteria | FindOperator<MonitorCriteria>
|
||||
): JSONObject | null {
|
||||
if (_value) {
|
||||
return (_value as MonitorCriteria).toJSON();
|
||||
if (value && value instanceof MonitorCriteria) {
|
||||
return (value as MonitorCriteria).toJSON();
|
||||
} else if (value) {
|
||||
return JSONFunctions.serialize(value as any);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -86,7 +166,7 @@ export default class MonitorCriteria extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorCriteria | null {
|
||||
if (value) {
|
||||
return new MonitorCriteria().fromJSON(value);
|
||||
return MonitorCriteria.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -1,82 +1,456 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONObject } from '../JSON';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import ObjectID from '../ObjectID';
|
||||
|
||||
export enum CheckOn {
|
||||
ResponseTime = 'Response Time',
|
||||
ResponseCode = 'Response Code',
|
||||
ResponseHeader = 'Response Header',
|
||||
ResponseBody = 'Response Body',
|
||||
IsOnline = 'Is Online',
|
||||
}
|
||||
|
||||
export interface CriteriaFilter {
|
||||
checkOn: CheckOn;
|
||||
filterType: FilterType;
|
||||
value: string | number;
|
||||
}
|
||||
|
||||
export interface CriteriaIncident {
|
||||
title: string;
|
||||
description: string;
|
||||
incidentSeverityId: ObjectID;
|
||||
}
|
||||
|
||||
export enum FilterType {
|
||||
EqualTo = 'Equal To',
|
||||
NotEqualTo = 'Not Equal To',
|
||||
GreaterThan = 'Greater Than',
|
||||
LessThan = 'Less Than',
|
||||
GreaterThanOrEqualTo = 'Greater Than Or Equal To',
|
||||
LessThanOrEqualTo = 'Less Than Or Equal To',
|
||||
Contains = 'Contains',
|
||||
NotContains = 'Not Contains',
|
||||
StartsWith = 'Starts With',
|
||||
EndsWith = 'Ends With',
|
||||
IsEmpty = 'Is Empty',
|
||||
IsNotEmpty = 'Is Not Empty',
|
||||
}
|
||||
|
||||
export enum FilterCondtion {
|
||||
All = 'All',
|
||||
Any = 'Any',
|
||||
}
|
||||
import { CriteriaIncident } from './CriteriaIncident';
|
||||
import {
|
||||
CheckOn,
|
||||
CriteriaFilter,
|
||||
FilterCondition,
|
||||
FilterType,
|
||||
} from './CriteriaFilter';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import MonitorType from './MonitorType';
|
||||
import Typeof from '../Typeof';
|
||||
import JSONFunctions from '../JSONFunctions';
|
||||
|
||||
export interface MonitorCriteriaInstanceType {
|
||||
monitorStateId: ObjectID;
|
||||
filter: {
|
||||
filterCondition: FilterCondtion;
|
||||
filters: Array<CriteriaFilter>;
|
||||
};
|
||||
createIncidents: Array<CriteriaIncident>;
|
||||
monitorStatusId: ObjectID | undefined;
|
||||
filterCondition: FilterCondition;
|
||||
filters: Array<CriteriaFilter>;
|
||||
incidents: Array<CriteriaIncident>;
|
||||
name: string;
|
||||
description: string;
|
||||
changeMonitorStatus?: boolean | undefined;
|
||||
createIncidents?: boolean | undefined;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export default class MonitorCriteriaInstance extends DatabaseProperty {
|
||||
public monitorCriteriaInstance: JSONObject = {};
|
||||
public data: MonitorCriteriaInstanceType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
this.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: undefined,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: undefined,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
createIncidents: false,
|
||||
changeMonitorStatus: false,
|
||||
incidents: [],
|
||||
name: '',
|
||||
description: '',
|
||||
};
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
return this.monitorCriteriaInstance;
|
||||
public static getDefaultOnlineMonitorCriteriaInstance(arg: {
|
||||
monitorType: MonitorType;
|
||||
monitorStatusId: ObjectID;
|
||||
}): MonitorCriteriaInstance {
|
||||
const monitorCriteriaInstance: MonitorCriteriaInstance =
|
||||
new MonitorCriteriaInstance();
|
||||
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: arg.monitorStatusId,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.True,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
incidents: [],
|
||||
changeMonitorStatus: true,
|
||||
createIncidents: false,
|
||||
name: 'Check if online',
|
||||
description: 'This criteria cheks if the monitor is online',
|
||||
};
|
||||
|
||||
if (
|
||||
arg.monitorType === MonitorType.Website ||
|
||||
arg.monitorType === MonitorType.API
|
||||
) {
|
||||
monitorCriteriaInstance.data.filters.push({
|
||||
checkOn: CheckOn.ResponseStatusCode,
|
||||
filterType: FilterType.EqualTo,
|
||||
value: 200,
|
||||
});
|
||||
}
|
||||
|
||||
return monitorCriteriaInstance;
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorCriteriaInstance {
|
||||
this.monitorCriteriaInstance = json;
|
||||
public static getDefaultOfflineMonitorCriteriaInstance(arg: {
|
||||
monitorType: MonitorType;
|
||||
monitorStatusId: ObjectID;
|
||||
incidentSeverityId: ObjectID;
|
||||
}): MonitorCriteriaInstance {
|
||||
const monitorCriteriaInstance: MonitorCriteriaInstance =
|
||||
new MonitorCriteriaInstance();
|
||||
|
||||
if (
|
||||
arg.monitorType === MonitorType.Ping ||
|
||||
arg.monitorType === MonitorType.IP
|
||||
) {
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: arg.monitorStatusId,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.False,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
incidents: [
|
||||
{
|
||||
title: `${arg.monitorType} monitor is offline`,
|
||||
description: `${arg.monitorType} monitor is currently offline.`,
|
||||
incidentSeverityId: arg.incidentSeverityId,
|
||||
},
|
||||
],
|
||||
changeMonitorStatus: true,
|
||||
createIncidents: true,
|
||||
name: 'Check if offline',
|
||||
description: 'This criteria cheks if the monitor is offline',
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
arg.monitorType === MonitorType.API ||
|
||||
arg.monitorType === MonitorType.Website
|
||||
) {
|
||||
monitorCriteriaInstance.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: arg.monitorStatusId,
|
||||
filterCondition: FilterCondition.Any,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.False,
|
||||
value: undefined,
|
||||
},
|
||||
{
|
||||
checkOn: CheckOn.ResponseStatusCode,
|
||||
filterType: FilterType.NotEqualTo,
|
||||
value: 200,
|
||||
},
|
||||
],
|
||||
incidents: [
|
||||
{
|
||||
title: `${arg.monitorType} monitor is offline`,
|
||||
description: `${arg.monitorType} monitor is currently offline.`,
|
||||
incidentSeverityId: arg.incidentSeverityId,
|
||||
},
|
||||
],
|
||||
changeMonitorStatus: true,
|
||||
createIncidents: true,
|
||||
name: 'Check if offline',
|
||||
description: 'This criteria cheks if the monitor is offline',
|
||||
};
|
||||
}
|
||||
|
||||
return monitorCriteriaInstance;
|
||||
}
|
||||
|
||||
public static getNewMonitorCriteriaInstanceAsJSON(): JSONObject {
|
||||
return {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorStatusId: undefined,
|
||||
filterCondition: FilterCondition.All,
|
||||
filters: [
|
||||
{
|
||||
checkOn: CheckOn.IsOnline,
|
||||
filterType: FilterType.True,
|
||||
value: undefined,
|
||||
},
|
||||
],
|
||||
incidents: [],
|
||||
name: '',
|
||||
description: '',
|
||||
createIncidents: false,
|
||||
changeMonitorStatus: false,
|
||||
};
|
||||
}
|
||||
|
||||
public static getValidationError(
|
||||
value: MonitorCriteriaInstance,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Step is required';
|
||||
}
|
||||
|
||||
if (value.data.filters.length === 0) {
|
||||
return 'Monitor Criteria filter is required';
|
||||
}
|
||||
|
||||
if (!value.data.name) {
|
||||
return 'Monitor Criteria name is required';
|
||||
}
|
||||
|
||||
if (!value.data.description) {
|
||||
return 'Monitor Criteria description is required';
|
||||
}
|
||||
|
||||
for (const incident of value.data.incidents) {
|
||||
if (!incident) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!incident.title) {
|
||||
return 'Monitor Criteria incident title is required';
|
||||
}
|
||||
|
||||
if (!incident.description) {
|
||||
return 'Monitor Criteria incident description is required';
|
||||
}
|
||||
|
||||
if (!incident.incidentSeverityId) {
|
||||
return 'Monitor Criteria incident severity is required';
|
||||
}
|
||||
}
|
||||
|
||||
for (const filter of value.data.filters) {
|
||||
if (!filter.checkOn) {
|
||||
return 'Monitor Criteria filter check on is required';
|
||||
}
|
||||
|
||||
if (
|
||||
monitorType === MonitorType.Ping &&
|
||||
filter.checkOn !== CheckOn.IsOnline &&
|
||||
filter.checkOn !== CheckOn.ResponseTime
|
||||
) {
|
||||
return (
|
||||
'Ping Monitor cannot have filter criteria: ' +
|
||||
filter.checkOn
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public setName(name: string): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.name = name;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setDescription(description: string): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.description = description;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public static clone(
|
||||
monitorCriteriaInstance: MonitorCriteriaInstance
|
||||
): MonitorCriteriaInstance {
|
||||
return MonitorCriteriaInstance.fromJSON(
|
||||
monitorCriteriaInstance.toJSON()
|
||||
);
|
||||
}
|
||||
|
||||
public setMonitorStatusId(
|
||||
monitorStatusId: ObjectID | undefined
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.monitorStatusId = monitorStatusId;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setFilterCondition(
|
||||
filterCondition: FilterCondition
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.filterCondition = filterCondition;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setFilters(filters: Array<CriteriaFilter>): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.filters = filters;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setIncidents(
|
||||
incidents: Array<CriteriaIncident>
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.incidents = [...incidents];
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setChangeMonitorStatus(
|
||||
changeMonitorStatus: boolean | undefined
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.changeMonitorStatus = changeMonitorStatus;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public setCreateIncidents(
|
||||
createIncidents: boolean | undefined
|
||||
): MonitorCriteriaInstance {
|
||||
if (this.data) {
|
||||
this.data.createIncidents = createIncidents;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
if (!this.data) {
|
||||
return MonitorCriteriaInstance.getNewMonitorCriteriaInstanceAsJSON();
|
||||
}
|
||||
|
||||
return JSONFunctions.serialize({
|
||||
_type: ObjectType.MonitorCriteriaInstance,
|
||||
value: {
|
||||
id: this.data.id,
|
||||
monitorStatusId: this.data.monitorStatusId?.toString(),
|
||||
filterCondition: this.data.filterCondition,
|
||||
filters: this.data.filters,
|
||||
incidents: this.data.incidents,
|
||||
changeMonitorStatus: this.data.changeMonitorStatus,
|
||||
createIncidents: this.data.createIncidents,
|
||||
name: this.data.name,
|
||||
description: this.data.description,
|
||||
} as any,
|
||||
});
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): MonitorCriteriaInstance {
|
||||
if (json instanceof MonitorCriteriaInstance) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json) {
|
||||
throw new BadDataException('json is null');
|
||||
}
|
||||
|
||||
if (!json['_type']) {
|
||||
throw new BadDataException('json._type is null');
|
||||
}
|
||||
|
||||
if (json['_type'] !== ObjectType.MonitorCriteriaInstance) {
|
||||
throw new BadDataException(
|
||||
'json._type should be MonitorCriteriaInstance'
|
||||
);
|
||||
}
|
||||
|
||||
if (!json['value']) {
|
||||
throw new BadDataException('json.value is null');
|
||||
}
|
||||
|
||||
json = json['value'] as JSONObject;
|
||||
|
||||
if (!json['filterCondition']) {
|
||||
throw new BadDataException('json.filterCondition is null');
|
||||
}
|
||||
|
||||
if (!json['filters']) {
|
||||
throw new BadDataException('json.filters is null');
|
||||
}
|
||||
|
||||
if (!Array.isArray(json['filters'])) {
|
||||
throw new BadDataException('json.filters should be an array');
|
||||
}
|
||||
|
||||
if (!json['incidents']) {
|
||||
throw new BadDataException('json.incidents is null');
|
||||
}
|
||||
|
||||
if (!Array.isArray(json['incidents'])) {
|
||||
throw new BadDataException('json.incidents should be an array');
|
||||
}
|
||||
|
||||
let monitorStatusId: ObjectID | undefined = undefined;
|
||||
|
||||
if (
|
||||
json['monitorStatusId'] &&
|
||||
typeof json['monitorStatusId'] === Typeof.String
|
||||
) {
|
||||
monitorStatusId = new ObjectID(json['monitorStatusId'] as string);
|
||||
} else if (
|
||||
json['monitorStatusId'] &&
|
||||
(json['monitorStatusId'] as JSONObject)['value'] !== null
|
||||
) {
|
||||
monitorStatusId = new ObjectID(
|
||||
(json['monitorStatusId'] as JSONObject)['value'] as string
|
||||
);
|
||||
}
|
||||
|
||||
const filterCondition: FilterCondition = json[
|
||||
'filterCondition'
|
||||
] as FilterCondition;
|
||||
|
||||
const filters: Array<CriteriaFilter> = [];
|
||||
|
||||
const incidents: Array<CriteriaIncident> = [];
|
||||
|
||||
for (const filter of json['filters']) {
|
||||
filters.push({ ...(filter as any) });
|
||||
}
|
||||
|
||||
for (const incident of json['incidents']) {
|
||||
incidents.push({ ...(incident as any) });
|
||||
}
|
||||
|
||||
const monitorCriteriaInstance: MonitorCriteriaInstance =
|
||||
new MonitorCriteriaInstance();
|
||||
|
||||
monitorCriteriaInstance.data = JSONFunctions.deserialize({
|
||||
id: (json['id'] as string) || ObjectID.generate().toString(),
|
||||
monitorStatusId,
|
||||
filterCondition,
|
||||
changeMonitorStatus:
|
||||
(json['changeMonitorStatus'] as boolean) || false,
|
||||
createIncidents: (json['createIncidents'] as boolean) || false,
|
||||
filters: filters as any,
|
||||
incidents: incidents as any,
|
||||
name: (json['name'] as string) || '',
|
||||
description: (json['description'] as string) || '',
|
||||
}) as any;
|
||||
|
||||
return monitorCriteriaInstance;
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static override toDatabase(
|
||||
_value: MonitorCriteriaInstance | FindOperator<MonitorCriteriaInstance>
|
||||
value: MonitorCriteriaInstance | FindOperator<MonitorCriteriaInstance>
|
||||
): JSONObject | null {
|
||||
if (_value) {
|
||||
return (_value as MonitorCriteriaInstance).toJSON();
|
||||
if (value && value instanceof MonitorCriteriaInstance) {
|
||||
return (value as MonitorCriteriaInstance).toJSON();
|
||||
} else if (value) {
|
||||
return JSONFunctions.serialize(value as any);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -86,7 +460,7 @@ export default class MonitorCriteriaInstance extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorCriteriaInstance | null {
|
||||
if (value) {
|
||||
return new MonitorCriteriaInstance().fromJSON(value);
|
||||
return MonitorCriteriaInstance.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export default class MonitorCustomFields {}
|
||||
@@ -1,43 +1,171 @@
|
||||
import { FindOperator } from 'typeorm';
|
||||
import DatabaseProperty from '../Database/DatabaseProperty';
|
||||
import { JSONObject } from '../JSON';
|
||||
import { JSONObject, ObjectType } from '../JSON';
|
||||
import URL from '../API/URL';
|
||||
import IP from '../IP/IP';
|
||||
import MonitorCriteria from './MonitorCriteria';
|
||||
import BadDataException from '../Exception/BadDataException';
|
||||
import HTTPMethod from '../API/HTTPMethod';
|
||||
import Dictionary from '../Dictionary';
|
||||
import ObjectID from '../ObjectID';
|
||||
import MonitorType from './MonitorType';
|
||||
import JSONFunctions from '../JSONFunctions';
|
||||
|
||||
export interface MonitorStepType {
|
||||
monitorDestination: URL | IP;
|
||||
id: string;
|
||||
monitorDestination?: URL | IP | undefined;
|
||||
monitorCriteria: MonitorCriteria;
|
||||
requestType: HTTPMethod;
|
||||
requestHeaders?: Dictionary<string> | undefined;
|
||||
requestBody?: string | undefined;
|
||||
}
|
||||
|
||||
export default class MonitorStep extends DatabaseProperty {
|
||||
public monitorStep: MonitorStepType | undefined = undefined;
|
||||
public data: MonitorStepType | undefined = undefined;
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
|
||||
this.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorDestination: undefined,
|
||||
monitorCriteria: new MonitorCriteria(),
|
||||
requestType: HTTPMethod.GET,
|
||||
requestHeaders: undefined,
|
||||
requestBody: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
public static isValid(_json: JSONObject): boolean {
|
||||
return true;
|
||||
public static getDefaultMoniorStep(arg: {
|
||||
monitorType: MonitorType;
|
||||
onlineMonitorStatusId: ObjectID;
|
||||
offlineMonitorStatusId: ObjectID;
|
||||
defaultIncidentSeverityId: ObjectID;
|
||||
}): MonitorStep {
|
||||
const monitorStep: MonitorStep = new MonitorStep();
|
||||
|
||||
monitorStep.data = {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorDestination: undefined,
|
||||
monitorCriteria: MonitorCriteria.getDefaultMonitorCriteria(arg),
|
||||
requestType: HTTPMethod.GET,
|
||||
requestHeaders: undefined,
|
||||
requestBody: undefined,
|
||||
};
|
||||
|
||||
return monitorStep;
|
||||
}
|
||||
|
||||
public toJSON(): JSONObject {
|
||||
if (this.monitorStep) {
|
||||
return {
|
||||
_type: 'MonitorStep',
|
||||
value: {
|
||||
monitorDestination:
|
||||
this.monitorStep.monitorDestination.toJSON(),
|
||||
monitorCriteria: this.monitorStep.monitorCriteria.toJSON(),
|
||||
},
|
||||
};
|
||||
public get id(): ObjectID {
|
||||
return new ObjectID(this.data?.id!);
|
||||
}
|
||||
|
||||
public set id(v: ObjectID) {
|
||||
this.data!.id = v.toString();
|
||||
}
|
||||
|
||||
public setRequestType(requestType: HTTPMethod): MonitorStep {
|
||||
this.data!.requestType = requestType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setRequestHeaders(requestHeaders: Dictionary<string>): MonitorStep {
|
||||
this.data!.requestHeaders = requestHeaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static clone(monitorStep: MonitorStep): MonitorStep {
|
||||
return MonitorStep.fromJSON(monitorStep.toJSON());
|
||||
}
|
||||
|
||||
public setRequestBody(requestBody: string): MonitorStep {
|
||||
this.data!.requestBody = requestBody;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setMonitorDestination(monitorDestination: URL | IP): MonitorStep {
|
||||
this.data!.monitorDestination = monitorDestination;
|
||||
return this;
|
||||
}
|
||||
|
||||
public setMonitorCriteria(monitorCriteria: MonitorCriteria): MonitorStep {
|
||||
this.data!.monitorCriteria = monitorCriteria;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static getNewMonitorStepAsJSON(): JSONObject {
|
||||
return {
|
||||
_type: ObjectType.MonitorStep,
|
||||
value: {
|
||||
id: ObjectID.generate().toString(),
|
||||
monitorDestination: undefined,
|
||||
monitorCriteria: MonitorCriteria.getNewMonitorCriteriaAsJSON(),
|
||||
requestType: HTTPMethod.GET,
|
||||
requestHeaders: undefined,
|
||||
requestBody: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public static getValidationError(
|
||||
value: MonitorStep,
|
||||
monitorType: MonitorType
|
||||
): string | null {
|
||||
if (!value.data) {
|
||||
return 'Monitor Step is required';
|
||||
}
|
||||
|
||||
return {};
|
||||
if (!value.data.monitorDestination) {
|
||||
return 'Monitor Destination is required';
|
||||
}
|
||||
|
||||
if (!value.data.monitorCriteria) {
|
||||
return 'Monitor Criteria is required';
|
||||
}
|
||||
|
||||
if (
|
||||
!MonitorCriteria.getValidationError(
|
||||
value.data.monitorCriteria,
|
||||
monitorType
|
||||
)
|
||||
) {
|
||||
return MonitorCriteria.getValidationError(
|
||||
value.data.monitorCriteria,
|
||||
monitorType
|
||||
);
|
||||
}
|
||||
|
||||
if (!value.data.requestType && monitorType === MonitorType.API) {
|
||||
return 'Request Type is required';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public fromJSON(json: JSONObject): MonitorStep {
|
||||
public override toJSON(): JSONObject {
|
||||
if (this.data) {
|
||||
return JSONFunctions.serialize({
|
||||
_type: ObjectType.MonitorStep,
|
||||
value: {
|
||||
id: this.data.id,
|
||||
monitorDestination:
|
||||
this.data?.monitorDestination?.toJSON() || undefined,
|
||||
monitorCriteria: this.data.monitorCriteria.toJSON(),
|
||||
requestType: this.data.requestType,
|
||||
requestHeaders: this.data.requestHeaders || undefined,
|
||||
requestBody: this.data.requestBody || undefined,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return MonitorStep.getNewMonitorStepAsJSON();
|
||||
}
|
||||
|
||||
public static override fromJSON(json: JSONObject): MonitorStep {
|
||||
if (json instanceof MonitorStep) {
|
||||
return json;
|
||||
}
|
||||
|
||||
if (!json || json['_type'] !== 'MonitorStep') {
|
||||
throw new BadDataException('Invalid monitor step');
|
||||
}
|
||||
@@ -70,10 +198,6 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
);
|
||||
}
|
||||
|
||||
if (!monitorDestination) {
|
||||
throw new BadDataException('Invalid monitor destination');
|
||||
}
|
||||
|
||||
if (!json['monitorCriteria']) {
|
||||
throw new BadDataException('Invalid monitor criteria');
|
||||
}
|
||||
@@ -85,14 +209,21 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
throw new BadDataException('Invalid monitor criteria');
|
||||
}
|
||||
|
||||
this.monitorStep = {
|
||||
monitorDestination: monitorDestination,
|
||||
monitorCriteria: new MonitorCriteria().fromJSON(
|
||||
const monitorStep: MonitorStep = new MonitorStep();
|
||||
|
||||
monitorStep.data = JSONFunctions.deserialize({
|
||||
id: json['id'] as string,
|
||||
monitorDestination: monitorDestination || undefined,
|
||||
monitorCriteria: MonitorCriteria.fromJSON(
|
||||
json['monitorCriteria'] as JSONObject
|
||||
),
|
||||
};
|
||||
requestType: (json['requestType'] as HTTPMethod) || HTTPMethod.GET,
|
||||
requestHeaders:
|
||||
(json['requestHeaders'] as Dictionary<string>) || undefined,
|
||||
requestBody: (json['requestBody'] as string) || undefined,
|
||||
}) as any;
|
||||
|
||||
return this;
|
||||
return monitorStep;
|
||||
}
|
||||
|
||||
public isValid(): boolean {
|
||||
@@ -100,10 +231,12 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
}
|
||||
|
||||
protected static override toDatabase(
|
||||
_value: MonitorStep | FindOperator<MonitorStep>
|
||||
value: MonitorStep | FindOperator<MonitorStep>
|
||||
): JSONObject | null {
|
||||
if (_value) {
|
||||
return (_value as MonitorStep).toJSON();
|
||||
if (value && value instanceof MonitorStep) {
|
||||
return (value as MonitorStep).toJSON();
|
||||
} else if (value) {
|
||||
return JSONFunctions.serialize(value as any);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -113,7 +246,7 @@ export default class MonitorStep extends DatabaseProperty {
|
||||
value: JSONObject
|
||||
): MonitorStep | null {
|
||||
if (value) {
|
||||
return new MonitorStep().fromJSON(value);
|
||||
return MonitorStep.fromJSON(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user