Compare commits

...
383 Commits
Author SHA1 Message Date
shimon c159032e93 email template path 2023-10-19 22:49:53 +03:00
shimon 416e5cc88c Merge branch '1.4.x' of github.com:appwrite/appwrite into cl-1.4.x 2023-10-19 21:00:21 +03:00
Christy JacobandGitHub 8e44f350e5 Merge pull request #6960 from appwrite/fix-email-tmeplate-path
email template path
2023-10-19 21:59:04 +04:00
shimon dd47ef4fd9 email template path 2023-10-19 20:57:24 +03:00
shimon aa9b057632 Merge branch '1.4.x' of github.com:appwrite/appwrite into cl-1.4.x 2023-10-19 19:42:03 +03:00
Christy JacobandGitHub 21b9716bb2 Merge pull request #6959 from appwrite/chore-update-backup-timings
chore: update backup timings
2023-10-19 20:40:43 +04:00
Christy JacobandGitHub a8ee31f9ae Merge pull request #6958 from appwrite/fix-events-queue-proxy
Fix events queue
2023-10-19 20:32:42 +04:00
德华 刘 de8b9638d5 chore: update backup timings 2023-10-19 16:07:54 +00:00
shimon 8048766d28 queues fixes 2023-10-19 18:28:01 +03:00
Christy JacobandGitHub 5403df059f Merge pull request #6952 from appwrite/feat-upgrade-executor
Feat: Upgrade executor
2023-10-19 17:18:29 +04:00
Christy JacobandGitHub 6b853a532a Merge pull request #6953 from appwrite/fix-logger-ver
hard coding utopia logger to 0.3.1
2023-10-19 16:44:49 +04:00
Christy Jacob c89bace5e4 chore: revert logger version 2023-10-19 12:25:10 +00:00
shimon 23926e9530 hard coding utopia logger to 0.3.1 2023-10-19 14:01:06 +03:00
shimon aa32b419a8 hard coding utopia logger to 0.3.1 2023-10-19 13:50:32 +03:00
Matej Bačo 20c37db8fc Upgrade executor 2023-10-19 11:54:56 +02:00
Christy JacobandGitHub 8d9f0180a1 Merge pull request #6948 from appwrite/feat-1.4.6-release-prep
Prepare 1.4.6 release
2023-10-19 05:41:21 -04:00
Christy JacobandGitHub 01e842782f Merge branch '1.4.x' into feat-1.4.6-release-prep 2023-10-19 05:28:02 -04:00
Christy JacobandGitHub 4b08729131 Update app/init.php 2023-10-19 05:27:52 -04:00
Christy Jacob 18dc8749d5 chore: update health API 2023-10-19 09:25:38 +00:00
Christy JacobandGitHub e2be9ea180 Merge pull request #6949 from appwrite/feat-api-db-timeout
API DB timeout
2023-10-19 05:17:00 -04:00
Christy JacobandGitHub a46b3d088c Merge branch '1.4.x' into feat-api-db-timeout 2023-10-19 05:15:44 -04:00
Jake Barnby bd3be15d07 Fix options test 2023-10-19 21:23:54 +13:00
Jake Barnby 9cb2e834a6 Update db 2023-10-19 20:41:06 +13:00
Jake Barnby 03b6d65669 Add timeout on vcs project DBs 2023-10-19 17:21:11 +13:00
Jake Barnby b5cdbb50c7 Use fixed message 2023-10-19 17:12:05 +13:00
Jake Barnby 354211950f Add timeout test 2023-10-19 17:06:57 +13:00
Jake Barnby b6b8fe7d51 Allow overriding timeout per request in dev mode 2023-10-19 16:19:40 +13:00
Jake Barnby b17e24f645 Use const for timeout 2023-10-19 15:45:32 +13:00
Jake Barnby 389d367fca Set hard timeouts for API dbs 2023-10-19 15:32:45 +13:00
Jake Barnby db3fa21468 Update database 2023-10-19 14:26:44 +13:00
Steven Nguyen 238608a559 Generate 1.4.x docs examples 2023-10-18 17:42:27 -07:00
Steven Nguyen 6d040beb36 Update specs for 1.4.6
$ diff old.json new.json
4c4
<     "version": "1.4.5",
---
>     "version": "1.4.6",
8132c8132
<     "/health/queue/databases": {
---
>     "/health/queue/databases/{databaseId}": {
8164c8164,8175
<         "security": [{ "Project": [], "Key": [] }]
---
>         "security": [{ "Project": [], "Key": [] }],
>         "parameters": [
>           {
>             "name": "databaseId",
>             "description": "Database for which to check the queue size",
>             "required": false,
>             "type": "string",
>             "x-example": "[DATABASE_ID]",
>             "default": "database_db_main",
>             "in": "path"
>           }
>         ]
2023-10-18 17:42:27 -07:00
Steven Nguyen 1d7c9d84d2 Fix get database queue endpoint params
A path param cannot be optional so change it to a query param.
2023-10-18 17:42:27 -07:00
Steven Nguyen ef82d525a4 Add 1.4.6 changes to CHANGES.md 2023-10-18 16:08:28 -07:00
Steven Nguyen 435b20df77 Bump appwrite version to 1.4.6 2023-10-18 16:07:47 -07:00
Eldad A. FuxandGitHub f80f7c8d9b Merge pull request #6947 from appwrite/chore-bump-console
Bump console to version 3.2.3
2023-10-18 18:56:03 -04:00
Steven Nguyen 9bc6b124c0 Bump console to version 3.2.3 2023-10-18 15:51:13 -07:00
Eldad A. FuxandGitHub 251ae23a80 Merge pull request #6928 from appwrite/refactor-workers-sn
Refactor workers
2023-10-18 18:46:45 -04:00
Christy Jacob 67541d4a1d chore: review comments 2023-10-18 21:35:15 +00:00
Christy JacobandGitHub 20985c7ee4 Merge pull request #6946 from appwrite/remove-resque
chore: remove resque library and update health check endpoints
2023-10-18 16:59:44 -04:00
Christy Jacob 6d55b20fac chore: update health tests 2023-10-18 20:18:15 +00:00
Christy JacobandGitHub be5ed9b282 Merge pull request #6934 from appwrite/feat-delegate-deletes
Delegate custom deletes
2023-10-18 16:13:08 -04:00
Christy Jacob 3d7cd91176 chore: fix injections 2023-10-18 19:54:56 +00:00
Christy Jacob be26e4b729 chore: remove resque library and update health check endpoints 2023-10-18 19:44:06 +00:00
Christy JacobandGitHub f822f86517 Merge branch '1.4.x' into refactor-workers-sn 2023-10-18 15:26:45 -04:00
Christy Jacob 80086e9edc chore: fix composer dependencies 2023-10-18 19:26:35 +00:00
Christy Jacob 74e3f3f7d2 fix: remove unused variable 2023-10-18 19:08:21 +00:00
Christy Jacob 133cb62b4e fix: update injection name 2023-10-18 19:07:17 +00:00
Christy Jacob 4724d729fb Merge branch 'refactor-workers-sn' of https://github.com/appwrite/appwrite into feat-delegate-deletes 2023-10-18 18:59:51 +00:00
Christy JacobandGitHub eed70454ce Merge pull request #6940 from appwrite/remove-obsolete-tasks
chore: cleanup obsolete CLI tasks
2023-10-18 14:59:41 -04:00
Christy Jacob 066dd6393d Merge branch 'refactor-workers-sn' of https://github.com/appwrite/appwrite into feat-delegate-deletes 2023-10-18 18:57:16 +00:00
Christy Jacob 72d0865ad8 chore: use deletes worker for deleting audit logs 2023-10-18 18:54:20 +00:00
Christy Jacob 688f2e5a56 Merge branch 'refactor-workers-sn' of github.com:appwrite/appwrite into remove-obsolete-tasks 2023-10-18 22:19:52 +04:00
shimon 8a52dc3485 some fixes 2023-10-18 20:21:39 +03:00
Christy Jacob 20415c6daf fix: webhook tests 2023-10-18 21:09:23 +04:00
Christy Jacob 2e3d17e7b1 fix: webhook tests 2023-10-18 21:06:59 +04:00
Christy Jacob 699ac7f7f5 fix: review comments 2023-10-18 20:53:11 +04:00
Christy Jacob 050cb28d4f fix: incorrect events 2023-10-18 20:30:47 +04:00
Christy Jacob 5f9059e221 chore: run linter 2023-10-18 19:50:40 +04:00
Christy Jacob 2a201a9d1c chore: fix flaky tests 2023-10-18 19:42:23 +04:00
Christy Jacob a0be115815 chore: re-order tests 2023-10-18 03:07:41 +04:00
Christy Jacob c501dc61dc chore: re-order tests 2023-10-18 02:58:29 +04:00
Christy Jacob 33ec5b3d7b chore: re-order tests 2023-10-18 02:36:50 +04:00
Christy Jacob 39820b5a0f chore: update docker compose config 2023-10-18 01:56:54 +04:00
Christy Jacob 67642f9f91 chore: update docker compose config 2023-10-18 01:56:05 +04:00
Christy Jacob 011df60c0d feat: remove old worker class 2023-10-18 01:17:02 +04:00
Christy Jacob eeb6a5065b chore: update composer 2023-10-18 00:11:52 +04:00
Christy Jacob 6a53d8e0d5 chore: update composer 2023-10-18 00:02:45 +04:00
Christy JacobandGitHub 2bad00a2fd Merge pull request #6936 from appwrite/feat-dart-3.1
Feat: Dart 3.1 support
2023-10-17 15:53:17 -04:00
Christy Jacob b8367c2b9f chore: update composer 2023-10-17 23:51:16 +04:00
Christy Jacob c3af1e4513 chore: revert composer 2023-10-17 23:49:50 +04:00
Christy Jacob 8afc29c5ed chore: cleanup obsolete CLI tasks 2023-10-17 23:49:10 +04:00
Christy Jacob d1ea0c2244 chore: cleanup obsolete CLI tasks 2023-10-17 23:38:03 +04:00
Christy Jacob 685a953705 Merge branch 'refactor-workers-sn' of github.com:appwrite/appwrite into remove-obsolete-tasks 2023-10-17 23:30:44 +04:00
Christy Jacob 617ded14aa chore: cleanup obsolete CLI tasks 2023-10-17 23:30:11 +04:00
Christy Jacob 7806cf1b55 chore: cleanup obsolete CLI tasks 2023-10-17 23:29:25 +04:00
shimon 593e5ab316 some fixes 2023-10-17 22:08:01 +03:00
shimon 1036cb406d some fixes 2023-10-17 21:32:38 +03:00
Matej Bačo 8b6d050b0d Fix failing event tests 2023-10-17 18:23:10 +02:00
shimon 59052b4fd1 some fixes 2023-10-17 18:12:43 +03:00
shimon b42a9e94e2 some fixes 2023-10-17 18:12:24 +03:00
shimon 3d5930c104 some fixes 2023-10-17 16:55:08 +03:00
Christy Jacob 022952e2ee chore: revert console 2023-10-17 08:36:41 +00:00
Christy Jacob 20468782e5 chore: revert console 2023-10-17 08:35:22 +00:00
Matej Bačo 97ea29bba2 Add dart 3.1 support 2023-10-17 10:18:29 +02:00
shimon 09f829e482 updating gitmodules 2023-10-17 11:00:14 +03:00
shimon 6d98b38e23 addressing some comments 2023-10-17 07:29:37 +03:00
shimon d7b7dfef25 addressing some comments 2023-10-17 07:28:51 +03:00
shimon 56f565bf30 addressing some comments 2023-10-17 07:23:33 +03:00
shimon e8dbd043ec addressing some comments 2023-10-17 07:02:54 +03:00
shimon 55dfb0b034 Merge remote-tracking branch 'origin/refactor-workers-sn' into refactor-workers-sn 2023-10-17 06:44:53 +03:00
shimon 9a6d88a819 addressing some comments 2023-10-17 06:44:36 +03:00
Jake Barnby dbfe5e45aa Delegate custom deletes 2023-10-17 12:18:51 +13:00
e565557eb2 Update app/worker.php
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
2023-10-16 20:13:39 +03:00
shimon 0e2cf14e12 minor fix 2023-10-16 18:17:13 +03:00
shimon a8f5886474 minor fix 2023-10-16 18:17:02 +03:00
710ac707e3 Update src/Appwrite/Event/Audit.php
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
2023-10-16 18:11:29 +03:00
shimon 039df4abb3 revert changes 2023-10-16 18:04:27 +03:00
shimon 5dc55110b4 small fixes 2023-10-16 17:34:55 +03:00
shimon e660a6f4a3 small fixes 2023-10-16 17:09:51 +03:00
shimon 2451d9fef1 Merge branch '1.4.x' of github.com:appwrite/appwrite into refactor-workers-sn
 Conflicts:
	src/Appwrite/Platform/Workers/Deletes.php
2023-10-16 17:06:59 +03:00
shimon 2fcda9fc11 Merge branch 'cl-1.4.x' of github.com:appwrite/appwrite into refactor-workers-sn 2023-10-16 17:03:43 +03:00
shimon 0e2c1c1f2d small fixes 2023-10-16 16:20:41 +03:00
Christy JacobandGitHub ee39971eee Merge pull request #6930 from appwrite/main
Merge main into 1.4.x
2023-10-16 07:09:08 -04:00
shimon 0c776e0a44 comparing $workersCount via worker.php vs init php 2023-10-16 11:04:44 +03:00
shimon 94178f8eaf rollback to Usage 2023-10-15 20:41:09 +03:00
Torsten DittmannandGitHub fce18647d2 Merge pull request #6434 from appwrite/fix-specs
chore: fix spec links
2023-10-13 16:12:19 +02:00
Torsten Dittmann 7bae8ac374 revert: console change 2023-10-13 16:10:27 +02:00
Torsten Dittmann f5d0ebeb75 docs: fix broken links 2023-10-13 15:59:28 +02:00
Torsten Dittmann c0c4cffba2 fix: relative links to absolute v2 2023-10-13 15:43:44 +02:00
Torsten Dittmann 3778939605 fix: relative links to absolute 2023-10-13 15:43:23 +02:00
Torsten Dittmann 8e12a07267 Merge branch 'main' of https://github.com/appwrite/appwrite into fix-specs 2023-10-13 15:42:09 +02:00
Torsten DittmannandGitHub ce0024d97a Merge pull request #5290 from DH-555/patch-4
Fix: spanish translations (emails)
2023-10-13 13:36:28 +02:00
Torsten DittmannandGitHub ecd073fb02 Merge pull request #6898 from appwrite/fix-6879-fix-project-delete
Update teamInternalId when updating project team
2023-10-13 13:35:47 +02:00
Torsten DittmannandGitHub 35891503ef Merge pull request #6897 from appwrite/fix-6895-realtime-deletes
Fix realtime deletes
2023-10-13 12:49:49 +02:00
Christy Jacob d8714ec3fa fix: rename domains collection to rules in hamster script 2023-10-13 12:54:10 +04:00
Christy Jacob b3d8998735 chore: update hamster script 2023-10-13 12:29:03 +04:00
Steven Nguyen 3f2f6ab43a Ensure permissions are updated when a project moves orgs
Since the following collections also have permissions set to the team,
the team should be updated for consistency:

- installations
- repositories
- vcsComments
2023-10-12 17:34:53 -07:00
Steven Nguyen 3bb22c38cc Update teamInternalId when updating project team
This is important because when an organization is deleted, projects are
fetched by the teamInternalId and if the teamInternalId is not updated
when the project team is updated, the project will be deleted if the
previous organization is deleted.
2023-10-12 17:03:45 -07:00
Steven Nguyen 2d2af20547 Fix realtime deletes
The realtime collection only exists in the console project so iterating
over every project leads to the not found error.

In addition, the deleteForProjectIds() doesn't include the console
project so the realtime records were not being cleaned up properly.
2023-10-12 22:49:55 +00:00
shimon 66c57c9a4f Merge remote-tracking branch 'origin/refactor-workers' into refactor-workers 2023-10-12 16:34:31 +03:00
shimon 4088941f70 sync with main 2023-10-12 16:34:13 +03:00
Jake BarnbyandGitHub 4e988dd1fa Merge pull request #6888 from appwrite/feat-db-per-process
Feat db per worker
2023-10-12 21:36:12 +13:00
Jake Barnby 48bc369149 Hardcode default queue for db worker only 2023-10-12 21:32:33 +13:00
Jake Barnby 204912cb98 Update compose phtml 2023-10-12 20:59:40 +13:00
Jake Barnby 8c92170cb6 Add missing workers num 2023-10-12 20:22:26 +13:00
Jake Barnby dc580c3d0d Change name 2023-10-12 20:15:16 +13:00
Jake Barnby 34e7af806a Fix typo 2023-10-12 20:10:44 +13:00
Jake Barnby 855fe5b893 Remove redundant postfix 2023-10-12 19:12:26 +13:00
Jake Barnby e2a8369712 Add docblock for env vars 2023-10-12 19:11:08 +13:00
Jake Barnby effdeb4bc2 Fix env vars 2023-10-12 19:10:45 +13:00
Jake Barnby 6a05d9606e Remove default number postfix 2023-10-12 18:55:01 +13:00
Jake Barnby 1ac3372239 Set queue name per worker 2023-10-12 17:55:30 +13:00
Jake Barnby 0ebb256b16 Revert formatting 2023-10-12 15:31:58 +13:00
Jake Barnby 096a529618 Revert "Merge branch 'feat-db-per-process' of github.com:appwrite/appwrite into feat-db-per-process"
This reverts commit 6f42305484, reversing
changes made to 69abd222e8.
2023-10-12 15:30:01 +13:00
Jake Barnby 6f42305484 Merge branch 'feat-db-per-process' of github.com:appwrite/appwrite into feat-db-per-process
# Conflicts:
#	bin/worker-databases
#	src/Appwrite/Event/Database.php
#	src/Appwrite/Platform/Workers/Databases.php
2023-10-12 15:28:52 +13:00
Jake Barnby 69abd222e8 Simplify 2023-10-12 15:26:01 +13:00
Jake Barnby 7a78f49eb9 Allow multiprocess for db queue 2023-10-12 15:23:16 +13:00
Jake Barnby 662233b026 Set the queue name based on project DB 2023-10-12 15:21:11 +13:00
Jake Barnby c0c6197cff Remove static queue set for database worker 2023-10-12 15:19:42 +13:00
Jake Barnby d7b87d7bae Add env var for db queues 2023-10-12 15:19:17 +13:00
Jake Barnby 5d845208d9 Simplify 2023-10-12 15:02:53 +13:00
Christy Jacob 31aeb5887a Merge branch 'main' of https://github.com/appwrite/appwrite into cl-1.4.x 2023-10-11 15:50:38 +00:00
Christy JacobandGitHub f656002a03 Merge pull request #6885 from appwrite/hamster-fix
hamster script fix
2023-10-11 11:13:43 -04:00
shimon 5748418247 sync with main 2023-10-11 18:09:27 +03:00
shimon 1c8b38502a sync with main 2023-10-11 17:07:06 +03:00
Torsten DittmannandGitHub 9cf9337223 Merge pull request #6884 from appwrite/feat-console-3-2-2
chore: upgrade console to 3.2.2 on cloud
2023-10-11 15:08:01 +02:00
shimon 2cd4514086 sync with main 2023-10-11 16:03:15 +03:00
Torsten Dittmann 92adaee1cb chore: upgrade console to 3.2.2 on cloud 2023-10-11 14:57:11 +02:00
shimon 893b1d0ba7 Merge branch 'main' of github.com:appwrite/appwrite into refactor-workers
 Conflicts:
	.gitmodules
	app/controllers/api/functions.php
	app/controllers/api/health.php
	app/init.php
	app/views/install/compose.phtml
	composer.lock
	src/Appwrite/Migration/Migration.php
	src/Appwrite/Platform/Workers/Builds.php
	src/Appwrite/Platform/Workers/Deletes.php
	src/Appwrite/Platform/Workers/Functions.php
	src/Executor/Executor.php
2023-10-11 12:08:13 +03:00
Christy JacobandGitHub 32c8e84770 Merge pull request #6509 from appwrite/fix-add-hacktoberfest-contributing-guidelines
Added Hacktoberfest Contributing Guidelines
2023-10-11 04:36:52 -04:00
Jake Barnby d238d79e29 Allow multiprocess for db queue 2023-10-11 21:28:29 +13:00
Jake Barnby 365630ff39 Set the queue name based on project DB 2023-10-11 17:21:40 +13:00
Jake Barnby ca5b7f5b16 Add dynamic queue setting for database worker 2023-10-11 16:52:58 +13:00
Jake Barnby 2cf0ed1d69 Remove static queue set for database worker 2023-10-11 16:51:43 +13:00
Jake Barnby 747a16c4ba Add env var for db queues 2023-10-11 16:50:21 +13:00
Steven NguyenandGitHub d3603765f4 Merge branch 'main' into fix-add-hacktoberfest-contributing-guidelines 2023-10-10 13:11:50 -07:00
haimantika mitraandGitHub dbf3f636fc Update HACKTOBERFEST.md 2023-10-11 00:50:05 +05:30
haimantika mitraandGitHub d70042b066 Update HACKTOBERFEST.md 2023-10-11 00:45:00 +05:30
42da578193 Update HACKTOBERFEST.md
Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com>
2023-10-11 00:42:26 +05:30
Torsten DittmannandGitHub 2016310907 Merge pull request #6345 from appwrite/1.4.x
1.4.x
2023-10-10 20:11:46 +02:00
shimon 002fc19d60 tests fix 2023-10-10 21:02:24 +03:00
Haimantika mitra e10bf167b9 Added all requested changes 2023-10-10 23:32:24 +05:30
Eldad A. FuxandGitHub 6f39c1ddc9 Merge branch 'main' into 1.4.x 2023-10-10 19:34:43 +02:00
haimantika mitraandGitHub a362728861 delete old file 2023-10-10 22:30:21 +05:30
Torsten DittmannandGitHub 920d2b2db3 Merge branch 'cl-1.4.x' into 1.4.x 2023-10-10 11:59:24 +02:00
Torsten DittmannandGitHub 8dce3d5862 Merge pull request #6870 from appwrite/feat-1.4.5-release
Prepare 1.4.5 release
2023-10-10 11:15:44 +02:00
Torsten DittmannandGitHub 4cd0c501da Merge pull request #6868 from appwrite/feat-bump-console
Bump console to 3.2.1
2023-10-10 11:14:18 +02:00
Steven Nguyen 9d3972f43f Bump API specs 2023-10-09 16:52:11 -07:00
Steven Nguyen 071920fb30 Bump version to 1.4.5 2023-10-09 16:39:46 -07:00
Steven Nguyen 501153532c Update CHANGES.md for 1.4.5 2023-10-09 16:39:14 -07:00
Steven Nguyen 2620328810 Bump APP_CACHE_BUSTER to make sure browsers fetch the new console 2023-10-09 16:38:54 -07:00
Steven Nguyen 81a6512cce Bump console to 3.2.1 2023-10-09 16:19:59 -07:00
haimantika mitraandGitHub 0c0c41ce87 Made style changes 2023-10-09 22:50:22 +05:30
haimantika mitraandGitHub d43e4f20aa Made requested changes 2023-10-09 22:47:02 +05:30
16d76c2e87 Update Hacktoberfest_Contribution_Guideline.md
Co-authored-by: Vincent (Wen Yu) Ge <vincent@appwrite.io>
2023-10-09 22:41:00 +05:30
Eldad A. FuxandGitHub 970461c509 Merge pull request #6490 from appwrite/fix-6442-executor-restart
Ensure openruntimes-executor restarts after a server reboot
2023-10-09 17:27:15 +02:00
shimon e2989afda8 queueForBuilds fix via functions controller 2023-10-09 13:28:06 +03:00
shimon 24e09d3d8e queueForBuilds fix via functions controller 2023-10-09 13:16:05 +03:00
Jake BarnbyandGitHub 72b4950168 Merge pull request #6469 from appwrite/fix-migration-response-model
Fix missing array flag on migration errors response model rule
2023-10-09 11:29:31 +13:00
Christy JacobandGitHub 030f9629a6 Merge pull request #6496 from appwrite/fix-readme-cn
Update logo in README-CN.md
2023-10-06 08:55:17 -04:00
Steven Nguyen 623b2f97da Ensure openruntimes-executor restarts after a server reboot
Every other service restarts automatically after a server reboot so
the openruntimes-executor should too. Otherwise, function executions
will fail as the executor is unavailable.
2023-10-05 14:25:50 -07:00
Haimantika mitra 0cecdf2937 Added Hacktoberfest Contributing Guidelines 2023-10-06 01:40:30 +05:30
Eldad A. FuxandGitHub 2019552a47 Merge pull request #6476 from appwrite/fix-upgrade-executor
Fix: Upgrade executor
2023-10-05 21:56:48 +03:00
DavidandGitHub 82bde7f7e9 Merge branch 'main' into patch-4 2023-10-05 17:43:27 +02:00
shimon 948f36a023 sync with 1.4 2023-10-05 16:15:39 +03:00
Christy JacobandGitHub 2c5e4a7d28 Merge pull request #6499 from appwrite/chore-add-db-override
chore: add database overrides
2023-10-05 02:06:52 -04:00
Christy Jacob 32ba34cba5 chore: add database overrides 2023-10-05 05:58:52 +00:00
Christy Jacob adbbb6dc20 chore: add database overrides 2023-10-05 05:53:49 +00:00
Steven NguyenandGitHub c5408393c8 Update logo in README-CN.md 2023-10-04 17:26:02 -07:00
Eldad A. FuxandGitHub 8a4302ffe6 Merge pull request #6454 from appwrite/hacktoberfest-update
Update with hacktoberfest instructions.
2023-10-04 14:42:53 +03:00
shimon a643a8c907 sync with 1.4 2023-10-04 13:43:21 +03:00
Matej Bačo b6ce679b93 Merge branch '1.4.x' into cl-1.4.x 2023-10-04 10:46:38 +02:00
Eldad A. FuxandGitHub e2831ed8d2 Merge pull request #6478 from appwrite/fix-realtime-logs
Fix: realtime logs
2023-10-04 11:45:58 +03:00
shimon 7f1507f810 sync with 1.4 2023-10-04 11:20:32 +03:00
Matej Bačo 891960a977 Fix realtime logs container name 2023-10-04 10:16:02 +02:00
Matej Bačo 0f3ce658c2 Upgrade executor 2023-10-04 09:10:50 +02:00
Jake Barnby b8cfac90e2 Update specs 2023-10-04 15:13:43 +13:00
Jake Barnby d1502029d1 Fix missing array flag on migration errors response model rule 2023-10-04 15:05:42 +13:00
4a43c84b29 Update CONTRIBUTING.md
Co-authored-by: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com>
2023-10-03 15:02:17 -04:00
shimon e3668a4d06 sync with 1.4 2023-10-03 21:56:36 +03:00
shimon 429dabaaee sync with 1.4 2023-10-03 19:50:48 +03:00
shimon ce82a9efa9 remove usage executions from shared api 2023-10-03 17:41:11 +03:00
Vincent (Wen Yu) GeandGitHub 897e975b49 Update with hacktoberfest instructions. 2023-10-03 10:36:27 -04:00
shimon 3b00e396d5 sync with main 2023-10-03 15:15:13 +03:00
shimon 6d60b0bd8c sync with 1.4 2023-10-03 11:40:34 +03:00
Christy Jacob ff3c25d352 chore: update database 2023-10-02 22:23:35 +00:00
Christy JacobandGitHub 74f9ec4907 Merge pull request #6446 from appwrite/chore-update-database
chore: update database
2023-10-02 18:02:43 -04:00
Christy Jacob 29ad61d461 chore: update database 2023-10-02 22:01:42 +00:00
Christy JacobandGitHub 58165e9389 Merge pull request #6445 from appwrite/chore-patch-prevent-db-creates
chore: remove DB creates
2023-10-02 17:38:19 -04:00
Christy Jacob b456c9df2c chore: remove DB creates 2023-10-02 21:32:05 +00:00
shimon 2bb4d8fb89 sync with 1.4 2023-10-02 17:02:48 +03:00
Torsten Dittmann 7b5ee34b68 fix: more links 2023-10-02 14:32:43 +02:00
Torsten Dittmann 71775c76b1 fix: specs relative links 2023-10-02 14:26:54 +02:00
Torsten Dittmann e0dcf3f8b1 fix: relative links 2023-10-02 13:51:24 +02:00
Torsten Dittmann 4b03d6a361 fix: http links with https 2023-10-02 13:47:35 +02:00
Torsten Dittmann f230419614 chore: fix spec links 2023-10-02 13:42:44 +02:00
Torsten DittmannandGitHub 514a5c37fd Merge pull request #6253 from appwrite/feat-package-json
feat: package json
2023-10-02 13:42:20 +02:00
shimon 9995ccfd51 composer 2023-10-02 09:48:06 +03:00
shimon 75d8741eaa sync against master 2023-10-01 21:30:52 +03:00
shimon b1da87f970 migrations worker 2023-10-01 21:06:25 +03:00
shimon b02d51c794 migrations worker 2023-10-01 20:39:26 +03:00
shimon 47d27096db deletes & databases workers 2023-10-01 11:04:12 +03:00
Christy JacobandGitHub 1492c8bfb1 Merge pull request #6370 from appwrite/patch-sync-exec-timeout
Patch: Sync executions timeout
2023-09-30 16:53:52 -04:00
Matej Bačo 1502bfef74 Increase timeout 2023-09-30 17:24:09 +02:00
Matej Bačo 78dd0ca439 Merge branch 'cl-1.4.x' into patch-sync-exec-timeout 2023-09-30 16:02:33 +02:00
Christy JacobandGitHub 43de260b33 Merge pull request #6366 from appwrite/1.4.x
Update cl-1.4.x
2023-09-30 10:02:15 -04:00
Matej Bačo 515fec2858 Linter fix 2023-09-30 11:57:15 +02:00
Matej Bačo d9f2f1c37b Introduce execution sync timeout 2023-09-30 11:54:54 +02:00
Torsten DittmannandGitHub c0f44537cd Merge pull request #6365 from appwrite/chore-merge-main 2023-09-29 21:39:06 +02:00
Steven Nguyen 785304b034 Merge branch 'main' into chore-merge-main 2023-09-29 12:36:04 -07:00
Torsten DittmannandGitHub c02f5fedbc Merge pull request #6354 from appwrite/feat-bump-console 2023-09-29 21:19:04 +02:00
Torsten DittmannandGitHub 2da7cc6e69 Merge pull request #6164 from appwrite/fix-skip-non-ascii-chars-image 2023-09-29 21:18:12 +02:00
Steven Nguyen 9d47237da9 Merge branch '1.4.x' into fix-skip-non-ascii-chars-image 2023-09-29 11:07:31 -07:00
Steven Nguyen e95b4460b4 Bump console to the latest version 2023-09-29 11:06:07 -07:00
Torsten DittmannandGitHub 4205614b74 Merge pull request #6363 from appwrite/fix-avatar-tests
Fix avatars tests
2023-09-29 20:04:37 +02:00
Steven Nguyen f2feecf84e Fix avatars tests
Because the tests referenced images on the appwrite.io website, but the
appwrite.io website changed, the tests broke. This updates the tests to
reference valid images/URLs.

In addition, the favicon test was changed to use github.com because
appwrite.io has an SVG favicon which the avatars API does not support.
2023-09-29 10:25:22 -07:00
Torsten DittmannandGitHub edf06962ec Merge pull request #6350 from appwrite/update-references
chore: update references
2023-09-29 17:52:19 +02:00
Bradley Schofield 1136dc9e64 Add Test and don't stop on special char 2023-09-29 16:27:59 +01:00
Bradley Schofield 615d61d962 Merge branch '1.4.x' into fix-skip-non-ascii-chars-image 2023-09-29 09:21:17 +01:00
Christy Jacob c27d5cb721 chore: revert composer.lock 2023-09-28 22:29:49 +00:00
Christy Jacob cf4cf6c1af Merge branch '1.4.x' of https://github.com/appwrite/appwrite into cl-1.4.x 2023-09-28 22:26:25 +00:00
Christy Jacob d600ae1f74 chore: revert composer.lock 2023-09-28 22:25:53 +00:00
Christy Jacob a65c1c1ee5 chore: fix merge conflict 2023-09-28 22:22:44 +00:00
Christy JacobandGitHub 583f8dbc54 Merge pull request #6349 from appwrite/fix-empty-fulltext-search
Fix empty fulltext search
2023-09-28 15:42:07 -04:00
Christy JacobandGitHub 49155a97d4 Merge pull request #6356 from appwrite/fix-logo
chore: update banner
2023-09-28 15:20:29 -04:00
Christy Jacob fee8e7b136 chore: update banner 2023-09-28 19:05:48 +00:00
Christy Jacob edad80e84f chore: update banner 2023-09-28 18:58:56 +00:00
Christy JacobandGitHub d3e27be2d3 Merge pull request #6353 from appwrite/chore-changes-initials-fix
Update CHANGES.md to add fix for avatar initials
2023-09-28 14:47:59 -04:00
shimon 9cf83151cd certificates worker 2023-09-28 20:37:07 +03:00
Steven Nguyen c85cf65e8f Update CHANGES.md to add fix for avatar initials 2023-09-28 09:33:20 -07:00
Christy JacobandGitHub e640235704 Merge pull request #6352 from appwrite/fix-logo
chore: update logo
2023-09-28 12:07:53 -04:00
Christy Jacob 05f583ae64 chore: update logo 2023-09-28 16:07:39 +00:00
Christy Jacob 9aad825c1c chore: revert composer 2023-09-28 16:02:51 +00:00
Christy Jacob 7460114bab chore: update logo 2023-09-28 15:52:14 +00:00
Christy Jacob 64291676f0 chore: update logo 2023-09-28 15:31:18 +00:00
Christy Jacob a1802d968e chore: update references for dart and flutter 2023-09-28 13:01:54 +00:00
Christy Jacob 6314778e05 chore: update references 2023-09-28 13:00:51 +00:00
Christy Jacob 1423ad1a1c chore: update references 2023-09-28 12:56:27 +00:00
shimon a10246a9bd build && audit && usage workers 2023-09-28 13:45:15 +03:00
Jake Barnby aa1cf053f7 Add test ensuring no 500 on bad serach 2023-09-28 18:58:29 +13:00
Jake Barnby 4491975f78 Update database 2023-09-28 18:41:58 +13:00
Christy JacobandGitHub 6211a58b2b Merge pull request #6348 from appwrite/chore-generate-specs
Generate 1.4.x and latest specs
2023-09-27 20:13:57 -04:00
Steven Nguyen faf69a7a4e Generate 1.4.x and latest specs 2023-09-27 16:42:04 -07:00
Christy Jacob ac844d33ef Merge branch '1.4.x' of https://github.com/appwrite/appwrite into cl-1.4.x 2023-09-27 23:25:48 +00:00
Christy JacobandGitHub 4f88ba8b88 Merge pull request #6347 from appwrite/chore-prep-for-1.4
Chore prep for 1.4
2023-09-27 18:59:16 -04:00
Christy JacobandGitHub df3eef3471 Merge pull request #6346 from appwrite/chore-add-health-endpoints
Chore add health endpoints
2023-09-27 18:44:06 -04:00
Christy Jacob 9fa93e0449 chore: review comments 2023-09-27 22:13:03 +00:00
Christy Jacob 70988f5f7e chore: update changelog 2023-09-27 21:52:12 +00:00
Christy Jacob 9adeac5f2c chore: update changelog 2023-09-27 21:51:56 +00:00
Christy Jacob d4a8137e63 chore: update changelog 2023-09-27 21:50:07 +00:00
Christy Jacob c93780cb27 chore: generate new specs 2023-09-27 21:37:34 +00:00
Christy Jacob 0c2cd174a5 chore: prep for 1.4.4 2023-09-27 21:28:28 +00:00
Matej BačoandChristy Jacob d625b9abc8 Remvoe unnessessary comments 2023-09-27 21:25:12 +00:00
Matej BačoandChristy Jacob 2d578dddac Remove double test 2023-09-27 21:25:04 +00:00
Matej BačoandChristy Jacob e58bf7f695 Rename audits back to logs 2023-09-27 21:24:56 +00:00
Matej BačoandChristy Jacob 5120152369 Add all worker health endpoints 2023-09-27 21:24:41 +00:00
Christy JacobandGitHub 50600d6f2a Merge pull request #6343 from appwrite/master
Merge master into 1.4.x
2023-09-27 17:20:32 -04:00
Christy JacobandGitHub 540116502f Merge pull request #6342 from appwrite/feat-bump-assistant
Bump appwrite-assistant to prevent it from crashing w/o open ai key
2023-09-27 17:17:04 -04:00
Christy JacobandGitHub d0f2a101a7 Merge pull request #6332 from appwrite/fix-long-running-functions
Fix execution call timeout
2023-09-27 17:16:30 -04:00
Christy JacobandGitHub 9ec6597464 Merge pull request #6344 from appwrite/chore-bump-composer
Bump composer to fix migration bug
2023-09-27 17:14:57 -04:00
Eldad A. FuxandGitHub c659c5978f Merge pull request #6277 from appwrite/feat/avatar-colors
Update avatar font and default colors
2023-09-27 21:35:32 +03:00
Steven Nguyen 376cfc9d6a Bump composer to fix migration bug 2023-09-27 11:18:03 -07:00
Steven Nguyen 43f491c5bf Bump appwrite-assistant to prevent it from crashing w/o open ai key 2023-09-27 10:46:48 -07:00
shimon dcf0107a79 sync with master 2023-09-27 20:10:21 +03:00
shimon c4bd6e008e Merge branch 'master' of github.com:appwrite/appwrite into refactor-workers
 Conflicts:
	.env
	app/cli.php
	app/config/collections.php
	app/console
	app/controllers/api/account.php
	app/controllers/api/databases.php
	app/controllers/api/functions.php
	app/controllers/api/projects.php
	app/controllers/api/storage.php
	app/controllers/api/teams.php
	app/controllers/api/users.php
	app/controllers/general.php
	app/controllers/shared/api.php
	app/init.php
	app/worker.php
	app/workers/audits.php
	app/workers/builds.php
	app/workers/certificates.php
	app/workers/databases.php
	app/workers/deletes.php
	app/workers/functions.php
	app/workers/mails.php
	bin/worker-usage
	composer.json
	composer.lock
	docker-compose.yml
	src/Appwrite/Event/Delete.php
	src/Appwrite/Event/Mail.php
	src/Appwrite/Platform/Tasks/Maintenance.php
2023-09-27 18:51:17 +03:00
Eldad A. FuxandGitHub 59a850d8b8 Merge pull request #5926 from Dksie09/sentence-case
converted desc to sentence case
2023-09-27 18:16:40 +03:00
Vincent (Wen Yu) GeandGitHub 86f0e6008c Merge branch 'master' into sentence-case 2023-09-27 11:11:58 -04:00
Matej Bačo 872531dc95 Fix execution call timeout 2023-09-26 10:06:22 +02:00
Steven Nguyen 4a0c77a8df Update avatar font and default colors 2023-09-25 15:55:15 -07:00
Christy Jacob 79d7bd8379 chore: linter 2023-09-26 00:10:17 +04:00
Christy Jacob 39dc153a22 chore: remove comments 2023-09-26 00:05:01 +04:00
Christy Jacob 2273cb50b4 Merge branch '1.4.x' of github.com:appwrite/appwrite into cl-1.4.x 2023-09-26 00:02:19 +04:00
Christy Jacob 2856d6db84 Merge branch 'cl-1.4.x' of github.com:appwrite/appwrite into cl-1.4.x 2023-09-26 00:02:09 +04:00
Christy Jacob d4debddc46 chore: update hamster script 2023-09-26 00:01:42 +04:00
Christy Jacob d1d523e1dc chore: update hamster script 2023-09-26 00:01:34 +04:00
Christy JacobandGitHub 650677195c Merge pull request #6319 from appwrite/feat-health-queues
Feat: New health endpoints
2023-09-25 09:54:27 -04:00
Christy JacobandGitHub 6a28499f1b Merge pull request #6329 from appwrite/patch-oauth-flows-1.4.x
Patch: Disable console protection
2023-09-25 09:34:43 -04:00
Christy JacobandGitHub ad83a34857 Merge pull request #6317 from appwrite/feat-event-json-parsing
Feat: Parse event body
2023-09-25 09:34:23 -04:00
Matej Bačo 9f244f976e Remvoe unnessessary comments 2023-09-25 15:32:51 +02:00
Christy JacobandGitHub 0b19b62f39 Merge pull request #6326 from appwrite/fix-max-function-body
Fix: Execution body limit
2023-09-25 09:31:48 -04:00
Matej Bačo 420d2a9c36 @Meldiron Disable console endpoint protection 2023-09-25 15:05:51 +02:00
Matej Bačo c35f05f495 Increase max body size 2023-09-25 11:12:41 +02:00
Matej Bačo a6aa38f1d8 Fix test 2023-09-25 09:55:55 +02:00
Matej Bačo 303c8a16ca Fix test 2023-09-24 14:38:33 +02:00
Matej Bačo b4c5ef2d17 Remove double test 2023-09-24 14:36:47 +02:00
Matej Bačo 725897c896 Rename audits back to logs 2023-09-24 14:36:20 +02:00
Matej Bačo fee30e0239 Remove unnessessary test code 2023-09-24 14:34:27 +02:00
Matej Bačo 24204bce54 Add all worker health endpoints 2023-09-24 14:07:37 +02:00
Matej Bačo 310517fd29 Auto-parse event bodies + test 2023-09-24 13:19:31 +02:00
Torsten DittmannandGitHub c273e3d8e1 Merge pull request #6229 from btme0011/fix-6212-Issue-With-Linkedin-OAuth 2023-09-24 01:57:58 +02:00
Torsten DittmannandGitHub 614e91b60a Merge pull request #6260 from appwrite/fix-delete-project-domains 2023-09-24 01:54:28 +02:00
Christy JacobandGitHub 9dde039adf Merge pull request #6290 from appwrite/fix-deployment-delete
Fix deployment delete
2023-09-22 11:37:50 -04:00
Christy JacobandGitHub e35b07bf0a Merge pull request #6268 from appwrite/fix-download-deployment-desc
Add Description for Download Deployment
2023-09-22 06:24:48 -04:00
Steven Nguyen d731d2b619 Remove legacy comment 2023-09-21 15:35:40 -07:00
Steven Nguyen bb70860b92 Fix deployment and build files deletion on function delete
Make sure deployment and build paths exist before deleting fiels.
2023-09-21 14:55:08 -07:00
Matej Bačo 3e41578d61 Merge branch '1.4.x' into cl-1.4.x 2023-09-21 16:36:09 +02:00
Christy JacobandGitHub deb58a60b7 Merge pull request #6302 from appwrite/fix-migrations
Fix: migrations
2023-09-21 10:35:39 -04:00
Matej Bačo cebfc5a22d Fix migrations 2023-09-21 16:09:51 +02:00
Steven Nguyen 9ca82b7662 Fix missing resourceInternalId on deployments 2023-09-20 19:26:23 -07:00
Steven Nguyen c5e059c118 Fix delete function deployment
Prior to this, deleting a VCS deployment would fail because the
deployment path for VCS deployments are empty. Because an error gets
thrown, the delete function would stop and not delete the build files.

This change updates the worker to only delete the storage files if the
path is set.
2023-09-20 18:58:11 -07:00
Bradley Schofield 30b7b9dfae Regenerate Specs 2023-09-18 09:53:40 +01:00
Bradley Schofield 2eb62953ca Add Description for Download Deployment 2023-09-18 09:50:46 +01:00
Steven Nguyen 68b2706797 Fix project deletion
The project deletion failed because old code for deleting domain was
still present. By removing the old code and replacing it with the new
delete rule code, the project deletion is now working.
2023-09-15 17:04:56 -07:00
Torsten Dittmann c1b0ef206b chore: remove unused props from package.json 2023-09-15 14:20:46 +02:00
Torsten Dittmann c58f5a4522 chore: add package.json 2023-09-15 14:17:10 +02:00
Akhil Anand 5ba6491dd5 fix-6212-Issue-With-Linkedin-OAuth 2023-09-14 13:16:45 +05:30
Akhil AnandandGitHub 01ecfc51ea Merge branch 'appwrite:master' into fix-6212-Issue-With-Linkedin-OAuth 2023-09-14 13:09:44 +05:30
Akhil Anand 2aa788d7d5 fix-6212-Issue-With-Linkedin-OAuth 2023-09-13 21:31:26 +05:30
Bradley Schofield 8e0e131824 Remove Special Chars from Initials 2023-09-06 09:54:59 +01:00
Dakshi 16a2135d4a updated based on review 2023-08-02 02:19:20 +05:30
Dakshi 12228ccef4 converted desc to sentence case 2023-08-01 20:56:48 +05:30
shimon 1fd7f0c5d7 SSl task 2023-07-18 10:54:11 +03:00
shimon d28a235b4d $projectInternalId rollback to false 2023-07-17 16:31:19 +03:00
DavidandGitHub 3a42dca19e Update es.json
Fixed suggested changes by Matej
2023-07-17 13:44:04 +02:00
shimon d1d1392bb3 small adjustments 2023-07-12 11:12:56 +03:00
shimon 58aa29a4ae cli 2023-07-11 18:47:38 +03:00
shimon e950945170 users addition 2023-07-11 18:46:21 +03:00
1358d6c455 Update src/Appwrite/Platform/Workers/Audits.php
Co-authored-by: Damodar Lohani <lohanidamodar@users.noreply.github.com>
2023-07-10 11:13:35 +03:00
shimon 5366d90ff2 users addition 2023-07-10 11:07:54 +03:00
shimon 89f0146c45 users addition 2023-07-10 11:03:59 +03:00
shimon 785c00ae5c functions/builds/deletes worker 2023-06-12 13:04:47 +03:00
shimon 57bc7d0584 functions/builds/deletes worker 2023-06-11 17:08:48 +03:00
shimon fd4f86b1c1 functions/builds/deletes worker 2023-06-11 13:29:04 +03:00
shimon 62c619434e functions/builds/deletes worker 2023-06-05 19:13:00 +03:00
shimon d820d93ac7 databases worker 2023-06-04 19:25:56 +03:00
shimon 0d2987620c refactor workers 2023-06-04 11:19:49 +03:00
shimon 6e7c160249 changing event signature 2023-06-02 06:54:34 +03:00
shimon 73f3f0aee6 Messaging 2023-05-30 16:19:44 +03:00
shimon 478e83a4bf Messaging 2023-05-30 11:53:52 +03:00
shimon 06ca9ce815 Messaging 2023-05-29 19:32:33 +03:00
shimon 5a22d17459 Mails 2023-05-29 18:03:09 +03:00
shimon f1466c05cf refactor workers 2023-05-29 16:58:45 +03:00
shimon 543efd6032 re-working worker flow 2023-05-23 16:43:34 +03:00
shimon 98dc1db878 re-working worker flow 2023-05-23 16:43:03 +03:00
shimon 432ee72071 Merge branch 'feat-db-pools' of github.com:appwrite/appwrite into refactor-workers
 Conflicts:
	app/cli.php
	app/console
	app/controllers/api/account.php
	app/controllers/api/functions.php
	app/controllers/api/teams.php
	app/controllers/shared/api.php
	app/init.php
	app/worker.php
	app/workers/builds.php
	app/workers/certificates.php
	app/workers/deletes.php
	app/workers/functions.php
	app/workers/mails.php
	src/Appwrite/Event/Event.php
	src/Appwrite/Event/Mail.php
2023-05-22 18:41:24 +03:00
DavidandGitHub 536bcf28b5 Corrected spanish translations (emails)
Some translations to spanish had some misspellings and redaction issues. Fixed that.
2023-03-28 21:05:38 +02:00
Bradley Schofield c0daed3644 Refactor names and cleanup code 2022-12-20 16:11:30 +00:00
Bradley Schofield 0b17a737fe Fix Functions Worker 2022-12-20 15:42:04 +00:00
Bradley Schofield 1cd84aacc7 Update Event.php 2022-12-20 13:06:57 +00:00
Bradley Schofield 740bae6a99 Update console 2022-12-20 13:01:39 +00:00
Bradley Schofield 284ce42177 Merge branch 'feat-db-pools' into refactor-schedulers-workers 2022-12-20 13:01:27 +00:00
Bradley Schofield e577c04fae Update Maintenance.php 2022-12-20 12:49:33 +00:00
Bradley Schofield b0c8e8980d Continue removing resque 2022-12-20 12:48:55 +00:00
Bradley Schofield 886a1a2abb Port Deletes and Builds worker 2022-12-20 12:22:58 +00:00
Bradley Schofield f2e8a619da Merge branch 'refactor-scheduler-messaging' into refactor-schedulers-workers 2022-12-20 11:24:58 +00:00
Bradley Schofield 6f3a057608 Merge branch 'refactor-scheduler-emails' into refactor-schedulers-workers 2022-12-20 11:24:26 +00:00
Bradley Schofield 11bd518b6a Merge branch 'refactor-scheduler-database' into refactor-schedulers-workers 2022-12-20 11:23:26 +00:00
Bradley Schofield 3e66d1a549 Rename certificate queue 2022-12-20 11:21:07 +00:00
Bradley Schofield 169386d0b3 Merge branch 'refactor-sceduler-certificates' into refactor-schedulers-workers 2022-12-20 11:20:52 +00:00
Bradley Schofield d52fa1169a Merge Audits 2022-12-20 11:11:36 +00:00
Bradley Schofield a09e23d0b9 Start work on porting webhooks 2022-12-20 11:07:49 +00:00
Bradley Schofield ab7c04074c Update Phone.php 2022-12-17 21:23:15 +00:00
Bradley Schofield 50f82a276f Run Linter 2022-12-17 20:46:34 +00:00
Bradley Schofield a8595eaca2 Port Messages worker to Utopia queue system 2022-12-17 20:45:58 +00:00
Bradley Schofield 2e49666ee6 Port Mail Worker from resque to Utopia Queue 2022-12-17 19:19:41 +00:00
Bradley Schofield e4ad14c794 Run Linter 2022-12-13 15:56:36 +00:00
Bradley Schofield 02271c5329 Remove debug force true 2022-12-13 15:54:37 +00:00
Bradley Schofield 6e6a6d5518 Migrate Database worker to Utopia Queue system 2022-12-13 15:54:01 +00:00
Bradley Schofield b7d7a71994 Run Linter 2022-12-13 11:18:38 +00:00
Bradley Schofield 21afa43127 Port Certificates to new Queue system 2022-12-13 11:16:12 +00:00
Bradley Schofield 85268cbae2 Run Linter 2022-12-06 15:15:16 +00:00
Bradley Schofield 84f1a15a4c Refactor Audit Worker to use Utopia Queue system 2022-12-06 15:06:40 +00:00
328 changed files with 59636 additions and 3725 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
[submodule "app/console"]
path = app/console
url = https://github.com/appwrite/console
branch = 3.1.1
branch = 3.2.3
+54
View File
@@ -1,3 +1,57 @@
# Version 1.4.6
## Changes
- Bump console to version 3.2.3 in [#6947](https://github.com/appwrite/appwrite/pull/6947)
- New health endpoints in [#6319](https://github.com/appwrite/appwrite/pull/6319)
- 30 second sync executions timeout in [#6370](https://github.com/appwrite/appwrite/pull/6370)
- Feat db per worker in [#6888](https://github.com/appwrite/appwrite/pull/6888)
- Feat: Dart 3.1 support in [#6936](https://github.com/appwrite/appwrite/pull/6936)
- chore: remove resque library and update health check endpoints in [#6946](https://github.com/appwrite/appwrite/pull/6946)
- Refactor workers in [#6928](https://github.com/appwrite/appwrite/pull/6928)
## Fixes
- Fix realtime deletes in [#6897](https://github.com/appwrite/appwrite/pull/6897)
- Update teamInternalId when updating project team in [#6898](https://github.com/appwrite/appwrite/pull/6898)
- Fix: spanish translations (emails) in [#5290](https://github.com/appwrite/appwrite/pull/5290)
- chore: fix spec links in [#6434](https://github.com/appwrite/appwrite/pull/6434)
- Delegate custom deletes in [#6934](https://github.com/appwrite/appwrite/pull/6934)
# Version 1.4.5
## Changes
- Bump console to version 3.2.1 in [#6868](https://github.com/appwrite/appwrite/pull/6868)
## Fixes
- Fix realtime logs in [#6478](https://github.com/appwrite/appwrite/pull/6478)
- Fix "File not found" error in executor in [#6476](https://github.com/appwrite/appwrite/pull/6476)
- Fix missing array flag on migration errors response model rule in [#6469](https://github.com/appwrite/appwrite/pull/6469)
- Ensure openruntimes-executor restarts after a server reboot in [#6490](https://github.com/appwrite/appwrite/pull/6490)
# Version 1.4.4
## Features
- Feat: Function domains force https in [#6269](https://github.com/appwrite/appwrite/pull/6269)
- Feat: router protection in [#6272](https://github.com/appwrite/appwrite/pull/6272)
- Feat: Parse event body in [#6317](https://github.com/appwrite/appwrite/pull/6317)
## Fixes
- Fix: wrong device type in [#6271](https://github.com/appwrite/appwrite/pull/6271)
- Fix: build race condition in [#6270](https://github.com/appwrite/appwrite/pull/6270)
- Fix: Large builds in [#6273](https://github.com/appwrite/appwrite/pull/6273)
- Fix: migrations in [#6302](https://github.com/appwrite/appwrite/pull/6302)
- Add Description for Download Deployment in [#6268](https://github.com/appwrite/appwrite/pull/6268)
- Fix deployment delete in [#6290](https://github.com/appwrite/appwrite/pull/6290)
- Fix project deletion in [#6260](https://github.com/appwrite/appwrite/pull/6260)
- fix-6212-Issue-With-Linkedin-OAuth in [#6229](https://github.com/appwrite/appwrite/pull/6229)
- Fix: Execution body limit in [#6326](https://github.com/appwrite/appwrite/pull/6326)
- Patch: Disable console protection in [#6329](https://github.com/appwrite/appwrite/pull/6329)
- converted desc to sentence case in [#5926](https://github.com/appwrite/appwrite/pull/5926)
- Update avatar font and default colors in [#6277](https://github.com/appwrite/appwrite/pull/6277)
- Bump composer to fix migration bug in [#6344](https://github.com/appwrite/appwrite/pull/6344)
- Fix execution call timeout in [#6332](https://github.com/appwrite/appwrite/pull/6332)
- Bump appwrite-assistant to prevent it from crashing w/o open ai key in [#6342](https://github.com/appwrite/appwrite/pull/6342)
- Remove Special Chars from Initials [#6164](https://github.com/appwrite/appwrite/pull/6164)
# Version 1.4.3
## Features
+5 -2
View File
@@ -2,6 +2,11 @@
We would ❤️ you to contribute to Appwrite and help make it better! We want contributing to Appwrite to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, and new docs, as well as updates and tweaks, blog posts, workshops, and more.
## Here for Hacktoberfest?
If you're here to contribute during Hacktoberfest, we're so happy to see you here. Appwrite has been a long-time participant of Hacktoberfest and we welcome you, whatever your experience level. This year, we're **only taking contributions for issues tagged** `hacktoberfest`, so we can focus our resources to support your contributions.
You can [find issues using this query](https://github.com/search?q=org%3Aappwrite+is%3Aopen+type%3Aissue+label%3Ahacktoberfest&type=issues).
## How to Start?
If you are worried or dont know where to start, check out the next section that explains what kind of help we could use and where you can get involved. You can send your questions to [@appwrite](https://twitter.com/appwrite) on Twitter or to anyone from the [Appwrite team on Discord](https://appwrite.io/discord). You can also submit an issue, and a maintainer can guide you!
@@ -201,7 +206,6 @@ Appwrite's current structure is a combination of both [Monolithic](https://en.wi
│ ├── Network
│ ├── OpenSSL
│ ├── Promises
│ ├── Resque
│ ├── Specification
│ ├── Task
│ ├── Template
@@ -246,7 +250,6 @@ Appwrite stack is a combination of a variety of open-source technologies and too
- Imagemagick - for manipulating and managing image media files.
- Webp - for better compression of images on supporting clients.
- SMTP - for sending email messages and alerts.
- Resque - for managing data queues and scheduled tasks over a Redis server.
## Package Managers
+57
View File
@@ -0,0 +1,57 @@
# Appwrite hacktoberfest contribution
Welcome to the Appwrite Hacktoberfest contribution! We appreciate your interest in contributing to our open-source project. Please read this carefully to understand how to get started and make your contributions count.
## Familiarize with the project
Before you start contributing, familiarize yourself with our project by reading the [main README](https://github.com/appwrite/appwrite/blob/main/README.md).
## Code of conduct
Please ensure that you always follow our [Code of Conduct](https://github.com/appwrite/awesome-appwrite/blob/master/CODE_OF_CONDUCT.md). We aim to maintain a respectful and inclusive community.
## Contributing guide
Please review our [Contributing Guide](https://github.com/appwrite/appwrite/blob/main/CONTRIBUTING.md) before contributing. It will help you learn about the architecture, instructions on how to update code, run tests, and submit a PR.
## Hacktoberfest contribution guidelines
To participate in Hacktoberfest with Appwrite, follow these guidelines:
1. **Valid issues**: To make your contribution count, please look for issues labeled with `hacktoberfest`. Only issues labeled with `hacktoberfest` will count as a valid contribution.
2. **Wait for issue assignment**: After you have identified an issue to work on, please wait for it to be assigned to you by our team. We assign issues on a first-come, first-serve basis.
3. **Knowing about labels**: We do not have the `hacktoberfest` label in our repositories, but we use it on specific issues. For your pull request to be valid, our team will review and add the `hacktoberfest-accepted` label once it meets the criteria.
4. **Discuss new issues**: If you're interested in finding and adding new issues for Hacktoberfest, please discuss it with the team on our [Discord server](https://appwrite.io/discord) in the `#hacktoberfest` channel.
5. **Be patient with pull request reviews**: PR reviews may take up to 15 days due to the volume of contributions. However, we also host PR review parties every week where you can add your PRs for instant review.
6. **Regular updates**: If you've been assigned an issue, it's essential to share updates every 3 days. Failure to do so may result in being unassigned from the issue.
## Getting started
1. Fork the Appwrite repository you'd like to contribute to.
2. Clone your forked repository to your local machine.
```bash
git clone https://github.com/your-username/repository-name.git
```
3. Create a new branch for your contribution.
```bash
git checkout -b TYPE-ISSUE_ID-DESCRIPTION
```
4. Make your changes, commit them, and push them to your forked repository.
```bash
git commit -m "Add your commit message here"
git push origin TYPE-ISSUE_ID-DESCRIPTION
```
5. Create a Pull Request (PR) from your forked repository to the Appwrite repository. Be sure to reference the issue you are addressing in your PR description.
Thank you for contributing to Appwrite, and we look forward to your Hacktoberfest contributions! If you have any questions or need assistance, feel free to ask on our Discord server or in the issue discussion. Happy hacking!
+10 -10
View File
@@ -2,7 +2,7 @@
<br />
<p align="center">
<a href="https://appwrite.io" target="_blank"><img width="260" height="39" src="https://appwrite.io/images/appwrite.svg" alt="Appwrite Logo"></a>
<a href="https://appwrite.io" target="_blank"><img src="./public/images/banner.png" alt="Appwrite Logo"></a>
<br />
<br />
<b>适用于[Flutter/Vue/Angular/React/iOS/Android/* 等等平台 *]的完整后端服务</b>
@@ -66,7 +66,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.4.3
appwrite/appwrite:1.4.6
```
### Windows
@@ -78,7 +78,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.4.3
appwrite/appwrite:1.4.6
```
#### PowerShell
@@ -88,7 +88,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.4.3
appwrite/appwrite:1.4.6
```
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
@@ -113,14 +113,14 @@ docker run -it --rm `
### 软件服务
* [**帐户**](https://appwrite.io/docs/client/account) -管理当前用户的帐户和登录方式。跟踪和管理用户 Session,登录设备,登录方法和查看相关记录。
* [**帐户**](https://appwrite.io/docs/references/cloud/client-web/account) -管理当前用户的帐户和登录方式。跟踪和管理用户 Session,登录设备,登录方法和查看相关记录。
* [**用户**](https://appwrite.io/docs/server/users) - 在以管理员模式登录时管理和列出所有用户。
* [**团队**](https://appwrite.io/docs/client/teams) - 管理用户分组。邀请成员,管理团队中的用户权限和用户角色。
* [**数据库**](https://appwrite.io/docs/client/databases) - 管理数据库文档和文档集。用检索界面来对文档和文档集进行读取,创建,更新,和删除。
* [**贮存**](https://appwrite.io/docs/client/storage) - 管理文件的阅读、创建、删除和预览。设置文件的预览来满足程序的个性化需求。所有文件都由 ClamAV 扫描并安全存储和加密。
* [**团队**](https://appwrite.io/docs/references/cloud/client-web/teams) - 管理用户分组。邀请成员,管理团队中的用户权限和用户角色。
* [**数据库**](https://appwrite.io/docs/references/cloud/client-web/databases) - 管理数据库文档和文档集。用检索界面来对文档和文档集进行读取,创建,更新,和删除。
* [**贮存**](https://appwrite.io/docs/references/cloud/client-web/storage) - 管理文件的阅读、创建、删除和预览。设置文件的预览来满足程序的个性化需求。所有文件都由 ClamAV 扫描并安全存储和加密。
* [**云函数**](https://appwrite.io/docs/server/functions) - 在安全,隔离的环境中运行自定义代码。这些代码可以被事件,CRON,或者手动操作触发。
* [**语言适配**](https://appwrite.io/docs/client/locale) - 根据用户所在的的国家和地区做出合适的语言适配。
* [**头像**](https://appwrite.io/docs/client/avatars) -管理用户头像、国家旗帜、浏览器图标、信用卡符号,和生成二维码。
* [**语言适配**](https://appwrite.io/docs/references/cloud/client-web/locale) - 根据用户所在的的国家和地区做出合适的语言适配。
* [**头像**](https://appwrite.io/docs/references/cloud/client-web/avatars) -管理用户头像、国家旗帜、浏览器图标、信用卡符号,和生成二维码。
如需完整的 API 界面文档,请访问 [https://appwrite.io/docs](https://appwrite.io/docs)。如需更多教程、新闻和公告,请订阅我们的 [博客](https://medium.com/appwrite-io) 和 加入我们的[Discord 社区](https://discord.gg/GSeTUeA)。
### 开发套件
+11 -10
View File
@@ -2,7 +2,8 @@
<br />
<p align="center">
<a href="https://appwrite.io" target="_blank"><img width="260" height="39" src="https://appwrite.io/images/appwrite.svg" alt="Appwrite Logo"></a>
<a href="https://appwrite.io" target="_blank"><img src="./public/images/banner.png" alt="Appwrite Logo"></a>
<br />
<br />
<b>Appwrite is a backend platform for developing Web, Mobile, and Flutter applications. Built with the open source community and optimized for developer experience in the coding languages you love.</b>
<br />
@@ -75,7 +76,7 @@ docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="install" \
appwrite/appwrite:1.4.3
appwrite/appwrite:1.4.6
```
### Windows
@@ -87,7 +88,7 @@ docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
--entrypoint="install" ^
appwrite/appwrite:1.4.3
appwrite/appwrite:1.4.6
```
#### PowerShell
@@ -97,7 +98,7 @@ docker run -it --rm `
--volume /var/run/docker.sock:/var/run/docker.sock `
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
--entrypoint="install" `
appwrite/appwrite:1.4.3
appwrite/appwrite:1.4.6
```
Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation.
@@ -150,15 +151,15 @@ Getting started with Appwrite is as easy as creating a new project, choosing you
### Services
- [**Account**](https://appwrite.io/docs/client/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
- [**Account**](https://appwrite.io/docs/references/cloud/client-web/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
- [**Users**](https://appwrite.io/docs/server/users) - Manage and list all project users when building backend integrations with Server SDKs.
- [**Teams**](https://appwrite.io/docs/client/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
- [**Databases**](https://appwrite.io/docs/client/databases) - Manage databases, collections, and documents. Read, create, update, and delete documents and filter lists of document collections using advanced filters.
- [**Storage**](https://appwrite.io/docs/client/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to perfectly fit your app. All files are scanned by ClamAV and stored in a secure and encrypted way.
- [**Teams**](https://appwrite.io/docs/references/cloud/client-web/teams) - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
- [**Databases**](https://appwrite.io/docs/references/cloud/client-web/databases) - Manage databases, collections, and documents. Read, create, update, and delete documents and filter lists of document collections using advanced filters.
- [**Storage**](https://appwrite.io/docs/references/cloud/client-web/storage) - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to perfectly fit your app. All files are scanned by ClamAV and stored in a secure and encrypted way.
- [**Functions**](https://appwrite.io/docs/server/functions) - Customize your Appwrite server by executing your custom code in a secure, isolated environment. You can trigger your code on any Appwrite system event either manually or using a CRON schedule.
- [**Realtime**](https://appwrite.io/docs/realtime) - Listen to real-time events for any of your Appwrite services including users, storage, functions, databases, and more.
- [**Locale**](https://appwrite.io/docs/client/locale) - Track your user's location and manage your app locale-based data.
- [**Avatars**](https://appwrite.io/docs/client/avatars) - Manage your users' avatars, countries' flags, browser icons, and credit card symbols. Generate QR codes from links or plaintext strings.
- [**Locale**](https://appwrite.io/docs/references/cloud/client-web/locale) - Track your user's location and manage your app locale-based data.
- [**Avatars**](https://appwrite.io/docs/references/cloud/client-web/avatars) - Manage your users' avatars, countries' flags, browser icons, and credit card symbols. Generate QR codes from links or plaintext strings.
For the complete API documentation, visit [https://appwrite.io/docs](https://appwrite.io/docs). For more tutorials, news and announcements check out our [blog](https://medium.com/appwrite-io) and [Discord Server](https://discord.gg/GSeTUeA).
Binary file not shown.
Binary file not shown.
+15 -6
View File
@@ -3,6 +3,8 @@
require_once __DIR__ . '/init.php';
require_once __DIR__ . '/controllers/general.php';
use Appwrite\Event\Delete;
use Appwrite\Event\Certificate;
use Appwrite\Event\Func;
use Appwrite\Platform\Appwrite;
use Utopia\CLI\CLI;
@@ -17,6 +19,7 @@ use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Logger\Log;
use Utopia\Pools\Group;
use Utopia\Queue\Connection;
use Utopia\Registry\Registry;
Authorization::disable();
@@ -86,7 +89,7 @@ CLI::setResource('dbForConsole', function ($pools, $cache) {
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, $cache) {
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
$getProjectDB = function (Document $project) use ($pools, $dbForConsole, $cache, &$databases) {
return function (Document $project) use ($pools, $dbForConsole, $cache, &$databases) {
if ($project->isEmpty() || $project->getId() === 'console') {
return $dbForConsole;
}
@@ -112,8 +115,6 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForConsole,
return $database;
};
return $getProjectDB;
}, ['pools', 'dbForConsole', 'cache']);
CLI::setResource('influxdb', function (Registry $register) {
@@ -140,10 +141,18 @@ CLI::setResource('influxdb', function (Registry $register) {
return $database;
}, ['register']);
CLI::setResource('queueForFunctions', function (Group $pools) {
return new Func($pools->get('queue')->pop()->getResource());
CLI::setResource('queue', function (Group $pools) {
return $pools->get('queue')->pop()->getResource();
}, ['pools']);
CLI::setResource('queueForFunctions', function (Connection $queue) {
return new Func($queue);
}, ['queue']);
CLI::setResource('queueForDeletes', function (Connection $queue) {
return new Delete($queue);
}, ['queue']);
CLI::setResource('queueForCertificates', function (Connection $queue) {
return new Certificate($queue);
}, ['queue']);
CLI::setResource('logError', function (Registry $register) {
return function (Throwable $error, string $namespace, string $action) use ($register) {
$logger = $register->get('logger');
+5 -1
View File
@@ -460,12 +460,16 @@ return [
'description' => 'Database not found',
'code' => 404
],
Exception::DATABASE_ALREADY_EXISTS => [
'name' => Exception::DATABASE_ALREADY_EXISTS,
'description' => 'Database already exists',
'code' => 409
],
Exception::DATABASE_TIMEOUT => [
'name' => Exception::DATABASE_TIMEOUT,
'description' => 'Database timed out. Try adjusting your queries or adding an index.',
'code' => 408
],
/** Collections */
Exception::COLLECTION_NOT_FOUND => [
+19 -19
View File
@@ -2,31 +2,31 @@
"settings.inspire": "\"El arte de ser sabio es el arte de saber qué pasar por alto\"",
"settings.locale": "es",
"settings.direction": "ltr",
"emails.sender": "Equipo %s",
"emails.sender": "El equipo de %s",
"emails.verification.subject": "Verificación de cuenta",
"emails.verification.hello": "Hola {{user}}",
"emails.verification.body": "Haz clic en este enlace para verificar tu correo.",
"emails.verification.hello": "Hola, {{name}}",
"emails.verification.body": "Haz clic en este enlace para verificar tu correo:",
"emails.verification.footer": "Si no has solicitado verificar este correo, puedes ignorar este mensaje.",
"emails.verification.thanks": "Gracias",
"emails.verification.signature": "Equipo de {{project}}",
"emails.verification.thanks": "Gracias.",
"emails.verification.signature": "El equipo de {{project}}.",
"emails.magicSession.subject": "Inicio de sesión",
"emails.magicSession.hello": "Hola,",
"emails.magicSession.body": "Haz clic en este enlace para iniciar sesión.",
"emails.magicSession.footer": "Si no has solicitado ingresar usando este correo, puedes ignorar este mensaje.",
"emails.magicSession.thanks": "Gracias",
"emails.magicSession.signature": "Equipo de {{project}}",
"emails.magicSession.hello": "Hola",
"emails.magicSession.body": "Haz clic en este enlace para iniciar sesión:",
"emails.magicSession.footer": "Si no has solicitado iniciar sesión usando este correo, puedes ignorar este mensaje.",
"emails.magicSession.thanks": "Gracias.",
"emails.magicSession.signature": "El equipo de {{project}}",
"emails.recovery.subject": "Restablecer contraseña",
"emails.recovery.hello": "Hola {{user}}",
"emails.recovery.body": "Haz clic en este enlace para restablecer la contraseña de {{project}}.",
"emails.recovery.hello": "Hola, {{name}}",
"emails.recovery.body": "Haz clic en este enlace para restablecer la contraseña de {{project}}:",
"emails.recovery.footer": "Si no has solicitado restablecer la contraseña, puedes ignorar este mensaje.",
"emails.recovery.thanks": "Gracias",
"emails.recovery.signature": "Equipo de {{project}}",
"emails.recovery.thanks": "Gracias.",
"emails.recovery.signature": "El equipo de {{project}}",
"emails.invitation.subject": "Invitación al equipo %s en %s",
"emails.invitation.hello": "Hola",
"emails.invitation.body": "Este correo ha sido enviado a petición de {{owner}} quien quiere invitarte a formar parte del equipo {{team}} en {{project}}.",
"emails.invitation.footer": "Si no estas interesado, puedes ignorar este mensaje.",
"emails.invitation.thanks": "Gracias",
"emails.invitation.signature": "Equipo de {{project}}",
"emails.invitation.body": "Este correo ha sido enviado a petición de {{owner}} quién quiere invitarte a formar parte del equipo {{team}} en {{project}}.",
"emails.invitation.footer": "Si no estás interesado, puedes ignorar este mensaje.",
"emails.invitation.thanks": "Gracias.",
"emails.invitation.signature": "El equipo de {{project}}",
"locale.country.unknown": "Desconocido",
"countries.af": "Afganistán",
"countries.ao": "Angola",
@@ -229,4 +229,4 @@
"continents.na": "América del Norte",
"continents.oc": "Oceanía",
"continents.sa": "América del Sur"
}
}
+2 -2
View File
@@ -8,7 +8,7 @@ return [
APP_PLATFORM_CLIENT => [
'key' => APP_PLATFORM_CLIENT,
'name' => 'Client',
'description' => 'Client libraries for integrating with Appwrite to build client-based applications and websites. Read the [getting started for web](/docs/getting-started-for-web) or [getting started for Flutter](/docs/getting-started-for-flutter) tutorials to start building your first application.',
'description' => 'Client libraries for integrating with Appwrite to build client-based applications and websites. Read the [getting started for web](https://appwrite.io/docs/getting-started-for-web) or [getting started for Flutter](https://appwrite.io/docs/getting-started-for-flutter) tutorials to start building your first application.',
'enabled' => true,
'beta' => false,
'sdks' => [
@@ -224,7 +224,7 @@ return [
APP_PLATFORM_SERVER => [
'key' => APP_PLATFORM_SERVER,
'name' => 'Server',
'description' => 'Libraries for integrating with Appwrite to build server side integrations. Read the [getting started for server](/docs/getting-started-for-server) tutorial to start building your first server integration.',
'description' => 'Libraries for integrating with Appwrite to build server side integrations. Read the [getting started for server](https://appwrite.io/docs/getting-started-for-server) tutorial to start building your first server integration.',
'enabled' => true,
'beta' => false,
'sdks' => [
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
+118 -117
View File
@@ -50,7 +50,7 @@ $oauthDefaultSuccess = '/auth/oauth2/success';
$oauthDefaultFailure = '/auth/oauth2/failure';
App::post('/v1/account')
->desc('Create Account')
->desc('Create account')
->groups(['api', 'account', 'auth'])
->label('event', 'users.[userId].create')
->label('scope', 'public')
@@ -76,8 +76,9 @@ App::post('/v1/account')
->inject('user')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents) {
$email = \strtolower($email);
if ('console' === $project->getId()) {
$whitelistEmails = $project->getAttribute('authWhitelistEmails');
@@ -156,7 +157,7 @@ App::post('/v1/account')
Authorization::setRole(Role::user($user->getId())->toString());
Authorization::setRole(Role::users()->toString());
$events->setParam('userId', $user->getId());
$queueForEvents->setParam('userId', $user->getId());
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -165,7 +166,7 @@ App::post('/v1/account')
App::post('/v1/account/sessions/email')
->alias('/v1/account/sessions')
->desc('Create Email Session')
->desc('Create email session')
->groups(['api', 'account', 'auth', 'session'])
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
@@ -193,8 +194,8 @@ App::post('/v1/account/sessions/email')
->inject('project')
->inject('locale')
->inject('geodb')
->inject('events')
->action(function (string $email, string $password, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $events) {
->inject('queueForEvents')
->action(function (string $email, string $password, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) {
$email = \strtolower($email);
$protocol = $request->getProtocol();
@@ -276,7 +277,7 @@ App::post('/v1/account/sessions/email')
->setAttribute('expire', $expire)
;
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId())
;
@@ -285,7 +286,7 @@ App::post('/v1/account/sessions/email')
});
App::get('/v1/account/sessions/oauth2/:provider')
->desc('Create OAuth2 Session')
->desc('Create OAuth2 session')
->groups(['api', 'account'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('scope', 'public')
@@ -351,7 +352,7 @@ App::get('/v1/account/sessions/oauth2/:provider')
});
App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
->desc('OAuth2 Callback')
->desc('OAuth2 callback')
->groups(['account'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('scope', 'public')
@@ -383,7 +384,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
});
App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
->desc('OAuth2 Callback')
->desc('OAuth2 callback')
->groups(['account'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('scope', 'public')
@@ -416,7 +417,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
});
App::get('/v1/account/sessions/oauth2/:provider/redirect')
->desc('OAuth2 Redirect')
->desc('OAuth2 redirect')
->groups(['api', 'account', 'session'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('event', 'users.[userId].sessions.[sessionId].create')
@@ -440,8 +441,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
->inject('user')
->inject('dbForProject')
->inject('geodb')
->inject('events')
->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Reader $geodb, Event $events) use ($oauthDefaultSuccess) {
->inject('queueForEvents')
->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) {
$protocol = $request->getProtocol();
$callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId();
@@ -758,7 +759,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
$session->setAttribute('expire', $expire);
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId())
->setPayload($response->output($session, Response::MODEL_SESSION))
@@ -872,7 +873,7 @@ App::delete('/v1/account/identities/:identityId')
});
App::post('/v1/account/sessions/magic-url')
->desc('Create Magic URL session')
->desc('Create magic URL session')
->groups(['api', 'account'])
->label('scope', 'public')
->label('auth.type', 'magic-url')
@@ -897,9 +898,9 @@ App::post('/v1/account/sessions/magic-url')
->inject('project')
->inject('dbForProject')
->inject('locale')
->inject('events')
->inject('mails')
->action(function (string $userId, string $email, string $url, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Locale $locale, Event $events, Mail $mails) {
->inject('queueForEvents')
->inject('queueForMails')
->action(function (string $userId, string $email, string $url, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails) {
if (empty(App::getEnv('_APP_SMTP_HOST'))) {
throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP disabled');
@@ -1020,7 +1021,7 @@ App::post('/v1/account/sessions/magic-url')
$replyTo = $smtp['replyTo'];
}
$mails
$queueForMails
->setSmtpHost($smtp['host'] ?? '')
->setSmtpPort($smtp['port'] ?? '')
->setSmtpUsername($smtp['username'] ?? '')
@@ -1042,7 +1043,7 @@ App::post('/v1/account/sessions/magic-url')
$subject = $customTemplate['subject'] ?? $subject;
}
$mails
$queueForMails
->setSmtpReplyTo($replyTo)
->setSmtpSenderEmail($senderEmail)
->setSmtpSenderName($senderName);
@@ -1066,14 +1067,14 @@ App::post('/v1/account/sessions/magic-url')
'redirect' => $url
];
$mails
$queueForMails
->setSubject($subject)
->setBody($body)
->setVariables($emailVariables)
->setRecipient($email)
->trigger();
$events->setPayload(
$queueForEvents->setPayload(
$response->output(
$token->setAttribute('secret', $loginSecret),
Response::MODEL_TOKEN
@@ -1090,7 +1091,7 @@ App::post('/v1/account/sessions/magic-url')
});
App::put('/v1/account/sessions/magic-url')
->desc('Create Magic URL session (confirmation)')
->desc('Create magic URL session (confirmation)')
->groups(['api', 'account', 'session'])
->label('scope', 'public')
->label('event', 'users.[userId].sessions.[sessionId].create')
@@ -1117,8 +1118,8 @@ App::put('/v1/account/sessions/magic-url')
->inject('project')
->inject('locale')
->inject('geodb')
->inject('events')
->action(function (string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $events) {
->inject('queueForEvents')
->action(function (string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) {
/** @var Utopia\Database\Document $user */
@@ -1186,7 +1187,7 @@ App::put('/v1/account/sessions/magic-url')
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed saving user to DB');
}
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId());
@@ -1212,7 +1213,7 @@ App::put('/v1/account/sessions/magic-url')
});
App::post('/v1/account/sessions/phone')
->desc('Create Phone session')
->desc('Create phone session')
->groups(['api', 'account'])
->label('scope', 'public')
->label('auth.type', 'phone')
@@ -1235,10 +1236,10 @@ App::post('/v1/account/sessions/phone')
->inject('user')
->inject('project')
->inject('dbForProject')
->inject('events')
->inject('messaging')
->inject('queueForEvents')
->inject('queueForMessaging')
->inject('locale')
->action(function (string $userId, string $phone, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $events, EventPhone $messaging, Locale $locale) {
->action(function (string $userId, string $phone, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents, EventPhone $queueForMessaging, Locale $locale) {
if (empty(App::getEnv('_APP_SMS_PROVIDER'))) {
throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured');
@@ -1326,12 +1327,12 @@ App::post('/v1/account/sessions/phone')
$message = $message->setParam('{{token}}', $secret);
$message = $message->render();
$messaging
$queueForMessaging
->setRecipient($phone)
->setMessage($message)
->trigger();
$events->setPayload(
$queueForEvents->setPayload(
$response->output(
$token->setAttribute('secret', $secret),
Response::MODEL_TOKEN
@@ -1348,7 +1349,7 @@ App::post('/v1/account/sessions/phone')
});
App::put('/v1/account/sessions/phone')
->desc('Create Phone Session (confirmation)')
->desc('Create phone session (confirmation)')
->groups(['api', 'account', 'session'])
->label('scope', 'public')
->label('event', 'users.[userId].sessions.[sessionId].create')
@@ -1370,8 +1371,8 @@ App::put('/v1/account/sessions/phone')
->inject('project')
->inject('locale')
->inject('geodb')
->inject('events')
->action(function (string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $events) {
->inject('queueForEvents')
->action(function (string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) {
$userFromRequest = Authorization::skip(fn() => $dbForProject->getDocument('users', $userId));
@@ -1435,7 +1436,7 @@ App::put('/v1/account/sessions/phone')
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed saving user to DB');
}
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId())
;
@@ -1464,7 +1465,7 @@ App::put('/v1/account/sessions/phone')
});
App::post('/v1/account/sessions/anonymous')
->desc('Create Anonymous Session')
->desc('Create anonymous session')
->groups(['api', 'account', 'auth', 'session'])
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
@@ -1490,8 +1491,8 @@ App::post('/v1/account/sessions/anonymous')
->inject('project')
->inject('dbForProject')
->inject('geodb')
->inject('events')
->action(function (Request $request, Response $response, Locale $locale, Document $user, Document $project, Database $dbForProject, Reader $geodb, Event $events) {
->inject('queueForEvents')
->action(function (Request $request, Response $response, Locale $locale, Document $user, Document $project, Database $dbForProject, Reader $geodb, Event $queueForEvents) {
$protocol = $request->getProtocol();
@@ -1574,7 +1575,7 @@ App::post('/v1/account/sessions/anonymous')
$dbForProject->deleteCachedDocument('users', $user->getId());
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId())
;
@@ -1648,7 +1649,7 @@ App::post('/v1/account/jwt')
});
App::get('/v1/account')
->desc('Get Account')
->desc('Get account')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@@ -1669,7 +1670,7 @@ App::get('/v1/account')
});
App::get('/v1/account/prefs')
->desc('Get Account Preferences')
->desc('Get account preferences')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@@ -1692,7 +1693,7 @@ App::get('/v1/account/prefs')
});
App::get('/v1/account/sessions')
->desc('List Sessions')
->desc('List sessions')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@@ -1731,7 +1732,7 @@ App::get('/v1/account/sessions')
});
App::get('/v1/account/logs')
->desc('List Logs')
->desc('List logs')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@@ -1792,7 +1793,7 @@ App::get('/v1/account/logs')
});
App::get('/v1/account/sessions/:sessionId')
->desc('Get Session')
->desc('Get session')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
@@ -1837,7 +1838,7 @@ App::get('/v1/account/sessions/:sessionId')
});
App::patch('/v1/account/name')
->desc('Update Name')
->desc('Update name')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.name')
->label('scope', 'account')
@@ -1858,20 +1859,20 @@ App::patch('/v1/account/name')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $name, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $name, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
$user->setAttribute('name', $name);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events->setParam('userId', $user->getId());
$queueForEvents->setParam('userId', $user->getId());
$response->dynamic($user, Response::MODEL_ACCOUNT);
});
App::patch('/v1/account/password')
->desc('Update Password')
->desc('Update password')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.password')
->label('scope', 'account')
@@ -1895,8 +1896,8 @@ App::patch('/v1/account/password')
->inject('user')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $password, string $oldPassword, ?\DateTime $requestTimestamp, Response $response, Document $user, Document $project, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $password, string $oldPassword, ?\DateTime $requestTimestamp, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents) {
// Check old password only if its an existing user.
if (!empty($user->getAttribute('passwordUpdate')) && !Auth::passwordVerify($oldPassword, $user->getAttribute('password'), $user->getAttribute('hash'), $user->getAttribute('hashOptions'))) { // Double check user password
@@ -1932,13 +1933,13 @@ App::patch('/v1/account/password')
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events->setParam('userId', $user->getId());
$queueForEvents->setParam('userId', $user->getId());
$response->dynamic($user, Response::MODEL_ACCOUNT);
});
App::patch('/v1/account/email')
->desc('Update Email')
->desc('Update email')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.email')
->label('scope', 'account')
@@ -1960,8 +1961,8 @@ App::patch('/v1/account/email')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $email, string $password, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $email, string $password, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
// passwordUpdate will be empty if the user has never set a password
$passwordUpdate = $user->getAttribute('passwordUpdate');
@@ -2002,13 +2003,13 @@ App::patch('/v1/account/email')
throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS);
}
$events->setParam('userId', $user->getId());
$queueForEvents->setParam('userId', $user->getId());
$response->dynamic($user, Response::MODEL_ACCOUNT);
});
App::patch('/v1/account/phone')
->desc('Update Phone')
->desc('Update phone')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.phone')
->label('scope', 'account')
@@ -2030,8 +2031,8 @@ App::patch('/v1/account/phone')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $phone, string $password, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $phone, string $password, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
// passwordUpdate will be empty if the user has never set a password
$passwordUpdate = $user->getAttribute('passwordUpdate');
@@ -2061,13 +2062,13 @@ App::patch('/v1/account/phone')
throw new Exception(Exception::USER_PHONE_ALREADY_EXISTS);
}
$events->setParam('userId', $user->getId());
$queueForEvents->setParam('userId', $user->getId());
$response->dynamic($user, Response::MODEL_ACCOUNT);
});
App::patch('/v1/account/prefs')
->desc('Update Preferences')
->desc('Update preferences')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.prefs')
->label('scope', 'account')
@@ -2088,20 +2089,20 @@ App::patch('/v1/account/prefs')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (array $prefs, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (array $prefs, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
$user->setAttribute('prefs', $prefs);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events->setParam('userId', $user->getId());
$queueForEvents->setParam('userId', $user->getId());
$response->dynamic($user, Response::MODEL_ACCOUNT);
});
App::patch('/v1/account/status')
->desc('Update Status')
->desc('Update status')
->groups(['api', 'account'])
->label('event', 'users.[userId].update.status')
->label('scope', 'account')
@@ -2120,14 +2121,14 @@ App::patch('/v1/account/status')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (?\DateTime $requestTimestamp, Request $request, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (?\DateTime $requestTimestamp, Request $request, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
$user->setAttribute('status', false);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events
$queueForEvents
->setParam('userId', $user->getId())
->setPayload($response->output($user, Response::MODEL_ACCOUNT));
@@ -2145,7 +2146,7 @@ App::patch('/v1/account/status')
});
App::delete('/v1/account/sessions/:sessionId')
->desc('Delete Session')
->desc('Delete session')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].sessions.[sessionId].delete')
@@ -2166,9 +2167,9 @@ App::delete('/v1/account/sessions/:sessionId')
->inject('user')
->inject('dbForProject')
->inject('locale')
->inject('events')
->inject('queueForEvents')
->inject('project')
->action(function (?string $sessionId, ?\DateTime $requestTimestamp, Request $request, Response $response, Document $user, Database $dbForProject, Locale $locale, Event $events, Document $project) {
->action(function (?string $sessionId, ?\DateTime $requestTimestamp, Request $request, Response $response, Document $user, Database $dbForProject, Locale $locale, Event $queueForEvents, Document $project) {
$protocol = $request->getProtocol();
$authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
@@ -2208,7 +2209,7 @@ App::delete('/v1/account/sessions/:sessionId')
$dbForProject->deleteCachedDocument('users', $user->getId());
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId())
->setPayload($response->output($session, Response::MODEL_SESSION))
@@ -2221,7 +2222,7 @@ App::delete('/v1/account/sessions/:sessionId')
});
App::patch('/v1/account/sessions/:sessionId')
->desc('Update OAuth Session (Refresh Tokens)')
->desc('Update OAuth session (refresh tokens)')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].sessions.[sessionId].update')
@@ -2244,8 +2245,8 @@ App::patch('/v1/account/sessions/:sessionId')
->inject('dbForProject')
->inject('project')
->inject('locale')
->inject('events')
->action(function (?string $sessionId, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Event $events) {
->inject('queueForEvents')
->action(function (?string $sessionId, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Event $queueForEvents) {
$authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
$sessionId = ($sessionId === 'current')
? Auth::sessionVerify($user->getAttribute('sessions'), Auth::$secret, $authDuration)
@@ -2293,7 +2294,7 @@ App::patch('/v1/account/sessions/:sessionId')
$session->setAttribute('expire', DateTime::formatTz(DateTime::addSeconds(new \DateTime($session->getCreatedAt()), $authDuration)));
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId())
->setPayload($response->output($session, Response::MODEL_SESSION))
@@ -2307,7 +2308,7 @@ App::patch('/v1/account/sessions/:sessionId')
});
App::delete('/v1/account/sessions')
->desc('Delete Sessions')
->desc('Delete sessions')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].sessions.[sessionId].delete')
@@ -2326,8 +2327,8 @@ App::delete('/v1/account/sessions')
->inject('user')
->inject('dbForProject')
->inject('locale')
->inject('events')
->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Locale $locale, Event $events) {
->inject('queueForEvents')
->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Locale $locale, Event $queueForEvents) {
$protocol = $request->getProtocol();
$sessions = $user->getAttribute('sessions', []);
@@ -2354,13 +2355,13 @@ App::delete('/v1/account/sessions')
->addCookie(Auth::$cookieName, '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite'));
// Use current session for events.
$events->setPayload($response->output($session, Response::MODEL_SESSION));
$queueForEvents->setPayload($response->output($session, Response::MODEL_SESSION));
}
}
$dbForProject->deleteCachedDocument('users', $user->getId());
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('sessionId', $session->getId());
@@ -2368,7 +2369,7 @@ App::delete('/v1/account/sessions')
});
App::post('/v1/account/recovery')
->desc('Create Password Recovery')
->desc('Create password recovery')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].recovery.[tokenId].create')
@@ -2393,9 +2394,9 @@ App::post('/v1/account/recovery')
->inject('dbForProject')
->inject('project')
->inject('locale')
->inject('mails')
->inject('events')
->action(function (string $email, string $url, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Mail $mails, Event $events) {
->inject('queueForMails')
->inject('queueForEvents')
->action(function (string $email, string $url, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Mail $queueForMails, Event $queueForEvents) {
if (empty(App::getEnv('_APP_SMTP_HOST'))) {
throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP Disabled');
@@ -2477,7 +2478,7 @@ App::post('/v1/account/recovery')
$replyTo = $smtp['replyTo'];
}
$mails
$queueForMails
->setSmtpHost($smtp['host'] ?? '')
->setSmtpPort($smtp['port'] ?? '')
->setSmtpUsername($smtp['username'] ?? '')
@@ -2499,7 +2500,7 @@ App::post('/v1/account/recovery')
$subject = $customTemplate['subject'] ?? $subject;
}
$mails
$queueForMails
->setSmtpReplyTo($replyTo)
->setSmtpSenderEmail($senderEmail)
->setSmtpSenderName($senderName);
@@ -2524,7 +2525,7 @@ App::post('/v1/account/recovery')
];
$mails
$queueForMails
->setRecipient($profile->getAttribute('email', ''))
->setName($profile->getAttribute('name'))
->setBody($body)
@@ -2532,7 +2533,7 @@ App::post('/v1/account/recovery')
->setSubject($subject)
->trigger();
$events
$queueForEvents
->setParam('userId', $profile->getId())
->setParam('tokenId', $recovery->getId())
->setUser($profile)
@@ -2551,7 +2552,7 @@ App::post('/v1/account/recovery')
});
App::put('/v1/account/recovery')
->desc('Create Password Recovery (confirmation)')
->desc('Create password recovery (confirmation)')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].recovery.[tokenId].update')
@@ -2576,8 +2577,8 @@ App::put('/v1/account/recovery')
->inject('user')
->inject('dbForProject')
->inject('project')
->inject('events')
->action(function (string $userId, string $secret, string $password, string $passwordAgain, Response $response, Document $user, Database $dbForProject, Document $project, Event $events) {
->inject('queueForEvents')
->action(function (string $userId, string $secret, string $password, string $passwordAgain, Response $response, Document $user, Database $dbForProject, Document $project, Event $queueForEvents) {
if ($password !== $passwordAgain) {
throw new Exception(Exception::USER_PASSWORD_MISMATCH);
}
@@ -2630,7 +2631,7 @@ App::put('/v1/account/recovery')
$dbForProject->deleteDocument('tokens', $recovery);
$dbForProject->deleteCachedDocument('users', $profile->getId());
$events
$queueForEvents
->setParam('userId', $profile->getId())
->setParam('tokenId', $recoveryDocument->getId())
;
@@ -2639,7 +2640,7 @@ App::put('/v1/account/recovery')
});
App::post('/v1/account/verification')
->desc('Create Email Verification')
->desc('Create email verification')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].verification.[tokenId].create')
@@ -2662,9 +2663,9 @@ App::post('/v1/account/verification')
->inject('user')
->inject('dbForProject')
->inject('locale')
->inject('events')
->inject('mails')
->action(function (string $url, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Event $events, Mail $mails) {
->inject('queueForEvents')
->inject('queueForMails')
->action(function (string $url, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails) {
if (empty(App::getEnv('_APP_SMTP_HOST'))) {
throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP Disabled');
@@ -2729,7 +2730,7 @@ App::post('/v1/account/verification')
$replyTo = $smtp['replyTo'];
}
$mails
$queueForMails
->setSmtpHost($smtp['host'] ?? '')
->setSmtpPort($smtp['port'] ?? '')
->setSmtpUsername($smtp['username'] ?? '')
@@ -2751,7 +2752,7 @@ App::post('/v1/account/verification')
$subject = $customTemplate['subject'] ?? $subject;
}
$mails
$queueForMails
->setSmtpReplyTo($replyTo)
->setSmtpSenderEmail($senderEmail)
->setSmtpSenderName($senderName);
@@ -2775,7 +2776,7 @@ App::post('/v1/account/verification')
'redirect' => $url
];
$mails
$queueForMails
->setSubject($subject)
->setBody($body)
->setVariables($emailVariables)
@@ -2783,7 +2784,7 @@ App::post('/v1/account/verification')
->setName($user->getAttribute('name') ?? '')
->trigger();
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('tokenId', $verification->getId())
->setPayload($response->output(
@@ -2800,7 +2801,7 @@ App::post('/v1/account/verification')
});
App::put('/v1/account/verification')
->desc('Create Email Verification (confirmation)')
->desc('Create email verification (confirmation)')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].verification.[tokenId].update')
@@ -2821,8 +2822,8 @@ App::put('/v1/account/verification')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $secret, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $userId, string $secret, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
$profile = Authorization::skip(fn() => $dbForProject->getDocument('users', $userId));
@@ -2852,7 +2853,7 @@ App::put('/v1/account/verification')
$dbForProject->deleteDocument('tokens', $verification);
$dbForProject->deleteCachedDocument('users', $profile->getId());
$events
$queueForEvents
->setParam('userId', $userId)
->setParam('tokenId', $verificationDocument->getId())
;
@@ -2861,7 +2862,7 @@ App::put('/v1/account/verification')
});
App::post('/v1/account/verification/phone')
->desc('Create Phone Verification')
->desc('Create phone verification')
->groups(['api', 'account'])
->label('scope', 'account')
->label('event', 'users.[userId].verification.[tokenId].create')
@@ -2881,11 +2882,11 @@ App::post('/v1/account/verification/phone')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->inject('messaging')
->inject('queueForEvents')
->inject('queueForMessaging')
->inject('project')
->inject('locale')
->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Event $events, EventPhone $messaging, Document $project, Locale $locale) {
->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Event $queueForEvents, EventPhone $queueForMessaging, Document $project, Locale $locale) {
if (empty(App::getEnv('_APP_SMS_PROVIDER'))) {
throw new Exception(Exception::GENERAL_PHONE_DISABLED);
@@ -2933,13 +2934,13 @@ App::post('/v1/account/verification/phone')
$message = $message->setParam('{{token}}', $secret);
$message = $message->render();
$messaging
$queueForMessaging
->setRecipient($user->getAttribute('phone'))
->setMessage($message)
->trigger()
;
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('tokenId', $verification->getId())
->setPayload($response->output(
@@ -2957,7 +2958,7 @@ App::post('/v1/account/verification/phone')
});
App::put('/v1/account/verification/phone')
->desc('Create Phone Verification (confirmation)')
->desc('Create phone verification (confirmation)')
->groups(['api', 'account'])
->label('scope', 'public')
->label('event', 'users.[userId].verification.[tokenId].update')
@@ -2978,8 +2979,8 @@ App::put('/v1/account/verification/phone')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $secret, Response $response, Document $user, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $userId, string $secret, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) {
$profile = Authorization::skip(fn() => $dbForProject->getDocument('users', $userId));
@@ -3007,7 +3008,7 @@ App::put('/v1/account/verification/phone')
$dbForProject->deleteDocument('tokens', $verification);
$dbForProject->deleteCachedDocument('users', $profile->getId());
$events
$queueForEvents
->setParam('userId', $user->getId())
->setParam('tokenId', $verificationDocument->getId())
;
+22 -21
View File
@@ -191,7 +191,7 @@ $getUserGitHub = function (string $userId, Document $project, Database $dbForPro
};
App::get('/v1/avatars/credit-cards/:code')
->desc('Get Credit Card Icon')
->desc('Get credit card icon')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@@ -211,7 +211,7 @@ App::get('/v1/avatars/credit-cards/:code')
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('credit-cards', $code, $width, $height, $quality, $response));
App::get('/v1/avatars/browsers/:code')
->desc('Get Browser Icon')
->desc('Get browser icon')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@@ -231,7 +231,7 @@ App::get('/v1/avatars/browsers/:code')
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('browsers', $code, $width, $height, $quality, $response));
App::get('/v1/avatars/flags/:code')
->desc('Get Country Flag')
->desc('Get country flag')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@@ -251,7 +251,7 @@ App::get('/v1/avatars/flags/:code')
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('flags', $code, $width, $height, $quality, $response));
App::get('/v1/avatars/image')
->desc('Get Image from URL')
->desc('Get image from URL')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@@ -307,7 +307,7 @@ App::get('/v1/avatars/image')
});
App::get('/v1/avatars/favicon')
->desc('Get Favicon')
->desc('Get favicon')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
@@ -449,7 +449,7 @@ App::get('/v1/avatars/favicon')
});
App::get('/v1/avatars/qr')
->desc('Get QR Code')
->desc('Get QR code')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -489,7 +489,7 @@ App::get('/v1/avatars/qr')
});
App::get('/v1/avatars/initials')
->desc('Get User Initials')
->desc('Get user initials')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache.resource', 'avatar/initials')
@@ -509,12 +509,11 @@ App::get('/v1/avatars/initials')
->action(function (string $name, int $width, int $height, string $background, Response $response, Document $user) {
$themes = [
['background' => '#FFA1CE'], // Default (Pink)
['background' => '#FDC584'], // Orange
['background' => '#94DBD1'], // Green
['background' => '#A1C4FF'], // Blue
['background' => '#FFA1CE'], // Pink
['background' => '#CBB1FC'] // Purple
['background' => '#FD366E'], // Default (Pink)
['background' => '#FE9567'], // Orange
['background' => '#7C67FE'], // Purple
['background' => '#68A3FE'], // Blue
['background' => '#85DBD8'], // Mint
];
$name = (!empty($name)) ? $name : $user->getAttribute('name', $user->getAttribute('email', ''));
@@ -526,11 +525,13 @@ App::get('/v1/avatars/initials')
$code = 0;
foreach ($words as $key => $w) {
$initials .= $w[0] ?? '';
$code += (isset($w[0])) ? \ord($w[0]) : 0;
if (ctype_alnum($w[0] ?? '')) {
$initials .= $w[0];
$code += ord($w[0]);
if ($key == 1) {
break;
if ($key == 1) {
break;
}
}
}
@@ -548,8 +549,8 @@ App::get('/v1/avatars/initials')
$punch->newImage($width, $height, 'transparent');
$draw->setFont(__DIR__ . "/../../assets/fonts/poppins-v9-latin-500.ttf");
$image->setFont(__DIR__ . "/../../assets/fonts/poppins-v9-latin-500.ttf");
$draw->setFont(__DIR__ . "/../../assets/fonts/inter-v8-latin-regular.woff2");
$image->setFont(__DIR__ . "/../../assets/fonts/inter-v8-latin-regular.woff2");
$draw->setFillColor(new ImagickPixel('black'));
$draw->setFontSize($fontSize);
@@ -724,7 +725,7 @@ App::get('/v1/cards/cloud')
$text = new \ImagickDraw();
$text->setTextAlignment(Imagick::ALIGN_CENTER);
$text->setFont(__DIR__ . '/../../../public/fonts/Poppins-Bold.ttf');
$text->setFont(__DIR__ . '/../../../public/fonts/Inter-Bold.ttf');
$text->setFillColor(new \ImagickPixel('#FFFFFF'));
if (\strlen($name) > 32) {
@@ -1108,7 +1109,7 @@ App::get('/v1/cards/cloud-og')
$textName = new \ImagickDraw();
$textName->setTextAlignment(Imagick::ALIGN_CENTER);
$textName->setFont(__DIR__ . '/../../../public/fonts/Poppins-Bold.ttf');
$textName->setFont(__DIR__ . '/../../../public/fonts/Inter-Bold.ttf');
$textName->setFillColor(new \ImagickPixel('#FFFFFF'));
if (\strlen($name) > 32) {
+1 -1
View File
@@ -17,7 +17,7 @@ App::init()
App::get('/v1/console/variables')
->desc('Get Variables')
->desc('Get variables')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
File diff suppressed because it is too large Load Diff
+71 -64
View File
@@ -6,7 +6,6 @@ use Appwrite\Event\Build;
use Appwrite\Event\Delete;
use Appwrite\Event\Event;
use Appwrite\Event\Func;
use Appwrite\Event\Usage;
use Appwrite\Event\Validator\FunctionEvent;
use Appwrite\Utopia\Response\Model\Rule;
use Appwrite\Extend\Exception;
@@ -50,7 +49,7 @@ use Utopia\VCS\Adapter\Git\GitHub;
include_once __DIR__ . '/../shared/api.php';
$redeployVcs = function (Request $request, Document $function, Document $project, Document $installation, Database $dbForProject, Document $template, GitHub $github) {
$redeployVcs = function (Request $request, Document $function, Document $project, Document $installation, Database $dbForProject, Build $queueForBuilds, Document $template, GitHub $github) {
$deploymentId = ID::unique();
$entrypoint = $function->getAttribute('entrypoint', '');
$providerInstallationId = $installation->getAttribute('providerInstallationId', '');
@@ -84,6 +83,7 @@ $redeployVcs = function (Request $request, Document $function, Document $project
Permission::delete(Role::any()),
],
'resourceId' => $function->getId(),
'resourceInternalId' => $function->getInternalId(),
'resourceType' => 'functions',
'entrypoint' => $entrypoint,
'commands' => $function->getAttribute('commands', ''),
@@ -108,8 +108,7 @@ $redeployVcs = function (Request $request, Document $function, Document $project
'activate' => true,
]));
$buildEvent = new Build();
$buildEvent
$queueForBuilds
->setType(BUILD_TYPE_DEPLOYMENT)
->setResource($function)
->setDeployment($deployment)
@@ -120,7 +119,7 @@ $redeployVcs = function (Request $request, Document $function, Document $project
App::post('/v1/functions')
->groups(['api', 'functions'])
->desc('Create Function')
->desc('Create function')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].create')
->label('audits.event', 'function.create')
@@ -157,10 +156,11 @@ App::post('/v1/functions')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('dbForConsole')
->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, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateBranch, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $eventsInstance, Database $dbForConsole, GitHub $github) use ($redeployVcs) {
->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateBranch, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) use ($redeployVcs) {
$functionId = ($functionId == 'unique()') ? ID::unique() : $functionId;
// build from template
@@ -260,7 +260,7 @@ App::post('/v1/functions')
// Redeploy vcs logic
if (!empty($providerRepositoryId)) {
$redeployVcs($request, $function, $project, $installation, $dbForProject, $template, $github);
$redeployVcs($request, $function, $project, $installation, $dbForProject, $queueForBuilds, $template, $github);
}
$functionsDomain = App::getEnv('_APP_DOMAIN_FUNCTIONS', '');
@@ -285,7 +285,12 @@ App::post('/v1/functions')
/** Trigger Webhook */
$ruleModel = new Rule();
$ruleCreate = new Event(Event::WEBHOOK_QUEUE_NAME, Event::WEBHOOK_CLASS_NAME);
$ruleCreate =
$queueForEvents
->setClass(Event::WEBHOOK_CLASS_NAME)
->setQueue(Event::WEBHOOK_QUEUE_NAME)
;
$ruleCreate
->setProject($project)
->setEvent('rules.[ruleId].create')
@@ -325,7 +330,7 @@ App::post('/v1/functions')
);
}
$eventsInstance->setParam('functionId', $function->getId());
$queueForEvents->setParam('functionId', $function->getId());
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -334,7 +339,7 @@ App::post('/v1/functions')
App::get('/v1/functions')
->groups(['api', 'functions'])
->desc('List Functions')
->desc('List functions')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@@ -409,7 +414,7 @@ App::get('/v1/functions/runtimes')
App::get('/v1/functions/:functionId')
->groups(['api', 'functions'])
->desc('Get Function')
->desc('Get function')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@@ -432,7 +437,7 @@ App::get('/v1/functions/:functionId')
});
App::get('/v1/functions/:functionId/usage')
->desc('Get Function Usage')
->desc('Get function usage')
->groups(['api', 'functions', 'usage'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@@ -529,7 +534,7 @@ App::get('/v1/functions/:functionId/usage')
'range' => $range,
'executionsTotal' => $stats["executions.$functionId.compute.total"] ?? [],
'executionsFailure' => $stats["executions.$functionId.compute.failure"] ?? [],
'executionsSuccesse' => $stats["executions.$functionId.compute.success"] ?? [],
'executionsSuccess' => $stats["executions.$functionId.compute.success"] ?? [],
'executionsTime' => $stats["executions.$functionId.compute.time"] ?? [],
'buildsTotal' => $stats["builds.$functionId.compute.total"] ?? [],
'buildsFailure' => $stats["builds.$functionId.compute.failure"] ?? [],
@@ -542,7 +547,7 @@ App::get('/v1/functions/:functionId/usage')
});
App::get('/v1/functions/usage')
->desc('Get Functions Usage')
->desc('Get functions usage')
->groups(['api', 'functions', 'usage'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
@@ -646,7 +651,7 @@ App::get('/v1/functions/usage')
App::put('/v1/functions/:functionId')
->groups(['api', 'functions'])
->desc('Update Function')
->desc('Update function')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].update')
->label('audits.event', 'function.update')
@@ -678,10 +683,11 @@ App::put('/v1/functions/:functionId')
->inject('response')
->inject('dbForProject')
->inject('project')
->inject('events')
->inject('queueForEvents')
->inject('queueForBuilds')
->inject('dbForConsole')
->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, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, Request $request, Response $response, Database $dbForProject, Document $project, Event $eventsInstance, Database $dbForConsole, GitHub $github) use ($redeployVcs) {
->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) use ($redeployVcs) {
// TODO: If only branch changes, re-deploy
$function = $dbForProject->getDocument('functions', $functionId);
@@ -806,7 +812,7 @@ App::put('/v1/functions/:functionId')
// Redeploy logic
if (!$isConnected && !empty($providerRepositoryId)) {
$redeployVcs($request, $function, $project, $installation, $dbForProject, new Document(), $github);
$redeployVcs($request, $function, $project, $installation, $dbForProject, $queueForBuilds, new Document(), $github);
}
// Inform scheduler if function is still active
@@ -817,7 +823,7 @@ App::put('/v1/functions/:functionId')
->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment')));
Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule));
$eventsInstance->setParam('functionId', $function->getId());
$queueForEvents->setParam('functionId', $function->getId());
$response->dynamic($function, Response::MODEL_FUNCTION);
});
@@ -911,7 +917,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download')
App::patch('/v1/functions/:functionId/deployments/:deploymentId')
->groups(['api', 'functions'])
->desc('Update Function Deployment')
->desc('Update function deployment')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
->label('audits.event', 'deployment.update')
@@ -927,9 +933,9 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
->param('deploymentId', '', new UID(), 'Deployment ID.')
->inject('response')
->inject('dbForProject')
->inject('events')
->inject('queueForEvents')
->inject('dbForConsole')
->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Event $events, Database $dbForConsole) {
->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForConsole) {
$function = $dbForProject->getDocument('functions', $functionId);
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
@@ -964,7 +970,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment')));
Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule));
$events
$queueForEvents
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
@@ -973,7 +979,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
App::delete('/v1/functions/:functionId')
->groups(['api', 'functions'])
->desc('Delete Function')
->desc('Delete function')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].delete')
->label('audits.event', 'function.delete')
@@ -987,10 +993,10 @@ App::delete('/v1/functions/:functionId')
->param('functionId', '', new UID(), 'Function ID.')
->inject('response')
->inject('dbForProject')
->inject('deletes')
->inject('events')
->inject('queueForDeletes')
->inject('queueForEvents')
->inject('dbForConsole')
->action(function (string $functionId, Response $response, Database $dbForProject, Delete $deletes, Event $events, Database $dbForConsole) {
->action(function (string $functionId, Response $response, Database $dbForProject, Delete $queueForDeletes, Event $queueForEvents, Database $dbForConsole) {
$function = $dbForProject->getDocument('functions', $functionId);
@@ -1009,18 +1015,18 @@ App::delete('/v1/functions/:functionId')
->setAttribute('active', false);
Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule));
$deletes
$queueForDeletes
->setType(DELETE_TYPE_DOCUMENT)
->setDocument($function);
$events->setParam('functionId', $function->getId());
$queueForEvents->setParam('functionId', $function->getId());
$response->noContent();
});
App::post('/v1/functions/:functionId/deployments')
->groups(['api', 'functions'])
->desc('Create Deployment')
->desc('Create deployment')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].create')
->label('audits.event', 'deployment.create')
@@ -1042,11 +1048,13 @@ App::post('/v1/functions/:functionId/deployments')
->inject('request')
->inject('response')
->inject('dbForProject')
->inject('events')
->inject('queueForEvents')
->inject('project')
->inject('deviceFunctions')
->inject('deviceLocal')
->action(function (string $functionId, ?string $entrypoint, ?string $commands, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) {
->inject('queueForBuilds')
->action(function (string $functionId, ?string $entrypoint, ?string $commands, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceFunctions, Device $deviceLocal, Build $queueForBuilds) {
$activate = filter_var($activate, FILTER_VALIDATE_BOOLEAN);
$function = $dbForProject->getDocument('functions', $functionId);
@@ -1190,8 +1198,7 @@ App::post('/v1/functions/:functionId/deployments')
}
// Start the build
$buildEvent = new Build();
$buildEvent
$queueForBuilds
->setType(BUILD_TYPE_DEPLOYMENT)
->setResource($function)
->setDeployment($deployment)
@@ -1228,7 +1235,7 @@ App::post('/v1/functions/:functionId/deployments')
$metadata = null;
$events
$queueForEvents
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
@@ -1239,7 +1246,7 @@ App::post('/v1/functions/:functionId/deployments')
App::get('/v1/functions/:functionId/deployments')
->groups(['api', 'functions'])
->desc('List Deployments')
->desc('List deployments')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@@ -1309,7 +1316,7 @@ App::get('/v1/functions/:functionId/deployments')
App::get('/v1/functions/:functionId/deployments/:deploymentId')
->groups(['api', 'functions'])
->desc('Get Deployment')
->desc('Get deployment')
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
@@ -1351,7 +1358,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId')
App::delete('/v1/functions/:functionId/deployments/:deploymentId')
->groups(['api', 'functions'])
->desc('Delete Deployment')
->desc('Delete deployment')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].delete')
->label('audits.event', 'deployment.delete')
@@ -1366,10 +1373,10 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
->param('deploymentId', '', new UID(), 'Deployment ID.')
->inject('response')
->inject('dbForProject')
->inject('deletes')
->inject('events')
->inject('queueForDeletes')
->inject('queueForEvents')
->inject('deviceFunctions')
->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Delete $deletes, Event $events, Device $deviceFunctions) {
->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Delete $queueForDeletes, Event $queueForEvents, Device $deviceFunctions) {
$function = $dbForProject->getDocument('functions', $functionId);
if ($function->isEmpty()) {
@@ -1402,11 +1409,11 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
])));
}
$events
$queueForEvents
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
$deletes
$queueForDeletes
->setType(DELETE_TYPE_DOCUMENT)
->setDocument($deployment);
@@ -1415,7 +1422,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
->groups(['api', 'functions'])
->desc('Create Build')
->desc('Create build')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
->label('audits.event', 'deployment.update')
@@ -1433,8 +1440,9 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
->inject('response')
->inject('dbForProject')
->inject('project')
->inject('events')
->action(function (string $functionId, string $deploymentId, string $buildId, Request $request, Response $response, Database $dbForProject, Document $project, Event $events) use ($redeployVcs) {
->inject('queueForEvents')
->inject('queueForBuilds')
->action(function (string $functionId, string $deploymentId, string $buildId, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds) {
$function = $dbForProject->getDocument('functions', $functionId);
@@ -1466,16 +1474,14 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
'search' => implode(' ', [$deploymentId, $function->getAttribute('entrypoint')]),
]));
$buildEvent = new Build();
$buildEvent
$queueForBuilds
->setType(BUILD_TYPE_DEPLOYMENT)
->setResource($function)
->setDeployment($deployment)
->setProject($project)
->trigger();
$events
$queueForEvents
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
@@ -1484,7 +1490,7 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
App::post('/v1/functions/:functionId/executions')
->groups(['api', 'functions'])
->desc('Create Execution')
->desc('Create execution')
->label('scope', 'execution.write')
->label('event', 'functions.[functionId].executions.[executionId].create')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -1495,7 +1501,7 @@ App::post('/v1/functions/:functionId/executions')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_EXECUTION)
->param('functionId', '', new UID(), 'Function ID.')
->param('body', '', new Text(8192, 0), 'HTTP body of execution. Default value is empty string.', true)
->param('body', '', new Text(0, 0), 'HTTP body of execution. Default value is empty string.', true)
->param('async', false, new Boolean(), 'Execute code in the background. Default value is false.', true)
->param('path', '/', new Text(2048), 'HTTP path of execution. Path can include query params. Default value is /', true)
->param('method', 'POST', new Whitelist(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], true), 'HTTP method of execution. Default value is GET.', true)
@@ -1504,12 +1510,12 @@ App::post('/v1/functions/:functionId/executions')
->inject('project')
->inject('dbForProject')
->inject('user')
->inject('events')
->inject('queueForEvents')
->inject('usage')
->inject('mode')
->inject('queueForFunctions')
->inject('geodb')
->action(function (string $functionId, string $body, bool $async, string $path, string $method, array $headers, Response $response, Document $project, Database $dbForProject, Document $user, Event $events, Stats $usage, string $mode, Func $queueForFunctions, Reader $geodb) {
->action(function (string $functionId, string $body, bool $async, string $path, string $method, array $headers, Response $response, Document $project, Database $dbForProject, Document $user, Event $queueForEvents, Stats $usage, string $mode, Func $queueForFunctions, Reader $geodb) {
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
@@ -1625,7 +1631,7 @@ App::post('/v1/functions/:functionId/executions')
'search' => implode(' ', [$functionId, $executionId]),
]);
$events
$queueForEvents
->setParam('functionId', $function->getId())
->setParam('executionId', $execution->getId())
->setContext('function', $function);
@@ -1707,7 +1713,8 @@ App::post('/v1/functions/:functionId/executions')
path: $path,
method: $method,
headers: $headers,
runtimeEntrypoint: $command
runtimeEntrypoint: $command,
requestTimeout: 30
);
$headersFiltered = [];
@@ -1773,7 +1780,7 @@ App::post('/v1/functions/:functionId/executions')
App::get('/v1/functions/:functionId/executions')
->groups(['api', 'functions'])
->desc('List Executions')
->desc('List executions')
->label('scope', 'execution.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'functions')
@@ -1848,7 +1855,7 @@ App::get('/v1/functions/:functionId/executions')
App::get('/v1/functions/:functionId/executions/:executionId')
->groups(['api', 'functions'])
->desc('Get Execution')
->desc('Get execution')
->label('scope', 'execution.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'functions')
@@ -1896,7 +1903,7 @@ App::get('/v1/functions/:functionId/executions/:executionId')
// Variables
App::post('/v1/functions/:functionId/variables')
->desc('Create Variable')
->desc('Create variable')
->groups(['api', 'functions'])
->label('scope', 'functions.write')
->label('audits.event', 'variable.create')
@@ -1960,7 +1967,7 @@ App::post('/v1/functions/:functionId/variables')
});
App::get('/v1/functions/:functionId/variables')
->desc('List Variables')
->desc('List variables')
->groups(['api', 'functions'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -1987,7 +1994,7 @@ App::get('/v1/functions/:functionId/variables')
});
App::get('/v1/functions/:functionId/variables/:variableId')
->desc('Get Variable')
->desc('Get variable')
->groups(['api', 'functions'])
->label('scope', 'functions.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -2026,7 +2033,7 @@ App::get('/v1/functions/:functionId/variables/:variableId')
});
App::put('/v1/functions/:functionId/variables/:variableId')
->desc('Update Variable')
->desc('Update variable')
->groups(['api', 'functions'])
->label('scope', 'functions.write')
->label('audits.event', 'variable.update')
@@ -2087,7 +2094,7 @@ App::put('/v1/functions/:functionId/variables/:variableId')
});
App::delete('/v1/functions/:functionId/variables/:variableId')
->desc('Delete Variable')
->desc('Delete variable')
->groups(['api', 'functions'])
->label('scope', 'functions.write')
->label('audits.event', 'variable.delete')
+3 -3
View File
@@ -18,7 +18,7 @@ use Utopia\Validator\JSON;
use Utopia\Validator\Text;
App::get('/v1/graphql')
->desc('GraphQL Endpoint')
->desc('GraphQL endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
@@ -58,7 +58,7 @@ App::get('/v1/graphql')
});
App::post('/v1/graphql/mutation')
->desc('GraphQL Endpoint')
->desc('GraphQL endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
@@ -103,7 +103,7 @@ App::post('/v1/graphql/mutation')
});
App::post('/v1/graphql')
->desc('GraphQL Endpoint')
->desc('GraphQL endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
+133 -20
View File
@@ -14,6 +14,7 @@ use Utopia\Registry\Registry;
use Utopia\Storage\Device;
use Utopia\Storage\Device\Local;
use Utopia\Storage\Storage;
use Utopia\Validator\Text;
App::get('/v1/health')
->desc('Get HTTP')
@@ -39,7 +40,7 @@ App::get('/v1/health')
});
App::get('/v1/health/version')
->desc('Get Version')
->desc('Get version')
->groups(['api', 'health'])
->label('scope', 'public')
->label('sdk.response.code', Response::STATUS_CODE_OK)
@@ -109,7 +110,7 @@ App::get('/v1/health/db')
});
App::get('/v1/health/cache')
->desc('Get Cache')
->desc('Get cache')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -166,7 +167,7 @@ App::get('/v1/health/cache')
});
App::get('/v1/health/queue')
->desc('Get Queue')
->desc('Get queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -223,7 +224,7 @@ App::get('/v1/health/queue')
});
App::get('/v1/health/pubsub')
->desc('Get PubSub')
->desc('Get pubsub')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -280,7 +281,7 @@ App::get('/v1/health/pubsub')
});
App::get('/v1/health/time')
->desc('Get Time')
->desc('Get time')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -337,7 +338,7 @@ App::get('/v1/health/time')
});
App::get('/v1/health/queue/webhooks')
->desc('Get Webhooks Queue')
->desc('Get webhooks queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -347,14 +348,15 @@ App::get('/v1/health/queue/webhooks')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Response $response) {
$response->dynamic(new Document([ 'size' => Resque::size(Event::WEBHOOK_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::WEBHOOK_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/logs')
->desc('Get Logs Queue')
->desc('Get logs queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -364,14 +366,15 @@ App::get('/v1/health/queue/logs')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Response $response) {
$response->dynamic(new Document([ 'size' => Resque::size(Event::AUDITS_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::AUDITS_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/certificates')
->desc('Get Certificates Queue')
->desc('Get certificates queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -381,14 +384,124 @@ App::get('/v1/health/queue/certificates')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Response $response) {
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::CERTIFICATES_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
$response->dynamic(new Document([ 'size' => Resque::size(Event::CERTIFICATES_QUEUE_NAME) ]), Response::MODEL_HEALTH_QUEUE);
App::get('/v1/health/queue/builds')
->desc('Get builds queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueBuilds')
->label('sdk.description', '/docs/references/health/get-queue-builds.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::BUILDS_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/databases')
->desc('Get databases queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueDatabases')
->label('sdk.description', '/docs/references/health/get-queue-databases.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true)
->inject('queue')
->inject('response')
->action(function (string $name, Connection $queue, Response $response) {
$client = new Client($name, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/deletes')
->desc('Get deletes queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueDeletes')
->label('sdk.description', '/docs/references/health/get-queue-deletes.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::DELETE_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/mails')
->desc('Get mails queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueMails')
->label('sdk.description', '/docs/references/health/get-queue-mails.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::MAILS_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/messaging')
->desc('Get messaging queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueMessaging')
->label('sdk.description', '/docs/references/health/get-queue-messaging.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::MESSAGING_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/migrations')
->desc('Get migrations queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueMigrations')
->label('sdk.description', '/docs/references/health/get-queue-migrations.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
->inject('queue')
->inject('response')
->action(function (Connection $queue, Response $response) {
$client = new Client(Event::MIGRATIONS_QUEUE_NAME, $queue);
$response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE);
}, ['response']);
App::get('/v1/health/queue/functions')
->desc('Get Functions Queue')
->desc('Get functions queue')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -406,7 +519,7 @@ App::get('/v1/health/queue/functions')
}, ['response']);
App::get('/v1/health/storage/local')
->desc('Get Local Storage')
->desc('Get local storage')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -449,7 +562,7 @@ App::get('/v1/health/storage/local')
});
App::get('/v1/health/anti-virus')
->desc('Get Antivirus')
->desc('Get antivirus')
->groups(['api', 'health'])
->label('scope', 'health.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
@@ -488,7 +601,7 @@ App::get('/v1/health/anti-virus')
});
App::get('/v1/health/stats') // Currently only used internally
->desc('Get System Stats')
->desc('Get system stats')
->groups(['api', 'health'])
->label('scope', 'root')
// ->label('sdk.auth', [APP_AUTH_TYPE_KEY])
+7 -7
View File
@@ -9,7 +9,7 @@ use Utopia\Database\Document;
use Utopia\Locale\Locale;
App::get('/v1/locale')
->desc('Get User Locale')
->desc('Get user locale')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -91,7 +91,7 @@ App::get('/v1/locale/codes')
});
App::get('/v1/locale/countries')
->desc('List Countries')
->desc('List countries')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -124,7 +124,7 @@ App::get('/v1/locale/countries')
});
App::get('/v1/locale/countries/eu')
->desc('List EU Countries')
->desc('List EU countries')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -159,7 +159,7 @@ App::get('/v1/locale/countries/eu')
});
App::get('/v1/locale/countries/phones')
->desc('List Countries Phone Codes')
->desc('List countries phone codes')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -193,7 +193,7 @@ App::get('/v1/locale/countries/phones')
});
App::get('/v1/locale/continents')
->desc('List Continents')
->desc('List continents')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -225,7 +225,7 @@ App::get('/v1/locale/continents')
});
App::get('/v1/locale/currencies')
->desc('List Currencies')
->desc('List currencies')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
@@ -248,7 +248,7 @@ App::get('/v1/locale/currencies')
App::get('/v1/locale/languages')
->desc('List Languages')
->desc('List languages')
->groups(['api', 'locale'])
->label('scope', 'locale.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
+31 -32
View File
@@ -51,8 +51,9 @@ App::post('/v1/migrations/appwrite')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->action(function (array $resources, string $endpoint, string $projectId, string $apiKey, Response $response, Database $dbForProject, Document $project, Document $user, Event $events) {
->inject('queueForEvents')
->inject('queueForMigrations')
->action(function (array $resources, string $endpoint, string $projectId, string $apiKey, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Migration $queueForMigrations) {
$migration = $dbForProject->createDocument('migrations', new Document([
'$id' => ID::unique(),
'status' => 'pending',
@@ -69,11 +70,10 @@ App::post('/v1/migrations/appwrite')
'errors' => [],
]));
$events->setParam('migrationId', $migration->getId());
$queueForEvents->setParam('migrationId', $migration->getId());
// Trigger Transfer
$event = new Migration();
$event
$queueForMigrations
->setMigration($migration)
->setProject($project)
->setUser($user)
@@ -104,9 +104,10 @@ App::post('/v1/migrations/firebase/oauth')
->inject('dbForConsole')
->inject('project')
->inject('user')
->inject('events')
->inject('queueForEvents')
->inject('queueForMigrations')
->inject('request')
->action(function (array $resources, string $projectId, Response $response, Database $dbForProject, Database $dbForConsole, Document $project, Document $user, Event $events, Request $request) {
->action(function (array $resources, string $projectId, Response $response, Database $dbForProject, Database $dbForConsole, Document $project, Document $user, Event $queueForEvents, Migration $queueForMigrations, Request $request) {
$firebase = new OAuth2Firebase(
App::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', ''),
App::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', ''),
@@ -171,11 +172,10 @@ App::post('/v1/migrations/firebase/oauth')
'errors' => []
]));
$events->setParam('migrationId', $migration->getId());
$queueForEvents->setParam('migrationId', $migration->getId());
// Trigger Transfer
$event = new Migration();
$event
$queueForMigrations
->setMigration($migration)
->setProject($project)
->setUser($user)
@@ -205,8 +205,9 @@ App::post('/v1/migrations/firebase')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->action(function (array $resources, string $serviceAccount, Response $response, Database $dbForProject, Document $project, Document $user, Event $events) {
->inject('queueForEvents')
->inject('queueForMigrations')
->action(function (array $resources, string $serviceAccount, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Migration $queueForMigrations) {
$migration = $dbForProject->createDocument('migrations', new Document([
'$id' => ID::unique(),
'status' => 'pending',
@@ -221,11 +222,10 @@ App::post('/v1/migrations/firebase')
'errors' => [],
]));
$events->setParam('migrationId', $migration->getId());
$queueForEvents->setParam('migrationId', $migration->getId());
// Trigger Transfer
$event = new Migration();
$event
$queueForMigrations
->setMigration($migration)
->setProject($project)
->setUser($user)
@@ -260,8 +260,9 @@ App::post('/v1/migrations/supabase')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->action(function (array $resources, string $endpoint, string $apiKey, string $databaseHost, string $username, string $password, int $port, Response $response, Database $dbForProject, Document $project, Document $user, Event $events) {
->inject('queueForEvents')
->inject('queueForMigrations')
->action(function (array $resources, string $endpoint, string $apiKey, string $databaseHost, string $username, string $password, int $port, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Migration $queueForMigrations) {
$migration = $dbForProject->createDocument('migrations', new Document([
'$id' => ID::unique(),
'status' => 'pending',
@@ -281,11 +282,10 @@ App::post('/v1/migrations/supabase')
'errors' => [],
]));
$events->setParam('migrationId', $migration->getId());
$queueForEvents->setParam('migrationId', $migration->getId());
// Trigger Transfer
$event = new Migration();
$event
$queueForMigrations
->setMigration($migration)
->setProject($project)
->setUser($user)
@@ -321,8 +321,9 @@ App::post('/v1/migrations/nhost')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->action(function (array $resources, string $subdomain, string $region, string $adminSecret, string $database, string $username, string $password, int $port, Response $response, Database $dbForProject, Document $project, Document $user, Event $events) {
->inject('queueForEvents')
->inject('queueForMigrations')
->action(function (array $resources, string $subdomain, string $region, string $adminSecret, string $database, string $username, string $password, int $port, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Migration $queueForMigrations) {
$migration = $dbForProject->createDocument('migrations', new Document([
'$id' => ID::unique(),
'status' => 'pending',
@@ -343,11 +344,10 @@ App::post('/v1/migrations/nhost')
'errors' => [],
]));
$events->setParam('migrationId', $migration->getId());
$queueForEvents->setParam('migrationId', $migration->getId());
// Trigger Transfer
$event = new Migration();
$event
$queueForMigrations
->setMigration($migration)
->setProject($project)
->setUser($user)
@@ -931,8 +931,8 @@ App::patch('/v1/migrations/:migrationId')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->action(function (string $migrationId, Response $response, Database $dbForProject, Document $project, Document $user, Event $eventInstance) {
->inject('queueForMigrations')
->action(function (string $migrationId, Response $response, Database $dbForProject, Document $project, Document $user, Migration $queueForMigrations) {
$migration = $dbForProject->getDocument('migrations', $migrationId);
if ($migration->isEmpty()) {
@@ -948,8 +948,7 @@ App::patch('/v1/migrations/:migrationId')
->setAttribute('dateUpdated', \time());
// Trigger Migration
$event = new Migration();
$event
$queueForMigrations
->setMigration($migration)
->setProject($project)
->setUser($user)
@@ -974,8 +973,8 @@ App::delete('/v1/migrations/:migrationId')
->param('migrationId', '', new UID(), 'Migration ID.')
->inject('response')
->inject('dbForProject')
->inject('events')
->action(function (string $migrationId, Response $response, Database $dbForProject, Event $events) {
->inject('queueForEvents')
->action(function (string $migrationId, Response $response, Database $dbForProject, Event $queueForEvents) {
$migration = $dbForProject->getDocument('migrations', $migrationId);
if ($migration->isEmpty()) {
@@ -986,7 +985,7 @@ App::delete('/v1/migrations/:migrationId')
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove migration from DB');
}
$events->setParam('migrationId', $migration->getId());
$queueForEvents->setParam('migrationId', $migration->getId());
$response->noContent();
});

Some files were not shown because too many files have changed in this diff Show More