mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Compare commits
708
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b17bbaa5a4 | ||
|
|
7952eafdf0 | ||
|
|
de9b0e6eee | ||
|
|
aeffeb8cc8 | ||
|
|
a11cbc3799 | ||
|
|
b0eb6434b8 | ||
|
|
fe28af292b | ||
|
|
6b4ecbcd23 | ||
|
|
f58c8c5370 | ||
|
|
4228bc9b63 | ||
|
|
ed8c39f649 | ||
|
|
c0bd4401c5 | ||
|
|
cd647e0c18 | ||
|
|
8906d94e8f | ||
|
|
68e0083566 | ||
|
|
f4e8d72593 | ||
|
|
dd3f92856a | ||
|
|
e6e28f32ff | ||
|
|
fb6ec704a1 | ||
|
|
0f8e1db044 | ||
|
|
772ca7d36c | ||
|
|
189f2e05e0 | ||
|
|
b2f7ed48dd | ||
|
|
ecd77cb2e3 | ||
|
|
8d3070416a | ||
|
|
6e422ebe3c | ||
|
|
3c602e84e6 | ||
|
|
1cacb87c65 | ||
|
|
8e4bd363d2 | ||
|
|
b7c2220648 | ||
|
|
85de3d27d8 | ||
|
|
c7ab1dda9f | ||
|
|
c1f62ce0bd | ||
|
|
74d946e42a | ||
|
|
523a8b6ff6 | ||
|
|
06c87a28c9 | ||
|
|
b9e8c1d8bc | ||
|
|
53660f3100 | ||
|
|
bea723ff2e | ||
|
|
ba58a372d1 | ||
|
|
59e43b1035 | ||
|
|
304f67c88f | ||
|
|
8e2571539c | ||
|
|
3e0323dae8 | ||
|
|
d0181787b9 | ||
|
|
f08ea92df4 | ||
|
|
c3120f4aaa | ||
|
|
969c58fda9 | ||
|
|
49814c2a7e | ||
|
|
f9141ca564 | ||
|
|
4edec1494a | ||
|
|
0b60898ad5 | ||
|
|
82ce35029a | ||
|
|
93f86e57ea | ||
|
|
a46c5d1029 | ||
|
|
88b229b13e | ||
|
|
3ed87a8ab9 | ||
|
|
6e86527eb6 | ||
|
|
5d9bdd4cc7 | ||
|
|
6852ee1f0f | ||
|
|
81c3d96629 | ||
|
|
1acbff316e | ||
|
|
f02707627f | ||
|
|
0df1396d52 | ||
|
|
c4509f5ce7 | ||
|
|
3f0857b36d | ||
|
|
e3f64c3234 | ||
|
|
2c36fab1c6 | ||
|
|
f8d92c04ad | ||
|
|
950cc420a2 | ||
|
|
cbb943cc88 | ||
|
|
862664dd62 | ||
|
|
498f9e40c8 | ||
|
|
dc40fd7ddc | ||
|
|
a6281992b1 | ||
|
|
3be50d2ab5 | ||
|
|
2a2bf7f154 | ||
|
|
9a8ba13dbf | ||
|
|
ecdea8b487 | ||
|
|
5f6e65c1aa | ||
|
|
932f34df92 | ||
|
|
fd5a900758 | ||
|
|
fb7223bd1b | ||
|
|
b1685a5ca1 | ||
|
|
c3656fd4e7 | ||
|
|
b3c9e6181f | ||
|
|
04733e25c8 | ||
|
|
67084374fb | ||
|
|
4d9521edc6 | ||
|
|
1dd0b419c5 | ||
|
|
636b0775fd | ||
|
|
c4a506445d | ||
|
|
8d046f021c | ||
|
|
2d0885ed70 | ||
|
|
ffe153630d | ||
|
|
6cd9fc72d9 | ||
|
|
312d1029c0 | ||
|
|
fb802c7fe4 | ||
|
|
942775c352 | ||
|
|
f5852a52e2 | ||
|
|
ff89da513f | ||
|
|
49ab765ee8 | ||
|
|
2495101dfd | ||
|
|
07cdd66296 | ||
|
|
e1b4917acf | ||
|
|
796a1b5bd2 | ||
|
|
881525f349 | ||
|
|
8086d6eef0 | ||
|
|
badbcaf1a8 | ||
|
|
e6d9c5c5fd | ||
|
|
86c26f2dc7 | ||
|
|
2c453d5fd9 | ||
|
|
3bd8405deb | ||
|
|
a20ff31ba3 | ||
|
|
fed98ffdfe | ||
|
|
31a5a175b3 | ||
|
|
0ae70f8321 | ||
|
|
954ed45a36 | ||
|
|
57bc76edc7 | ||
|
|
fcd31f4cff | ||
|
|
2d7b01aa35 | ||
|
|
2243f0c72e | ||
|
|
c3c568653f | ||
|
|
403083b0ce | ||
|
|
e5ef825ac4 | ||
|
|
abd953974d | ||
|
|
7297188c1b | ||
|
|
2a672f5a63 | ||
|
|
a160b0f987 | ||
|
|
01e2eb5025 | ||
|
|
baffa615e6 | ||
|
|
bd87672607 | ||
|
|
31c326fe87 | ||
|
|
0dc319d244 | ||
|
|
2e784c0e8b | ||
|
|
1660c0b00c | ||
|
|
96327a9ebc | ||
|
|
32a5ff4c8c | ||
|
|
31b1663f6b | ||
|
|
c152d8e001 | ||
|
|
8fd6208502 | ||
|
|
938505da51 | ||
|
|
30462b1951 | ||
|
|
b46de29735 | ||
|
|
d92413fd6b | ||
|
|
ae0cdaff63 | ||
|
|
4698323f38 | ||
|
|
612b064d2a | ||
|
|
2a7038bb8e | ||
|
|
2c434924de | ||
|
|
d9b7a018ea | ||
|
|
abcaf6cd73 | ||
|
|
81ee68e219 | ||
|
|
e14ae7ea4a | ||
|
|
ec21effd2c | ||
|
|
7399362c20 | ||
|
|
d5ad714f5a | ||
|
|
1389bab3d1 | ||
|
|
100189c0fb | ||
|
|
d36a09eec6 | ||
|
|
1a5e9748f3 | ||
|
|
22939831f2 | ||
|
|
2069c9fdad | ||
|
|
a4c18c4b77 | ||
|
|
cba700402b | ||
|
|
60399aaa0a | ||
|
|
ad7552e676 | ||
|
|
93839ec36d | ||
|
|
17dc8e3f8a | ||
|
|
f4d01f4c37 | ||
|
|
cfb1f4fcdb | ||
|
|
05067302d2 | ||
|
|
1a54bd58a6 | ||
|
|
c443a2f999 | ||
|
|
c79e8e5b95 | ||
|
|
9f537a5bee | ||
|
|
a60d19fb42 | ||
|
|
ef7cf41a61 | ||
|
|
8b1e97bae4 | ||
|
|
7b8f25696c | ||
|
|
91ad4097ff | ||
|
|
d9d38197dd | ||
|
|
a8b2ebb356 | ||
|
|
c53262a44c | ||
|
|
8339435fb5 | ||
|
|
424a357503 | ||
|
|
35cd2b5295 | ||
|
|
9a7512d1fd | ||
|
|
989fa2b8a0 | ||
|
|
a461d5bf72 | ||
|
|
cb2d0dc592 | ||
|
|
a9d1f6668f | ||
|
|
9d020fdef5 | ||
|
|
f25143b240 | ||
|
|
d89cdbcf5a | ||
|
|
8447732614 | ||
|
|
9f446da0a5 | ||
|
|
62effa7bc4 | ||
|
|
dedcdc2e0e | ||
|
|
854256e8a6 | ||
|
|
d72f69f792 | ||
|
|
7fdde1a518 | ||
|
|
6195674611 | ||
|
|
4804bdf110 | ||
|
|
cb356bc410 | ||
|
|
74d9a3c181 | ||
|
|
6bcdc8c769 | ||
|
|
c9c9db5640 | ||
|
|
a20140eb36 | ||
|
|
c0cb4b26a3 | ||
|
|
b842e03f38 | ||
|
|
16aca35bd4 | ||
|
|
2795505e82 | ||
|
|
5799ca1041 | ||
|
|
e11e7e6780 | ||
|
|
e93010c5fe | ||
|
|
d677b8ed88 | ||
|
|
0648de2046 | ||
|
|
3399308ee3 | ||
|
|
42f72b4477 | ||
|
|
25b6d59e30 | ||
|
|
5479e6f8f1 | ||
|
|
586e676299 | ||
|
|
26821c8372 | ||
|
|
56d78b1712 | ||
|
|
e4c4ffdb3c | ||
|
|
6e146889bf | ||
|
|
ab1683070b | ||
|
|
9f3d15bd1c | ||
|
|
a7199ff980 | ||
|
|
37dfe0d719 | ||
|
|
86856bf87d | ||
|
|
7c2ab4fcf6 | ||
|
|
29ea03b7bb | ||
|
|
434fcdc508 | ||
|
|
ed7c2fa451 | ||
|
|
d661195a5f | ||
|
|
50e7986f84 | ||
|
|
c7301af18a | ||
|
|
c0c0c921dc | ||
|
|
7c795da72f | ||
|
|
13750f7dbd | ||
|
|
69bdf50c85 | ||
|
|
ea02639767 | ||
|
|
bd19da2e7a | ||
|
|
b0b57935da | ||
|
|
7c3f8504bb | ||
|
|
6c0ce5cc41 | ||
|
|
403e5773a2 | ||
|
|
9d82892219 | ||
|
|
5eb7c36f50 | ||
|
|
68e8b7ca2b | ||
|
|
9c54cce5bd | ||
|
|
9345025ade | ||
|
|
31ca35782b | ||
|
|
438d5185a9 | ||
|
|
2505e25da8 | ||
|
|
cc0a97b10e | ||
|
|
d3cabcd5ac | ||
|
|
84133ef631 | ||
|
|
2be59a94da | ||
|
|
88d6150db2 | ||
|
|
faed019d92 | ||
|
|
b318c2cc08 | ||
|
|
eb4340cf4c | ||
|
|
ee09e2c91b | ||
|
|
e6e7c5c816 | ||
|
|
e9841e53b9 | ||
|
|
fca2e95fdd | ||
|
|
5683c310db | ||
|
|
7d86ce76d8 | ||
|
|
795928a037 | ||
|
|
aab8bca91e | ||
|
|
70e27748be | ||
|
|
556e00b62b | ||
|
|
370a8e231c | ||
|
|
aa5ea7f3a1 | ||
|
|
8a77eaf2bb | ||
|
|
fe308b4f1f | ||
|
|
e43a3109eb | ||
|
|
d9fbe9658d | ||
|
|
1e2f5bcb84 | ||
|
|
088d0998cd | ||
|
|
a7165e6a32 | ||
|
|
5f7ceecb30 | ||
|
|
e5261e7d70 | ||
|
|
60912cb084 | ||
|
|
7149deeacb | ||
|
|
59f613f9bb | ||
|
|
8184bc8c78 | ||
|
|
bbfd22ce2e | ||
|
|
9cb860d446 | ||
|
|
6eff011100 | ||
|
|
8fd877810d | ||
|
|
04711d8c02 | ||
|
|
5a5d43f3d0 | ||
|
|
3e462ded0a | ||
|
|
de96b2511a | ||
|
|
ab790f6c02 | ||
|
|
ff618a0565 | ||
|
|
b3db296f13 | ||
|
|
e019e426f1 | ||
|
|
90899b92e3 | ||
|
|
adacec4ad1 | ||
|
|
4eece99768 | ||
|
|
971a4b8f30 | ||
|
|
418185b914 | ||
|
|
167011ce87 | ||
|
|
3d69a35d5a | ||
|
|
aac90ea8b8 | ||
|
|
56aa503146 | ||
|
|
875a60fe07 | ||
|
|
3427755695 | ||
|
|
68238193d2 | ||
|
|
07926534bf | ||
|
|
a2a0a1405f | ||
|
|
195edd19ac | ||
|
|
6cf333141c | ||
|
|
12dbb1d50d | ||
|
|
9dff192508 | ||
|
|
650627bfb4 | ||
|
|
4016895b8f | ||
|
|
3b7aea22c2 | ||
|
|
50fe0bf98d | ||
|
|
4f0a7de868 | ||
|
|
1933e48d9c | ||
|
|
90228a5ffb | ||
|
|
063c2be38f | ||
|
|
ff9845c9b9 | ||
|
|
bd5bfc04ef | ||
|
|
c55030387f | ||
|
|
5f2512dc4f | ||
|
|
f6fc425c98 | ||
|
|
810d650aba | ||
|
|
817a3808e5 | ||
|
|
d96910138f | ||
|
|
b8673ac07f | ||
|
|
246c8ce939 | ||
|
|
49d89a4206 | ||
|
|
2c803b262c | ||
|
|
fcf15689e8 | ||
|
|
aef38aa114 | ||
|
|
d81f2f8b5c | ||
|
|
e119bf6777 | ||
|
|
7402145c9d | ||
|
|
74f4ebf90e | ||
|
|
a60d916c51 | ||
|
|
d522b1a04c | ||
|
|
4b740dce86 | ||
|
|
6a05bd4e0d | ||
|
|
d6e53d8e2e | ||
|
|
e3f59c696d | ||
|
|
107a185953 | ||
|
|
0570567b2e | ||
|
|
3a29bcb41b | ||
|
|
f6b5deda6d | ||
|
|
d9fc6b70ad | ||
|
|
a0605b14cb | ||
|
|
6c652ba3ae | ||
|
|
1b3fe3046d | ||
|
|
7c91157dc8 | ||
|
|
584e4c0d75 | ||
|
|
f0477f8940 | ||
|
|
3bc81c82ec | ||
|
|
2a5b3317bf | ||
|
|
19ad2088a0 | ||
|
|
12eb3b4eea | ||
|
|
adb451234b | ||
|
|
52a73856bc | ||
|
|
921b9154eb | ||
|
|
5ed1ca617f | ||
|
|
12f274223f | ||
|
|
368b61493f | ||
|
|
6ad34a7bf7 | ||
|
|
57c7ebb53d | ||
|
|
458df23797 | ||
|
|
369caae87d | ||
|
|
f48791fba6 | ||
|
|
ad56782b49 | ||
|
|
ce5a04a37d | ||
|
|
e8fb2f8ae1 | ||
|
|
e2b9c64f91 | ||
|
|
69e9a1bd8c | ||
|
|
697c30f559 | ||
|
|
1f606a591d | ||
|
|
34d587d7c5 | ||
|
|
e972ccedd6 | ||
|
|
e4369e5e85 | ||
|
|
45b2d58aa5 | ||
|
|
be1c12147f | ||
|
|
4157e89ab7 | ||
|
|
c151d2aaca | ||
|
|
baa40e4007 | ||
|
|
197e32f128 | ||
|
|
39e5c5e734 | ||
|
|
a8a8df602f | ||
|
|
d641177618 | ||
|
|
463bc4aac3 | ||
|
|
e597ee4493 | ||
|
|
00478e8533 | ||
|
|
9aad6721cd | ||
|
|
ec5fd1d798 | ||
|
|
f723948907 | ||
|
|
2106022507 | ||
|
|
e992ed11c1 | ||
|
|
50400c4b43 | ||
|
|
3cfb013f1e | ||
|
|
be27912a6e | ||
|
|
b73b450a2e | ||
|
|
4dc7206e04 | ||
|
|
0547dbc454 | ||
|
|
a3324b7453 | ||
|
|
df017bccb2 | ||
|
|
c4ab6f5aff | ||
|
|
891c1c4093 | ||
|
|
507c8bd3ec | ||
|
|
2de4e71662 | ||
|
|
b18d3bc678 | ||
|
|
0cc5088e8e | ||
|
|
2c4f5d3daa | ||
|
|
1675683e76 | ||
|
|
78dcfd2770 | ||
|
|
87de071f53 | ||
|
|
39585d0438 | ||
|
|
270dfd685d | ||
|
|
de29879793 | ||
|
|
8508e6009b | ||
|
|
a70e323a15 | ||
|
|
ff1bfb61f1 | ||
|
|
54c8a890d3 | ||
|
|
74b06cdd96 | ||
|
|
5113c9e50a | ||
|
|
0052487d49 | ||
|
|
9841f6ae87 | ||
|
|
9b58ae7ff5 | ||
|
|
59c41478ca | ||
|
|
37087c37ca | ||
|
|
066008293d | ||
|
|
b9acae5a25 | ||
|
|
d0452e5d3b | ||
|
|
f94f6642ea | ||
|
|
01dc8fa396 | ||
|
|
430c883a88 | ||
|
|
dbec8c01a9 | ||
|
|
0c37530974 | ||
|
|
5fa4a1232f | ||
|
|
645fbd4f1c | ||
|
|
b2f920d983 | ||
|
|
3c152b8349 | ||
|
|
bad427071e | ||
|
|
419d18bb1c | ||
|
|
6e1675c574 | ||
|
|
561af1d386 | ||
|
|
286f7e6b86 | ||
|
|
fe18afcfca | ||
|
|
348199712a | ||
|
|
1ae7d730ba | ||
|
|
246c334127 | ||
|
|
11867bef50 | ||
|
|
8b0465f129 | ||
|
|
99f736aa52 | ||
|
|
48fd3b371e | ||
|
|
acea8812da | ||
|
|
13597d7c54 | ||
|
|
f4d2583865 | ||
|
|
18f17ff9fb | ||
|
|
a39341ada8 | ||
|
|
c451074278 | ||
|
|
33a8da45bd | ||
|
|
a7d09118e4 | ||
|
|
0e0009dd27 | ||
|
|
3159e5de0c | ||
|
|
e4bdbdd9ba | ||
|
|
cce6222184 | ||
|
|
e154407fc6 | ||
|
|
06b69360f4 | ||
|
|
aa2a45f142 | ||
|
|
54d1ef257d | ||
|
|
39e4a04625 | ||
|
|
9a89cc1332 | ||
|
|
f4637e1b7d | ||
|
|
8f390a70c7 | ||
|
|
c9e6bfbdb3 | ||
|
|
8e0bd8d18d | ||
|
|
d0be46be74 | ||
|
|
dd6cde6ae5 | ||
|
|
714c2f30d7 | ||
|
|
316b739a27 | ||
|
|
b04a85491b | ||
|
|
635dbdb5cb | ||
|
|
d06e41f81e | ||
|
|
1a6f23c3a1 | ||
|
|
ba510a5641 | ||
|
|
cb93b9e1e7 | ||
|
|
61d030b2c6 | ||
|
|
1d49d8284c | ||
|
|
65474df642 | ||
|
|
ac27c77426 | ||
|
|
6e09bcf6c6 | ||
|
|
5e3e0b6683 | ||
|
|
9468b08eb2 | ||
|
|
d2bf15b20b | ||
|
|
b1e5a5b987 | ||
|
|
9ca420a0e6 | ||
|
|
6f8c38dfa0 | ||
|
|
ddb86127b7 | ||
|
|
ea0a5a186c | ||
|
|
928590b175 | ||
|
|
7656ba11ff | ||
|
|
7ae7ccbe49 | ||
|
|
6d376df00a | ||
|
|
0e03842173 | ||
|
|
aa8af5a213 | ||
|
|
f1a3cd13ff | ||
|
|
00989fcdde | ||
|
|
c677374a11 | ||
|
|
3f0a8fbe21 | ||
|
|
7d5ae2f1c3 | ||
|
|
0f8ad539ad | ||
|
|
9839a4ef36 | ||
|
|
e91c762953 | ||
|
|
3f6368f046 | ||
|
|
d802639b0e | ||
|
|
3d333633e4 | ||
|
|
900f64bf8d | ||
|
|
dad8f597ca | ||
|
|
90f18c57ac | ||
|
|
6e7dd26f75 | ||
|
|
9151abc951 | ||
|
|
714f6b62ac | ||
|
|
316693798e | ||
|
|
c7f92fbb02 | ||
|
|
e715f9e90c | ||
|
|
f6ea6d2fc5 | ||
|
|
e626c2ad45 | ||
|
|
3b19ef6b1e | ||
|
|
c1a3b29a97 | ||
|
|
aa2385ffb9 | ||
|
|
8b99517dd0 | ||
|
|
33037a3ae5 | ||
|
|
b0852aeca3 | ||
|
|
09da4378c6 | ||
|
|
a85b43654c | ||
|
|
ad8693c018 | ||
|
|
a0280e3c43 | ||
|
|
76216c3bf6 | ||
|
|
c8c4576bbc | ||
|
|
dac8766eb4 | ||
|
|
f6de256220 | ||
|
|
2f9b44930f | ||
|
|
627df0d11f | ||
|
|
fcd323baa4 | ||
|
|
0009b73b06 | ||
|
|
b5efbdbb0f | ||
|
|
a6e9d58f12 | ||
|
|
b496bcb6df | ||
|
|
030e26b223 | ||
|
|
9e69e41e02 | ||
|
|
773fa6ffd6 | ||
|
|
21bff77c50 | ||
|
|
472f167b4a | ||
|
|
f86bf6fdfd | ||
|
|
f3315c69a0 | ||
|
|
76701b0cca | ||
|
|
2cc73151d1 | ||
|
|
39e237dfb4 | ||
|
|
c624d94c45 | ||
|
|
b22188251d | ||
|
|
68d017f452 | ||
|
|
2ed854893d | ||
|
|
eb083a7e10 | ||
|
|
2076a429c6 | ||
|
|
59766b6ce6 | ||
|
|
36bff12939 | ||
|
|
b4c986839e | ||
|
|
4d81a901cb | ||
|
|
c11888c906 | ||
|
|
e6fb296666 | ||
|
|
d425c9f071 | ||
|
|
e219ee2d84 | ||
|
|
e66d0216c6 | ||
|
|
e3e20d2923 | ||
|
|
e0c503e249 | ||
|
|
c3a8db0ea4 | ||
|
|
228cabab3a | ||
|
|
2b3e7f67a4 | ||
|
|
c2d5e8ec11 | ||
|
|
028c5366c2 | ||
|
|
cca0c3ae45 | ||
|
|
0b85a64dab | ||
|
|
4eafce998d | ||
|
|
4963d98331 | ||
|
|
1633acbdc3 | ||
|
|
9e07579a52 | ||
|
|
16a2d61874 | ||
|
|
75e8635563 | ||
|
|
83e94629dc | ||
|
|
b00b609621 | ||
|
|
cdbd72ec3d | ||
|
|
a6104ad8cd | ||
|
|
6e3160c502 | ||
|
|
104ec3188f | ||
|
|
4e37699e25 | ||
|
|
118252d3af | ||
|
|
509f06c2f0 | ||
|
|
12458af84a | ||
|
|
66bfc5748b | ||
|
|
cf32ba0351 | ||
|
|
b47a4703c4 | ||
|
|
4ceff430f9 | ||
|
|
5603516d88 | ||
|
|
013d95ebf3 | ||
|
|
eca8d116c2 | ||
|
|
8210808db0 | ||
|
|
4a003f2826 | ||
|
|
54f39494c0 | ||
|
|
ae4edf119f | ||
|
|
7be7b3389c | ||
|
|
54555cb3cd | ||
|
|
a56293e018 | ||
|
|
f8b2878943 | ||
|
|
a0c58317bd | ||
|
|
e687c64ca0 | ||
|
|
3ff5472543 | ||
|
|
d979c0c914 | ||
|
|
a41b767400 | ||
|
|
ba0a495d3c | ||
|
|
6435fa84af | ||
|
|
8743330ad8 | ||
|
|
a37aa5551a | ||
|
|
b2521cf8a3 | ||
|
|
c853b6593a | ||
|
|
d980711c30 | ||
|
|
7ab55e0694 | ||
|
|
db244937ff | ||
|
|
bcb593e6df | ||
|
|
9bfab69062 | ||
|
|
5451a9cd23 | ||
|
|
5ea83b8827 | ||
|
|
6fe7d92fea | ||
|
|
28b02a4ba8 | ||
|
|
f4d456fa4c | ||
|
|
687252b15b | ||
|
|
f21b1c87a6 | ||
|
|
ccbde6c470 | ||
|
|
f189c41421 | ||
|
|
5fcb990b1c | ||
|
|
30bd25d134 | ||
|
|
36d2b84301 | ||
|
|
a80b921927 | ||
|
|
1373d62c52 | ||
|
|
d0481482ae | ||
|
|
78b9be2e78 | ||
|
|
a3b7cf84d5 | ||
|
|
add6a60af4 | ||
|
|
4543c182b5 | ||
|
|
051d6e580c | ||
|
|
36e4c8c399 | ||
|
|
7921bd62d9 | ||
|
|
74ecc20751 | ||
|
|
d477de256a | ||
|
|
cffbc77d05 | ||
|
|
16fe23244b | ||
|
|
7d7b2c7544 | ||
|
|
d2c66894fd | ||
|
|
1cd3e69161 | ||
|
|
5850caff35 | ||
|
|
0cce55565a | ||
|
|
6b429c9da9 | ||
|
|
8f6151a575 | ||
|
|
3f19fac0b4 | ||
|
|
08e5ed6a8a | ||
|
|
e4d554689f | ||
|
|
19912c87c9 | ||
|
|
0de1e64958 | ||
|
|
aa0a795ec6 | ||
|
|
d1b062a418 | ||
|
|
812d8a34cf | ||
|
|
ec02d881c9 | ||
|
|
b706571a21 | ||
|
|
134f90a464 | ||
|
|
eb553fa96c | ||
|
|
fd8b7eb6fc | ||
|
|
501411f5b5 | ||
|
|
bee844fcdb | ||
|
|
d18a67e6d8 | ||
|
|
25d44b5b4c | ||
|
|
ee7de0cb41 | ||
|
|
28642b9f04 | ||
|
|
c18308c024 | ||
|
|
1eafbf2ee2 | ||
|
|
b98bcdd4a1 | ||
|
|
4c8cd5b6c6 | ||
|
|
5b37a91b46 | ||
|
|
52647cef23 | ||
|
|
11ec31aefb | ||
|
|
73ca1efbeb | ||
|
|
340aa48d93 | ||
|
|
8ff72b341e | ||
|
|
a23402075e | ||
|
|
6b86ed0117 | ||
|
|
e2a45cec8e | ||
|
|
ec2eb2bfa3 | ||
|
|
10adfc5124 | ||
|
|
5f7aae0e60 | ||
|
|
4952608b8d | ||
|
|
42ebefef92 | ||
|
|
03d33601b0 |
@@ -15,6 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io
|
||||
_APP_EMAIL_SECURITY=security@appwrite.io
|
||||
_APP_EMAIL_CERTIFICATES=certificates@appwrite.io
|
||||
_APP_SYSTEM_RESPONSE_FORMAT=
|
||||
_APP_CUSTOM_DOMAIN_DENY_LIST=
|
||||
_APP_OPTIONS_ABUSE=disabled
|
||||
_APP_OPTIONS_ROUTER_PROTECTION=disabled
|
||||
_APP_OPTIONS_FORCE_HTTPS=disabled
|
||||
@@ -86,6 +87,7 @@ _APP_MAINTENANCE_RETENTION_CACHE=2592000
|
||||
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600
|
||||
_APP_MAINTENANCE_RETENTION_ABUSE=86400
|
||||
_APP_MAINTENANCE_RETENTION_AUDIT=1209600
|
||||
_APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE=15778800
|
||||
_APP_USAGE_AGGREGATION_INTERVAL=30
|
||||
_APP_STATS_RESOURCES_INTERVAL=3600
|
||||
_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
|
||||
+1
-8
@@ -7,6 +7,7 @@ tasks:
|
||||
docker pull composer
|
||||
command: |
|
||||
docker run --rm --interactive --tty \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
--volume $PWD:/app \
|
||||
composer install \
|
||||
--ignore-platform-reqs \
|
||||
@@ -23,11 +24,3 @@ vscode:
|
||||
extensions:
|
||||
- ms-azuretools.vscode-docker
|
||||
- zobo.php-intellisense
|
||||
|
||||
github:
|
||||
# https://www.gitpod.io/docs/prebuilds#github-specific-configuration
|
||||
prebuilds:
|
||||
# enable for pull requests coming from forks (defaults to false)
|
||||
pullRequestsFromForks: true
|
||||
# add a check to pull requests (defaults to true)
|
||||
addCheck: false
|
||||
|
||||
@@ -86,7 +86,6 @@ RUN chmod +x /usr/local/bin/doctor && \
|
||||
chmod +x /usr/local/bin/worker-migrations && \
|
||||
chmod +x /usr/local/bin/worker-webhooks && \
|
||||
chmod +x /usr/local/bin/worker-stats-usage && \
|
||||
chmod +x /usr/local/bin/worker-stats-usage-dump && \
|
||||
chmod +x /usr/local/bin/stats-resources && \
|
||||
chmod +x /usr/local/bin/worker-stats-resources
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
> Appwrite Init has concluded! You can check out all the latest announcements [on our Init website](https://appwrite.io/init) :rocket:
|
||||
> [Get started with Appwrite](https://apwr.dev/appcloud)
|
||||
|
||||
<br />
|
||||
<p align="center">
|
||||
@@ -24,11 +24,9 @@
|
||||
|
||||
English | [简体中文](README-CN.md)
|
||||
|
||||
[**Announcing Appwrite Cloud Public Beta! Sign up today!**](https://cloud.appwrite.io)
|
||||
|
||||
Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker<nobr> microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster.
|
||||
|
||||
Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, and [more services](https://appwrite.io/docs).
|
||||
Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, messaging, and [more services](https://appwrite.io/docs).
|
||||
|
||||
<p align="center">
|
||||
<br />
|
||||
@@ -52,7 +50,7 @@ Table of Contents:
|
||||
- [Upgrade from an Older Version](#upgrade-from-an-older-version)
|
||||
- [One-Click Setups](#one-click-setups)
|
||||
- [Getting Started](#getting-started)
|
||||
- [Services](#services)
|
||||
- [Products](#products)
|
||||
- [SDKs](#sdks)
|
||||
- [Client](#client)
|
||||
- [Server](#server)
|
||||
|
||||
+31
-11
@@ -9,6 +9,7 @@ use Appwrite\Event\StatsResources;
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Platform\Appwrite;
|
||||
use Appwrite\Runtimes\Runtimes;
|
||||
use Executor\Executor;
|
||||
use Utopia\Cache\Adapter\Sharding;
|
||||
use Utopia\Cache\Cache;
|
||||
use Utopia\CLI\CLI;
|
||||
@@ -25,7 +26,7 @@ use Utopia\Queue\Publisher;
|
||||
use Utopia\Registry\Registry;
|
||||
use Utopia\System\System;
|
||||
|
||||
// overwriting runtimes to be architectur agnostic for CLI
|
||||
// Overwriting runtimes to be architecture agnostic for CLI
|
||||
Config::setParam('runtimes', (new Runtimes('v4'))->getAll(supported: false));
|
||||
|
||||
// require controllers after overwriting runtimes
|
||||
@@ -43,8 +44,7 @@ CLI::setResource('cache', function ($pools) {
|
||||
$adapters[] = $pools
|
||||
->get($value)
|
||||
->pop()
|
||||
->getResource()
|
||||
;
|
||||
->getResource();
|
||||
}
|
||||
|
||||
return new Cache(new Sharding($adapters));
|
||||
@@ -187,7 +187,7 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) {
|
||||
$database
|
||||
->setSharedTables(true)
|
||||
->setNamespace('logsV1')
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS)
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_TASK)
|
||||
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
|
||||
|
||||
// set tenant
|
||||
@@ -219,6 +219,13 @@ CLI::setResource('queueForCertificates', function (Publisher $publisher) {
|
||||
}, ['publisher']);
|
||||
CLI::setResource('logError', function (Registry $register) {
|
||||
return function (Throwable $error, string $namespace, string $action) use ($register) {
|
||||
Console::error('[Error] Timestamp: ' . date('c', time()));
|
||||
Console::error('[Error] Type: ' . get_class($error));
|
||||
Console::error('[Error] Message: ' . $error->getMessage());
|
||||
Console::error('[Error] File: ' . $error->getFile());
|
||||
Console::error('[Error] Line: ' . $error->getLine());
|
||||
Console::error('[Error] Trace: ' . $error->getTraceAsString());
|
||||
|
||||
$logger = $register->get('logger');
|
||||
|
||||
if ($logger) {
|
||||
@@ -237,6 +244,7 @@ CLI::setResource('logError', function (Registry $register) {
|
||||
$log->addExtra('file', $error->getFile());
|
||||
$log->addExtra('line', $error->getLine());
|
||||
$log->addExtra('trace', $error->getTraceAsString());
|
||||
$log->addExtra('detailedTrace', $error->getTrace());
|
||||
|
||||
$log->setAction($action);
|
||||
|
||||
@@ -250,22 +258,34 @@ CLI::setResource('logError', function (Registry $register) {
|
||||
Console::error('Error pushing log: ' . $th->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
Console::warning("Failed: {$error->getMessage()}");
|
||||
Console::warning($error->getTraceAsString());
|
||||
};
|
||||
}, ['register']);
|
||||
|
||||
$platform = new Appwrite();
|
||||
$platform->init(Service::TYPE_TASK);
|
||||
CLI::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST')));
|
||||
|
||||
$platform = new Appwrite();
|
||||
$args = $platform->getEnv('argv');
|
||||
|
||||
if (!isset($args[0])) {
|
||||
Console::error('Missing task name');
|
||||
Console::exit(1);
|
||||
}
|
||||
|
||||
\array_shift($args);
|
||||
$taskName = $args[0];
|
||||
$platform->init(Service::TYPE_TASK);
|
||||
$cli = $platform->getCli();
|
||||
|
||||
$cli
|
||||
->error()
|
||||
->inject('error')
|
||||
->action(function (Throwable $error) {
|
||||
Console::error($error->getMessage());
|
||||
->inject('logError')
|
||||
->action(function (Throwable $error, callable $logError) use ($taskName) {
|
||||
call_user_func_array($logError, [
|
||||
$error,
|
||||
'Task',
|
||||
$taskName,
|
||||
]);
|
||||
});
|
||||
|
||||
$cli->run();
|
||||
|
||||
@@ -1038,7 +1038,7 @@ return [
|
||||
'$id' => ID::custom('providerUid'),
|
||||
'type' => Database::VAR_STRING,
|
||||
'format' => '',
|
||||
'size' => 2048,
|
||||
'size' => 2048, // Decrease to 128 as in index length?
|
||||
'signed' => true,
|
||||
'required' => false,
|
||||
'default' => null,
|
||||
@@ -1107,14 +1107,14 @@ return [
|
||||
'$id' => ID::custom('_key_userInternalId_provider_providerUid'),
|
||||
'type' => Database::INDEX_UNIQUE,
|
||||
'attributes' => ['userInternalId', 'provider', 'providerUid'],
|
||||
'lengths' => [11, 128, 128],
|
||||
'lengths' => [11, 128, 128], // providerUid is length 2000!
|
||||
'orders' => [Database::ORDER_ASC, Database::ORDER_ASC],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_key_provider_providerUid'),
|
||||
'type' => Database::INDEX_UNIQUE,
|
||||
'attributes' => ['provider', 'providerUid'],
|
||||
'lengths' => [128, 128],
|
||||
'lengths' => [128, 128], // providerUid is length 2000!
|
||||
'orders' => [Database::ORDER_ASC, Database::ORDER_ASC],
|
||||
],
|
||||
[
|
||||
|
||||
@@ -1066,7 +1066,29 @@ return [
|
||||
'default' => null,
|
||||
'array' => false,
|
||||
'filters' => [],
|
||||
]
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('owner'),
|
||||
'type' => Database::VAR_STRING,
|
||||
'format' => '',
|
||||
'size' => 16,
|
||||
'signed' => true,
|
||||
'required' => false,
|
||||
'default' => '', // "Appwrite" or empty string
|
||||
'array' => false,
|
||||
'filters' => [],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('region'),
|
||||
'type' => Database::VAR_STRING,
|
||||
'format' => '',
|
||||
'size' => 16,
|
||||
'signed' => true,
|
||||
'required' => true,
|
||||
'default' => null,
|
||||
'array' => false,
|
||||
'filters' => [],
|
||||
],
|
||||
],
|
||||
'indexes' => [
|
||||
[
|
||||
@@ -1111,6 +1133,20 @@ return [
|
||||
'lengths' => [],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_key_owner'),
|
||||
'type' => Database::INDEX_KEY,
|
||||
'attributes' => ['owner'],
|
||||
'lengths' => [16],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_key_region'),
|
||||
'type' => Database::INDEX_KEY,
|
||||
'attributes' => ['region'],
|
||||
'lengths' => [16],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ $console = [
|
||||
'hostname' => 'localhost',
|
||||
], // Current host is added on app init
|
||||
],
|
||||
'region' => 'fra',
|
||||
'legalName' => '',
|
||||
'legalCountry' => '',
|
||||
'legalState' => '',
|
||||
|
||||
@@ -593,6 +593,11 @@ return [
|
||||
'description' => 'Database timed out. Try adjusting your queries or adding an index.',
|
||||
'code' => 408
|
||||
],
|
||||
Exception::DATABASE_QUERY_ORDER_NULL => [
|
||||
'name' => Exception::DATABASE_QUERY_ORDER_NULL,
|
||||
'description' => 'The order attribute had a null value. Cursor pagination requires all documents order attribute values are non-null.',
|
||||
'code' => 400,
|
||||
],
|
||||
|
||||
/** Collections */
|
||||
Exception::COLLECTION_NOT_FOUND => [
|
||||
|
||||
@@ -1,11 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Continent codes with names and approximate central coordinates
|
||||
*
|
||||
* Coordinates represent approximate geographical centers of each continent
|
||||
* Note: These are simplified centroids and may not represent the exact geographical center
|
||||
*/
|
||||
|
||||
return [
|
||||
'AF',
|
||||
'AN',
|
||||
'AS',
|
||||
'EU',
|
||||
'NA',
|
||||
'OC',
|
||||
'SA',
|
||||
'AF' => [
|
||||
'name' => 'Africa',
|
||||
'latitude' => 8.7832,
|
||||
'longitude' => 34.5085
|
||||
],
|
||||
'AN' => [
|
||||
'name' => 'Antarctica',
|
||||
'latitude' => -82.8628,
|
||||
'longitude' => 135.0000
|
||||
],
|
||||
'AS' => [
|
||||
'name' => 'Asia',
|
||||
'latitude' => 34.0479,
|
||||
'longitude' => 100.6197
|
||||
],
|
||||
'EU' => [
|
||||
'name' => 'Europe',
|
||||
'latitude' => 54.5260,
|
||||
'longitude' => 15.2551
|
||||
],
|
||||
'NA' => [
|
||||
'name' => 'North America',
|
||||
'latitude' => 54.5260,
|
||||
'longitude' => -105.2551
|
||||
],
|
||||
'OC' => [
|
||||
'name' => 'Oceania',
|
||||
'latitude' => -22.7359,
|
||||
'longitude' => 140.0188
|
||||
],
|
||||
'SA' => [
|
||||
'name' => 'South America',
|
||||
'latitude' => -8.7832,
|
||||
'longitude' => -55.4915
|
||||
],
|
||||
];
|
||||
|
||||
+199
-198
@@ -1,209 +1,210 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ISO 3166 standard country codes
|
||||
* ISO 3166 standard country codes with country names and coordinates
|
||||
* https://www.iso.org/iso-3166-country-codes.html
|
||||
*
|
||||
* Source:
|
||||
* https://www.iso.org/obp/ui/#search/code/
|
||||
* Coordinates source: Natural Earth Data (approximate country centroids)
|
||||
*/
|
||||
|
||||
return [
|
||||
'AF',
|
||||
'AO',
|
||||
'AL',
|
||||
'AD',
|
||||
'AE',
|
||||
'AR',
|
||||
'AM',
|
||||
'AG',
|
||||
'AU',
|
||||
'AT',
|
||||
'AZ',
|
||||
'BI',
|
||||
'BE',
|
||||
'BJ',
|
||||
'BF',
|
||||
'BD',
|
||||
'BG',
|
||||
'BH',
|
||||
'BS',
|
||||
'BA',
|
||||
'BY',
|
||||
'BZ',
|
||||
'BO',
|
||||
'BR',
|
||||
'BB',
|
||||
'BN',
|
||||
'BT',
|
||||
'BW',
|
||||
'CF',
|
||||
'CA',
|
||||
'CH',
|
||||
'CL',
|
||||
'CN',
|
||||
'CI',
|
||||
'CM',
|
||||
'CD',
|
||||
'CG',
|
||||
'CO',
|
||||
'KM',
|
||||
'CV',
|
||||
'CR',
|
||||
'CU',
|
||||
'CY',
|
||||
'CZ',
|
||||
'DE',
|
||||
'DJ',
|
||||
'DM',
|
||||
'DK',
|
||||
'DO',
|
||||
'DZ',
|
||||
'EC',
|
||||
'EG',
|
||||
'ER',
|
||||
'ES',
|
||||
'EE',
|
||||
'ET',
|
||||
'FI',
|
||||
'FJ',
|
||||
'FR',
|
||||
'FM',
|
||||
'GA',
|
||||
'GB',
|
||||
'GE',
|
||||
'GH',
|
||||
'GN',
|
||||
'GM',
|
||||
'GW',
|
||||
'GQ',
|
||||
'GR',
|
||||
'GD',
|
||||
'GT',
|
||||
'GY',
|
||||
'HK',
|
||||
'HN',
|
||||
'HR',
|
||||
'HT',
|
||||
'HU',
|
||||
'ID',
|
||||
'IN',
|
||||
'IE',
|
||||
'IR',
|
||||
'IQ',
|
||||
'IS',
|
||||
'IL',
|
||||
'IT',
|
||||
'JM',
|
||||
'JO',
|
||||
'JP',
|
||||
'KZ',
|
||||
'KE',
|
||||
'KG',
|
||||
'KH',
|
||||
'KI',
|
||||
'KN',
|
||||
'KR',
|
||||
'KW',
|
||||
'LA',
|
||||
'LB',
|
||||
'LR',
|
||||
'LY',
|
||||
'LC',
|
||||
'LI',
|
||||
'LK',
|
||||
'LS',
|
||||
'LT',
|
||||
'LU',
|
||||
'LV',
|
||||
'MA',
|
||||
'MC',
|
||||
'MD',
|
||||
'MG',
|
||||
'MV',
|
||||
'MX',
|
||||
'MH',
|
||||
'MK',
|
||||
'ML',
|
||||
'MT',
|
||||
'MM',
|
||||
'ME',
|
||||
'MN',
|
||||
'MZ',
|
||||
'MR',
|
||||
'MU',
|
||||
'MW',
|
||||
'MY',
|
||||
'NA',
|
||||
'NE',
|
||||
'NG',
|
||||
'NI',
|
||||
'NL',
|
||||
'NO',
|
||||
'NP',
|
||||
'NR',
|
||||
'NZ',
|
||||
'OM',
|
||||
'PK',
|
||||
'PS',
|
||||
'PA',
|
||||
'PE',
|
||||
'PH',
|
||||
'PW',
|
||||
'PG',
|
||||
'PL',
|
||||
'KP',
|
||||
'PT',
|
||||
'PY',
|
||||
'QA',
|
||||
'RO',
|
||||
'RU',
|
||||
'RW',
|
||||
'SA',
|
||||
'SD',
|
||||
'SN',
|
||||
'SG',
|
||||
'SB',
|
||||
'SL',
|
||||
'SV',
|
||||
'SM',
|
||||
'SO',
|
||||
'RS',
|
||||
'SS',
|
||||
'ST',
|
||||
'SR',
|
||||
'SK',
|
||||
'SI',
|
||||
'SE',
|
||||
'SZ',
|
||||
'SC',
|
||||
'SY',
|
||||
'TD',
|
||||
'TG',
|
||||
'TH',
|
||||
'TJ',
|
||||
'TM',
|
||||
'TL',
|
||||
'TO',
|
||||
'TT',
|
||||
'TN',
|
||||
'TR',
|
||||
'TV',
|
||||
'TZ',
|
||||
'TW',
|
||||
'UG',
|
||||
'UA',
|
||||
'UY',
|
||||
'US',
|
||||
'UZ',
|
||||
'VA',
|
||||
'VC',
|
||||
'VE',
|
||||
'VN',
|
||||
'VU',
|
||||
'WS',
|
||||
'YE',
|
||||
'ZA',
|
||||
'ZM',
|
||||
'ZW',
|
||||
'AF' => ['name' => 'Afghanistan', 'latitude' => 33.0, 'longitude' => 66.0],
|
||||
'AO' => ['name' => 'Angola', 'latitude' => -12.5, 'longitude' => 18.5],
|
||||
'AL' => ['name' => 'Albania', 'latitude' => 41.0, 'longitude' => 20.0],
|
||||
'AD' => ['name' => 'Andorra', 'latitude' => 42.5, 'longitude' => 1.6],
|
||||
'AE' => ['name' => 'United Arab Emirates', 'latitude' => 24.0, 'longitude' => 54.0],
|
||||
'AR' => ['name' => 'Argentina', 'latitude' => -34.0, 'longitude' => -64.0],
|
||||
'AM' => ['name' => 'Armenia', 'latitude' => 40.0, 'longitude' => 45.0],
|
||||
'AG' => ['name' => 'Antigua and Barbuda', 'latitude' => 17.05, 'longitude' => -61.8],
|
||||
'AU' => ['name' => 'Australia', 'latitude' => -25.0, 'longitude' => 135.0],
|
||||
'AT' => ['name' => 'Austria', 'latitude' => 47.3, 'longitude' => 13.3],
|
||||
'AZ' => ['name' => 'Azerbaijan', 'latitude' => 40.5, 'longitude' => 47.5],
|
||||
'BI' => ['name' => 'Burundi', 'latitude' => -3.5, 'longitude' => 30.0],
|
||||
'BE' => ['name' => 'Belgium', 'latitude' => 50.8, 'longitude' => 4.0],
|
||||
'BJ' => ['name' => 'Benin', 'latitude' => 9.5, 'longitude' => 2.25],
|
||||
'BF' => ['name' => 'Burkina Faso', 'latitude' => 13.0, 'longitude' => -2.0],
|
||||
'BD' => ['name' => 'Bangladesh', 'latitude' => 24.0, 'longitude' => 90.0],
|
||||
'BG' => ['name' => 'Bulgaria', 'latitude' => 43.0, 'longitude' => 25.0],
|
||||
'BH' => ['name' => 'Bahrain', 'latitude' => 26.0, 'longitude' => 50.5],
|
||||
'BS' => ['name' => 'Bahamas', 'latitude' => 24.25, 'longitude' => -76.0],
|
||||
'BA' => ['name' => 'Bosnia and Herzegovina', 'latitude' => 44.0, 'longitude' => 18.0],
|
||||
'BY' => ['name' => 'Belarus', 'latitude' => 53.0, 'longitude' => 28.0],
|
||||
'BZ' => ['name' => 'Belize', 'latitude' => 17.25, 'longitude' => -88.75],
|
||||
'BO' => ['name' => 'Bolivia', 'latitude' => -17.0, 'longitude' => -65.0],
|
||||
'BR' => ['name' => 'Brazil', 'latitude' => -10.0, 'longitude' => -55.0],
|
||||
'BB' => ['name' => 'Barbados', 'latitude' => 13.17, 'longitude' => -59.53],
|
||||
'BN' => ['name' => 'Brunei', 'latitude' => 4.5, 'longitude' => 114.67],
|
||||
'BT' => ['name' => 'Bhutan', 'latitude' => 27.5, 'longitude' => 90.5],
|
||||
'BW' => ['name' => 'Botswana', 'latitude' => -22.0, 'longitude' => 24.0],
|
||||
'CF' => ['name' => 'Central African Republic', 'latitude' => 7.0, 'longitude' => 21.0],
|
||||
'CA' => ['name' => 'Canada', 'latitude' => 60.0, 'longitude' => -95.0],
|
||||
'CH' => ['name' => 'Switzerland', 'latitude' => 47.0, 'longitude' => 8.0],
|
||||
'CL' => ['name' => 'Chile', 'latitude' => -30.0, 'longitude' => -71.0],
|
||||
'CN' => ['name' => 'China', 'latitude' => 35.0, 'longitude' => 105.0],
|
||||
'CI' => ['name' => 'Côte d\'Ivoire', 'latitude' => 8.0, 'longitude' => -5.0],
|
||||
'CM' => ['name' => 'Cameroon', 'latitude' => 6.0, 'longitude' => 12.0],
|
||||
'CD' => ['name' => 'Democratic Republic of the Congo', 'latitude' => -2.5, 'longitude' => 23.5],
|
||||
'CG' => ['name' => 'Republic of the Congo', 'latitude' => -1.0, 'longitude' => 15.0],
|
||||
'CO' => ['name' => 'Colombia', 'latitude' => 4.0, 'longitude' => -72.0],
|
||||
'KM' => ['name' => 'Comoros', 'latitude' => -12.17, 'longitude' => 44.25],
|
||||
'CV' => ['name' => 'Cape Verde', 'latitude' => 16.0, 'longitude' => -24.0],
|
||||
'CR' => ['name' => 'Costa Rica', 'latitude' => 10.0, 'longitude' => -84.0],
|
||||
'CU' => ['name' => 'Cuba', 'latitude' => 21.5, 'longitude' => -80.0],
|
||||
'CY' => ['name' => 'Cyprus', 'latitude' => 35.0, 'longitude' => 33.0],
|
||||
'CZ' => ['name' => 'Czech Republic', 'latitude' => 49.75, 'longitude' => 15.5],
|
||||
'DE' => ['name' => 'Germany', 'latitude' => 51.0, 'longitude' => 9.0],
|
||||
'DJ' => ['name' => 'Djibouti', 'latitude' => 11.5, 'longitude' => 43.0],
|
||||
'DM' => ['name' => 'Dominica', 'latitude' => 15.42, 'longitude' => -61.33],
|
||||
'DK' => ['name' => 'Denmark', 'latitude' => 56.0, 'longitude' => 10.0],
|
||||
'DO' => ['name' => 'Dominican Republic', 'latitude' => 19.0, 'longitude' => -70.67],
|
||||
'DZ' => ['name' => 'Algeria', 'latitude' => 28.0, 'longitude' => 3.0],
|
||||
'EC' => ['name' => 'Ecuador', 'latitude' => -2.0, 'longitude' => -77.5],
|
||||
'EG' => ['name' => 'Egypt', 'latitude' => 27.0, 'longitude' => 30.0],
|
||||
'ER' => ['name' => 'Eritrea', 'latitude' => 15.0, 'longitude' => 39.0],
|
||||
'ES' => ['name' => 'Spain', 'latitude' => 40.0, 'longitude' => -4.0],
|
||||
'EE' => ['name' => 'Estonia', 'latitude' => 59.0, 'longitude' => 26.0],
|
||||
'ET' => ['name' => 'Ethiopia', 'latitude' => 8.0, 'longitude' => 38.0],
|
||||
'FI' => ['name' => 'Finland', 'latitude' => 64.0, 'longitude' => 26.0],
|
||||
'FJ' => ['name' => 'Fiji', 'latitude' => -18.0, 'longitude' => 175.0],
|
||||
'FR' => ['name' => 'France', 'latitude' => 46.0, 'longitude' => 2.0],
|
||||
'FM' => ['name' => 'Micronesia', 'latitude' => 6.92, 'longitude' => 158.25],
|
||||
'GA' => ['name' => 'Gabon', 'latitude' => -1.0, 'longitude' => 11.75],
|
||||
'GB' => ['name' => 'United Kingdom', 'latitude' => 54.0, 'longitude' => -2.0],
|
||||
'GE' => ['name' => 'Georgia', 'latitude' => 42.0, 'longitude' => 43.5],
|
||||
'GH' => ['name' => 'Ghana', 'latitude' => 8.0, 'longitude' => -2.0],
|
||||
'GN' => ['name' => 'Guinea', 'latitude' => 11.0, 'longitude' => -10.0],
|
||||
'GM' => ['name' => 'Gambia', 'latitude' => 13.47, 'longitude' => -16.57],
|
||||
'GW' => ['name' => 'Guinea-Bissau', 'latitude' => 12.0, 'longitude' => -15.0],
|
||||
'GQ' => ['name' => 'Equatorial Guinea', 'latitude' => 2.0, 'longitude' => 10.0],
|
||||
'GR' => ['name' => 'Greece', 'latitude' => 39.0, 'longitude' => 22.0],
|
||||
'GD' => ['name' => 'Grenada', 'latitude' => 12.12, 'longitude' => -61.67],
|
||||
'GT' => ['name' => 'Guatemala', 'latitude' => 15.5, 'longitude' => -90.25],
|
||||
'GY' => ['name' => 'Guyana', 'latitude' => 5.0, 'longitude' => -59.0],
|
||||
'HK' => ['name' => 'Hong Kong', 'latitude' => 22.25, 'longitude' => 114.17],
|
||||
'HN' => ['name' => 'Honduras', 'latitude' => 15.0, 'longitude' => -86.5],
|
||||
'HR' => ['name' => 'Croatia', 'latitude' => 45.17, 'longitude' => 15.5],
|
||||
'HT' => ['name' => 'Haiti', 'latitude' => 19.0, 'longitude' => -72.42],
|
||||
'HU' => ['name' => 'Hungary', 'latitude' => 47.0, 'longitude' => 20.0],
|
||||
'ID' => ['name' => 'Indonesia', 'latitude' => -5.0, 'longitude' => 120.0],
|
||||
'IN' => ['name' => 'India', 'latitude' => 20.0, 'longitude' => 77.0],
|
||||
'IE' => ['name' => 'Ireland', 'latitude' => 53.0, 'longitude' => -8.0],
|
||||
'IR' => ['name' => 'Iran', 'latitude' => 32.0, 'longitude' => 53.0],
|
||||
'IQ' => ['name' => 'Iraq', 'latitude' => 33.0, 'longitude' => 44.0],
|
||||
'IS' => ['name' => 'Iceland', 'latitude' => 65.0, 'longitude' => -18.0],
|
||||
'IL' => ['name' => 'Israel', 'latitude' => 31.5, 'longitude' => 34.75],
|
||||
'IT' => ['name' => 'Italy', 'latitude' => 42.83, 'longitude' => 12.83],
|
||||
'JM' => ['name' => 'Jamaica', 'latitude' => 18.25, 'longitude' => -77.5],
|
||||
'JO' => ['name' => 'Jordan', 'latitude' => 31.0, 'longitude' => 36.0],
|
||||
'JP' => ['name' => 'Japan', 'latitude' => 36.0, 'longitude' => 138.0],
|
||||
'KZ' => ['name' => 'Kazakhstan', 'latitude' => 48.0, 'longitude' => 68.0],
|
||||
'KE' => ['name' => 'Kenya', 'latitude' => 1.0, 'longitude' => 38.0],
|
||||
'KG' => ['name' => 'Kyrgyzstan', 'latitude' => 41.0, 'longitude' => 75.0],
|
||||
'KH' => ['name' => 'Cambodia', 'latitude' => 13.0, 'longitude' => 105.0],
|
||||
'KI' => ['name' => 'Kiribati', 'latitude' => 1.42, 'longitude' => 173.0],
|
||||
'KN' => ['name' => 'Saint Kitts and Nevis', 'latitude' => 17.33, 'longitude' => -62.75],
|
||||
'KR' => ['name' => 'South Korea', 'latitude' => 37.0, 'longitude' => 127.5],
|
||||
'KW' => ['name' => 'Kuwait', 'latitude' => 29.34, 'longitude' => 47.66],
|
||||
'LA' => ['name' => 'Laos', 'latitude' => 18.0, 'longitude' => 105.0],
|
||||
'LB' => ['name' => 'Lebanon', 'latitude' => 33.83, 'longitude' => 35.83],
|
||||
'LR' => ['name' => 'Liberia', 'latitude' => 6.5, 'longitude' => -9.5],
|
||||
'LY' => ['name' => 'Libya', 'latitude' => 25.0, 'longitude' => 17.0],
|
||||
'LC' => ['name' => 'Saint Lucia', 'latitude' => 13.88, 'longitude' => -61.13],
|
||||
'LI' => ['name' => 'Liechtenstein', 'latitude' => 47.17, 'longitude' => 9.53],
|
||||
'LK' => ['name' => 'Sri Lanka', 'latitude' => 7.0, 'longitude' => 81.0],
|
||||
'LS' => ['name' => 'Lesotho', 'latitude' => -29.5, 'longitude' => 28.5],
|
||||
'LT' => ['name' => 'Lithuania', 'latitude' => 56.0, 'longitude' => 24.0],
|
||||
'LU' => ['name' => 'Luxembourg', 'latitude' => 49.75, 'longitude' => 6.17],
|
||||
'LV' => ['name' => 'latitudevia', 'latitude' => 57.0, 'longitude' => 25.0],
|
||||
'MA' => ['name' => 'Morocco', 'latitude' => 32.0, 'longitude' => -5.0],
|
||||
'MC' => ['name' => 'Monaco', 'latitude' => 43.73, 'longitude' => 7.4],
|
||||
'MD' => ['name' => 'Moldova', 'latitude' => 47.0, 'longitude' => 29.0],
|
||||
'MG' => ['name' => 'Madagascar', 'latitude' => -20.0, 'longitude' => 47.0],
|
||||
'MV' => ['name' => 'Maldives', 'latitude' => 3.25, 'longitude' => 73.0],
|
||||
'MX' => ['name' => 'Mexico', 'latitude' => 23.0, 'longitude' => -102.0],
|
||||
'MH' => ['name' => 'Marshall Islands', 'latitude' => 9.0, 'longitude' => 168.0],
|
||||
'MK' => ['name' => 'North Macedonia', 'latitude' => 41.83, 'longitude' => 22.0],
|
||||
'ML' => ['name' => 'Mali', 'latitude' => 17.0, 'longitude' => -4.0],
|
||||
'MT' => ['name' => 'Malta', 'latitude' => 35.83, 'longitude' => 14.58],
|
||||
'MM' => ['name' => 'Myanmar', 'latitude' => 22.0, 'longitude' => 98.0],
|
||||
'ME' => ['name' => 'Montenegro', 'latitude' => 42.5, 'longitude' => 19.3],
|
||||
'MN' => ['name' => 'Mongolia', 'latitude' => 46.0, 'longitude' => 105.0],
|
||||
'MZ' => ['name' => 'Mozambique', 'latitude' => -18.25, 'longitude' => 35.0],
|
||||
'MR' => ['name' => 'Mauritania', 'latitude' => 20.0, 'longitude' => -12.0],
|
||||
'MU' => ['name' => 'Mauritius', 'latitude' => -20.28, 'longitude' => 57.55],
|
||||
'MW' => ['name' => 'Malawi', 'latitude' => -13.5, 'longitude' => 34.0],
|
||||
'MY' => ['name' => 'Malaysia', 'latitude' => 2.5, 'longitude' => 112.5],
|
||||
'NA' => ['name' => 'Namibia', 'latitude' => -22.0, 'longitude' => 17.0],
|
||||
'NE' => ['name' => 'Niger', 'latitude' => 16.0, 'longitude' => 8.0],
|
||||
'NG' => ['name' => 'Nigeria', 'latitude' => 10.0, 'longitude' => 8.0],
|
||||
'NI' => ['name' => 'Nicaragua', 'latitude' => 13.0, 'longitude' => -85.0],
|
||||
'NL' => ['name' => 'Netherlands', 'latitude' => 52.5, 'longitude' => 5.75],
|
||||
'NO' => ['name' => 'Norway', 'latitude' => 62.0, 'longitude' => 10.0],
|
||||
'NP' => ['name' => 'Nepal', 'latitude' => 28.0, 'longitude' => 84.0],
|
||||
'NR' => ['name' => 'Nauru', 'latitude' => -0.53, 'longitude' => 166.92],
|
||||
'NZ' => ['name' => 'New Zealand', 'latitude' => -41.0, 'longitude' => 174.0],
|
||||
'OM' => ['name' => 'Oman', 'latitude' => 21.0, 'longitude' => 57.0],
|
||||
'PK' => ['name' => 'Pakistan', 'latitude' => 30.0, 'longitude' => 70.0],
|
||||
'PS' => ['name' => 'Palestine', 'latitude' => 31.9, 'longitude' => 35.2],
|
||||
'PA' => ['name' => 'Panama', 'latitude' => 9.0, 'longitude' => -80.0],
|
||||
'PE' => ['name' => 'Peru', 'latitude' => -10.0, 'longitude' => -76.0],
|
||||
'PH' => ['name' => 'Philippines', 'latitude' => 13.0, 'longitude' => 122.0],
|
||||
'PW' => ['name' => 'Palau', 'latitude' => 7.5, 'longitude' => 134.5],
|
||||
'PG' => ['name' => 'Papua New Guinea', 'latitude' => -6.0, 'longitude' => 147.0],
|
||||
'PL' => ['name' => 'Poland', 'latitude' => 52.0, 'longitude' => 20.0],
|
||||
'KP' => ['name' => 'North Korea', 'latitude' => 40.0, 'longitude' => 127.0],
|
||||
'PT' => ['name' => 'Portugal', 'latitude' => 39.5, 'longitude' => -8.0],
|
||||
'PY' => ['name' => 'Paraguay', 'latitude' => -23.0, 'longitude' => -58.0],
|
||||
'QA' => ['name' => 'Qatar', 'latitude' => 25.5, 'longitude' => 51.25],
|
||||
'RO' => ['name' => 'Romania', 'latitude' => 46.0, 'longitude' => 25.0],
|
||||
'RU' => ['name' => 'Russia', 'latitude' => 60.0, 'longitude' => 100.0],
|
||||
'RW' => ['name' => 'Rwanda', 'latitude' => -2.0, 'longitude' => 30.0],
|
||||
'SA' => ['name' => 'Saudi Arabia', 'latitude' => 25.0, 'longitude' => 45.0],
|
||||
'SD' => ['name' => 'Sudan', 'latitude' => 15.0, 'longitude' => 30.0],
|
||||
'SN' => ['name' => 'Senegal', 'latitude' => 14.0, 'longitude' => -14.0],
|
||||
'SG' => ['name' => 'Singapore', 'latitude' => 1.37, 'longitude' => 103.8],
|
||||
'SB' => ['name' => 'Solomon Islands', 'latitude' => -8.0, 'longitude' => 159.0],
|
||||
'SL' => ['name' => 'Sierra Leone', 'latitude' => 8.5, 'longitude' => -11.5],
|
||||
'SV' => ['name' => 'El Salvador', 'latitude' => 13.83, 'longitude' => -88.92],
|
||||
'SM' => ['name' => 'San Marino', 'latitude' => 43.77, 'longitude' => 12.42],
|
||||
'SO' => ['name' => 'Somalia', 'latitude' => 10.0, 'longitude' => 49.0],
|
||||
'RS' => ['name' => 'Serbia', 'latitude' => 44.0, 'longitude' => 21.0],
|
||||
'SS' => ['name' => 'South Sudan', 'latitude' => 8.0, 'longitude' => 30.0],
|
||||
'ST' => ['name' => 'São Tomé and Príncipe', 'latitude' => 1.0, 'longitude' => 7.0],
|
||||
'SR' => ['name' => 'Suriname', 'latitude' => 4.0, 'longitude' => -56.0],
|
||||
'SK' => ['name' => 'Slovakia', 'latitude' => 48.67, 'longitude' => 19.5],
|
||||
'SI' => ['name' => 'Slovenia', 'latitude' => 46.0, 'longitude' => 15.0],
|
||||
'SE' => ['name' => 'Sweden', 'latitude' => 62.0, 'longitude' => 15.0],
|
||||
'SZ' => ['name' => 'Eswatini', 'latitude' => -26.5, 'longitude' => 31.5],
|
||||
'SC' => ['name' => 'Seychelles', 'latitude' => -4.58, 'longitude' => 55.67],
|
||||
'SY' => ['name' => 'Syria', 'latitude' => 35.0, 'longitude' => 38.0],
|
||||
'TD' => ['name' => 'Chad', 'latitude' => 15.0, 'longitude' => 19.0],
|
||||
'TG' => ['name' => 'Togo', 'latitude' => 8.0, 'longitude' => 1.17],
|
||||
'TH' => ['name' => 'Thailand', 'latitude' => 15.0, 'longitude' => 100.0],
|
||||
'TJ' => ['name' => 'Tajikistan', 'latitude' => 39.0, 'longitude' => 71.0],
|
||||
'TM' => ['name' => 'Turkmenistan', 'latitude' => 40.0, 'longitude' => 60.0],
|
||||
'TL' => ['name' => 'Timor-Leste', 'latitude' => -8.83, 'longitude' => 125.92],
|
||||
'TO' => ['name' => 'Tonga', 'latitude' => -20.0, 'longitude' => -175.0],
|
||||
'TT' => ['name' => 'Trinidad and Tobago', 'latitude' => 11.0, 'longitude' => -61.0],
|
||||
'TN' => ['name' => 'Tunisia', 'latitude' => 34.0, 'longitude' => 9.0],
|
||||
'TR' => ['name' => 'Turkey', 'latitude' => 39.0, 'longitude' => 35.0],
|
||||
'TV' => ['name' => 'Tuvalu', 'latitude' => -8.0, 'longitude' => 178.0],
|
||||
'TZ' => ['name' => 'Tanzania', 'latitude' => -6.0, 'longitude' => 35.0],
|
||||
'TW' => ['name' => 'Taiwan', 'latitude' => 23.5, 'longitude' => 121.0],
|
||||
'UG' => ['name' => 'Uganda', 'latitude' => 1.0, 'longitude' => 32.0],
|
||||
'UA' => ['name' => 'Ukraine', 'latitude' => 49.0, 'longitude' => 32.0],
|
||||
'UY' => ['name' => 'Uruguay', 'latitude' => -33.0, 'longitude' => -56.0],
|
||||
'US' => ['name' => 'United States', 'latitude' => 38.0, 'longitude' => -97.0],
|
||||
'UZ' => ['name' => 'Uzbekistan', 'latitude' => 41.0, 'longitude' => 64.0],
|
||||
'VA' => ['name' => 'Vatican City', 'latitude' => 41.9, 'longitude' => 12.45],
|
||||
'VC' => ['name' => 'Saint Vincent and the Grenadines', 'latitude' => 13.25, 'longitude' => -61.2],
|
||||
'VE' => ['name' => 'Venezuela', 'latitude' => 8.0, 'longitude' => -66.0],
|
||||
'VN' => ['name' => 'Vietnam', 'latitude' => 16.0, 'longitude' => 106.0],
|
||||
'VU' => ['name' => 'Vanuatu', 'latitude' => -16.0, 'longitude' => 167.0],
|
||||
'WS' => ['name' => 'Samoa', 'latitude' => -13.58, 'longitude' => -172.33],
|
||||
'YE' => ['name' => 'Yemen', 'latitude' => 15.0, 'longitude' => 48.0],
|
||||
'ZA' => ['name' => 'South Africa', 'latitude' => -29.0, 'longitude' => 24.0],
|
||||
'ZM' => ['name' => 'Zambia', 'latitude' => -15.0, 'longitude' => 30.0],
|
||||
'ZW' => ['name' => 'Zimbabwe', 'latitude' => -20.0, 'longitude' => 30.0],
|
||||
];
|
||||
|
||||
@@ -142,6 +142,16 @@ return [
|
||||
'beta' => false,
|
||||
'mock' => false,
|
||||
],
|
||||
'figma' => [
|
||||
'name' => 'Figma',
|
||||
'developers' => 'https://www.figma.com/developers/api#oauth2',
|
||||
'icon' => 'icon-figma',
|
||||
'enabled' => true,
|
||||
'sandbox' => false,
|
||||
'form' => false,
|
||||
'beta' => false,
|
||||
'mock' => false,
|
||||
],
|
||||
'github' => [
|
||||
'name' => 'GitHub',
|
||||
'developers' => 'https://developer.github.com/',
|
||||
|
||||
@@ -11,7 +11,7 @@ return [
|
||||
[
|
||||
'key' => 'web',
|
||||
'name' => 'Web',
|
||||
'version' => '16.1.0',
|
||||
'version' => '17.0.1',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-web',
|
||||
'package' => 'https://www.npmjs.com/package/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -59,7 +59,7 @@ return [
|
||||
[
|
||||
'key' => 'flutter',
|
||||
'name' => 'Flutter',
|
||||
'version' => '13.1.1',
|
||||
'version' => '15.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-flutter',
|
||||
'package' => 'https://pub.dev/packages/appwrite',
|
||||
'enabled' => true,
|
||||
@@ -77,7 +77,7 @@ return [
|
||||
[
|
||||
'key' => 'apple',
|
||||
'name' => 'Apple',
|
||||
'version' => '7.1.0',
|
||||
'version' => '9.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-apple',
|
||||
'package' => 'https://github.com/appwrite/sdk-for-apple',
|
||||
'enabled' => true,
|
||||
@@ -134,7 +134,7 @@ return [
|
||||
[
|
||||
'key' => 'react-native',
|
||||
'name' => 'React Native',
|
||||
'version' => '0.6.0',
|
||||
'version' => '0.7.2',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-react-native',
|
||||
'package' => 'https://npmjs.com/package/react-native-appwrite',
|
||||
'enabled' => true,
|
||||
@@ -217,7 +217,7 @@ return [
|
||||
[
|
||||
'key' => 'cli',
|
||||
'name' => 'Command Line',
|
||||
'version' => '6.2.0',
|
||||
'version' => '6.2.3',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-cli',
|
||||
'package' => 'https://www.npmjs.com/package/appwrite-cli',
|
||||
'enabled' => true,
|
||||
@@ -245,7 +245,7 @@ return [
|
||||
[
|
||||
'key' => 'nodejs',
|
||||
'name' => 'Node.js',
|
||||
'version' => '14.2.0',
|
||||
'version' => '15.0.1',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-node',
|
||||
'package' => 'https://www.npmjs.com/package/node-appwrite',
|
||||
'enabled' => true,
|
||||
@@ -299,7 +299,7 @@ return [
|
||||
[
|
||||
'key' => 'python',
|
||||
'name' => 'Python',
|
||||
'version' => '6.2.0',
|
||||
'version' => '9.0.3',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-python',
|
||||
'package' => 'https://pypi.org/project/appwrite/',
|
||||
'enabled' => true,
|
||||
@@ -371,7 +371,7 @@ return [
|
||||
[
|
||||
'key' => 'dart',
|
||||
'name' => 'Dart',
|
||||
'version' => '12.2.0',
|
||||
'version' => '14.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-dart',
|
||||
'package' => 'https://pub.dev/packages/dart_appwrite',
|
||||
'enabled' => true,
|
||||
@@ -411,7 +411,7 @@ return [
|
||||
[
|
||||
'key' => 'swift',
|
||||
'name' => 'Swift',
|
||||
'version' => '6.2.0',
|
||||
'version' => '8.0.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-swift',
|
||||
'package' => 'https://github.com/appwrite/sdk-for-swift',
|
||||
'enabled' => true,
|
||||
|
||||
+1
-65
@@ -3,72 +3,8 @@
|
||||
return [
|
||||
'default' => [
|
||||
'$id' => 'default',
|
||||
'name' => 'Frankfurt',
|
||||
'name' => 'default',
|
||||
'disabled' => false,
|
||||
'flag' => 'de',
|
||||
'default' => true,
|
||||
],
|
||||
'fra' => [
|
||||
'$id' => 'fra',
|
||||
'name' => 'Frankfurt',
|
||||
'disabled' => false,
|
||||
'flag' => 'de',
|
||||
'default' => true,
|
||||
],
|
||||
'nyc' => [
|
||||
'$id' => 'nyc',
|
||||
'name' => 'New York',
|
||||
'disabled' => true,
|
||||
'flag' => 'us',
|
||||
'default' => true,
|
||||
],
|
||||
'sfo' => [
|
||||
'$id' => 'sfo',
|
||||
'name' => 'San Francisco',
|
||||
'disabled' => true,
|
||||
'flag' => 'us',
|
||||
'default' => true,
|
||||
],
|
||||
'blr' => [
|
||||
'$id' => 'blr',
|
||||
'name' => 'Bengaluru',
|
||||
'disabled' => true,
|
||||
'flag' => 'in',
|
||||
'default' => true,
|
||||
],
|
||||
'lon' => [
|
||||
'$id' => 'lon',
|
||||
'name' => 'London',
|
||||
'disabled' => true,
|
||||
'flag' => 'gb',
|
||||
'default' => true,
|
||||
],
|
||||
'ams' => [
|
||||
'$id' => 'ams',
|
||||
'name' => 'Amsterdam',
|
||||
'disabled' => true,
|
||||
'flag' => 'nl',
|
||||
'default' => true,
|
||||
],
|
||||
'sgp' => [
|
||||
'$id' => 'sgp',
|
||||
'name' => 'Singapore',
|
||||
'disabled' => true,
|
||||
'flag' => 'sg',
|
||||
'default' => true,
|
||||
],
|
||||
'tor' => [
|
||||
'$id' => 'tor',
|
||||
'name' => 'Toronto',
|
||||
'disabled' => true,
|
||||
'flag' => 'ca',
|
||||
'default' => true,
|
||||
],
|
||||
'syd' => [
|
||||
'$id' => 'syd',
|
||||
'name' => 'Sydney',
|
||||
'disabled' => true,
|
||||
'flag' => 'au',
|
||||
'default' => true,
|
||||
],
|
||||
];
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"title": "Appwrite",
|
||||
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)",
|
||||
"termsOfService": "https:\/\/appwrite.io\/policy\/terms",
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
@@ -43,6 +43,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": "account",
|
||||
"weight": 9,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -91,6 +92,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"group": "account",
|
||||
"weight": 8,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -175,6 +177,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateEmail",
|
||||
"group": "account",
|
||||
"weight": 34,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -250,6 +253,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listIdentities",
|
||||
"group": "identities",
|
||||
"weight": 57,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -308,6 +312,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteIdentity",
|
||||
"group": "identities",
|
||||
"weight": 58,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -370,6 +375,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createJWT",
|
||||
"group": "tokens",
|
||||
"weight": 29,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -418,6 +424,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLogs",
|
||||
"group": "logs",
|
||||
"weight": 31,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -483,6 +490,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMFA",
|
||||
"group": "mfa",
|
||||
"weight": 44,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -552,6 +560,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 46,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -597,7 +606,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Verify authenticator",
|
||||
"summary": "Update authenticator (confirmation)",
|
||||
"operationId": "accountUpdateMfaAuthenticator",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -617,6 +626,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 47,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -694,6 +704,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 51,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -761,6 +772,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 52,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -814,7 +826,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create MFA challenge (confirmation)",
|
||||
"summary": "Update MFA challenge (confirmation)",
|
||||
"operationId": "accountUpdateMfaChallenge",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -834,6 +846,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 53,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -909,6 +922,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMfaFactors",
|
||||
"group": "mfa",
|
||||
"weight": 45,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -939,7 +953,7 @@
|
||||
},
|
||||
"\/account\/mfa\/recovery-codes": {
|
||||
"get": {
|
||||
"summary": "Get MFA recovery codes",
|
||||
"summary": "List MFA recovery codes",
|
||||
"operationId": "accountGetMfaRecoveryCodes",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -959,6 +973,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 50,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1007,6 +1022,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 48,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1035,7 +1051,7 @@
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Regenerate MFA recovery codes",
|
||||
"summary": "Update MFA recovery codes (regenerate)",
|
||||
"operationId": "accountUpdateMfaRecoveryCodes",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -1055,6 +1071,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 49,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1105,6 +1122,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"group": "account",
|
||||
"weight": 32,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1174,6 +1192,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePassword",
|
||||
"group": "account",
|
||||
"weight": 33,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1248,6 +1267,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhone",
|
||||
"group": "account",
|
||||
"weight": 35,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1323,6 +1343,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"group": "account",
|
||||
"weight": 30,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1371,6 +1392,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"group": "account",
|
||||
"weight": 36,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1440,6 +1462,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 38,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1496,7 +1519,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create password recovery (confirmation)",
|
||||
"summary": "Update password recovery (confirmation)",
|
||||
"operationId": "accountUpdateRecovery",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -1516,6 +1539,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 39,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1597,6 +1621,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listSessions",
|
||||
"group": "sessions",
|
||||
"weight": 11,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1638,6 +1663,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSessions",
|
||||
"group": "sessions",
|
||||
"weight": 12,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1688,6 +1714,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createAnonymousSession",
|
||||
"group": "sessions",
|
||||
"weight": 17,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1736,6 +1763,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailPasswordSession",
|
||||
"group": "sessions",
|
||||
"weight": 16,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1809,6 +1837,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMagicURLSession",
|
||||
"group": "sessions",
|
||||
"weight": 26,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1875,6 +1904,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Session",
|
||||
"group": "sessions",
|
||||
"weight": 19,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -1902,7 +1932,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -1922,6 +1952,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -2015,6 +2046,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneSession",
|
||||
"group": "sessions",
|
||||
"weight": 27,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2088,6 +2120,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSession",
|
||||
"group": "sessions",
|
||||
"weight": 18,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2161,6 +2194,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getSession",
|
||||
"group": "sessions",
|
||||
"weight": 13,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2221,6 +2255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateSession",
|
||||
"group": "sessions",
|
||||
"weight": 15,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2274,6 +2309,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSession",
|
||||
"group": "sessions",
|
||||
"weight": 14,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2336,6 +2372,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateStatus",
|
||||
"group": "account",
|
||||
"weight": 37,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2386,6 +2423,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 54,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2464,6 +2502,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 55,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2534,6 +2573,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deletePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 56,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2594,6 +2634,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailToken",
|
||||
"group": "tokens",
|
||||
"weight": 25,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2672,6 +2713,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMagicURLToken",
|
||||
"group": "tokens",
|
||||
"weight": 24,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2751,6 +2793,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Token",
|
||||
"group": "tokens",
|
||||
"weight": 23,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -2778,7 +2821,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -2798,6 +2841,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -2891,6 +2935,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneToken",
|
||||
"group": "tokens",
|
||||
"weight": 28,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2967,6 +3012,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createVerification",
|
||||
"group": "verification",
|
||||
"weight": 40,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3014,7 +3060,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create email verification (confirmation)",
|
||||
"summary": "Update email verification (confirmation)",
|
||||
"operationId": "accountUpdateVerification",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -3034,6 +3080,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateVerification",
|
||||
"group": "verification",
|
||||
"weight": 41,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3109,6 +3156,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 42,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3160,6 +3208,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 43,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3228,6 +3277,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getBrowser",
|
||||
"group": null,
|
||||
"weight": 60,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3353,6 +3403,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCreditCard",
|
||||
"group": null,
|
||||
"weight": 59,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3484,6 +3535,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFavicon",
|
||||
"group": null,
|
||||
"weight": 63,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3541,6 +3593,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFlag",
|
||||
"group": null,
|
||||
"weight": 61,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4028,6 +4081,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getImage",
|
||||
"group": null,
|
||||
"weight": 62,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4109,6 +4163,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getInitials",
|
||||
"group": null,
|
||||
"weight": 65,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4200,6 +4255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQR",
|
||||
"group": null,
|
||||
"weight": 64,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4298,6 +4354,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listDocuments",
|
||||
"group": "documents",
|
||||
"weight": 109,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4382,6 +4439,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"group": "documents",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4488,6 +4546,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getDocument",
|
||||
"group": "documents",
|
||||
"weight": 110,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4582,6 +4641,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateDocument",
|
||||
"group": "documents",
|
||||
"weight": 112,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4680,6 +4740,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteDocument",
|
||||
"group": "documents",
|
||||
"weight": 113,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4763,7 +4824,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listExecutions",
|
||||
"weight": 306,
|
||||
"group": "executions",
|
||||
"weight": 305,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -4848,7 +4910,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createExecution",
|
||||
"weight": 305,
|
||||
"group": "executions",
|
||||
"weight": 304,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -4962,7 +5025,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getExecution",
|
||||
"weight": 307,
|
||||
"group": "executions",
|
||||
"weight": 306,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5035,7 +5099,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "query",
|
||||
"weight": 331,
|
||||
"group": "graphql",
|
||||
"weight": 330,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5086,7 +5151,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "mutation",
|
||||
"weight": 330,
|
||||
"group": "graphql",
|
||||
"weight": 329,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5137,6 +5203,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": null,
|
||||
"weight": 117,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5188,6 +5255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCodes",
|
||||
"group": null,
|
||||
"weight": 118,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5239,6 +5307,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listContinents",
|
||||
"group": null,
|
||||
"weight": 122,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5290,6 +5359,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountries",
|
||||
"group": null,
|
||||
"weight": 119,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5341,6 +5411,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesEU",
|
||||
"group": null,
|
||||
"weight": 120,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5392,6 +5463,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesPhones",
|
||||
"group": null,
|
||||
"weight": 121,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5443,6 +5515,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCurrencies",
|
||||
"group": null,
|
||||
"weight": 123,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5494,6 +5567,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLanguages",
|
||||
"group": null,
|
||||
"weight": 124,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5545,7 +5619,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSubscriber",
|
||||
"weight": 376,
|
||||
"group": "subscribers",
|
||||
"weight": 375,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5627,7 +5702,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSubscriber",
|
||||
"weight": 380,
|
||||
"group": "subscribers",
|
||||
"weight": 379,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5701,7 +5777,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listFiles",
|
||||
"weight": 208,
|
||||
"group": "files",
|
||||
"weight": 207,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5786,7 +5863,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createFile",
|
||||
"weight": 207,
|
||||
"group": "files",
|
||||
"weight": 206,
|
||||
"cookies": false,
|
||||
"type": "upload",
|
||||
"deprecated": false,
|
||||
@@ -5883,7 +5961,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFile",
|
||||
"weight": 209,
|
||||
"group": "files",
|
||||
"weight": 208,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5954,7 +6033,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateFile",
|
||||
"weight": 214,
|
||||
"group": "files",
|
||||
"weight": 213,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6042,7 +6122,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteFile",
|
||||
"weight": 215,
|
||||
"group": "files",
|
||||
"weight": 214,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6108,7 +6189,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileDownload",
|
||||
"weight": 211,
|
||||
"group": "files",
|
||||
"weight": 210,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6174,7 +6256,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFilePreview",
|
||||
"weight": 210,
|
||||
"group": "files",
|
||||
"weight": 209,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6390,7 +6473,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileView",
|
||||
"weight": 212,
|
||||
"group": "files",
|
||||
"weight": 211,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6463,7 +6547,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"weight": 219,
|
||||
"group": "teams",
|
||||
"weight": 218,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6538,7 +6623,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"weight": 218,
|
||||
"group": "teams",
|
||||
"weight": 217,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6622,7 +6708,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"weight": 220,
|
||||
"group": "teams",
|
||||
"weight": 219,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6683,7 +6770,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"weight": 222,
|
||||
"group": "teams",
|
||||
"weight": 221,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6756,7 +6844,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"weight": 224,
|
||||
"group": "teams",
|
||||
"weight": 223,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6819,7 +6908,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMemberships",
|
||||
"weight": 226,
|
||||
"group": "memberships",
|
||||
"weight": 225,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6904,7 +6994,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMembership",
|
||||
"weight": 225,
|
||||
"group": "memberships",
|
||||
"weight": 224,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7014,7 +7105,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMembership",
|
||||
"weight": 227,
|
||||
"group": "memberships",
|
||||
"weight": 226,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7085,7 +7177,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembership",
|
||||
"weight": 228,
|
||||
"group": "memberships",
|
||||
"weight": 227,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7171,7 +7264,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMembership",
|
||||
"weight": 230,
|
||||
"group": "memberships",
|
||||
"weight": 229,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7244,7 +7338,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembershipStatus",
|
||||
"weight": 229,
|
||||
"group": "memberships",
|
||||
"weight": 228,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7341,7 +7436,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"weight": 221,
|
||||
"group": "teams",
|
||||
"weight": 220,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7401,7 +7497,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"weight": 223,
|
||||
"group": "teams",
|
||||
"weight": 222,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"title": "Appwrite",
|
||||
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)",
|
||||
"termsOfService": "https:\/\/appwrite.io\/policy\/terms",
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https:\/\/cloud.appwrite.io\/v1"
|
||||
"url": "https:\/\/<REGION>.cloud.appwrite.io\/v1"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
@@ -43,6 +43,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": "account",
|
||||
"weight": 9,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -91,6 +92,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"group": "account",
|
||||
"weight": 8,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -175,6 +177,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateEmail",
|
||||
"group": "account",
|
||||
"weight": 34,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -250,6 +253,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listIdentities",
|
||||
"group": "identities",
|
||||
"weight": 57,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -308,6 +312,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteIdentity",
|
||||
"group": "identities",
|
||||
"weight": 58,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -370,6 +375,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createJWT",
|
||||
"group": "tokens",
|
||||
"weight": 29,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -418,6 +424,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLogs",
|
||||
"group": "logs",
|
||||
"weight": 31,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -483,6 +490,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMFA",
|
||||
"group": "mfa",
|
||||
"weight": 44,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -552,6 +560,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 46,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -597,7 +606,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Verify authenticator",
|
||||
"summary": "Update authenticator (confirmation)",
|
||||
"operationId": "accountUpdateMfaAuthenticator",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -617,6 +626,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 47,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -694,6 +704,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 51,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -761,6 +772,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 52,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -814,7 +826,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create MFA challenge (confirmation)",
|
||||
"summary": "Update MFA challenge (confirmation)",
|
||||
"operationId": "accountUpdateMfaChallenge",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -834,6 +846,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 53,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -909,6 +922,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMfaFactors",
|
||||
"group": "mfa",
|
||||
"weight": 45,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -939,7 +953,7 @@
|
||||
},
|
||||
"\/account\/mfa\/recovery-codes": {
|
||||
"get": {
|
||||
"summary": "Get MFA recovery codes",
|
||||
"summary": "List MFA recovery codes",
|
||||
"operationId": "accountGetMfaRecoveryCodes",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -959,6 +973,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 50,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1007,6 +1022,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 48,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1035,7 +1051,7 @@
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Regenerate MFA recovery codes",
|
||||
"summary": "Update MFA recovery codes (regenerate)",
|
||||
"operationId": "accountUpdateMfaRecoveryCodes",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -1055,6 +1071,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 49,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1105,6 +1122,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"group": "account",
|
||||
"weight": 32,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1174,6 +1192,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePassword",
|
||||
"group": "account",
|
||||
"weight": 33,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1248,6 +1267,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhone",
|
||||
"group": "account",
|
||||
"weight": 35,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1323,6 +1343,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"group": "account",
|
||||
"weight": 30,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1371,6 +1392,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"group": "account",
|
||||
"weight": 36,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1440,6 +1462,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 38,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1496,7 +1519,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create password recovery (confirmation)",
|
||||
"summary": "Update password recovery (confirmation)",
|
||||
"operationId": "accountUpdateRecovery",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -1516,6 +1539,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 39,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1597,6 +1621,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listSessions",
|
||||
"group": "sessions",
|
||||
"weight": 11,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1638,6 +1663,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSessions",
|
||||
"group": "sessions",
|
||||
"weight": 12,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1688,6 +1714,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createAnonymousSession",
|
||||
"group": "sessions",
|
||||
"weight": 17,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1736,6 +1763,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailPasswordSession",
|
||||
"group": "sessions",
|
||||
"weight": 16,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1809,6 +1837,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMagicURLSession",
|
||||
"group": "sessions",
|
||||
"weight": 26,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1875,6 +1904,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Session",
|
||||
"group": "sessions",
|
||||
"weight": 19,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -1902,7 +1932,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -1922,6 +1952,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -2015,6 +2046,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneSession",
|
||||
"group": "sessions",
|
||||
"weight": 27,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2088,6 +2120,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSession",
|
||||
"group": "sessions",
|
||||
"weight": 18,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2161,6 +2194,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getSession",
|
||||
"group": "sessions",
|
||||
"weight": 13,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2221,6 +2255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateSession",
|
||||
"group": "sessions",
|
||||
"weight": 15,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2274,6 +2309,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSession",
|
||||
"group": "sessions",
|
||||
"weight": 14,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2336,6 +2372,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateStatus",
|
||||
"group": "account",
|
||||
"weight": 37,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2386,6 +2423,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 54,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2464,6 +2502,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 55,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2534,6 +2573,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deletePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 56,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2594,6 +2634,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailToken",
|
||||
"group": "tokens",
|
||||
"weight": 25,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2672,6 +2713,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMagicURLToken",
|
||||
"group": "tokens",
|
||||
"weight": 24,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2751,6 +2793,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Token",
|
||||
"group": "tokens",
|
||||
"weight": 23,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -2778,7 +2821,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -2798,6 +2841,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -2891,6 +2935,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneToken",
|
||||
"group": "tokens",
|
||||
"weight": 28,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2967,6 +3012,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createVerification",
|
||||
"group": "verification",
|
||||
"weight": 40,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3014,7 +3060,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create email verification (confirmation)",
|
||||
"summary": "Update email verification (confirmation)",
|
||||
"operationId": "accountUpdateVerification",
|
||||
"tags": [
|
||||
"account"
|
||||
@@ -3034,6 +3080,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateVerification",
|
||||
"group": "verification",
|
||||
"weight": 41,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3109,6 +3156,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 42,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3160,6 +3208,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 43,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3228,6 +3277,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getBrowser",
|
||||
"group": null,
|
||||
"weight": 60,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3353,6 +3403,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCreditCard",
|
||||
"group": null,
|
||||
"weight": 59,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3484,6 +3535,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFavicon",
|
||||
"group": null,
|
||||
"weight": 63,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3541,6 +3593,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFlag",
|
||||
"group": null,
|
||||
"weight": 61,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4028,6 +4081,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getImage",
|
||||
"group": null,
|
||||
"weight": 62,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4109,6 +4163,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getInitials",
|
||||
"group": null,
|
||||
"weight": 65,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4200,6 +4255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQR",
|
||||
"group": null,
|
||||
"weight": 64,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4298,6 +4354,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listDocuments",
|
||||
"group": "documents",
|
||||
"weight": 109,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4382,6 +4439,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"group": "documents",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4488,6 +4546,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getDocument",
|
||||
"group": "documents",
|
||||
"weight": 110,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4582,6 +4641,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateDocument",
|
||||
"group": "documents",
|
||||
"weight": 112,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4680,6 +4740,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteDocument",
|
||||
"group": "documents",
|
||||
"weight": 113,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4763,7 +4824,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listExecutions",
|
||||
"weight": 306,
|
||||
"group": "executions",
|
||||
"weight": 305,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -4848,7 +4910,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createExecution",
|
||||
"weight": 305,
|
||||
"group": "executions",
|
||||
"weight": 304,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -4962,7 +5025,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getExecution",
|
||||
"weight": 307,
|
||||
"group": "executions",
|
||||
"weight": 306,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5035,7 +5099,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "query",
|
||||
"weight": 331,
|
||||
"group": "graphql",
|
||||
"weight": 330,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5086,7 +5151,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "mutation",
|
||||
"weight": 330,
|
||||
"group": "graphql",
|
||||
"weight": 329,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5137,6 +5203,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": null,
|
||||
"weight": 117,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5188,6 +5255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCodes",
|
||||
"group": null,
|
||||
"weight": 118,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5239,6 +5307,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listContinents",
|
||||
"group": null,
|
||||
"weight": 122,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5290,6 +5359,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountries",
|
||||
"group": null,
|
||||
"weight": 119,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5341,6 +5411,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesEU",
|
||||
"group": null,
|
||||
"weight": 120,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5392,6 +5463,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesPhones",
|
||||
"group": null,
|
||||
"weight": 121,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5443,6 +5515,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCurrencies",
|
||||
"group": null,
|
||||
"weight": 123,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5494,6 +5567,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLanguages",
|
||||
"group": null,
|
||||
"weight": 124,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5545,7 +5619,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSubscriber",
|
||||
"weight": 376,
|
||||
"group": "subscribers",
|
||||
"weight": 375,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5627,7 +5702,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSubscriber",
|
||||
"weight": 380,
|
||||
"group": "subscribers",
|
||||
"weight": 379,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5701,7 +5777,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listFiles",
|
||||
"weight": 208,
|
||||
"group": "files",
|
||||
"weight": 207,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5786,7 +5863,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createFile",
|
||||
"weight": 207,
|
||||
"group": "files",
|
||||
"weight": 206,
|
||||
"cookies": false,
|
||||
"type": "upload",
|
||||
"deprecated": false,
|
||||
@@ -5883,7 +5961,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFile",
|
||||
"weight": 209,
|
||||
"group": "files",
|
||||
"weight": 208,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5954,7 +6033,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateFile",
|
||||
"weight": 214,
|
||||
"group": "files",
|
||||
"weight": 213,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6042,7 +6122,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteFile",
|
||||
"weight": 215,
|
||||
"group": "files",
|
||||
"weight": 214,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6108,7 +6189,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileDownload",
|
||||
"weight": 211,
|
||||
"group": "files",
|
||||
"weight": 210,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6174,7 +6256,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFilePreview",
|
||||
"weight": 210,
|
||||
"group": "files",
|
||||
"weight": 209,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6390,7 +6473,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileView",
|
||||
"weight": 212,
|
||||
"group": "files",
|
||||
"weight": 211,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6463,7 +6547,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"weight": 219,
|
||||
"group": "teams",
|
||||
"weight": 218,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6538,7 +6623,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"weight": 218,
|
||||
"group": "teams",
|
||||
"weight": 217,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6622,7 +6708,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"weight": 220,
|
||||
"group": "teams",
|
||||
"weight": 219,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6683,7 +6770,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"weight": 222,
|
||||
"group": "teams",
|
||||
"weight": 221,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6756,7 +6844,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"weight": 224,
|
||||
"group": "teams",
|
||||
"weight": 223,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6819,7 +6908,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMemberships",
|
||||
"weight": 226,
|
||||
"group": "memberships",
|
||||
"weight": 225,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6904,7 +6994,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMembership",
|
||||
"weight": 225,
|
||||
"group": "memberships",
|
||||
"weight": 224,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7014,7 +7105,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMembership",
|
||||
"weight": 227,
|
||||
"group": "memberships",
|
||||
"weight": 226,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7085,7 +7177,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembership",
|
||||
"weight": 228,
|
||||
"group": "memberships",
|
||||
"weight": 227,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7171,7 +7264,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMembership",
|
||||
"weight": 230,
|
||||
"group": "memberships",
|
||||
"weight": 229,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7244,7 +7338,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembershipStatus",
|
||||
"weight": 229,
|
||||
"group": "memberships",
|
||||
"weight": 228,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7341,7 +7436,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"weight": 221,
|
||||
"group": "teams",
|
||||
"weight": 220,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7401,7 +7497,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"weight": 223,
|
||||
"group": "teams",
|
||||
"weight": 222,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"title": "Appwrite",
|
||||
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)",
|
||||
"termsOfService": "https:\/\/appwrite.io\/policy\/terms",
|
||||
@@ -15,7 +15,7 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "cloud.appwrite.io",
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
@@ -87,6 +87,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": "account",
|
||||
"weight": 9,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -137,6 +138,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"group": "account",
|
||||
"weight": 8,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -227,6 +229,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateEmail",
|
||||
"group": "account",
|
||||
"weight": 34,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -306,6 +309,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listIdentities",
|
||||
"group": "identities",
|
||||
"weight": 57,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -367,6 +371,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteIdentity",
|
||||
"group": "identities",
|
||||
"weight": 58,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -429,6 +434,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createJWT",
|
||||
"group": "tokens",
|
||||
"weight": 29,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -479,6 +485,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLogs",
|
||||
"group": "logs",
|
||||
"weight": 31,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -545,6 +552,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMFA",
|
||||
"group": "mfa",
|
||||
"weight": 44,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -617,6 +625,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 46,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -660,7 +669,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Verify authenticator",
|
||||
"summary": "Update authenticator (confirmation)",
|
||||
"operationId": "accountUpdateMfaAuthenticator",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -682,6 +691,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 47,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -760,6 +770,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 51,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -827,6 +838,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 52,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -881,7 +893,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create MFA challenge (confirmation)",
|
||||
"summary": "Update MFA challenge (confirmation)",
|
||||
"operationId": "accountUpdateMfaChallenge",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -903,6 +915,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 53,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -982,6 +995,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMfaFactors",
|
||||
"group": "mfa",
|
||||
"weight": 45,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1012,7 +1026,7 @@
|
||||
},
|
||||
"\/account\/mfa\/recovery-codes": {
|
||||
"get": {
|
||||
"summary": "Get MFA recovery codes",
|
||||
"summary": "List MFA recovery codes",
|
||||
"operationId": "accountGetMfaRecoveryCodes",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -1034,6 +1048,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 50,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1084,6 +1099,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 48,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1112,7 +1128,7 @@
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Regenerate MFA recovery codes",
|
||||
"summary": "Update MFA recovery codes (regenerate)",
|
||||
"operationId": "accountUpdateMfaRecoveryCodes",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -1134,6 +1150,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 49,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1186,6 +1203,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"group": "account",
|
||||
"weight": 32,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1258,6 +1276,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePassword",
|
||||
"group": "account",
|
||||
"weight": 33,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1336,6 +1355,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhone",
|
||||
"group": "account",
|
||||
"weight": 35,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1415,6 +1435,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"group": "account",
|
||||
"weight": 30,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1465,6 +1486,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"group": "account",
|
||||
"weight": 36,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1537,6 +1559,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 38,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1595,7 +1618,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create password recovery (confirmation)",
|
||||
"summary": "Update password recovery (confirmation)",
|
||||
"operationId": "accountUpdateRecovery",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -1617,6 +1640,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 39,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1703,6 +1727,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listSessions",
|
||||
"group": "sessions",
|
||||
"weight": 11,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1748,6 +1773,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSessions",
|
||||
"group": "sessions",
|
||||
"weight": 12,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1800,6 +1826,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createAnonymousSession",
|
||||
"group": "sessions",
|
||||
"weight": 17,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1850,6 +1877,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailPasswordSession",
|
||||
"group": "sessions",
|
||||
"weight": 16,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1927,6 +1955,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMagicURLSession",
|
||||
"group": "sessions",
|
||||
"weight": 26,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2001,6 +2030,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Session",
|
||||
"group": "sessions",
|
||||
"weight": 19,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -2028,7 +2058,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amazon",
|
||||
@@ -2047,6 +2077,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -2136,6 +2167,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneSession",
|
||||
"group": "sessions",
|
||||
"weight": 27,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2213,6 +2245,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSession",
|
||||
"group": "sessions",
|
||||
"weight": 18,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2290,6 +2323,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getSession",
|
||||
"group": "sessions",
|
||||
"weight": 13,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2350,6 +2384,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateSession",
|
||||
"group": "sessions",
|
||||
"weight": 15,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2405,6 +2440,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSession",
|
||||
"group": "sessions",
|
||||
"weight": 14,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2467,6 +2503,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateStatus",
|
||||
"group": "account",
|
||||
"weight": 37,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2519,6 +2556,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 54,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2602,6 +2640,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 55,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2673,6 +2712,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deletePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 56,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2733,6 +2773,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailToken",
|
||||
"group": "tokens",
|
||||
"weight": 25,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2816,6 +2857,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMagicURLToken",
|
||||
"group": "tokens",
|
||||
"weight": 24,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2905,6 +2947,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Token",
|
||||
"group": "tokens",
|
||||
"weight": 23,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -2932,7 +2975,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amazon",
|
||||
@@ -2951,6 +2994,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -3040,6 +3084,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneToken",
|
||||
"group": "tokens",
|
||||
"weight": 28,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3120,6 +3165,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createVerification",
|
||||
"group": "verification",
|
||||
"weight": 40,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3168,7 +3214,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create email verification (confirmation)",
|
||||
"summary": "Update email verification (confirmation)",
|
||||
"operationId": "accountUpdateVerification",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -3190,6 +3236,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateVerification",
|
||||
"group": "verification",
|
||||
"weight": 41,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3269,6 +3316,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 42,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3322,6 +3370,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 43,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3401,6 +3450,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getBrowser",
|
||||
"group": null,
|
||||
"weight": 60,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3527,6 +3577,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCreditCard",
|
||||
"group": null,
|
||||
"weight": 59,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3659,6 +3710,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFavicon",
|
||||
"group": null,
|
||||
"weight": 63,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3723,6 +3775,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFlag",
|
||||
"group": null,
|
||||
"weight": 61,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4211,6 +4264,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getImage",
|
||||
"group": null,
|
||||
"weight": 62,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4295,6 +4349,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getInitials",
|
||||
"group": null,
|
||||
"weight": 65,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4387,6 +4442,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQR",
|
||||
"group": null,
|
||||
"weight": 64,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4479,6 +4535,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listDocuments",
|
||||
"group": "documents",
|
||||
"weight": 109,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4560,6 +4617,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"group": "documents",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4665,6 +4723,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getDocument",
|
||||
"group": "documents",
|
||||
"weight": 110,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4754,6 +4813,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateDocument",
|
||||
"group": "documents",
|
||||
"weight": 112,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4850,6 +4910,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteDocument",
|
||||
"group": "documents",
|
||||
"weight": 113,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4929,7 +4990,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listExecutions",
|
||||
"weight": 306,
|
||||
"group": "executions",
|
||||
"weight": 305,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5011,7 +5073,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createExecution",
|
||||
"weight": 305,
|
||||
"group": "executions",
|
||||
"weight": 304,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5129,7 +5192,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getExecution",
|
||||
"weight": 307,
|
||||
"group": "executions",
|
||||
"weight": 306,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5200,7 +5264,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "query",
|
||||
"weight": 331,
|
||||
"group": "graphql",
|
||||
"weight": 330,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5273,7 +5338,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "mutation",
|
||||
"weight": 330,
|
||||
"group": "graphql",
|
||||
"weight": 329,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5346,6 +5412,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": null,
|
||||
"weight": 117,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5399,6 +5466,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCodes",
|
||||
"group": null,
|
||||
"weight": 118,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5452,6 +5520,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listContinents",
|
||||
"group": null,
|
||||
"weight": 122,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5505,6 +5574,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountries",
|
||||
"group": null,
|
||||
"weight": 119,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5558,6 +5628,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesEU",
|
||||
"group": null,
|
||||
"weight": 120,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5611,6 +5682,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesPhones",
|
||||
"group": null,
|
||||
"weight": 121,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5664,6 +5736,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCurrencies",
|
||||
"group": null,
|
||||
"weight": 123,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5717,6 +5790,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLanguages",
|
||||
"group": null,
|
||||
"weight": 124,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5770,7 +5844,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSubscriber",
|
||||
"weight": 376,
|
||||
"group": "subscribers",
|
||||
"weight": 375,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5854,7 +5929,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSubscriber",
|
||||
"weight": 380,
|
||||
"group": "subscribers",
|
||||
"weight": 379,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5926,7 +6002,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listFiles",
|
||||
"weight": 208,
|
||||
"group": "files",
|
||||
"weight": 207,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6008,7 +6085,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createFile",
|
||||
"weight": 207,
|
||||
"group": "files",
|
||||
"weight": 206,
|
||||
"cookies": false,
|
||||
"type": "upload",
|
||||
"deprecated": false,
|
||||
@@ -6099,7 +6177,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFile",
|
||||
"weight": 209,
|
||||
"group": "files",
|
||||
"weight": 208,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6168,7 +6247,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateFile",
|
||||
"weight": 214,
|
||||
"group": "files",
|
||||
"weight": 213,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6256,7 +6336,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteFile",
|
||||
"weight": 215,
|
||||
"group": "files",
|
||||
"weight": 214,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6327,7 +6408,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileDownload",
|
||||
"weight": 211,
|
||||
"group": "files",
|
||||
"weight": 210,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6398,7 +6480,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFilePreview",
|
||||
"weight": 210,
|
||||
"group": "files",
|
||||
"weight": 209,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6597,7 +6680,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileView",
|
||||
"weight": 212,
|
||||
"group": "files",
|
||||
"weight": 211,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6668,7 +6752,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"weight": 219,
|
||||
"group": "teams",
|
||||
"weight": 218,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6742,7 +6827,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"weight": 218,
|
||||
"group": "teams",
|
||||
"weight": 217,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6833,7 +6919,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"weight": 220,
|
||||
"group": "teams",
|
||||
"weight": 219,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6894,7 +6981,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"weight": 222,
|
||||
"group": "teams",
|
||||
"weight": 221,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6968,7 +7056,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"weight": 224,
|
||||
"group": "teams",
|
||||
"weight": 223,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7031,7 +7120,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMemberships",
|
||||
"weight": 226,
|
||||
"group": "memberships",
|
||||
"weight": 225,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7113,7 +7203,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMembership",
|
||||
"weight": 225,
|
||||
"group": "memberships",
|
||||
"weight": 224,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7227,7 +7318,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMembership",
|
||||
"weight": 227,
|
||||
"group": "memberships",
|
||||
"weight": 226,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7296,7 +7388,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembership",
|
||||
"weight": 228,
|
||||
"group": "memberships",
|
||||
"weight": 227,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7381,7 +7474,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMembership",
|
||||
"weight": 230,
|
||||
"group": "memberships",
|
||||
"weight": 229,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7452,7 +7546,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembershipStatus",
|
||||
"weight": 229,
|
||||
"group": "memberships",
|
||||
"weight": 228,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7547,7 +7642,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"weight": 221,
|
||||
"group": "teams",
|
||||
"weight": 220,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7607,7 +7703,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"weight": 223,
|
||||
"group": "teams",
|
||||
"weight": 222,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"title": "Appwrite",
|
||||
"description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)",
|
||||
"termsOfService": "https:\/\/appwrite.io\/policy\/terms",
|
||||
@@ -15,7 +15,7 @@
|
||||
"url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"
|
||||
}
|
||||
},
|
||||
"host": "cloud.appwrite.io",
|
||||
"host": "<REGION>.cloud.appwrite.io",
|
||||
"basePath": "\/v1",
|
||||
"schemes": [
|
||||
"https"
|
||||
@@ -87,6 +87,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": "account",
|
||||
"weight": 9,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -137,6 +138,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"group": "account",
|
||||
"weight": 8,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -227,6 +229,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateEmail",
|
||||
"group": "account",
|
||||
"weight": 34,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -306,6 +309,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listIdentities",
|
||||
"group": "identities",
|
||||
"weight": 57,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -367,6 +371,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteIdentity",
|
||||
"group": "identities",
|
||||
"weight": 58,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -429,6 +434,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createJWT",
|
||||
"group": "tokens",
|
||||
"weight": 29,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -479,6 +485,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLogs",
|
||||
"group": "logs",
|
||||
"weight": 31,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -545,6 +552,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMFA",
|
||||
"group": "mfa",
|
||||
"weight": 44,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -617,6 +625,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 46,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -660,7 +669,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Verify authenticator",
|
||||
"summary": "Update authenticator (confirmation)",
|
||||
"operationId": "accountUpdateMfaAuthenticator",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -682,6 +691,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 47,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -760,6 +770,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMfaAuthenticator",
|
||||
"group": "mfa",
|
||||
"weight": 51,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -827,6 +838,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 52,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -881,7 +893,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create MFA challenge (confirmation)",
|
||||
"summary": "Update MFA challenge (confirmation)",
|
||||
"operationId": "accountUpdateMfaChallenge",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -903,6 +915,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaChallenge",
|
||||
"group": "mfa",
|
||||
"weight": 53,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -982,6 +995,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMfaFactors",
|
||||
"group": "mfa",
|
||||
"weight": 45,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1012,7 +1026,7 @@
|
||||
},
|
||||
"\/account\/mfa\/recovery-codes": {
|
||||
"get": {
|
||||
"summary": "Get MFA recovery codes",
|
||||
"summary": "List MFA recovery codes",
|
||||
"operationId": "accountGetMfaRecoveryCodes",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -1034,6 +1048,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 50,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1084,6 +1099,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 48,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1112,7 +1128,7 @@
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Regenerate MFA recovery codes",
|
||||
"summary": "Update MFA recovery codes (regenerate)",
|
||||
"operationId": "accountUpdateMfaRecoveryCodes",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -1134,6 +1150,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMfaRecoveryCodes",
|
||||
"group": "mfa",
|
||||
"weight": 49,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1186,6 +1203,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"group": "account",
|
||||
"weight": 32,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1258,6 +1276,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePassword",
|
||||
"group": "account",
|
||||
"weight": 33,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1336,6 +1355,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhone",
|
||||
"group": "account",
|
||||
"weight": 35,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1415,6 +1435,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"group": "account",
|
||||
"weight": 30,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1465,6 +1486,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"group": "account",
|
||||
"weight": 36,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1537,6 +1559,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 38,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1595,7 +1618,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create password recovery (confirmation)",
|
||||
"summary": "Update password recovery (confirmation)",
|
||||
"operationId": "accountUpdateRecovery",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -1617,6 +1640,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateRecovery",
|
||||
"group": "recovery",
|
||||
"weight": 39,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1703,6 +1727,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listSessions",
|
||||
"group": "sessions",
|
||||
"weight": 11,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1748,6 +1773,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSessions",
|
||||
"group": "sessions",
|
||||
"weight": 12,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1800,6 +1826,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createAnonymousSession",
|
||||
"group": "sessions",
|
||||
"weight": 17,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1850,6 +1877,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailPasswordSession",
|
||||
"group": "sessions",
|
||||
"weight": 16,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -1927,6 +1955,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMagicURLSession",
|
||||
"group": "sessions",
|
||||
"weight": 26,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2001,6 +2030,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Session",
|
||||
"group": "sessions",
|
||||
"weight": 19,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -2028,7 +2058,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amazon",
|
||||
@@ -2047,6 +2077,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -2136,6 +2167,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneSession",
|
||||
"group": "sessions",
|
||||
"weight": 27,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2213,6 +2245,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSession",
|
||||
"group": "sessions",
|
||||
"weight": 18,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2290,6 +2323,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getSession",
|
||||
"group": "sessions",
|
||||
"weight": 13,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2350,6 +2384,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateSession",
|
||||
"group": "sessions",
|
||||
"weight": 15,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2405,6 +2440,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSession",
|
||||
"group": "sessions",
|
||||
"weight": 14,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2467,6 +2503,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateStatus",
|
||||
"group": "account",
|
||||
"weight": 37,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2519,6 +2556,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 54,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2602,6 +2640,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 55,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2673,6 +2712,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deletePushTarget",
|
||||
"group": "pushTargets",
|
||||
"weight": 56,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2733,6 +2773,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createEmailToken",
|
||||
"group": "tokens",
|
||||
"weight": 25,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2816,6 +2857,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMagicURLToken",
|
||||
"group": "tokens",
|
||||
"weight": 24,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -2905,6 +2947,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createOAuth2Token",
|
||||
"group": "tokens",
|
||||
"weight": 23,
|
||||
"cookies": false,
|
||||
"type": "webAuth",
|
||||
@@ -2932,7 +2975,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "provider",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amazon",
|
||||
@@ -2951,6 +2994,7 @@
|
||||
"dropbox",
|
||||
"etsy",
|
||||
"facebook",
|
||||
"figma",
|
||||
"github",
|
||||
"gitlab",
|
||||
"google",
|
||||
@@ -3040,6 +3084,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneToken",
|
||||
"group": "tokens",
|
||||
"weight": 28,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3120,6 +3165,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createVerification",
|
||||
"group": "verification",
|
||||
"weight": 40,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3168,7 +3214,7 @@
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create email verification (confirmation)",
|
||||
"summary": "Update email verification (confirmation)",
|
||||
"operationId": "accountUpdateVerification",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
@@ -3190,6 +3236,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateVerification",
|
||||
"group": "verification",
|
||||
"weight": 41,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3269,6 +3316,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createPhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 42,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3322,6 +3370,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePhoneVerification",
|
||||
"group": "verification",
|
||||
"weight": 43,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -3401,6 +3450,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getBrowser",
|
||||
"group": null,
|
||||
"weight": 60,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3527,6 +3577,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCreditCard",
|
||||
"group": null,
|
||||
"weight": 59,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3659,6 +3710,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFavicon",
|
||||
"group": null,
|
||||
"weight": 63,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -3723,6 +3775,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFlag",
|
||||
"group": null,
|
||||
"weight": 61,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4211,6 +4264,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getImage",
|
||||
"group": null,
|
||||
"weight": 62,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4295,6 +4349,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getInitials",
|
||||
"group": null,
|
||||
"weight": 65,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4387,6 +4442,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQR",
|
||||
"group": null,
|
||||
"weight": 64,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
@@ -4479,6 +4535,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listDocuments",
|
||||
"group": "documents",
|
||||
"weight": 109,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4560,6 +4617,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createDocument",
|
||||
"group": "documents",
|
||||
"weight": 108,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4665,6 +4723,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getDocument",
|
||||
"group": "documents",
|
||||
"weight": 110,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4754,6 +4813,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateDocument",
|
||||
"group": "documents",
|
||||
"weight": 112,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4850,6 +4910,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteDocument",
|
||||
"group": "documents",
|
||||
"weight": 113,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -4929,7 +4990,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listExecutions",
|
||||
"weight": 306,
|
||||
"group": "executions",
|
||||
"weight": 305,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5011,7 +5073,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createExecution",
|
||||
"weight": 305,
|
||||
"group": "executions",
|
||||
"weight": 304,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5129,7 +5192,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getExecution",
|
||||
"weight": 307,
|
||||
"group": "executions",
|
||||
"weight": 306,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5200,7 +5264,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "query",
|
||||
"weight": 331,
|
||||
"group": "graphql",
|
||||
"weight": 330,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5273,7 +5338,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "mutation",
|
||||
"weight": 330,
|
||||
"group": "graphql",
|
||||
"weight": 329,
|
||||
"cookies": false,
|
||||
"type": "graphql",
|
||||
"deprecated": false,
|
||||
@@ -5346,6 +5412,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": null,
|
||||
"weight": 117,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5399,6 +5466,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCodes",
|
||||
"group": null,
|
||||
"weight": 118,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5452,6 +5520,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listContinents",
|
||||
"group": null,
|
||||
"weight": 122,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5505,6 +5574,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountries",
|
||||
"group": null,
|
||||
"weight": 119,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5558,6 +5628,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesEU",
|
||||
"group": null,
|
||||
"weight": 120,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5611,6 +5682,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCountriesPhones",
|
||||
"group": null,
|
||||
"weight": 121,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5664,6 +5736,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listCurrencies",
|
||||
"group": null,
|
||||
"weight": 123,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5717,6 +5790,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listLanguages",
|
||||
"group": null,
|
||||
"weight": 124,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
@@ -5770,7 +5844,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createSubscriber",
|
||||
"weight": 376,
|
||||
"group": "subscribers",
|
||||
"weight": 375,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5854,7 +5929,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteSubscriber",
|
||||
"weight": 380,
|
||||
"group": "subscribers",
|
||||
"weight": 379,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -5926,7 +6002,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listFiles",
|
||||
"weight": 208,
|
||||
"group": "files",
|
||||
"weight": 207,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6008,7 +6085,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createFile",
|
||||
"weight": 207,
|
||||
"group": "files",
|
||||
"weight": 206,
|
||||
"cookies": false,
|
||||
"type": "upload",
|
||||
"deprecated": false,
|
||||
@@ -6099,7 +6177,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFile",
|
||||
"weight": 209,
|
||||
"group": "files",
|
||||
"weight": 208,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6168,7 +6247,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateFile",
|
||||
"weight": 214,
|
||||
"group": "files",
|
||||
"weight": 213,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6256,7 +6336,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteFile",
|
||||
"weight": 215,
|
||||
"group": "files",
|
||||
"weight": 214,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6327,7 +6408,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileDownload",
|
||||
"weight": 211,
|
||||
"group": "files",
|
||||
"weight": 210,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6398,7 +6480,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFilePreview",
|
||||
"weight": 210,
|
||||
"group": "files",
|
||||
"weight": 209,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6597,7 +6680,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getFileView",
|
||||
"weight": 212,
|
||||
"group": "files",
|
||||
"weight": 211,
|
||||
"cookies": false,
|
||||
"type": "location",
|
||||
"deprecated": false,
|
||||
@@ -6668,7 +6752,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"weight": 219,
|
||||
"group": "teams",
|
||||
"weight": 218,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6742,7 +6827,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "create",
|
||||
"weight": 218,
|
||||
"group": "teams",
|
||||
"weight": 217,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6833,7 +6919,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"weight": 220,
|
||||
"group": "teams",
|
||||
"weight": 219,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6894,7 +6981,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateName",
|
||||
"weight": 222,
|
||||
"group": "teams",
|
||||
"weight": 221,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -6968,7 +7056,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"weight": 224,
|
||||
"group": "teams",
|
||||
"weight": 223,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7031,7 +7120,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "listMemberships",
|
||||
"weight": 226,
|
||||
"group": "memberships",
|
||||
"weight": 225,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7113,7 +7203,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createMembership",
|
||||
"weight": 225,
|
||||
"group": "memberships",
|
||||
"weight": 224,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7227,7 +7318,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getMembership",
|
||||
"weight": 227,
|
||||
"group": "memberships",
|
||||
"weight": 226,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7296,7 +7388,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembership",
|
||||
"weight": 228,
|
||||
"group": "memberships",
|
||||
"weight": 227,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7381,7 +7474,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "deleteMembership",
|
||||
"weight": 230,
|
||||
"group": "memberships",
|
||||
"weight": 229,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7452,7 +7546,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updateMembershipStatus",
|
||||
"weight": 229,
|
||||
"group": "memberships",
|
||||
"weight": 228,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7547,7 +7642,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPrefs",
|
||||
"weight": 221,
|
||||
"group": "teams",
|
||||
"weight": 220,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -7607,7 +7703,8 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "updatePrefs",
|
||||
"weight": 223,
|
||||
"group": "teams",
|
||||
"weight": 222,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -79,6 +79,15 @@ return [
|
||||
'question' => 'Enter your Appwrite hostname',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_CUSTOM_DOMAIN_DENY_LIST',
|
||||
'description' => 'List of reserved or prohibited domains when configuring custom domains.',
|
||||
'introduction' => '',
|
||||
'default' => 'example.com,test.com,app.example.com',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_DOMAIN_FUNCTIONS',
|
||||
'description' => 'A domain to use for function preview URLs. Setting to empty turns off function preview URLs.',
|
||||
@@ -1048,13 +1057,22 @@ return [
|
||||
],
|
||||
[
|
||||
'name' => '_APP_MAINTENANCE_RETENTION_AUDIT',
|
||||
'description' => 'IThe maximum duration (in seconds) upto which to retain audit logs. The default value is 1209600 seconds (14 days).',
|
||||
'description' => 'The maximum duration (in seconds) upto which to retain audit logs. The default value is 1209600 seconds (14 days).',
|
||||
'introduction' => '0.7.0',
|
||||
'default' => '1209600',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE',
|
||||
'description' => 'The maximum duration (in seconds) upto which to retain console audit logs. The default value is 15778800 seconds (6 months).',
|
||||
'introduction' => '1.6.2',
|
||||
'default' => '15778800',
|
||||
'required' => false,
|
||||
'question' => '',
|
||||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_MAINTENANCE_RETENTION_ABUSE',
|
||||
'description' => 'The maximum duration (in seconds) upto which to retain abuse logs. The default value is 86400 seconds (1 day).',
|
||||
|
||||
@@ -43,6 +43,7 @@ use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -155,9 +156,6 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc
|
||||
|
||||
|
||||
$createSession = function (string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents, Mail $queueForMails) {
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
/** @var Utopia\Database\Document $user */
|
||||
$userFromRequest = Authorization::skip(fn () => $dbForProject->getDocument('users', $userId));
|
||||
@@ -273,7 +271,7 @@ $createSession = function (string $userId, string $secret, Request $request, Res
|
||||
->setAttribute('current', true)
|
||||
->setAttribute('countryName', $countryName)
|
||||
->setAttribute('expire', $expire)
|
||||
->setAttribute('secret', ($isPrivilegedUser || $isAppUser) ? Auth::encodeSession($user->getId(), $sessionSecret) : '')
|
||||
->setAttribute('secret', Auth::encodeSession($user->getId(), $sessionSecret))
|
||||
;
|
||||
|
||||
$response->dynamic($session, Response::MODEL_SESSION);
|
||||
@@ -289,6 +287,7 @@ App::post('/v1/account')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'create',
|
||||
description: '/docs/references/account/create.md',
|
||||
auth: [],
|
||||
@@ -432,6 +431,7 @@ App::get('/v1/account')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'get',
|
||||
description: '/docs/references/account/get.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -461,6 +461,7 @@ App::delete('/v1/account')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'delete',
|
||||
description: '/docs/references/account/delete.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -513,6 +514,7 @@ App::get('/v1/account/sessions')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'listSessions',
|
||||
description: '/docs/references/account/list-sessions.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -530,9 +532,6 @@ App::get('/v1/account/sessions')
|
||||
->inject('project')
|
||||
->action(function (Response $response, Document $user, Locale $locale, Document $project) {
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$sessions = $user->getAttribute('sessions', []);
|
||||
$current = Auth::sessionVerify($sessions, Auth::$secret);
|
||||
@@ -542,7 +541,7 @@ App::get('/v1/account/sessions')
|
||||
|
||||
$session->setAttribute('countryName', $countryName);
|
||||
$session->setAttribute('current', ($current == $session->getId()) ? true : false);
|
||||
$session->setAttribute('secret', ($isPrivilegedUser || $isAppUser) ? $session->getAttribute('secret', '') : '');
|
||||
$session->setAttribute('secret', $session->getAttribute('secret', ''));
|
||||
|
||||
$sessions[$key] = $session;
|
||||
}
|
||||
@@ -562,6 +561,7 @@ App::delete('/v1/account/sessions')
|
||||
->label('audits.resource', 'user/{user.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'deleteSessions',
|
||||
description: '/docs/references/account/delete-sessions.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -631,6 +631,7 @@ App::get('/v1/account/sessions/:sessionId')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'getSession',
|
||||
description: '/docs/references/account/get-session.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -649,10 +650,6 @@ App::get('/v1/account/sessions/:sessionId')
|
||||
->inject('project')
|
||||
->action(function (?string $sessionId, Response $response, Document $user, Locale $locale, Document $project) {
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$sessions = $user->getAttribute('sessions', []);
|
||||
$sessionId = ($sessionId === 'current')
|
||||
? Auth::sessionVerify($user->getAttribute('sessions'), Auth::$secret)
|
||||
@@ -665,7 +662,7 @@ App::get('/v1/account/sessions/:sessionId')
|
||||
$session
|
||||
->setAttribute('current', ($session->getAttribute('secret') == Auth::hash(Auth::$secret)))
|
||||
->setAttribute('countryName', $countryName)
|
||||
->setAttribute('secret', ($isPrivilegedUser || $isAppUser) ? $session->getAttribute('secret', '') : '')
|
||||
->setAttribute('secret', $session->getAttribute('secret', ''))
|
||||
;
|
||||
|
||||
return $response->dynamic($session, Response::MODEL_SESSION);
|
||||
@@ -684,6 +681,7 @@ App::delete('/v1/account/sessions/:sessionId')
|
||||
->label('audits.resource', 'user/{user.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'deleteSession',
|
||||
description: '/docs/references/account/delete-session.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -772,6 +770,7 @@ App::patch('/v1/account/sessions/:sessionId')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'updateSession',
|
||||
description: '/docs/references/account/update-session.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -856,6 +855,7 @@ App::post('/v1/account/sessions/email')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'createEmailPasswordSession',
|
||||
description: '/docs/references/account/create-session-email-password.md',
|
||||
auth: [],
|
||||
@@ -897,10 +897,6 @@ App::post('/v1/account/sessions/email')
|
||||
throw new Exception(Exception::USER_BLOCKED); // User is in status blocked
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$user->setAttributes($profile->getArrayCopy());
|
||||
|
||||
$hooks->trigger('passwordValidator', [$dbForProject, $project, $password, &$user, false]);
|
||||
@@ -966,7 +962,7 @@ App::post('/v1/account/sessions/email')
|
||||
$session
|
||||
->setAttribute('current', true)
|
||||
->setAttribute('countryName', $countryName)
|
||||
->setAttribute('secret', ($isPrivilegedUser || $isAppUser) ? Auth::encodeSession($user->getId(), $secret) : '')
|
||||
->setAttribute('secret', Auth::encodeSession($user->getId(), $secret))
|
||||
;
|
||||
|
||||
$queueForEvents
|
||||
@@ -996,6 +992,7 @@ App::post('/v1/account/sessions/anonymous')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'createAnonymousSession',
|
||||
description: '/docs/references/account/create-session-anonymous.md',
|
||||
auth: [],
|
||||
@@ -1019,9 +1016,6 @@ App::post('/v1/account/sessions/anonymous')
|
||||
->inject('queueForEvents')
|
||||
->action(function (Request $request, Response $response, Locale $locale, Document $user, Document $project, Database $dbForProject, Reader $geodb, Event $queueForEvents) {
|
||||
$protocol = $request->getProtocol();
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
if ('console' === $project->getId()) {
|
||||
throw new Exception(Exception::USER_ANONYMOUS_CONSOLE_PROHIBITED, 'Failed to create anonymous user');
|
||||
@@ -1123,7 +1117,7 @@ App::post('/v1/account/sessions/anonymous')
|
||||
$session
|
||||
->setAttribute('current', true)
|
||||
->setAttribute('countryName', $countryName)
|
||||
->setAttribute('secret', ($isPrivilegedUser || $isAppUser) ? Auth::encodeSession($user->getId(), $secret) : '')
|
||||
->setAttribute('secret', Auth::encodeSession($user->getId(), $secret))
|
||||
;
|
||||
|
||||
$response->dynamic($session, Response::MODEL_SESSION);
|
||||
@@ -1139,6 +1133,7 @@ App::post('/v1/account/sessions/token')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'createSession',
|
||||
description: '/docs/references/account/create-session.md',
|
||||
auth: [],
|
||||
@@ -1172,6 +1167,7 @@ App::get('/v1/account/sessions/oauth2/:provider')
|
||||
->label('scope', 'sessions.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'createOAuth2Session',
|
||||
description: '/docs/references/account/create-session-oauth2.md',
|
||||
type: MethodType::WEBAUTH,
|
||||
@@ -1243,7 +1239,7 @@ App::get('/v1/account/sessions/oauth2/:provider')
|
||||
});
|
||||
|
||||
App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
||||
->desc('OAuth2 callback')
|
||||
->desc('Get OAuth2 callback')
|
||||
->groups(['account'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('scope', 'public')
|
||||
@@ -1273,7 +1269,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
||||
});
|
||||
|
||||
App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
||||
->desc('OAuth2 callback')
|
||||
->desc('Create OAuth2 callback')
|
||||
->groups(['account'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('scope', 'public')
|
||||
@@ -1304,7 +1300,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
|
||||
});
|
||||
|
||||
App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
->desc('OAuth2 redirect')
|
||||
->desc('Get OAuth2 redirect')
|
||||
->groups(['api', 'account', 'session'])
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
@@ -1449,7 +1445,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::notEqual('userInternalId', $user->getInternalId()),
|
||||
]);
|
||||
if (!$identityWithMatchingEmail->isEmpty()) {
|
||||
throw new Exception(Exception::USER_ALREADY_EXISTS);
|
||||
$failureRedirect(Exception::USER_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
$userWithMatchingEmail = $dbForProject->find('users', [
|
||||
@@ -1457,7 +1453,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::notEqual('$id', $userId),
|
||||
]);
|
||||
if (!empty($userWithMatchingEmail)) {
|
||||
throw new Exception(Exception::USER_ALREADY_EXISTS);
|
||||
$failureRedirect(Exception::USER_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
$sessionUpgrade = true;
|
||||
@@ -1486,7 +1482,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
|
||||
if ($user === false || $user->isEmpty()) { // No user logged in or with OAuth2 provider ID, create new one or connect with account with same email
|
||||
if (empty($email)) {
|
||||
throw new Exception(Exception::USER_UNAUTHORIZED, 'OAuth provider failed to return email.');
|
||||
$failureRedirect(Exception::USER_UNAUTHORIZED, 'OAuth provider failed to return email.');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1529,7 +1525,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::equal('providerEmail', [$email]),
|
||||
]);
|
||||
if (!$identityWithMatchingEmail->isEmpty()) {
|
||||
throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
$failureRedirect(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -1601,7 +1597,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||
Query::notEqual('userInternalId', $user->getInternalId()),
|
||||
]);
|
||||
if (!empty($identitiesWithMatchingEmail)) {
|
||||
throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
$failureRedirect(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */
|
||||
}
|
||||
|
||||
$dbForProject->createDocument('identities', new Document([
|
||||
@@ -1769,6 +1765,7 @@ App::get('/v1/account/tokens/oauth2/:provider')
|
||||
->label('scope', 'sessions.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'tokens',
|
||||
name: 'createOAuth2Token',
|
||||
description: '/docs/references/account/create-token-oauth2.md',
|
||||
auth: [],
|
||||
@@ -1849,6 +1846,7 @@ App::post('/v1/account/tokens/magic-url')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'tokens',
|
||||
name: 'createMagicURLToken',
|
||||
description: '/docs/references/account/create-token-magic-url.md',
|
||||
auth: [],
|
||||
@@ -1884,9 +1882,6 @@ App::post('/v1/account/tokens/magic-url')
|
||||
$phrase = Phrase::generate();
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$result = $dbForProject->findOne('users', [Query::equal('email', [$email])]);
|
||||
if (!$result->isEmpty()) {
|
||||
@@ -2068,17 +2063,11 @@ App::post('/v1/account/tokens/magic-url')
|
||||
->setRecipient($email)
|
||||
->trigger();
|
||||
|
||||
// Set to unhashed secret for events and server responses
|
||||
$token->setAttribute('secret', $tokenSecret);
|
||||
|
||||
$queueForEvents
|
||||
->setPayload($response->output($token, Response::MODEL_TOKEN), sensitive: ['secret']);
|
||||
|
||||
// Hide secret for clients
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$token->setAttribute('secret', '');
|
||||
}
|
||||
|
||||
if (!empty($phrase)) {
|
||||
$token->setAttribute('phrase', $phrase);
|
||||
}
|
||||
@@ -2098,6 +2087,7 @@ App::post('/v1/account/tokens/email')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'tokens',
|
||||
name: 'createEmailToken',
|
||||
description: '/docs/references/account/create-token-email.md',
|
||||
auth: [],
|
||||
@@ -2131,10 +2121,6 @@ App::post('/v1/account/tokens/email')
|
||||
$phrase = Phrase::generate();
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$result = $dbForProject->findOne('users', [Query::equal('email', [$email])]);
|
||||
if (!$result->isEmpty()) {
|
||||
$user->setAttributes($result->getArrayCopy());
|
||||
@@ -2303,17 +2289,11 @@ App::post('/v1/account/tokens/email')
|
||||
->setRecipient($email)
|
||||
->trigger();
|
||||
|
||||
// Set to unhashed secret for events and server responses
|
||||
$token->setAttribute('secret', $tokenSecret);
|
||||
|
||||
$queueForEvents
|
||||
->setPayload($response->output($token, Response::MODEL_TOKEN), sensitive: ['secret']);
|
||||
|
||||
// Hide secret for clients
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$token->setAttribute('secret', '');
|
||||
}
|
||||
|
||||
if (!empty($phrase)) {
|
||||
$token->setAttribute('phrase', $phrase);
|
||||
}
|
||||
@@ -2333,6 +2313,7 @@ App::put('/v1/account/sessions/magic-url')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'updateMagicURLSession',
|
||||
description: '/docs/references/account/create-session.md',
|
||||
auth: [],
|
||||
@@ -2370,6 +2351,7 @@ App::put('/v1/account/sessions/phone')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'sessions',
|
||||
name: 'updatePhoneSession',
|
||||
description: '/docs/references/account/create-session.md',
|
||||
auth: [],
|
||||
@@ -2408,6 +2390,7 @@ App::post('/v1/account/tokens/phone')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'tokens',
|
||||
name: 'createPhoneToken',
|
||||
description: '/docs/references/account/create-token-phone.md',
|
||||
auth: [],
|
||||
@@ -2439,10 +2422,6 @@ App::post('/v1/account/tokens/phone')
|
||||
throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured');
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$result = $dbForProject->findOne('users', [Query::equal('phone', [$phone])]);
|
||||
if (!$result->isEmpty()) {
|
||||
$user->setAttributes($result->getArrayCopy());
|
||||
@@ -2594,14 +2573,13 @@ App::post('/v1/account/tokens/phone')
|
||||
}
|
||||
}
|
||||
|
||||
// Set to unhashed secret for events and server responses
|
||||
$token->setAttribute('secret', $secret);
|
||||
|
||||
$queueForEvents
|
||||
->setPayload($response->output($token, Response::MODEL_TOKEN), sensitive: ['secret']);
|
||||
|
||||
// Hide secret for clients
|
||||
$token->setAttribute('secret', ($isPrivilegedUser || $isAppUser) ? Auth::encodeSession($user->getId(), $secret) : '');
|
||||
// Encode secret for clients
|
||||
$token->setAttribute('secret', Auth::encodeSession($user->getId(), $secret));
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||
@@ -2616,6 +2594,7 @@ App::post('/v1/account/jwts')
|
||||
->label('auth.type', 'jwt')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'tokens',
|
||||
name: 'createJWT',
|
||||
description: '/docs/references/account/create-jwt.md',
|
||||
auth: [],
|
||||
@@ -2664,6 +2643,7 @@ App::get('/v1/account/prefs')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'getPrefs',
|
||||
description: '/docs/references/account/get-prefs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -2690,6 +2670,7 @@ App::get('/v1/account/logs')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'logs',
|
||||
name: 'listLogs',
|
||||
description: '/docs/references/account/list-logs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -2766,6 +2747,7 @@ App::patch('/v1/account/name')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'updateName',
|
||||
description: '/docs/references/account/update-name.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -2804,6 +2786,7 @@ App::patch('/v1/account/password')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'updatePassword',
|
||||
description: '/docs/references/account/update-password.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -2877,6 +2860,7 @@ App::patch('/v1/account/email')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'updateEmail',
|
||||
description: '/docs/references/account/update-email.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -2973,6 +2957,7 @@ App::patch('/v1/account/phone')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'updatePhone',
|
||||
description: '/docs/references/account/update-phone.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3058,6 +3043,7 @@ App::patch('/v1/account/prefs')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'updatePrefs',
|
||||
description: '/docs/references/account/update-prefs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3095,6 +3081,7 @@ App::patch('/v1/account/status')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'account',
|
||||
name: 'updateStatus',
|
||||
description: '/docs/references/account/update-status.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3145,6 +3132,7 @@ App::post('/v1/account/recovery')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'recovery',
|
||||
name: 'createRecovery',
|
||||
description: '/docs/references/account/create-recovery.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3174,11 +3162,6 @@ App::post('/v1/account/recovery')
|
||||
throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP Disabled');
|
||||
}
|
||||
$url = htmlentities($url);
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$email = \strtolower($email);
|
||||
|
||||
$profile = $dbForProject->findOne('users', [
|
||||
@@ -3302,19 +3285,13 @@ App::post('/v1/account/recovery')
|
||||
->setSubject($subject)
|
||||
->trigger();
|
||||
|
||||
// Set to unhashed secret for events and server responses
|
||||
$recovery->setAttribute('secret', $secret);
|
||||
|
||||
$queueForEvents
|
||||
->setParam('userId', $profile->getId())
|
||||
->setParam('tokenId', $recovery->getId())
|
||||
->setUser($profile)
|
||||
->setPayload($response->output($recovery, Response::MODEL_TOKEN), sensitive: ['secret']);
|
||||
|
||||
// Hide secret for clients
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$recovery->setAttribute('secret', '');
|
||||
}
|
||||
->setPayload(Response::showSensitive(fn () => $response->output($recovery, Response::MODEL_TOKEN)), sensitive: ['secret']);
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||
@@ -3322,7 +3299,7 @@ App::post('/v1/account/recovery')
|
||||
});
|
||||
|
||||
App::put('/v1/account/recovery')
|
||||
->desc('Create password recovery (confirmation)')
|
||||
->desc('Update password recovery (confirmation)')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'sessions.write')
|
||||
->label('event', 'users.[userId].recovery.[tokenId].update')
|
||||
@@ -3331,6 +3308,7 @@ App::put('/v1/account/recovery')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'recovery',
|
||||
name: 'updateRecovery',
|
||||
description: '/docs/references/account/update-recovery.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3407,7 +3385,7 @@ App::put('/v1/account/recovery')
|
||||
$queueForEvents
|
||||
->setParam('userId', $profile->getId())
|
||||
->setParam('tokenId', $recoveryDocument->getId())
|
||||
;
|
||||
->setPayload(Response::showSensitive(fn () => $response->output($recoveryDocument, Response::MODEL_TOKEN)), sensitive: ['secret']);
|
||||
|
||||
$response->dynamic($recoveryDocument, Response::MODEL_TOKEN);
|
||||
});
|
||||
@@ -3421,6 +3399,7 @@ App::post('/v1/account/verification')
|
||||
->label('audits.resource', 'user/{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'verification',
|
||||
name: 'createVerification',
|
||||
description: '/docs/references/account/create-email-verification.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3454,9 +3433,6 @@ App::post('/v1/account/verification')
|
||||
throw new Exception(Exception::USER_EMAIL_ALREADY_VERIFIED);
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
$verificationSecret = Auth::tokenGenerator(Auth::TOKEN_LENGTH_VERIFICATION);
|
||||
$expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM);
|
||||
|
||||
@@ -3565,18 +3541,12 @@ App::post('/v1/account/verification')
|
||||
->setName($user->getAttribute('name') ?? '')
|
||||
->trigger();
|
||||
|
||||
// Set to unhashed secret for events and server responses
|
||||
$verification->setAttribute('secret', $verificationSecret);
|
||||
|
||||
$queueForEvents
|
||||
->setParam('userId', $user->getId())
|
||||
->setParam('tokenId', $verification->getId())
|
||||
->setPayload($response->output($verification, Response::MODEL_TOKEN), sensitive: ['secret']);
|
||||
|
||||
// Hide secret for clients
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$verification->setAttribute('secret', '');
|
||||
}
|
||||
->setPayload(Response::showSensitive(fn () => $response->output($verification, Response::MODEL_TOKEN)), sensitive: ['secret']);
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||
@@ -3584,7 +3554,7 @@ App::post('/v1/account/verification')
|
||||
});
|
||||
|
||||
App::put('/v1/account/verification')
|
||||
->desc('Create email verification (confirmation)')
|
||||
->desc('Update email verification (confirmation)')
|
||||
->groups(['api', 'account'])
|
||||
->label('scope', 'public')
|
||||
->label('event', 'users.[userId].verification.[tokenId].update')
|
||||
@@ -3592,6 +3562,7 @@ App::put('/v1/account/verification')
|
||||
->label('audits.resource', 'user/{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'verification',
|
||||
name: 'updateVerification',
|
||||
description: '/docs/references/account/update-email-verification.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3643,7 +3614,8 @@ App::put('/v1/account/verification')
|
||||
|
||||
$queueForEvents
|
||||
->setParam('userId', $userId)
|
||||
->setParam('tokenId', $verification->getId());
|
||||
->setParam('tokenId', $verification->getId())
|
||||
->setPayload(Response::showSensitive(fn () => $response->output($verification, Response::MODEL_TOKEN)), sensitive: ['secret']);
|
||||
|
||||
$response->dynamic($verification, Response::MODEL_TOKEN);
|
||||
});
|
||||
@@ -3658,6 +3630,7 @@ App::post('/v1/account/verification/phone')
|
||||
->label('audits.resource', 'user/{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'verification',
|
||||
name: 'createPhoneVerification',
|
||||
description: '/docs/references/account/create-phone-verification.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3696,10 +3669,6 @@ App::post('/v1/account/verification/phone')
|
||||
throw new Exception(Exception::USER_PHONE_ALREADY_VERIFIED);
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
$secret = null;
|
||||
$sendSMS = true;
|
||||
$mockNumbers = $project->getAttribute('auths', [])['mockNumbers'] ?? [];
|
||||
@@ -3788,7 +3757,6 @@ App::post('/v1/account/verification/phone')
|
||||
}
|
||||
}
|
||||
|
||||
// Set to unhashed secret for events and server responses
|
||||
$verification->setAttribute('secret', $secret);
|
||||
|
||||
$queueForEvents
|
||||
@@ -3796,11 +3764,6 @@ App::post('/v1/account/verification/phone')
|
||||
->setParam('tokenId', $verification->getId())
|
||||
->setPayload($response->output($verification, Response::MODEL_TOKEN), sensitive: ['secret']);
|
||||
|
||||
// Hide secret for clients
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$verification->setAttribute('secret', '');
|
||||
}
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||
->dynamic($verification, Response::MODEL_TOKEN);
|
||||
@@ -3815,6 +3778,7 @@ App::put('/v1/account/verification/phone')
|
||||
->label('audits.resource', 'user/{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'verification',
|
||||
name: 'updatePhoneVerification',
|
||||
description: '/docs/references/account/update-phone-verification.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3880,6 +3844,7 @@ App::patch('/v1/account/mfa')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'updateMFA',
|
||||
description: '/docs/references/account/update-mfa.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3933,6 +3898,7 @@ App::get('/v1/account/mfa/factors')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'listMfaFactors',
|
||||
description: '/docs/references/account/list-mfa-factors.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -3973,6 +3939,7 @@ App::post('/v1/account/mfa/authenticators/:type')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'createMfaAuthenticator',
|
||||
description: '/docs/references/account/create-mfa-authenticator.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4040,7 +4007,7 @@ App::post('/v1/account/mfa/authenticators/:type')
|
||||
});
|
||||
|
||||
App::put('/v1/account/mfa/authenticators/:type')
|
||||
->desc('Verify authenticator')
|
||||
->desc('Update authenticator (confirmation)')
|
||||
->groups(['api', 'account'])
|
||||
->label('event', 'users.[userId].update.mfa')
|
||||
->label('scope', 'account')
|
||||
@@ -4049,6 +4016,7 @@ App::put('/v1/account/mfa/authenticators/:type')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'updateMfaAuthenticator',
|
||||
description: '/docs/references/account/update-mfa-authenticator.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4118,6 +4086,7 @@ App::post('/v1/account/mfa/recovery-codes')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'createMfaRecoveryCodes',
|
||||
description: '/docs/references/account/create-mfa-recovery-codes.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4155,7 +4124,7 @@ App::post('/v1/account/mfa/recovery-codes')
|
||||
});
|
||||
|
||||
App::patch('/v1/account/mfa/recovery-codes')
|
||||
->desc('Regenerate MFA recovery codes')
|
||||
->desc('Update MFA recovery codes (regenerate)')
|
||||
->groups(['api', 'account', 'mfaProtected'])
|
||||
->label('event', 'users.[userId].update.mfa')
|
||||
->label('scope', 'account')
|
||||
@@ -4164,6 +4133,7 @@ App::patch('/v1/account/mfa/recovery-codes')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'updateMfaRecoveryCodes',
|
||||
description: '/docs/references/account/update-mfa-recovery-codes.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4200,11 +4170,12 @@ App::patch('/v1/account/mfa/recovery-codes')
|
||||
});
|
||||
|
||||
App::get('/v1/account/mfa/recovery-codes')
|
||||
->desc('Get MFA recovery codes')
|
||||
->desc('List MFA recovery codes')
|
||||
->groups(['api', 'account', 'mfaProtected'])
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'getMfaRecoveryCodes',
|
||||
description: '/docs/references/account/get-mfa-recovery-codes.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4243,6 +4214,7 @@ App::delete('/v1/account/mfa/authenticators/:type')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'deleteMfaAuthenticator',
|
||||
description: '/docs/references/account/delete-mfa-authenticator.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4288,6 +4260,7 @@ App::post('/v1/account/mfa/challenge')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'createMfaChallenge',
|
||||
description: '/docs/references/account/create-mfa-challenge.md',
|
||||
auth: [],
|
||||
@@ -4498,7 +4471,7 @@ App::post('/v1/account/mfa/challenge')
|
||||
});
|
||||
|
||||
App::put('/v1/account/mfa/challenge')
|
||||
->desc('Create MFA challenge (confirmation)')
|
||||
->desc('Update MFA challenge (confirmation)')
|
||||
->groups(['api', 'account', 'mfa'])
|
||||
->label('scope', 'account')
|
||||
->label('event', 'users.[userId].sessions.[sessionId].create')
|
||||
@@ -4507,6 +4480,7 @@ App::put('/v1/account/mfa/challenge')
|
||||
->label('audits.userId', '{response.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'mfa',
|
||||
name: 'updateMfaChallenge',
|
||||
description: '/docs/references/account/update-mfa-challenge.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4600,6 +4574,7 @@ App::post('/v1/account/targets/push')
|
||||
->label('event', 'users.[userId].targets.[targetId].create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'pushTargets',
|
||||
name: 'createPushTarget',
|
||||
description: '/docs/references/account/create-push-target.md',
|
||||
auth: [AuthType::SESSION],
|
||||
@@ -4680,6 +4655,7 @@ App::put('/v1/account/targets/:targetId/push')
|
||||
->label('event', 'users.[userId].targets.[targetId].update')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'pushTargets',
|
||||
name: 'updatePushTarget',
|
||||
description: '/docs/references/account/update-push-target.md',
|
||||
auth: [AuthType::SESSION],
|
||||
@@ -4744,6 +4720,7 @@ App::delete('/v1/account/targets/:targetId/push')
|
||||
->label('event', 'users.[userId].targets.[targetId].delete')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'pushTargets',
|
||||
name: 'deletePushTarget',
|
||||
description: '/docs/references/account/delete-push-target.md',
|
||||
auth: [AuthType::SESSION],
|
||||
@@ -4794,6 +4771,7 @@ App::get('/v1/account/identities')
|
||||
->label('scope', 'account')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'identities',
|
||||
name: 'listIdentities',
|
||||
description: '/docs/references/account/list-identities.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -4845,8 +4823,11 @@ App::get('/v1/account/identities')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
$results = $dbForProject->find('identities', $queries);
|
||||
try {
|
||||
$results = $dbForProject->find('identities', $queries);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$total = $dbForProject->count('identities', $filterQueries, APP_LIMIT_COUNT);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
@@ -4865,6 +4846,7 @@ App::delete('/v1/account/identities/:identityId')
|
||||
->label('audits.userId', '{user.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'account',
|
||||
group: 'identities',
|
||||
name: 'deleteIdentity',
|
||||
description: '/docs/references/account/delete-identity.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
|
||||
@@ -171,6 +171,7 @@ App::get('/v1/avatars/credit-cards/:code')
|
||||
->label('cache.resource', 'avatar/credit-card')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getCreditCard',
|
||||
description: '/docs/references/avatars/get-credit-card.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -198,6 +199,7 @@ App::get('/v1/avatars/browsers/:code')
|
||||
->label('cache.resource', 'avatar/browser')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getBrowser',
|
||||
description: '/docs/references/avatars/get-browser.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -225,6 +227,7 @@ App::get('/v1/avatars/flags/:code')
|
||||
->label('cache.resource', 'avatar/flag')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getFlag',
|
||||
description: '/docs/references/avatars/get-flag.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -252,6 +255,7 @@ App::get('/v1/avatars/image')
|
||||
->label('cache.resource', 'avatar/image')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getImage',
|
||||
description: '/docs/references/avatars/get-image.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -322,6 +326,7 @@ App::get('/v1/avatars/favicon')
|
||||
->label('cache.resource', 'avatar/favicon')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getFavicon',
|
||||
description: '/docs/references/avatars/get-favicon.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -472,6 +477,7 @@ App::get('/v1/avatars/qr')
|
||||
->label('scope', 'avatars.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getQR',
|
||||
description: '/docs/references/avatars/get-qr.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -520,6 +526,7 @@ App::get('/v1/avatars/initials')
|
||||
->label('cache.resource', 'avatar/initials')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'avatars',
|
||||
group: null,
|
||||
name: 'getInitials',
|
||||
description: '/docs/references/avatars/get-initials.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
|
||||
@@ -27,6 +27,7 @@ App::get('/v1/console/variables')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'console',
|
||||
group: 'console',
|
||||
name: 'variables',
|
||||
description: '/docs/references/console/variables.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -67,11 +68,12 @@ App::get('/v1/console/variables')
|
||||
});
|
||||
|
||||
App::post('/v1/console/assistant')
|
||||
->desc('Ask query')
|
||||
->desc('Create assistant query')
|
||||
->groups(['api', 'assistant'])
|
||||
->label('scope', 'assistant.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'assistant',
|
||||
group: 'console',
|
||||
name: 'chat',
|
||||
description: '/docs/references/assistant/chat.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -31,6 +31,7 @@ use Utopia\Database\Exception\Duplicate as DuplicateException;
|
||||
use Utopia\Database\Exception\Index as IndexException;
|
||||
use Utopia\Database\Exception\Limit as LimitException;
|
||||
use Utopia\Database\Exception\NotFound as NotFoundException;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Exception\Restricted as RestrictedException;
|
||||
use Utopia\Database\Exception\Structure as StructureException;
|
||||
@@ -466,6 +467,7 @@ App::post('/v1/databases')
|
||||
->label('audits.resource', 'database/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'databases',
|
||||
name: 'create',
|
||||
description: '/docs/references/databases/create.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -534,7 +536,6 @@ App::post('/v1/databases')
|
||||
}
|
||||
|
||||
$queueForEvents->setParam('databaseId', $database->getId());
|
||||
$queueForStatsUsage->addMetric(str_replace(['{databaseInternalId}'], [$database->getInternalId()], METRIC_DATABASE_ID_STORAGE), 1); // per database
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||
@@ -548,6 +549,7 @@ App::get('/v1/databases')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'databases',
|
||||
name: 'list',
|
||||
description: '/docs/references/databases/list.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -597,9 +599,15 @@ App::get('/v1/databases')
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$databases = $dbForProject->find('databases', $queries);
|
||||
$total = $dbForProject->count('databases', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'databases' => $dbForProject->find('databases', $queries),
|
||||
'total' => $dbForProject->count('databases', $filterQueries, APP_LIMIT_COUNT),
|
||||
'databases' => $databases,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_DATABASE_LIST);
|
||||
});
|
||||
|
||||
@@ -610,6 +618,7 @@ App::get('/v1/databases/:databaseId')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'databases',
|
||||
name: 'get',
|
||||
description: '/docs/references/databases/get.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -642,6 +651,7 @@ App::get('/v1/databases/:databaseId/logs')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'logs',
|
||||
name: 'listLogs',
|
||||
description: '/docs/references/databases/get-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -745,6 +755,7 @@ App::put('/v1/databases/:databaseId')
|
||||
->label('audits.resource', 'database/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'databases',
|
||||
name: 'update',
|
||||
description: '/docs/references/databases/update.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -790,6 +801,7 @@ App::delete('/v1/databases/:databaseId')
|
||||
->label('audits.resource', 'database/{request.databaseId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'databases',
|
||||
name: 'delete',
|
||||
description: '/docs/references/databases/delete.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -830,9 +842,6 @@ App::delete('/v1/databases/:databaseId')
|
||||
->setParam('databaseId', $database->getId())
|
||||
->setPayload($response->output($database, Response::MODEL_DATABASE));
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_DATABASES_STORAGE, 1); // Global, deletion forces full recalculation
|
||||
|
||||
$response->noContent();
|
||||
});
|
||||
|
||||
@@ -846,6 +855,7 @@ App::post('/v1/databases/:databaseId/collections')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'createCollection',
|
||||
description: '/docs/references/databases/create-collection.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -917,6 +927,7 @@ App::get('/v1/databases/:databaseId/collections')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'listCollections',
|
||||
description: '/docs/references/databases/list-collections.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -975,9 +986,15 @@ App::get('/v1/databases/:databaseId/collections')
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$collections = $dbForProject->find('database_' . $database->getInternalId(), $queries);
|
||||
$total = $dbForProject->count('database_' . $database->getInternalId(), $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'collections' => $dbForProject->find('database_' . $database->getInternalId(), $queries),
|
||||
'total' => $dbForProject->count('database_' . $database->getInternalId(), $filterQueries, APP_LIMIT_COUNT),
|
||||
'collections' => $collections,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_COLLECTION_LIST);
|
||||
});
|
||||
|
||||
@@ -989,6 +1006,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'getCollection',
|
||||
description: '/docs/references/databases/get-collection.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1030,6 +1048,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'listCollectionLogs',
|
||||
description: '/docs/references/databases/get-collection-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1142,6 +1161,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'updateCollection',
|
||||
description: '/docs/references/databases/update-collection.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1216,6 +1236,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'deleteCollection',
|
||||
description: '/docs/references/databases/delete-collection.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1279,6 +1300,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createStringAttribute',
|
||||
description: '/docs/references/databases/create-string-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1341,6 +1363,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createEmailAttribute',
|
||||
description: '/docs/references/databases/create-email-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1389,6 +1412,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createEnumAttribute',
|
||||
description: '/docs/references/databases/create-attribute-enum.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1442,6 +1466,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createIpAttribute',
|
||||
description: '/docs/references/databases/create-ip-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1490,6 +1515,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createUrlAttribute',
|
||||
description: '/docs/references/databases/create-url-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1538,6 +1564,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createIntegerAttribute',
|
||||
description: '/docs/references/databases/create-integer-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1615,6 +1642,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createFloatAttribute',
|
||||
description: '/docs/references/databases/create-float-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1690,6 +1718,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createBooleanAttribute',
|
||||
description: '/docs/references/databases/create-boolean-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1737,6 +1766,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createDatetimeAttribute',
|
||||
description: '/docs/references/databases/create-datetime-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1787,6 +1817,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'createRelationshipAttribute',
|
||||
description: '/docs/references/databases/create-relationship-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1918,6 +1949,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'listAttributes',
|
||||
description: '/docs/references/databases/list-attributes.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1986,9 +2018,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes')
|
||||
}
|
||||
|
||||
$filters = Query::groupByType($queries)['filters'];
|
||||
|
||||
$attributes = $dbForProject->find('attributes', $queries);
|
||||
$total = $dbForProject->count('attributes', $filters, APP_LIMIT_COUNT);
|
||||
try {
|
||||
$attributes = $dbForProject->find('attributes', $queries);
|
||||
$total = $dbForProject->count('attributes', $filters, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'attributes' => $attributes,
|
||||
@@ -2004,6 +2039,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'getAttribute',
|
||||
description: '/docs/references/databases/get-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2088,6 +2124,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateStringAttribute',
|
||||
description: '/docs/references/databases/update-string-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2139,6 +2176,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateEmailAttribute',
|
||||
description: '/docs/references/databases/update-email-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2188,6 +2226,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateEnumAttribute',
|
||||
description: '/docs/references/databases/update-enum-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2239,6 +2278,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateIpAttribute',
|
||||
description: '/docs/references/databases/update-ip-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2288,6 +2328,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/:
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateUrlAttribute',
|
||||
description: '/docs/references/databases/update-url-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2337,6 +2378,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateIntegerAttribute',
|
||||
description: '/docs/references/databases/update-integer-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2396,6 +2438,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateFloatAttribute',
|
||||
description: '/docs/references/databases/update-float-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2455,6 +2498,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateBooleanAttribute',
|
||||
description: '/docs/references/databases/update-boolean-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2503,6 +2547,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateDatetimeAttribute',
|
||||
description: '/docs/references/databases/update-datetime-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2551,6 +2596,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'updateRelationshipAttribute',
|
||||
description: '/docs/references/databases/update-relationship-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2616,6 +2662,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'attributes',
|
||||
name: 'deleteAttribute',
|
||||
description: '/docs/references/databases/delete-attribute.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2732,9 +2779,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key
|
||||
->setContext('database', $db)
|
||||
->setPayload($response->output($attribute, $model));
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$db->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection
|
||||
|
||||
$response->noContent();
|
||||
});
|
||||
|
||||
@@ -2749,6 +2793,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'collections',
|
||||
name: 'createIndex',
|
||||
description: '/docs/references/databases/create-index.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2919,6 +2964,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'indexes',
|
||||
name: 'listIndexes',
|
||||
description: '/docs/references/databases/list-indexes.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2987,9 +3033,16 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
try {
|
||||
$total = $dbForProject->count('indexes', $filterQueries, APP_LIMIT_COUNT);
|
||||
$indexes = $dbForProject->find('indexes', $queries);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $dbForProject->count('indexes', $filterQueries, APP_LIMIT_COUNT),
|
||||
'indexes' => $dbForProject->find('indexes', $queries),
|
||||
'total' => $total,
|
||||
'indexes' => $indexes,
|
||||
]), Response::MODEL_INDEX_LIST);
|
||||
});
|
||||
|
||||
@@ -3001,6 +3054,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'indexes',
|
||||
name: 'getIndex',
|
||||
description: '/docs/references/databases/get-index.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -3050,6 +3104,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'indexes',
|
||||
name: 'deleteIndex',
|
||||
description: '/docs/references/databases/delete-index.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -3128,6 +3183,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
[
|
||||
new Method(
|
||||
namespace: 'databases',
|
||||
group: 'documents',
|
||||
name: 'createDocument',
|
||||
description: '/docs/references/databases/create-document.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -3355,9 +3411,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
$processDocument($collection, $document);
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations)
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations)
|
||||
->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1))
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); // per collection
|
||||
|
||||
$response->addHeader('X-Debug-Operations', $operations);
|
||||
|
||||
@@ -3390,6 +3445,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'documents',
|
||||
name: 'listDocuments',
|
||||
description: '/docs/references/databases/list-documents.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -3453,9 +3509,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
|
||||
$cursor->setValue($cursorDocument);
|
||||
}
|
||||
|
||||
$documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries);
|
||||
$total = $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT);
|
||||
try {
|
||||
$documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries);
|
||||
$total = $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$operations = 0;
|
||||
|
||||
@@ -3520,7 +3579,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
}
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations)
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_READS, max($operations, 1))
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations);
|
||||
|
||||
$response->addHeader('X-Debug-Operations', $operations);
|
||||
@@ -3566,6 +3625,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'documents',
|
||||
name: 'getDocument',
|
||||
description: '/docs/references/databases/get-document.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -3661,7 +3721,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
||||
$processDocument($collection, $document);
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations)
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_READS, max($operations, 1))
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations);
|
||||
|
||||
$response->addHeader('X-Debug-Operations', $operations);
|
||||
@@ -3677,6 +3737,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'logs',
|
||||
name: 'listDocumentLogs',
|
||||
description: '/docs/references/databases/get-document-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -3797,6 +3858,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'documents',
|
||||
name: 'updateDocument',
|
||||
description: '/docs/references/databases/update-document.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -3959,7 +4021,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum
|
||||
$setCollection($collection, $newDocument);
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations)
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1))
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations);
|
||||
|
||||
$response->addHeader('X-Debug-Operations', $operations);
|
||||
@@ -4051,6 +4113,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: 'documents',
|
||||
name: 'deleteDocument',
|
||||
description: '/docs/references/databases/delete-document.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -4141,8 +4204,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1)
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1)
|
||||
->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); // per collection
|
||||
|
||||
$response->addHeader('X-Debug-Operations', 1);
|
||||
|
||||
@@ -4172,6 +4234,7 @@ App::get('/v1/databases/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: null,
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/databases/get-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -4267,6 +4330,7 @@ App::get('/v1/databases/:databaseId/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: null,
|
||||
name: 'getDatabaseUsage',
|
||||
description: '/docs/references/databases/get-database-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -4368,6 +4432,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'databases',
|
||||
group: null,
|
||||
name: 'getCollectionUsage',
|
||||
description: '/docs/references/databases/get-collection-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -37,6 +37,7 @@ use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate as DuplicateException;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -150,6 +151,7 @@ App::post('/v1/functions')
|
||||
->label('audits.resource', 'function/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'functions',
|
||||
name: 'create',
|
||||
description: '/docs/references/functions/create-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -295,7 +297,7 @@ App::post('/v1/functions')
|
||||
|
||||
$schedule = Authorization::skip(
|
||||
fn () => $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'), // Todo replace with projects region
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'function',
|
||||
'resourceId' => $function->getId(),
|
||||
'resourceInternalId' => $function->getInternalId(),
|
||||
@@ -387,6 +389,8 @@ App::post('/v1/functions')
|
||||
'resourceInternalId' => $function->getInternalId(),
|
||||
'status' => 'verified',
|
||||
'certificateId' => '',
|
||||
'owner' => 'Appwrite',
|
||||
'region' => $project->getAttribute('region')
|
||||
]))
|
||||
);
|
||||
|
||||
@@ -429,6 +433,7 @@ App::get('/v1/functions')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'functions',
|
||||
name: 'list',
|
||||
description: '/docs/references/functions/list-functions.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -481,10 +486,15 @@ App::get('/v1/functions')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$functions = $dbForProject->find('functions', $queries);
|
||||
$total = $dbForProject->count('functions', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'functions' => $dbForProject->find('functions', $queries),
|
||||
'total' => $dbForProject->count('functions', $filterQueries, APP_LIMIT_COUNT),
|
||||
'functions' => $functions,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_FUNCTION_LIST);
|
||||
});
|
||||
|
||||
@@ -495,6 +505,7 @@ App::get('/v1/functions/runtimes')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'runtimes',
|
||||
name: 'listRuntimes',
|
||||
description: '/docs/references/functions/list-runtimes.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -534,6 +545,7 @@ App::get('/v1/functions/specifications')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'runtimes',
|
||||
name: 'listSpecifications',
|
||||
description: '/docs/references/functions/list-specifications.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
@@ -576,6 +588,7 @@ App::get('/v1/functions/:functionId')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'functions',
|
||||
name: 'get',
|
||||
description: '/docs/references/functions/get-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -606,6 +619,7 @@ App::get('/v1/functions/:functionId/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: null,
|
||||
name: 'getFunctionUsage',
|
||||
description: '/docs/references/functions/get-function-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -717,6 +731,7 @@ App::get('/v1/functions/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: null,
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/functions/get-functions-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -826,6 +841,7 @@ App::put('/v1/functions/:functionId')
|
||||
->label('audits.resource', 'function/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'functions',
|
||||
name: 'update',
|
||||
description: '/docs/references/functions/update-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -867,7 +883,8 @@ App::put('/v1/functions/:functionId')
|
||||
->inject('queueForBuilds')
|
||||
->inject('dbForPlatform')
|
||||
->inject('gitHub')
|
||||
->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForPlatform, GitHub $github) use ($redeployVcs) {
|
||||
->inject('executor')
|
||||
->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForPlatform, GitHub $github, Executor $executor) use ($redeployVcs) {
|
||||
// TODO: If only branch changes, re-deploy
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
@@ -970,7 +987,6 @@ App::put('/v1/functions/:functionId')
|
||||
|
||||
// Enforce Cold Start if spec limits change.
|
||||
if ($function->getAttribute('specification') !== $specification && !empty($function->getAttribute('deployment'))) {
|
||||
$executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
|
||||
try {
|
||||
$executor->deleteRuntime($project->getId(), $function->getAttribute('deployment'));
|
||||
} catch (\Throwable $th) {
|
||||
@@ -1026,11 +1042,12 @@ App::put('/v1/functions/:functionId')
|
||||
|
||||
App::get('/v1/functions/:functionId/deployments/:deploymentId/download')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Download deployment')
|
||||
->desc('Get deployment download')
|
||||
->label('scope', 'functions.read')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'getDeploymentDownload',
|
||||
description: '/docs/references/functions/get-deployment-download.md',
|
||||
auth: [AuthType::KEY, AuthType::JWT],
|
||||
@@ -1127,6 +1144,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'updateDeployment',
|
||||
description: '/docs/references/functions/update-function-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1195,6 +1213,7 @@ App::delete('/v1/functions/:functionId')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'functions',
|
||||
name: 'delete',
|
||||
description: '/docs/references/functions/delete-function.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1250,6 +1269,7 @@ App::post('/v1/functions/:functionId/deployments')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'createDeployment',
|
||||
description: '/docs/references/functions/create-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1472,6 +1492,7 @@ App::get('/v1/functions/:functionId/deployments')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'listDeployments',
|
||||
description: '/docs/references/functions/list-deployments.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1535,9 +1556,12 @@ App::get('/v1/functions/:functionId/deployments')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
$results = $dbForProject->find('deployments', $queries);
|
||||
$total = $dbForProject->count('deployments', $filterQueries, APP_LIMIT_COUNT);
|
||||
try {
|
||||
$results = $dbForProject->find('deployments', $queries);
|
||||
$total = $dbForProject->count('deployments', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
foreach ($results as $result) {
|
||||
$build = $dbForProject->getDocument('builds', $result->getAttribute('buildId', ''));
|
||||
@@ -1561,6 +1585,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'getDeployment',
|
||||
description: '/docs/references/functions/get-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1613,6 +1638,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'deleteDeployment',
|
||||
description: '/docs/references/functions/delete-deployment.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1678,7 +1704,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
App::post('/v1/functions/:functionId/deployments/:deploymentId/build')
|
||||
->alias('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Rebuild deployment')
|
||||
->desc('Create deployment build')
|
||||
->label('scope', 'functions.write')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
||||
@@ -1686,6 +1712,7 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'createBuild',
|
||||
description: '/docs/references/functions/create-build.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1761,6 +1788,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'deployments',
|
||||
name: 'updateDeploymentBuild',
|
||||
description: '/docs/references/functions/update-deployment-build.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1777,7 +1805,8 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build')
|
||||
->inject('dbForProject')
|
||||
->inject('project')
|
||||
->inject('queueForEvents')
|
||||
->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Document $project, Event $queueForEvents) {
|
||||
->inject('executor')
|
||||
->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Executor $executor) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
@@ -1832,7 +1861,6 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build')
|
||||
$dbForProject->purgeCachedDocument('deployments', $deployment->getId());
|
||||
|
||||
try {
|
||||
$executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
|
||||
$executor->deleteRuntime($project->getId(), $deploymentId . "-build");
|
||||
} catch (\Throwable $th) {
|
||||
// Don't throw if the deployment doesn't exist
|
||||
@@ -1856,6 +1884,7 @@ App::post('/v1/functions/:functionId/executions')
|
||||
->label('event', 'functions.[functionId].executions.[executionId].create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'executions',
|
||||
name: 'createExecution',
|
||||
description: '/docs/references/functions/create-execution.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1884,8 +1913,9 @@ App::post('/v1/functions/:functionId/executions')
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForStatsUsage')
|
||||
->inject('queueForFunctions')
|
||||
->inject('executor')
|
||||
->inject('geodb')
|
||||
->action(function (string $functionId, string $body, mixed $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForPlatform, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb) {
|
||||
->action(function (string $functionId, string $body, mixed $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForPlatform, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb) {
|
||||
$async = \strval($async) === 'true' || \strval($async) === '1';
|
||||
|
||||
if (!$async && !is_null($scheduledAt)) {
|
||||
@@ -2077,7 +2107,7 @@ App::post('/v1/functions/:functionId/executions')
|
||||
];
|
||||
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => ScheduleExecutions::getSupportedResource(),
|
||||
'resourceId' => $execution->getId(),
|
||||
'resourceInternalId' => $execution->getInternalId(),
|
||||
@@ -2158,7 +2188,6 @@ App::post('/v1/functions/:functionId/executions')
|
||||
]);
|
||||
|
||||
/** Execute function */
|
||||
$executor = new Executor(System::getEnv('_APP_EXECUTOR_HOST'));
|
||||
try {
|
||||
$version = $function->getAttribute('version', 'v2');
|
||||
$command = $runtime['startCommand'];
|
||||
@@ -2224,15 +2253,6 @@ App::post('/v1/functions/:functionId/executions')
|
||||
$execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution));
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$execution->setAttribute('logs', '');
|
||||
$execution->setAttribute('errors', '');
|
||||
}
|
||||
|
||||
$headers = [];
|
||||
foreach (($executionResponse['headers'] ?? []) as $key => $value) {
|
||||
$headers[] = ['name' => $key, 'value' => $value];
|
||||
@@ -2264,6 +2284,7 @@ App::get('/v1/functions/:functionId/executions')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'executions',
|
||||
name: 'listExecutions',
|
||||
description: '/docs/references/functions/list-executions.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -2329,19 +2350,11 @@ App::get('/v1/functions/:functionId/executions')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
$results = $dbForProject->find('executions', $queries);
|
||||
$total = $dbForProject->count('executions', $filterQueries, APP_LIMIT_COUNT);
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$results = array_map(function ($execution) {
|
||||
$execution->setAttribute('logs', '');
|
||||
$execution->setAttribute('errors', '');
|
||||
return $execution;
|
||||
}, $results);
|
||||
try {
|
||||
$results = $dbForProject->find('executions', $queries);
|
||||
$total = $dbForProject->count('executions', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
@@ -2357,6 +2370,7 @@ App::get('/v1/functions/:functionId/executions/:executionId')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'executions',
|
||||
name: 'getExecution',
|
||||
description: '/docs/references/functions/get-execution.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -2392,14 +2406,6 @@ App::get('/v1/functions/:functionId/executions/:executionId')
|
||||
throw new Exception(Exception::EXECUTION_NOT_FOUND);
|
||||
}
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
$isAppUser = Auth::isAppUser($roles);
|
||||
if (!$isPrivilegedUser && !$isAppUser) {
|
||||
$execution->setAttribute('logs', '');
|
||||
$execution->setAttribute('errors', '');
|
||||
}
|
||||
|
||||
$response->dynamic($execution, Response::MODEL_EXECUTION);
|
||||
});
|
||||
|
||||
@@ -2413,6 +2419,7 @@ App::delete('/v1/functions/:functionId/executions/:executionId')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'executions',
|
||||
name: 'deleteExecution',
|
||||
description: '/docs/references/functions/delete-execution.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2490,6 +2497,7 @@ App::post('/v1/functions/:functionId/variables')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'variables',
|
||||
name: 'createVariable',
|
||||
description: '/docs/references/functions/create-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2560,6 +2568,7 @@ App::get('/v1/functions/:functionId/variables')
|
||||
'sdk',
|
||||
new Method(
|
||||
namespace: 'functions',
|
||||
group: 'variables',
|
||||
name: 'listVariables',
|
||||
description: '/docs/references/functions/list-variables.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2596,6 +2605,7 @@ App::get('/v1/functions/:functionId/variables/:variableId')
|
||||
'sdk',
|
||||
new Method(
|
||||
namespace: 'functions',
|
||||
group: 'variables',
|
||||
name: 'getVariable',
|
||||
description: '/docs/references/functions/get-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2644,6 +2654,7 @@ App::put('/v1/functions/:functionId/variables/:variableId')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'variables',
|
||||
name: 'updateVariable',
|
||||
description: '/docs/references/functions/update-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2711,6 +2722,7 @@ App::delete('/v1/functions/:functionId/variables/:variableId')
|
||||
->label('audits.resource', 'function/{request.functionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'variables',
|
||||
name: 'deleteVariable',
|
||||
description: '/docs/references/functions/delete-variable.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2765,6 +2777,7 @@ App::get('/v1/functions/templates')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'templates',
|
||||
name: 'listTemplates',
|
||||
description: '/docs/references/functions/list-templates.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2808,6 +2821,7 @@ App::get('/v1/functions/templates/:templateId')
|
||||
->label('resourceType', RESOURCE_TYPE_FUNCTIONS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'templates',
|
||||
name: 'getTemplate',
|
||||
description: '/docs/references/functions/get-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -44,6 +44,7 @@ App::get('/v1/graphql')
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'graphql',
|
||||
group: 'graphql',
|
||||
name: 'get',
|
||||
auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
hide: true,
|
||||
@@ -90,6 +91,7 @@ App::post('/v1/graphql/mutation')
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'graphql',
|
||||
group: 'graphql',
|
||||
name: 'mutation',
|
||||
auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
description: '/docs/references/graphql/post.md',
|
||||
@@ -140,6 +142,7 @@ App::post('/v1/graphql')
|
||||
->label('scope', 'graphql')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'graphql',
|
||||
group: 'graphql',
|
||||
name: 'query',
|
||||
auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
description: '/docs/references/graphql/post.md',
|
||||
|
||||
@@ -32,6 +32,7 @@ App::get('/v1/health')
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'get',
|
||||
auth: [AuthType::KEY],
|
||||
description: '/docs/references/health/get.md',
|
||||
@@ -71,6 +72,7 @@ App::get('/v1/health/db')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getDB',
|
||||
description: '/docs/references/health/get-db.md',
|
||||
responses: [
|
||||
@@ -131,6 +133,7 @@ App::get('/v1/health/cache')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getCache',
|
||||
description: '/docs/references/health/get-cache.md',
|
||||
responses: [
|
||||
@@ -195,6 +198,7 @@ App::get('/v1/health/pubsub')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getPubSub',
|
||||
description: '/docs/references/health/get-pubsub.md',
|
||||
responses: [
|
||||
@@ -259,6 +263,7 @@ App::get('/v1/health/time')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getTime',
|
||||
description: '/docs/references/health/get-time.md',
|
||||
responses: [
|
||||
@@ -322,6 +327,7 @@ App::get('/v1/health/queue/webhooks')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueWebhooks',
|
||||
description: '/docs/references/health/get-queue-webhooks.md',
|
||||
responses: [
|
||||
@@ -354,6 +360,7 @@ App::get('/v1/health/queue/logs')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueLogs',
|
||||
description: '/docs/references/health/get-queue-logs.md',
|
||||
responses: [
|
||||
@@ -386,6 +393,7 @@ App::get('/v1/health/certificate')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getCertificate',
|
||||
description: '/docs/references/health/get-certificate.md',
|
||||
responses: [
|
||||
@@ -442,6 +450,7 @@ App::get('/v1/health/queue/certificates')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueCertificates',
|
||||
description: '/docs/references/health/get-queue-certificates.md',
|
||||
responses: [
|
||||
@@ -474,6 +483,7 @@ App::get('/v1/health/queue/builds')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueBuilds',
|
||||
description: '/docs/references/health/get-queue-builds.md',
|
||||
responses: [
|
||||
@@ -506,6 +516,7 @@ App::get('/v1/health/queue/databases')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueDatabases',
|
||||
description: '/docs/references/health/get-queue-databases.md',
|
||||
responses: [
|
||||
@@ -539,6 +550,7 @@ App::get('/v1/health/queue/deletes')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueDeletes',
|
||||
description: '/docs/references/health/get-queue-deletes.md',
|
||||
responses: [
|
||||
@@ -571,6 +583,7 @@ App::get('/v1/health/queue/mails')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueMails',
|
||||
description: '/docs/references/health/get-queue-mails.md',
|
||||
responses: [
|
||||
@@ -603,6 +616,7 @@ App::get('/v1/health/queue/messaging')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueMessaging',
|
||||
description: '/docs/references/health/get-queue-messaging.md',
|
||||
responses: [
|
||||
@@ -635,6 +649,7 @@ App::get('/v1/health/queue/migrations')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueMigrations',
|
||||
description: '/docs/references/health/get-queue-migrations.md',
|
||||
responses: [
|
||||
@@ -667,6 +682,7 @@ App::get('/v1/health/queue/functions')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueFunctions',
|
||||
description: '/docs/references/health/get-queue-functions.md',
|
||||
responses: [
|
||||
@@ -699,6 +715,7 @@ App::get('/v1/health/queue/stats-resources')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueStatsResources',
|
||||
description: '/docs/references/health/get-queue-stats-resources.md',
|
||||
responses: [
|
||||
@@ -731,6 +748,7 @@ App::get('/v1/health/queue/stats-usage')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueUsage',
|
||||
description: '/docs/references/health/get-queue-stats-usage.md',
|
||||
responses: [
|
||||
@@ -756,38 +774,6 @@ App::get('/v1/health/queue/stats-usage')
|
||||
$response->dynamic(new Document([ 'size' => $size ]), Response::MODEL_HEALTH_QUEUE);
|
||||
});
|
||||
|
||||
App::get('/v1/health/queue/stats-usage-dump')
|
||||
->desc('Get usage dump queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
name: 'getQueueStatsUsageDump',
|
||||
description: '/docs/references/health/get-queue-stats-usage-dump.md',
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisher')
|
||||
->inject('response')
|
||||
->action(function (int|string $threshold, Publisher $publisher, Response $response) {
|
||||
$threshold = \intval($threshold);
|
||||
|
||||
$size = $publisher->getQueueSize(new Queue(Event::STATS_USAGE_DUMP_QUEUE_NAME));
|
||||
|
||||
if ($size >= $threshold) {
|
||||
throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([ 'size' => $size ]), Response::MODEL_HEALTH_QUEUE);
|
||||
});
|
||||
|
||||
App::get('/v1/health/storage/local')
|
||||
->desc('Get local storage')
|
||||
->groups(['api', 'health'])
|
||||
@@ -795,6 +781,7 @@ App::get('/v1/health/storage/local')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'storage',
|
||||
name: 'getStorageLocal',
|
||||
description: '/docs/references/health/get-storage-local.md',
|
||||
responses: [
|
||||
@@ -844,6 +831,7 @@ App::get('/v1/health/storage')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'storage',
|
||||
name: 'getStorage',
|
||||
description: '/docs/references/health/get-storage.md',
|
||||
responses: [
|
||||
@@ -891,6 +879,7 @@ App::get('/v1/health/anti-virus')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getAntivirus',
|
||||
description: '/docs/references/health/get-storage-anti-virus.md',
|
||||
responses: [
|
||||
@@ -936,6 +925,7 @@ App::get('/v1/health/queue/failed/:name')
|
||||
->label('sdk', new Method(
|
||||
auth: [AuthType::KEY],
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getFailedJobs',
|
||||
description: '/docs/references/health/get-failed-queue-jobs.md',
|
||||
responses: [
|
||||
@@ -954,7 +944,6 @@ App::get('/v1/health/queue/failed/:name')
|
||||
Event::FUNCTIONS_QUEUE_NAME,
|
||||
Event::STATS_RESOURCES_QUEUE_NAME,
|
||||
Event::STATS_USAGE_QUEUE_NAME,
|
||||
Event::STATS_USAGE_DUMP_QUEUE_NAME,
|
||||
Event::WEBHOOK_QUEUE_NAME,
|
||||
Event::CERTIFICATES_QUEUE_NAME,
|
||||
Event::BUILDS_QUEUE_NAME,
|
||||
@@ -980,9 +969,6 @@ App::get('/v1/health/stats') // Currently only used internally
|
||||
->desc('Get system stats')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'root')
|
||||
// ->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
// ->label('sdk.namespace', 'health')
|
||||
// ->label('sdk.method', 'getStats')
|
||||
->label('docs', false)
|
||||
->inject('response')
|
||||
->inject('register')
|
||||
|
||||
@@ -17,6 +17,7 @@ App::get('/v1/locale')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'get',
|
||||
description: '/docs/references/locale/get-locale.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -80,6 +81,7 @@ App::get('/v1/locale/codes')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listCodes',
|
||||
description: '/docs/references/locale/list-locale-codes.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -105,6 +107,7 @@ App::get('/v1/locale/countries')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listCountries',
|
||||
description: '/docs/references/locale/list-countries.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -118,7 +121,7 @@ App::get('/v1/locale/countries')
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
->action(function (Response $response, Locale $locale) {
|
||||
$list = Config::getParam('locale-countries'); /* @var $list array */
|
||||
$list = array_keys(Config::getParam('locale-countries')); /* @var $list array */
|
||||
$output = [];
|
||||
|
||||
foreach ($list as $value) {
|
||||
@@ -141,6 +144,7 @@ App::get('/v1/locale/countries/eu')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listCountriesEU',
|
||||
description: '/docs/references/locale/list-countries-eu.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -179,6 +183,7 @@ App::get('/v1/locale/countries/phones')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listCountriesPhones',
|
||||
description: '/docs/references/locale/list-countries-phones.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -216,6 +221,7 @@ App::get('/v1/locale/continents')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listContinents',
|
||||
description: '/docs/references/locale/list-continents.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -229,7 +235,7 @@ App::get('/v1/locale/continents')
|
||||
->inject('response')
|
||||
->inject('locale')
|
||||
->action(function (Response $response, Locale $locale) {
|
||||
$list = Config::getParam('locale-continents');
|
||||
$list = array_keys(Config::getParam('locale-continents'));
|
||||
|
||||
foreach ($list as $value) {
|
||||
$output[] = new Document([
|
||||
@@ -251,6 +257,7 @@ App::get('/v1/locale/currencies')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listCurrencies',
|
||||
description: '/docs/references/locale/list-currencies.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -277,6 +284,7 @@ App::get('/v1/locale/languages')
|
||||
->label('scope', 'locale.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'locale',
|
||||
group: null,
|
||||
name: 'listLanguages',
|
||||
description: '/docs/references/locale/list-languages.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
|
||||
@@ -30,6 +30,7 @@ use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate as DuplicateException;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
@@ -63,6 +64,7 @@ App::post('/v1/messaging/providers/mailgun')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createMailgunProvider',
|
||||
description: '/docs/references/messaging/create-mailgun-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -156,6 +158,7 @@ App::post('/v1/messaging/providers/sendgrid')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createSendgridProvider',
|
||||
description: '/docs/references/messaging/create-sendgrid-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -237,6 +240,7 @@ App::post('/v1/messaging/providers/smtp')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createSmtpProvider',
|
||||
description: '/docs/references/messaging/create-smtp-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -331,6 +335,7 @@ App::post('/v1/messaging/providers/msg91')
|
||||
->label('event', 'providers.[providerId].create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createMsg91Provider',
|
||||
description: '/docs/references/messaging/create-msg91-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -413,6 +418,7 @@ App::post('/v1/messaging/providers/telesign')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createTelesignProvider',
|
||||
description: '/docs/references/messaging/create-telesign-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -496,6 +502,7 @@ App::post('/v1/messaging/providers/textmagic')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createTextmagicProvider',
|
||||
description: '/docs/references/messaging/create-textmagic-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -579,6 +586,7 @@ App::post('/v1/messaging/providers/twilio')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createTwilioProvider',
|
||||
description: '/docs/references/messaging/create-twilio-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -662,6 +670,7 @@ App::post('/v1/messaging/providers/vonage')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createVonageProvider',
|
||||
description: '/docs/references/messaging/create-vonage-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -745,6 +754,7 @@ App::post('/v1/messaging/providers/fcm')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createFcmProvider',
|
||||
description: '/docs/references/messaging/create-fcm-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -814,6 +824,7 @@ App::post('/v1/messaging/providers/apns')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'createApnsProvider',
|
||||
description: '/docs/references/messaging/create-apns-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -903,6 +914,7 @@ App::get('/v1/messaging/providers')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'listProviders',
|
||||
description: '/docs/references/messaging/list-providers.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -951,10 +963,15 @@ App::get('/v1/messaging/providers')
|
||||
|
||||
$cursor->setValue($cursorDocument);
|
||||
}
|
||||
|
||||
try {
|
||||
$providers = $dbForProject->find('providers', $queries);
|
||||
$total = $dbForProject->count('providers', $queries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'providers' => $dbForProject->find('providers', $queries),
|
||||
'total' => $dbForProject->count('providers', $queries, APP_LIMIT_COUNT),
|
||||
'providers' => $providers,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_PROVIDER_LIST);
|
||||
});
|
||||
|
||||
@@ -965,6 +982,7 @@ App::get('/v1/messaging/providers/:providerId/logs')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'listProviderLogs',
|
||||
description: '/docs/references/messaging/list-provider-logs.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1061,6 +1079,7 @@ App::get('/v1/messaging/providers/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'getProvider',
|
||||
description: '/docs/references/messaging/get-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1094,6 +1113,7 @@ App::patch('/v1/messaging/providers/mailgun/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateMailgunProvider',
|
||||
description: '/docs/references/messaging/update-mailgun-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1206,6 +1226,7 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateSendgridProvider',
|
||||
description: '/docs/references/messaging/update-sendgrid-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1303,6 +1324,7 @@ App::patch('/v1/messaging/providers/smtp/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateSmtpProvider',
|
||||
description: '/docs/references/messaging/update-smtp-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1431,6 +1453,7 @@ App::patch('/v1/messaging/providers/msg91/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateMsg91Provider',
|
||||
description: '/docs/references/messaging/update-msg91-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1517,6 +1540,7 @@ App::patch('/v1/messaging/providers/telesign/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateTelesignProvider',
|
||||
description: '/docs/references/messaging/update-telesign-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1605,6 +1629,7 @@ App::patch('/v1/messaging/providers/textmagic/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateTextmagicProvider',
|
||||
description: '/docs/references/messaging/update-textmagic-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1693,6 +1718,7 @@ App::patch('/v1/messaging/providers/twilio/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateTwilioProvider',
|
||||
description: '/docs/references/messaging/update-twilio-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1781,6 +1807,7 @@ App::patch('/v1/messaging/providers/vonage/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateVonageProvider',
|
||||
description: '/docs/references/messaging/update-vonage-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1869,6 +1896,7 @@ App::patch('/v1/messaging/providers/fcm/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateFcmProvider',
|
||||
description: '/docs/references/messaging/update-fcm-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -1944,6 +1972,7 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'updateApnsProvider',
|
||||
description: '/docs/references/messaging/update-apns-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2045,6 +2074,7 @@ App::delete('/v1/messaging/providers/:providerId')
|
||||
->label('resourceType', RESOURCE_TYPE_PROVIDERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'providers',
|
||||
name: 'deleteProvider',
|
||||
description: '/docs/references/messaging/delete-provider.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2087,6 +2117,7 @@ App::post('/v1/messaging/topics')
|
||||
->label('resourceType', RESOURCE_TYPE_TOPICS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'topics',
|
||||
name: 'createTopic',
|
||||
description: '/docs/references/messaging/create-topic.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2133,6 +2164,7 @@ App::get('/v1/messaging/topics')
|
||||
->label('resourceType', RESOURCE_TYPE_TOPICS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'topics',
|
||||
name: 'listTopics',
|
||||
description: '/docs/references/messaging/list-topics.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2181,10 +2213,15 @@ App::get('/v1/messaging/topics')
|
||||
|
||||
$cursor->setValue($cursorDocument[0]);
|
||||
}
|
||||
|
||||
try {
|
||||
$topics = $dbForProject->find('topics', $queries);
|
||||
$total = $dbForProject->count('topics', $queries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'topics' => $dbForProject->find('topics', $queries),
|
||||
'total' => $dbForProject->count('topics', $queries, APP_LIMIT_COUNT),
|
||||
'topics' => $topics,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_TOPIC_LIST);
|
||||
});
|
||||
|
||||
@@ -2195,6 +2232,7 @@ App::get('/v1/messaging/topics/:topicId/logs')
|
||||
->label('resourceType', RESOURCE_TYPE_TOPICS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'topics',
|
||||
name: 'listTopicLogs',
|
||||
description: '/docs/references/messaging/list-topic-logs.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2292,6 +2330,7 @@ App::get('/v1/messaging/topics/:topicId')
|
||||
->label('resourceType', RESOURCE_TYPE_TOPICS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'topics',
|
||||
name: 'getTopic',
|
||||
description: '/docs/references/messaging/get-topic.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2326,6 +2365,7 @@ App::patch('/v1/messaging/topics/:topicId')
|
||||
->label('resourceType', RESOURCE_TYPE_TOPICS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'topics',
|
||||
name: 'updateTopic',
|
||||
description: '/docs/references/messaging/update-topic.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2376,6 +2416,7 @@ App::delete('/v1/messaging/topics/:topicId')
|
||||
->label('resourceType', RESOURCE_TYPE_TOPICS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'topics',
|
||||
name: 'deleteTopic',
|
||||
description: '/docs/references/messaging/delete-topic.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2423,6 +2464,7 @@ App::post('/v1/messaging/topics/:topicId/subscribers')
|
||||
->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'subscribers',
|
||||
name: 'createSubscriber',
|
||||
description: '/docs/references/messaging/create-subscriber.md',
|
||||
auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2522,6 +2564,7 @@ App::get('/v1/messaging/topics/:topicId/subscribers')
|
||||
->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'subscribers',
|
||||
name: 'listSubscribers',
|
||||
description: '/docs/references/messaging/list-subscribers.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2579,8 +2622,11 @@ App::get('/v1/messaging/topics/:topicId/subscribers')
|
||||
|
||||
$cursor->setValue($cursorDocument);
|
||||
}
|
||||
|
||||
$subscribers = $dbForProject->find('subscribers', $queries);
|
||||
try {
|
||||
$subscribers = $dbForProject->find('subscribers', $queries);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$subscribers = batch(\array_map(function (Document $subscriber) use ($dbForProject) {
|
||||
return function () use ($subscriber, $dbForProject) {
|
||||
@@ -2607,6 +2653,7 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs')
|
||||
->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'subscribers',
|
||||
name: 'listSubscriberLogs',
|
||||
description: '/docs/references/messaging/list-subscriber-logs.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2704,6 +2751,7 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId')
|
||||
->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'subscribers',
|
||||
name: 'getSubscriber',
|
||||
description: '/docs/references/messaging/get-subscriber.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2752,6 +2800,7 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId')
|
||||
->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'subscribers',
|
||||
name: 'deleteSubscriber',
|
||||
description: '/docs/references/messaging/delete-subscriber.md',
|
||||
auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2818,6 +2867,7 @@ App::post('/v1/messaging/messages/email')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'createEmail',
|
||||
description: '/docs/references/messaging/create-email.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -2936,7 +2986,7 @@ App::post('/v1/messaging/messages/email')
|
||||
break;
|
||||
case MessageStatus::SCHEDULED:
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'message',
|
||||
'resourceId' => $message->getId(),
|
||||
'resourceInternalId' => $message->getInternalId(),
|
||||
@@ -2976,6 +3026,7 @@ App::post('/v1/messaging/messages/sms')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'createSms',
|
||||
description: '/docs/references/messaging/create-sms.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3058,7 +3109,7 @@ App::post('/v1/messaging/messages/sms')
|
||||
break;
|
||||
case MessageStatus::SCHEDULED:
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'message',
|
||||
'resourceId' => $message->getId(),
|
||||
'resourceInternalId' => $message->getInternalId(),
|
||||
@@ -3098,6 +3149,7 @@ App::post('/v1/messaging/messages/push')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'createPush',
|
||||
description: '/docs/references/messaging/create-push.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3275,7 +3327,7 @@ App::post('/v1/messaging/messages/push')
|
||||
break;
|
||||
case MessageStatus::SCHEDULED:
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'message',
|
||||
'resourceId' => $message->getId(),
|
||||
'resourceInternalId' => $message->getInternalId(),
|
||||
@@ -3312,6 +3364,7 @@ App::get('/v1/messaging/messages')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'listMessages',
|
||||
description: '/docs/references/messaging/list-messages.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3360,10 +3413,15 @@ App::get('/v1/messaging/messages')
|
||||
|
||||
$cursor->setValue($cursorDocument);
|
||||
}
|
||||
|
||||
try {
|
||||
$messages = $dbForProject->find('messages', $queries);
|
||||
$total = $dbForProject->count('messages', $queries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'messages' => $dbForProject->find('messages', $queries),
|
||||
'total' => $dbForProject->count('messages', $queries, APP_LIMIT_COUNT),
|
||||
'messages' => $messages,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_MESSAGE_LIST);
|
||||
});
|
||||
|
||||
@@ -3374,6 +3432,7 @@ App::get('/v1/messaging/messages/:messageId/logs')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'logs',
|
||||
name: 'listMessageLogs',
|
||||
description: '/docs/references/messaging/list-message-logs.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3471,6 +3530,7 @@ App::get('/v1/messaging/messages/:messageId/targets')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'listTargets',
|
||||
description: '/docs/references/messaging/list-message-targets.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3533,10 +3593,15 @@ App::get('/v1/messaging/messages/:messageId/targets')
|
||||
|
||||
$cursor->setValue($cursorDocument);
|
||||
}
|
||||
|
||||
try {
|
||||
$targets = $dbForProject->find('targets', $queries);
|
||||
$total = $dbForProject->count('targets', $queries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'targets' => $dbForProject->find('targets', $queries),
|
||||
'total' => $dbForProject->count('targets', $queries, APP_LIMIT_COUNT),
|
||||
'targets' => $targets,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_TARGET_LIST);
|
||||
});
|
||||
|
||||
@@ -3547,6 +3612,7 @@ App::get('/v1/messaging/messages/:messageId')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'getMessage',
|
||||
description: '/docs/references/messaging/get-message.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3580,6 +3646,7 @@ App::patch('/v1/messaging/messages/email/:messageId')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'updateEmail',
|
||||
description: '/docs/references/messaging/update-email.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3661,7 +3728,7 @@ App::patch('/v1/messaging/messages/email/:messageId')
|
||||
|
||||
if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) {
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'message',
|
||||
'resourceId' => $message->getId(),
|
||||
'resourceInternalId' => $message->getInternalId(),
|
||||
@@ -3786,6 +3853,7 @@ App::patch('/v1/messaging/messages/sms/:messageId')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'updateSms',
|
||||
description: '/docs/references/messaging/update-sms.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -3862,7 +3930,7 @@ App::patch('/v1/messaging/messages/sms/:messageId')
|
||||
|
||||
if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) {
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'message',
|
||||
'resourceId' => $message->getId(),
|
||||
'resourceInternalId' => $message->getInternalId(),
|
||||
@@ -3947,6 +4015,7 @@ App::patch('/v1/messaging/messages/push/:messageId')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'updatePush',
|
||||
description: '/docs/references/messaging/update-push.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
@@ -4035,7 +4104,7 @@ App::patch('/v1/messaging/messages/push/:messageId')
|
||||
|
||||
if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) {
|
||||
$schedule = $dbForPlatform->createDocument('schedules', new Document([
|
||||
'region' => System::getEnv('_APP_REGION', 'default'),
|
||||
'region' => $project->getAttribute('region'),
|
||||
'resourceType' => 'message',
|
||||
'resourceId' => $message->getId(),
|
||||
'resourceInternalId' => $message->getInternalId(),
|
||||
@@ -4206,6 +4275,7 @@ App::delete('/v1/messaging/messages/:messageId')
|
||||
->label('resourceType', RESOURCE_TYPE_MESSAGES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'messaging',
|
||||
group: 'messages',
|
||||
name: 'delete',
|
||||
description: '/docs/references/messaging/delete-message.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
|
||||
@@ -12,6 +12,7 @@ use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
@@ -31,12 +32,13 @@ include_once __DIR__ . '/../shared/api.php';
|
||||
|
||||
App::post('/v1/migrations/appwrite')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Migrate Appwrite data')
|
||||
->desc('Create Appwrite migration')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'createAppwriteMigration',
|
||||
description: '/docs/references/migrations/migration-appwrite.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -92,12 +94,13 @@ App::post('/v1/migrations/appwrite')
|
||||
|
||||
App::post('/v1/migrations/firebase')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Migrate Firebase data')
|
||||
->desc('Create Firebase migration')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'createFirebaseMigration',
|
||||
description: '/docs/references/migrations/migration-firebase.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -158,12 +161,13 @@ App::post('/v1/migrations/firebase')
|
||||
|
||||
App::post('/v1/migrations/supabase')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Migrate Supabase data')
|
||||
->desc('Create Supabase migration')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'createSupabaseMigration',
|
||||
description: '/docs/references/migrations/migration-supabase.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -224,12 +228,13 @@ App::post('/v1/migrations/supabase')
|
||||
|
||||
App::post('/v1/migrations/nhost')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Migrate NHost data')
|
||||
->desc('Create NHost migration')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].create')
|
||||
->label('audits.event', 'migration.create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'createNHostMigration',
|
||||
description: '/docs/references/migrations/migration-nhost.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -296,6 +301,7 @@ App::get('/v1/migrations')
|
||||
->label('scope', 'migrations.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'list',
|
||||
description: '/docs/references/migrations/list-migrations.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -347,10 +353,15 @@ App::get('/v1/migrations')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$migrations = $dbForProject->find('migrations', $queries);
|
||||
$total = $dbForProject->count('migrations', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'migrations' => $dbForProject->find('migrations', $queries),
|
||||
'total' => $dbForProject->count('migrations', $filterQueries, APP_LIMIT_COUNT),
|
||||
'migrations' => $migrations,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_MIGRATION_LIST);
|
||||
});
|
||||
|
||||
@@ -360,6 +371,7 @@ App::get('/v1/migrations/:migrationId')
|
||||
->label('scope', 'migrations.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'get',
|
||||
description: '/docs/references/migrations/get-migration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -385,10 +397,11 @@ App::get('/v1/migrations/:migrationId')
|
||||
|
||||
App::get('/v1/migrations/appwrite/report')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Appwrite data')
|
||||
->desc('Get Appwrite migration report')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'getAppwriteReport',
|
||||
description: '/docs/references/migrations/migration-appwrite-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -408,6 +421,7 @@ App::get('/v1/migrations/appwrite/report')
|
||||
->inject('project')
|
||||
->inject('user')
|
||||
->action(function (array $resources, string $endpoint, string $projectID, string $key, Response $response) {
|
||||
|
||||
$appwrite = new Appwrite($projectID, $endpoint, $key);
|
||||
|
||||
try {
|
||||
@@ -432,10 +446,11 @@ App::get('/v1/migrations/appwrite/report')
|
||||
|
||||
App::get('/v1/migrations/firebase/report')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Firebase data')
|
||||
->desc('Get Firebase migration report')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'getFirebaseReport',
|
||||
description: '/docs/references/migrations/migration-firebase-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -484,10 +499,11 @@ App::get('/v1/migrations/firebase/report')
|
||||
|
||||
App::get('/v1/migrations/supabase/report')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on Supabase Data')
|
||||
->desc('Get Supabase migration report')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'getSupabaseReport',
|
||||
description: '/docs/references/migrations/migration-supabase-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -532,10 +548,11 @@ App::get('/v1/migrations/supabase/report')
|
||||
|
||||
App::get('/v1/migrations/nhost/report')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Generate a report on NHost Data')
|
||||
->desc('Get NHost migration report')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'getNHostReport',
|
||||
description: '/docs/references/migrations/migration-nhost-report.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -580,13 +597,14 @@ App::get('/v1/migrations/nhost/report')
|
||||
|
||||
App::patch('/v1/migrations/:migrationId')
|
||||
->groups(['api', 'migrations'])
|
||||
->desc('Retry migration')
|
||||
->desc('Update retry migration')
|
||||
->label('scope', 'migrations.write')
|
||||
->label('event', 'migrations.[migrationId].retry')
|
||||
->label('audits.event', 'migration.retry')
|
||||
->label('audits.resource', 'migrations/{request.migrationId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'retry',
|
||||
description: '/docs/references/migrations/retry-migration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -637,6 +655,7 @@ App::delete('/v1/migrations/:migrationId')
|
||||
->label('audits.resource', 'migrations/{request.migrationId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'migrations',
|
||||
group: null,
|
||||
name: 'delete',
|
||||
description: '/docs/references/migrations/delete-migration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -26,6 +26,7 @@ App::get('/v1/project/usage')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
group: null,
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/project/get-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -387,6 +388,7 @@ App::post('/v1/project/variables')
|
||||
->label('audits.event', 'variable.create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
group: null,
|
||||
name: 'createVariable',
|
||||
description: '/docs/references/project/create-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -446,6 +448,7 @@ App::get('/v1/project/variables')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
group: null,
|
||||
name: 'listVariables',
|
||||
description: '/docs/references/project/list-variables.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -476,6 +479,7 @@ App::get('/v1/project/variables/:variableId')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
group: null,
|
||||
name: 'getVariable',
|
||||
description: '/docs/references/project/get-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -505,6 +509,7 @@ App::put('/v1/project/variables/:variableId')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
group: null,
|
||||
name: 'updateVariable',
|
||||
description: '/docs/references/project/update-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -556,6 +561,7 @@ App::delete('/v1/project/variables/:variableId')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'project',
|
||||
group: null,
|
||||
name: 'deleteVariable',
|
||||
description: '/docs/references/project/delete-variable.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -28,6 +28,7 @@ use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -68,6 +69,7 @@ App::post('/v1/projects')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'create',
|
||||
description: '/docs/references/projects/create.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -138,6 +140,14 @@ App::post('/v1/projects')
|
||||
|
||||
$databases = Config::getParam('pools-database', []);
|
||||
|
||||
if ($region !== 'default') {
|
||||
$databaseKeys = System::getEnv('_APP_DATABASE_KEYS', '');
|
||||
$keys = explode(',', $databaseKeys);
|
||||
$databases = array_filter($keys, function ($value) use ($region) {
|
||||
return str_contains($value, $region);
|
||||
});
|
||||
}
|
||||
|
||||
$databaseOverride = System::getEnv('_APP_DATABASE_OVERRIDE');
|
||||
$index = \array_search($databaseOverride, $databases);
|
||||
if ($index !== false) {
|
||||
@@ -205,17 +215,17 @@ App::post('/v1/projects')
|
||||
$dsn = new DSN('mysql://' . $dsn);
|
||||
}
|
||||
|
||||
$adapter = $pools->get($dsn->getHost())->pop()->getResource();
|
||||
$dbForProject = new Database($adapter, $cache);
|
||||
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
|
||||
$sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', ''));
|
||||
|
||||
$projectTables = !\in_array($dsn->getHost(), $sharedTables);
|
||||
$sharedTablesV1 = \in_array($dsn->getHost(), $sharedTablesV1);
|
||||
$sharedTablesV2 = !$projectTables && !$sharedTablesV1;
|
||||
$sharedTables = $sharedTablesV1 || $sharedTablesV2;
|
||||
|
||||
if (!$sharedTablesV2) {
|
||||
$adapter = $pools->get($dsn->getHost())->pop()->getResource();
|
||||
$dbForProject = new Database($adapter, $cache);
|
||||
|
||||
if ($sharedTables) {
|
||||
$dbForProject
|
||||
->setSharedTables(true)
|
||||
@@ -297,6 +307,7 @@ App::get('/v1/projects')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'list',
|
||||
description: '/docs/references/projects/list.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -349,10 +360,15 @@ App::get('/v1/projects')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$projects = $dbForPlatform->find('projects', $queries);
|
||||
$total = $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'projects' => $dbForPlatform->find('projects', $queries),
|
||||
'total' => $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT),
|
||||
'projects' => $projects,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_PROJECT_LIST);
|
||||
});
|
||||
|
||||
@@ -362,6 +378,7 @@ App::get('/v1/projects/:projectId')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'get',
|
||||
description: '/docs/references/projects/get.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -394,6 +411,7 @@ App::patch('/v1/projects/:projectId')
|
||||
->label('audits.resource', 'project/{request.projectId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'update',
|
||||
description: '/docs/references/projects/update.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -447,6 +465,7 @@ App::patch('/v1/projects/:projectId/team')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'updateTeam',
|
||||
description: '/docs/references/projects/update-team.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -521,6 +540,7 @@ App::patch('/v1/projects/:projectId/service')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'updateServiceStatus',
|
||||
description: '/docs/references/projects/update-service-status.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -558,6 +578,7 @@ App::patch('/v1/projects/:projectId/service/all')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'updateServiceStatusAll',
|
||||
description: '/docs/references/projects/update-service-status-all.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -598,6 +619,7 @@ App::patch('/v1/projects/:projectId/api')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'updateApiStatus',
|
||||
description: '/docs/references/projects/update-api-status.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -635,6 +657,7 @@ App::patch('/v1/projects/:projectId/api/all')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'updateApiStatusAll',
|
||||
description: '/docs/references/projects/update-api-status-all.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -675,6 +698,7 @@ App::patch('/v1/projects/:projectId/oauth2')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateOAuth2',
|
||||
description: '/docs/references/projects/update-oauth2.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -725,6 +749,7 @@ App::patch('/v1/projects/:projectId/auth/session-alerts')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateSessionAlerts',
|
||||
description: '/docs/references/projects/update-session-alerts.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -762,6 +787,7 @@ App::patch('/v1/projects/:projectId/auth/memberships-privacy')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateMembershipsPrivacy',
|
||||
description: '/docs/references/projects/update-memberships-privacy.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -803,6 +829,7 @@ App::patch('/v1/projects/:projectId/auth/limit')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateAuthLimit',
|
||||
description: '/docs/references/projects/update-auth-limit.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -840,6 +867,7 @@ App::patch('/v1/projects/:projectId/auth/duration')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateAuthDuration',
|
||||
description: '/docs/references/projects/update-auth-duration.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -877,6 +905,7 @@ App::patch('/v1/projects/:projectId/auth/:method')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateAuthStatus',
|
||||
description: '/docs/references/projects/update-auth-status.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -917,6 +946,7 @@ App::patch('/v1/projects/:projectId/auth/password-history')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateAuthPasswordHistory',
|
||||
description: '/docs/references/projects/update-auth-password-history.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -954,6 +984,7 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateAuthPasswordDictionary',
|
||||
description: '/docs/references/projects/update-auth-password-dictionary.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -986,11 +1017,12 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary')
|
||||
});
|
||||
|
||||
App::patch('/v1/projects/:projectId/auth/personal-data')
|
||||
->desc('Enable or disable checking user passwords for similarity with their personal data.')
|
||||
->desc('Update personal data check')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updatePersonalDataCheck',
|
||||
description: '/docs/references/projects/update-personal-data-check.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1028,6 +1060,7 @@ App::patch('/v1/projects/:projectId/auth/max-sessions')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateAuthSessionsLimit',
|
||||
description: '/docs/references/projects/update-auth-sessions-limit.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1065,6 +1098,7 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'updateMockNumbers',
|
||||
description: '/docs/references/projects/update-mock-numbers.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1112,6 +1146,7 @@ App::delete('/v1/projects/:projectId')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'projects',
|
||||
name: 'delete',
|
||||
description: '/docs/references/projects/delete.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1155,6 +1190,7 @@ App::post('/v1/projects/:projectId/webhooks')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'webhooks',
|
||||
name: 'createWebhook',
|
||||
description: '/docs/references/projects/create-webhook.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1219,6 +1255,7 @@ App::get('/v1/projects/:projectId/webhooks')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'webhooks',
|
||||
name: 'listWebhooks',
|
||||
description: '/docs/references/projects/list-webhooks.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1257,6 +1294,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
|
||||
->label('scope', 'projects.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'webhooks',
|
||||
name: 'getWebhook',
|
||||
description: '/docs/references/projects/get-webhook.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1297,6 +1335,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'webhooks',
|
||||
name: 'updateWebhook',
|
||||
description: '/docs/references/projects/update-webhook.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1362,6 +1401,7 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'webhooks',
|
||||
name: 'updateWebhookSignature',
|
||||
description: '/docs/references/projects/update-webhook-signature.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1407,6 +1447,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'webhooks',
|
||||
name: 'deleteWebhook',
|
||||
description: '/docs/references/projects/delete-webhook.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1454,6 +1495,7 @@ App::post('/v1/projects/:projectId/keys')
|
||||
->label('scope', 'keys.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'keys',
|
||||
name: 'createKey',
|
||||
description: '/docs/references/projects/create-key.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1510,6 +1552,7 @@ App::get('/v1/projects/:projectId/keys')
|
||||
->label('scope', 'keys.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'keys',
|
||||
name: 'listKeys',
|
||||
description: '/docs/references/projects/list-keys.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1548,6 +1591,7 @@ App::get('/v1/projects/:projectId/keys/:keyId')
|
||||
->label('scope', 'keys.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'keys',
|
||||
name: 'getKey',
|
||||
description: '/docs/references/projects/get-key.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1588,6 +1632,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
|
||||
->label('scope', 'keys.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'keys',
|
||||
name: 'updateKey',
|
||||
description: '/docs/references/projects/update-key.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1640,6 +1685,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
|
||||
->label('scope', 'keys.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'keys',
|
||||
name: 'deleteKey',
|
||||
description: '/docs/references/projects/delete-key.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1687,6 +1733,7 @@ App::post('/v1/projects/:projectId/jwts')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'auth',
|
||||
name: 'createJWT',
|
||||
description: '/docs/references/projects/create-jwt.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1730,6 +1777,7 @@ App::post('/v1/projects/:projectId/platforms')
|
||||
->label('scope', 'platforms.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'platforms',
|
||||
name: 'createPlatform',
|
||||
description: '/docs/references/projects/create-platform.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1786,6 +1834,7 @@ App::get('/v1/projects/:projectId/platforms')
|
||||
->label('scope', 'platforms.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'platforms',
|
||||
name: 'listPlatforms',
|
||||
description: '/docs/references/projects/list-platforms.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1824,6 +1873,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId')
|
||||
->label('scope', 'platforms.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'platforms',
|
||||
name: 'getPlatform',
|
||||
description: '/docs/references/projects/get-platform.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1864,6 +1914,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
|
||||
->label('scope', 'platforms.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'platforms',
|
||||
name: 'updatePlatform',
|
||||
description: '/docs/references/projects/update-platform.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1919,6 +1970,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
|
||||
->label('scope', 'platforms.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'platforms',
|
||||
name: 'deletePlatform',
|
||||
description: '/docs/references/projects/delete-platform.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1966,6 +2018,7 @@ App::patch('/v1/projects/:projectId/smtp')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'updateSmtp',
|
||||
description: '/docs/references/projects/update-smtp.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2062,6 +2115,7 @@ App::post('/v1/projects/:projectId/smtp/tests')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'createSmtpTest',
|
||||
description: '/docs/references/projects/create-smtp-test.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2128,6 +2182,7 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'getSmsTemplate',
|
||||
description: '/docs/references/projects/get-sms-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2175,6 +2230,7 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'getEmailTemplate',
|
||||
description: '/docs/references/projects/get-email-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2233,6 +2289,7 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'updateSmsTemplate',
|
||||
description: '/docs/references/projects/update-sms-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2279,6 +2336,7 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'updateEmailTemplate',
|
||||
description: '/docs/references/projects/update-email-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2335,6 +2393,7 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale')
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'deleteSmsTemplate',
|
||||
description: '/docs/references/projects/delete-sms-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -2380,11 +2439,12 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale')
|
||||
});
|
||||
|
||||
App::delete('/v1/projects/:projectId/templates/email/:type/:locale')
|
||||
->desc('Reset custom email template')
|
||||
->desc('Delete custom email template')
|
||||
->groups(['api', 'projects'])
|
||||
->label('scope', 'projects.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'projects',
|
||||
group: 'templates',
|
||||
name: 'deleteEmailTemplate',
|
||||
description: '/docs/references/projects/delete-email-template.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -35,6 +35,7 @@ App::post('/v1/proxy/rules')
|
||||
->label('audits.resource', 'rule/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
group: null,
|
||||
name: 'createRule',
|
||||
description: '/docs/references/proxy/create-rule.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -55,14 +56,25 @@ App::post('/v1/proxy/rules')
|
||||
->inject('dbForPlatform')
|
||||
->inject('dbForProject')
|
||||
->action(function (string $domain, string $resourceType, string $resourceId, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) {
|
||||
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
if ($domain === $mainDomain) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your main domain to specific resource. Please use subdomain or a different domain.');
|
||||
}
|
||||
|
||||
$functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', '');
|
||||
if ($functionsDomain != '' && str_ends_with($domain, $functionsDomain)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your functions domain or it\'s subdomain to specific resource. Please use different domain.');
|
||||
$functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS');
|
||||
$denyListDomains = System::getEnv('_APP_CUSTOM_DOMAIN_DENY_LIST');
|
||||
|
||||
if (!empty($denyListDomains)) {
|
||||
$functionsDomain .= ',' . $denyListDomains;
|
||||
}
|
||||
|
||||
$deniedDomains = array_map('trim', explode(',', $functionsDomain));
|
||||
|
||||
foreach ($deniedDomains as $deniedDomain) {
|
||||
if (str_ends_with($domain, $deniedDomain)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your functions domain or its subdomain to a specific resource. Please use a different domain.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($domain === 'localhost' || $domain === APP_HOSTNAME_INTERNAL) {
|
||||
@@ -130,6 +142,8 @@ App::post('/v1/proxy/rules')
|
||||
'resourceId' => $resourceId,
|
||||
'resourceInternalId' => $resourceInternalId,
|
||||
'certificateId' => '',
|
||||
'owner' => '',
|
||||
'region' => $project->getAttribute('region')
|
||||
]);
|
||||
|
||||
$status = 'created';
|
||||
@@ -171,6 +185,7 @@ App::get('/v1/proxy/rules')
|
||||
->label('scope', 'rules.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
group: null,
|
||||
name: 'listRules',
|
||||
description: '/docs/references/proxy/list-rules.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -245,6 +260,7 @@ App::get('/v1/proxy/rules/:ruleId')
|
||||
->label('scope', 'rules.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
group: null,
|
||||
name: 'getRule',
|
||||
description: '/docs/references/proxy/get-rule.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -282,6 +298,7 @@ App::delete('/v1/proxy/rules/:ruleId')
|
||||
->label('audits.resource', 'rule/{request.ruleId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
group: null,
|
||||
name: 'deleteRule',
|
||||
description: '/docs/references/proxy/delete-rule.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -326,6 +343,7 @@ App::patch('/v1/proxy/rules/:ruleId/verification')
|
||||
->label('audits.resource', 'rule/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
group: null,
|
||||
name: 'updateRuleVerification',
|
||||
description: '/docs/references/proxy/update-rule-verification.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -24,6 +24,7 @@ use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate as DuplicateException;
|
||||
use Utopia\Database\Exception\NotFound as NotFoundException;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -62,6 +63,7 @@ App::post('/v1/storage/buckets')
|
||||
->label('audits.resource', 'bucket/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'buckets',
|
||||
name: 'createBucket',
|
||||
description: '/docs/references/storage/create-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -164,6 +166,7 @@ App::get('/v1/storage/buckets')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'buckets',
|
||||
name: 'listBuckets',
|
||||
description: '/docs/references/storage/list-buckets.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -216,10 +219,15 @@ App::get('/v1/storage/buckets')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$buckets = $dbForProject->find('buckets', $queries);
|
||||
$total = $dbForProject->count('buckets', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'buckets' => $dbForProject->find('buckets', $queries),
|
||||
'total' => $dbForProject->count('buckets', $filterQueries, APP_LIMIT_COUNT),
|
||||
'buckets' => $buckets,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_BUCKET_LIST);
|
||||
});
|
||||
|
||||
@@ -230,6 +238,7 @@ App::get('/v1/storage/buckets/:bucketId')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'buckets',
|
||||
name: 'getBucket',
|
||||
description: '/docs/references/storage/get-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -264,6 +273,7 @@ App::put('/v1/storage/buckets/:bucketId')
|
||||
->label('audits.resource', 'bucket/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'buckets',
|
||||
name: 'updateBucket',
|
||||
description: '/docs/references/storage/update-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -334,6 +344,7 @@ App::delete('/v1/storage/buckets/:bucketId')
|
||||
->label('audits.resource', 'bucket/{request.bucketId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'buckets',
|
||||
name: 'deleteBucket',
|
||||
description: '/docs/references/storage/delete-bucket.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -387,6 +398,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'createFile',
|
||||
description: '/docs/references/storage/create-file.md',
|
||||
type: MethodType::UPLOAD,
|
||||
@@ -756,6 +768,7 @@ App::get('/v1/storage/buckets/:bucketId/files')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'listFiles',
|
||||
description: '/docs/references/storage/list-files.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -837,6 +850,8 @@ App::get('/v1/storage/buckets/:bucketId/files')
|
||||
}
|
||||
} catch (NotFoundException) {
|
||||
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
@@ -853,6 +868,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'getFile',
|
||||
description: '/docs/references/storage/get-file.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -909,6 +925,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
->label('cache.resource', 'file/{request.fileId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'getFilePreview',
|
||||
description: '/docs/references/storage/get-file-preview.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1091,6 +1108,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'getFileDownload',
|
||||
description: '/docs/references/storage/get-file-download.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1239,6 +1257,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'getFileView',
|
||||
description: '/docs/references/storage/get-file-view.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1396,9 +1415,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push')
|
||||
->groups(['api', 'storage'])
|
||||
->label('scope', 'public')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', '*/*')
|
||||
->label('sdk.methodType', 'location')
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
->param('jwt', '', new Text(2048, 0), 'JSON Web Token to validate', true)
|
||||
@@ -1559,6 +1575,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'updateFile',
|
||||
description: '/docs/references/storage/update-file.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1673,6 +1690,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: 'files',
|
||||
name: 'deleteFile',
|
||||
description: '/docs/references/storage/delete-file.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1772,6 +1790,7 @@ App::get('/v1/storage/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: null,
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/storage/get-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1858,6 +1877,7 @@ App::get('/v1/storage/:bucketId/usage')
|
||||
->label('resourceType', RESOURCE_TYPE_BUCKETS)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'storage',
|
||||
group: null,
|
||||
name: 'getBucketUsage',
|
||||
description: '/docs/references/storage/get-bucket-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -33,6 +33,7 @@ use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Authorization as AuthorizationException;
|
||||
use Utopia\Database\Exception\Duplicate;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -62,6 +63,7 @@ App::post('/v1/teams')
|
||||
->label('audits.resource', 'team/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'create',
|
||||
description: '/docs/references/teams/create-team.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -152,6 +154,7 @@ App::get('/v1/teams')
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'list',
|
||||
description: '/docs/references/teams/list-teams.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -204,9 +207,12 @@ App::get('/v1/teams')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
$results = $dbForProject->find('teams', $queries);
|
||||
$total = $dbForProject->count('teams', $filterQueries, APP_LIMIT_COUNT);
|
||||
try {
|
||||
$results = $dbForProject->find('teams', $queries);
|
||||
$total = $dbForProject->count('teams', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'teams' => $results,
|
||||
@@ -220,6 +226,7 @@ App::get('/v1/teams/:teamId')
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'get',
|
||||
description: '/docs/references/teams/get-team.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -250,6 +257,7 @@ App::get('/v1/teams/:teamId/prefs')
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'getPrefs',
|
||||
description: '/docs/references/teams/get-team-prefs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -285,6 +293,7 @@ App::put('/v1/teams/:teamId')
|
||||
->label('audits.resource', 'team/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'updateName',
|
||||
description: '/docs/references/teams/update-team-name.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -332,6 +341,7 @@ App::put('/v1/teams/:teamId/prefs')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'updatePrefs',
|
||||
description: '/docs/references/teams/update-team-prefs.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -371,6 +381,7 @@ App::delete('/v1/teams/:teamId')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'teams',
|
||||
name: 'delete',
|
||||
description: '/docs/references/teams/delete-team.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -429,6 +440,7 @@ App::post('/v1/teams/:teamId/memberships')
|
||||
->label('audits.userId', '{request.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'memberships',
|
||||
name: 'createMembership',
|
||||
description: '/docs/references/teams/create-team-membership.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -615,7 +627,10 @@ App::post('/v1/teams/:teamId/memberships')
|
||||
$membership = ($isPrivilegedUser || $isAppUser) ?
|
||||
Authorization::skip(fn () => $dbForProject->createDocument('memberships', $membership)) :
|
||||
$dbForProject->createDocument('memberships', $membership);
|
||||
Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1));
|
||||
|
||||
if ($isPrivilegedUser || $isAppUser) {
|
||||
Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1));
|
||||
}
|
||||
|
||||
} elseif ($membership->getAttribute('confirm') === false) {
|
||||
$membership->setAttribute('secret', Auth::hash($secret));
|
||||
@@ -793,6 +808,7 @@ App::get('/v1/teams/:teamId/memberships')
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'memberships',
|
||||
name: 'listMemberships',
|
||||
description: '/docs/references/teams/list-team-members.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -856,17 +872,20 @@ App::get('/v1/teams/:teamId/memberships')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
try {
|
||||
$memberships = $dbForProject->find(
|
||||
collection: 'memberships',
|
||||
queries: $queries,
|
||||
);
|
||||
$total = $dbForProject->count(
|
||||
collection: 'memberships',
|
||||
queries: $filterQueries,
|
||||
max: APP_LIMIT_COUNT
|
||||
);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$memberships = $dbForProject->find(
|
||||
collection: 'memberships',
|
||||
queries: $queries,
|
||||
);
|
||||
|
||||
$total = $dbForProject->count(
|
||||
collection: 'memberships',
|
||||
queries: $filterQueries,
|
||||
max: APP_LIMIT_COUNT
|
||||
);
|
||||
|
||||
$memberships = array_filter($memberships, fn (Document $membership) => !empty($membership->getAttribute('userId')));
|
||||
|
||||
@@ -931,6 +950,7 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'memberships',
|
||||
name: 'getMembership',
|
||||
description: '/docs/references/teams/get-team-member.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1017,6 +1037,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'memberships',
|
||||
name: 'updateMembership',
|
||||
description: '/docs/references/teams/update-team-membership.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1031,7 +1052,6 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->param('membershipId', '', new UID(), 'Membership ID.')
|
||||
->param('roles', [], function (Document $project) {
|
||||
if ($project->getId() === 'console') {
|
||||
;
|
||||
$roles = array_keys(Config::getParam('roles', []));
|
||||
array_filter($roles, function ($role) {
|
||||
return !in_array($role, [Auth::USER_ROLE_APPS, Auth::USER_ROLE_GUESTS, Auth::USER_ROLE_USERS]);
|
||||
@@ -1043,9 +1063,10 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('user')
|
||||
->inject('project')
|
||||
->inject('dbForProject')
|
||||
->inject('queueForEvents')
|
||||
->action(function (string $teamId, string $membershipId, array $roles, Request $request, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
|
||||
->action(function (string $teamId, string $membershipId, array $roles, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents) {
|
||||
|
||||
$team = $dbForProject->getDocument('teams', $teamId);
|
||||
if ($team->isEmpty()) {
|
||||
@@ -1066,6 +1087,21 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
$isAppUser = Auth::isAppUser(Authorization::getRoles());
|
||||
$isOwner = Authorization::isRole('team:' . $team->getId() . '/owner');
|
||||
|
||||
if ($project->getId() === 'console') {
|
||||
// Quick check: fetch up to 2 owners to determine if only one exists
|
||||
$ownersCount = $dbForProject->count(
|
||||
collection: 'memberships',
|
||||
queries: [Query::contains('roles', ['owner'])],
|
||||
max: 2
|
||||
);
|
||||
|
||||
// Prevent role change if there's only one owner left,
|
||||
// the requester is that owner, and the new `$roles` no longer include 'owner'!
|
||||
if ($ownersCount === 1 && $isOwner && !\in_array('owner', $roles)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'There must be at least one owner in the organization.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$isOwner && !$isPrivilegedUser && !$isAppUser) { // Not owner, not admin, not app (server)
|
||||
throw new Exception(Exception::USER_UNAUTHORIZED, 'User is not allowed to modify roles');
|
||||
}
|
||||
@@ -1105,6 +1141,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
|
||||
->label('audits.userId', '{request.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'memberships',
|
||||
name: 'updateMembershipStatus',
|
||||
description: '/docs/references/teams/update-team-membership-status.md',
|
||||
auth: [AuthType::SESSION, AuthType::JWT],
|
||||
@@ -1262,6 +1299,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->label('audits.resource', 'team/{request.teamId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'memberships',
|
||||
name: 'deleteMembership',
|
||||
description: '/docs/references/teams/delete-team-membership.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -1332,6 +1370,7 @@ App::get('/v1/teams/:teamId/logs')
|
||||
->label('scope', 'teams.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'teams',
|
||||
group: 'logs',
|
||||
name: 'listLogs',
|
||||
description: '/docs/references/teams/get-team-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -33,6 +33,7 @@ use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -191,6 +192,7 @@ App::post('/v1/users')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'create',
|
||||
description: '/docs/references/users/create-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -225,6 +227,7 @@ App::post('/v1/users/bcrypt')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createBcryptUser',
|
||||
description: '/docs/references/users/create-bcrypt-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -259,6 +262,7 @@ App::post('/v1/users/md5')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createMD5User',
|
||||
description: '/docs/references/users/create-md5-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -293,6 +297,7 @@ App::post('/v1/users/argon2')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createArgon2User',
|
||||
description: '/docs/references/users/create-argon2-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -327,6 +332,7 @@ App::post('/v1/users/sha')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createSHAUser',
|
||||
description: '/docs/references/users/create-sha-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -368,6 +374,7 @@ App::post('/v1/users/phpass')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createPHPassUser',
|
||||
description: '/docs/references/users/create-phpass-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -402,6 +409,7 @@ App::post('/v1/users/scrypt')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createScryptUser',
|
||||
description: '/docs/references/users/create-scrypt-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -449,6 +457,7 @@ App::post('/v1/users/scrypt-modified')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'createScryptModifiedUser',
|
||||
description: '/docs/references/users/create-scrypt-modified-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -487,6 +496,7 @@ App::post('/v1/users/:userId/targets')
|
||||
->label('scope', 'targets.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'targets',
|
||||
name: 'createTarget',
|
||||
description: '/docs/references/users/create-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
@@ -578,6 +588,7 @@ App::get('/v1/users')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'list',
|
||||
description: '/docs/references/users/list-users.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -630,10 +641,15 @@ App::get('/v1/users')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$users = $dbForProject->find('users', $queries);
|
||||
$total = $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'users' => $dbForProject->find('users', $queries),
|
||||
'total' => $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT),
|
||||
'users' => $users,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_USER_LIST);
|
||||
});
|
||||
|
||||
@@ -643,6 +659,7 @@ App::get('/v1/users/:userId')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'get',
|
||||
description: '/docs/references/users/get-user.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -673,6 +690,7 @@ App::get('/v1/users/:userId/prefs')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'getPrefs',
|
||||
description: '/docs/references/users/get-user-prefs.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -705,6 +723,7 @@ App::get('/v1/users/:userId/targets/:targetId')
|
||||
->label('scope', 'targets.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'targets',
|
||||
name: 'getTarget',
|
||||
description: '/docs/references/users/get-user-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
@@ -742,6 +761,7 @@ App::get('/v1/users/:userId/sessions')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'sessions',
|
||||
name: 'listSessions',
|
||||
description: '/docs/references/users/list-user-sessions.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -788,6 +808,7 @@ App::get('/v1/users/:userId/memberships')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'memberships',
|
||||
name: 'listMemberships',
|
||||
description: '/docs/references/users/list-user-memberships.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -832,6 +853,7 @@ App::get('/v1/users/:userId/logs')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'logs',
|
||||
name: 'listLogs',
|
||||
description: '/docs/references/users/list-user-logs.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -928,6 +950,7 @@ App::get('/v1/users/:userId/targets')
|
||||
->label('scope', 'targets.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'targets',
|
||||
name: 'listTargets',
|
||||
description: '/docs/references/users/list-user-targets.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
@@ -980,10 +1003,15 @@ App::get('/v1/users/:userId/targets')
|
||||
|
||||
$cursor->setValue($cursorDocument);
|
||||
}
|
||||
|
||||
try {
|
||||
$targets = $dbForProject->find('targets', $queries);
|
||||
$total = $dbForProject->count('targets', $queries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'targets' => $dbForProject->find('targets', $queries),
|
||||
'total' => $dbForProject->count('targets', $queries, APP_LIMIT_COUNT),
|
||||
'targets' => $targets,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_TARGET_LIST);
|
||||
});
|
||||
|
||||
@@ -993,6 +1021,7 @@ App::get('/v1/users/identities')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'identities',
|
||||
name: 'listIdentities',
|
||||
description: '/docs/references/users/list-identities.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1045,10 +1074,15 @@ App::get('/v1/users/identities')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
try {
|
||||
$identities = $dbForProject->find('identities', $queries);
|
||||
$total = $dbForProject->count('identities', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'identities' => $dbForProject->find('identities', $queries),
|
||||
'total' => $dbForProject->count('identities', $filterQueries, APP_LIMIT_COUNT),
|
||||
'identities' => $identities,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_IDENTITY_LIST);
|
||||
});
|
||||
|
||||
@@ -1062,6 +1096,7 @@ App::patch('/v1/users/:userId/status')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updateStatus',
|
||||
description: '/docs/references/users/update-user-status.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1102,6 +1137,7 @@ App::put('/v1/users/:userId/labels')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updateLabels',
|
||||
description: '/docs/references/users/update-user-labels.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1144,6 +1180,7 @@ App::patch('/v1/users/:userId/verification/phone')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updatePhoneVerification',
|
||||
description: '/docs/references/users/update-user-phone-verification.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1185,6 +1222,7 @@ App::patch('/v1/users/:userId/name')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updateName',
|
||||
description: '/docs/references/users/update-user-name.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1227,6 +1265,7 @@ App::patch('/v1/users/:userId/password')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updatePassword',
|
||||
description: '/docs/references/users/update-user-password.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1309,6 +1348,7 @@ App::patch('/v1/users/:userId/email')
|
||||
->label('audits.userId', '{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updateEmail',
|
||||
description: '/docs/references/users/update-user-email.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1408,6 +1448,7 @@ App::patch('/v1/users/:userId/phone')
|
||||
->label('audits.resource', 'user/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updatePhone',
|
||||
description: '/docs/references/users/update-user-phone.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1497,6 +1538,7 @@ App::patch('/v1/users/:userId/verification')
|
||||
->label('audits.userId', '{request.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updateEmailVerification',
|
||||
description: '/docs/references/users/update-user-email-verification.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1534,6 +1576,7 @@ App::patch('/v1/users/:userId/prefs')
|
||||
->label('scope', 'users.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updatePrefs',
|
||||
description: '/docs/references/users/update-user-prefs.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1574,6 +1617,7 @@ App::patch('/v1/users/:userId/targets/:targetId')
|
||||
->label('scope', 'targets.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'targets',
|
||||
name: 'updateTarget',
|
||||
description: '/docs/references/users/update-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
@@ -1678,6 +1722,7 @@ App::patch('/v1/users/:userId/mfa')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'updateMfa',
|
||||
description: '/docs/references/users/update-user-mfa.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1717,6 +1762,7 @@ App::get('/v1/users/:userId/mfa/factors')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'mfa',
|
||||
name: 'listMfaFactors',
|
||||
description: '/docs/references/users/list-mfa-factors.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1755,6 +1801,7 @@ App::get('/v1/users/:userId/mfa/recovery-codes')
|
||||
->label('usage.metric', 'users.{scope}.requests.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'mfa',
|
||||
name: 'getMfaRecoveryCodes',
|
||||
description: '/docs/references/users/get-mfa-recovery-codes.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1799,6 +1846,7 @@ App::patch('/v1/users/:userId/mfa/recovery-codes')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'mfa',
|
||||
name: 'createMfaRecoveryCodes',
|
||||
description: '/docs/references/users/create-mfa-recovery-codes.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1840,7 +1888,7 @@ App::patch('/v1/users/:userId/mfa/recovery-codes')
|
||||
});
|
||||
|
||||
App::put('/v1/users/:userId/mfa/recovery-codes')
|
||||
->desc('Regenerate MFA recovery codes')
|
||||
->desc('Update MFA recovery codes (regenerate)')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.[userId].update.mfa.recovery-codes')
|
||||
->label('scope', 'users.write')
|
||||
@@ -1850,6 +1898,7 @@ App::put('/v1/users/:userId/mfa/recovery-codes')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'mfa',
|
||||
name: 'updateMfaRecoveryCodes',
|
||||
description: '/docs/references/users/update-mfa-recovery-codes.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1900,6 +1949,7 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type')
|
||||
->label('usage.metric', 'users.{scope}.requests.update')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'mfa',
|
||||
name: 'deleteMfaAuthenticator',
|
||||
description: '/docs/references/users/delete-mfa-authenticator.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -1947,6 +1997,7 @@ App::post('/v1/users/:userId/sessions')
|
||||
->label('usage.metric', 'sessions.{scope}.requests.create')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'sessions',
|
||||
name: 'createSession',
|
||||
description: '/docs/references/users/create-session.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2031,6 +2082,7 @@ App::post('/v1/users/:userId/tokens')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'sessions',
|
||||
name: 'createToken',
|
||||
description: '/docs/references/users/create-token.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2093,6 +2145,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'sessions',
|
||||
name: 'deleteSession',
|
||||
description: '/docs/references/users/delete-user-session.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2143,6 +2196,7 @@ App::delete('/v1/users/:userId/sessions')
|
||||
->label('audits.resource', 'user/{user.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'sessions',
|
||||
name: 'deleteSessions',
|
||||
description: '/docs/references/users/delete-user-sessions.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2192,6 +2246,7 @@ App::delete('/v1/users/:userId')
|
||||
->label('audits.resource', 'user/{request.userId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'users',
|
||||
name: 'delete',
|
||||
description: '/docs/references/users/delete.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2241,6 +2296,7 @@ App::delete('/v1/users/:userId/targets/:targetId')
|
||||
->label('scope', 'targets.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'targets',
|
||||
name: 'deleteTarget',
|
||||
description: '/docs/references/users/delete-target.md',
|
||||
auth: [AuthType::KEY, AuthType::ADMIN],
|
||||
@@ -2298,6 +2354,7 @@ App::delete('/v1/users/identities/:identityId')
|
||||
->label('audits.resource', 'identity/{request.$identityId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'identities',
|
||||
name: 'deleteIdentity',
|
||||
description: '/docs/references/users/delete-identity.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2337,6 +2394,7 @@ App::post('/v1/users/:userId/jwts')
|
||||
->label('scope', 'users.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: 'sessions',
|
||||
name: 'createJWT',
|
||||
description: '/docs/references/users/create-user-jwt.md',
|
||||
auth: [AuthType::KEY],
|
||||
@@ -2392,6 +2450,7 @@ App::get('/v1/users/usage')
|
||||
->label('scope', 'users.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'users',
|
||||
group: null,
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/users/get-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
@@ -19,6 +19,7 @@ use Utopia\Config\Config;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Order as OrderException;
|
||||
use Utopia\Database\Exception\Query as QueryException;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
@@ -269,12 +270,13 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
|
||||
};
|
||||
|
||||
App::get('/v1/vcs/github/authorize')
|
||||
->desc('Install GitHub app')
|
||||
->desc('Create GitHub app installation')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.read')
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'installations',
|
||||
name: 'createGitHubInstallation',
|
||||
description: '/docs/references/vcs/create-github-installation.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -318,7 +320,7 @@ App::get('/v1/vcs/github/authorize')
|
||||
});
|
||||
|
||||
App::get('/v1/vcs/github/callback')
|
||||
->desc('Capture installation and authorization from GitHub app')
|
||||
->desc('Get installation and authorization from GitHub app')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'public')
|
||||
->label('error', __DIR__ . '/../../views/general/error.phtml')
|
||||
@@ -456,6 +458,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'getRepositoryContents',
|
||||
description: '/docs/references/vcs/get-repository-contents.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -517,11 +520,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
||||
});
|
||||
|
||||
App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId/detection')
|
||||
->desc('Detect runtime settings from source code')
|
||||
->desc('Create runtime settings detection')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'createRepositoryDetection',
|
||||
description: '/docs/references/vcs/create-repository-detection.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -599,6 +603,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories')
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'listRepositories',
|
||||
description: '/docs/references/vcs/list-repositories.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -699,6 +704,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'createRepository',
|
||||
description: '/docs/references/vcs/create-repository.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -811,6 +817,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'getRepository',
|
||||
description: '/docs/references/vcs/get-repository.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -865,6 +872,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'listRepositoryBranches',
|
||||
description: '/docs/references/vcs/list-repository-branches.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1058,6 +1066,7 @@ App::get('/v1/vcs/installations')
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'installations',
|
||||
name: 'listInstallations',
|
||||
description: '/docs/references/vcs/list-installations.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1113,9 +1122,12 @@ App::get('/v1/vcs/installations')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
|
||||
$results = $dbForPlatform->find('installations', $queries);
|
||||
$total = $dbForPlatform->count('installations', $filterQueries, APP_LIMIT_COUNT);
|
||||
try {
|
||||
$results = $dbForPlatform->find('installations', $queries);
|
||||
$total = $dbForPlatform->count('installations', $filterQueries, APP_LIMIT_COUNT);
|
||||
} catch (OrderException $e) {
|
||||
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'installations' => $results,
|
||||
@@ -1129,6 +1141,7 @@ App::get('/v1/vcs/installations/:installationId')
|
||||
->label('scope', 'vcs.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'installations',
|
||||
name: 'getInstallation',
|
||||
description: '/docs/references/vcs/get-installation.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1163,6 +1176,7 @@ App::delete('/v1/vcs/installations/:installationId')
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'installations',
|
||||
name: 'deleteInstallation',
|
||||
description: '/docs/references/vcs/delete-installation.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
@@ -1198,11 +1212,12 @@ App::delete('/v1/vcs/installations/:installationId')
|
||||
});
|
||||
|
||||
App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositoryId')
|
||||
->desc('Authorize external deployment')
|
||||
->desc('Update external deployment (authorize)')
|
||||
->groups(['api', 'vcs'])
|
||||
->label('scope', 'vcs.write')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vcs',
|
||||
group: 'repositories',
|
||||
name: 'updateExternalDeployments',
|
||||
description: '/docs/references/vcs/update-external-deployments.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
|
||||
+37
-16
@@ -50,7 +50,7 @@ Config::setParam('domainVerification', false);
|
||||
Config::setParam('cookieDomain', 'localhost');
|
||||
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
|
||||
|
||||
function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname)
|
||||
function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname)
|
||||
{
|
||||
$utopia->getRoute()?->label('error', __DIR__ . '/../views/general/error.phtml');
|
||||
|
||||
@@ -72,11 +72,19 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
|
||||
}
|
||||
|
||||
if ($route->isEmpty()) {
|
||||
if ($host === System::getEnv('_APP_DOMAIN_FUNCTIONS', '')) {
|
||||
|
||||
$appDomainFunctionsFallback = System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', '');
|
||||
$appDomainFunctions = System::getEnv('_APP_DOMAIN_FUNCTIONS', '');
|
||||
|
||||
if (!empty($appDomainFunctionsFallback) && \str_ends_with($host, $appDomainFunctionsFallback)) {
|
||||
$appDomainFunctions = $appDomainFunctionsFallback;
|
||||
}
|
||||
|
||||
if ($host === $appDomainFunctions) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain cannot be used for security reasons. Please use any subdomain instead.');
|
||||
}
|
||||
|
||||
if (\str_ends_with($host, System::getEnv('_APP_DOMAIN_FUNCTIONS', ''))) {
|
||||
if (\str_ends_with($host, $appDomainFunctions)) {
|
||||
throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain is not connected to any Appwrite resource yet. Please configure custom domain or function domain to allow this request.');
|
||||
}
|
||||
|
||||
@@ -125,6 +133,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
|
||||
if (empty($method)) {
|
||||
$utopia->getRoute()?->label('sdk', new Method(
|
||||
namespace: 'functions',
|
||||
group: 'executions',
|
||||
name: 'createExecution',
|
||||
description: '/docs/references/functions/create-execution.md',
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
@@ -339,7 +348,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
|
||||
]);
|
||||
|
||||
/** Execute function */
|
||||
$executor = new Executor(System::getEnv('_APP_EXECUTOR_HOST'));
|
||||
try {
|
||||
$version = $function->getAttribute('version', 'v2');
|
||||
$command = $runtime['startCommand'];
|
||||
@@ -503,9 +511,10 @@ App::init()
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForCertificates')
|
||||
->inject('queueForFunctions')
|
||||
->inject('executor')
|
||||
->inject('isResourceBlocked')
|
||||
->inject('previewHostname')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, callable $isResourceBlocked, string $previewHostname) {
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname) {
|
||||
/*
|
||||
* Appwrite Router
|
||||
*/
|
||||
@@ -513,7 +522,7 @@ App::init()
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
// Only run Router when external domain
|
||||
if ($host !== $mainDomain || !empty($previewHostname)) {
|
||||
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname)) {
|
||||
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -582,6 +591,12 @@ App::init()
|
||||
]);
|
||||
}
|
||||
|
||||
$owner = '';
|
||||
$functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', '');
|
||||
if (!empty($functionsDomain) && \str_ends_with($domain->get(), $functionsDomain)) {
|
||||
$owner = 'Appwrite';
|
||||
}
|
||||
|
||||
if ($domainDocument->isEmpty()) {
|
||||
$domainDocument = new Document([
|
||||
// TODO: @christyjacob remove once we migrate the rules in 1.7.x
|
||||
@@ -589,8 +604,10 @@ App::init()
|
||||
'domain' => $domain->get(),
|
||||
'resourceType' => 'api',
|
||||
'status' => 'verifying',
|
||||
'projectId' => 'console',
|
||||
'projectInternalId' => 'console'
|
||||
'projectId' => $console->getId(),
|
||||
'projectInternalId' => $console->getInternalId(),
|
||||
'owner' => $owner,
|
||||
'region' => $console->getAttribute('region')
|
||||
]);
|
||||
|
||||
$domainDocument = $dbForPlatform->createDocument('rules', $domainDocument);
|
||||
@@ -734,11 +751,12 @@ App::options()
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForStatsUsage')
|
||||
->inject('queueForFunctions')
|
||||
->inject('executor')
|
||||
->inject('geodb')
|
||||
->inject('isResourceBlocked')
|
||||
->inject('previewHostname')
|
||||
->inject('project')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project) {
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project) {
|
||||
/*
|
||||
* Appwrite Router
|
||||
*/
|
||||
@@ -746,7 +764,7 @@ App::options()
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
// Only run Router when external domain
|
||||
if ($host !== $mainDomain || !empty($previewHostname)) {
|
||||
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname)) {
|
||||
if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -863,17 +881,18 @@ App::error()
|
||||
if (!empty($providerConfig) && $error->getCode() >= 400 && $error->getCode() < 500) {
|
||||
// Register error logger
|
||||
try {
|
||||
$loggingProvider = new DSN($providerConfig ?? '');
|
||||
$loggingProvider = new DSN($providerConfig);
|
||||
$providerName = $loggingProvider->getScheme();
|
||||
|
||||
if (!empty($providerName) && $providerName === 'sentry') {
|
||||
$key = $loggingProvider->getPassword();
|
||||
$projectId = $loggingProvider->getUser() ?? '';
|
||||
$host = 'https://' . $loggingProvider->getHost();
|
||||
$sampleRate = $loggingProvider->getParam('sample', 0.01);
|
||||
|
||||
$adapter = new Sentry($projectId, $key, $host);
|
||||
$logger = new Logger($adapter);
|
||||
$logger->setSample(0.01);
|
||||
$logger->setSample($sampleRate);
|
||||
$publish = true;
|
||||
} else {
|
||||
throw new \Exception('Invalid experimental logging provider');
|
||||
@@ -1053,10 +1072,11 @@ App::get('/robots.txt')
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForStatsUsage')
|
||||
->inject('queueForFunctions')
|
||||
->inject('executor')
|
||||
->inject('geodb')
|
||||
->inject('isResourceBlocked')
|
||||
->inject('previewHostname')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname) {
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname) {
|
||||
$host = $request->getHostname() ?? '';
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
@@ -1064,7 +1084,7 @@ App::get('/robots.txt')
|
||||
$template = new View(__DIR__ . '/../views/general/robots.phtml');
|
||||
$response->text($template->render(false));
|
||||
} else {
|
||||
router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname);
|
||||
router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1081,10 +1101,11 @@ App::get('/humans.txt')
|
||||
->inject('queueForEvents')
|
||||
->inject('queueForStatsUsage')
|
||||
->inject('queueForFunctions')
|
||||
->inject('executor')
|
||||
->inject('geodb')
|
||||
->inject('isResourceBlocked')
|
||||
->inject('previewHostname')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname) {
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname) {
|
||||
$host = $request->getHostname() ?? '';
|
||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
@@ -1092,7 +1113,7 @@ App::get('/humans.txt')
|
||||
$template = new View(__DIR__ . '/../views/general/humans.phtml');
|
||||
$response->text($template->render(false));
|
||||
} else {
|
||||
router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname);
|
||||
router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -238,34 +238,36 @@ App::init()
|
||||
subject: 'keys'
|
||||
);
|
||||
|
||||
if ($dbKey) {
|
||||
$accessedAt = $dbKey->getAttribute('accessedAt', '');
|
||||
if (!$dbKey) {
|
||||
throw new Exception(Exception::USER_UNAUTHORIZED);
|
||||
}
|
||||
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) {
|
||||
$dbKey->setAttribute('accessedAt', DateTime::now());
|
||||
$accessedAt = $dbKey->getAttribute('accessedAt', '');
|
||||
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) {
|
||||
$dbKey->setAttribute('accessedAt', DateTime::now());
|
||||
$dbForPlatform->updateDocument('keys', $dbKey->getId(), $dbKey);
|
||||
$dbForPlatform->purgeCachedDocument('projects', $project->getId());
|
||||
}
|
||||
|
||||
$sdkValidator = new WhiteList($servers, true);
|
||||
$sdk = $request->getHeader('x-sdk-name', 'UNKNOWN');
|
||||
|
||||
if ($sdkValidator->isValid($sdk)) {
|
||||
$sdks = $dbKey->getAttribute('sdks', []);
|
||||
|
||||
if (!in_array($sdk, $sdks)) {
|
||||
$sdks[] = $sdk;
|
||||
$dbKey->setAttribute('sdks', $sdks);
|
||||
|
||||
/** Update access time as well */
|
||||
$dbKey->setAttribute('accessedAt', Datetime::now());
|
||||
$dbForPlatform->updateDocument('keys', $dbKey->getId(), $dbKey);
|
||||
$dbForPlatform->purgeCachedDocument('projects', $project->getId());
|
||||
}
|
||||
|
||||
$sdkValidator = new WhiteList($servers, true);
|
||||
$sdk = $request->getHeader('x-sdk-name', 'UNKNOWN');
|
||||
|
||||
if ($sdkValidator->isValid($sdk)) {
|
||||
$sdks = $dbKey->getAttribute('sdks', []);
|
||||
|
||||
if (!in_array($sdk, $sdks)) {
|
||||
$sdks[] = $sdk;
|
||||
$dbKey->setAttribute('sdks', $sdks);
|
||||
|
||||
/** Update access time as well */
|
||||
$dbKey->setAttribute('accessedAt', Datetime::now());
|
||||
$dbForPlatform->updateDocument('keys', $dbKey->getId(), $dbKey);
|
||||
$dbForPlatform->purgeCachedDocument('projects', $project->getId());
|
||||
}
|
||||
}
|
||||
|
||||
$queueForAudits->setUser($user);
|
||||
}
|
||||
|
||||
$queueForAudits->setUser($user);
|
||||
}
|
||||
} // Admin User Authentication
|
||||
elseif (($project->getId() === 'console' && !$team->isEmpty() && !$user->isEmpty()) || ($project->getId() !== 'console' && !$user->isEmpty() && $mode === APP_MODE_ADMIN)) {
|
||||
@@ -390,7 +392,8 @@ App::init()
|
||||
->inject('timelimit')
|
||||
->inject('mode')
|
||||
->inject('apiKey')
|
||||
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, string $mode, ?Key $apiKey) use ($usageDatabaseListener, $eventDatabaseListener) {
|
||||
->inject('plan')
|
||||
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, string $mode, ?Key $apiKey, array $plan) use ($usageDatabaseListener, $eventDatabaseListener) {
|
||||
|
||||
$route = $utopia->getRoute();
|
||||
|
||||
@@ -520,6 +523,10 @@ App::init()
|
||||
|
||||
$useCache = $route->getLabel('cache', false);
|
||||
if ($useCache) {
|
||||
$route = $utopia->match($request);
|
||||
$isImageTransformation = $route->getPath() === '/v1/storage/buckets/:bucketId/files/:fileId/preview';
|
||||
$isDisabled = isset($plan['imageTransformations']) && $plan['imageTransformations'] === -1 && !Auth::isPrivilegedUser(Authorization::getRoles());
|
||||
|
||||
$key = md5($request->getURI() . '*' . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER);
|
||||
$cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key));
|
||||
$cache = new Cache(
|
||||
@@ -529,10 +536,10 @@ App::init()
|
||||
$data = $cache->load($key, $timestamp);
|
||||
|
||||
if (!empty($data) && !$cacheLog->isEmpty()) {
|
||||
$parts = explode('/', $cacheLog->getAttribute('resourceType'));
|
||||
$parts = explode('/', $cacheLog->getAttribute('resourceType', ''));
|
||||
$type = $parts[0] ?? null;
|
||||
|
||||
if ($type === 'bucket') {
|
||||
if ($type === 'bucket' && (!$isImageTransformation || !$isDisabled)) {
|
||||
$bucketId = $parts[1] ?? null;
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
|
||||
@@ -573,8 +580,10 @@ App::init()
|
||||
$response
|
||||
->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp))
|
||||
->addHeader('X-Appwrite-Cache', 'hit')
|
||||
->setContentType($cacheLog->getAttribute('mimeType'))
|
||||
->send($data);
|
||||
->setContentType($cacheLog->getAttribute('mimeType'));
|
||||
if (!$isImageTransformation || !$isDisabled) {
|
||||
$response->send($data);
|
||||
}
|
||||
} else {
|
||||
$response
|
||||
->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
|
||||
|
||||
+9
-1891
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Utopia\Config\Config;
|
||||
|
||||
Config::load('events', __DIR__ . '/../config/events.php');
|
||||
Config::load('auth', __DIR__ . '/../config/auth.php');
|
||||
Config::load('apis', __DIR__ . '/../config/apis.php'); // List of APIs
|
||||
Config::load('errors', __DIR__ . '/../config/errors.php');
|
||||
Config::load('oAuthProviders', __DIR__ . '/../config/oAuthProviders.php');
|
||||
Config::load('platforms', __DIR__ . '/../config/platforms.php');
|
||||
Config::load('console', __DIR__ . '/../config/console.php');
|
||||
Config::load('collections', __DIR__ . '/../config/collections.php');
|
||||
Config::load('runtimes', __DIR__ . '/../config/runtimes.php');
|
||||
Config::load('runtimes-v2', __DIR__ . '/../config/runtimes-v2.php');
|
||||
Config::load('usage', __DIR__ . '/../config/usage.php');
|
||||
Config::load('roles', __DIR__ . '/../config/roles.php'); // User roles and scopes
|
||||
Config::load('scopes', __DIR__ . '/../config/scopes.php'); // User roles and scopes
|
||||
Config::load('services', __DIR__ . '/../config/services.php'); // List of services
|
||||
Config::load('variables', __DIR__ . '/../config/variables.php'); // List of env variables
|
||||
Config::load('regions', __DIR__ . '/../config/regions.php'); // List of available regions
|
||||
Config::load('avatar-browsers', __DIR__ . '/../config/avatars/browsers.php');
|
||||
Config::load('avatar-credit-cards', __DIR__ . '/../config/avatars/credit-cards.php');
|
||||
Config::load('avatar-flags', __DIR__ . '/../config/avatars/flags.php');
|
||||
Config::load('locale-codes', __DIR__ . '/../config/locale/codes.php');
|
||||
Config::load('locale-currencies', __DIR__ . '/../config/locale/currencies.php');
|
||||
Config::load('locale-eu', __DIR__ . '/../config/locale/eu.php');
|
||||
Config::load('locale-languages', __DIR__ . '/../config/locale/languages.php');
|
||||
Config::load('locale-phones', __DIR__ . '/../config/locale/phones.php');
|
||||
Config::load('locale-countries', __DIR__ . '/../config/locale/countries.php');
|
||||
Config::load('locale-continents', __DIR__ . '/../config/locale/continents.php');
|
||||
Config::load('locale-templates', __DIR__ . '/../config/locale/templates.php');
|
||||
Config::load('storage-logos', __DIR__ . '/../config/storage/logos.php');
|
||||
Config::load('storage-mimes', __DIR__ . '/../config/storage/mimes.php');
|
||||
Config::load('storage-inputs', __DIR__ . '/../config/storage/inputs.php');
|
||||
Config::load('storage-outputs', __DIR__ . '/../config/storage/outputs.php');
|
||||
Config::load('runtime-specifications', __DIR__ . '/../config/runtimes/specifications.php');
|
||||
Config::load('function-templates', __DIR__ . '/../config/function-templates.php');
|
||||
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Functions\Specification;
|
||||
|
||||
const APP_NAME = 'Appwrite';
|
||||
const APP_DOMAIN = 'appwrite.io';
|
||||
const APP_EMAIL_TEAM = 'team@localhost.test'; // Default email address
|
||||
const APP_EMAIL_SECURITY = ''; // Default security email address
|
||||
const APP_USERAGENT = APP_NAME . '-Server v%s. Please report abuse at %s';
|
||||
const APP_MODE_DEFAULT = 'default';
|
||||
const APP_MODE_ADMIN = 'admin';
|
||||
const APP_PAGING_LIMIT = 12;
|
||||
const APP_LIMIT_COUNT = 5000;
|
||||
const APP_LIMIT_USERS = 10_000;
|
||||
const APP_LIMIT_USER_PASSWORD_HISTORY = 20;
|
||||
const APP_LIMIT_USER_SESSIONS_MAX = 100;
|
||||
const APP_LIMIT_USER_SESSIONS_DEFAULT = 10;
|
||||
const APP_LIMIT_ANTIVIRUS = 20_000_000; //20MB
|
||||
const APP_LIMIT_ENCRYPTION = 20_000_000; //20MB
|
||||
const APP_LIMIT_COMPRESSION = 20_000_000; //20MB
|
||||
const APP_LIMIT_ARRAY_PARAMS_SIZE = 100; // Default maximum of how many elements can there be in API parameter that expects array value
|
||||
const APP_LIMIT_ARRAY_LABELS_SIZE = 1000; // Default maximum of how many labels elements can there be in API parameter that expects array value
|
||||
const APP_LIMIT_ARRAY_ELEMENT_SIZE = 4096; // Default maximum length of element in array parameter represented by maximum URL length.
|
||||
const APP_LIMIT_SUBQUERY = 1000;
|
||||
const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000;
|
||||
const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period
|
||||
const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds
|
||||
const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls
|
||||
const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_FILE_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours
|
||||
const APP_CACHE_BUSTER = 4318;
|
||||
const APP_VERSION_STABLE = '1.6.2';
|
||||
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
||||
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
||||
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
||||
const APP_DATABASE_ATTRIBUTE_DATETIME = 'datetime';
|
||||
const APP_DATABASE_ATTRIBUTE_URL = 'url';
|
||||
const APP_DATABASE_ATTRIBUTE_INT_RANGE = 'intRange';
|
||||
const APP_DATABASE_ATTRIBUTE_FLOAT_RANGE = 'floatRange';
|
||||
const APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH = 1_073_741_824; // 2^32 bits / 4 bits per char
|
||||
const APP_DATABASE_TIMEOUT_MILLISECONDS_API = 15 * 1000; // 15 seconds
|
||||
const APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER = 300 * 1000; // 5 minutes
|
||||
const APP_DATABASE_TIMEOUT_MILLISECONDS_TASK = 300 * 1000; // 5 minutes
|
||||
const APP_DATABASE_QUERY_MAX_VALUES = 500;
|
||||
const APP_STORAGE_UPLOADS = '/storage/uploads';
|
||||
const APP_STORAGE_FUNCTIONS = '/storage/functions';
|
||||
const APP_STORAGE_BUILDS = '/storage/builds';
|
||||
const APP_STORAGE_CACHE = '/storage/cache';
|
||||
const APP_STORAGE_CERTIFICATES = '/storage/certificates';
|
||||
const APP_STORAGE_CONFIG = '/storage/config';
|
||||
const APP_STORAGE_READ_BUFFER = 20 * (1000 * 1000); //20MB other names `APP_STORAGE_MEMORY_LIMIT`, `APP_STORAGE_MEMORY_BUFFER`, `APP_STORAGE_READ_LIMIT`, `APP_STORAGE_BUFFER_LIMIT`
|
||||
const APP_SOCIAL_TWITTER = 'https://twitter.com/appwrite';
|
||||
const APP_SOCIAL_TWITTER_HANDLE = 'appwrite';
|
||||
const APP_SOCIAL_FACEBOOK = 'https://www.facebook.com/appwrite.io';
|
||||
const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite';
|
||||
const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io';
|
||||
const APP_SOCIAL_GITHUB = 'https://github.com/appwrite';
|
||||
const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord';
|
||||
const APP_SOCIAL_DISCORD_CHANNEL = '564160730845151244';
|
||||
const APP_SOCIAL_DEV = 'https://dev.to/appwrite';
|
||||
const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite';
|
||||
const APP_SOCIAL_YOUTUBE = 'https://www.youtube.com/c/appwrite?sub_confirmation=1';
|
||||
const APP_HOSTNAME_INTERNAL = 'appwrite';
|
||||
const APP_FUNCTION_SPECIFICATION_DEFAULT = Specification::S_1VCPU_512MB;
|
||||
const APP_FUNCTION_CPUS_DEFAULT = 0.5;
|
||||
const APP_FUNCTION_MEMORY_DEFAULT = 512;
|
||||
const APP_PLATFORM_SERVER = 'server';
|
||||
const APP_PLATFORM_CLIENT = 'client';
|
||||
const APP_PLATFORM_CONSOLE = 'console';
|
||||
|
||||
// Database Reconnect
|
||||
const DATABASE_RECONNECT_SLEEP = 2;
|
||||
const DATABASE_RECONNECT_MAX_ATTEMPTS = 10;
|
||||
|
||||
// Database Worker Types
|
||||
const DATABASE_TYPE_CREATE_ATTRIBUTE = 'createAttribute';
|
||||
const DATABASE_TYPE_CREATE_INDEX = 'createIndex';
|
||||
const DATABASE_TYPE_DELETE_ATTRIBUTE = 'deleteAttribute';
|
||||
const DATABASE_TYPE_DELETE_INDEX = 'deleteIndex';
|
||||
const DATABASE_TYPE_DELETE_COLLECTION = 'deleteCollection';
|
||||
const DATABASE_TYPE_DELETE_DATABASE = 'deleteDatabase';
|
||||
|
||||
// Build Worker Types
|
||||
const BUILD_TYPE_DEPLOYMENT = 'deployment';
|
||||
const BUILD_TYPE_RETRY = 'retry';
|
||||
|
||||
// Deletion Types
|
||||
const DELETE_TYPE_DATABASES = 'databases';
|
||||
const DELETE_TYPE_DOCUMENT = 'document';
|
||||
const DELETE_TYPE_COLLECTIONS = 'collections';
|
||||
const DELETE_TYPE_PROJECTS = 'projects';
|
||||
const DELETE_TYPE_FUNCTIONS = 'functions';
|
||||
const DELETE_TYPE_DEPLOYMENTS = 'deployments';
|
||||
const DELETE_TYPE_USERS = 'users';
|
||||
const DELETE_TYPE_TEAM_PROJECTS = 'teams_projects';
|
||||
const DELETE_TYPE_EXECUTIONS = 'executions';
|
||||
const DELETE_TYPE_AUDIT = 'audit';
|
||||
const DELETE_TYPE_ABUSE = 'abuse';
|
||||
const DELETE_TYPE_USAGE = 'usage';
|
||||
const DELETE_TYPE_REALTIME = 'realtime';
|
||||
const DELETE_TYPE_BUCKETS = 'buckets';
|
||||
const DELETE_TYPE_INSTALLATIONS = 'installations';
|
||||
const DELETE_TYPE_RULES = 'rules';
|
||||
const DELETE_TYPE_SESSIONS = 'sessions';
|
||||
const DELETE_TYPE_CACHE_BY_TIMESTAMP = 'cacheByTimeStamp';
|
||||
const DELETE_TYPE_CACHE_BY_RESOURCE = 'cacheByResource';
|
||||
const DELETE_TYPE_SCHEDULES = 'schedules';
|
||||
const DELETE_TYPE_TOPIC = 'topic';
|
||||
const DELETE_TYPE_TARGET = 'target';
|
||||
const DELETE_TYPE_EXPIRED_TARGETS = 'invalid_targets';
|
||||
const DELETE_TYPE_SESSION_TARGETS = 'session_targets';
|
||||
const DELETE_TYPE_MAINTENANCE = 'maintenance';
|
||||
|
||||
// Message types
|
||||
const MESSAGE_SEND_TYPE_INTERNAL = 'internal';
|
||||
const MESSAGE_SEND_TYPE_EXTERNAL = 'external';
|
||||
// Mail Types
|
||||
const MAIL_TYPE_VERIFICATION = 'verification';
|
||||
const MAIL_TYPE_MAGIC_SESSION = 'magicSession';
|
||||
const MAIL_TYPE_RECOVERY = 'recovery';
|
||||
const MAIL_TYPE_INVITATION = 'invitation';
|
||||
const MAIL_TYPE_CERTIFICATE = 'certificate';
|
||||
// Auth Types
|
||||
const APP_AUTH_TYPE_SESSION = 'Session';
|
||||
const APP_AUTH_TYPE_JWT = 'JWT';
|
||||
const APP_AUTH_TYPE_KEY = 'Key';
|
||||
const APP_AUTH_TYPE_ADMIN = 'Admin';
|
||||
// Response related
|
||||
const MAX_OUTPUT_CHUNK_SIZE = 10 * 1024 * 1024; // 10MB
|
||||
// Function headers
|
||||
const FUNCTION_ALLOWLIST_HEADERS_REQUEST = ['content-type', 'agent', 'content-length', 'host'];
|
||||
const FUNCTION_ALLOWLIST_HEADERS_RESPONSE = ['content-type', 'content-length'];
|
||||
// Message types
|
||||
const MESSAGE_TYPE_EMAIL = 'email';
|
||||
const MESSAGE_TYPE_SMS = 'sms';
|
||||
const MESSAGE_TYPE_PUSH = 'push';
|
||||
// API key types
|
||||
const API_KEY_STANDARD = 'standard';
|
||||
const API_KEY_DYNAMIC = 'dynamic';
|
||||
// Usage metrics
|
||||
const METRIC_TEAMS = 'teams';
|
||||
const METRIC_USERS = 'users';
|
||||
const METRIC_WEBHOOKS_SENT = 'webhooks.events.sent';
|
||||
const METRIC_WEBHOOKS_FAILED = 'webhooks.events.failed';
|
||||
const METRIC_WEBHOOK_ID_SENT = '{webhookInternalId}.webhooks.events.sent';
|
||||
const METRIC_WEBHOOK_ID_FAILED = '{webhookInternalId}.webhooks.events.failed';
|
||||
const METRIC_AUTH_METHOD_PHONE = 'auth.method.phone';
|
||||
const METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE = METRIC_AUTH_METHOD_PHONE . '.{countryCode}';
|
||||
const METRIC_MESSAGES = 'messages';
|
||||
const METRIC_MESSAGES_SENT = METRIC_MESSAGES . '.sent';
|
||||
const METRIC_MESSAGES_FAILED = METRIC_MESSAGES . '.failed';
|
||||
const METRIC_MESSAGES_TYPE = METRIC_MESSAGES . '.{type}';
|
||||
const METRIC_MESSAGES_TYPE_SENT = METRIC_MESSAGES . '.{type}.sent';
|
||||
const METRIC_MESSAGES_TYPE_FAILED = METRIC_MESSAGES . '.{type}.failed';
|
||||
const METRIC_MESSAGES_TYPE_PROVIDER = METRIC_MESSAGES . '.{type}.{provider}';
|
||||
const METRIC_MESSAGES_TYPE_PROVIDER_SENT = METRIC_MESSAGES . '.{type}.{provider}.sent';
|
||||
const METRIC_MESSAGES_TYPE_PROVIDER_FAILED = METRIC_MESSAGES . '.{type}.{provider}.failed';
|
||||
const METRIC_SESSIONS = 'sessions';
|
||||
const METRIC_DATABASES = 'databases';
|
||||
const METRIC_COLLECTIONS = 'collections';
|
||||
const METRIC_DATABASES_STORAGE = 'databases.storage';
|
||||
const METRIC_DATABASE_ID_COLLECTIONS = '{databaseInternalId}.collections';
|
||||
const METRIC_DATABASE_ID_STORAGE = '{databaseInternalId}.databases.storage';
|
||||
const METRIC_DOCUMENTS = 'documents';
|
||||
const METRIC_DATABASE_ID_DOCUMENTS = '{databaseInternalId}.documents';
|
||||
const METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS = '{databaseInternalId}.{collectionInternalId}.documents';
|
||||
const METRIC_DATABASE_ID_COLLECTION_ID_STORAGE = '{databaseInternalId}.{collectionInternalId}.databases.storage';
|
||||
const METRIC_DATABASES_OPERATIONS_READS = 'databases.operations.reads';
|
||||
const METRIC_DATABASE_ID_OPERATIONS_READS = '{databaseInternalId}.databases.operations.reads';
|
||||
const METRIC_DATABASES_OPERATIONS_WRITES = 'databases.operations.writes';
|
||||
const METRIC_DATABASE_ID_OPERATIONS_WRITES = '{databaseInternalId}.databases.operations.writes';
|
||||
const METRIC_BUCKETS = 'buckets';
|
||||
const METRIC_FILES = 'files';
|
||||
const METRIC_FILES_STORAGE = 'files.storage';
|
||||
const METRIC_FILES_TRANSFORMATIONS = 'files.transformations';
|
||||
const METRIC_BUCKET_ID_FILES_TRANSFORMATIONS = '{bucketInternalId}.files.transformations';
|
||||
const METRIC_FILES_IMAGES_TRANSFORMED = 'files.imagesTransformed';
|
||||
const METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED = '{bucketInternalId}.files.imagesTransformed';
|
||||
const METRIC_BUCKET_ID_FILES = '{bucketInternalId}.files';
|
||||
const METRIC_BUCKET_ID_FILES_STORAGE = '{bucketInternalId}.files.storage';
|
||||
const METRIC_FUNCTIONS = 'functions';
|
||||
const METRIC_DEPLOYMENTS = 'deployments';
|
||||
const METRIC_DEPLOYMENTS_STORAGE = 'deployments.storage';
|
||||
const METRIC_BUILDS = 'builds';
|
||||
const METRIC_BUILDS_SUCCESS = 'builds.success';
|
||||
const METRIC_BUILDS_FAILED = 'builds.failed';
|
||||
const METRIC_BUILDS_STORAGE = 'builds.storage';
|
||||
const METRIC_BUILDS_COMPUTE = 'builds.compute';
|
||||
const METRIC_BUILDS_COMPUTE_SUCCESS = 'builds.compute.success';
|
||||
const METRIC_BUILDS_COMPUTE_FAILED = 'builds.compute.failed';
|
||||
const METRIC_BUILDS_MB_SECONDS = 'builds.mbSeconds';
|
||||
const METRIC_FUNCTION_ID_BUILDS = '{functionInternalId}.builds';
|
||||
const METRIC_FUNCTION_ID_BUILDS_SUCCESS = '{functionInternalId}.builds.success';
|
||||
const METRIC_FUNCTION_ID_BUILDS_FAILED = '{functionInternalId}.builds.failed';
|
||||
const METRIC_FUNCTION_ID_BUILDS_STORAGE = '{functionInternalId}.builds.storage';
|
||||
const METRIC_FUNCTION_ID_BUILDS_COMPUTE = '{functionInternalId}.builds.compute';
|
||||
const METRIC_FUNCTION_ID_BUILDS_COMPUTE_SUCCESS = '{functionInternalId}.builds.compute.success';
|
||||
const METRIC_FUNCTION_ID_BUILDS_COMPUTE_FAILED = '{functionInternalId}.builds.compute.failed';
|
||||
const METRIC_FUNCTION_ID_DEPLOYMENTS = '{resourceType}.{resourceInternalId}.deployments';
|
||||
const METRIC_FUNCTION_ID_DEPLOYMENTS_STORAGE = '{resourceType}.{resourceInternalId}.deployments.storage';
|
||||
const METRIC_FUNCTION_ID_BUILDS_MB_SECONDS = '{functionInternalId}.builds.mbSeconds';
|
||||
const METRIC_EXECUTIONS = 'executions';
|
||||
const METRIC_EXECUTIONS_COMPUTE = 'executions.compute';
|
||||
const METRIC_EXECUTIONS_MB_SECONDS = 'executions.mbSeconds';
|
||||
const METRIC_FUNCTION_ID_EXECUTIONS = '{functionInternalId}.executions';
|
||||
const METRIC_FUNCTION_ID_EXECUTIONS_COMPUTE = '{functionInternalId}.executions.compute';
|
||||
const METRIC_FUNCTION_ID_EXECUTIONS_MB_SECONDS = '{functionInternalId}.executions.mbSeconds';
|
||||
const METRIC_NETWORK_REQUESTS = 'network.requests';
|
||||
const METRIC_NETWORK_INBOUND = 'network.inbound';
|
||||
const METRIC_NETWORK_OUTBOUND = 'network.outbound';
|
||||
const METRIC_MAU = 'users.mau';
|
||||
const METRIC_DAU = 'users.dau';
|
||||
const METRIC_WAU = 'users.wau';
|
||||
const METRIC_WEBHOOKS = 'webhooks';
|
||||
const METRIC_PLATFORMS = 'platforms';
|
||||
const METRIC_PROVIDERS = 'providers';
|
||||
const METRIC_TOPICS = 'topics';
|
||||
const METRIC_TARGETS = 'targets';
|
||||
const METRIC_PROVIDER_TYPE_TARGETS = '{providerType}.targets';
|
||||
const METRIC_KEYS = 'keys';
|
||||
const METRIC_DOMAINS = 'domains';
|
||||
const METRIC_RESOURCE_TYPE_ID_BUILDS = '{resourceType}.{resourceInternalId}.builds';
|
||||
const METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE = '{resourceType}.{resourceInternalId}.builds.storage';
|
||||
const METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS = '{resourceType}.{resourceInternalId}.deployments';
|
||||
const METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE = '{resourceType}.{resourceInternalId}.deployments.storage';
|
||||
|
||||
// Resource types
|
||||
|
||||
const RESOURCE_TYPE_PROJECTS = 'projects';
|
||||
const RESOURCE_TYPE_FUNCTIONS = 'functions';
|
||||
const RESOURCE_TYPE_DATABASES = 'databases';
|
||||
const RESOURCE_TYPE_BUCKETS = 'buckets';
|
||||
const RESOURCE_TYPE_PROVIDERS = 'providers';
|
||||
const RESOURCE_TYPE_TOPICS = 'topics';
|
||||
const RESOURCE_TYPE_SUBSCRIBERS = 'subscribers';
|
||||
const RESOURCE_TYPE_MESSAGES = 'messages';
|
||||
@@ -0,0 +1,404 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\System\System;
|
||||
|
||||
Database::addFilter(
|
||||
'casting',
|
||||
function (mixed $value) {
|
||||
return json_encode(['value' => $value], JSON_PRESERVE_ZERO_FRACTION);
|
||||
},
|
||||
function (mixed $value) {
|
||||
if (is_null($value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return json_decode($value, true)['value'];
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'enum',
|
||||
function (mixed $value, Document $attribute) {
|
||||
if ($attribute->isSet('elements')) {
|
||||
$attribute->removeAttribute('elements');
|
||||
}
|
||||
|
||||
return $value;
|
||||
},
|
||||
function (mixed $value, Document $attribute) {
|
||||
$formatOptions = \json_decode($attribute->getAttribute('formatOptions', '[]'), true);
|
||||
if (isset($formatOptions['elements'])) {
|
||||
$attribute->setAttribute('elements', $formatOptions['elements']);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'range',
|
||||
function (mixed $value, Document $attribute) {
|
||||
if ($attribute->isSet('min')) {
|
||||
$attribute->removeAttribute('min');
|
||||
}
|
||||
if ($attribute->isSet('max')) {
|
||||
$attribute->removeAttribute('max');
|
||||
}
|
||||
|
||||
return $value;
|
||||
},
|
||||
function (mixed $value, Document $attribute) {
|
||||
$formatOptions = json_decode($attribute->getAttribute('formatOptions', '[]'), true);
|
||||
if (isset($formatOptions['min']) || isset($formatOptions['max'])) {
|
||||
$attribute
|
||||
->setAttribute('min', $formatOptions['min'])
|
||||
->setAttribute('max', $formatOptions['max']);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryAttributes',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
$attributes = $database->find('attributes', [
|
||||
Query::equal('collectionInternalId', [$document->getInternalId()]),
|
||||
Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]),
|
||||
Query::limit($database->getLimitForAttributes()),
|
||||
]);
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
if ($attribute->getAttribute('type') === Database::VAR_RELATIONSHIP) {
|
||||
$options = $attribute->getAttribute('options');
|
||||
foreach ($options as $key => $value) {
|
||||
$attribute->setAttribute($key, $value);
|
||||
}
|
||||
$attribute->removeAttribute('options');
|
||||
}
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryIndexes',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return $database
|
||||
->find('indexes', [
|
||||
Query::equal('collectionInternalId', [$document->getInternalId()]),
|
||||
Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]),
|
||||
Query::limit($database->getLimitForIndexes()),
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryPlatforms',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return $database
|
||||
->find('platforms', [
|
||||
Query::equal('projectInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryKeys',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return $database
|
||||
->find('keys', [
|
||||
Query::equal('projectInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryWebhooks',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return $database
|
||||
->find('webhooks', [
|
||||
Query::equal('projectInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQuerySessions',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return Authorization::skip(fn () => $database->find('sessions', [
|
||||
Query::equal('userInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryTokens',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return Authorization::skip(fn () => $database
|
||||
->find('tokens', [
|
||||
Query::equal('userInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryChallenges',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return Authorization::skip(fn () => $database
|
||||
->find('challenges', [
|
||||
Query::equal('userInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryAuthenticators',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return Authorization::skip(fn () => $database
|
||||
->find('authenticators', [
|
||||
Query::equal('userInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryMemberships',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return Authorization::skip(fn () => $database
|
||||
->find('memberships', [
|
||||
Query::equal('userInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryVariables',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return $database
|
||||
->find('variables', [
|
||||
Query::equal('resourceInternalId', [$document->getInternalId()]),
|
||||
Query::equal('resourceType', ['function']),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'encrypt',
|
||||
function (mixed $value) {
|
||||
$key = System::getEnv('_APP_OPENSSL_KEY_V1');
|
||||
$iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
|
||||
$tag = null;
|
||||
|
||||
return json_encode([
|
||||
'data' => OpenSSL::encrypt($value, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
|
||||
'method' => OpenSSL::CIPHER_AES_128_GCM,
|
||||
'iv' => \bin2hex($iv),
|
||||
'tag' => \bin2hex($tag ?? ''),
|
||||
'version' => '1',
|
||||
]);
|
||||
},
|
||||
function (mixed $value) {
|
||||
if (is_null($value)) {
|
||||
return;
|
||||
}
|
||||
$value = json_decode($value, true);
|
||||
$key = System::getEnv('_APP_OPENSSL_KEY_V' . $value['version']);
|
||||
|
||||
return OpenSSL::decrypt($value['data'], $value['method'], $key, 0, hex2bin($value['iv']), hex2bin($value['tag']));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryProjectVariables',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return $database
|
||||
->find('variables', [
|
||||
Query::equal('resourceType', ['project']),
|
||||
Query::limit(APP_LIMIT_SUBQUERY)
|
||||
]);
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'userSearch',
|
||||
function (mixed $value, Document $user) {
|
||||
$searchValues = [
|
||||
$user->getId(),
|
||||
$user->getAttribute('email', ''),
|
||||
$user->getAttribute('name', ''),
|
||||
$user->getAttribute('phone', '')
|
||||
];
|
||||
|
||||
foreach ($user->getAttribute('labels', []) as $label) {
|
||||
$searchValues[] = 'label:' . $label;
|
||||
}
|
||||
|
||||
$search = implode(' ', \array_filter($searchValues));
|
||||
|
||||
return $search;
|
||||
},
|
||||
function (mixed $value) {
|
||||
return $value;
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryTargets',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
return Authorization::skip(fn () => $database
|
||||
->find('targets', [
|
||||
Query::equal('userInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBQUERY)
|
||||
]));
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'subQueryTopicTargets',
|
||||
function (mixed $value) {
|
||||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
$targetIds = Authorization::skip(fn () => \array_map(
|
||||
fn ($document) => $document->getAttribute('targetInternalId'),
|
||||
$database->find('subscribers', [
|
||||
Query::equal('topicInternalId', [$document->getInternalId()]),
|
||||
Query::limit(APP_LIMIT_SUBSCRIBERS_SUBQUERY)
|
||||
])
|
||||
));
|
||||
if (\count($targetIds) > 0) {
|
||||
return $database->skipValidation(fn () => $database->find('targets', [
|
||||
Query::equal('$internalId', $targetIds)
|
||||
]));
|
||||
}
|
||||
return [];
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'providerSearch',
|
||||
function (mixed $value, Document $provider) {
|
||||
$searchValues = [
|
||||
$provider->getId(),
|
||||
$provider->getAttribute('name', ''),
|
||||
$provider->getAttribute('provider', ''),
|
||||
$provider->getAttribute('type', '')
|
||||
];
|
||||
|
||||
$search = \implode(' ', \array_filter($searchValues));
|
||||
|
||||
return $search;
|
||||
},
|
||||
function (mixed $value) {
|
||||
return $value;
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'topicSearch',
|
||||
function (mixed $value, Document $topic) {
|
||||
$searchValues = [
|
||||
$topic->getId(),
|
||||
$topic->getAttribute('name', ''),
|
||||
$topic->getAttribute('description', ''),
|
||||
];
|
||||
|
||||
$search = \implode(' ', \array_filter($searchValues));
|
||||
|
||||
return $search;
|
||||
},
|
||||
function (mixed $value) {
|
||||
return $value;
|
||||
}
|
||||
);
|
||||
|
||||
Database::addFilter(
|
||||
'messageSearch',
|
||||
function (mixed $value, Document $message) {
|
||||
$searchValues = [
|
||||
$message->getId(),
|
||||
$message->getAttribute('description', ''),
|
||||
$message->getAttribute('status', ''),
|
||||
];
|
||||
|
||||
$data = \json_decode($message->getAttribute('data', []), true);
|
||||
$providerType = $message->getAttribute('providerType', '');
|
||||
|
||||
switch ($providerType) {
|
||||
case MESSAGE_TYPE_EMAIL:
|
||||
$searchValues[] = $data['subject'];
|
||||
$searchValues[] = MESSAGE_TYPE_EMAIL;
|
||||
break;
|
||||
case MESSAGE_TYPE_SMS:
|
||||
$searchValues[] = $data['content'];
|
||||
$searchValues[] = MESSAGE_TYPE_SMS;
|
||||
break;
|
||||
case MESSAGE_TYPE_PUSH:
|
||||
$searchValues[] = $data['title'] ?? '';
|
||||
$searchValues[] = MESSAGE_TYPE_PUSH;
|
||||
break;
|
||||
}
|
||||
|
||||
$search = \implode(' ', \array_filter($searchValues));
|
||||
|
||||
return $search;
|
||||
},
|
||||
function (mixed $value) {
|
||||
return $value;
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Network\Validator\Email;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Validator\Datetime as DatetimeValidator;
|
||||
use Utopia\Database\Validator\Structure;
|
||||
use Utopia\Validator\IP;
|
||||
use Utopia\Validator\Range;
|
||||
use Utopia\Validator\URL;
|
||||
use Utopia\Validator\WhiteList;
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_EMAIL, function () {
|
||||
return new Email();
|
||||
}, Database::VAR_STRING);
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_DATETIME, function () {
|
||||
return new DatetimeValidator();
|
||||
}, Database::VAR_DATETIME);
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_ENUM, function ($attribute) {
|
||||
$elements = $attribute['formatOptions']['elements'] ?? [];
|
||||
return new WhiteList($elements, true);
|
||||
}, Database::VAR_STRING);
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_IP, function () {
|
||||
return new IP();
|
||||
}, Database::VAR_STRING);
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_URL, function () {
|
||||
return new URL();
|
||||
}, Database::VAR_STRING);
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_INT_RANGE, function ($attribute) {
|
||||
$min = $attribute['formatOptions']['min'] ?? -INF;
|
||||
$max = $attribute['formatOptions']['max'] ?? INF;
|
||||
return new Range($min, $max, Range::TYPE_INTEGER);
|
||||
}, Database::VAR_INTEGER);
|
||||
|
||||
Structure::addFormat(APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, function ($attribute) {
|
||||
$min = $attribute['formatOptions']['min'] ?? -INF;
|
||||
$max = $attribute['formatOptions']['max'] ?? INF;
|
||||
return new Range($min, $max, Range::TYPE_FLOAT);
|
||||
}, Database::VAR_FLOAT);
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Locale\Locale;
|
||||
|
||||
Locale::$exceptions = false;
|
||||
|
||||
$locales = Config::getParam('locale-codes', []);
|
||||
|
||||
foreach ($locales as $locale) {
|
||||
$code = $locale['code'];
|
||||
|
||||
$path = __DIR__ . '/../config/locale/translations/' . $code . '.json';
|
||||
|
||||
if (!\file_exists($path)) {
|
||||
$path = __DIR__ . '/../config/locale/translations/' . \substr($code, 0, 2) . '.json'; // if `ar-ae` doesn't exist, look for `ar`
|
||||
if (!\file_exists($path)) {
|
||||
$path = __DIR__ . '/../config/locale/translations/en.json'; // if none translation exists, use default from `en.json`
|
||||
}
|
||||
}
|
||||
|
||||
Locale::setLanguageFromJSON($code, $path);
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\GraphQL\Promises\Adapter\Swoole;
|
||||
use Appwrite\Hooks\Hooks;
|
||||
use Appwrite\PubSub\Adapter\Redis as PubSub;
|
||||
use Appwrite\URL\URL as AppwriteURL;
|
||||
use MaxMind\Db\Reader;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use Swoole\Database\PDOProxy;
|
||||
use Utopia\App;
|
||||
use Utopia\Cache\Adapter\Redis as RedisCache;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Database\Adapter\MariaDB;
|
||||
use Utopia\Database\Adapter\MySQL;
|
||||
use Utopia\Database\Adapter\SQL;
|
||||
use Utopia\Domains\Validator\PublicDomain;
|
||||
use Utopia\DSN\DSN;
|
||||
use Utopia\Logger\Adapter\AppSignal;
|
||||
use Utopia\Logger\Adapter\LogOwl;
|
||||
use Utopia\Logger\Adapter\Raygun;
|
||||
use Utopia\Logger\Adapter\Sentry;
|
||||
use Utopia\Logger\Logger;
|
||||
use Utopia\Pools\Group;
|
||||
use Utopia\Pools\Pool;
|
||||
use Utopia\Queue;
|
||||
use Utopia\Registry\Registry;
|
||||
use Utopia\System\System;
|
||||
|
||||
$register = new Registry();
|
||||
|
||||
App::setMode(System::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION));
|
||||
|
||||
if (!App::isProduction()) {
|
||||
// Allow specific domains to skip public domain validation in dev environment
|
||||
// Useful for existing tests involving webhooks
|
||||
PublicDomain::allow(['request-catcher']);
|
||||
}
|
||||
$register->set('logger', function () {
|
||||
// Register error logger
|
||||
$providerName = System::getEnv('_APP_LOGGING_PROVIDER', '');
|
||||
$providerConfig = System::getEnv('_APP_LOGGING_CONFIG', '');
|
||||
|
||||
if (empty($providerConfig)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$loggingProvider = new DSN($providerConfig ?? '');
|
||||
|
||||
$providerName = $loggingProvider->getScheme();
|
||||
$providerConfig = match ($providerName) {
|
||||
'sentry' => ['key' => $loggingProvider->getPassword(), 'projectId' => $loggingProvider->getUser() ?? '', 'host' => 'https://' . $loggingProvider->getHost()],
|
||||
'logowl' => ['ticket' => $loggingProvider->getUser() ?? '', 'host' => $loggingProvider->getHost()],
|
||||
default => ['key' => $loggingProvider->getHost()],
|
||||
};
|
||||
} catch (Throwable $th) {
|
||||
// Fallback for older Appwrite versions up to 1.5.x that use _APP_LOGGING_PROVIDER and _APP_LOGGING_CONFIG environment variables
|
||||
Console::warning('Using deprecated logging configuration. Please update your configuration to use DSN format.' . $th->getMessage());
|
||||
$configChunks = \explode(";", $providerConfig);
|
||||
|
||||
$providerConfig = match ($providerName) {
|
||||
'sentry' => [ 'key' => $configChunks[0], 'projectId' => $configChunks[1] ?? '', 'host' => '',],
|
||||
'logowl' => ['ticket' => $configChunks[0] ?? '', 'host' => ''],
|
||||
default => ['key' => $providerConfig],
|
||||
};
|
||||
}
|
||||
|
||||
if (empty($providerName) || empty($providerConfig)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Logger::hasProvider($providerName)) {
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, "Logging provider not supported. Logging is disabled");
|
||||
}
|
||||
|
||||
try {
|
||||
$adapter = match ($providerName) {
|
||||
'sentry' => new Sentry($providerConfig['projectId'], $providerConfig['key'], $providerConfig['host']),
|
||||
'logowl' => new LogOwl($providerConfig['ticket'], $providerConfig['host']),
|
||||
'raygun' => new Raygun($providerConfig['key']),
|
||||
'appsignal' => new AppSignal($providerConfig['key']),
|
||||
default => null
|
||||
};
|
||||
} catch (Throwable $th) {
|
||||
$adapter = null;
|
||||
}
|
||||
|
||||
if ($adapter === null) {
|
||||
Console::error("Logging provider not supported. Logging is disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
return new Logger($adapter);
|
||||
});
|
||||
|
||||
$register->set('pools', function () {
|
||||
$group = new Group();
|
||||
|
||||
$fallbackForDB = 'db_main=' . AppwriteURL::unparse([
|
||||
'scheme' => 'mariadb',
|
||||
'host' => System::getEnv('_APP_DB_HOST', 'mariadb'),
|
||||
'port' => System::getEnv('_APP_DB_PORT', '3306'),
|
||||
'user' => System::getEnv('_APP_DB_USER', ''),
|
||||
'pass' => System::getEnv('_APP_DB_PASS', ''),
|
||||
'path' => System::getEnv('_APP_DB_SCHEMA', ''),
|
||||
]);
|
||||
$fallbackForRedis = 'redis_main=' . AppwriteURL::unparse([
|
||||
'scheme' => 'redis',
|
||||
'host' => System::getEnv('_APP_REDIS_HOST', 'redis'),
|
||||
'port' => System::getEnv('_APP_REDIS_PORT', '6379'),
|
||||
'user' => System::getEnv('_APP_REDIS_USER', ''),
|
||||
'pass' => System::getEnv('_APP_REDIS_PASS', ''),
|
||||
]);
|
||||
|
||||
$connections = [
|
||||
'console' => [
|
||||
'type' => 'database',
|
||||
'dsns' => $fallbackForDB,
|
||||
'multiple' => false,
|
||||
'schemes' => ['mariadb', 'mysql'],
|
||||
],
|
||||
'database' => [
|
||||
'type' => 'database',
|
||||
'dsns' => $fallbackForDB,
|
||||
'multiple' => true,
|
||||
'schemes' => ['mariadb', 'mysql'],
|
||||
],
|
||||
'logs' => [
|
||||
'type' => 'database',
|
||||
'dsns' => System::getEnv('_APP_CONNECTIONS_DB_LOGS', $fallbackForDB),
|
||||
'multiple' => false,
|
||||
'schemes' => ['mariadb', 'mysql'],
|
||||
],
|
||||
'publisher' => [
|
||||
'type' => 'publisher',
|
||||
'dsns' => $fallbackForRedis,
|
||||
'multiple' => false,
|
||||
'schemes' => ['redis'],
|
||||
],
|
||||
'consumer' => [
|
||||
'type' => 'consumer',
|
||||
'dsns' => $fallbackForRedis,
|
||||
'multiple' => false,
|
||||
'schemes' => ['redis'],
|
||||
],
|
||||
'pubsub' => [
|
||||
'type' => 'pubsub',
|
||||
'dsns' => $fallbackForRedis,
|
||||
'multiple' => false,
|
||||
'schemes' => ['redis'],
|
||||
],
|
||||
'cache' => [
|
||||
'type' => 'cache',
|
||||
'dsns' => $fallbackForRedis,
|
||||
'multiple' => true,
|
||||
'schemes' => ['redis'],
|
||||
],
|
||||
];
|
||||
|
||||
$maxConnections = System::getEnv('_APP_CONNECTIONS_MAX', 151);
|
||||
$instanceConnections = $maxConnections / System::getEnv('_APP_POOL_CLIENTS', 14);
|
||||
|
||||
$multiprocessing = System::getEnv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled';
|
||||
|
||||
if ($multiprocessing) {
|
||||
$workerCount = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6));
|
||||
} else {
|
||||
$workerCount = 1;
|
||||
}
|
||||
|
||||
if ($workerCount > $instanceConnections) {
|
||||
throw new \Exception('Pool size is too small. Increase the number of allowed database connections or decrease the number of workers.', 500);
|
||||
}
|
||||
|
||||
$poolSize = (int)($instanceConnections / $workerCount);
|
||||
|
||||
foreach ($connections as $key => $connection) {
|
||||
$type = $connection['type'] ?? '';
|
||||
$multiple = $connection['multiple'] ?? false;
|
||||
$schemes = $connection['schemes'] ?? [];
|
||||
$config = [];
|
||||
$dsns = explode(',', $connection['dsns'] ?? '');
|
||||
foreach ($dsns as &$dsn) {
|
||||
$dsn = explode('=', $dsn);
|
||||
$name = ($multiple) ? $key . '_' . $dsn[0] : $key;
|
||||
$dsn = $dsn[1] ?? '';
|
||||
$config[] = $name;
|
||||
if (empty($dsn)) {
|
||||
//throw new Exception(Exception::GENERAL_SERVER_ERROR, "Missing value for DSN connection in {$key}");
|
||||
continue;
|
||||
}
|
||||
|
||||
$dsn = new DSN($dsn);
|
||||
$dsnHost = $dsn->getHost();
|
||||
$dsnPort = $dsn->getPort();
|
||||
$dsnUser = $dsn->getUser();
|
||||
$dsnPass = $dsn->getPassword();
|
||||
$dsnScheme = $dsn->getScheme();
|
||||
$dsnDatabase = $dsn->getPath();
|
||||
|
||||
if (!in_array($dsnScheme, $schemes)) {
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, "Invalid console database scheme");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Resource
|
||||
*
|
||||
* Creation could be reused across connection types like database, cache, queue, etc.
|
||||
*
|
||||
* Resource assignment to an adapter will happen below.
|
||||
*/
|
||||
$resource = match ($dsnScheme) {
|
||||
'mysql',
|
||||
'mariadb' => function () use ($dsnHost, $dsnPort, $dsnUser, $dsnPass, $dsnDatabase) {
|
||||
return new PDOProxy(function () use ($dsnHost, $dsnPort, $dsnUser, $dsnPass, $dsnDatabase) {
|
||||
return new PDO("mysql:host={$dsnHost};port={$dsnPort};dbname={$dsnDatabase};charset=utf8mb4", $dsnUser, $dsnPass, array(
|
||||
PDO::ATTR_TIMEOUT => 3, // Seconds
|
||||
PDO::ATTR_PERSISTENT => false,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_EMULATE_PREPARES => true,
|
||||
PDO::ATTR_STRINGIFY_FETCHES => true
|
||||
));
|
||||
});
|
||||
},
|
||||
'redis' => function () use ($dsnHost, $dsnPort, $dsnPass) {
|
||||
$redis = new \Redis();
|
||||
@$redis->pconnect($dsnHost, (int)$dsnPort);
|
||||
if ($dsnPass) {
|
||||
$redis->auth($dsnPass);
|
||||
}
|
||||
$redis->setOption(\Redis::OPT_READ_TIMEOUT, -1);
|
||||
|
||||
return $redis;
|
||||
},
|
||||
default => throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Invalid scheme'),
|
||||
};
|
||||
|
||||
$pool = new Pool($name, $poolSize, function () use ($type, $resource, $dsn) {
|
||||
// Get Adapter
|
||||
switch ($type) {
|
||||
case 'database':
|
||||
$adapter = match ($dsn->getScheme()) {
|
||||
'mariadb' => new MariaDB($resource()),
|
||||
'mysql' => new MySQL($resource()),
|
||||
default => null
|
||||
};
|
||||
|
||||
$adapter->setDatabase($dsn->getPath());
|
||||
return $adapter;
|
||||
case 'pubsub':
|
||||
return match ($dsn->getScheme()) {
|
||||
'redis' => new PubSub($resource()),
|
||||
default => null
|
||||
};
|
||||
case 'publisher':
|
||||
case 'consumer':
|
||||
return match ($dsn->getScheme()) {
|
||||
'redis' => new Queue\Broker\Redis(new Queue\Connection\Redis($dsn->getHost(), $dsn->getPort())),
|
||||
default => null
|
||||
};
|
||||
case 'cache':
|
||||
return match ($dsn->getScheme()) {
|
||||
'redis' => new RedisCache($resource()),
|
||||
default => null
|
||||
};
|
||||
default:
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, "Server error: Missing adapter implementation.");
|
||||
}
|
||||
});
|
||||
|
||||
$group->add($pool);
|
||||
}
|
||||
|
||||
Config::setParam('pools-' . $key, $config);
|
||||
}
|
||||
|
||||
return $group;
|
||||
});
|
||||
|
||||
$register->set('db', function () {
|
||||
// This is usually for our workers or CLI commands scope
|
||||
$dbHost = System::getEnv('_APP_DB_HOST', '');
|
||||
$dbPort = System::getEnv('_APP_DB_PORT', '');
|
||||
$dbUser = System::getEnv('_APP_DB_USER', '');
|
||||
$dbPass = System::getEnv('_APP_DB_PASS', '');
|
||||
$dbScheme = System::getEnv('_APP_DB_SCHEMA', '');
|
||||
|
||||
return new PDO(
|
||||
"mysql:host={$dbHost};port={$dbPort};dbname={$dbScheme};charset=utf8mb4",
|
||||
$dbUser,
|
||||
$dbPass,
|
||||
SQL::getPDOAttributes()
|
||||
);
|
||||
});
|
||||
|
||||
$register->set('smtp', function () {
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
$mail->isSMTP();
|
||||
|
||||
$username = System::getEnv('_APP_SMTP_USERNAME');
|
||||
$password = System::getEnv('_APP_SMTP_PASSWORD');
|
||||
|
||||
$mail->XMailer = 'Appwrite Mailer';
|
||||
$mail->Host = System::getEnv('_APP_SMTP_HOST', 'smtp');
|
||||
$mail->Port = System::getEnv('_APP_SMTP_PORT', 25);
|
||||
$mail->SMTPAuth = !empty($username) && !empty($password);
|
||||
$mail->Username = $username;
|
||||
$mail->Password = $password;
|
||||
$mail->SMTPSecure = System::getEnv('_APP_SMTP_SECURE', '');
|
||||
$mail->SMTPAutoTLS = false;
|
||||
$mail->CharSet = 'UTF-8';
|
||||
|
||||
$from = \urldecode(System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'));
|
||||
$email = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM);
|
||||
|
||||
$mail->setFrom($email, $from);
|
||||
$mail->addReplyTo($email, $from);
|
||||
|
||||
$mail->isHTML(true);
|
||||
|
||||
return $mail;
|
||||
});
|
||||
$register->set('geodb', function () {
|
||||
return new Reader(__DIR__ . '/../assets/dbip/dbip-country-lite-2024-09.mmdb');
|
||||
});
|
||||
$register->set('passwordsDictionary', function () {
|
||||
$content = \file_get_contents(__DIR__ . '/../assets/security/10k-common-passwords');
|
||||
$content = explode("\n", $content);
|
||||
$content = array_flip($content);
|
||||
return $content;
|
||||
});
|
||||
$register->set('promiseAdapter', function () {
|
||||
return new Swoole();
|
||||
});
|
||||
$register->set('hooks', function () {
|
||||
return new Hooks();
|
||||
});
|
||||
@@ -0,0 +1,845 @@
|
||||
<?php
|
||||
|
||||
use Ahc\Jwt\JWT;
|
||||
use Ahc\Jwt\JWTException;
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Auth\Key;
|
||||
use Appwrite\Event\Audit;
|
||||
use Appwrite\Event\Build;
|
||||
use Appwrite\Event\Certificate;
|
||||
use Appwrite\Event\Database as EventDatabase;
|
||||
use Appwrite\Event\Delete;
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Event\Func;
|
||||
use Appwrite\Event\Mail;
|
||||
use Appwrite\Event\Messaging;
|
||||
use Appwrite\Event\Migration;
|
||||
use Appwrite\Event\Realtime;
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Event\Webhook;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\GraphQL\Schema;
|
||||
use Appwrite\Network\Validator\Origin;
|
||||
use Appwrite\Utopia\Request;
|
||||
use Executor\Executor;
|
||||
use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis;
|
||||
use Utopia\App;
|
||||
use Utopia\Cache\Adapter\Sharding;
|
||||
use Utopia\Cache\Cache;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\DSN\DSN;
|
||||
use Utopia\Locale\Locale;
|
||||
use Utopia\Logger\Log;
|
||||
use Utopia\Pools\Group;
|
||||
use Utopia\Queue\Publisher;
|
||||
use Utopia\Storage\Device;
|
||||
use Utopia\Storage\Device\AWS;
|
||||
use Utopia\Storage\Device\Backblaze;
|
||||
use Utopia\Storage\Device\DOSpaces;
|
||||
use Utopia\Storage\Device\Linode;
|
||||
use Utopia\Storage\Device\Local;
|
||||
use Utopia\Storage\Device\S3;
|
||||
use Utopia\Storage\Device\Wasabi;
|
||||
use Utopia\Storage\Storage;
|
||||
use Utopia\System\System;
|
||||
use Utopia\Telemetry\Adapter as Telemetry;
|
||||
use Utopia\Telemetry\Adapter\None as NoTelemetry;
|
||||
use Utopia\Validator\Hostname;
|
||||
use Utopia\VCS\Adapter\Git\GitHub as VcsGitHub;
|
||||
|
||||
// Runtime Execution
|
||||
App::setResource('log', fn () => new Log());
|
||||
App::setResource('logger', function ($register) {
|
||||
return $register->get('logger');
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('hooks', function ($register) {
|
||||
return $register->get('hooks');
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('register', fn () => $register);
|
||||
App::setResource('locale', fn () => new Locale(System::getEnv('_APP_LOCALE', 'en')));
|
||||
|
||||
App::setResource('localeCodes', function () {
|
||||
return array_map(fn ($locale) => $locale['code'], Config::getParam('locale-codes', []));
|
||||
});
|
||||
|
||||
// Queues
|
||||
App::setResource('publisher', function (Group $pools) {
|
||||
return $pools->get('publisher')->pop()->getResource();
|
||||
}, ['pools']);
|
||||
App::setResource('consumer', function (Group $pools) {
|
||||
return $pools->get('consumer')->pop()->getResource();
|
||||
}, ['pools']);
|
||||
App::setResource('queueForMessaging', function (Publisher $publisher) {
|
||||
return new Messaging($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForMails', function (Publisher $publisher) {
|
||||
return new Mail($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForBuilds', function (Publisher $publisher) {
|
||||
return new Build($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForDatabase', function (Publisher $publisher) {
|
||||
return new EventDatabase($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForDeletes', function (Publisher $publisher) {
|
||||
return new Delete($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForEvents', function (Publisher $publisher) {
|
||||
return new Event($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForWebhooks', function (Publisher $publisher) {
|
||||
return new Webhook($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForRealtime', function () {
|
||||
return new Realtime();
|
||||
}, []);
|
||||
App::setResource('queueForStatsUsage', function (Publisher $publisher) {
|
||||
return new StatsUsage($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForAudits', function (Publisher $publisher) {
|
||||
return new Audit($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForFunctions', function (Publisher $publisher) {
|
||||
return new Func($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForCertificates', function (Publisher $publisher) {
|
||||
return new Certificate($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForMigrations', function (Publisher $publisher) {
|
||||
return new Migration($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('clients', function ($request, $console, $project) {
|
||||
$console->setAttribute('platforms', [ // Always allow current host
|
||||
'$collection' => ID::custom('platforms'),
|
||||
'name' => 'Current Host',
|
||||
'type' => Origin::CLIENT_TYPE_WEB,
|
||||
'hostname' => $request->getHostname(),
|
||||
], Document::SET_TYPE_APPEND);
|
||||
|
||||
$hostnames = explode(',', System::getEnv('_APP_CONSOLE_HOSTNAMES', ''));
|
||||
$validator = new Hostname();
|
||||
foreach ($hostnames as $hostname) {
|
||||
$hostname = trim($hostname);
|
||||
if (!$validator->isValid($hostname)) {
|
||||
continue;
|
||||
}
|
||||
$console->setAttribute('platforms', [
|
||||
'$collection' => ID::custom('platforms'),
|
||||
'type' => Origin::CLIENT_TYPE_WEB,
|
||||
'name' => $hostname,
|
||||
'hostname' => $hostname,
|
||||
], Document::SET_TYPE_APPEND);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get All verified client URLs for both console and current projects
|
||||
* + Filter for duplicated entries
|
||||
*/
|
||||
$clientsConsole = \array_map(
|
||||
fn ($node) => $node['hostname'],
|
||||
\array_filter(
|
||||
$console->getAttribute('platforms', []),
|
||||
fn ($node) => (isset($node['type']) && ($node['type'] === Origin::CLIENT_TYPE_WEB) && !empty($node['hostname']))
|
||||
)
|
||||
);
|
||||
|
||||
$clients = $clientsConsole;
|
||||
$platforms = $project->getAttribute('platforms', []);
|
||||
|
||||
foreach ($platforms as $node) {
|
||||
if (
|
||||
isset($node['type']) &&
|
||||
($node['type'] === Origin::CLIENT_TYPE_WEB ||
|
||||
$node['type'] === Origin::CLIENT_TYPE_FLUTTER_WEB) &&
|
||||
!empty($node['hostname'])
|
||||
) {
|
||||
$clients[] = $node['hostname'];
|
||||
}
|
||||
}
|
||||
|
||||
return \array_unique($clients);
|
||||
}, ['request', 'console', 'project']);
|
||||
|
||||
App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForPlatform) {
|
||||
/** @var Appwrite\Utopia\Request $request */
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Utopia\Database\Document $project */
|
||||
/** @var Utopia\Database\Database $dbForProject */
|
||||
/** @var Utopia\Database\Database $dbForPlatform */
|
||||
/** @var string $mode */
|
||||
|
||||
Authorization::setDefaultStatus(true);
|
||||
|
||||
Auth::setCookieName('a_session_' . $project->getId());
|
||||
|
||||
if (APP_MODE_ADMIN === $mode) {
|
||||
Auth::setCookieName('a_session_' . $console->getId());
|
||||
}
|
||||
|
||||
$session = Auth::decodeSession(
|
||||
$request->getCookie(
|
||||
Auth::$cookieName, // Get sessions
|
||||
$request->getCookie(Auth::$cookieName . '_legacy', '')
|
||||
)
|
||||
);
|
||||
|
||||
// Get session from header for SSR clients
|
||||
if (empty($session['id']) && empty($session['secret'])) {
|
||||
$sessionHeader = $request->getHeader('x-appwrite-session', '');
|
||||
|
||||
if (!empty($sessionHeader)) {
|
||||
$session = Auth::decodeSession($sessionHeader);
|
||||
}
|
||||
}
|
||||
|
||||
// Get fallback session from old clients (no SameSite support) or clients who block 3rd-party cookies
|
||||
if ($response) {
|
||||
$response->addHeader('X-Debug-Fallback', 'false');
|
||||
}
|
||||
|
||||
if (empty($session['id']) && empty($session['secret'])) {
|
||||
if ($response) {
|
||||
$response->addHeader('X-Debug-Fallback', 'true');
|
||||
}
|
||||
$fallback = $request->getHeader('x-fallback-cookies', '');
|
||||
$fallback = \json_decode($fallback, true);
|
||||
$session = Auth::decodeSession(((isset($fallback[Auth::$cookieName])) ? $fallback[Auth::$cookieName] : ''));
|
||||
}
|
||||
|
||||
Auth::$unique = $session['id'] ?? '';
|
||||
Auth::$secret = $session['secret'] ?? '';
|
||||
|
||||
if (APP_MODE_ADMIN !== $mode) {
|
||||
if ($project->isEmpty()) {
|
||||
$user = new Document([]);
|
||||
} else {
|
||||
if ($project->getId() === 'console') {
|
||||
$user = $dbForPlatform->getDocument('users', Auth::$unique);
|
||||
} else {
|
||||
$user = $dbForProject->getDocument('users', Auth::$unique);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$user = $dbForPlatform->getDocument('users', Auth::$unique);
|
||||
}
|
||||
|
||||
if (
|
||||
$user->isEmpty() // Check a document has been found in the DB
|
||||
|| !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret)
|
||||
) { // Validate user has valid login token
|
||||
$user = new Document([]);
|
||||
}
|
||||
|
||||
// if (APP_MODE_ADMIN === $mode) {
|
||||
// if ($user->find('teamInternalId', $project->getAttribute('teamInternalId'), 'memberships')) {
|
||||
// Authorization::setDefaultStatus(false); // Cancel security segmentation for admin users.
|
||||
// } else {
|
||||
// $user = new Document([]);
|
||||
// }
|
||||
// }
|
||||
|
||||
$authJWT = $request->getHeader('x-appwrite-jwt', '');
|
||||
|
||||
if (!empty($authJWT) && !$project->isEmpty()) { // JWT authentication
|
||||
$jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 0);
|
||||
|
||||
try {
|
||||
$payload = $jwt->decode($authJWT);
|
||||
} catch (JWTException $error) {
|
||||
throw new Exception(Exception::USER_JWT_INVALID, 'Failed to verify JWT. ' . $error->getMessage());
|
||||
}
|
||||
|
||||
$jwtUserId = $payload['userId'] ?? '';
|
||||
if (!empty($jwtUserId)) {
|
||||
$user = $dbForProject->getDocument('users', $jwtUserId);
|
||||
}
|
||||
|
||||
$jwtSessionId = $payload['sessionId'] ?? '';
|
||||
if (!empty($jwtSessionId)) {
|
||||
if (empty($user->find('$id', $jwtSessionId, 'sessions'))) { // Match JWT to active token
|
||||
$user = new Document([]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dbForProject->setMetadata('user', $user->getId());
|
||||
$dbForPlatform->setMetadata('user', $user->getId());
|
||||
|
||||
return $user;
|
||||
}, ['mode', 'project', 'console', 'request', 'response', 'dbForProject', 'dbForPlatform']);
|
||||
|
||||
App::setResource('project', function ($dbForPlatform, $request, $console) {
|
||||
/** @var Appwrite\Utopia\Request $request */
|
||||
/** @var Utopia\Database\Database $dbForPlatform */
|
||||
/** @var Utopia\Database\Document $console */
|
||||
|
||||
$projectId = $request->getParam('project', $request->getHeader('x-appwrite-project', ''));
|
||||
|
||||
if (empty($projectId) || $projectId === 'console') {
|
||||
return $console;
|
||||
}
|
||||
|
||||
$project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId));
|
||||
|
||||
return $project;
|
||||
}, ['dbForPlatform', 'request', 'console']);
|
||||
|
||||
App::setResource('session', function (Document $user) {
|
||||
if ($user->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sessions = $user->getAttribute('sessions', []);
|
||||
$sessionId = Auth::sessionVerify($user->getAttribute('sessions'), Auth::$secret);
|
||||
|
||||
if (!$sessionId) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($sessions as $session) {/** @var Document $session */
|
||||
if ($sessionId === $session->getId()) {
|
||||
return $session;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}, ['user']);
|
||||
|
||||
App::setResource('console', function () {
|
||||
return new Document(Config::getParam('console'));
|
||||
}, []);
|
||||
|
||||
App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform, Cache $cache, Document $project) {
|
||||
if ($project->isEmpty() || $project->getId() === 'console') {
|
||||
return $dbForPlatform;
|
||||
}
|
||||
|
||||
try {
|
||||
$dsn = new DSN($project->getAttribute('database'));
|
||||
} catch (\InvalidArgumentException) {
|
||||
// TODO: Temporary until all projects are using shared tables
|
||||
$dsn = new DSN('mysql://' . $project->getAttribute('database'));
|
||||
}
|
||||
|
||||
$dbAdapter = $pools
|
||||
->get($dsn->getHost())
|
||||
->pop()
|
||||
->getResource();
|
||||
|
||||
$database = new Database($dbAdapter, $cache);
|
||||
|
||||
$database
|
||||
->setMetadata('host', \gethostname())
|
||||
->setMetadata('project', $project->getId())
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API)
|
||||
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
|
||||
|
||||
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
|
||||
|
||||
if (\in_array($dsn->getHost(), $sharedTables)) {
|
||||
$database
|
||||
->setSharedTables(true)
|
||||
->setTenant($project->getInternalId())
|
||||
->setNamespace($dsn->getParam('namespace'));
|
||||
} else {
|
||||
$database
|
||||
->setSharedTables(false)
|
||||
->setTenant(null)
|
||||
->setNamespace('_' . $project->getInternalId());
|
||||
}
|
||||
|
||||
return $database;
|
||||
}, ['pools', 'dbForPlatform', 'cache', 'project']);
|
||||
|
||||
App::setResource('dbForPlatform', function (Group $pools, Cache $cache) {
|
||||
$dbAdapter = $pools
|
||||
->get('console')
|
||||
->pop()
|
||||
->getResource();
|
||||
|
||||
$database = new Database($dbAdapter, $cache);
|
||||
|
||||
$database
|
||||
->setNamespace('_console')
|
||||
->setMetadata('host', \gethostname())
|
||||
->setMetadata('project', 'console')
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API)
|
||||
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
|
||||
|
||||
return $database;
|
||||
}, ['pools', 'cache']);
|
||||
|
||||
App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) {
|
||||
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
|
||||
|
||||
return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) {
|
||||
if ($project->isEmpty() || $project->getId() === 'console') {
|
||||
return $dbForPlatform;
|
||||
}
|
||||
|
||||
try {
|
||||
$dsn = new DSN($project->getAttribute('database'));
|
||||
} catch (\InvalidArgumentException) {
|
||||
// TODO: Temporary until all projects are using shared tables
|
||||
$dsn = new DSN('mysql://' . $project->getAttribute('database'));
|
||||
}
|
||||
|
||||
$configure = (function (Database $database) use ($project, $dsn) {
|
||||
$database
|
||||
->setMetadata('host', \gethostname())
|
||||
->setMetadata('project', $project->getId())
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API)
|
||||
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
|
||||
|
||||
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
|
||||
|
||||
if (\in_array($dsn->getHost(), $sharedTables)) {
|
||||
$database
|
||||
->setSharedTables(true)
|
||||
->setTenant($project->getInternalId())
|
||||
->setNamespace($dsn->getParam('namespace'));
|
||||
} else {
|
||||
$database
|
||||
->setSharedTables(false)
|
||||
->setTenant(null)
|
||||
->setNamespace('_' . $project->getInternalId());
|
||||
}
|
||||
});
|
||||
|
||||
if (isset($databases[$dsn->getHost()])) {
|
||||
$database = $databases[$dsn->getHost()];
|
||||
$configure($database);
|
||||
return $database;
|
||||
}
|
||||
|
||||
$dbAdapter = $pools
|
||||
->get($dsn->getHost())
|
||||
->pop()
|
||||
->getResource();
|
||||
|
||||
$database = new Database($dbAdapter, $cache);
|
||||
$databases[$dsn->getHost()] = $database;
|
||||
$configure($database);
|
||||
|
||||
return $database;
|
||||
};
|
||||
}, ['pools', 'dbForPlatform', 'cache']);
|
||||
|
||||
App::setResource('getLogsDB', function (Group $pools, Cache $cache) {
|
||||
$database = null;
|
||||
return function (?Document $project = null) use ($pools, $cache, $database) {
|
||||
if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') {
|
||||
$database->setTenant($project->getInternalId());
|
||||
return $database;
|
||||
}
|
||||
|
||||
$dbAdapter = $pools
|
||||
->get('logs')
|
||||
->pop()
|
||||
->getResource();
|
||||
|
||||
$database = new Database(
|
||||
$dbAdapter,
|
||||
$cache
|
||||
);
|
||||
|
||||
$database
|
||||
->setSharedTables(true)
|
||||
->setNamespace('logsV1')
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API)
|
||||
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
|
||||
|
||||
// set tenant
|
||||
if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') {
|
||||
$database->setTenant($project->getInternalId());
|
||||
}
|
||||
|
||||
return $database;
|
||||
};
|
||||
}, ['pools', 'cache']);
|
||||
|
||||
App::setResource('telemetry', fn () => new NoTelemetry());
|
||||
|
||||
App::setResource('cache', function (Group $pools, Telemetry $telemetry) {
|
||||
$list = Config::getParam('pools-cache', []);
|
||||
$adapters = [];
|
||||
|
||||
foreach ($list as $value) {
|
||||
$adapters[] = $pools
|
||||
->get($value)
|
||||
->pop()
|
||||
->getResource();
|
||||
}
|
||||
|
||||
$cache = new Cache(new Sharding($adapters));
|
||||
|
||||
$cache->setTelemetry($telemetry);
|
||||
|
||||
return $cache;
|
||||
}, ['pools', 'telemetry']);
|
||||
|
||||
App::setResource('redis', function () {
|
||||
$host = System::getEnv('_APP_REDIS_HOST', 'localhost');
|
||||
$port = System::getEnv('_APP_REDIS_PORT', 6379);
|
||||
$pass = System::getEnv('_APP_REDIS_PASS', '');
|
||||
|
||||
$redis = new \Redis();
|
||||
@$redis->pconnect($host, (int)$port);
|
||||
if ($pass) {
|
||||
$redis->auth($pass);
|
||||
}
|
||||
$redis->setOption(\Redis::OPT_READ_TIMEOUT, -1);
|
||||
|
||||
return $redis;
|
||||
});
|
||||
|
||||
App::setResource('timelimit', function (\Redis $redis) {
|
||||
return function (string $key, int $limit, int $time) use ($redis) {
|
||||
return new TimeLimitRedis($key, $limit, $time, $redis);
|
||||
};
|
||||
}, ['redis']);
|
||||
|
||||
App::setResource('deviceForLocal', function () {
|
||||
return new Local();
|
||||
});
|
||||
|
||||
App::setResource('deviceForFiles', function ($project) {
|
||||
return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
App::setResource('deviceForFunctions', function ($project) {
|
||||
return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
App::setResource('deviceForBuilds', function ($project) {
|
||||
return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
function getDevice(string $root, string $connection = ''): Device
|
||||
{
|
||||
$connection = !empty($connection) ? $connection : System::getEnv('_APP_CONNECTIONS_STORAGE', '');
|
||||
|
||||
if (!empty($connection)) {
|
||||
$acl = 'private';
|
||||
$device = Storage::DEVICE_LOCAL;
|
||||
$accessKey = '';
|
||||
$accessSecret = '';
|
||||
$bucket = '';
|
||||
$region = '';
|
||||
$url = System::getEnv('_APP_STORAGE_S3_ENDPOINT', '');
|
||||
|
||||
try {
|
||||
$dsn = new DSN($connection);
|
||||
$device = $dsn->getScheme();
|
||||
$accessKey = $dsn->getUser() ?? '';
|
||||
$accessSecret = $dsn->getPassword() ?? '';
|
||||
$bucket = $dsn->getPath() ?? '';
|
||||
$region = $dsn->getParam('region');
|
||||
} catch (\Throwable $e) {
|
||||
Console::warning($e->getMessage() . 'Invalid DSN. Defaulting to Local device.');
|
||||
}
|
||||
|
||||
switch ($device) {
|
||||
case Storage::DEVICE_S3:
|
||||
if (!empty($url)) {
|
||||
return new S3($root, $accessKey, $accessSecret, $url, $region, $acl);
|
||||
} else {
|
||||
return new AWS($root, $accessKey, $accessSecret, $bucket, $region, $acl);
|
||||
}
|
||||
// no break
|
||||
case STORAGE::DEVICE_DO_SPACES:
|
||||
$device = new DOSpaces($root, $accessKey, $accessSecret, $bucket, $region, $acl);
|
||||
$device->setHttpVersion(S3::HTTP_VERSION_1_1);
|
||||
return $device;
|
||||
case Storage::DEVICE_BACKBLAZE:
|
||||
return new Backblaze($root, $accessKey, $accessSecret, $bucket, $region, $acl);
|
||||
case Storage::DEVICE_LINODE:
|
||||
return new Linode($root, $accessKey, $accessSecret, $bucket, $region, $acl);
|
||||
case Storage::DEVICE_WASABI:
|
||||
return new Wasabi($root, $accessKey, $accessSecret, $bucket, $region, $acl);
|
||||
case Storage::DEVICE_LOCAL:
|
||||
default:
|
||||
return new Local($root);
|
||||
}
|
||||
} else {
|
||||
switch (strtolower(System::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL) ?? '')) {
|
||||
case Storage::DEVICE_LOCAL:
|
||||
default:
|
||||
return new Local($root);
|
||||
case Storage::DEVICE_S3:
|
||||
$s3AccessKey = System::getEnv('_APP_STORAGE_S3_ACCESS_KEY', '');
|
||||
$s3SecretKey = System::getEnv('_APP_STORAGE_S3_SECRET', '');
|
||||
$s3Region = System::getEnv('_APP_STORAGE_S3_REGION', '');
|
||||
$s3Bucket = System::getEnv('_APP_STORAGE_S3_BUCKET', '');
|
||||
$s3Acl = 'private';
|
||||
$s3EndpointUrl = System::getEnv('_APP_STORAGE_S3_ENDPOINT', '');
|
||||
if (!empty($s3EndpointUrl)) {
|
||||
return new S3($root, $s3AccessKey, $s3SecretKey, $s3EndpointUrl, $s3Region, $s3Acl);
|
||||
} else {
|
||||
return new AWS($root, $s3AccessKey, $s3SecretKey, $s3Bucket, $s3Region, $s3Acl);
|
||||
}
|
||||
// no break
|
||||
case Storage::DEVICE_DO_SPACES:
|
||||
$doSpacesAccessKey = System::getEnv('_APP_STORAGE_DO_SPACES_ACCESS_KEY', '');
|
||||
$doSpacesSecretKey = System::getEnv('_APP_STORAGE_DO_SPACES_SECRET', '');
|
||||
$doSpacesRegion = System::getEnv('_APP_STORAGE_DO_SPACES_REGION', '');
|
||||
$doSpacesBucket = System::getEnv('_APP_STORAGE_DO_SPACES_BUCKET', '');
|
||||
$doSpacesAcl = 'private';
|
||||
$device = new DOSpaces($root, $doSpacesAccessKey, $doSpacesSecretKey, $doSpacesBucket, $doSpacesRegion, $doSpacesAcl);
|
||||
$device->setHttpVersion(S3::HTTP_VERSION_1_1);
|
||||
return $device;
|
||||
case Storage::DEVICE_BACKBLAZE:
|
||||
$backblazeAccessKey = System::getEnv('_APP_STORAGE_BACKBLAZE_ACCESS_KEY', '');
|
||||
$backblazeSecretKey = System::getEnv('_APP_STORAGE_BACKBLAZE_SECRET', '');
|
||||
$backblazeRegion = System::getEnv('_APP_STORAGE_BACKBLAZE_REGION', '');
|
||||
$backblazeBucket = System::getEnv('_APP_STORAGE_BACKBLAZE_BUCKET', '');
|
||||
$backblazeAcl = 'private';
|
||||
return new Backblaze($root, $backblazeAccessKey, $backblazeSecretKey, $backblazeBucket, $backblazeRegion, $backblazeAcl);
|
||||
case Storage::DEVICE_LINODE:
|
||||
$linodeAccessKey = System::getEnv('_APP_STORAGE_LINODE_ACCESS_KEY', '');
|
||||
$linodeSecretKey = System::getEnv('_APP_STORAGE_LINODE_SECRET', '');
|
||||
$linodeRegion = System::getEnv('_APP_STORAGE_LINODE_REGION', '');
|
||||
$linodeBucket = System::getEnv('_APP_STORAGE_LINODE_BUCKET', '');
|
||||
$linodeAcl = 'private';
|
||||
return new Linode($root, $linodeAccessKey, $linodeSecretKey, $linodeBucket, $linodeRegion, $linodeAcl);
|
||||
case Storage::DEVICE_WASABI:
|
||||
$wasabiAccessKey = System::getEnv('_APP_STORAGE_WASABI_ACCESS_KEY', '');
|
||||
$wasabiSecretKey = System::getEnv('_APP_STORAGE_WASABI_SECRET', '');
|
||||
$wasabiRegion = System::getEnv('_APP_STORAGE_WASABI_REGION', '');
|
||||
$wasabiBucket = System::getEnv('_APP_STORAGE_WASABI_BUCKET', '');
|
||||
$wasabiAcl = 'private';
|
||||
return new Wasabi($root, $wasabiAccessKey, $wasabiSecretKey, $wasabiBucket, $wasabiRegion, $wasabiAcl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
App::setResource('mode', function ($request) {
|
||||
/** @var Appwrite\Utopia\Request $request */
|
||||
|
||||
/**
|
||||
* Defines the mode for the request:
|
||||
* - 'default' => Requests for Client and Server Side
|
||||
* - 'admin' => Request from the Console on non-console projects
|
||||
*/
|
||||
return $request->getParam('mode', $request->getHeader('x-appwrite-mode', APP_MODE_DEFAULT));
|
||||
}, ['request']);
|
||||
|
||||
App::setResource('geodb', function ($register) {
|
||||
/** @var Utopia\Registry\Registry $register */
|
||||
return $register->get('geodb');
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('passwordsDictionary', function ($register) {
|
||||
/** @var Utopia\Registry\Registry $register */
|
||||
return $register->get('passwordsDictionary');
|
||||
}, ['register']);
|
||||
|
||||
|
||||
App::setResource('servers', function () {
|
||||
$platforms = Config::getParam('platforms');
|
||||
$server = $platforms[APP_PLATFORM_SERVER];
|
||||
|
||||
$languages = array_map(function ($language) {
|
||||
return strtolower($language['name']);
|
||||
}, $server['sdks']);
|
||||
|
||||
return $languages;
|
||||
});
|
||||
|
||||
App::setResource('promiseAdapter', function ($register) {
|
||||
return $register->get('promiseAdapter');
|
||||
}, ['register']);
|
||||
|
||||
App::setResource('schema', function ($utopia, $dbForProject) {
|
||||
|
||||
$complexity = function (int $complexity, array $args) {
|
||||
$queries = Query::parseQueries($args['queries'] ?? []);
|
||||
$query = Query::getByType($queries, [Query::TYPE_LIMIT])[0] ?? null;
|
||||
$limit = $query ? $query->getValue() : APP_LIMIT_LIST_DEFAULT;
|
||||
|
||||
return $complexity * $limit;
|
||||
};
|
||||
|
||||
$attributes = function (int $limit, int $offset) use ($dbForProject) {
|
||||
$attrs = Authorization::skip(fn () => $dbForProject->find('attributes', [
|
||||
Query::limit($limit),
|
||||
Query::offset($offset),
|
||||
]));
|
||||
|
||||
return \array_map(function ($attr) {
|
||||
return $attr->getArrayCopy();
|
||||
}, $attrs);
|
||||
};
|
||||
|
||||
$urls = [
|
||||
'list' => function (string $databaseId, string $collectionId, array $args) {
|
||||
return "/v1/databases/$databaseId/collections/$collectionId/documents";
|
||||
},
|
||||
'create' => function (string $databaseId, string $collectionId, array $args) {
|
||||
return "/v1/databases/$databaseId/collections/$collectionId/documents";
|
||||
},
|
||||
'read' => function (string $databaseId, string $collectionId, array $args) {
|
||||
return "/v1/databases/$databaseId/collections/$collectionId/documents/{$args['documentId']}";
|
||||
},
|
||||
'update' => function (string $databaseId, string $collectionId, array $args) {
|
||||
return "/v1/databases/$databaseId/collections/$collectionId/documents/{$args['documentId']}";
|
||||
},
|
||||
'delete' => function (string $databaseId, string $collectionId, array $args) {
|
||||
return "/v1/databases/$databaseId/collections/$collectionId/documents/{$args['documentId']}";
|
||||
},
|
||||
];
|
||||
|
||||
$params = [
|
||||
'list' => function (string $databaseId, string $collectionId, array $args) {
|
||||
return [ 'queries' => $args['queries']];
|
||||
},
|
||||
'create' => function (string $databaseId, string $collectionId, array $args) {
|
||||
$id = $args['id'] ?? 'unique()';
|
||||
$permissions = $args['permissions'] ?? null;
|
||||
|
||||
unset($args['id']);
|
||||
unset($args['permissions']);
|
||||
|
||||
// Order must be the same as the route params
|
||||
return [
|
||||
'databaseId' => $databaseId,
|
||||
'documentId' => $id,
|
||||
'collectionId' => $collectionId,
|
||||
'data' => $args,
|
||||
'permissions' => $permissions,
|
||||
];
|
||||
},
|
||||
'update' => function (string $databaseId, string $collectionId, array $args) {
|
||||
$documentId = $args['id'];
|
||||
$permissions = $args['permissions'] ?? null;
|
||||
|
||||
unset($args['id']);
|
||||
unset($args['permissions']);
|
||||
|
||||
// Order must be the same as the route params
|
||||
return [
|
||||
'databaseId' => $databaseId,
|
||||
'collectionId' => $collectionId,
|
||||
'documentId' => $documentId,
|
||||
'data' => $args,
|
||||
'permissions' => $permissions,
|
||||
];
|
||||
},
|
||||
];
|
||||
|
||||
return Schema::build(
|
||||
$utopia,
|
||||
$complexity,
|
||||
$attributes,
|
||||
$urls,
|
||||
$params,
|
||||
);
|
||||
}, ['utopia', 'dbForProject']);
|
||||
|
||||
App::setResource('contributors', function () {
|
||||
$path = 'app/config/contributors.json';
|
||||
$list = (file_exists($path)) ? json_decode(file_get_contents($path), true) : [];
|
||||
return $list;
|
||||
});
|
||||
|
||||
App::setResource('employees', function () {
|
||||
$path = 'app/config/employees.json';
|
||||
$list = (file_exists($path)) ? json_decode(file_get_contents($path), true) : [];
|
||||
return $list;
|
||||
});
|
||||
|
||||
App::setResource('heroes', function () {
|
||||
$path = 'app/config/heroes.json';
|
||||
$list = (file_exists($path)) ? json_decode(file_get_contents($path), true) : [];
|
||||
return $list;
|
||||
});
|
||||
|
||||
App::setResource('gitHub', function (Cache $cache) {
|
||||
return new VcsGitHub($cache);
|
||||
}, ['cache']);
|
||||
|
||||
App::setResource('requestTimestamp', function ($request) {
|
||||
//TODO: Move this to the Request class itself
|
||||
$timestampHeader = $request->getHeader('x-appwrite-timestamp');
|
||||
$requestTimestamp = null;
|
||||
if (!empty($timestampHeader)) {
|
||||
try {
|
||||
$requestTimestamp = new \DateTime($timestampHeader);
|
||||
} catch (\Throwable $e) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Invalid X-Appwrite-Timestamp header value');
|
||||
}
|
||||
}
|
||||
return $requestTimestamp;
|
||||
}, ['request']);
|
||||
|
||||
App::setResource('plan', function (array $plan = []) {
|
||||
return [];
|
||||
});
|
||||
|
||||
App::setResource('smsRates', function () {
|
||||
return [];
|
||||
});
|
||||
|
||||
App::setResource('team', function (Document $project, Database $dbForPlatform, App $utopia, Request $request) {
|
||||
$teamInternalId = '';
|
||||
if ($project->getId() !== 'console') {
|
||||
$teamInternalId = $project->getAttribute('teamInternalId', '');
|
||||
} else {
|
||||
$route = $utopia->match($request);
|
||||
$path = $route->getPath();
|
||||
if (str_starts_with($path, '/v1/projects/:projectId')) {
|
||||
$uri = $request->getURI();
|
||||
$pid = explode('/', $uri)[3];
|
||||
$p = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $pid));
|
||||
$teamInternalId = $p->getAttribute('teamInternalId', '');
|
||||
} elseif ($path === '/v1/projects') {
|
||||
$teamId = $request->getParam('teamId', '');
|
||||
$team = Authorization::skip(fn () => $dbForPlatform->getDocument('teams', $teamId));
|
||||
return $team;
|
||||
}
|
||||
}
|
||||
|
||||
$team = Authorization::skip(function () use ($dbForPlatform, $teamInternalId) {
|
||||
return $dbForPlatform->findOne('teams', [
|
||||
Query::equal('$internalId', [$teamInternalId]),
|
||||
]);
|
||||
});
|
||||
|
||||
return $team;
|
||||
}, ['project', 'dbForPlatform', 'utopia', 'request']);
|
||||
|
||||
App::setResource(
|
||||
'isResourceBlocked',
|
||||
fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false
|
||||
);
|
||||
|
||||
App::setResource('previewHostname', function (Request $request) {
|
||||
if (App::isDevelopment()) {
|
||||
$host = $request->getQuery('appwrite-hostname') ?? '';
|
||||
if (!empty($host)) {
|
||||
return $host;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}, ['request']);
|
||||
|
||||
App::setResource('apiKey', function (Request $request, Document $project): ?Key {
|
||||
$key = $request->getHeader('x-appwrite-key');
|
||||
|
||||
if (empty($key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Key::decode($project, $key);
|
||||
}, ['request', 'project']);
|
||||
|
||||
App::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST')));
|
||||
@@ -148,6 +148,7 @@ $image = $this->getParam('image', '');
|
||||
- _APP_MAINTENANCE_RETENTION_CACHE
|
||||
- _APP_MAINTENANCE_RETENTION_ABUSE
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE
|
||||
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
|
||||
- _APP_MAINTENANCE_RETENTION_SCHEDULES
|
||||
- _APP_SMS_PROVIDER
|
||||
@@ -164,11 +165,10 @@ $image = $this->getParam('image', '');
|
||||
- _APP_MIGRATIONS_FIREBASE_CLIENT_ID
|
||||
- _APP_MIGRATIONS_FIREBASE_CLIENT_SECRET
|
||||
- _APP_ASSISTANT_OPENAI_API_KEY
|
||||
|
||||
appwrite-console:
|
||||
<<: *x-logging
|
||||
container_name: appwrite-console
|
||||
image: <?php echo $organization; ?>/console:5.2.27
|
||||
image: <?php echo $organization; ?>/console:5.2.58
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- appwrite
|
||||
@@ -341,7 +341,10 @@ $image = $this->getParam('image', '');
|
||||
- _APP_EXECUTOR_HOST
|
||||
- _APP_MAINTENANCE_RETENTION_ABUSE
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE
|
||||
- _APP_MAINTENANCE_RETENTION_EXECUTION
|
||||
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
|
||||
- _APP_EMAIL_CERTIFICATES
|
||||
|
||||
appwrite-worker-databases:
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
@@ -650,6 +653,7 @@ $image = $this->getParam('image', '');
|
||||
- _APP_MAINTENANCE_RETENTION_CACHE
|
||||
- _APP_MAINTENANCE_RETENTION_ABUSE
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE
|
||||
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
|
||||
- _APP_MAINTENANCE_RETENTION_SCHEDULES
|
||||
|
||||
@@ -740,34 +744,6 @@ $image = $this->getParam('image', '');
|
||||
- _APP_LOGGING_CONFIG
|
||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||
|
||||
appwrite-worker-stats-usage-dump:
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: worker-stats-usage-dump
|
||||
<<: *x-logging
|
||||
container_name: appwrite-worker-stats-usage-dump
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- appwrite
|
||||
depends_on:
|
||||
- redis
|
||||
- mariadb
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_DB_HOST
|
||||
- _APP_DB_PORT
|
||||
- _APP_DB_SCHEMA
|
||||
- _APP_DB_USER
|
||||
- _APP_DB_PASS
|
||||
- _APP_REDIS_HOST
|
||||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_USAGE_STATS
|
||||
- _APP_LOGGING_CONFIG
|
||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||
|
||||
appwrite-task-scheduler-functions:
|
||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||
entrypoint: schedule-functions
|
||||
|
||||
+16
-13
@@ -15,11 +15,9 @@ use Appwrite\Event\Messaging;
|
||||
use Appwrite\Event\Migration;
|
||||
use Appwrite\Event\Realtime;
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Event\StatsUsageDump;
|
||||
/** remove */
|
||||
/** /remove */
|
||||
use Appwrite\Event\Webhook;
|
||||
use Appwrite\Platform\Appwrite;
|
||||
use Executor\Executor;
|
||||
use Swoole\Runtime;
|
||||
use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis;
|
||||
use Utopia\Cache\Adapter\Sharding;
|
||||
@@ -112,6 +110,8 @@ Server::setResource('dbForProject', function (Cache $cache, Registry $register,
|
||||
->setNamespace('_' . $project->getInternalId());
|
||||
}
|
||||
|
||||
$database->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER);
|
||||
|
||||
return $database;
|
||||
}, ['cache', 'register', 'message', 'project', 'dbForPlatform']);
|
||||
|
||||
@@ -173,6 +173,8 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf
|
||||
->setNamespace('_' . $project->getInternalId());
|
||||
}
|
||||
|
||||
$database->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER);
|
||||
|
||||
return $database;
|
||||
};
|
||||
}, ['pools', 'dbForPlatform', 'cache']);
|
||||
@@ -198,7 +200,7 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) {
|
||||
$database
|
||||
->setSharedTables(true)
|
||||
->setNamespace('logsV1')
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS)
|
||||
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER)
|
||||
->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES);
|
||||
|
||||
// set tenant
|
||||
@@ -211,15 +213,18 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) {
|
||||
}, ['pools', 'cache']);
|
||||
|
||||
Server::setResource('abuseRetention', function () {
|
||||
return time() - (int) System::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', 86400);
|
||||
return time() - (int) System::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', 86400); // 1 day
|
||||
});
|
||||
|
||||
Server::setResource('auditRetention', function () {
|
||||
return DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 1209600));
|
||||
});
|
||||
Server::setResource('auditRetention', function (Document $project) {
|
||||
if ($project->getId() === 'console') {
|
||||
return DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE', 15778800)); // 6 months
|
||||
}
|
||||
return DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 1209600)); // 14 days
|
||||
}, ['project']);
|
||||
|
||||
Server::setResource('executionRetention', function () {
|
||||
return DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_EXECUTION', 1209600));
|
||||
return DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_EXECUTION', 1209600)); // 14 days
|
||||
});
|
||||
|
||||
Server::setResource('cache', function (Registry $register) {
|
||||
@@ -273,10 +278,6 @@ Server::setResource('queueForStatsUsage', function (Publisher $publisher) {
|
||||
return new StatsUsage($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForStatsUsageDump', function (Publisher $publisher) {
|
||||
return new StatsUsageDump($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForDatabase', function (Publisher $publisher) {
|
||||
return new EventDatabase($publisher);
|
||||
}, ['publisher']);
|
||||
@@ -408,6 +409,8 @@ Server::setResource('logError', function (Registry $register, Document $project)
|
||||
};
|
||||
}, ['register', 'project']);
|
||||
|
||||
Server::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST')));
|
||||
|
||||
$pools = $register->get('pools');
|
||||
$platform = new Appwrite();
|
||||
$args = $platform->getEnv('argv');
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
php /usr/src/code/app/worker.php stats-usage-dump $@
|
||||
+9
-9
@@ -45,34 +45,34 @@
|
||||
"ext-sockets": "*",
|
||||
"appwrite/php-runtimes": "0.16.*",
|
||||
"appwrite/php-clamav": "2.0.*",
|
||||
"utopia-php/abuse": "0.51.*",
|
||||
"utopia-php/abuse": "0.52.*",
|
||||
"utopia-php/analytics": "0.10.*",
|
||||
"utopia-php/audit": "0.54.0",
|
||||
"utopia-php/audit": "0.55.*",
|
||||
"utopia-php/cache": "0.12.*",
|
||||
"utopia-php/cli": "0.15.*",
|
||||
"utopia-php/config": "0.2.*",
|
||||
"utopia-php/database": "0.60.*",
|
||||
"utopia-php/database": "0.65.*",
|
||||
"utopia-php/domains": "0.5.*",
|
||||
"utopia-php/dsn": "0.2.1",
|
||||
"utopia-php/framework": "0.33.*",
|
||||
"utopia-php/fetch": "0.3.*",
|
||||
"utopia-php/fetch": "0.4.*",
|
||||
"utopia-php/image": "0.8.*",
|
||||
"utopia-php/locale": "0.4.*",
|
||||
"utopia-php/logger": "0.6.*",
|
||||
"utopia-php/messaging": "0.16.*",
|
||||
"utopia-php/migration": "0.6.*",
|
||||
"utopia-php/migration": "0.8.*",
|
||||
"utopia-php/orchestration": "0.9.*",
|
||||
"utopia-php/platform": "0.7.3",
|
||||
"utopia-php/pools": "0.5.*",
|
||||
"utopia-php/platform": "0.7.*",
|
||||
"utopia-php/pools": "0.8.*",
|
||||
"utopia-php/preloader": "0.2.*",
|
||||
"utopia-php/queue": "0.8.*",
|
||||
"utopia-php/queue": "0.9.*",
|
||||
"utopia-php/registry": "0.5.*",
|
||||
"utopia-php/storage": "0.18.*",
|
||||
"utopia-php/swoole": "0.8.*",
|
||||
"utopia-php/system": "0.9.*",
|
||||
"utopia-php/telemetry": "0.1.*",
|
||||
"utopia-php/vcs": "0.9.*",
|
||||
"utopia-php/websocket": "0.1.*",
|
||||
"utopia-php/websocket": "0.3.*",
|
||||
"matomo/device-detector": "6.1.*",
|
||||
"dragonmantank/cron-expression": "3.3.2",
|
||||
"phpmailer/phpmailer": "6.9.1",
|
||||
|
||||
Generated
+156
-432
File diff suppressed because it is too large
Load Diff
+13
-36
@@ -171,6 +171,7 @@ services:
|
||||
- _APP_MAINTENANCE_RETENTION_CACHE
|
||||
- _APP_MAINTENANCE_RETENTION_ABUSE
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE
|
||||
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
|
||||
- _APP_MAINTENANCE_RETENTION_SCHEDULES
|
||||
- _APP_SMS_PROVIDER
|
||||
@@ -197,11 +198,14 @@ services:
|
||||
- _APP_DATABASE_SHARED_TABLES_V1
|
||||
- _APP_DATABASE_SHARED_NAMESPACE
|
||||
- _APP_FUNCTIONS_CREATION_ABUSE_LIMIT
|
||||
- _APP_CUSTOM_DOMAIN_DENY_LIST
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
appwrite-console:
|
||||
<<: *x-logging
|
||||
container_name: appwrite-console
|
||||
image: appwrite/console:5.2.27
|
||||
image: appwrite/console:5.2.58
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- appwrite
|
||||
@@ -389,6 +393,8 @@ services:
|
||||
- _APP_DATABASE_SHARED_TABLES
|
||||
- _APP_DATABASE_SHARED_TABLES_V1
|
||||
- _APP_EMAIL_CERTIFICATES
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE
|
||||
|
||||
appwrite-worker-databases:
|
||||
entrypoint: worker-databases
|
||||
@@ -486,6 +492,8 @@ services:
|
||||
- _APP_STORAGE_WASABI_REGION
|
||||
- _APP_STORAGE_WASABI_BUCKET
|
||||
- _APP_DATABASE_SHARED_TABLES
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
appwrite-worker-certificates:
|
||||
entrypoint: worker-certificates
|
||||
@@ -721,6 +729,7 @@ services:
|
||||
- _APP_MAINTENANCE_RETENTION_CACHE
|
||||
- _APP_MAINTENANCE_RETENTION_ABUSE
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT
|
||||
- _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE
|
||||
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
|
||||
- _APP_MAINTENANCE_RETENTION_SCHEDULES
|
||||
- _APP_MAINTENANCE_DELAY
|
||||
@@ -756,7 +765,7 @@ services:
|
||||
- _APP_LOGGING_CONFIG
|
||||
- _APP_DATABASE_SHARED_TABLES
|
||||
- _APP_STATS_RESOURCES_INTERVAL
|
||||
|
||||
|
||||
appwrite-worker-stats-resources:
|
||||
entrypoint: worker-stats-resources
|
||||
<<: *x-logging
|
||||
@@ -787,7 +796,7 @@ services:
|
||||
- _APP_LOGGING_CONFIG
|
||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||
- _APP_DATABASE_SHARED_TABLES
|
||||
|
||||
|
||||
appwrite-worker-stats-usage:
|
||||
entrypoint: worker-stats-usage
|
||||
<<: *x-logging
|
||||
@@ -819,38 +828,6 @@ services:
|
||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||
- _APP_DATABASE_SHARED_TABLES
|
||||
|
||||
appwrite-worker-stats-usage-dump:
|
||||
entrypoint: worker-stats-usage-dump
|
||||
<<: *x-logging
|
||||
container_name: appwrite-worker-stats-usage-dump
|
||||
image: appwrite-dev
|
||||
networks:
|
||||
- appwrite
|
||||
volumes:
|
||||
- ./app:/usr/src/code/app
|
||||
- ./src:/usr/src/code/src
|
||||
depends_on:
|
||||
- redis
|
||||
- mariadb
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_DB_HOST
|
||||
- _APP_DB_PORT
|
||||
- _APP_DB_SCHEMA
|
||||
- _APP_DB_USER
|
||||
- _APP_DB_PASS
|
||||
- _APP_REDIS_HOST
|
||||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_USAGE_STATS
|
||||
- _APP_LOGGING_CONFIG
|
||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||
- _APP_DATABASE_SHARED_TABLES
|
||||
- _APP_STATS_USAGE_DUAL_WRITING_DBS
|
||||
|
||||
appwrite-task-scheduler-functions:
|
||||
entrypoint: schedule-functions
|
||||
<<: *x-logging
|
||||
@@ -1127,4 +1104,4 @@ volumes:
|
||||
appwrite-certificates:
|
||||
appwrite-functions:
|
||||
appwrite-builds:
|
||||
appwrite-config:
|
||||
appwrite-config:
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Avatars avatars = new Avatars(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Avatars avatars = new Avatars(client);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Client client = new Client(getApplicationContext())
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Avatars avatars = new Avatars(client);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user