Compare commits

...
Author SHA1 Message Date
Vincent (Wen Yu) Ge 03bfed4e25 Update create-document description and improve error message for unknown attribute. 2023-04-24 22:54:01 +00:00
Torsten DittmannandGitHub 495a17a290 Merge pull request #5405 from appwrite/feat-ci-release
ci: release action
2023-04-21 12:05:33 +02:00
Torsten Dittmann 097030c348 fix:: adapt to review 2023-04-21 11:58:59 +02:00
Torsten Dittmann 725ebfcd44 fix: ci version numbers 2023-04-20 22:15:29 +02:00
Torsten Dittmann ba1e5a7159 ci: use proper versions 2023-04-20 21:46:29 +02:00
Torsten Dittmann 7d119aa68c ci: try sharing console build for all 2023-04-19 14:03:23 +02:00
Torsten Dittmann 590ae9cfe4 update tags 2023-04-19 13:55:05 +02:00
Torsten Dittmann a769a18ba0 update tags 2023-04-19 13:54:48 +02:00
Torsten DittmannandGitHub 08e5dc1c40 Update release.yml 2023-04-19 13:25:12 +02:00
Torsten Dittmann 85b8728e71 fix: change name 2023-04-19 13:23:14 +02:00
Torsten Dittmann b3c2273780 ci: release action 2023-04-19 13:22:13 +02:00
Christy JacobandGitHub 62bdc77b93 Merge pull request #5377 from appwrite/fix-function-timeout-desc
Update description for _APP_FUNCTIONS_INACTIVE_THRESHOLD
2023-04-17 22:55:14 +04:00
Vincent (Wen Yu) GeandGitHub b6c43e2ccf Update app/config/variables.php 2023-04-17 14:02:11 -04:00
Vincent (Wen Yu) GeandGitHub 166b446fe7 Update description for _APP_FUNCTIONS_INACTIVE_THRESHOLD 2023-04-14 14:31:22 -04:00
Torsten DittmannandGitHub e5fa4883b2 Merge pull request #5358 from appwrite/1.3.x
1.3.x sync
2023-04-12 19:01:02 +02:00
Torsten DittmannandGitHub 7f377f8d32 Merge pull request #5355 from appwrite/fix-relationship-attr-link
Fix link in Learn more about relationship attributes
2023-04-12 19:00:17 +02:00
Torsten DittmannandGitHub 35b76a9597 Merge pull request #5357 from appwrite/chore-prepare-1-3-1
chore: prepare 1.3.1 release
2023-04-12 18:56:31 +02:00
Torsten Dittmann 7ca70b2ab9 Merge branch 'master' of https://github.com/appwrite/appwrite into chore-prepare-1-3-1 2023-04-12 18:51:00 +02:00
Torsten DittmannandGitHub 7cec672a63 Merge pull request #5356 from appwrite/fix-migration-v18
fix: migration for 1.3.x
2023-04-12 18:27:20 +02:00
Torsten Dittmann 8872d9db17 feat: upgrade to console 2.3.3 2023-04-12 18:23:09 +02:00
Torsten Dittmann d2b2d18134 chore: prepare 1.3.1 release 2023-04-12 18:13:49 +02:00
Torsten Dittmann 34d27fb4d0 fix: prefs for teams 2023-04-12 18:03:08 +02:00
Torsten Dittmann 52d7dcf082 fix: update prefs endpoints to not fallback to stdClass 2023-04-12 18:02:43 +02:00
Torsten Dittmann 3009168350 fix: migration for 1.3.x 2023-04-12 17:48:36 +02:00
Vincent (Wen Yu) Ge 07017e0835 Updated specs for storage links 2023-04-12 11:32:25 -04:00
Vincent (Wen Yu) Ge f952d57c88 Fix link in storage specs 2023-04-12 11:27:56 -04:00
Vincent (Wen Yu) Ge c96b32d7b6 Update specs 2023-04-12 11:18:55 -04:00
Vincent (Wen Yu) Ge 472ddd190c fix links for relationship attribute 2023-04-12 15:11:10 +00:00
Christy JacobandGitHub af7cbef024 Merge pull request #5353 from appwrite/update-1.3-blog-link-readme
Fix: Update Appwrite 1.3 blog link in Readme
2023-04-12 13:58:30 +04:00
Aditya Oberai be609f4ee2 Update Appwrite 1.3 blog link in Readme 2023-04-12 09:55:36 +00:00
Jake BarnbyandGitHub f2ea043c3b Merge pull request #5350 from appwrite/1.3.x
1.3.x
2023-04-12 19:50:21 +12:00
Jake BarnbyandGitHub ceadcbf113 Merge pull request #5352 from appwrite/feat-review-fixes
Feat review fixes
2023-04-12 19:22:28 +12:00
Jake Barnby f39e52e1d5 Update console 2023-04-12 19:11:58 +12:00
Jake Barnby 211f1bb117 Update versions 2023-04-12 19:02:36 +12:00
Jake BarnbyandGitHub 7ea990e1d9 Merge pull request #5351 from appwrite/feat-review-fixes
Update versions
2023-04-12 18:23:06 +12:00
Jake Barnby 15080fee1b Update changelogs 2023-04-12 18:18:04 +12:00
Jake Barnby 979fa36b02 Update versions 2023-04-12 17:59:43 +12:00
Jake BarnbyandGitHub 927c2a2988 Merge pull request #5347 from appwrite/fix-mock-file-upload
Skip validation for mock file upload
2023-04-12 17:15:35 +12:00
Jake Barnby d63ce7319c Update changelogs 2023-04-12 17:13:02 +12:00
Jake Barnby e2a0b8dcc1 Merge remote-tracking branch 'origin/master' into fix-mock-file-upload 2023-04-12 17:10:40 +12:00
Jake Barnby 98bab42414 Merge remote-tracking branch 'origin/master' into fix-mock-file-upload 2023-04-12 17:09:38 +12:00
Jake Barnby 924b7b90a4 Update specs 2023-04-12 17:09:19 +12:00
Jake BarnbyandGitHub 02c5df1676 Merge pull request #5259 from appwrite/feat-sync-master-12x
Bring 1.2.x to master
2023-04-12 17:08:51 +12:00
Jake Barnby 683aa8a325 Update SDK generator 2023-04-12 16:46:53 +12:00
Jake Barnby 3c6f8d2326 Skip validation for mock file upload 2023-04-12 14:53:35 +12:00
Damodar LohaniandGitHub d050ae40a7 Merge branch 'master' into feat-sync-master-12x 2023-04-12 07:31:23 +05:45
Christy JacobandGitHub d47bea764c Merge pull request #5336 from appwrite/1.3.x
1.3.x
2023-04-12 03:30:22 +04:00
Christy JacobandGitHub 3b4b412733 Merge pull request #5346 from appwrite/fix-console-service
fix: console server duplicate key
2023-04-11 23:35:10 +04:00
Torsten Dittmann ed702d0bc1 chore: update to new console 2023-04-11 21:33:48 +02:00
Torsten Dittmann d47b32856b fix: console server duplicate key 2023-04-11 20:57:27 +02:00
Christy JacobandGitHub 72330d0869 Merge pull request #5345 from appwrite/update-console
feat: update console version
2023-04-11 22:06:24 +04:00
Christy JacobandGitHub ce64bdb7f7 Merge pull request #5344 from appwrite/update-readme
feat: update readme
2023-04-11 22:06:09 +04:00
Christy Jacob 67be2c10eb feat: update console version 2023-04-11 18:01:37 +00:00
Christy JacobandGitHub 871f158bb6 Update README.md 2023-04-11 23:19:10 +05:30
Christy Jacob 641a47f195 feat: remove support for 0.15.x 2023-04-11 17:21:26 +00:00
Christy Jacob 7f14db493d feat: update security file 2023-04-11 17:00:22 +00:00
Christy Jacob f4a77fcf11 feat: update readme 2023-04-11 16:52:38 +00:00
Jake BarnbyandGitHub 3670b5e9ad Merge pull request #5342 from appwrite/feat-review-fixes
Feat review fixes
2023-04-12 03:56:22 +12:00
Jake Barnby d86d604624 Reviews fixes 2023-04-12 03:32:14 +12:00
Jake BarnbyandGitHub 2a8911011b Merge pull request #5341 from appwrite/feat-db-update-migrations
Add options key to attributes
2023-04-12 03:01:11 +12:00
Jake Barnby f869252d90 Remove redundant import 2023-04-12 03:00:09 +12:00
Jake Barnby 26eaddee82 Update comment 2023-04-12 02:59:45 +12:00
Jake Barnby 71b96452c6 Update platforms 2023-04-12 02:58:59 +12:00
Jake Barnby bafcfcfbb9 Update cache buster 2023-04-12 02:56:48 +12:00
Jake Barnby a01dd3fc41 Add options key to attributes 2023-04-12 02:49:47 +12:00
Jake BarnbyandGitHub 07b8f0fe3f Merge pull request #5339 from appwrite/feat-add-version
Add versioned specs and examples
2023-04-12 01:56:29 +12:00
Jake BarnbyandGitHub 117e416b80 Merge pull request #5334 from appwrite/feat-db-update-migrations
Feat db update migrations
2023-04-12 01:31:25 +12:00
Jake BarnbyandGitHub 69b5fae3bf Merge pull request #5338 from appwrite/feat-update-sdk-generator
Update SDK generator for 1.3.x support
2023-04-12 01:28:48 +12:00
Jake Barnby ffb91eca68 Merge remote-tracking branch 'origin/1.3.x' into feat-update-sdk-generator
# Conflicts:
#	composer.json
#	composer.lock
2023-04-12 01:24:50 +12:00
Jake Barnby 6b497a31c8 Add versioned specs and examples 2023-04-12 01:23:29 +12:00
Christy JacobandGitHub e3b8f0b302 Merge pull request #5337 from appwrite/sync-master
Sync master
2023-04-11 18:53:01 +05:30
Jake Barnby 9b7d032eda Update SDK generator for 1.3.x support 2023-04-12 00:58:12 +12:00
Jake Barnby 7fe14ca10b Merge remote-tracking branch 'origin/master' into sync-master
# Conflicts:
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
#	app/console
#	app/controllers/api/storage.php
#	composer.lock
2023-04-12 00:50:31 +12:00
Jake Barnby 9a76507185 Merge remote-tracking branch 'origin/1.3.x' into feat-db-update-migrations
# Conflicts:
#	CHANGES.md
2023-04-12 00:39:18 +12:00
Jake BarnbyandGitHub aa20b685a7 Merge pull request #5335 from appwrite/fix-organization-delete
fix: deletes worker deleting projects with console team
2023-04-12 00:38:38 +12:00
Jake Barnby bf73b1a55f Update changelog 2023-04-12 00:38:07 +12:00
Jake Barnby de2ea95099 Update changelog 2023-04-12 00:34:29 +12:00
Jake Barnby 43946cade5 Add teams migration 2023-04-12 00:33:29 +12:00
Jake Barnby b0a6190394 Only iterate attributes once 2023-04-12 00:05:19 +12:00
Jake Barnby d46f3092e5 Remove redis and unused imports 2023-04-12 00:04:53 +12:00
Torsten Dittmann fdd18fdc7d fix: update changelog 2023-04-11 13:52:01 +02:00
Torsten Dittmann 700abb3e47 fix: deletes worker deleting projects with console team 2023-04-11 13:49:45 +02:00
Jake Barnby a2cb3c135f Fix migration of floats 2023-04-11 23:42:06 +12:00
Jake Barnby 0f1c1fda9e Quote attribute name 2023-04-11 22:30:45 +12:00
Jake Barnby c60d7764e4 Fix cache key 2023-04-11 22:27:49 +12:00
Jake Barnby 28a9a373b1 Fix binding 2023-04-11 22:27:29 +12:00
Jake Barnby f6bd9d4150 Merge remote-tracking branch 'origin/1.3.x' into feat-db-update-migrations 2023-04-11 22:15:32 +12:00
Jake BarnbyandGitHub c077636d40 Merge pull request #5300 from appwrite/doc-auth-1.3
Update auth doc links for 1.3
2023-04-11 22:08:40 +12:00
Jake Barnby 2157acd63f Merge branch '1.3.x' into doc-auth-1.3
# Conflicts:
#	composer.lock
2023-04-11 21:22:32 +12:00
Jake BarnbyandGitHub 655ae89423 Merge pull request #5333 from appwrite/fix-user-model-response
Fix user model response for SDKs
2023-04-11 21:15:08 +12:00
Christy JacobandGitHub 45e636ab2d Merge pull request #5154 from appwrite/update-cli-1.2.1
feat: upgrade CLI to 1.2.1
2023-04-11 14:31:41 +05:30
Jake Barnby 5cbb08d6f1 Fix response model types for update password + update status 2023-04-11 20:41:24 +12:00
Christy Jacob 391e114cdd feat: update docs examples 2023-04-11 08:27:36 +00:00
Christy Jacob 4a314c0a58 Merge branch 'master' of https://github.com/appwrite/appwrite into update-cli-1.2.1 2023-04-11 08:14:52 +00:00
Jake Barnby 58ba41a9c5 Make password, hash and hashOptions optional so that they are optional in SDKs, and nulled when returning from the account service 2023-04-11 19:36:14 +12:00
Christy JacobandGitHub 01b066e317 Merge pull request #5330 from appwrite/docs-inputfile
Link to InputFile Docs
2023-04-11 13:02:31 +05:30
Jake BarnbyandGitHub dc626ea336 Merge pull request #5238 from appwrite/feat-relations-2
Feat relations 2
2023-04-11 18:26:10 +12:00
Jake Barnby 9604cd1d94 Update to tagged release 2023-04-11 17:41:21 +12:00
Jake Barnby f00bd7dac7 Merge remote-tracking branch 'origin/1.3.x' into feat-relations-2
# Conflicts:
#	composer.lock
2023-04-11 17:25:26 +12:00
Jake BarnbyandGitHub 87864d2365 Merge pull request #5301 from appwrite/doc-db-relationships
Updates links for query page
2023-04-11 17:16:12 +12:00
Jake Barnby 84f4c757c3 Fix test 2023-04-11 16:21:22 +12:00
Jake Barnby 7f8f34793e Merge remote-tracking branch 'origin/1.3.x' into doc-db-relationships
# Conflicts:
#	composer.lock
2023-04-11 15:57:35 +12:00
d58ce741f3 Apply suggestions from code review
Co-authored-by: Vincent (Wen Yu) Ge <vincent@appwrite.io>
2023-04-11 15:49:36 +12:00
Jake Barnby 5485346b5e Fail validation on nested attribute query 2023-04-11 15:40:14 +12:00
Vincent (Wen Yu) Ge 6e9e6aa6b3 relink to inputfile docs 2023-04-10 22:18:07 +00:00
fogelito acbdb06b3c Add .md files 2023-04-10 23:15:18 +03:00
Vincent (Wen Yu) GeandGitHub 5354e5ee44 Merge branch '1.3.x' into doc-auth-1.3 2023-04-10 16:03:36 -04:00
Jake Barnby 93a994a95d Update console + database 2023-04-10 21:48:50 +12:00
Jake Barnby e123188b0a Fix list document total 2023-04-10 20:51:38 +12:00
Christy JacobandGitHub 8d3c96d7eb Merge pull request #5325 from appwrite/fix-email-template-path
Fix email-base.tpl path in certificates worker
2023-04-10 13:05:19 +05:30
a91ee7e80f Apply suggestions from code review
Co-authored-by: Vincent (Wen Yu) Ge <vincent@appwrite.io>
2023-04-10 15:05:58 +12:00
b39b018a10 Update Dockerfile
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
2023-04-09 16:46:05 -04:00
StevenandGitHub 577ba9b0ec Fix email-base.tpl path in certificates worker 2023-04-06 13:48:52 -07:00
Jake Barnby d44f69df09 Delete collection relationships from deletes worker 2023-04-06 15:40:39 +12:00
Jake Barnby deb2751cbf Fix copy error 2023-04-06 02:57:37 +12:00
Jake Barnby bb9ae6f326 Update database 2023-04-06 02:43:06 +12:00
Jake Barnby b252fe847f Add custom delete restricted error 2023-04-06 00:54:44 +12:00
Torsten DittmannandGitHub 9e11e00c6d Merge pull request #5313 from appwrite/feat-console-service
feat: console service
2023-04-05 14:45:07 +02:00
Jake Barnby 6591778f90 Fix query tests 2023-04-05 23:04:12 +12:00
Jake Barnby 08b013353b Update database 2023-04-05 21:13:28 +12:00
Jake Barnby 1bf15a7cc2 Update database + console 2023-04-05 20:13:51 +12:00
Jake Barnby 599a0d0781 Catch, clear cache and re-throw for unhandled exceptions on attribute create 2023-04-05 18:48:57 +12:00
4624241d32 Update app/controllers/api/databases.php
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
2023-04-05 18:19:40 +12:00
2153f65893 Update app/controllers/api/databases.php
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
2023-04-05 18:19:25 +12:00
Jake Barnby 72f203b365 Update console 2023-04-03 22:49:29 +12:00
Jake Barnby ed8911e0a6 Remap internal attributes when updating existing document 2023-04-03 22:45:10 +12:00
Jake Barnby 6aba92bf8b Add missing instanceof checks 2023-04-03 22:39:31 +12:00
Jake Barnby 13c77b6927 Update database 2023-04-03 21:12:13 +12:00
Jake Barnby 460d52f948 Add unique ID when no ID passed for nested documents 2023-04-03 20:21:28 +12:00
Jake Barnby 6664377fb8 Merge remote-tracking branch 'origin/test-update-attributes' into feat-relations-2
# Conflicts:
#	app/controllers/api/databases.php
2023-04-03 16:10:09 +12:00
Jake Barnby af890a4e4b Merge remote-tracking branch 'origin/1.3.x' into feat-relations-2
# Conflicts:
#	composer.lock
2023-04-03 15:55:17 +12:00
Jake Barnby 3d95f7e129 Fix cache invalidation when deleting database 2023-04-03 15:51:44 +12:00
Jake Barnby 3cfbdf07b7 Fix cache invalidation when updating attributes 2023-04-03 15:43:14 +12:00
Jake BarnbyandGitHub cbcf110560 Merge pull request #5311 from appwrite/chore-update-abuse
Update abuse
2023-04-03 13:29:18 +12:00
Torsten DittmannandGitHub bd7d28f7d1 fix: steven review 2023-03-31 22:48:34 +02:00
Torsten Dittmann 28758d4794 fix: typo 2023-03-31 18:47:00 +02:00
Torsten DittmannandGitHub e8b6ff2bb3 Merge pull request #5210 from appwrite/fix-debugger
Fix yasd so that the debugger works
2023-03-31 18:43:13 +02:00
Torsten Dittmann 42df2435ec fix: sdk.auth for console service 2023-03-31 17:17:30 +02:00
Torsten Dittmann 3860602697 feat: console service 2023-03-31 17:14:59 +02:00
Torsten Dittmann f9adffc569 tests: add tests for cache on updating attributes 2023-03-31 14:56:38 +02:00
Jake Barnby dd2f980539 Fix worker warning 2023-03-31 23:15:48 +13:00
Jake Barnby eb8258d548 Fix tests 2023-03-31 21:29:02 +13:00
Jake Barnby 9010320cd9 Update abuse 2023-03-31 20:57:47 +13:00
Jake Barnby fec374fe59 Delete two way relationship attributes on collection delete 2023-03-31 19:56:35 +13:00
Jake Barnby bcf5b4bfab Update related two way attribute 2023-03-31 18:38:37 +13:00
Jake Barnby 3bbe6d4da8 Disallow updating two-way 2023-03-31 18:19:46 +13:00
Jake Barnby cf122054aa Update DB and console 2023-03-31 18:07:36 +13:00
Jake Barnby 578d4d1619 Disallow index creation on relationship attributes 2023-03-31 18:06:50 +13:00
Jake Barnby c7201cc417 Remove HTML from API error messages 2023-03-31 18:05:45 +13:00
Jake Barnby 939a0c5591 Add missing instanceof check 2023-03-31 17:56:25 +13:00
Jake Barnby bf4e2df45b Allow 'unique()' for nested document IDs 2023-03-31 17:33:21 +13:00
fogelito 05d7badd60 Delete related on 2 way 2023-03-30 20:36:24 +03:00
Jake Barnby 2f709a2e89 Fix test 2023-03-30 22:05:35 +13:00
Jake Barnby bd64ace713 Allow int for float filter queries 2023-03-30 21:02:33 +13:00
Jake Barnby 39acf18bc3 Handle document arrays when filtering documents 2023-03-30 20:54:45 +13:00
Jake Barnby 07d90aa4c4 Manually add the side to the attributes table 2023-03-30 20:41:18 +13:00
Jake Barnby ed54d9861f Add back validation for fulltext index on search queries 2023-03-30 19:57:56 +13:00
Steven Nguyen a86c1c0a2b Fix yasd so that the debugger works
* Update the base image since the yasd extension wasn't installed correctly
* Fix the path to the yasd_init.php file
* Use `host.docker.internal` as the remote host because that should always work inside docker
* Mount the dev folder into the appwrite container so the yasd_init.php file is picked up.
2023-03-29 18:04:24 -07:00
Jake Barnby 72d090f196 Update console 2023-03-30 13:33:40 +13:00
Jake Barnby 4de45bf9a7 Delete related cache on finally 2023-03-30 13:28:06 +13:00
Jake Barnby a7a3d85bcb Clear related collection cache 2023-03-30 13:24:44 +13:00
Jake Barnby 9468c238de Remove conflicts 2023-03-30 13:01:58 +13:00
Jake Barnby 9025f97939 Merge branch 'feat-relations-2' of github.com:appwrite/appwrite into feat-relations-2 2023-03-30 11:39:43 +13:00
fogelito e2d3c95fa6 add relations into attributes collection 2023-03-29 23:37:22 +03:00
fogelito 5aff6969db add relations into attributes collection 2023-03-29 23:31:49 +03:00
Vincent (Wen Yu) Ge 19d5ea03b9 Updates links for query page 2023-03-29 19:38:39 +00:00
Vincent (Wen Yu) Ge 7b35d3739b Update auth doc links for 1.3 2023-03-29 18:58:55 +00:00
fogelito 0638fec40d related attributes call tests 2023-03-29 18:43:54 +03:00
fogelito 1af33d1af7 related attributes call tests 2023-03-29 18:34:49 +03:00
Jake Barnby bfc54c4590 Delete original attribute if two-way attribute creation fails 2023-03-29 20:28:59 +13:00
Jake Barnby 161eb0b66f Create two-way attribute on related collection 2023-03-29 19:26:58 +13:00
Jake Barnby f25bfa805b Fix more name collisions 2023-03-29 16:30:47 +13:00
Jake Barnby d23a2e2040 Database side permission check for list document count 2023-03-29 16:05:53 +13:00
Jake Barnby 1958cef3d2 Merge remote-tracking branch 'origin/feat-relations-2' into feat-relations-2 2023-03-29 14:43:09 +13:00
Jake Barnby c09ab6cc9d Remove duplicate dependency 2023-03-29 14:42:19 +13:00
Jake Barnby 970ae8d0ad Reset array keys for list documents 2023-03-29 14:38:43 +13:00
Jake Barnby 96e1440ee6 Fix name collision 2023-03-29 14:37:56 +13:00
Jake Barnby ecaca00463 Force arrays for relation permissions checks 2023-03-29 14:33:53 +13:00
Jake Barnby e80d13076f Consistent attribute ordering 2023-03-29 13:37:51 +13:00
Jake Barnby 15d1badafb Update param desc 2023-03-29 13:37:03 +13:00
ac82726364 Update app/controllers/api/databases.php
Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
2023-03-29 13:33:27 +13:00
fogelito 3c9cb0ab80 Strict WhiteList options 2023-03-28 16:24:18 +03:00
Jake Barnby 505ffc91ae Fix existing tests 2023-03-28 22:08:36 +13:00
Jake Barnby f69d222a5a Inline permissions checks 2023-03-28 22:02:49 +13:00
Jake Barnby 5f7f44f939 Reduce nesting and handle arrays for nested ID set 2023-03-28 16:10:12 +13:00
fogelito 18be424fc0 Test list attributes 2023-03-27 18:24:02 +03:00
Jake Barnby fa64cc33ea Add missing check for update 2023-03-27 20:08:02 +13:00
Jake Barnby 948f04e71c Lint 2023-03-27 19:26:27 +13:00
Jake Barnby 1cf25199ab Recurse through nested documents to set collection ID 2023-03-27 19:03:00 +13:00
Jake Barnby 0465fb2268 Lint..? 2023-03-27 15:56:11 +13:00
Jake Barnby 275c6bb3a0 Set databaseId for all nested documents 2023-03-27 15:42:36 +13:00
Jake Barnby 64ee75e80d Revert "Extract $options on get attributes list"
This reverts commit 0ef6f32a10.
2023-03-27 12:18:47 +13:00
Jake Barnby 9ac08b496b Merge remote-tracking branch 'origin/feat-relations-2' into feat-relations-2 2023-03-27 12:18:29 +13:00
fogelito 0ef6f32a10 Extract $options on get attributes list 2023-03-26 19:39:26 +03:00
fogelito 276b1de2b0 Disable 2 way for ManyToOne relation test 2023-03-26 16:27:07 +03:00
Jake Barnby 79c8ed3ce4 Remove $collection and $internalId for nested documents 2023-03-25 17:11:19 +13:00
Jake Barnby 07c383e17a Review updates 2023-03-25 16:36:20 +13:00
Jake Barnby ac8d4fcb2a Add relationships to attribute response model tests 2023-03-25 16:29:40 +13:00
Jake Barnby d76d573e7c Update attribute subquery to flatten relationship attributes 2023-03-25 16:28:07 +13:00
Jake Barnby 0797df8414 Merge remote-tracking branch 'origin/1.3.x' into feat-relations-2
# Conflicts:
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
2023-03-25 15:32:55 +13:00
Christy JacobandGitHub ca186543ca Merge pull request #5274 from appwrite/update-readme
feat: update readme
2023-03-25 01:52:23 +05:30
Christy Jacob 8578985515 feat: update readme 2023-03-24 20:16:20 +00:00
Torsten DittmannandGitHub b8b6ac75fc Merge pull request #5196 from appwrite/feat-team-prefs
feat: team preferences
2023-03-24 12:33:55 +01:00
Jake Barnby daa5c7e59f Merge remote-tracking branch 'origin/1.3.x' into feat-relations-2
# Conflicts:
#	composer.json
#	composer.lock
2023-03-24 23:50:26 +13:00
Jake BarnbyandGitHub d43d0cf293 Merge pull request #5143 from appwrite/feat-remove-limits
Remove count, limit and offset limitations for queries
2023-03-24 23:48:32 +13:00
Jake Barnby 47586fedb5 Remove invalid test 2023-03-24 23:09:49 +13:00
Jake Barnby 702000ac2f Remove redundant test 2023-03-24 22:28:39 +13:00
Jake Barnby c65800b3a3 Merge remote-tracking branch 'origin/1.3.x' into feat-remove-limits
# Conflicts:
#	composer.json
#	composer.lock
2023-03-24 21:03:18 +13:00
Jake Barnby 0071b9d885 Generate specs 2023-03-24 20:59:12 +13:00
Jake Barnby 48b018fd9d Merge remote-tracking branch 'origin/1.3.x' into feat-relations-2 2023-03-24 20:53:41 +13:00
Jake Barnby 6cddb38290 Fix for count 2023-03-24 20:30:41 +13:00
Jake Barnby c4b11afd08 Disable stop on failure 2023-03-24 18:59:26 +13:00
Jake BarnbyandGitHub f6aa4a4ab1 Merge pull request #5271 from appwrite/feat-realtions-jake
Feat relations updates
2023-03-24 18:58:25 +13:00
Jake Barnby a48ce855c7 Move tests 2023-03-24 18:56:49 +13:00
Jake Barnby 1885f9e87c Add graphql tests 2023-03-24 18:08:50 +13:00
Jake Barnby 24d1163703 Fix params 2023-03-24 16:57:56 +13:00
Jake Barnby 2775a92cdf Add more tests 2023-03-24 16:48:50 +13:00
Jake Barnby b6cfe43681 Clean up 2023-03-24 16:46:02 +13:00
Jake Barnby 947ad20bad Pass attribute to select validator 2023-03-24 16:44:28 +13:00
Jake Barnby c310434eeb Update dependencies 2023-03-24 16:39:35 +13:00
fogelito e62e5c405a Select from parent and related 2023-03-23 18:34:49 +02:00
fogelito 3a7d00519f some tests assertArrayHasKey 2023-03-23 18:05:22 +02:00
fogelito d6a7e26678 FilterTest.php 2023-03-23 17:51:30 +02:00
fogelito 671888d975 Unit test SelectTest.php 2023-03-23 16:33:11 +02:00
fogelito 6539f15178 Fix return on test 2023-03-23 16:23:14 +02:00
fogelito 617a2c5fc8 New Queries Activation 2023-03-23 16:13:50 +02:00
fogelito fad9ecd389 New Queries Activation 2023-03-23 16:11:02 +02:00
fogelito 969cff5e41 New Queries Activation 2023-03-23 16:08:38 +02:00
Torsten Dittmann 0b9526fc50 tests: add graphql tests 2023-03-23 13:54:12 +01:00
Torsten Dittmann 7020c85f78 tests: fix teams tests 2023-03-23 13:06:48 +01:00
Torsten Dittmann c1ba898cec feat: rename update team sdk method 2023-03-23 13:04:16 +01:00
Torsten Dittmann 10cd97e978 Merge branch '1.3.x' of https://github.com/appwrite/appwrite into feat-team-prefs 2023-03-23 13:03:50 +01:00
Torsten DittmannandGitHub e8583d9387 Merge pull request #5164 from appwrite/feat-database-update-attribute
feat: database update attribute endpoints
2023-03-23 13:01:05 +01:00
Torsten Dittmann 75b687786d chore: run formatter 2023-03-23 11:28:31 +01:00
Torsten Dittmann 0fc4d5f49a chore: generate specs 2023-03-23 11:28:15 +01:00
Torsten Dittmann 010481bafc feat: change url for updating attributes 2023-03-23 11:25:40 +01:00
Torsten Dittmann 818d111068 fix: wrong team event descriptions 2023-03-23 10:52:43 +01:00
Jake Barnby f43ff0d2e9 Update dependencies 2023-03-23 18:40:05 +13:00
Jake Barnby 588d6651a2 Update tests 2023-03-23 18:34:13 +13:00
Jake Barnby c18af032ae Remove redundant model attributes 2023-03-23 18:20:15 +13:00
Jake Barnby 035180c4da Allow other filter query types 2023-03-23 18:09:38 +13:00
Jake Barnby 7a089f8861 Use specific document validator for select queries on get document 2023-03-23 17:59:23 +13:00
Jake Barnby 2e44434ab8 Parse queries after validation 2023-03-23 17:55:31 +13:00
Jake Barnby f974477ecc Use plain param to allow validating against collection attributes 2023-03-23 17:32:44 +13:00
Jake Barnby f9f7af8759 Worker fix 2023-03-23 17:20:08 +13:00
Jake Barnby 0643a94b12 Update signatures 2023-03-23 16:58:41 +13:00
Jake Barnby 18bdb6ae3e Revert "Trigger workflow"
This reverts commit 5f965e6dad.
2023-03-23 15:16:24 +13:00
Jake Barnby 5f965e6dad Trigger workflow 2023-03-23 15:15:57 +13:00
Jake Barnby 2b1e35659c Merge remote-tracking branch 'origin/1.3.x' into feat-remove-limits
# Conflicts:
#	composer.json
#	composer.lock
2023-03-23 15:08:35 +13:00
Jake Barnby 5689d47d41 Merge remote-tracking branch 'origin/1.3.x' into feat-db-update-migrations
# Conflicts:
#	src/Appwrite/Migration/Version/V18.php
2023-03-23 15:05:35 +13:00
fogelito 60c54e2d10 Select Validator 2023-03-22 23:10:47 +02:00
Christy JacobandGitHub 6122a25e56 Merge pull request #5188 from singhbhaskar/feat-5159-improve-error-when-creating-custom-domain
Updated the error to 501 error code for custom domain when _APP_DOMAIN and _APP_DOMAIN_TARGET is setup incorrectly
2023-03-22 23:15:50 +05:30
fogelito 319698dab4 libraries 2023-03-22 19:14:41 +02:00
fogelito 34467de87d Update relationship get Attribute 2023-03-22 18:44:12 +02:00
Christy Jacob c31d60dc1f feat: sync with master 2023-03-22 20:38:59 +04:00
Christy Jacob 4c52458684 Merge branch 'master' of github.com:appwrite/appwrite into update-cli-1.2.1 2023-03-22 20:34:21 +04:00
fogelito a824b46df0 Update relationship 2023-03-22 17:49:08 +02:00
fogelito 433b3be9ed $oneToMany tests 2023-03-21 19:52:25 +02:00
Eldad A. FuxandGitHub 53dc3a9dee Merge pull request #5202 from appwrite/fix-cache-flush
Prevent cache from being flushed on start
2023-03-21 17:31:00 +02:00
Bhaskar SinghandGitHub 5c2c968933 Merge branch 'appwrite:master' into feat-5159-improve-error-when-creating-custom-domain 2023-03-21 20:35:22 +05:30
Bhaskar Singh 8b5e0e1f1a Updating the exception variable name for easy
readability
2023-03-21 20:33:42 +05:30
fogelito e06e890279 query validators ignore nested 2023-03-21 14:32:05 +02:00
Jake BarnbyandGitHub a3ddfd98d8 Merge pull request #5243 from appwrite/fix-migration
Update migration V18.php
2023-03-21 19:54:01 +13:00
Damodar Lohani 48065033b5 composer update 2023-03-21 05:59:21 +00:00
Damodar Lohani 8e987112b9 Merge remote-tracking branch 'origin/master' into 1.2.x 2023-03-21 05:55:07 +00:00
Eldad A. FuxandGitHub 5f1fb5a5ef Merge pull request #5235 from appwrite/fix-android-getting-started
Update GETTING_STARTED.md
2023-03-21 07:33:39 +02:00
Eldad A. FuxandGitHub b77967dc1f Merge pull request #5131 from appwrite/feat-sdk-releases
For SDK release
2023-03-21 07:32:48 +02:00
Eldad A. FuxandGitHub 3139130fdd Merge pull request #5228 from appwrite/fix-object-storage-xml-reading
Fix XML reading issue
2023-03-21 07:31:17 +02:00
Christy Jacob 66f18a494b Merge branch 'update-cli-1.2.1' of github.com:appwrite/appwrite into update-cli-1.2.1 2023-03-20 17:00:40 +05:30
Christy Jacob e114da1d9a Merge branch 'master' of github.com:appwrite/appwrite into update-cli-1.2.1 2023-03-20 16:55:02 +05:30
fogelito a5f3af62bd Extract model options 2023-03-20 13:20:24 +02:00
f7c9e9c650 Update app/workers/databases.php
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
2023-03-20 11:23:01 +02:00
Torsten Dittmann d59b4d17bb fix: update attribute review 2023-03-20 10:13:23 +01:00
Christy Jacob 232dc7aef7 feat: update console 2023-03-20 07:14:16 +00:00
Christy Jacob 6640c52849 Merge branch 'master' of https://github.com/appwrite/appwrite into update-cli-1.2.1 2023-03-20 06:56:35 +00:00
fogelito 0c6f9bdb01 delete relation attribute 2023-03-19 19:31:15 +02:00
fogelito eee29940bb Some tests 2023-03-19 19:09:17 +02:00
Torsten Dittmann 644832f0b3 fix: mock endpoint for nullable params 2023-03-17 10:31:36 +01:00
Torsten Dittmann 841a8d3fae chore: generate specs 2023-03-17 10:27:56 +01:00
Torsten Dittmann a40dba1b49 tests: add nullable mock endpoint 2023-03-17 10:19:39 +01:00
Damodar LohaniandGitHub c094a40a53 Update Migration.php 2023-03-17 07:09:50 +05:45
Damodar LohaniandGitHub 6e4592dab4 Update migration V18.php 2023-03-17 07:08:47 +05:45
fogelito 038f4fc073 Some relation tests 2023-03-16 18:28:08 +02:00
fogelito 00c1418246 Update response Model.php 2023-03-16 13:48:27 +02:00
fogelito 79bfa025cb Merge branch 'feat-database-update-attribute' of github.com:appwrite/appwrite into feat-relations-2
 Conflicts:
	app/controllers/api/databases.php
	composer.json
	composer.lock
2023-03-16 12:14:37 +02:00
fogelito 28af0669f6 docker-compose.yml temp mount 2023-03-16 11:11:04 +02:00
Damodar Lohani d26d0d5943 update base docker image 2023-03-16 07:50:04 +00:00
fogelito 44de884ee5 convert relatedOptions to options 2023-03-16 09:31:48 +02:00
Damodar LohaniandGitHub 9aaef931ca Update GETTING_STARTED.md 2023-03-16 07:35:04 +05:45
348c2d4ffe Update app/config/events.php
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
2023-03-15 12:11:46 +01:00
Torsten Dittmann 08d588aeb1 fix: remove unnecessary owner check 2023-03-15 11:55:21 +01:00
fogelito c1bce185fd composer framework update 2023-03-15 10:04:02 +02:00
Damodar Lohani a0a3e3bd2c update utopia storage version 2023-03-15 00:29:31 +00:00
Steven Nguyen 137c2d663e Prevent cache from being flushed on start
We shouldn't clear the cache because scheduled functions are also
in the cache and we don't want to lose them.
2023-03-14 16:09:14 -07:00
fogelito 31fad24603 collections.php 2023-03-14 15:20:56 +02:00
fogelito 40152fbd6c Model relationshipOptions 2023-03-14 15:18:30 +02:00
fogelito 6306ec59ba Model relationship 2023-03-14 10:32:49 +02:00
fogelito f255484fd4 Model relationship 2023-03-14 10:24:53 +02:00
Torsten Dittmann bfdb7830d0 fix: update team prefs endpoint 2023-03-14 04:40:17 +05:30
fogelito adcbb08374 deleteRelationship worker 2023-03-13 17:32:51 +02:00
fogelito 341830b3d7 deleteRelationship worker 2023-03-13 17:19:24 +02:00
fogelito 9c4b269669 update collections.php with options 2023-03-13 12:59:01 +02:00
Torsten Dittmann ea1c0d0a1f chore: generate specs 2023-03-13 15:54:55 +05:30
Torsten Dittmann 2f1dda891b fix: specs generation for nullable params 2023-03-13 15:54:49 +05:30
fogelito b1cc4ada4c relationType 2023-03-13 12:11:38 +02:00
Eldad A. FuxandGitHub 8b79438755 Merge pull request #5126 from appwrite/feat-reset-sdk-account-model
switch SDK response model from account to user
2023-03-13 11:46:44 +02:00
fogelito f5f51c4fc9 Worker $relatedCollection 2023-03-13 11:46:03 +02:00
fogelito 5fc3f5bc3a Worker 2023-03-13 11:34:41 +02:00
fogelito b6c279b576 add relatedCollectionInternalId 2023-03-13 10:45:54 +02:00
fogelito b116d24486 Document options 2023-03-13 10:33:07 +02:00
fogelito ba6439375c create attribute function 2023-03-13 10:22:01 +02:00
fogelito f525104963 create relationship 2023-03-12 17:06:56 +02:00
fogelito ca3efdf562 create relation 2023-03-12 16:04:18 +02:00
Torsten Dittmann 10150aad3e feat: only owners are allowed to update attributes 2023-03-10 21:57:13 +05:30
Torsten Dittmann 2178bfc126 Merge branch '1.3.x' of https://github.com/appwrite/appwrite into feat-database-update-attribute 2023-03-10 18:39:11 +05:30
Torsten Dittmann f568f9f1ad style: fix formatting 2023-03-10 18:37:16 +05:30
Torsten Dittmann 7b1853eb96 feat: graphql support 2023-03-10 18:36:46 +05:30
Torsten Dittmann 077ad544b6 fix: database responses 2023-03-10 18:36:34 +05:30
Torsten Dittmann cb065e4228 fix: openapi specification 2023-03-10 15:36:10 +05:30
Bhaskar Singh 31a903d144 Updated the error message for target check fails
in custom domain creation
2023-03-10 00:24:33 +05:30
Torsten Dittmann fcd9b060fd chore: generate specs 2023-03-09 16:49:11 +05:30
Torsten Dittmann 01edc57806 Merge branch '1.3.x' of https://github.com/appwrite/appwrite into feat-team-prefs 2023-03-09 16:04:20 +05:30
Damodar LohaniandGitHub ad8ae92a6d Merge branch '1.3.x' into feat-reset-sdk-account-model 2023-03-09 07:06:24 +05:45
Torsten Dittmann 64244d9f8f docs: update teams get prefs 2023-03-09 02:11:10 +05:30
4f08d8e82a Apply suggestions from code review
Co-authored-by: Vincent (Wen Yu) Ge <vincent@appwrite.io>
2023-03-09 02:09:03 +05:30
Eldad A. FuxandGitHub 9ea3f0317f Merge pull request #5024 from appwrite/feat-x-appwrite-timestamp-header
Update Update Document API to check X-Appwrite-Timestamp header
2023-03-08 18:32:24 +02:00
Bhaskar Singh b16c789282 Fixing the bracket 2023-03-08 17:23:15 +05:30
Bhaskar Singh 7a4cea9f79 Removed ENV_VARIABLE_INCORRECT_SETUP 2023-03-08 17:21:37 +05:30
Bhaskar Singh 7f3000439a Updated ENV_VARIABLE_INCORRECT_SETUP to DOMAIN_VARIABLE_INCORRECT 2023-03-08 17:15:55 +05:30
Steven Nguyen 85a2d623a6 Update APIs to check X-Appwrite-Timestamp header
Appwrite will refer to the X-Appwrite-Timestamp header for when the
request was originally sent and reject the request if the Timestamp
is older than the updatedAt timestamp of the document.
2023-03-07 10:54:52 -08:00
Damodar Lohani 0121a95cee update sdk versions 2023-03-07 06:15:01 +00:00
Damodar Lohani e11ef18f1e update sdk generator 2023-03-07 06:14:34 +00:00
Damodar Lohani cbc365a702 update changelog 2023-03-07 06:14:24 +00:00
Torsten Dittmann 496da61cd9 feat: team preferences 2023-03-06 19:54:02 +05:30
Bhaskar Singh eaf31fdb78 Updated the error to 501 error code for custom
domain when _APP_DOMAIN and _APP_DOMAIN_TARGET is setup incorrectly
2023-03-05 14:35:47 +05:30
Torsten Dittmann df9f1ee4c4 tests: fix update attribute status code 2023-03-02 14:01:35 +05:30
Torsten Dittmann 5df53e3e76 fix: http status codes for udpating attributes 2023-03-02 12:15:10 +05:30
Torsten Dittmann bfd23665cb fix: graphql 2023-03-01 18:13:34 +05:30
Torsten Dittmann 0dd666c227 tests: fix functions tests 2023-03-01 17:30:54 +05:30
Torsten Dittmann 6e5b8fab4b fix: implement new framework changes 2023-03-01 17:30:36 +05:30
Jake BarnbyandGitHub d2c55afdcf Merge pull request #5145 from appwrite/feat-remove-index-requirements
Remove indexed attribute query requirement
2023-03-01 21:42:29 +13:00
Torsten DittmannandGitHub 861e980420 Merge pull request #5173 from appwrite/chore-release-1-3-console-sdk
chore: 1.3.x console sdk
2023-03-01 12:56:21 +05:30
Torsten Dittmann 41277864fd sdks: fix version number for console sdk 2023-02-28 15:26:37 +05:30
Torsten Dittmann 86134768fc chore: generate specs 2023-02-28 15:07:30 +05:30
Torsten Dittmann ae32536be2 Merge branch 'master' of https://github.com/appwrite/appwrite into chore-release-1-3-console-sdk 2023-02-28 14:45:34 +05:30
Torsten Dittmann d5449cb498 fix: console sdk package name 2023-02-28 14:43:36 +05:30
Torsten DittmannandGitHub e8c74d7204 Merge pull request #5172 from appwrite/feat-console-sdk-generation
feat: console sdk generation
2023-02-28 14:40:56 +05:30
Torsten Dittmann 8714f11fd2 chore: generate docs 2023-02-28 14:06:08 +05:30
Torsten Dittmann d604746f9b chore: generate console docs 2023-02-28 14:05:57 +05:30
Torsten Dittmann b331fe4ab9 fix: console sdk package name 2023-02-28 14:05:40 +05:30
Torsten Dittmann 7372983c9d docs: update attributes 2023-02-28 13:55:06 +05:30
Torsten DittmannandGitHub 196ecff5dc Merge pull request #5160 from appwrite/feat-mock-cache-labels
Add offline support labels on mock endpoint for sdk generator tests
2023-02-28 13:24:52 +05:30
Jake Barnby c06b38773c Merge remote-tracking branch 'origin/1.3.x' into feat-db-update-migrations
# Conflicts:
#	src/Appwrite/Migration/Migration.php
#	src/Appwrite/Migration/Version/V18.php
2023-02-28 16:59:14 +13:00
Jake Barnby a28eaa80cf Add test asserting indexes not required 2023-02-28 16:52:11 +13:00
Jake Barnby 66a7b652e6 Update lock 2023-02-28 16:48:27 +13:00
Jake Barnby 84f4813135 Revert "Remove count, limit and offset limitations"
This reverts commit ae3535de0d.

# Conflicts:
#	composer.lock
2023-02-28 16:42:21 +13:00
Jake Barnby 04c1d3ca7f Revert "Remove redundant test"
This reverts commit b2fc7cc25a.
2023-02-28 16:40:52 +13:00
Jake Barnby 73a47b5624 Revert "Remove redundant test"
This reverts commit 8c5220f455.
2023-02-28 16:40:25 +13:00
Torsten Dittmann c4a27c79ab chore: run linter 2023-02-27 13:56:45 +05:30
Torsten Dittmann 18d938ce54 tests: add tests for update attributes on non existing resources 2023-02-27 13:29:37 +05:30
Torsten Dittmann 4023a4bb2f tests: rename import for AppwriteException 2023-02-27 13:17:20 +05:30
Torsten Dittmann 454fd1cd43 revert: remove unused imports 2023-02-27 13:16:35 +05:30
Torsten Dittmann c5953d1e1b tests: add tests for updating attributes 2023-02-27 13:15:21 +05:30
Torsten Dittmann fb3a7bc0e9 fix: update attribute endpoints params 2023-02-27 13:15:11 +05:30
Torsten Dittmann acd18b4d9d tests: update attributes 2023-02-26 21:15:42 +05:30
Torsten Dittmann ec7e28b3e7 fix: databases update attributes events 2023-02-26 21:14:22 +05:30
Torsten Dittmann 5a2bbd0976 docs: update attributes 2023-02-26 21:13:27 +05:30
Torsten Dittmann 740e1956b5 revert: style changes 2023-02-26 18:07:44 +05:30
Torsten Dittmann 8ae974e6dd feat: database update attribute endpoints 2023-02-26 18:03:18 +05:30
Torsten DittmannandGitHub fadad0ee4f Merge pull request #5002 from appwrite/feat-console-sdk
feat: add console sdk
2023-02-26 14:20:36 +05:30
Eldad A. FuxandGitHub f1fd44cee3 Merge pull request #5142 from appwrite/feat-13x-master-sync
Feat 13x master sync
2023-02-26 10:32:27 +02:00
Torsten Dittmann 293c0e176b Merge branch 'master' of https://github.com/appwrite/appwrite into feat-console-sdk 2023-02-26 13:24:55 +05:30
Damodar LohaniandGitHub dd9eab65c8 Merge branch 'master' into feat-reset-sdk-account-model 2023-02-26 10:46:07 +05:45
Steven Nguyen 0790fe04cc Add offline support labels on mock endpoint for sdk generator tests 2023-02-24 16:00:00 -08:00
Torsten DittmannandGitHub 8b7dd6eaa6 Merge pull request #5083 from singhbhaskar/fix-5070-session-create-event-doesnt-show-in-Appwrite-Console-user-activity-for-OAuth-Sessions
Adding missing audits.userId to routes
2023-02-24 15:29:21 +05:30
Torsten DittmannandGitHub d043a74082 Merge pull request #4985 from munyoudoum/fix-4982-email-session-expire-string-formattz
Fix 4982 email session expire string formattz
2023-02-24 15:24:05 +05:30
Torsten DittmannandGitHub dacb713450 Merge branch 'master' into fix-4982-email-session-expire-string-formattz 2023-02-24 15:23:33 +05:30
Torsten DittmannandGitHub 7d7ac9757b Merge pull request #5151 from appwrite/feat-cancel-in-progress
Update the github workflows to cancel if PR is modified
2023-02-24 15:22:18 +05:30
Torsten DittmannandGitHub c60f78fdeb Merge pull request #5099 from appwrite/feat-cache-labels
Feat cache labels
2023-02-24 12:01:07 +05:30
Steven Nguyen 0c6ddb8c99 Generate updated specs 2023-02-23 14:47:45 -08:00
Steven Nguyen c5ebcbab2b Add offline support labels on endpoints 2023-02-23 14:47:45 -08:00
Christy Jacob 941cb173c3 feat: upgrade CLI to 1.2.1 2023-02-22 11:22:14 +05:30
Christy Jacob b8efa441fb feat: upgrade CLI to 1.2.1 2023-02-22 11:06:21 +05:30
Steven Nguyen 7f542e2052 Update the github workflows to cancel if PR is modified 2023-02-21 14:59:15 -08:00
Steven Nguyen 6bdd3906c9 Update specs generator to include offline metadata 2023-02-21 14:50:17 -08:00
Steven Nguyen 7c0eb7bf8b Document new offline support labels 2023-02-21 14:33:52 -08:00
Jake Barnby 8c5220f455 Remove redundant test 2023-02-21 19:43:59 +13:00
Damodar Lohani 0b07fb2060 fix error 2023-02-21 05:18:41 +00:00
Jake Barnby b2fc7cc25a Remove redundant test 2023-02-21 17:59:10 +13:00
Damodar LohaniandGitHub 6b6f9edbd6 Merge branch '1.3.x' into feat-13x-master-sync 2023-02-21 07:38:46 +05:45
Jake Barnby 32fd00031d Update audit 2023-02-21 14:21:23 +13:00
Jake Barnby b8c11a5643 Fix test 2023-02-21 13:38:19 +13:00
Eldad A. FuxandGitHub 6540749559 Merge pull request #4866 from appwrite/feat-password-history
feat: check password history
2023-02-20 12:48:55 +02:00
Eldad A. FuxandGitHub cf0b039653 Merge pull request #4906 from appwrite/feat-password-dictionary
password dictionary
2023-02-20 11:42:42 +02:00
Damodar Lohani 104d99e636 fix default value error 2023-02-20 07:08:27 +00:00
Jake Barnby 6635ebf27f Remove indexed attribute query requirement 2023-02-20 19:29:25 +13:00
Jake Barnby 17fec2690a Add back param 2023-02-20 19:26:17 +13:00
Jake Barnby 94c58c367b Add back configurable limit for offset/limit 2023-02-20 19:18:19 +13:00
Jake Barnby ae3535de0d Remove count, limit and offset limitations 2023-02-20 19:03:15 +13:00
Damodar Lohani 1b9ee249be Merge remote-tracking branch 'origin/1.3.x' into feat-password-history 2023-02-20 04:02:23 +00:00
Damodar Lohani 81add700c6 fix error 2023-02-20 04:01:08 +00:00
Damodar Lohani c990f686dd Merge remote-tracking branch 'origin/1.3.x' into feat-password-dictionary 2023-02-20 03:56:48 +00:00
Damodar Lohani 4948aedfb5 Merge remote-tracking branch 'origin/master' into 1.3.x 2023-02-20 03:51:54 +00:00
Damodar LohaniandGitHub 9f3e815167 Merge branch 'feat-password-history' into feat-password-dictionary 2023-02-20 07:56:17 +05:45
Damodar Lohani e1cf464bcb Merge branch 'feat-password-history' of https://github.com/appwrite/appwrite into feat-password-history 2023-02-20 02:09:59 +00:00
Damodar Lohani 5863ba6285 update changes 2023-02-20 02:08:28 +00:00
Damodar Lohani 4e1a4b961c update attribute errors 2023-02-20 01:51:56 +00:00
Damodar Lohani 1904e3df81 fix formatting 2023-02-20 01:38:57 +00:00
Damodar Lohani 7e055c585d formatting fix 2023-02-20 01:37:33 +00:00
Damodar Lohani 452ee5c086 update dictonary validator 2023-02-20 01:34:05 +00:00
Christy JacobandGitHub 5d1ada4652 Merge pull request #4610 from ks129/fix-4594-function-response-500
Include response of 5xx status codes for function executions
2023-02-19 22:37:34 +05:30
Christy Jacob 35687e72d9 Merge branch 'master' of https://github.com/appwrite/appwrite into fix-4594-function-response-500 2023-02-19 16:30:36 +00:00
Eldad A. FuxandGitHub ed8c0ac02b Merge pull request #4973 from appwrite/feat-team-invite-improvements
Team Invite Improvements
2023-02-19 09:22:21 +02:00
Eldad A. FuxandGitHub 6696373d28 Merge pull request #4974 from appwrite/lohanidamodar-patch-3
Oauth2 check if provider is enabled
2023-02-19 08:53:41 +02:00
Eldad A. FuxandGitHub 3e3eaaf209 Merge pull request #5107 from BoynChan/master
Update Chinese Document
2023-02-17 08:14:22 +02:00
Damodar Lohani a730d1ddc7 fix changelog 2023-02-16 07:31:24 +00:00
Eldad A. FuxandGitHub 5ebd40ced8 Merge pull request #5115 from appwrite/feat-github-action-cache
Update tests CI to cache docker layers
2023-02-16 09:30:11 +02:00
Damodar Lohani 8eb4c1dd7f update flutter version 2023-02-16 07:29:57 +00:00
b43ca1a539 Update app/config/platforms.php
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
2023-02-16 11:55:10 +05:45
Damodar Lohani e1af86af98 update flutter changelog 2023-02-16 06:04:45 +00:00
Damodar Lohani 92f597cd49 update version numbers 2023-02-16 06:03:06 +00:00
Damodar Lohani 66beaf2cca remove space 2023-02-16 06:00:35 +00:00
Damodar Lohani c0968c9002 upgrade sdk generator 2023-02-16 06:00:24 +00:00
Steven Nguyen fc87a0a281 Bump actions to fix save-state warning 2023-02-15 11:27:26 -08:00
Torsten DittmannandGitHub bfc594b56e Merge pull request #5125 from appwrite/1.2.x
Update master with 1.2.1
2023-02-15 17:58:34 +01:00
Torsten Dittmann 244c4e1795 Merge branch 'master' of https://github.com/appwrite/appwrite into 1.2.x 2023-02-15 17:54:23 +01:00
Eldad A. FuxandGitHub 89560c4b82 Merge pull request #5106 from appwrite/feat-use-new-base-image
build using appwrite base docker image
2023-02-15 10:52:55 +02:00
Jake Barnby 650d1af339 Merge remote-tracking branch 'origin/master' into feat-db-update-migrations 2023-02-15 20:35:32 +13:00
Jake Barnby d543705a54 Migration for database update 2023-02-15 20:35:24 +13:00
Jake BarnbyandGitHub 0f2349faa2 Merge pull request #4864 from appwrite/feat-technical-debt-2
Feat technical debt for database changes
2023-02-15 20:13:23 +13:00
Jake Barnby 6012171258 Merge branch 'feat-technical-debt-2' of github.com:appwrite/appwrite into feat-technical-debt-2 2023-02-15 17:41:03 +13:00
Jake Barnby b3e29c6086 Fix audit 2023-02-15 17:39:15 +13:00
Damodar Lohani 2d702b62b2 switch SDK response model from account to user 2023-02-15 00:10:54 +00:00
Torsten DittmannandGitHub 0180aff4f5 Merge pull request #5123 from appwrite/feat-release-console-1-2-1
feat: bump console to 2.2.0
2023-02-14 20:34:46 +01:00
Torsten Dittmann 92a20a2241 chore: add to changelog 2023-02-14 18:56:06 +01:00
Torsten Dittmann 397d4937ea feat: bump console to 2.2.0 2023-02-14 18:53:11 +01:00
Torsten DittmannandGitHub 439467347e Merge pull request #5119 from appwrite/release-1.2.1
Release 1.2.1
2023-02-14 15:23:51 +01:00
fogelito 9b017140c7 composer.lock 2023-02-14 11:59:56 +02:00
fogelito 161d3b485e composer.json upgrades 2023-02-14 11:58:52 +02:00
fogelito 94b311f14f composer.json upgrades 2023-02-14 11:55:20 +02:00
fogelito 265eea0599 composer.lock 2023-02-14 09:55:06 +02:00
fogelito 05eb4eee78 Merge branch 'master' of github.com:appwrite/appwrite into feat-technical-debt-2 2023-02-14 09:40:55 +02:00
Damodar Lohani 3f171fbdb9 fix error code 2023-02-14 06:07:06 +00:00
Damodar Lohani 637e4098be provider disabled test 2023-02-14 05:56:14 +00:00
Jake Barnby f6fc9a8d8c Merge remote-tracking branch 'origin/master' into feat-technical-debt-2
# Conflicts:
#	composer.lock
2023-02-14 14:22:08 +13:00
Steven Nguyen c340fae696 Update CHANGES.md 2023-02-13 16:59:05 -08:00
Steven Nguyen bbd39582ba Update API specs 2023-02-13 16:21:45 -08:00
Steven Nguyen 7790079bb2 Bump version to 1.2.1 2023-02-13 15:55:54 -08:00
Steven Nguyen e90e007da1 Merge branch 'master' into release-1.2.1 2023-02-13 15:46:30 -08:00
Steven Nguyen 037d330641 Ensure image is added to local registry 2023-02-13 13:26:26 -08:00
Steven Nguyen 57c445868e Remove github cache cleanup 2023-02-13 13:14:15 -08:00
Steven Nguyen 88e9099e87 Update tests CI to cache docker layers 2023-02-13 12:08:28 -08:00
Christy JacobandGitHub 08fca62767 Merge pull request #5111 from appwrite/feat-add-growth-endpoint-envar
Expose Growth Env Var
2023-02-13 22:31:46 +05:30
Bradley Schofield 1e9bbdbda0 Add Default growth server 2023-02-13 14:52:58 +00:00
Bradley Schofield 5a665f3ad1 Update Dockerfile 2023-02-13 14:18:04 +00:00
Eldad A. FuxandGitHub 00bad84d48 Merge pull request #5109 from appwrite/feat-slow-tests-hook
Feature slow test
2023-02-13 13:56:15 +02:00
Damodar Lohani 488d3ec7e8 fix lint error 2023-02-13 06:26:36 +00:00
Damodar Lohani da873b2876 fix colored output 2023-02-13 06:24:22 +00:00
Damodar Lohani 0045eefd1e slow period 2023-02-13 06:02:20 +00:00
Damodar Lohani bff39aea08 slow test in stderr 2023-02-13 05:55:11 +00:00
BoynnandGitHub cdf7731508 Document: update CN doc 2023-02-13 11:42:03 +08:00
Damodar Lohani 6026358fb2 build using appwrite base docker image 2023-02-13 03:37:34 +00:00
StevenandGitHub 6d85dd6d85 Merge branch 'master' into fix-4594-function-response-500 2023-02-08 12:03:14 -08:00
Torsten DittmannandGitHub 3abb0013e7 Merge pull request #5089 from appwrite/fix-validator-origin
Fix validating origin for apple platforms
2023-02-07 19:28:05 +01:00
Torsten DittmannandGitHub 799c527661 Merge pull request #5090 from appwrite/sync-1.2.x
Sync 1.2.x
2023-02-07 19:27:50 +01:00
Torsten DittmannandGitHub 8f8e2b4aa3 Merge pull request #5091 from appwrite/refactor-update-messaging
Update messaging + SDK generator
2023-02-07 19:25:24 +01:00
Jake Barnby 5ddce5fbda Update lock 2023-02-07 19:48:33 +13:00
Jake Barnby e2a58dfade Fix validating origin for apple platforms
(cherry picked from commit 702472a8c77717619d477801a52d6038daa30da1)
2023-02-07 19:39:07 +13:00
Bhaskar Singh e9d53cbc46 Adding missing audits.userId to routes 2023-02-05 12:32:56 +05:30
Eldad A. FuxandGitHub 661581a7f3 Merge pull request #5071 from appwrite/fix-readme-badge
fix(readme): tests badge
2023-02-02 19:14:47 +02:00
Torsten DittmannandGitHub 213d3dc721 fix(readme): readme-cn 2023-02-02 18:02:12 +01:00
Torsten DittmannandGitHub abeb4973e4 fix(readme): tests badge 2023-02-02 18:00:12 +01:00
Christy JacobandGitHub 6a26d9db39 Merge pull request #5056 from appwrite/christyjacob4-patch-4
Update CONTRIBUTING.md
2023-02-01 12:55:41 +05:30
Damodar Lohani 9e4f66cac4 update migration 2023-01-31 06:52:40 +00:00
Damodar Lohani 45bc0f4066 fix migration 2023-01-31 06:51:43 +00:00
Damodar Lohani 8149405207 exception constant not needed 2023-01-30 06:08:56 +00:00
Damodar Lohani daa121262b fix boolean param 2023-01-30 06:06:52 +00:00
Damodar Lohani 91abc2b079 fix SDK method 2023-01-30 06:06:05 +00:00
Damodar Lohani 2070cccd54 update description 2023-01-30 06:05:32 +00:00
munyoudoum 9890b5934d chore: update changes.md 2023-01-30 00:43:46 +07:00
munyoudoum 63b54ead62 chore(tests): assert expire key has formatTz in POST email session 2023-01-30 00:32:05 +07:00
munyoudoum ff5c5c7138 fix(api/account): formatTz for expire property in POST email sessions 2023-01-30 00:32:05 +07:00
Damodar LohaniandGitHub 31b4c73b16 use variable 2023-01-29 15:30:39 +05:45
f15dd063fd Update src/Appwrite/Migration/Version/V18.php
Co-authored-by: Matej Bačo <matejbacocom@gmail.com>
2023-01-29 15:11:42 +05:45
Christy JacobandGitHub e5a6db6133 Merge pull request #4890 from appwrite/doc-clarify-permission
Update permission and ID param descriptions for grammar and clarity.
2023-01-28 04:15:20 +05:30
Christy JacobandGitHub feef53a43a Merge pull request #4556 from motasimmakki/motasim
docs: Removed unnecessary $ symbol and spaced correctly.
2023-01-27 22:50:04 +05:30
Christy Jacob 569776a1f6 Merge branch 'master' of https://github.com/appwrite/appwrite into motasim 2023-01-27 14:57:37 +00:00
Christy JacobandGitHub e9e254bb41 Merge pull request #4314 from tusharxoxoxo/patch-3
Update add-route.md
2023-01-27 18:49:03 +05:30
Christy JacobandGitHub 844690e904 Merge pull request #4315 from tusharxoxoxo/patch-4
Update add-runtime.md
2023-01-27 18:47:40 +05:30
Christy Jacob 0a73a76919 Merge branch 'master' of https://github.com/appwrite/appwrite into patch-3 2023-01-27 13:16:43 +00:00
Christy Jacob 2d8ba5438a Merge branch 'master' of https://github.com/appwrite/appwrite into patch-4 2023-01-27 13:13:10 +00:00
Christy JacobandGitHub 17ce9f532a Merge pull request #4316 from tusharxoxoxo/patch-5
Update add-storage-adapter.md
2023-01-27 18:37:44 +05:30
Christy JacobandGitHub e1dd5295f4 Update CONTRIBUTING.md 2023-01-27 18:36:20 +05:30
Christy Jacob 35ba33cb49 chore: review comments 2023-01-27 13:02:17 +00:00
Christy Jacob 148473e662 Merge branch 'master' of https://github.com/appwrite/appwrite into patch-5 2023-01-27 12:52:56 +00:00
Torsten DittmannandGitHub 00bd3bb9bb Merge pull request #4992 from appwrite/feat-4803-flutter-web-platform-type
Add flutter-web as a platform type
2023-01-27 13:27:35 +01:00
Torsten Dittmann 24a7caf936 Merge branch 'master' of https://github.com/appwrite/appwrite into feat-4803-flutter-web-platform-type 2023-01-27 13:24:41 +01:00
Torsten DittmannandGitHub eee2c0c4ff Merge pull request #4994 from aayushbisen/fix-4986-add-appwrite-worker-messaging-restart-policy
add restart policy for worker-messaging container
2023-01-27 13:21:35 +01:00
Christy JacobandGitHub c393e130ac Merge pull request #4983 from appwrite/fix-collection-delete
Fix deletes worker not deleting database collections
2023-01-27 14:40:14 +05:30
Christy JacobandGitHub c56f8277c9 Merge pull request #4984 from appwrite/fix-project-delete
Fix deletes worker not deleting project database tables
2023-01-27 13:45:07 +05:30
Jake Barnby c9f4b7ca23 Delete project domains and certificates 2023-01-27 16:46:38 +13:00
Christy JacobandGitHub 81b08de407 Merge pull request #5049 from appwrite/feat-update-dbip
Update DBIP Database
2023-01-26 22:15:02 +05:30
Bradley Schofield ade2e10994 Update DBIP Database 2023-01-26 14:57:02 +00:00
Christy JacobandGitHub 54f4bef67a Merge pull request #5004 from appwrite/feat-remove-validators
Replace Appwrite Validators with backported Utopia ones
2023-01-26 16:03:06 +05:30
Christy JacobandGitHub 860542deae Merge pull request #4669 from eltociear/patch-2
Fix typo in Model/Locale.php
2023-01-26 16:01:31 +05:30
Christy JacobandGitHub 7c2c68c5ec Merge pull request #4988 from appwrite/fix-storage-device-case
Convert _APP_STORAGE_DEVICE env var to lowercase
2023-01-26 15:24:26 +05:30
Christy JacobandGitHub 4ea82fb2d0 Merge pull request #4795 from appwrite/fix-compression-logic
feat: use constants in switch case
2023-01-23 17:50:33 +05:30
Damodar LohaniandGitHub b3481e08d3 Merge pull request #5014 from appwrite/gewenyu99-patch-team-invite-doc 2023-01-23 14:02:17 +05:45
Vincent (Wen Yu) Ge efcaa8ba77 update specs 2023-01-20 17:27:14 -05:00
Vincent (Wen Yu) Ge b25dc38a63 clarify custom ID vs unique ID 2023-01-20 22:22:16 +00:00
Christy JacobandGitHub 2f252ecee7 Merge pull request #4754 from appwrite/feat-pr-template
Update PR Template
2023-01-21 02:01:26 +05:30
StevenandGitHub e14f4404e0 Merge branch 'master' into feat-4803-flutter-web-platform-type 2023-01-20 12:04:58 -08:00
Christy JacobandGitHub b645f42881 Merge pull request #4515 from Akshay-Rana-Gujjar/fix-4446-updated-timestamp-format-to-ISO-in-realtime-payload
updated timestamp format to ISO string in realtime payload
2023-01-20 18:16:30 +05:30
Christy Jacob 58c4c3da1e feat: update changelog 2023-01-20 09:52:11 +00:00
Christy Jacob 0a98ad6042 Merge branch 'master' of https://github.com/appwrite/appwrite into fix-4446-updated-timestamp-format-to-ISO-in-realtime-payload 2023-01-20 09:51:19 +00:00
1466e7b770 Update app/controllers/api/teams.php
Co-authored-by: Vincent (Wen Yu) Ge <vincent@appwrite.io>
2023-01-18 09:33:47 +05:45
Vincent (Wen Yu) GeandGitHub 33dab2ea46 Update create-team-membership.md 2023-01-17 10:18:50 -05:00
Vincent (Wen Yu) GeandGitHub 60bfae7e00 Update create-team-membership.md 2023-01-17 10:14:32 -05:00
Christy JacobandGitHub e72c5511b6 Merge pull request #4654 from appwrite/fix-test-warnings
Fix null warnings
2023-01-17 17:45:10 +05:30
Bradley SchofieldandGitHub 4cc135e8e2 Merge branch 'master' into fix-test-warnings 2023-01-17 10:16:53 +00:00
Jake Barnby 536d36be7d Fix delete recursion 2023-01-17 17:31:14 +13:00
Damodar LohaniandGitHub 2c23f7f149 update doc 2023-01-17 07:17:08 +05:45
Damodar Lohani d53456c6ed fix test 2023-01-17 01:17:37 +00:00
fogelito 625aa8ada6 Some changes 2023-01-16 17:11:13 +02:00
Torsten Dittmann f7e35cce2c fix: sdk typo 2023-01-16 12:09:13 +01:00
Damodar Lohani 309d67066e Merge branch 'feat-password-history' of https://github.com/appwrite/appwrite into feat-password-dictionary 2023-01-16 09:55:12 +00:00
Damodar Lohani 7f3a2dcce7 fix model 2023-01-16 09:46:53 +00:00
fogelito 48e2bf1c3e Helpers GraphQL 2023-01-16 11:25:40 +02:00
fogelito f5cc2e43f4 conflics 2023-01-16 10:32:15 +02:00
fogelito c4ae047833 Merge branch 'master' of github.com:appwrite/appwrite into feat-technical-debt-2
 Conflicts:
	app/init.php
	composer.json
	composer.lock
2023-01-16 10:24:37 +02:00
fogelito aa5a45ba79 audit + abuse upgrade 2023-01-16 10:12:14 +02:00
Damodar Lohani aefe59a437 Merge branch 'feat-password-history' of https://github.com/appwrite/appwrite into feat-password-dictionary 2023-01-16 06:42:16 +00:00
Damodar Lohani 92e020b209 fix migration name 2023-01-16 06:41:44 +00:00
Damodar Lohani b7683364dd update changelog 2023-01-16 05:12:26 +00:00
Damodar Lohani 4f35353289 Merge branch 'feat-password-history' of https://github.com/appwrite/appwrite into feat-password-dictionary 2023-01-16 05:09:55 +00:00
Damodar Lohani 16b80e1ef8 new migration 2023-01-16 05:04:35 +00:00
Damodar Lohani fe472e5b36 Merge branch '1.3.x' of https://github.com/appwrite/appwrite into feat-password-history 2023-01-16 05:04:13 +00:00
Aayush Bisen 4975a769e7 add restart policy in root compose file
Fixes #4986
2023-01-14 09:39:29 +00:00
Vincent (Wen Yu) Ge d9edc65e9d Generate specs for 1.2.x 2023-01-13 15:30:48 -05:00
Vincent (Wen Yu) Ge 45aea5b941 Update branch with master 2023-01-13 14:53:54 -05:00
Vincent (Wen Yu) Ge 92a384e31c Fix descriptions for ID and regen 1.2.x specs 2023-01-13 14:27:08 -05:00
Bradley Schofield f5715f4df8 Update Spec generator 2023-01-13 15:43:57 +00:00
Bradley Schofield 7910149053 Remove tests and update other references to old validators 2023-01-13 15:42:29 +00:00
Bradley Schofield 31b718d829 Replace Appwrite Validators with backported Utopia ones
+ Updated Utopia Framework to 0.26.0
+ Replaced Appwrite Validators with Utopia ones
2023-01-13 15:28:04 +00:00
Torsten Dittmann 4639f2c753 chore: run formatter 2023-01-13 13:32:47 +01:00
Torsten Dittmann f6744fc07a feat: add console sdk 2023-01-13 13:29:22 +01:00
Damodar Lohani afaa64b54b fix invitation after merge 2023-01-13 06:05:16 +00:00
Damodar LohaniandGitHub 3146ec363d Merge branch 'master' into feat-team-invite-improvements 2023-01-13 11:39:20 +05:45
cb9b94ff04 Update Platform Model type property description
Co-authored-by: Ian Koerich Maciel <ianmaciel@gmail.com>
2023-01-12 11:33:29 -08:00
Jake Barnby 004bb82688 Fix functions + builds not deleted 2023-01-12 22:42:07 +13:00
Jake Barnby d49de9c6cf Use getProjectDB instead of new function 2023-01-12 22:27:20 +13:00
Christy JacobandGitHub a35cf0b4c0 Merge pull request #4991 from appwrite/fix-function-timeout-example
Function default timeout example fix
2023-01-12 13:53:25 +05:30
Eldad A. FuxandGitHub f0bb8dcc33 Merge pull request #4859 from appwrite/refactor-mails-next
refactor: make mails event and worker general
2023-01-12 09:07:43 +02:00
Aayush Bisen c9664e2d19 add restart policy for worker-messaging container
Fixes #4986
2023-01-12 06:51:50 +00:00
Steven Nguyen be77b10549 Add flutter-web as a platform type
Having a dedicated type for flutter-web will allow us to differentiate
between Flutter Web and Web in the Appwrite Console.
2023-01-11 15:47:49 -08:00
Vincent (Wen Yu) Ge a1cb81abb6 Function default timeout example to 15s, so it doesn't look like a timestamp. 2023-01-11 21:49:15 +00:00
Steven Nguyen 2b4dbfb4b9 Convert _APP_STORAGE_DEVICE env var to lowercase
This is done for backwards compatibility. Up to utopia-php/storage
version 0.12.X, the devices were not lowercase. Starting 0.13.X, they
are all converted to lowercase, but people would still have the old
case in their .env file. This change makes the value check insensitive
so that the value from older versions still works.
2023-01-11 11:41:26 -08:00
Jake Barnby 4b0ef4598b Fix deletes worker not deleting project database tables 2023-01-11 19:37:06 +13:00
Jake Barnby da8af68e1e Fix deletes worker not deleting database collections 2023-01-11 17:20:43 +13:00
Damodar Lohani d2ca803753 add provider enabled check in the redirect 2023-01-10 04:52:21 +00:00
Damodar Lohani b06ce91297 fix formatting 2023-01-09 11:11:55 +00:00
Damodar Lohani 8d40220114 remove var dumps 2023-01-09 11:10:50 +00:00
Damodar Lohani 11b3739360 fix when either email or phone were empty 2023-01-09 11:10:02 +00:00
Damodar Lohani a2642ecc67 send phone invite only if email is empty 2023-01-09 10:59:28 +00:00
Damodar Lohani b238a1ef2d fix format 2023-01-09 10:44:28 +00:00
Damodar LohaniandGitHub 87c7e76a16 Oauth2 check if provider is enabled 2023-01-09 16:20:03 +05:45
Damodar Lohani 34b2280207 fix format 2023-01-09 09:18:13 +00:00
Damodar Lohani 5088c9ea99 simple test 2023-01-09 09:17:45 +00:00
Damodar Lohani 8f351ad7b2 set email and phone attribute once user found 2023-01-09 09:17:39 +00:00
Damodar Lohani bc7b98821a fix error 2023-01-09 08:56:18 +00:00
Damodar Lohani 32b8a1edfe fix param order in action 2023-01-09 08:44:02 +00:00
Damodar Lohani 29ef377b60 refactor privileged/app user check 2023-01-09 08:29:33 +00:00
Damodar Lohani 63a981591d fix error and param order 2023-01-09 08:25:15 +00:00
Damodar Lohani a812bfb686 format fix 2023-01-09 05:55:07 +00:00
Damodar Lohani 2e154c06bc different test and messaging integration as well 2023-01-09 05:46:02 +00:00
Eldad A. FuxandGitHub 514b42bea2 Merge pull request #4741 from appwrite/fix-update-contribution-guide
Update contributing guide to include submodule update command
2023-01-08 13:37:14 +02:00
Eldad A. FuxandGitHub 3ca0ff66d6 Merge pull request #4964 from appwrite/fix-3433-bump-storage
Bump utopia-php/storage
2023-01-08 13:36:42 +02:00
Steven Nguyen 04fa436dca Bump utopia-php/storage
Update storage to fix bug with S3 provider paths
2023-01-06 10:28:40 -08:00
Eldad A. FuxandGitHub fe84af90b6 Merge pull request #4934 from appwrite/doc-editing-agency
Updates readme and contributing guide according to suggestions from editing agency
2022-12-30 17:10:24 +02:00
Vincent (Wen Yu) Ge ae6736222c Remove eldad's name 2022-12-30 15:02:21 +00:00
5e090c4cd4 Update CONTRIBUTING.md
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-30 09:38:18 -05:00
Vincent (Wen Yu) Ge eccae13651 Contribution guide updated 2022-12-29 22:40:53 +00:00
Vincent (Wen Yu) Ge 7eae5c300d Updates readme according to suggestions from editing agency 2022-12-29 21:46:03 +00:00
Eldad A. FuxandGitHub bc2d8c44c5 Merge pull request #4928 from appwrite/fix-graphql-examples
Update graphql examples to recursively show nested fields
2022-12-28 19:29:38 +02:00
Steven Nguyen b7ceae67b9 Update graphql examples to recursively show nested fields 2022-12-28 09:04:11 -08:00
Torsten DittmannandGitHub 76cc9af5a3 Merge pull request #4926 from appwrite/eldadfux-patch-1
Update README.md
2022-12-28 10:37:34 +01:00
Eldad A. FuxandGitHub a79e9efa78 Update README.md 2022-12-28 11:36:29 +02:00
Eldad A. FuxandGitHub 528bae3c53 Merge pull request #4925 from appwrite/fix-graphql-examples
Fix graphql examples to include _ for internal attributes
2022-12-28 08:52:03 +02:00
Steven Nguyen 79cfb49320 Fix graphql examples to include _ for internal attributes 2022-12-27 15:59:44 -08:00
Eldad A. FuxandGitHub 14fb586c4b Merge pull request #4923 from appwrite/fix-missing-var-category
Fix missing env var category
2022-12-28 01:05:57 +02:00
Matej Bačo 014457636c Fix missing env var category 2022-12-27 23:58:30 +01:00
Eldad A. FuxandGitHub 0aa853fdcf Merge pull request #4922 from appwrite/fix-docs
Fix:getting started docs
2022-12-28 00:58:06 +02:00
Eldad A. FuxandGitHub 070fb9b7cb Merge pull request #4920 from appwrite/feat-upgrade-sdk-generator
Feat: Upgrade SDK generator
2022-12-27 23:31:01 +02:00
Matej Bačo 7931253033 Fix flutter getting started docs 2022-12-27 22:30:49 +01:00
Matej Bačo 9e74be61d4 Upgrade SDK generator 2022-12-27 22:02:34 +01:00
Eldad A. FuxandGitHub 5bd90c57f1 Merge pull request #4919 from appwrite/fix-sdk-changelogs
Fix: SDK changelogs
2022-12-27 22:51:23 +02:00
Eldad A. FuxandGitHub 4d9901babb Merge pull request #4918 from appwrite/fix-nested-graphql-escaping
Fix: nested escaping
2022-12-27 22:51:08 +02:00
Matej Bačo 2405377593 Update SDK changelogs 2022-12-27 21:40:10 +01:00
Matej Bačo 0865b240c4 Fix linter 2022-12-27 20:33:16 +01:00
Matej Bačo 991c6dea64 Fix nested escaping 2022-12-27 20:15:22 +01:00
Eldad A. FuxandGitHub c74e5dcb1a Merge pull request #4891 from appwrite/1.2.x
1.2.x
2022-12-27 18:24:31 +02:00
Eldad A. FuxandGitHub 7c7e7c7bca Merge pull request #4917 from appwrite/1.2.x-fix-deps-version
Fix: 1.2.x deps version
2022-12-27 17:36:13 +02:00
Matej Bačo f77e150fe0 Fix version 2022-12-27 16:33:28 +01:00
Eldad A. FuxandGitHub 55031f8f43 Merge pull request #4916 from appwrite/doc-session-limit
Update descriptions for create session endpoints about session limits
2022-12-27 17:22:06 +02:00
Matej Bačo df0409d25c Update specs 2022-12-27 16:18:55 +01:00
Matej Bačo 0e80a548c7 Merge branch '1.2.x' into doc-session-limit 2022-12-27 16:16:17 +01:00
Vincent (Wen Yu) GeandGitHub ee432192de Update create-session-oauth2.md 2022-12-27 10:05:28 -05:00
Vincent (Wen Yu) Ge f9491a73a4 Update descriptions for create session endpoints about session limits 2022-12-27 15:04:06 +00:00
Eldad A. FuxandGitHub 8681acfeab Merge pull request #4912 from appwrite/fix-auth-session-limit-model
Fix: auth session limit model
2022-12-27 16:38:41 +02:00
Torsten DittmannandGitHub fa969dedbc Merge pull request #4915 from appwrite/fix-1.2.x-migration
Fix: 1.2.x migration
2022-12-27 15:04:31 +01:00
Matej Bačo 070edcf55a Fix buckets migration 2022-12-27 14:55:32 +01:00
Torsten DittmannandGitHub a528b66232 Merge pull request #4914 from appwrite/feat-console-upgrade-2.1.1
Feat: console upgrade 2.1.1
2022-12-27 13:00:13 +01:00
Matej Bačo c2d597e8c6 Upgrade console version 2022-12-27 12:56:26 +01:00
Torsten DittmannandGitHub 616348a312 Merge pull request #4913 from appwrite/feat-1.2.x-upgrade-console
Upgrade console
2022-12-27 12:25:29 +01:00
Matej Bačo 0384b705f9 Upgrade console 2022-12-27 12:19:02 +01:00
Matej Bačo d722bf01ea Code review changes 2022-12-27 11:40:24 +01:00
Matej Bačo 02d86cee84 Fix bug and update test 2022-12-27 11:33:38 +01:00
Torsten DittmannandGitHub 0347a8a1df Merge pull request #4910 from appwrite/fix-1.2.x-conflicts
Fix: 1.2.x merge conflicts
2022-12-27 10:49:53 +01:00
Torsten DittmannandGitHub a9e9fe3e67 Merge pull request #4911 from appwrite/feat-1.2.x-migrations
Feat: 1.2.x migrations
2022-12-27 10:33:08 +01:00
Matej BačoandGitHub 7532309bbb Apply suggestions from code review 2022-12-27 10:31:49 +01:00
Matej Bačo a922f7f0e1 Fix test 2022-12-27 09:15:05 +01:00
Matej Bačo 39cb846ae0 Fix failing test 2022-12-27 09:09:47 +01:00
Matej Bačo d63c429d3e Implement 1.2 migration 2022-12-27 08:35:55 +01:00
Matej Bačo ccc9432219 Merge branch 'master' into fix-1.2.x-conflicts 2022-12-27 08:29:10 +01:00
Matej Bačo 804dbb867c Re-add migration, add missing env vars 2022-12-27 08:24:34 +01:00
Damodar Lohani a0a08b3588 fix make password optional 2022-12-27 07:13:39 +00:00
Damodar Lohani 62dd5c275d fix explode 2022-12-27 06:16:19 +00:00
Eldad A. FuxandGitHub d4091e82e0 Merge pull request #4909 from appwrite/1.2.x-release-preps
Feat: 1.2.x release preps
2022-12-26 14:22:26 +02:00
Matej Bačo 65fec6b954 Update generated docs 2022-12-26 13:17:28 +01:00
Matej Bačo 3826937a7b Update 1.2 specs 2022-12-26 13:16:12 +01:00
Matej Bačo 4d33ba6db1 Fix big in migration class 2022-12-26 13:16:01 +01:00
Matej Bačo 14b6aa0e8e Update SDK versions 2022-12-26 13:08:31 +01:00
Matej Bačo bbe29e9aa7 Preparations for 1.2.0 2022-12-26 13:06:35 +01:00
Matej Bačo 18c4f2b92a Upgrade sdk-generator 2022-12-26 13:03:32 +01:00
Eldad A. FuxandGitHub 213d17ffad Merge pull request #974 from appwrite/feat-graphql-support
Feat graphql support
2022-12-26 13:27:48 +02:00
Damodar Lohani 8927c71b69 fix formatting 2022-12-26 10:34:41 +00:00
Damodar Lohani 96cf2e6330 password dictionary test 2022-12-26 10:27:04 +00:00
Damodar Lohani 0760ea90d6 use dictionary validator 2022-12-26 10:22:49 +00:00
Damodar Lohani 5649bc8060 load password dictionary as array 2022-12-26 10:22:38 +00:00
Damodar Lohani f03035451f fix test 2022-12-26 10:22:25 +00:00
Matej Bačo 614d7d878f Add missing ENV var to docker compose 2022-12-26 11:14:35 +01:00
Damodar Lohani a9078cded5 rename resource 2022-12-26 09:24:51 +00:00
50a5329b30 Update app/init.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-26 15:04:06 +05:45
Damodar Lohani 87b3df919f clear cache after migration 2022-12-26 08:20:16 +00:00
Damodar Lohani abde948b43 fix typo 2022-12-26 06:03:43 +00:00
Damodar Lohani 44082a92f7 fix resonse model 2022-12-26 05:58:16 +00:00
Damodar Lohani 276032b3f7 error fix 2022-12-26 05:55:02 +00:00
Damodar Lohani 574ffa4d4b check dictionary is enabled before checking password 2022-12-26 05:52:49 +00:00
Damodar Lohani e9710bdb76 formatting fix 2022-12-26 05:47:20 +00:00
Damodar Lohani 124403b804 test for password discionary 2022-12-26 05:46:35 +00:00
Damodar Lohani 3bcb1f846e password disctionary endpont and project model 2022-12-26 05:31:49 +00:00
Damodar Lohani 1ff8ce2382 check against passwords dictionary 2022-12-26 05:24:26 +00:00
Eldad A. FuxandGitHub f9371ee4f3 Merge pull request #4896 from appwrite/fix-max-session-method
Fix max session method
2022-12-23 23:49:26 +02:00
Damodar Lohani 2603f91a6a use password history on account create and update password 2022-12-23 07:19:35 +00:00
Damodar Lohani 5d61ff5fab password dictionary 2022-12-23 07:19:11 +00:00
Vincent (Wen Yu) Ge 1a92bf1923 regen specs 2022-12-22 23:00:29 +00:00
Eldad A. FuxandGitHub 054ebc699c Merge pull request #4783 from pomarec/fix-4782-email-body-fr-translation
Fix : translation french "emails.recovery.body"
2022-12-22 14:25:19 +02:00
Jake Barnby 27b1ae912a Merge remote-tracking branch 'origin/fix-max-session-method' into feat-graphql-support 2022-12-22 21:11:35 +13:00
Jake Barnby 43c850bd9b Deduplicate SDK method name 2022-12-22 21:03:06 +13:00
Jake Barnby 9694b79f03 Update changelog 2022-12-22 19:59:29 +13:00
Jake Barnby cbf1d9deb6 Fix indentation 2022-12-22 19:16:03 +13:00
Jake Barnby 4699d78112 Remove redundant import 2022-12-22 19:15:02 +13:00
Jake Barnby 89fb5dceb2 Remove redundant logo 2022-12-22 19:02:20 +13:00
Damodar Lohani eb9e7c737e fixed forgotten break 2022-12-22 04:56:17 +00:00
Jake Barnby e86994b597 Add retries for flaky tests 2022-12-22 16:12:45 +13:00
Jake Barnby 6adbeb8b0d Revert test change 2022-12-22 15:32:14 +13:00
Jake Barnby dc49e1dcf3 Update user test type 2022-12-22 12:52:54 +13:00
StevenandGitHub 9167b10c81 Merge branch 'master' into fix-4782-email-body-fr-translation 2022-12-21 11:45:50 -08:00
Vincent (Wen Yu) Ge 93b489fe2c revert composer lock update 2022-12-21 19:22:03 +00:00
fogelito 94c9d68e4f stopOnFailure revert 2022-12-21 11:03:06 +02:00
fogelito f707221ee4 stopOnFailure revert 2022-12-21 11:01:47 +02:00
fogelito b301a64dc4 clean up some use classes not in use 2022-12-21 10:02:22 +02:00
Jake Barnby 524a6db72d Hide get method from SDKs 2022-12-21 20:45:34 +13:00
Damodar Lohani 772481451c test to set password history limit above 20 2022-12-21 06:42:27 +00:00
Damodar Lohani 1388f58b59 fix: formatting 2022-12-21 06:16:36 +00:00
Jake Barnby 2ee9f2607f Remove redundant code 2022-12-21 19:15:42 +13:00
Damodar Lohani ba5e0b4ae4 bump version 2022-12-21 05:43:10 +00:00
Damodar Lohani 82d20233e2 feat: add migration for password history 2022-12-21 05:41:16 +00:00
Vincent (Wen Yu) Ge 8239113b95 Grammarly check 2022-12-20 21:43:55 +00:00
Vincent (Wen Yu) Ge 37fc5114ab Update permission param descriptions for grammar and clarity. 2022-12-20 21:39:41 +00:00
Christy JacobandGitHub 37ce513b87 Merge pull request #4341 from megatank58/patch-1
fix: correctly handle `=` in .env
2022-12-20 16:32:29 +05:30
Christy JacobandGitHub 8fdafdce45 Merge pull request #4533 from vimode/doc-windows-powershell-installation-new-line-fix
docs: update windows powershell commands
2022-12-20 15:40:37 +05:30
Christy JacobandGitHub cb0a927e34 Merge pull request #4050 from geisterfurz007/fix-3916-empty-payload-returned-as-object
fix: empty payload returned as list
2022-12-20 13:37:24 +05:30
Christy JacobandGitHub 6b31edfdef Merge pull request #4506 from karniv00l/user-not-found-exception
Fix User not found exception
2022-12-20 13:25:35 +05:30
Christy JacobandGitHub 1e94400a7b Merge pull request #4332 from Sushrut1101/master
workflows: Update actions/checkout to v3
2022-12-20 13:23:08 +05:30
Christy JacobandGitHub 36e6b7e5c0 Merge pull request #4317 from tusharxoxoxo/patch-6
Update add-translations.md
2022-12-20 02:39:16 +05:30
Christy JacobandGitHub a8b36f8259 Merge pull request #4298 from kalpeshT101/doc-fix-readme
Remove invalid link
2022-12-20 02:35:50 +05:30
Christy JacobandGitHub adb21683e0 Merge pull request #4285 from vrabe/update-zh-tw-translation
update zh-tw translation
2022-12-20 02:31:41 +05:30
Christy JacobandGitHub 7cf49ac1f6 Merge pull request #4534 from sarthakroy2002/master
workflows: Update codeql-action to v3
2022-12-20 00:17:50 +05:30
vimodeandGitHub fc1b0b0196 Merge branch 'master' into doc-windows-powershell-installation-new-line-fix 2022-12-19 18:37:04 +00:00
Christy JacobandGitHub 3e3cb638f4 Merge pull request #4537 from keul/patch-1
Fixed README documentation
2022-12-19 20:20:54 +05:30
fogelito 616bead19f stopOnFailure 2022-12-19 13:58:16 +02:00
fogelito dfd122efaa Change Client data hint 2022-12-19 13:25:01 +02:00
fogelito 91e17e4e94 remove static $dateValidator 2022-12-19 13:21:32 +02:00
fogelito 91db596b42 remove static $dateValidator 2022-12-19 13:21:09 +02:00
Damodar Lohani 679fd66507 add to changelog 2022-12-19 08:35:02 +00:00
Damodar Lohani 2019deb454 Merge branch 'feat-password-history' of https://github.com/appwrite/appwrite into feat-password-history 2022-12-19 08:28:30 +00:00
Damodar Lohani b35e5a04be fix users endpoint test 2022-12-19 08:28:02 +00:00
Jake Barnby 09a6726afa Update specs 2022-12-19 20:52:14 +13:00
Jake Barnby 56a903577f Remove docs false 2022-12-19 20:51:34 +13:00
Jake Barnby 11ef344216 Remove get method from SDKs 2022-12-19 19:07:04 +13:00
Jake Barnby bcceee9a7d Update for SDK generator changes
(cherry picked from commit d6bd0f466b76229e1bf5915d2fb5642cde7d3b69)
2022-12-19 19:06:57 +13:00
f72d075c40 Update src/Appwrite/Utopia/Response/Model/Project.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-19 10:54:56 +05:45
Damodar Lohani 5b1c54c440 fix suggestions 2022-12-19 05:07:41 +00:00
95791c85ff Update app/controllers/api/projects.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-19 10:49:18 +05:45
Damodar Lohani 28ac6c9355 fix validator 2022-12-18 09:37:13 +00:00
Damodar Lohani 30ece2d36a validator for password history 2022-12-18 09:08:51 +00:00
Damodar Lohani f7dd37a9d1 format fix 2022-12-18 08:54:53 +00:00
Damodar Lohani 7a9b9f2710 remove test 2022-12-18 08:53:01 +00:00
Damodar Lohani d098c8c698 use array slice 2022-12-18 08:47:02 +00:00
Damodar Lohani 3f26e66d26 not add random password to history 2022-12-18 08:35:12 +00:00
Damodar Lohani 15f52b933b fix excaping 2022-12-18 08:34:57 +00:00
9114a61fb2 Update src/Appwrite/Utopia/Response/Model/Project.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-18 14:08:45 +05:45
ba77b35f05 Update app/controllers/api/projects.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-18 14:05:55 +05:45
Damodar Lohani 4abc30eed1 refactor: fix formatting issues 2022-12-18 06:31:14 +00:00
Damodar Lohani 6612e6edf0 fix: password verify 2022-12-18 06:28:19 +00:00
Damodar Lohani 0eae73e7b8 fix: password comparison 2022-12-18 06:27:41 +00:00
Damodar Lohani 51ad9c6479 fix: get history limit before adding password to history 2022-12-18 04:38:27 +00:00
Damodar Lohani 0b1b7b8170 feat: check history limit 2022-12-16 10:47:08 +00:00
Damodar Lohani cfd5a91c43 feat: project endpoint to set password history limit 2022-12-16 10:37:49 +00:00
Damodar Lohani 61e03eeedf add new password to the history 2022-12-16 10:29:20 +00:00
Damodar Lohani 8e7b89ec03 feat: check password history 2022-12-16 10:22:39 +00:00
Damodar Lohani 12302d5b3d refactor: remove empty param 2022-12-16 06:34:03 +00:00
Damodar Lohani b7d17e82da fix: membership invite email 2022-12-16 06:15:23 +00:00
Damodar Lohani 495da1bfd4 fix: template path 2022-12-16 06:11:12 +00:00
ea241ceaf5 Update app/workers/certificates.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-12-16 11:33:16 +05:45
Damodar Lohani 5d195659bd refactor: mails refactor 2022-12-15 09:22:05 +00:00
fogelito bdc3e9f935 $dateValidator 2022-12-15 10:51:27 +02:00
Jake Barnby d107b92748 Remove debug flags on production instead of abuse enabled 2022-12-15 13:44:23 +13:00
Jake Barnby ab08f0ca40 Fix prism settings for graphql platforms 2022-12-15 13:39:13 +13:00
Jake Barnby 64b74d4100 Add alias route to allow for multiple SDK method names 2022-12-15 13:36:47 +13:00
fogelito d7a833faef Changing Role + Permissions namespace 2022-12-14 18:07:45 +02:00
fogelito 8ade726932 Changing Role + Permissions namespace 2022-12-14 18:04:06 +02:00
fogelito f96128e14f Changing Id 2022-12-14 17:42:25 +02:00
fogelito 1b37bd82c9 Merge remote-tracking branch 'origin/master' 2022-12-14 16:57:59 +02:00
Damodar Lohani 5741a960c7 refactor: use refactored maile event and worker 2022-12-14 06:35:04 +00:00
Damodar Lohani 42c855cb41 feat: make mails event and worker general 2022-12-14 06:23:14 +00:00
Jake Barnby ff33068906 Merge remote-tracking branch 'origin/1.2.x' into feat-graphql-support 2022-12-13 21:37:21 +13:00
Eldad A. FuxandGitHub e05fbb23a9 Merge pull request #4831 from appwrite/feat-user-session-limits
feat (projects): auth session limit
2022-12-13 10:34:59 +02:00
Jake Barnby cf9d67e9cc Fix assoc input for account prefs 2022-12-13 20:04:05 +13:00
Jake Barnby 5e9eccacd1 Allow create deployment from explorer 2022-12-13 19:49:20 +13:00
Damodar Lohani 255c4043d6 fix lint errors 2022-12-13 06:33:26 +00:00
Damodar Lohani ae24689b89 default auth session limit 10 2022-12-13 06:26:25 +00:00
Damodar Lohani 2c46cdcc3c add session default and comment 2022-12-13 06:08:38 +00:00
Jake Barnby 478c37ef97 Remove coming soon from architecture diagram 2022-12-13 18:23:23 +13:00
Jake Barnby aa7e326ce9 Allow file uploads from explorer 2022-12-13 15:43:29 +13:00
Jake Barnby 4868b8f8ec Update explorer image 2022-12-13 01:47:07 +13:00
Damodar Lohani c60a3a66a0 feat: session limit separate default and max value 2022-12-12 05:07:18 +00:00
Damodar Lohani ca39ed37d8 reset limit on test 2022-12-12 05:02:48 +00:00
Damodar Lohani e0be09ded6 refactor: use session group for session limit 2022-12-11 08:33:52 +00:00
Damodar Lohani 3885e0452c fix: session limit test 2022-12-11 08:26:31 +00:00
Damodar Lohani a6afc41c99 fix: update test 2022-12-11 07:15:47 +00:00
Damodar Lohani fd93c8aebd feat: add auth session limit param 2022-12-11 07:15:18 +00:00
Damodar Lohani 509aef16bd fix: delete user document cache 2022-12-11 07:13:39 +00:00
Damodar Lohani 65bacc6983 fix: naming and use constant 2022-12-11 07:13:11 +00:00
Damodar Lohani cda8e53386 feat: add test for max sessions 2022-12-09 11:54:23 +00:00
Damodar Lohani cbcc17ded6 refactor: add whitespace 2022-12-09 11:36:39 +00:00
Damodar Lohani f070f0974a session limit check on shutdown 2022-12-09 11:33:26 +00:00
Jake Barnby ccc5f7776d Cast to array for stdClass case 2022-12-08 18:02:35 +13:00
Jake Barnby ddbd03388e Remove prefixed items from additional data 2022-12-08 16:10:49 +13:00
Jake Barnby fd52cdc45f Revert prefix to _ 2022-12-08 16:08:57 +13:00
Jake Barnby da2821b4a8 Fix blacklist entries 2022-12-08 13:10:35 +13:00
Jake Barnby 4de3289ebb Remove redundant function 2022-12-07 19:29:24 +13:00
Jake Barnby e4f546eae0 Fix contribution merge changes 2022-12-07 19:28:37 +13:00
Jake Barnby 15654f8c99 Merge remote-tracking branch 'origin/1.2.x' into feat-graphql-support 2022-12-07 19:19:59 +13:00
Christy JacobandGitHub 2b72771781 Merge pull request #4736 from appwrite/sync-1.2.x
Sync 1.2.x
2022-12-06 20:57:13 +04:00
Damodar Lohani 27d7f4f083 fix (projects): session limits
Set max session limits to 100 and default session limits to 10
2022-12-06 10:52:17 +00:00
Damodar Lohani 1da3f7770f feat (projects): auth session limit
Add endpoint on project to set max number of sessions for project users.
2022-12-06 10:45:04 +00:00
Jake Barnby a12eaf12b4 Merge remote-tracking branch 'origin/master' into sync-1.2.x 2022-12-06 20:40:32 +13:00
Jake Barnby b6723b7c83 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/init.php
2022-12-06 20:38:09 +13:00
Christy Jacob 77d4627d42 feat: use constants in switch case 2022-11-26 19:45:29 +04:00
P.O Marec 31089b76fb Fix : translation french "emails.certificate.body" 2022-11-26 13:04:46 +01:00
P.O.M 0cd67229a1 Fix : translation french "emails.recovery.body"
Wrong reference to project variable
2022-11-26 13:04:44 +01:00
fogelito c02d04b5fa Merge remote-tracking branch 'origin/master' 2022-11-23 11:30:43 +02:00
Steven Nguyen 3e0456291f Update PR template
1. Ask for why in description to help with troubleshooting in the future
2. Change related PRs to a list so it renders nicer
3. Remove changes.md task in favor of just using milestones to track changes
4. Add reminder to check if API specs need to be updated
2022-11-22 09:42:54 -08:00
Steven Nguyen 7b09fa3f17 Update contributing guide to include submodule update command 2022-11-21 08:28:29 -08:00
fogelito 948f09bea9 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	composer.lock
2022-11-21 12:20:28 +02:00
Jake Barnby ce1b41b312 Merge branch 'master' into sync-1.2.x 2022-11-21 17:28:43 +13:00
Jake Barnby 5a84a37a9e Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/init.php
2022-11-18 12:41:48 +13:00
Jake Barnby 163cbc5052 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	composer.json
#	composer.lock
2022-11-17 21:41:56 +13:00
Jake Barnby f9d2976c1d Merge remote-tracking branch 'origin/1.1.x' into feat-graphql-support
# Conflicts:
#	CHANGES.md
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
#	app/init.php
#	app/tasks/sdks.php
#	composer.lock
#	docker-compose.yml
2022-11-16 19:37:35 +13:00
Jake Barnby dd6c5c056f Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	CHANGES.md
2022-11-16 19:31:40 +13:00
Bradley Schofield a19e668d79 Update storage.php 2022-11-14 13:11:43 +00:00
Ikko AshimineandGitHub 956db2ec2f Fix typo in Model/Locale.php
Europian -> European
2022-11-14 21:31:08 +09:00
Bradley Schofield bc915483ff Update CHANGES.md 2022-11-09 13:52:46 +00:00
Bradley Schofield a0ab934328 Fix another null warning 2022-11-09 13:23:14 +00:00
Bradley Schofield 29c30a361b Fix null warnings
- Fixed Avatars isset operator
- Added isset operator to openSSL data in files
- dns_get_record does not throw errors, instead it logs a warning and returns false. Altered code accordingly. PHP Bug Report: https://bugs.php.net/bug.php?id=73149
-
2022-11-09 11:45:15 +00:00
Jake Barnby a47bfe71bf Merge remote-tracking branch 'origin/1.2.x' into feat-graphql-support
# Conflicts:
#	CHANGES.md
#	composer.json
#	composer.lock
#	tests/e2e/Services/Functions/FunctionsCustomServerTest.php
2022-11-04 21:32:57 +13:00
Christy JacobandGitHub de63618842 Merge pull request #4621 from appwrite/sync-1.2.x
Sync 1.2.x
2022-11-04 09:17:31 +05:30
fogelito d2798ea401 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	composer.lock
2022-11-03 17:25:41 +02:00
Christy Jacob 8e99c44c59 Merge branch 'master' of github.com:appwrite/appwrite into sync-1.2.x 2022-11-02 20:39:20 +05:30
Christy Jacob 360a51ec20 Merge branch '1.1.x' of github.com:appwrite/appwrite into sync-1.2.x 2022-11-02 10:16:27 +05:30
Christy Jacob e9239717d7 Merge branch 'master' of github.com:appwrite/appwrite into sync-1.2.x 2022-11-02 10:16:16 +05:30
Kalpesh cbe7b35436 Update README-CN.md 2022-11-01 16:20:29 +05:30
Jake Barnby 8a4fd3307d Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	composer.json
#	composer.lock
2022-11-01 11:38:23 +13:00
Jake Barnby 03f85c3b74 Merge remote-tracking branch 'origin/1.1.x' into feat-graphql-support
# Conflicts:
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
#	composer.json
#	composer.lock
#	src/Appwrite/Utopia/Response/Model/Provider.php
2022-11-01 11:07:51 +13:00
Damodar LohaniandJake Barnby a97a476296 assert buildTime is greater than 0
(cherry picked from commit 24a140c3af)
2022-11-01 11:04:42 +13:00
Damodar LohaniandJake Barnby 11f3474cb8 buildTime attribute to deployment
(cherry picked from commit 7989518eec)
2022-11-01 11:04:27 +13:00
geisterfurz007 e891424c17 fix: empty payload deleting single user session 2022-10-31 21:01:49 +01:00
Karlis SuviandGitHub a82c8e88c2 Add changelog entry for #4610 2022-10-30 12:14:01 +02:00
Karlis Suvi 6ae1a12219 Include response of 5xx status codes for function executions 2022-10-29 09:04:57 +00:00
Jake Barnby 6234ff20f4 Add test for rate limit enforced when using graphql 2022-10-28 20:13:48 +13:00
Jake Barnby db49e962f4 Use abuse status instead of dev/prod for graphql abuse check 2022-10-28 20:12:11 +13:00
Jake Barnby c23cca950a Merge branch 'fix-provider-model' into feat-graphql-support 2022-10-28 11:30:15 +13:00
Jake Barnby 9274ec6880 Fix type error 2022-10-28 11:26:32 +13:00
Jake Barnby 323c0c5ab7 Revert debug changes 2022-10-28 10:25:59 +13:00
Jake Barnby e46eeb3e16 Remove namespace from var name 2022-10-28 10:19:09 +13:00
Jake Barnby 2a96056b8d Remove redundant import and sort 2022-10-28 10:06:09 +13:00
Jake Barnby 89b4d0026a Move shutdown hook to graphql controller 2022-10-28 10:04:31 +13:00
Jake Barnby 2469a42d1d Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-10-27 12:25:37 +13:00
Jake Barnby e632731c4e Merge remote-tracking branch 'origin/1.1.x' into feat-graphql-support 2022-10-27 12:24:57 +13:00
Jake Barnby 9620dcbc07 Update specs 2022-10-26 16:22:01 +13:00
Jake Barnby c8b19bd84d Update lock 2022-10-26 16:21:24 +13:00
Jake Barnby c5bda4d2ff Add REST to platforms and SDKs 2022-10-26 16:19:30 +13:00
Jake Barnby 9fbf8d6aee Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	tests/e2e/General/HTTPTest.php
2022-10-26 13:54:52 +13:00
Jake Barnby 2f444ead34 Revert "Review revert unrelated change"
This reverts commit bf064fa5c9.
2022-10-25 18:31:51 +13:00
Jake Barnby b6e7e84d50 Comments 2022-10-25 16:35:00 +13:00
Jake Barnby e3b5919e40 Review doc fixes 2022-10-25 15:53:15 +13:00
Jake Barnby 34bd0fe93d Review remove redundant registry injection 2022-10-25 15:45:08 +13:00
Jake Barnby bf064fa5c9 Review revert unrelated change 2022-10-25 15:44:19 +13:00
Jake Barnby e2840a1c84 Remove docs to reduce PR size 2022-10-25 12:51:22 +13:00
Jake Barnby 889db82ad4 Fix spec tests 2022-10-25 12:34:57 +13:00
motasimmakki 66893be752 docs: Removed unnecessary $ symbol and spaced correctly. 2022-10-22 10:07:18 +05:30
Jake Barnby 2d6974da82 Fix empty examples 2022-10-21 15:28:06 +13:00
Jake Barnby f9a32f6011 Fix reserved attribute selections 2022-10-21 13:53:54 +13:00
Luca FabbriandGitHub a174c6aca6 Fixed README documentatio
See https://github.com/appwrite/sdk-for-node/pull/43
2022-10-20 10:17:54 +02:00
Jake Barnby 81e1d2ac82 Fix examples 2022-10-20 19:58:24 +13:00
Jake Barnby 40be56b35f Set isSDK false for graphql 2022-10-20 18:52:51 +13:00
Jake Barnby 99b8769151 Fix family 2022-10-20 18:40:34 +13:00
Jake Barnby 3d2ff6b587 Fix doc extensions 2022-10-20 18:02:33 +13:00
Jake Barnby f0bfdf3a1b Add initial 1.2.x docs 2022-10-20 16:52:52 +13:00
Jake Barnby 455b9ca5df Add initial 1.2.x specs 2022-10-20 16:22:30 +13:00
Jake Barnby 2eed73395a Add GraphQL platform 2022-10-20 16:21:16 +13:00
Jake Barnby 19123257fc Strip $ instead of replace to match SDK models 2022-10-20 15:29:56 +13:00
Jake Barnby 6a4f3d6a6b Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
2022-10-20 12:41:24 +13:00
Jake Barnby 120b788343 Update resolvers for framework changes 2022-10-20 12:22:46 +13:00
Jake Barnby ce76fb58b1 Update request/response extensions for framework changes 2022-10-20 12:12:09 +13:00
Jake Barnby f54aa1f4c2 Update framework + swoole 2022-10-20 12:10:41 +13:00
Sarthak RoyandGitHub c57da64feb workflows: Update codeql-action to v3 2022-10-19 21:59:12 +05:30
vimo c772844bcb docs: update windows powershell commands 2022-10-19 16:37:46 +05:30
Jake Barnby 5a2dc60420 Fix options test 2022-10-19 22:23:08 +13:00
Jake Barnby f6dc7b2068 Add OAuth to blacklist 2022-10-19 13:23:42 +13:00
Jake Barnby c2e0ef3f98 Merge remote-tracking branch 'origin/1.0.x' into feat-graphql-support
# Conflicts:
#	CHANGES.md
2022-10-19 13:21:06 +13:00
Jake Barnby a2b1941a47 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	CONTRIBUTING.md
#	composer.json
#	composer.lock
#	docs/references/teams/list-teams.md
2022-10-19 13:17:56 +13:00
Jake Barnby 61e5014ff0 Add sdk graphql header to allowed headers list 2022-10-19 13:01:39 +13:00
Akshay Rana 641a4af8d4 upated the timestamp code 2022-10-18 22:40:50 +05:30
c08f2e65e6 Updated timestamp format
Co-authored-by: Steven <1477010+stnguyen90@users.noreply.github.com>
2022-10-18 22:22:01 +05:30
megatank58andGitHub 819ba45836 chore(tests): add test case for value ending in = 2022-10-17 16:02:24 +05:30
megatank58andGitHub d1e9e7b396 chore(tests): update .env 2022-10-17 16:01:28 +05:30
Akshay Rana 1fcc5eccb1 updated timestamp format to ISO string in realtime payload 2022-10-17 12:44:44 +05:30
Jake Barnby e0f6b8c105 Update specs 2022-10-17 14:43:27 +13:00
Jake Barnby fb5d2fc25c Abstract setting params to init 2022-10-17 13:27:15 +13:00
Jake Barnby fb68ed377e Fix imports 2022-10-17 12:13:35 +13:00
Jake Barnby cecc6dada2 Merge remote-tracking branch 'origin/1.1.x' into feat-graphql-support
# Conflicts:
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
#	app/init.php
#	composer.json
#	composer.lock
2022-10-17 12:04:13 +13:00
Piotr Rogowski b65a8c86c5 Add tests 2022-10-15 22:09:10 +02:00
vrabe f260836100 Update the name of Eswatini (Swaziland) 2022-10-15 19:14:20 +08:00
Piotr Rogowski 833e3f8ce1 Fix User not found exception 2022-10-14 18:17:00 +02:00
Jake Barnby d163217d1f Remove Appwrite URL dependency from resolvers 2022-10-14 18:04:23 +13:00
Jake Barnby a1718e8a44 Remove database dependency from mapper 2022-10-14 18:01:39 +13:00
Jake Barnby 09e0e948b5 Remove resolver database dependency 2022-10-14 18:00:22 +13:00
Jake Barnby 3f98cef633 Fix spec test 2022-10-14 14:40:34 +13:00
Jake Barnby a99ade13c0 Don't flatten batch results 2022-10-14 14:33:42 +13:00
Jake Barnby 742fc98cfc Controller cleanup 2022-10-14 14:32:16 +13:00
Jake Barnby 444c68e07e Remove redundant error 2022-10-14 13:23:21 +13:00
Jake Barnby 44e4f1e05b Make param errors consistent 2022-10-14 13:18:08 +13:00
Jake Barnby 64ad2211c7 Update specs + sdk generator 2022-10-13 17:42:53 +13:00
Jake Barnby e4673aaa50 Fix requests using x-sdk-graphql header 2022-10-13 17:33:55 +13:00
Jake Barnby 4e60db0598 Use upstream raw payload function 2022-10-13 16:56:12 +13:00
Jake Barnby 143c53cb20 Always set 200 status code to match spec 2022-10-13 14:52:08 +13:00
Jake Barnby 9c372d7335 Fix checking content type with postfixes 2022-10-13 14:32:06 +13:00
Jake Barnby a2b532ed22 Set dirty property instead of in registry from shutdown 2022-10-13 12:59:32 +13:00
Jake Barnby 5c5bdac3d9 Add route blacklist instead of individual cases 2022-10-13 12:58:28 +13:00
Jake Barnby aa5e9d7b2d Update service doc 2022-10-12 22:24:10 +13:00
Jake Barnby 9ae9213a97 Disable custom entity tests 2022-10-12 21:49:58 +13:00
Jake Barnby 9821cc5e18 Check if value has then function when setting result to check external promise types 2022-10-12 21:48:58 +13:00
Jake Barnby bb64bcc1c1 Allow cloning a request 2022-10-12 20:55:43 +13:00
Jake Barnby 597885028a Use request setters 2022-10-12 20:55:04 +13:00
Jake Barnby 5debe2c13c Alias + name fixes 2022-10-12 20:20:44 +13:00
Jake Barnby b6621f5e87 Restructure schema building 2022-10-12 14:04:11 +13:00
Jake Barnby 39fcbe4d76 Restructure exception 2022-10-12 13:59:35 +13:00
Jake Barnby 4bc44183b6 Restructure type related helpers 2022-10-12 13:57:37 +13:00
Jake Barnby ee2e8fcc23 Generify promises 2022-10-12 13:55:43 +13:00
Jake Barnby 20bee94175 Fix unit test 2022-10-11 14:20:19 +13:00
Jake Barnby bf194c30e9 Review updates 2022-10-11 13:38:06 +13:00
Jake Barnby d5dd83ea91 Fix tests for union and none types 2022-10-11 12:34:43 +13:00
Jake Barnby 62038bd2a9 Passthru JSON objects 2022-10-11 12:32:04 +13:00
Jake Barnby 0716c430d6 Fix getting union implementations 2022-10-11 12:31:12 +13:00
Jake Barnby 96bce27642 Cherrypick empty model rules 2022-10-11 12:28:46 +13:00
Jake Barnby fd8d4f4a1b Add type property to hash algorithms to allow resolving union type implementation 2022-10-11 12:27:03 +13:00
Jake Barnby 575b882b30 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	.github/workflows/tests.yml
#	composer.lock
2022-10-10 18:41:40 +13:00
Tushar DahiyaandGitHub 4100a3acdc Merge pull request #5 from tusharxoxoxo/tusharxoxoxo-patch-5
Update add-storage-adapter.md
2022-10-09 17:00:02 +05:30
Tushar DahiyaandGitHub 25f46908b6 Update add-storage-adapter.md 2022-10-09 16:59:48 +05:30
Tushar DahiyaandGitHub 9cec0f5907 Merge pull request #4 from tusharxoxoxo/tusharxoxoxo-patch-4
Update add-route.md
2022-10-09 16:55:28 +05:30
Tushar DahiyaandGitHub 765dca4a3e Update add-route.md 2022-10-09 16:55:17 +05:30
Tushar DahiyaandGitHub 5775bef5b5 Merge pull request #3 from tusharxoxoxo/tusharxoxoxo-patch-3
Update add-runtime.md
2022-10-09 16:53:35 +05:30
Tushar DahiyaandGitHub 7536818ec2 Update add-runtime.md 2022-10-09 16:53:25 +05:30
Tushar DahiyaandGitHub 214c3e96a7 Merge pull request #2 from tusharxoxoxo/tusharxoxoxo-patch-2
Update add-storage-adapter.md
2022-10-09 16:50:22 +05:30
Tushar DahiyaandGitHub 7982a49332 Update add-storage-adapter.md 2022-10-09 16:50:11 +05:30
Tushar DahiyaandGitHub 5d89feec61 Merge pull request #1 from tusharxoxoxo/tusharxoxoxo-patch-1
Update add-translations.md
2022-10-09 16:48:46 +05:30
Tushar DahiyaandGitHub b085b78d69 Update add-translations.md 2022-10-09 16:48:29 +05:30
megatank58andGitHub d898ccd8e0 fix: correctly handle = in .env 2022-10-09 11:29:00 +05:30
Sushrut1101andGitHub a0d1a12f1e workflows: Update actions/checkout to v3 2022-10-08 12:32:58 +05:30
kalpesh 6d82f04493 Update README-CN.md 2022-10-08 12:20:46 +05:30
kalpesh 8209615609 Update README-CN.md 2022-10-08 12:19:41 +05:30
Tushar DahiyaandGitHub b4e0fe0735 Update add-translations.md 2022-10-07 09:47:04 +05:30
Tushar DahiyaandGitHub c1f567a9ef Update add-storage-adapter.md 2022-10-07 09:42:45 +05:30
Tushar DahiyaandGitHub f7db9f8ab2 Update add-runtime.md 2022-10-07 09:38:46 +05:30
Tushar DahiyaandGitHub b271a98867 Update add-route.md 2022-10-07 09:30:58 +05:30
kalpesh 01f4805bef Update README-CN.md 2022-10-05 19:32:34 +05:30
kalpesh 00f3902cc4 Revert "remove dead link"
This reverts commit 7b38e8cdf6.
2022-10-05 19:30:22 +05:30
kalpesh 7b38e8cdf6 remove dead link 2022-10-05 19:20:25 +05:30
vrabe 5236b48f34 你 to 您, for consistency 2022-10-04 20:41:46 +08:00
vrabe 018e4fe54b update zh-tw translation 2022-10-04 20:25:40 +08:00
Jake Barnby 6ac4d4f490 Handle response model union type rules 2022-09-30 19:59:20 +13:00
Jake Barnby 1fbcedec42 Move mapping functions to TypeMapper 2022-09-30 19:58:26 +13:00
Jake Barnby f1429e8155 Move custom types to their own class 2022-09-30 19:51:27 +13:00
Jake Barnby df651c3c78 Match class names instead of strings 2022-09-29 19:28:41 +13:00
Jake Barnby b176929557 Sort schema 2022-09-29 19:27:57 +13:00
Jake Barnby fe0bd6a66e Fix env 2022-09-29 17:59:41 +13:00
Jake Barnby 0471bf1c90 Only allow default values for optional params 2022-09-29 17:54:48 +13:00
Jake Barnby 73d0f033b8 Skip new models with no rules 2022-09-29 17:53:53 +13:00
Jake Barnby e5b9e261c5 Upcase type names 2022-09-29 17:53:07 +13:00
Jake Barnby 6c81069b27 Custom type serialization fixes 2022-09-29 17:51:53 +13:00
Jake Barnby 471f12b8ba Only apply max depth and complexity in production to allow introspection 2022-09-29 17:46:01 +13:00
Jake Barnby a3b75a374b Update variables and defaults 2022-09-23 15:55:10 +12:00
Jake Barnby 63a4853563 Fix list complexity calculations 2022-09-23 15:53:25 +12:00
Jake Barnby 318bea760e Fix defualt arg types nullability 2022-09-23 13:52:19 +12:00
Jake Barnby eb818d15e0 Fix custom entity update 2022-09-23 13:49:36 +12:00
Jake Barnby 6e4bad5969 Fix custom entity delete 2022-09-23 13:46:39 +12:00
Jake Barnby 8cd36b2721 Fix custom entity list 2022-09-22 22:48:22 +12:00
Jake Barnby 5f0f136e6e Refactor methods for clarity 2022-09-22 20:59:47 +12:00
Jake Barnby 5bd420a823 Remove redundant test class prefixes 2022-09-22 20:29:42 +12:00
Jake Barnby a5b31b1956 Fix auth test 2022-09-22 20:22:10 +12:00
Jake Barnby f7e5ccf296 Merge remote-tracking branch 'origin/fix-team-get-membership-model' into feat-graphql-support
# Conflicts:
#	CONTRIBUTING.md
2022-09-22 20:12:17 +12:00
Jake Barnby 2d1cd7cb50 Add queries validators 2022-09-22 18:54:58 +12:00
Jake Barnby f2af301f16 Update functions vars -> variables 2022-09-22 14:16:13 +12:00
Jake Barnby 734561c6b6 Fix users queries phone -> number 2022-09-22 13:57:31 +12:00
Jake Barnby a2778e410f Fix team get membership queries 2022-09-22 13:55:31 +12:00
Jake Barnby 76614d8659 Update ID usages 2022-09-22 13:53:41 +12:00
Jake Barnby 8af0983274 Handle role validator 2022-09-21 21:12:23 +12:00
Jake Barnby 6aee9e0ddb Update errors 2022-09-21 21:11:05 +12:00
Jake Barnby 390453aa9b Add datetime attribute test 2022-09-21 21:08:20 +12:00
Jake Barnby 4d21323001 Update permissions 2022-09-21 21:03:14 +12:00
Jake Barnby 7167ea2a5f Update permissions 2022-09-21 20:17:17 +12:00
Jake Barnby b69217bb39 Update avatar size 2022-09-21 19:52:09 +12:00
Jake Barnby 6a1dcfa3c8 Update abuse test 2022-09-21 19:37:43 +12:00
Jake Barnby b217cf20d7 Update get team membership query 2022-09-21 19:22:15 +12:00
Jake Barnby 0389cc9ef2 Update permissions 2022-09-21 19:11:49 +12:00
Jake Barnby 9f008a18ea Update number -> phone usages 2022-09-21 19:05:35 +12:00
Jake Barnby 378d02f269 Update get -> list usages 2022-09-21 19:03:28 +12:00
Jake Barnby 6c9ac29f37 Fix attribute unpacking 2022-09-21 19:01:01 +12:00
Jake Barnby e2f86aec62 Add graphql scope back for guests 2022-09-21 18:54:47 +12:00
Jake Barnby 144e723431 Update error handling 2022-09-21 18:36:43 +12:00
Jake Barnby 5cefda4ff2 Fix key replacements 2022-09-21 18:24:47 +12:00
Jake Barnby 544413dddf More 1.0 migrations 2022-09-20 20:25:05 +12:00
Jake Barnby bf0b416183 Update permissions and queries for 1.0 2022-09-20 19:51:22 +12:00
Jake Barnby fbcaa1f60a Update database test queries 2022-09-20 19:40:21 +12:00
Jake Barnby fd37df5f9c Handle datetime model rules 2022-09-20 19:24:54 +12:00
Jake Barnby 48ede78894 Fix roles 2022-09-20 19:03:04 +12:00
Jake Barnby e9f75d32a1 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	Dockerfile
#	app/config/errors.php
#	app/config/roles.php
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
#	app/controllers/api/graphql.php
#	app/controllers/shared/api.php
#	app/init.php
#	composer.lock
#	docker-compose.yml
#	src/Appwrite/Extend/Exception.php
#	src/Appwrite/Migration/Migration.php
2022-09-20 15:43:09 +12:00
Jake Barnby 8841f8fe76 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/controllers/general.php
#	app/controllers/shared/api.php
#	composer.json
#	composer.lock
2022-08-22 21:13:29 +12:00
Jake Barnby f3d8a7338a Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	composer.lock
2022-07-26 13:55:25 +12:00
Jake Barnby 185624fda1 Return schema by ref 2022-07-25 16:27:07 +12:00
Jake Barnby fd79922284 Per project keys 2022-07-25 16:26:46 +12:00
Jake Barnby d69e77d572 Add additional batch tests 2022-07-25 11:20:04 +12:00
Jake Barnby 24d0d84bd1 JSON decode packed query 2022-07-22 16:09:23 +12:00
Jake Barnby 2c69dbcc22 Allow SDK graphql header in access control 2022-07-22 16:09:15 +12:00
Jake Barnby 427b25dfb7 Unpack query if request is coming from an SDK 2022-07-22 11:38:28 +12:00
Jake Barnby f8649a1a8d Add graphql sdk method type 2022-07-21 16:37:34 +12:00
Jake Barnby 1899b3ccd2 Fix order types param 2022-07-21 16:37:21 +12:00
Jake Barnby 58f9ccb023 Use test cache again 2022-07-20 13:10:30 +12:00
Jake Barnby e67029829a Generate specs 2022-07-20 01:30:21 +12:00
Jake Barnby 09d3159439 Add doc references 2022-07-20 01:30:12 +12:00
Jake Barnby 11ff88e44f Add account benchmarks 2022-07-20 01:30:01 +12:00
Jake Barnby b4b76b72ff Update framework branch 2022-07-20 01:29:15 +12:00
Jake Barnby 8320fc0686 Use labels parameters to add extra methods to spec 2022-07-20 01:28:47 +12:00
Jake Barnby c05c759eac Add --no-cache for tests 2022-07-19 14:25:14 +12:00
Jake Barnby 2d0bc9c193 Add get tests 2022-07-19 14:11:58 +12:00
Jake Barnby 5e4dc6ad13 Format 2022-07-19 13:51:30 +12:00
Jake Barnby 37c832134b Encode get query params for test 2022-07-19 13:41:31 +12:00
Jake Barnby d3565b673e Add get route test 2022-07-19 13:31:14 +12:00
Jake Barnby 4cf5797827 Expose upload as seperate endpoint for SDKs 2022-07-19 13:30:01 +12:00
Jake Barnby ca62d67d37 Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-07-19 11:55:29 +12:00
Jake Barnby 404ed4cb1f Update benchmarks 2022-07-19 00:44:02 +12:00
Jake Barnby 604396a029 Increase function deployment sleep time to reduce test flakiness 2022-07-18 22:35:34 +12:00
Jake Barnby 47c8088fb7 Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-07-18 21:38:23 +12:00
Jake Barnby e3bed0c636 Test fixes 2022-07-18 21:38:13 +12:00
Jake Barnby f37bddbc6d Ensure user creating team with custom roles is always owner as well 2022-07-18 20:55:59 +12:00
Jake Barnby b8bd81e232 Add back fullBody params for testing 2022-07-18 19:31:07 +12:00
Jake Barnby adbb1a1d79 Account for limit param when calculating query complexity 2022-07-18 19:30:54 +12:00
Jake Barnby 03a2a00b30 Check if path contains key before replacing 2022-07-18 19:29:51 +12:00
Jake Barnby 3530d3dfe0 Update env defaults 2022-07-18 19:29:37 +12:00
Jake Barnby 31081b01cb Fix chained promises 2022-07-18 18:47:08 +12:00
Jake Barnby 410d9b0f0c Use statics for anonymous functions 2022-07-18 14:53:49 +12:00
Jake Barnby b3600ae576 Remove redundant param parameters 2022-07-18 14:53:06 +12:00
Jake Barnby 1dc557042f Fix lazy matching route replacement parameters 2022-07-18 14:52:41 +12:00
Jake Barnby 16851be3e4 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	composer.lock
2022-07-15 11:14:37 +12:00
Jake Barnby 0b7b5496f3 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/init.php
2022-07-14 20:13:41 +12:00
Jake Barnby 221e7b59c4 Add abuse test 2022-07-14 20:11:39 +12:00
Jake Barnby 13ff5ca45e Add malformed request body tests 2022-07-14 15:58:17 +12:00
Jake Barnby 4f5c7ddada Add invalid query exception 2022-07-14 15:57:51 +12:00
Jake Barnby 4ee7f80433 Add too many queries exception 2022-07-14 15:57:34 +12:00
Jake Barnby ded46774bc Add max batch size env var 2022-07-14 15:56:02 +12:00
Jake Barnby c154ea3fc6 Add benchmark scripts 2022-07-14 13:47:32 +12:00
Jake Barnby 814298c549 Remove redundant injections 2022-07-14 01:38:16 +12:00
Jake Barnby 3896cd3d39 No content responses 2022-07-14 01:34:25 +12:00
Jake Barnby 4ca6750309 Cleanup controller 2022-07-13 23:21:02 +12:00
Jake Barnby d862de8e7f Remove redundant env var 2022-07-13 22:30:24 +12:00
Jake Barnby cdd7569e86 Contrib updates 2022-07-13 22:22:18 +12:00
Jake Barnby a656699fa7 Code cleanup 2022-07-13 21:34:56 +12:00
Jake Barnby 92c8e2c3a1 Fix flaky function deployment timing 2022-07-13 19:48:01 +12:00
Jake Barnby 306f89ff94 Fix database client test 2022-07-13 19:45:54 +12:00
Jake Barnby 83dfbf377d Fix database delete query 2022-07-13 19:38:44 +12:00
Jake Barnby 0f2cb5ed0d Add scope specific tests 2022-07-13 19:38:23 +12:00
Jake Barnby d7a1b7b3fc Add auth specific tests 2022-07-13 19:38:11 +12:00
Jake Barnby ac8e47ac2d Lint 2022-07-13 17:21:41 +12:00
Jake Barnby 4732127777 Fix parameters 2022-07-13 17:06:48 +12:00
Jake Barnby 3f2037a906 Reduce type re-scanning 2022-07-13 16:44:11 +12:00
Jake Barnby eeed6d6038 Remove redundant variable 2022-07-13 16:41:40 +12:00
Jake Barnby bf284f4fde Add content-type tests 2022-07-13 15:50:25 +12:00
Jake Barnby d0874e7612 Reset CI sleep time 2022-07-13 15:50:11 +12:00
Jake Barnby 9909493bfc Support query batching 2022-07-13 15:49:59 +12:00
Jake Barnby 9e29d5f22d Check if time is the issue 2022-07-12 18:41:24 +12:00
Jake Barnby d28131469d Increase test startup wait time 2022-07-12 18:29:08 +12:00
Jake Barnby ace6badfed Doc updates 2022-07-12 17:06:11 +12:00
Jake Barnby 78cd903543 Update to framework fork for CI 2022-07-12 12:15:56 +12:00
Jake Barnby 10a5c24a63 Format and lint 2022-07-12 09:52:00 +12:00
Jake Barnby 7259f21cf1 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	composer.lock
2022-07-12 09:18:58 +12:00
Jake Barnby de5d0eec06 Get current request context utopia instance in cached resolvers 2022-07-11 18:51:08 +12:00
Jake Barnby 8a9a5bec1e Remove redundant output redirection 2022-07-11 18:43:55 +12:00
Jake Barnby 4d60904cff Resolve request and response from resources 2022-07-11 18:43:15 +12:00
Jake Barnby c15a90f709 Update logging 2022-07-11 18:41:21 +12:00
Jake Barnby da71aec774 Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/controllers/api/databases.php
#	composer.lock
2022-07-08 17:50:16 +12:00
Jake Barnby a589681c3d WIP caching and lazy re-building schema 2022-07-08 17:48:00 +12:00
Jake Barnby 5b3c4921d6 Add schema group shutdown hook to set dirty flag in register 2022-07-08 17:43:20 +12:00
Jake Barnby ae32d89a0f Formatting 2022-07-07 19:55:07 +12:00
Jake Barnby b5e8273839 Fix custom entity id properties 2022-07-07 19:39:42 +12:00
Jake Barnby 8762bcba90 Abstract upload functionality 2022-07-07 18:13:12 +12:00
Jake Barnby 5e02355215 Storage test fixes 2022-07-07 17:51:20 +12:00
Jake Barnby a193f96b8d Functions tests fixes 2022-07-07 17:50:49 +12:00
Jake Barnby 380dbb32e9 Handle file uploads 2022-07-07 16:53:09 +12:00
Jake Barnby 32399ff52c Fix get deployment response type 2022-07-07 16:49:44 +12:00
Jake Barnby 4ec637f889 Update input file scalar definition 2022-07-07 12:54:59 +12:00
Jake Barnby 23c52da9f8 Fix input file switch reference 2022-07-07 12:54:44 +12:00
Jake Barnby d0f81c9621 Client database test fixes 2022-07-07 12:53:58 +12:00
Jake Barnby 67807f8c6f WIP input file handling 2022-07-06 20:56:58 +12:00
Jake Barnby 81265ab458 Fix custom entity tests 2022-07-06 17:12:12 +12:00
Jake Barnby 8bbe5abd72 Fix attribute databaseId 2022-07-06 17:11:26 +12:00
Jake Barnby 39233cfe1c Handle event validator parsing 2022-07-06 15:57:14 +12:00
Jake Barnby 99262e28fe Call server create bucket for client storage tests 2022-07-06 15:52:33 +12:00
Jake Barnby ce3180433d Database query fixes 2022-07-06 15:52:06 +12:00
Jake Barnby 5ac634b68d Enable users update phone test 2022-07-06 15:51:49 +12:00
Jake Barnby 61035a98a6 Format 2022-07-06 15:51:37 +12:00
Jake Barnby 96e86f6e4e Explicitly enforce content type of API response on GQL response 2022-07-06 15:51:03 +12:00
Jake Barnby bc098d73fa Databases API fixes 2022-07-06 15:50:27 +12:00
Jake Barnby 58ffde5326 Fix doubled shutdown calls firing events twice 2022-07-06 15:27:00 +12:00
Jake Barnby 608ad18bb9 Add health service tests 2022-07-04 18:38:04 +12:00
Jake Barnby cf1fe63a61 Revert status code checks for teams 2022-07-04 18:17:11 +12:00
Jake Barnby 4a0042f3d6 Add avatars service tests 2022-07-04 18:16:32 +12:00
Jake Barnby c22ffc1dfe Add locale service tests 2022-07-04 18:16:16 +12:00
Jake Barnby ac10ed31ac Split function tests 2022-07-04 18:16:06 +12:00
Jake Barnby 7b547456fe Add graphql functions server tests 2022-07-04 16:14:37 +12:00
Jake Barnby fd4e741c84 Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-07-04 12:09:46 +12:00
Jake Barnby 4ba33daf46 WIP storage service tests 2022-07-01 18:58:15 +12:00
Jake Barnby fb53acbf2a Database test fixes 2022-07-01 18:58:03 +12:00
Jake Barnby bdd65ed448 User test updates for 0.15 2022-07-01 12:02:59 +12:00
Jake Barnby 845e32e5e1 Account phone test updates for 0.15 2022-07-01 11:54:18 +12:00
Jake Barnby 1d797dacc6 Fix account tests for 0.15 2022-07-01 11:37:46 +12:00
Jake Barnby 7c8cc39d07 Update database queries for 0.15 2022-07-01 10:44:41 +12:00
Jake Barnby 9d134a949f Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/controllers/api/databases.php
#	app/controllers/general.php
#	app/init.php
#	composer.json
#	composer.lock
#	docker-compose.yml
#	phpunit.xml
2022-07-01 00:05:44 +12:00
Jake Barnby b61764693f WIP database service tests 2022-07-01 00:00:00 +12:00
Jake Barnby ee9e204410 Add teams service tests 2022-06-30 22:48:15 +12:00
Jake Barnby fead0f89b9 Remove redundant tests 2022-06-30 21:27:06 +12:00
Jake Barnby 2b3ba0370b Add users service tests 2022-06-30 21:26:46 +12:00
Jake Barnby 61913f9e46 Add account service tests 2022-06-30 21:26:23 +12:00
Jake Barnby 65f82b47fe Add extra account and user queries 2022-06-30 21:25:16 +12:00
Jake Barnby be0fd7d1f4 Explicit visibility for route keys + add extras for account and user 2022-06-30 21:24:40 +12:00
Jake Barnby f85169452a Add session ID to scope user state 2022-06-30 21:23:38 +12:00
Jake Barnby e36192388d Fix params for GET requests 2022-06-30 21:22:54 +12:00
Jake Barnby 8db6148297 Handle delete routes 2022-06-30 21:22:34 +12:00
Jake Barnby 2eb74d2898 Add data json string property to models with additional data 2022-06-30 21:22:16 +12:00
Jake Barnby b09e5aac8a Test fixes 2022-06-27 18:46:01 +12:00
Jake Barnby d019937e4f Merge remote-tracking branch 'origin/fix-role-clobbering' into feat-graphql-support
# Conflicts:
#	composer.lock
2022-06-27 14:52:39 +12:00
Jake Barnby 09d30ec249 Fix role clobbering for error messages 2022-06-27 14:51:43 +12:00
Jake Barnby 4367d1bafc Fix collection test syntax 2022-06-27 14:21:58 +12:00
Jake Barnby 32e530e757 Fix status code not proxied to outer request on exception 2022-06-27 14:21:44 +12:00
Jake Barnby 5ea41a0253 Print with debug flags if not production 2022-06-22 16:44:58 +12:00
Jake Barnby a117e7c1f4 Remove redundant files 2022-06-22 13:42:56 +12:00
Jake Barnby d6f48261d5 Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-06-22 13:21:07 +12:00
Jake Barnby 09c89ecd12 Test updates 2022-06-20 13:15:02 +12:00
Jake Barnby e865f77a6b Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	CONTRIBUTING.md
#	app/config/errors.php
#	app/controllers/api/account.php
#	app/controllers/api/graphql.php
#	app/init.php
#	composer.json
#	composer.lock
2022-06-20 11:15:22 +12:00
Jake Barnby 7689f7ef6f WIP allow processing routes with no response 2022-05-04 21:45:36 +12:00
Jake Barnby 9d2aad1134 WIP client test updates 2022-05-04 21:19:36 +12:00
Jake Barnby d94d5d53bf WIP server test updates 2022-05-04 21:19:28 +12:00
Jake Barnby 1055a00090 Proxy headers, cookies and status code from inner to outer request 2022-05-04 21:19:04 +12:00
Jake Barnby f7c1a6c4a6 IDE method hint 2022-05-04 21:17:19 +12:00
Jake Barnby cdefbef05c Remove redundant flags 2022-05-04 18:48:04 +12:00
Jake Barnby 54e672498e Remove redundant function 2022-05-04 18:47:34 +12:00
Jake Barnby 9deaf335cf Update document list resolution 2022-05-04 18:47:04 +12:00
Jake Barnby 4180784033 Update document get resolution 2022-05-04 18:46:43 +12:00
Jake Barnby 40d8760dd5 Delegate update to create with patch instead of post 2022-05-04 18:46:22 +12:00
Jake Barnby f02b73c109 Update delete document resolution 2022-05-04 18:45:37 +12:00
Jake Barnby 4f00b30fca Add common resolve 2022-05-04 18:45:14 +12:00
Jake Barnby 5b555c8aac Update document resolve 2022-05-04 18:44:45 +12:00
Jake Barnby 7edbb428d0 Use exposed nested validator 2022-05-04 18:43:51 +12:00
Jake Barnby 6138e4af5d Static map for default args 2022-05-04 18:42:12 +12:00
Jake Barnby 4020c4413d Remove redundant param 2022-05-04 18:41:18 +12:00
Jake Barnby 248f19f61e Allow routes with path params to execute by running match on the modified request 2022-05-03 23:15:41 +12:00
Jake Barnby 85873c9efb Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-05-03 23:06:04 +12:00
Jake Barnby 21dd2935dd Fix parameters 2022-05-03 18:27:41 +12:00
Jake Barnby b78b71b260 Update mutate delete for db collection 2022-05-03 17:41:13 +12:00
Jake Barnby 71a0cb59b5 Defer mutate update to mutate create 2022-05-03 17:41:02 +12:00
Jake Barnby 87333e2eb0 Update mutate create for db collection 2022-05-03 17:40:44 +12:00
Jake Barnby f31080f52c Update query list for db collection 2022-05-03 17:40:26 +12:00
Jake Barnby 4b216fccb9 Update query get for db collection 2022-05-03 17:40:12 +12:00
Jake Barnby fba936c2dc Correct get list default values 2022-05-03 17:39:47 +12:00
Jake Barnby c00f20f212 Resolve lower-level attribute inline 2022-05-03 17:39:24 +12:00
Jake Barnby 0c497f2600 Merge remote-tracking branch 'origin/master' into feat-graphql-support 2022-05-02 21:34:25 +12:00
Jake Barnby b60627e06d WIP test updates 2022-05-02 21:34:10 +12:00
Jake Barnby af2895dd9b Set content type null on inner response to circumvent echo's 2022-05-02 20:54:48 +12:00
Jake Barnby 2ee5762bc7 Update promise result output 2022-05-02 20:21:40 +12:00
Jake Barnby e3824170b1 Resolve fields directly 2022-05-02 19:44:59 +12:00
Jake Barnby d07fff5c3e Return self on then if callback is null 2022-05-02 19:43:43 +12:00
Jake Barnby ab44874626 Fix inline promise creation 2022-05-02 19:42:57 +12:00
Jake Barnby 383edd1fe1 Fixed promise all 2022-05-02 18:24:51 +12:00
Jake Barnby 5127602c9e Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	composer.lock
2022-04-26 19:50:49 +12:00
Jake Barnby dbb49ac7bf Async resolution fixes 2022-04-26 19:49:36 +12:00
Jake Barnby 5b1f973b45 Fix promise adapter all resolving on a started scheduler 2022-04-22 22:08:30 +12:00
Jake Barnby 1057d7e3aa Resolve fields as top-level promises for fixed passed through types 2022-04-22 22:06:53 +12:00
Jake Barnby e79343bae7 Fix type check 2022-04-22 17:49:46 +12:00
Jake Barnby 4a2b620611 Fix using closed request (rebuild API schema per request) 2022-04-22 17:47:27 +12:00
Jake Barnby 601576a9e3 WIP fix individual param resolution 2022-04-20 22:30:48 +12:00
Jake Barnby 5010317d8b WIP update get defer to route 2022-04-12 18:47:40 +12:00
Jake Barnby b4ff4aa123 Add GET endpoint as required by spec 2022-04-11 23:08:57 +12:00
Jake Barnby d4a77504c0 Inject read/write args for mutations 2022-04-09 02:08:36 +12:00
Jake Barnby 9250a735d9 Test updates 2022-04-09 01:52:20 +12:00
Jake Barnby 58241d6fe8 Check content type header exists before checking its type 2022-04-08 23:08:44 +12:00
Jake Barnby f81e69d7d6 Remove coroutines for easier debug 2022-04-08 23:08:20 +12:00
Jake Barnby d95a1b277f Expose swoole request instead of stealing it 2022-04-08 19:16:35 +12:00
Jake Barnby af128ede7c Pass-thru graphql args as request parameters 2022-04-08 19:05:59 +12:00
Jake Barnby 47642f63ff Fix API schema build arg types 2022-04-08 19:04:15 +12:00
Jake Barnby d1fd776076 Name fixes 2022-04-08 17:55:29 +12:00
Jake Barnby a1d877b726 Fix operation name empty 2022-04-08 17:55:17 +12:00
Jake Barnby af98bb9c4a Rename types 2022-04-08 17:54:51 +12:00
Jake Barnby 40b04a3721 Fix collection type arg and type setting 2022-04-08 02:02:48 +12:00
Jake Barnby b1521a2b33 Inject request to API schema build 2022-04-08 00:54:00 +12:00
Jake Barnby 75fec18356 Fix setting nested promise 2022-04-08 00:23:45 +12:00
Jake Barnby 10449822ce Check promise all equal 2022-04-07 18:41:53 +12:00
Jake Barnby 831429f00c Capture resolve vars 2022-04-07 18:41:36 +12:00
Jake Barnby 29266ce83e Append project schema on request 2022-04-07 18:40:49 +12:00
Jake Barnby c75d6b7b69 Wait for promise completion 2022-04-07 18:40:28 +12:00
Jake Barnby 196c763421 Add abuse limits 2022-04-07 18:39:42 +12:00
Jake Barnby 4a34971043 Update route labels 2022-04-07 18:39:33 +12:00
Jake Barnby 13c16dc18c Add validations 2022-04-07 18:39:15 +12:00
Jake Barnby eb85ff8e1e Update graphql resources 2022-04-07 18:38:38 +12:00
Jake Barnby c2ee34584e Add variables 2022-04-07 18:37:46 +12:00
Jake Barnby d9c0d1d556 Update service def 2022-04-07 17:54:10 +12:00
Jake Barnby 8ee96c575e Merge remote-tracking branch 'origin/fix-yasd-idea' into feat-graphql-support 2022-04-07 11:53:00 +12:00
Jake Barnby ede4fa8f69 Fix yasd for intellij 2022-04-07 11:51:30 +12:00
Jake Barnby 48ba76f365 Add resolvers for get, list, create, update, delete for user collections 2022-04-07 11:23:20 +12:00
Jake Barnby 69e7c2fed9 Async query resolution 2022-04-06 01:48:51 +12:00
Jake Barnby 48c610348e Merge remote-tracking branch 'origin/master' into feat-graphql-support
# Conflicts:
#	app/controllers/api/account.php
#	app/controllers/api/graphql.php
#	app/controllers/api/projects.php
#	app/controllers/api/users.php
#	app/controllers/general.php
#	app/http.php
#	app/init.php
#	composer.lock
#	src/Appwrite/Utopia/Response.php
2022-04-05 16:44:38 +12:00
Jake Barnby 82f368f0d9 WIP schema extension POC 2021-11-25 21:04:39 +13:00
Christy Jacob a50f099ba3 feat: sync graphQL with master 2021-11-16 15:45:24 +04:00
Christy Jacob 8141043946 Merge branch 'master' into feat-graphql-support 2021-11-16 11:09:21 +04:00
Christy Jacob b7b63b1b2d feat: sync graphQL branch 2021-06-15 08:59:39 +05:30
Christy Jacob e419e4bc1c Merge branch 'master' of github.com:appwrite/appwrite into feat-graphql-support 2021-06-14 21:53:29 +05:30
Christy Jacob 20e006ad73 feat: updated altair version 2021-03-23 23:37:21 +05:30
Christy Jacob 457ab656e7 feat: fixed some issues and updated docker-compose 2021-03-23 23:30:42 +05:30
Christy Jacob b47e57b1a0 feat: added some more tests 2021-03-22 17:51:59 +05:30
Christy Jacob fc41c2c33d feat: added null check for previous Error 2021-03-19 02:40:15 +05:30
Christy Jacob 9f6eb9ba67 feat: some more refactoring 2021-03-19 02:14:00 +05:30
Christy Jacob 925162fc4b feat: refactoring 2021-03-19 02:02:16 +05:30
Christy Jacob 08da222c46 feat: updated tests 2021-03-19 01:47:25 +05:30
Christy Jacob 053440c81e feat: added test for delete user 2021-03-19 01:44:18 +05:30
Christy Jacob 22558f9e8f feat: refactoring 2021-03-19 01:23:24 +05:30
Christy Jacob bbee14862b feat: removed getArgs function 2021-03-19 01:18:19 +05:30
Christy Jacob 207c06e912 feat: formatted doc blocks 2021-03-19 01:11:38 +05:30
Christy Jacob 8c9d6edff2 feat: refactored errors 2021-03-19 00:56:45 +05:30
Christy Jacob 772f110eee feat: refactor noContent() 2021-03-19 00:25:43 +05:30
Christy Jacob 455ba3ff18 feat: support for delete mutation 2021-03-18 02:47:50 +05:30
Christy Jacob 99ade8ec13 feat: added getCurrentModel() 2021-03-18 02:15:47 +05:30
Christy Jacob bf57280503 feat: refactor createTypeMapping 2021-03-17 01:35:48 +05:30
Christy Jacob 28337dc1cc feat: added tests for role based auth 2021-03-16 23:46:33 +05:30
Christy Jacob 60b863311b feat: refactoring 2021-03-16 20:04:43 +05:30
Christy Jacob 4c49fb1b05 feat: added tests for scope based auth 2021-03-16 19:04:11 +05:30
Christy Jacob 15558f997d feat: added more tests 2021-03-13 01:47:29 +05:30
Christy Jacob 96bb4613e4 feat: code cleanup 2021-03-13 00:30:43 +05:30
Christy Jacob b1c58e2fc4 feat: code cleanup 2021-03-12 23:39:25 +05:30
Christy Jacob d0c3111844 feat: added some tests and code cleanup 2021-03-12 23:30:41 +05:30
Christy Jacob b3f96c6b4c feat: refactoring and code clean up 2021-03-11 21:14:04 +05:30
Eldad Fux 7319a1eeb9 Refactoring 2021-03-10 17:22:19 +02:00
Eldad A. FuxandGitHub 2eb024200e Merge pull request #944 from christyjacob4/graphql
GraphQL Support in Appwrite
2021-03-10 16:08:06 +02:00
Christy Jacob 99d0074280 feat: refactoring and code clean up 2021-03-10 19:37:02 +05:30
Christy Jacob f1a7e9092c Merge branch 'feat-graphql-support' of https://github.com/appwrite/appwrite into graphql 2021-03-10 19:36:43 +05:30
Eldad Fux 2823c95929 Merge branch 'dev' of github.com:appwrite/appwrite into feat-graphql-support 2021-03-10 16:03:06 +02:00
Christy Jacob 2b9f974125 feat: refactoring and code clean up 2021-03-10 19:21:03 +05:30
Christy Jacob 3b0884e628 feat: refactoring and code clean up 2021-03-10 13:12:45 +05:30
Christy Jacob 4eae1f6f02 feat: added support for JSON types 2021-03-10 01:18:32 +05:30
Christy Jacob 293b1b3c8a feat: handle document response type 2021-03-08 20:13:28 +05:30
Christy Jacob 42d6194ed9 feat: error handling for graphQL 2021-03-05 00:10:52 +05:30
Christy Jacob b3a0df734e feat: added content type check in dynamic 2021-02-27 00:55:52 +05:30
Christy Jacob f11e431341 feat: got locale_getContinents working 2021-02-26 03:26:38 +05:30
Christy Jacob f378bcf48a Merge branch 'master' of https://github.com/appwrite/appwrite into graphql 2021-02-26 02:14:56 +05:30
Christy Jacob bb050e75d3 feat: defined logic for schema building 2021-02-26 02:13:21 +05:30
Eldad Fux b7674e3278 Fixed TODO list 2021-01-17 08:36:11 +02:00
Eldad Fux 1349a1a8b5 Changed public dev port 2021-01-11 00:25:07 +02:00
Eldad Fux e9529bb93a Updated GraphQL version 2021-01-11 00:24:59 +02:00
Eldad Fux 945e5ea9ac Merge branch '0.7.x' of github.com:appwrite/appwrite into graphql 2021-01-11 00:16:16 +02:00
Eldad Fux a4097081ab Merge branch 'master' of github.com:appwrite/appwrite into graphql 2020-07-15 14:45:19 +03:00
Eldad Fux 8458438465 Merge branch 'master' of github.com:appwrite/appwrite into graphql 2020-07-07 15:03:29 +03:00
Eldad Fux 1364d89cae Merge branch 'response-refactor' of github.com:appwrite/appwrite into graphql 2020-06-25 23:26:40 +03:00
Eldad Fux 81e61c9cc9 Updated deps 2020-06-25 23:13:13 +03:00
Eldad Fux 981e6527c3 Merge branch 'response-refactor' of github.com:appwrite/appwrite into graphql 2020-06-25 23:12:11 +03:00
Eldad Fux 63fa19b73a Tests 2020-06-24 15:55:05 +03:00
Eldad Fux f07b8ca296 Updated comments 2020-06-24 07:08:10 +03:00
Eldad Fux 437cff3efb Merge branch 'response-refactor' of github.com:appwrite/appwrite into graphql 2020-06-23 23:55:18 +03:00
Eldad Fux 77d0f2b37a First GraphQL parser POC 2020-06-22 15:04:19 +03:00
Eldad Fux a050b7ebb8 Added graphiql container 2020-06-22 15:03:36 +03:00
5503 changed files with 110745 additions and 2620 deletions
+3
View File
@@ -81,6 +81,9 @@ _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000
_APP_USAGE_STATS=enabled
_APP_LOGGING_PROVIDER=
_APP_LOGGING_CONFIG=
_APP_GRAPHQL_MAX_BATCH_SIZE=10
_APP_GRAPHQL_MAX_COMPLEXITY=250
_APP_GRAPHQL_MAX_DEPTH=3
DOCKERHUB_PULL_USERNAME=
DOCKERHUB_PULL_PASSWORD=
DOCKERHUB_PULL_EMAIL=
+7 -28
View File
@@ -1,28 +1,7 @@
app/config/* linguist-detectable=false
app/config/*/* linguist-detectable=false
app/config/*/*/* linguist-detectable=false
app/config/*/*/*/* linguist-detectable=false
app/views/* linguist-detectable=false
app/views/*/* linguist-detectable=false
app/views/*/*/* linguist-detectable=false
app/views/*/*/*/* linguist-detectable=false
app/controllers/* linguist-detectable=false
app/controllers/*/* linguist-detectable=false
app/controllers/*/*/* linguist-detectable=false
app/controllers/*/*/*/* linguist-detectable=false
app/controllers/*/*/*/*/* linguist-detectable=false
src/* linguist-detectable=false
src/*/* linguist-detectable=false
src/*/*/* linguist-detectable=false
src/*/*/*/* linguist-detectable=false
src/*/*/*/*/* linguist-detectable=false
tests/* linguist-detectable=false
tests/*/* linguist-detectable=false
tests/*/*/* linguist-detectable=false
tests/*/*/*/* linguist-detectable=false
tests/*/*/*/*/* linguist-detectable=false
tests/*/*/*/*/*/* linguist-detectable=false
public/scripts/* linguist-detectable=false
public/scripts/*/*/* linguist-detectable=false
public/scripts/*/*/*/* linguist-detectable=false
public/dist/scripts/* linguist-detectable=false
app/config/** linguist-detectable=false
app/views/** linguist-detectable=false
app/controllers/** linguist-detectable=false
src/** linguist-detectable=false
tests/** linguist-detectable=false
public/scripts/** linguist-detectable=false
public/dist/scripts/** linguist-detectable=false
+6 -10
View File
@@ -11,21 +11,17 @@ Happy contributing!
## What does this PR do?
(Provide a description of what this PR does.)
(Provide a description of what this PR does and why it's needed.)
## Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
## Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
- (Related PR or issue)
### Have you added your change to the [Changelog](https://github.com/appwrite/appwrite/blob/master/CHANGES.md)?
## Checklist
(The CHANGES.md file tracks all the changes that make it to the `main` branch. Add your change to this file in the following format)
- One line description of your PR [#pr_number](Link to your PR)
### Have you read the [Contributing Guidelines on issues](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md)?
(Write your answer here.)
- [ ] Have you read the [Contributing Guidelines on issues](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md)?
- [ ] If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?
+8 -4
View File
@@ -1,5 +1,9 @@
name: "CodeQL"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [master]
@@ -25,7 +29,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
@@ -38,14 +42,14 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -59,4 +63,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
+4
View File
@@ -1,5 +1,9 @@
name: "Linter"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [pull_request]
jobs:
lint:
+53
View File
@@ -0,0 +1,53 @@
name: "Release"
on:
release:
types: [published]
jobs:
tests:
name: Unit & E2E
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Fetch submodules
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: appwrite/appwrite
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ steps.meta.outputs.version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+25 -10
View File
@@ -1,5 +1,9 @@
name: "Tests"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [pull_request]
jobs:
tests:
@@ -8,7 +12,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
@@ -21,18 +25,29 @@ jobs:
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# This is a separate action that sets up buildx runner
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Appwrite
# Upstream bug causes buildkit pulls to fail so prefetch base images
# https://github.com/moby/moby/issues/41864
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: appwrite-dev
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
DEBUG=false
TESTING=true
VERSION=dev
- name: Start Appwrite
run: |
export COMPOSE_INTERACTIVE_NO_CLI
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
export BUILDKIT_PROGRESS=plain
docker pull composer:2.0
docker compose build appwrite
docker compose up -d
sleep 30
- name: Doctor
run: docker compose exec -T appwrite doctor
@@ -40,4 +55,4 @@ jobs:
run: docker compose exec -T appwrite vars
- name: Run Tests
run: docker compose exec -T appwrite test --debug
run: docker compose exec -T appwrite test --debug
+2
View File
@@ -5,6 +5,8 @@
/tests/resources/functions/**/code.tar.gz
/app/sdks/*
/.idea/
!/.idea/workspace.xml
!/.idea/php.xml
.DS_Store
.php_cs.cache
debug/
+1 -1
View File
@@ -1,4 +1,4 @@
[submodule "app/console"]
path = app/console
url = https://github.com/appwrite/console
branch = 2.0.2
branch = 2.3.3
+53 -4
View File
@@ -1,7 +1,58 @@
- Fix invited account verified status [#4776](https://github.com/appwrite/appwrite/pull/4776)
# Version 1.3.1
## Bugs
- Fixed Migration issue regarding 500 error [4906](https://github.com/appwrite/appwrite/pull/5356)
# Version 1.3.0
## Features
- Password dictionary setting allows to compare user's password against command password database [4906](https://github.com/appwrite/appwrite/pull/4906)
- Password history setting allows to save user's last used password so that it may not be used again. Maximum number of history saved is 20, which can be configured. Minimum is 0 which means disabled. [#4866](https://github.com/appwrite/appwrite/pull/4866)
- Update APIs to check X-Appwrite-Timestamp header [#5024](https://github.com/appwrite/appwrite/pull/5024)
- Database relationships [#5238](https://github.com/appwrite/appwrite/pull/5238)
- New query operators [#5238](https://github.com/appwrite/appwrite/pull/5238)
- Team preferences [#5196](https://github.com/appwrite/appwrite/pull/5196)
- Update attribute metadata [#5164](https://github.com/appwrite/appwrite/pull/5164)
## Bugs
- Fix not storing function's response on response codes 5xx [#4610](https://github.com/appwrite/appwrite/pull/4610)
- Fix expire to formatTz in create account session [#4985](https://github.com/appwrite/appwrite/pull/4985)
- Fix deleting projects when organization is deleted [#5335](https://github.com/appwrite/appwrite/pull/5335)
- Fix deleting collections from a project [#4983](https://github.com/appwrite/appwrite/pull/4983)
- Fix cleaning up project databases [#4984](https://github.com/appwrite/appwrite/pull/4984)
- Fix creating documents with attributes with special characters [#246](https://github.com/utopia-php/database/pull/246)
- Fix deleting attribute not deleting metadata index [#246](https://github.com/utopia-php/database/pull/246)
- Fix create attribute event payload [#246](https://github.com/utopia-php/database/pull/246)
# Version 1.2.1
## Changes
- Upgrade Console to [2.2.0](https://github.com/appwrite/console/releases/tag/2.2.0)
- Update DBIP Database [#5049](https://github.com/appwrite/appwrite/pull/5049)
## Bugs
- Fix a few null safety warnings [#4654](https://github.com/appwrite/appwrite/pull/4654)
- Fix timestamp format in Realtime response [#4515](https://github.com/appwrite/appwrite/pull/4515)
- Add flutter-web as a platform type [#4992](https://github.com/appwrite/appwrite/pull/4992)
- Fix typo in Model/Locale.php [#4669](https://github.com/appwrite/appwrite/pull/4669)
- Fix deletes worker not deleting project database tables [#4984](https://github.com/appwrite/appwrite/pull/4984)
- Fix deletes worker not deleting database collections [#4983](https://github.com/appwrite/appwrite/pull/4983)
- Fix restart policy for worker-messaging container [#4994](https://github.com/appwrite/appwrite/pull/4994)
- Fix validating origin for apple platforms [#5089](https://github.com/appwrite/appwrite/pull/5089)
# Version 1.2.0
## Features
- Added GraphQL API [#974](https://github.com/appwrite/appwrite/pull/974)
- Added GraphQL Explorer [#974](https://github.com/appwrite/appwrite/pull/974)
- Added ability to set max sessions per user per project [#4831](https://github.com/appwrite/appwrite/pull/4831)
## Changes
- Get default region from environment on project create [#4780](https://github.com/appwrite/appwrite/pull/4780)
- Fix french translation [#4782](https://github.com/appwrite/appwrite/pull/4782)
- Fix max mimetype size [#4814](https://github.com/appwrite/appwrite/pull/4814)
## Bugs
- Fix invited account verified status [#4776](https://github.com/appwrite/appwrite/pull/4776)
# Version 1.1.2
## Changes
- Released `appwrite/console` [2.0.2](https://github.com/appwrite/console/releases/tag/2.0.2)
@@ -28,14 +79,12 @@
## Bugs
- Fix license detection for Flutter and Dart SDKs [#4435](https://github.com/appwrite/appwrite/pull/4435)
- Fix missing realtime event for create function deployment [#4574](https://github.com/appwrite/appwrite/pull/4574)
- Fix missing `status`, `buildStderr` and `buildStderr` from get deployment response [#4611](https://github.com/appwrite/appwrite/pull/4611)
- Fix project pagination in DB usage aggregation [#4517](https://github.com/appwrite/appwrite/pull/4517)
- Fix missing file permissions due to cache [#4661](https://github.com/appwrite/appwrite/pull/4661)
- Fix usage stats for async function executions [#4674](https://github.com/appwrite/appwrite/pull/4674)
# Features
- Added Auth Duration API to allow users to set the duration of their sessions. [#4618](https://github.com/appwrite/appwrite/pull/4618)
# Version 1.0.3
## Bugs
- Fix document audit deletion [#4429](https://github.com/appwrite/appwrite/pull/4429)
+84 -69
View File
@@ -1,18 +1,18 @@
# Contributing
We would ❤️ for 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, new docs as well as updates and tweaks, blog posts, workshops, and more.
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.
## How to Start?
If you are worried or dont know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite](https://twitter.com/appwrite) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you!
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!
## Code of Conduct
Help us keep Appwrite open and inclusive. Please read and follow our [Code of Conduct](/https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md).
Help us keep Appwrite open and inclusive. Please read and follow our [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md).
## Submit a Pull Request 🚀
Branch naming convention is as follows
Branch naming convention is as following
`TYPE-ISSUE_ID-DESCRIPTION`
@@ -24,7 +24,7 @@ doc-548-submit-a-pull-request-section-to-contribution-guide
When `TYPE` can be:
- **feat** - is a new feature
- **feat** - a new feature
- **doc** - documentation only changes
- **cicd** - changes related to CI/CD system
- **fix** - a bug fix
@@ -40,33 +40,33 @@ For the initial start, fork the project and use git clone command to do
$ git pull
```
2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`<br/>
2. Create a new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`.<br/>
```
$ git checkout -b [name_of_your_new_branch]
```
3. Work - commit - repeat ( be sure to be in your branch )
3. Work - commit - repeat (make sure you're on the correct branch!)
4. Before you push your changes, make sure your code follows the `PSR12` coding standards, which is the standard Appwrite follows currently. You can easily do this by running the formatter.
4. Before you push your changes, make sure your code follows the `PSR12` coding standards, which is the standard that Appwrite currently follows. You can easily do this by running the formatter.
```bash
composer format <your file path>
```
Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix.
Now, go a step further by running the linter using the following command to manually fix the issues the formatter wasn't able to.
```bash
composer lint <your file path>
```
This will give you a list of errors for you to rectify, if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues.
This will give you a list of errors to rectify. If you need more information on the errors, you can pass in additional command line arguments to get more verbose information. More lists of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues.
```bash
composer lint --report=diff <your file path>
```
5. Push changes to GitHub
5. Push changes to GitHub.
```
$ git push origin [name_of_your_new_branch]
@@ -76,23 +76,23 @@ $ git push origin [name_of_your_new_branch]
If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button.
7. Start a Pull Request
Now submit the pull request and click on `Create pull request`.
8. Get a code review approval/reject
9. After approval, merge your PR
8. Get a code review approval/reject.
9. After approval, merge your PR.
10. GitHub will automatically delete the branch after the merge is done. (they can still be restored).
## Setup From Source
To set up a working **development environment**, just fork the project git repository and install the backend and frontend dependencies using the proper package manager and create run the docker-compose stack.
> If you just want to install Appwrite for day-to-day usage and not as a code maintainer use this [installation guide](https://github.com/appwrite/appwrite#installation).
Please note that these instructions are for setting a functional dev environment. If you want to set up an Appwrite instance to integrate into your app, you should probably try and install Appwrite by using the instructions in the [getting started guide](https://appwrite.io/docs/getting-started-for-web) or in the main [README](README.md) file.
> If you just want to install Appwrite for day-to-day use and not as a contributor, you can reference the [installation guide](https://github.com/appwrite/appwrite#installation), the [getting started guide](https://appwrite.io/docs/getting-started-for-web), or the main [README](README.md) file.
```bash
git clone git@github.com:[YOUR_FORK_HERE]/appwrite.git
cd appwrite
git submodule update --init
docker compose build
docker compose up -d
```
@@ -117,7 +117,7 @@ After finishing the installation process, you can start writing and editing code
#### Advanced Topics
We love to create issues that are good for beginners and label them as `good first issue` or `hacktoberfest`, but some more advanced topics might require extra knowledge. Below is a list of links you can use to learn more about some of the more advanced topics that will help you master the Appwrite codebase.
We love to create issues that are good for beginners and label them as `good first issue` or `hacktoberfest`, but some more advanced topics might require extra knowledge. Below is a list of links you can use to learn about the more advanced topics that will help you master the Appwrite codebase.
##### Tools and Libs
@@ -150,7 +150,7 @@ Learn more at our [Technology Stack](#technology-stack) section.
## Architecture
Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures, but our final goal, as we grow, is to be using only microservices.
Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures.
---
@@ -188,20 +188,23 @@ Appwrite's current structure is a combination of both [Monolithic](https://en.wi
├── src # Supporting libraries (each lib has one role, common libs are released as individual projects)
│ └── Appwrite
│ ├── Auth
│ ├── Database
│ ├── Detector
│ ├── Docker
| ├── DSN
│ ├── Event
│ ├── Extend
│ ├── GraphQL
│ ├── Messaging
│ ├── Migration
│ ├── Network
│ ├── OpenSSL
│ ├── Realtime
│ ├── Promises
│ ├── Resque
│ ├── Specification
│ ├── Task
│ ├── Template
│ ├── URL
│ ├── Usage
│ └── Utopia
└── tests # End to end & unit tests
├── e2e
@@ -213,13 +216,13 @@ Appwrite's current structure is a combination of both [Monolithic](https://en.wi
Appwrite's main API container is designed as a monolithic app. This is a decision we made to allow us to develop the project faster while still being a very small team.
Although the Appwrite API is a monolithic app, it has a very clear separation of concern as each internal service or worker is separated by its container, which will allow us as we grow to start breaking services for better maintenance and scalability.
Although the Appwrite API is a monolithic app, it has a very clear separation of concern as each internal service or worker is separated by its container, which allows us to start breaking services for better maintenance and scalability as we grow.
### The Microservice Part
Each container in Appwrite is a microservice on its own. Each service is an independent process that can scale without regard to any of the other services.
Currently, all of the Appwrite microservices are intended to communicate using the TCP protocol over a private network. You should be aware to not expose any of the services to the public-facing network, besides the public port 80 and 443, who, by default, are used to expose the Appwrite HTTP API.
Currently, all the Appwrite microservices are intended to communicate using the TCP protocol over a private network. With the exception of the public-facing port 80 and 443, which by default are used to expose the Appwrite HTTP API, you should **avoid exposing any other services' ports**.
## Ports
@@ -227,43 +230,43 @@ Appwrite dev version uses ports 80 and 443 as an entry point to the Appwrite API
## Technology Stack
To start helping us to improve the Appwrite server by submitting code, prior knowledge of Appwrite's technology stack can help you with getting started.
To start helping us to improve the Appwrite server by submitting code, prior knowledge of Appwrite's technology stack can help you get started.
Appwrite stack is combined from a variety of open-source technologies and tools. Appwrite backend API is written primarily with PHP version 7 and above on top of the [Utopia PHP framework](https://github.com/utopia-php/framework). The Appwrite frontend is built with tools like gulp, less, and [litespeed.js](https://github.com/litespeed-js). We use Docker as the container technology to package the Appwrite server for easy integration on-cloud, on-premise, or on-localhosts.
Appwrite stack is a combination of a variety of open-source technologies and tools. Appwrite backend API is written primarily with PHP version 7 and above, on top of the [Utopia PHP framework](https://github.com/utopia-php/framework). The Appwrite frontend is built with tools like gulp, less, and [litespeed.js](https://github.com/litespeed-js). We use Docker as the container technology to package the Appwrite server for easy on-cloud, on-premise, or on-localhost integration.
### Other Technologies
- Redis - for managing cache and in-memory data (currently, we do not use Redis for persistent data)
- MariaDB - for database storage and queries
- InfluxDB - for managing stats and time-series based data
- Statsd - for sending data over UDP protocol (using Telegraf)
- ClamAV - for validating and scanning storage files
- Redis - for managing cache and in-memory data (currently, we do not use Redis for persistent data).
- MariaDB - for database storage and queries.
- InfluxDB - for managing stats and time-series based data.
- Statsd - for sending data over UDP protocol (using Telegraf).
- ClamAV - for validating and scanning storage files.
- 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
- 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
Appwrite uses a package manager for managing code dependencies for both backend and frontend development. We try our best to avoid creating any unnecessary, and any new dependency to the project is subjected to a lead developer review and approval.
Appwrite uses a package manager for managing code dependencies for both backend and frontend development. We try our best to avoid creating any unnecessary dependencies. New dependency to the project is subjected to a lead developer's review and approval.
Many of Appwrite's internal modules are also used as dependencies to allow other Appwrite's projects to reuse them and as a way to contribute them back to the community.
Many of Appwrite's internal modules are also used as dependencies to allow other Appwrite projects to reuse them and as a way to contribute back to the community.
Appwrite uses [PHP's Composer](https://getcomposer.org/) for managing dependencies on the server-side and [JS NPM](https://www.npmjs.com/) for managing dependencies on the frontend side.
## Coding Standards
Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using both PSR-0 and PSR-12 for coding standards and autoloading standards.
Appwrite follows the [PHP-FIG standards](https://www.php-fig.org/). Currently, we use both PSR-0 and PSR-12 for coding standards and autoloading standards.
We use prettier for our JS coding standards and auto-formatting our code.
We use prettier for our JS coding standards and auto-formatting for our code.
## Scalability, Speed, and Performance
Appwrite is built to scale. Please keep in mind that the Appwrite stack can run in different environments and different scales.
We wish Appwrite will be as easy to set up and in a single, localhost, and easy to grow to a large environment with dozens and even hundreds of instances.
We intend Appwrite to be as easy to set up as possible in a single localhost, and to grow easily into a large environment with dozens and even hundreds of instances.
When contributing code, please take into account the following considerations:
When contributing code, please take into account the following:
- Response Time
- Throughput
@@ -274,25 +277,25 @@ When contributing code, please take into account the following considerations:
- Background Jobs
- Task Execution Time
## Security & Privacy
## Security and Privacy
Security and privacy are extremely important to Appwrite, developers, and users alike. Make sure to follow the best industry standards and practices.
## Dependencies
Please avoid introducing new dependencies to Appwrite without consulting the team. New dependencies can be very helpful but also introduce new security and privacy issues, complexity, and impact total docker image size.
Please avoid introducing new dependencies to Appwrite without consulting the team. New dependencies can be very helpful, but they also introduce new security and privacy risks, add complexity, and impact the total docker image size.
Adding a new dependency should have vital value on the product with minimum possible risk.
Adding a new dependency should have vital value for the product with minimum possible risk.
## Introducing New Features
We would 💖 you to contribute to Appwrite, but we would also like to make sure Appwrite is as great as possible and loyal to its vision and mission statement 🙏.
We would 💖 you to contribute to Appwrite, but we also want to ensure Appwrite is loyal to its vision and mission statement 🙏.
For us to find the right balance, please open an issue explaining your ideas before introducing a new pull request.
This will allow the Appwrite community to have sufficient discussion about the new feature value and how it fits in the product roadmap and vision.
This will allow the Appwrite community to sufficiently discuss the new feature value and how it fits within the product roadmap and vision.
This is also important for the Appwrite lead developers to be able to give technical input and different emphasis regarding the feature design and architecture. Some bigger features might need to go through our [RFC process](https://github.com/appwrite/rfc).
This is also important for the Appwrite lead developers to be able to provide technical input and potentially a different emphasis regarding the feature design and architecture. Some bigger features might need to go through our [RFC process](https://github.com/appwrite/rfc).
## Build
@@ -316,30 +319,34 @@ The Runtimes for all supported cloud functions (multicore builds) can be found a
## Generate SDK
For generating a new console SDK follow the next steps:
The following steps are used to generate a new console SDK:
1. Update the console spec file located at `app/config/specs/swagger2-<version-number>.console.json` using Appwrite Tasks. Run the `php app/cli.php specs <version-number> normal` command in a running `appwrite/appwrite` container.
2. Generate a new SDK using the command `php app/cli.php sdks`
3. Change your working dir using `cd app/sdks/console-web`
4. Build the new SDK `npm run build`
5. Copy `iife/sdk.js` to `appwrite.js`
6. Go back to the root of the project `run npm run build`
2. Generate a new SDK using the command `php app/cli.php sdks`.
3. Change your working dir using `cd app/sdks/console-web`.
4. Build the new SDK `npm run build`.
5. Copy `iife/sdk.js` to `appwrite.js`.
6. Go back to the root of the project `run npm run build`.
## Checklist for Releasing SDKs
Things to remember when releasing SDKs
Things to remember when releasing SDKs:
- Update the Changelogs in **docs/sdks** (right now only Dart and Flutter are using these)
- Update **GETTING_STARTED.md** in **docs/sdks** for each SDKs if any changes in the related APIs in there
- Update SDK versions as required on **app/config/platforms.php**
- Generate SDKs using the command `php app/cli.php sdks` and follow the instructions
- Release new tags on GitHub repository for each SDKs
- Update the Changelogs in **docs/sdks** (right now only Dart and Flutter are using these).
- Update **GETTING_STARTED.md** in **docs/sdks** for each SDKs if any changes in the related APIs are in there.
- Update SDK versions as required on **app/config/platforms.php**.
- Generate SDKs using the command `php app/cli.php sdks` and follow the instructions.
- Release new tags on GitHub repository for each SDK.
## Debug
Appwrite uses [yasd](https://github.com/swoole/yasd) debugger, which can be made available during build of Appwrite. You can connect to the debugger using VS Code [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension or if you are in PHP Storm you don't need any plugin. Below are the settings required for remote debugger connection.
Appwrite uses [yasd](https://github.com/swoole/yasd) debugger, which can be made available during build of Appwrite. You can connect to the debugger using VS Code's [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension.
First, you need to create an init file. Duplicate **dev/yasd_init.php.stub** file and name it **dev/yasd_init.php** and then change the IP address to your development machine's IP. Without the proper IP address debugger won't connect. And you also need to set **DEBUG** build arg in **appwrite** service in **docker-compose.yml** file.
If you are in PHP Storm you don't need any plugin. Below are the settings required for remote debugger connection:
1. Create an init file.
2. Duplicate **dev/yasd_init.php.stub** file and name it **dev/yasd_init.php**.
3. Set **DEBUG** build arg in **appwrite** service in **docker-compose.yml** file.
### VS Code Launch Configuration
@@ -357,7 +364,7 @@ First, you need to create an init file. Duplicate **dev/yasd_init.php.stub** fil
### PHPStorm Setup
In settings, go to **Languages & Frameworks** > **PHP** > **Debug**, there under **Xdebug** set the debug port to **9005** and enable **can accept external connections** checkbox.
In settings, go to **Languages & Frameworks** > **PHP** > **Debug**, under **Xdebug** set the debug port to **9005** and enable the **can accept external connections** checkbox.
## Tests
@@ -428,39 +435,47 @@ composer lint
composer lint <your file path>
```
## Clearing the Cache
If you need to clear the cache, you can do so by running the following command:
```bash
docker compose exec redis redis-cli FLUSHALL
```
## Tutorials
From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials:
- [Adding Support for a New OAuth2 Provider](./docs/tutorials/add-oauth2-provider.md)
- [Appwrite Environment Variables](./docs/tutorials/environment-variables.md)
- [Running in Production](./docs/tutorials/running-in-production.md)
- [Appwrite Environment Variables](./docs/tutorials/add-environment-variable.md)
- [Running in Production](https://appwrite.io/docs/production)
- [Adding Storage Adapter](./docs/tutorials/add-storage-adapter.md)
## Other Ways to Help
Pull requests are great, but there are many other areas where you can help Appwrite.
Pull requests are great, but there are many other ways you can help Appwrite.
### Blogging & Speaking
Blogging, speaking about, or creating tutorials about one of Appwrites many features. Mention [@appwrite](https://twitter.com/appwrite) on Twitter and/or [email team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub.
Blogging, speaking about, or creating tutorials about one of Appwrites many features are great ways to get the word out about Appwrite. Mention [@appwrite](https://twitter.com/appwrite) on Twitter and/or [email team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub.
### Presenting at Meetups
Presenting at meetups and conferences about your Appwrite projects. Your unique challenges and successes in building things with Appwrite can provide great speaking material. Wed love to review your talk abstract/CFP, so get in touch with us if youd like some help!
We encourage our contributors to present at meetups and conferences about your Appwrite projects. Your unique challenges and successes in building things with Appwrite can provide great speaking material. Wed love to review your talk abstract/CFP, so get in touch with us if youd like some help!
### Sending Feedbacks & Reporting Bugs
### Sending Feedbacks and Reporting Bugs
Sending feedback is a great way for us to understand your different use cases of Appwrite better. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA).
Sending feedback is a great way for us to understand your different use cases of Appwrite better. If you had any issues, bugs, or want to share your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA).
### Submitting New Ideas
If you think Appwrite could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and it's implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature.
If you think Appwrite could use a new feature, please open an issue on our GitHub repository, stating as much information as you have about your new idea and its implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature.
### Improving Documentation
Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated.
Submitting documentation updates, enhancements, designs, or bug fixes, as well as spelling or grammar fixes is much appreciated.
### Helping Someone
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
Consider searching for Appwrite on Discord, GitHub, or StackOverflow to help someone who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
+5 -188
View File
@@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM node:16.14.2-alpine3.15 as node
FROM --platform=$BUILDPLATFORM node:16.14.2-alpine3.15 as node
COPY app/console /usr/local/src/console
@@ -20,152 +20,16 @@ WORKDIR /usr/local/src/console
ARG VITE_GA_PROJECT
ARG VITE_CONSOLE_MODE
ARG VITE_APPWRITE_GROWTH_ENDPOINT=https://growth.appwrite.io/v1
ENV VITE_GA_PROJECT=$VITE_GA_PROJECT
ENV VITE_CONSOLE_MODE=$VITE_CONSOLE_MODE
ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT
RUN npm ci
RUN npm run build
FROM php:8.0.18-cli-alpine3.15 as compile
ARG DEBUG=false
ENV DEBUG=$DEBUG
ENV PHP_REDIS_VERSION=5.3.7 \
PHP_MONGODB_VERSION=1.13.0 \
PHP_SWOOLE_VERSION=v4.8.10 \
PHP_IMAGICK_VERSION=3.7.0 \
PHP_YAML_VERSION=2.2.2 \
PHP_MAXMINDDB_VERSION=v1.11.0 \
PHP_ZSTD_VERSION="4504e4186e79b197cfcb75d4d09aa47ef7d92fe9"
RUN \
apk add --no-cache --virtual .deps \
make \
automake \
autoconf \
gcc \
g++ \
git \
zlib-dev \
brotli-dev \
openssl-dev \
yaml-dev \
imagemagick \
imagemagick-dev \
libmaxminddb-dev \
zstd-dev
RUN docker-php-ext-install sockets
FROM compile AS redis
RUN \
# Redis Extension
git clone --depth 1 --branch $PHP_REDIS_VERSION https://github.com/phpredis/phpredis.git && \
cd phpredis && \
phpize && \
./configure && \
make && make install
## Swoole Extension
FROM compile AS swoole
RUN \
git clone --depth 1 --branch $PHP_SWOOLE_VERSION https://github.com/swoole/swoole-src.git && \
cd swoole-src && \
phpize && \
./configure --enable-sockets --enable-http2 --enable-openssl && \
make && make install && \
cd ..
## Swoole Debugger setup
RUN if [ "$DEBUG" == "true" ]; then \
cd /tmp && \
apk add boost-dev && \
git clone --depth 1 https://github.com/swoole/yasd && \
cd yasd && \
phpize && \
./configure && \
make && make install && \
cd ..;\
fi
## Imagick Extension
FROM compile AS imagick
RUN \
git clone --depth 1 --branch $PHP_IMAGICK_VERSION https://github.com/imagick/imagick && \
cd imagick && \
phpize && \
./configure && \
make && make install
## YAML Extension
FROM compile AS yaml
RUN \
git clone --depth 1 --branch $PHP_YAML_VERSION https://github.com/php/pecl-file_formats-yaml && \
cd pecl-file_formats-yaml && \
phpize && \
./configure && \
make && make install
## Maxminddb extension
FROM compile AS maxmind
RUN \
git clone --depth 1 --branch $PHP_MAXMINDDB_VERSION https://github.com/maxmind/MaxMind-DB-Reader-php.git && \
cd MaxMind-DB-Reader-php && \
cd ext && \
phpize && \
./configure && \
make && make install
# Mongodb Extension
FROM compile as mongodb
RUN \
git clone --depth 1 --branch $PHP_MONGODB_VERSION https://github.com/mongodb/mongo-php-driver.git && \
cd mongo-php-driver && \
git submodule update --init && \
phpize && \
./configure && \
make && make install
# Zstd Compression
FROM compile as zstd
RUN git clone --recursive -n https://github.com/kjdev/php-ext-zstd.git \
&& cd php-ext-zstd \
&& git checkout $PHP_ZSTD_VERSION \
&& phpize \
&& ./configure --with-libzstd \
&& make && make install
# Rust Extensions Compile Image
FROM php:8.0.18-cli as rust_compile
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN apt-get update && apt-get install musl-tools build-essential clang-11 git -y
RUN rustup target add $(uname -m)-unknown-linux-musl
# Install ZigBuild for easier cross-compilation
RUN curl https://ziglang.org/builds/zig-linux-$(uname -m)-0.10.0-dev.2674+d980c6a38.tar.xz --output /tmp/zig.tar.xz
RUN tar -xf /tmp/zig.tar.xz -C /tmp/ && cp -r /tmp/zig-linux-$(uname -m)-0.10.0-dev.2674+d980c6a38 /tmp/zig/
ENV PATH=/tmp/zig:$PATH
RUN cargo install cargo-zigbuild
ENV RUSTFLAGS="-C target-feature=-crt-static"
FROM rust_compile as scrypt
WORKDIR /usr/local/lib/php/extensions/
RUN \
git clone --depth 1 https://github.com/appwrite/php-scrypt.git && \
cd php-scrypt && \
cargo zigbuild --workspace --all-targets --target $(uname -m)-unknown-linux-musl --release && \
mv target/$(uname -m)-unknown-linux-musl/release/libphp_scrypt.so target/libphp_scrypt.so
FROM php:8.0.18-cli-alpine3.15 as final
FROM appwrite/base:0.2.2 as final
LABEL maintainer="team@appwrite.io"
@@ -260,38 +124,6 @@ ENV _APP_SERVER=swoole \
_APP_LOGGING_PROVIDER= \
_APP_LOGGING_CONFIG=
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN \
apk update \
&& apk add --no-cache --virtual .deps \
make \
automake \
autoconf \
gcc \
g++ \
curl-dev \
&& apk add --no-cache \
libstdc++ \
certbot \
brotli-dev \
yaml-dev \
imagemagick \
imagemagick-dev \
libmaxminddb-dev \
certbot \
docker-cli \
libgomp \
&& docker-php-ext-install sockets opcache pdo_mysql \
&& apk del .deps \
&& rm -rf /var/cache/apk/*
RUN \
mkdir -p $DOCKER_CONFIG/cli-plugins \
&& ARCH=$(uname -m) && if [ $ARCH == "armv7l" ]; then ARCH="armv7"; fi \
&& curl -SL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-$ARCH -o $DOCKER_CONFIG/cli-plugins/docker-compose \
&& chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
RUN \
if [ "$DEBUG" == "true" ]; then \
apk add boost boost-dev; \
@@ -301,14 +133,6 @@ WORKDIR /usr/src/code
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
COPY --from=node /usr/local/src/console/build /usr/src/code/console
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so* /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20200930/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20200930/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=yaml /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yaml.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=maxmind /usr/local/lib/php/extensions/no-debug-non-zts-20200930/maxminddb.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=mongodb /usr/local/lib/php/extensions/no-debug-non-zts-20200930/mongodb.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=scrypt /usr/local/lib/php/extensions/php-scrypt/target/libphp_scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
COPY --from=zstd /usr/local/lib/php/extensions/no-debug-non-zts-20200930/zstd.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
# Add Source Code
COPY ./app /usr/src/code/app
@@ -358,14 +182,7 @@ RUN chmod +x /usr/local/bin/doctor && \
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
# Enable Extensions
RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini
RUN echo extension=yaml.so >> /usr/local/etc/php/conf.d/yaml.ini
RUN echo extension=maxminddb.so >> /usr/local/etc/php/conf.d/maxminddb.ini
RUN echo extension=libphp_scrypt.so >> /usr/local/etc/php/conf.d/libphp_scrypt.ini
RUN echo extension=zstd.so >> /usr/local/etc/php/conf.d/zstd.ini
RUN if [ "$DEBUG" == "true" ]; then printf "zend_extension=yasd \nyasd.debug_mode=remote \nyasd.init_file=/usr/local/dev/yasd_init.php \nyasd.remote_port=9005 \nyasd.log_level=-1" >> /usr/local/etc/php/conf.d/yasd.ini; fi
RUN if [ "$DEBUG" == "true" ]; then printf "zend_extension=yasd \nyasd.debug_mode=remote \nyasd.init_file=/usr/src/code/dev/yasd_init.php \nyasd.remote_port=9005 \nyasd.log_level=-1" >> /usr/local/etc/php/conf.d/yasd.ini; fi
RUN if [ "$DEBUG" == "true" ]; then echo "opcache.enable=0" >> /usr/local/etc/php/conf.d/appwrite.ini; fi
RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
+17 -14
View File
@@ -1,3 +1,6 @@
> 准备好迎接狂风暴'云'了吗? 🌩 ☂️
> Appwrite Cloud即将到来!你能够通过https://appwrite.io/cloud了解更多的资讯, 注册即可领取试用额度哦
<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>
@@ -9,10 +12,10 @@
</p>
<!-- [![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) -->
[![We're Hiring](https://img.shields.io/static/v1?label=We're&message=Hiring&color=blue&style=flat-square)](https://appwrite.io/company/careers)
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
[![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
[![Build Status](https://img.shields.io/github/actions/workflow/status/appwrite/appwrite/tests.yml?branch=master&label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
@@ -21,9 +24,9 @@
[English](README.md) | 简体中文
[**我们发布了 Appwrite Console 2.0 版本,点击这里了解更多!**](https://medium.com/appwrite-io/announcing-console-2-0-2e0e96891cb0?source=friends_link&sk=7a82b4069778e3adc165dc026e960fe1)
[**宣布带有数据库关系的 Appwrite 1.3!了解最新消息!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc)
Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面简了从零编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面简了从零开始编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存,图像处理,云函数计算,[等多种服务](https://appwrite.io/docs).
@@ -55,7 +58,7 @@ Appwrite 可以提供给开发者用户验证,外部授权,用户数据读
Appwrite 的容器化服务器只需要一行指令就可以运行。您可以使用 docker-compose 在本地主机上运行 Appwrite,也可以在任何其他容器化工具(如 Kubernetes、Docker Swarm 或 Rancher)上运行 Appwrite。
开始运行 Appwrite 服务器的最简单方法是运行我们的 docker-compose 文件。在运行安装命令之前,请确保您的机器上安装了 [Docker](https://dockerdocs.cn/get-docker/index.html)
启动 Appwrite 服务器的最简单方法是运行我们的 docker-compose 文件。在运行安装命令之前,请确保您的机器上安装了 [Docker](https://dockerdocs.cn/get-docker/index.html)
### Unix
@@ -64,7 +67,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.1.2
appwrite/appwrite:1.3.1
```
### Windows
@@ -76,17 +79,17 @@ 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.1.2
appwrite/appwrite:1.3.1
```
#### PowerShell
```powershell
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.1.2
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.3.1
```
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
@@ -159,7 +162,7 @@ Appwrite API 界面层利用后台缓存和任务委派来提供极速的响应
## 贡献代码
所有代码贡献 - 包括来自具有直接提交更改权限的贡献者 - 都必须提交PR请求并在合并分支之前得到核心开发人员的批准。这是为了确保正确审查所有代码。
为了确保正确审查,所有代码贡献 - 包括来自具有直接提交更改权限的贡献者 - 都必须提交PR请求并在合并分支之前得到核心开发人员的批准。
我们欢迎所有人提交PR!如果您愿意提供帮助,可以在 [贡献指南](CONTRIBUTING.md) 中了解有关如何为项目做出贡献的更多信息。
@@ -169,7 +172,7 @@ Appwrite API 界面层利用后台缓存和任务委派来提供极速的响应
## 订阅我们
加入我们在世界各地不断发展的社区!请参阅我们的官方 [博客](https://medium.com/appwrite-io)。在 [Twitter](https://twitter.com/appwrite)、[Facebook 页面](https://www.facebook.com/appwrite.io)、[Facebook 群组](https://www.facebook)、[开发者社区](https://dev.to/appwrite) 等平台订阅我们或加入我们的 [Discord 社区](https://discord.gg/GSeTUeA) 以获得更多帮助,想法和讨论。
加入我们在世界各地不断发展的社区!请参阅我们的官方 [博客](https://medium.com/appwrite-io)。在 [Twitter](https://twitter.com/appwrite)、[Facebook 页面](https://www.facebook.com/appwrite.io)、[Facebook 群组](https://www.facebook.com/appwrite.io/groups/)、[开发者社区](https://dev.to/appwrite) 等平台订阅我们或加入我们的 [Discord 社区](https://discord.gg/GSeTUeA) 以获得更多帮助,想法和讨论。
## 版权说明
+20 -19
View File
@@ -14,9 +14,10 @@
<!-- [![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) -->
[![We're Hiring](https://img.shields.io/static/v1?label=We're&message=Hiring&color=blue&style=flat-square)](https://appwrite.io/company/careers)
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=ready&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
[![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
[![Build Status](https://img.shields.io/github/actions/workflow/status/appwrite/appwrite/tests.yml?branch=master&label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
@@ -25,11 +26,11 @@
English | [简体中文](README-CN.md)
[**Appwrite Console 2.0 has been released! Learn what's new!**](https://medium.com/appwrite-io/announcing-console-2-0-2e0e96891cb0?source=friends_link&sk=7a82b4069778e3adc165dc026e960fe1)
[**Announcing Appwrite 1.3 with Database Relationships! Learn what's new!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc)
Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker<nobr> microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster.
Using Appwrite, you can easily integrate your app with user authentication & multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, and [more services](https://appwrite.io/docs).
Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, and [more services](https://appwrite.io/docs).
<p align="center">
<br />
@@ -64,7 +65,7 @@ Table of Contents:
## Installation
Appwrite backend server is designed to run in a container environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool like Kubernetes, Docker Swarm, or Rancher.
Appwrite is designed to run in a containerized environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool, such as Kubernetes, Docker Swarm, or Rancher.
The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command, make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine:
@@ -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.1.2
appwrite/appwrite:1.3.1
```
### 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.1.2
appwrite/appwrite:1.3.1
```
#### PowerShell
@@ -97,10 +98,10 @@ 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.1.2
appwrite/appwrite:1.3.1
```
Once the Docker installation completes, 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 installation completes.
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.
For advanced production and custom installation, check out our Docker [environment variables](https://appwrite.io/docs/environment-variables) docs. You can also use our public [docker-compose.yml](https://appwrite.io/install/compose) and [.env](https://appwrite.io/install/env) files to manually set up an environment.
@@ -110,7 +111,7 @@ If you are upgrading your Appwrite server from an older version, you should use
## One-Click Setups
In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running with Appwrite quickly without installing Docker on your local machine.
In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running quickly with Appwrite without installing Docker on your local machine.
Choose from one of the providers below:
@@ -147,18 +148,18 @@ Getting started with Appwrite is as easy as creating a new project, choosing you
- [**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.
- [**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 fit your app perfectly. 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, 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, credit card symbols, and generate QR codes.
- [**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.
- [**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.
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).
### SDKs
Below is a list of currently supported platforms and languages. If you wish to help us add support to your platform of choice, you can go over to our [SDK Generator](https://github.com/appwrite/sdk-generator) project and view our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md).
Below is a list of currently supported platforms and languages. If you would like to help us add support to your platform of choice, you can go over to our [SDK Generator](https://github.com/appwrite/sdk-generator) project and view our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md).
#### Client
@@ -190,13 +191,13 @@ Looking for more SDKs? - Help us by contributing a pull request to our [SDK Gene
![Appwrite Architecture](docs/specs/overview.drawio.svg)
Appwrite uses a microservices architecture that was designed for easy scaling and delegation of responsibilities. In addition, Appwrite supports multiple APIs (REST, WebSocket, and GraphQL-soon) to allow you to interact with your resources by leveraging your existing knowledge and protocols of choice.
Appwrite uses a microservices architecture that was designed for easy scaling and delegation of responsibilities. In addition, Appwrite supports multiple APIs, such as REST, WebSocket, and GraphQL to allow you to interact with your resources by leveraging your existing knowledge and protocols of choice.
The Appwrite API layer was designed to be extremely fast by leveraging in-memory caching and delegating any heavy-lifting tasks to the Appwrite background workers. The background workers also allow you to precisely control your compute capacity and costs using a message queue to handle the load. You can learn more about our architecture in the [contribution guide](CONTRIBUTING.md#architecture-1).
## Contributing
All code contributions - including those of people having commit access - must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](CONTRIBUTING.md).
@@ -206,7 +207,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a
## Follow Us
Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
Join our growing community around the world! Check out our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
## License
+7 -6
View File
@@ -2,12 +2,13 @@
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| <= 0.14 | :x: |
| 1.15.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| Version | Supported |
| --------- | ------------------ |
| <= 0.15.x | :x: |
| 1.0.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| 1.2.x | :white_check_mark: |
| 1.3.x | :white_check_mark: |
## Reporting a Vulnerability
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
+33 -1
View File
@@ -3,7 +3,7 @@
use Appwrite\Auth\Auth;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\ID;
use Utopia\Database\Helpers\ID;
$providers = Config::getParam('providers', []);
$auth = Config::getParam('auth', []);
@@ -346,6 +346,16 @@ $collections = [
'array' => true,
'filters' => [],
],
[
'$id' => ID::custom('options'),
'type' => Database::VAR_STRING,
'size' => 16384,
'signed' => false,
'required' => false,
'default' => null,
'array' => false,
'filters' => ['json'],
],
],
'indexes' => [
[
@@ -1234,6 +1244,17 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('passwordHistory'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 16384,
'signed' => true,
'required' => false,
'default' => null,
'array' => true,
'filters' => [],
],
[
'$id' => ID::custom('password'),
'type' => Database::VAR_STRING,
@@ -1854,6 +1875,17 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('prefs'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 65535,
'signed' => true,
'required' => false,
'default' => new \stdClass(),
'array' => false,
'filters' => ['json'],
],
],
'indexes' => [
[
+33 -3
View File
@@ -408,6 +408,16 @@ return [
'description' => 'Document with the requested ID already exists.',
'code' => 409,
],
Exception::DOCUMENT_UPDATE_CONFLICT => [
'name' => Exception::DOCUMENT_UPDATE_CONFLICT,
'description' => 'Remote document is newer than local.',
'code' => 409,
],
Exception::DOCUMENT_DELETE_RESTRICTED => [
'name' => Exception::DOCUMENT_DELETE_RESTRICTED,
'description' => 'Document cannot be deleted because it is referenced by another document.',
'code' => 403,
],
/** Attributes */
Exception::ATTRIBUTE_NOT_FOUND => [
@@ -417,12 +427,12 @@ return [
],
Exception::ATTRIBUTE_UNKNOWN => [
'name' => Exception::ATTRIBUTE_UNKNOWN,
'description' => 'The attribute required for the index could not be found. Please confirm all your attributes are in the <span class="tag">available</span> state.',
'description' => 'The attribute required for the index could not be found. Please confirm all your attributes are in the available state.',
'code' => 400,
],
Exception::ATTRIBUTE_NOT_AVAILABLE => [
'name' => Exception::ATTRIBUTE_NOT_AVAILABLE,
'description' => 'The requested attribute is not yet <span class="tag">available</span>. Please try again later.',
'description' => 'The requested attribute is not yet available. Please try again later.',
'code' => 400,
],
Exception::ATTRIBUTE_FORMAT_UNSUPPORTED => [
@@ -432,7 +442,7 @@ return [
],
Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED => [
'name' => Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED,
'description' => 'Default values cannot be set for <span class="tag">array</span> and <span class="tag">required</span> attributes.',
'description' => 'Default values cannot be set for array or required attributes.',
'code' => 400,
],
Exception::ATTRIBUTE_ALREADY_EXISTS => [
@@ -450,6 +460,11 @@ return [
'description' => 'The attribute value is invalid. Please check the type, range and value of the attribute.',
'code' => 400,
],
Exception::ATTRIBUTE_TYPE_INVALID => [
'name' => Exception::ATTRIBUTE_TYPE_INVALID,
'description' => 'The attribute type is invalid.',
'code' => 400,
],
/** Indexes */
Exception::INDEX_NOT_FOUND => [
@@ -549,4 +564,19 @@ return [
'description' => 'Domain verification for the requested domain has failed.',
'code' => 401,
],
Exception::DOMAIN_TARGET_INVALID => [
'name' => Exception::DOMAIN_TARGET_INVALID,
'description' => 'Your Appwrite instance is not publicly accessible. Please check the _APP_DOMAIN_TARGET environment variable of your Appwrite server.',
'code' => 501,
],
Exception::GRAPHQL_NO_QUERY => [
'name' => Exception::GRAPHQL_NO_QUERY,
'description' => 'Param "query" is not optional.',
'code' => 400,
],
Exception::GRAPHQL_TOO_MANY_QUERIES => [
'name' => Exception::GRAPHQL_TOO_MANY_QUERIES,
'description' => 'Too many queries.',
'code' => 400,
],
];
+6 -3
View File
@@ -183,13 +183,16 @@ return [
],
],
'create' => [
'$description' => 'This event triggers when a bucket is created.'
'$description' => 'This event triggers when a team is created.'
],
'delete' => [
'$description' => 'This event triggers when a bucket is deleted.',
'$description' => 'This event triggers when a team is deleted.',
],
'update' => [
'$description' => 'This event triggers when a bucket is updated.',
'$description' => 'This event triggers when a team is updated.',
'prefs' => [
'$description' => 'This event triggers when a team\'s preferences are updated.',
],
]
],
'functions' => [
+2 -2
View File
@@ -17,7 +17,7 @@
"emails.magicSession.signature": "L'équipe {{project}}",
"emails.recovery.subject": "Réinitialisation du mot de passe",
"emails.recovery.hello": "Bonjour {{name}}",
"emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe pour {{projet}}.",
"emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe pour {{project}}.",
"emails.recovery.footer": "Si vous n'avez pas demandé à réinitialiser votre mot de passe, vous pouvez ignorer ce message.",
"emails.recovery.thanks": "Merci",
"emails.recovery.signature": "L'équipe {{project}}",
@@ -29,7 +29,7 @@
"emails.invitation.signature": "L'équipe {{project}}",
"emails.certificate.subject": "Échec du certificat pour %s",
"emails.certificate.hello": "Bonjour",
"emails.certificate.body": "Le certificate pour votre domaine '{{domain}}' n'a pas pu être généré. Ceci est la tentative {{tentative}} et l'échec a été causé par : {{erreur}}",
"emails.certificate.body": "Le certificate pour votre domaine '{{domain}}' n'a pas pu être généré. Ceci est la tentative {{attempt}} et l'échec a été causé par : {{error}}",
"emails.certificate.footer": "Votre certificat précédent sera valide pendant 30 jours à compter de la première défaillance. Nous vous recommandons fortement d'enquêter sur ce cas, sinon votre domaine se retrouvera sans communication SSL valide.",
"emails.certificate.thanks": "Merci",
"emails.certificate.signature": "L'équipe {{project}}",
+102 -96
View File
@@ -5,57 +5,63 @@
"emails.sender": "%s 小組",
"emails.verification.subject": "帳戶驗證",
"emails.verification.hello": "嗨 {{name}}",
"emails.verification.body": "按照此鏈接驗證您的電子郵件地址。",
"emails.verification.body": "按照此連結驗證您的電子郵件地址。",
"emails.verification.footer": "如果您沒有要求驗證此地址,則可以忽略此消息。",
"emails.verification.thanks": "謝謝",
"emails.verification.signature": "{{project}} 團隊",
"emails.magicSession.subject": "登",
"emails.magicSession.hello": "嗨",
"emails.magicSession.body": "點此鏈接登錄。",
"emails.magicSession.footer": "如果您沒有要求使用此電子郵件登,則可以忽略此消息。",
"emails.magicSession.subject": "登",
"emails.magicSession.hello": "嗨",
"emails.magicSession.body": "點此連結登入。",
"emails.magicSession.footer": "如果您沒有要求使用此電子郵件登,則可以忽略此消息。",
"emails.magicSession.thanks": "謝謝",
"emails.magicSession.signature": "{{project}} 團隊",
"emails.recovery.subject": "重設密碼",
"emails.recovery.hello": "好 {{name}}",
"emails.recovery.body": "按照此鏈接重置您的 {{project}} 密碼.",
"emails.recovery.hello": "好 {{name}}",
"emails.recovery.body": "按照此連結重置您的 {{project}} 密碼",
"emails.recovery.footer": "如果您沒有要求重置密碼,則可以忽略此消息。",
"emails.recovery.thanks": "謝謝",
"emails.recovery.signature": "{{project}} 團隊",
"emails.invitation.subject": "邀請 %s 團隊在 %s",
"emails.invitation.hello": "好",
"emails.invitation.body": "這封郵件發送給您是因為 {{owner}} 想邀請您成為 {{team}} 團隊在 {{project}}.",
"emails.invitation.hello": "好",
"emails.invitation.body": "發送這封郵件給您是因為 {{owner}} 想邀請您成為 {{team}} 團隊在 {{project}}",
"emails.invitation.footer": "如果您不感興趣,可以忽略此消息。",
"emails.invitation.thanks": "謝謝",
"emails.invitation.signature": "{{project}} 團隊",
"emails.certificate.subject": "%s 的憑證更新失敗",
"emails.certificate.hello": "您好",
"emails.certificate.body": "無法產生您的域名 '{{domain}}' 的憑證。這是第 {{attempt}} 次嘗試,失敗原因是:{{error}}",
"emails.certificate.footer": "您的上一個憑證將會在第一次失敗的 30 天後失效。我們強烈建議您調查這件事情,否則您的域名將會無法進行有效的 SSL 通訊。",
"emails.certificate.thanks": "謝謝",
"emails.certificate.signature": "{{project}} 團隊",
"locale.country.unknown": "未知",
"countries.af": "阿富汗",
"countries.ao": "安哥拉",
"countries.al": "阿爾巴尼亞",
"countries.ad": "安道爾",
"countries.ae": "阿拉伯聯合酋長國",
"countries.ae": "阿拉伯聯合大公國",
"countries.ar": "阿根廷",
"countries.am": "亞美尼亞",
"countries.ag": "安提瓜和巴布達",
"countries.au": "澳大利亞",
"countries.ag": "安地卡及巴布達",
"countries.au": "澳",
"countries.at": "奧地利",
"countries.az": "塞拜",
"countries.bi": "布隆迪",
"countries.az": "塞拜",
"countries.bi": "蒲隆地",
"countries.be": "比利時",
"countries.bj": "貝",
"countries.bf": "布納法索",
"countries.bd": "孟加拉",
"countries.bj": "貝",
"countries.bf": "布納法索",
"countries.bd": "孟加拉",
"countries.bg": "保加利亞",
"countries.bh": "巴林",
"countries.bs": "巴哈馬",
"countries.ba": "波",
"countries.by": "白羅斯",
"countries.bz": "伯利茲",
"countries.ba": "波士尼亞與赫塞哥維納",
"countries.by": "白羅斯",
"countries.bz": "貝里斯",
"countries.bo": "玻利維亞",
"countries.br": "巴西",
"countries.bb": "巴巴多斯",
"countries.bn": "萊",
"countries.bb": "巴貝多",
"countries.bn": "萊",
"countries.bt": "不丹",
"countries.bw": "博茨瓦納",
"countries.bw": "波札那",
"countries.cf": "中非共和國",
"countries.ca": "加拿大",
"countries.ch": "瑞士",
@@ -66,42 +72,42 @@
"countries.cd": "剛果民主共和國",
"countries.cg": "剛果共和國",
"countries.co": "哥倫比亞",
"countries.km": "摩",
"countries.cv": "佛得角",
"countries.cr": "哥斯黎加",
"countries.km": "摩",
"countries.cv": "維德角",
"countries.cr": "哥斯黎加",
"countries.cu": "古巴",
"countries.cy": "塞浦路斯",
"countries.cy": "賽普勒斯",
"countries.cz": "捷克",
"countries.de": "德國",
"countries.dj": "吉布",
"countries.dj": "吉布",
"countries.dm": "多米尼克",
"countries.dk": "丹麥",
"countries.do": "多明尼加共和國",
"countries.dz": "阿爾及利亞",
"countries.ec": "厄瓜多",
"countries.ec": "厄瓜多",
"countries.eg": "埃及",
"countries.er": "厄立特裏亞",
"countries.er": "厄利垂亞",
"countries.es": "西班牙",
"countries.ee": "愛沙尼亞",
"countries.et": "埃塞俄比亞",
"countries.et": "衣索比亞",
"countries.fi": "芬蘭",
"countries.fj": "斐濟",
"countries.fr": "法國",
"countries.fm": "密克羅尼西亞",
"countries.ga": "加",
"countries.ga": "加",
"countries.gb": "英國",
"countries.ge": "格魯吉亞",
"countries.gh": "納",
"countries.ge": "喬治亞",
"countries.gh": "納",
"countries.gn": "幾內亞",
"countries.gm": "比亞",
"countries.gw": "幾內亞比",
"countries.gm": "比亞",
"countries.gw": "幾內亞比",
"countries.gq": "赤道幾內亞",
"countries.gr": "希臘",
"countries.gd": "格林納達",
"countries.gt": "地馬拉",
"countries.gy": "亞那",
"countries.hn": "都拉斯",
"countries.hr": "克羅亞",
"countries.gd": "格瑞那達",
"countries.gt": "地馬拉",
"countries.gy": "亞那",
"countries.hn": "都拉斯",
"countries.hr": "克羅埃西亞",
"countries.ht": "海地",
"countries.hu": "匈牙利",
"countries.id": "印度尼西亞",
@@ -111,26 +117,26 @@
"countries.iq": "伊拉克",
"countries.is": "冰島",
"countries.il": "以色列",
"countries.it": "大利",
"countries.it": "大利",
"countries.jm": "牙買加",
"countries.jo": "約旦",
"countries.jp": "日本",
"countries.kz": "哈薩克斯坦",
"countries.ke": "肯亞",
"countries.kg": "吉爾吉斯斯坦",
"countries.kz": "哈薩克",
"countries.ke": "肯亞",
"countries.kg": "吉爾吉斯",
"countries.kh": "柬埔寨",
"countries.ki": "基裏巴斯",
"countries.kn": "聖基茨和尼維斯",
"countries.ki": "吉里巴斯",
"countries.kn": "聖克里斯多福及尼維斯",
"countries.kr": "韓國",
"countries.kw": "科威特",
"countries.la": "老撾",
"countries.la": "寮國",
"countries.lb": "黎巴嫩",
"countries.lr": "利比裏亞",
"countries.lr": "賴比瑞亞",
"countries.ly": "利比亞",
"countries.lc": "聖西亞",
"countries.li": "列支敦登",
"countries.lk": "斯蘭卡",
"countries.ls": "索托",
"countries.lc": "聖西亞",
"countries.li": "列支敦登",
"countries.lk": "斯蘭卡",
"countries.ls": "索托",
"countries.lt": "立陶宛",
"countries.lu": "盧森堡",
"countries.lv": "拉脫維亞",
@@ -138,90 +144,90 @@
"countries.mc": "摩納哥",
"countries.md": "摩爾多瓦",
"countries.mg": "馬達加斯加",
"countries.mv": "馬爾夫",
"countries.mv": "馬爾夫",
"countries.mx": "墨西哥",
"countries.mh": "馬紹爾群島",
"countries.mk": "馬其頓共和國",
"countries.ml": "馬",
"countries.mt": "馬他",
"countries.ml": "馬",
"countries.mt": "馬他",
"countries.mm": "緬甸",
"countries.me": "黑山",
"countries.me": "蒙特內哥羅",
"countries.mn": "蒙古",
"countries.mz": "莫比克",
"countries.mr": "毛裏塔尼亞",
"countries.mu": "毛裏求斯",
"countries.mw": "馬拉",
"countries.mz": "莫比克",
"countries.mr": "茅利塔尼亞",
"countries.mu": "模里西斯",
"countries.mw": "馬拉",
"countries.my": "馬來西亞",
"countries.na": "納米比亞",
"countries.ne": "尼日",
"countries.ng": "尼日利亞",
"countries.ne": "尼日",
"countries.ng": "奈及利亞",
"countries.ni": "尼加拉瓜",
"countries.nl": "荷蘭",
"countries.no": "挪威",
"countries.np": "尼泊爾",
"countries.nr": "魯",
"countries.nz": "西蘭",
"countries.nr": "魯",
"countries.nz": "西蘭",
"countries.om": "阿曼",
"countries.pk": "巴基斯坦",
"countries.pa": "巴拿馬",
"countries.pe": "秘魯",
"countries.ph": "菲律賓",
"countries.pw": "帕勞",
"countries.pg": "巴布亞幾內亞",
"countries.pw": "帛琉",
"countries.pg": "巴布亞幾內亞",
"countries.pl": "波蘭",
"countries.kp": "北朝鮮",
"countries.kp": "北",
"countries.pt": "葡萄牙",
"countries.py": "巴拉圭",
"countries.qa": "卡塔爾",
"countries.qa": "卡",
"countries.ro": "羅馬尼亞",
"countries.ru": "俄羅斯",
"countries.rw": "盧達",
"countries.sa": "沙阿拉伯",
"countries.rw": "盧達",
"countries.sa": "沙烏地阿拉伯",
"countries.sd": "蘇丹",
"countries.sn": "塞內加爾",
"countries.sg": "新加坡",
"countries.sb": "羅門群島",
"countries.sl": "塞拉利昂",
"countries.sb": "羅門群島",
"countries.sl": "獅子山",
"countries.sv": "薩爾瓦多",
"countries.sm": "聖馬諾",
"countries.so": "索馬",
"countries.sm": "聖馬諾",
"countries.so": "索馬利亞",
"countries.rs": "塞爾維亞",
"countries.ss": "南蘇丹",
"countries.st": "聖多美普林西比",
"countries.sr": "蘇南",
"countries.st": "聖多美普林西比",
"countries.sr": "蘇南",
"countries.sk": "斯洛伐克",
"countries.si": "斯洛尼亞",
"countries.si": "斯洛尼亞",
"countries.se": "瑞典",
"countries.sz": "斯威士蘭",
"countries.sc": "塞爾",
"countries.sz": "史瓦帝尼",
"countries.sc": "塞爾",
"countries.sy": "敘利亞",
"countries.td": "乍得",
"countries.td": "查德",
"countries.tg": "多哥",
"countries.th": "泰國",
"countries.tj": "塔吉克斯坦",
"countries.tm": "土庫曼斯坦",
"countries.tj": "塔吉克",
"countries.tm": "土庫曼",
"countries.tl": "東帝汶",
"countries.to": "加",
"countries.tt": "特立尼達和多巴哥",
"countries.tn": "突尼",
"countries.to": "加",
"countries.tt": "千里達及托巴哥",
"countries.tn": "突尼西亞",
"countries.tr": "土耳其",
"countries.tv": "圖瓦盧",
"countries.tz": "坦尼亞",
"countries.ug": "烏達",
"countries.tv": "吐瓦魯",
"countries.tz": "坦尼亞",
"countries.ug": "烏達",
"countries.ua": "烏克蘭",
"countries.uy": "烏拉圭",
"countries.us": "美國",
"countries.uz": "烏茲別克",
"countries.uz": "烏茲別克",
"countries.va": "梵蒂岡",
"countries.vc": "聖文森特和格林納丁斯",
"countries.vc": "聖文森及格瑞那丁",
"countries.ve": "委內瑞拉",
"countries.vn": "越南",
"countries.vu": "瓦努阿圖",
"countries.vu": "萬那杜",
"countries.ws": "薩摩亞",
"countries.ye": "門",
"countries.ye": "門",
"countries.za": "南非",
"countries.zm": "比亞",
"countries.zw": "津巴布韋",
"countries.zm": "比亞",
"countries.zw": "辛巴威",
"continents.af": "非洲",
"continents.an": "南極洲",
"continents.as": "亞洲",
@@ -229,4 +235,4 @@
"continents.na": "北美洲",
"continents.oc": "大洋洲",
"continents.sa": "南美洲"
}
}
+99 -38
View File
@@ -11,11 +11,11 @@ return [
'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.',
'enabled' => true,
'beta' => false,
'languages' => [ // TODO change key to 'sdks'
'sdks' => [
[
'key' => 'web',
'name' => 'Web',
'version' => '10.1.0',
'version' => '11.0.0',
'url' => 'https://github.com/appwrite/sdk-for-web',
'package' => 'https://www.npmjs.com/package/appwrite',
'enabled' => true,
@@ -63,7 +63,7 @@ return [
[
'key' => 'flutter',
'name' => 'Flutter',
'version' => '8.1.0',
'version' => '9.0.0',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'package' => 'https://pub.dev/packages/appwrite',
'enabled' => true,
@@ -81,7 +81,7 @@ return [
[
'key' => 'apple',
'name' => 'Apple',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-apple',
'package' => 'https://github.com/appwrite/sdk-for-apple',
'enabled' => true,
@@ -116,7 +116,7 @@ return [
[
'key' => 'android',
'name' => 'Android',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-android',
'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android',
'enabled' => true,
@@ -135,21 +135,44 @@ return [
'Java' => 'java',
],
],
// [
// 'key' => 'java',
// 'name' => 'Java',
// 'url' => '',
// 'enabled' => false,
// 'beta' => false,
// 'dev' => false,
// 'hidden' => false,
// 'family' => APP_PLATFORM_CLIENT,
// 'prism' => 'java',
// 'source' => false,
// 'gitUrl' => 'git@github.com:appwrite/sdk-for-java.git',
// 'gitRepoName' => 'sdk-for-java',
// 'gitUserName' => 'appwrite',
// ],
[
'key' => 'graphql',
'name' => 'GraphQL',
'version' => 'October 2021',
'url' => '',
'package' => '',
'enabled' => true,
'beta' => false,
'dev' => false,
'hidden' => true,
'family' => APP_PLATFORM_CLIENT,
'prism' => 'graphql',
'source' => \realpath(__DIR__ . '/../sdks/client-graphql'),
'gitUrl' => '',
'gitRepoName' => '',
'gitUserName' => '',
'gitBranch' => '',
'isSDK' => false,
],
[
'key' => 'rest',
'name' => 'REST',
'version' => '',
'url' => '',
'package' => '',
'enabled' => true,
'beta' => false,
'dev' => false,
'hidden' => true,
'family' => APP_PLATFORM_CLIENT,
'prism' => 'http',
'source' => \realpath(__DIR__ . '/../sdks/client-rest'),
'gitUrl' => '',
'gitRepoName' => '',
'gitUserName' => '',
'gitBranch' => '',
'isSDK' => false,
],
],
],
@@ -158,11 +181,11 @@ return [
'name' => 'Console',
'enabled' => false,
'beta' => false,
'languages' => [
'sdks' => [
[
'key' => 'web',
'name' => 'Console',
'version' => '7.1.0',
'version' => '0.1.0',
'url' => 'https://github.com/appwrite/sdk-for-console',
'package' => '',
'enabled' => true,
@@ -170,17 +193,17 @@ return [
'dev' => false,
'hidden' => true,
'family' => APP_PLATFORM_CONSOLE,
'prism' => 'console',
'prism' => 'javascript',
'source' => \realpath(__DIR__ . '/../sdks/console-web'),
'gitUrl' => null,
'gitBranch' => null,
'gitUrl' => 'git@github.com:appwrite/sdk-for-console.git',
'gitBranch' => 'main',
'gitRepoName' => 'sdk-for-console',
'gitUserName' => 'appwrite',
],
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '1.1.1',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://www.npmjs.com/package/appwrite-cli',
'enabled' => true,
@@ -204,11 +227,11 @@ return [
'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.',
'enabled' => true,
'beta' => false,
'languages' => [
'sdks' => [
[
'key' => 'nodejs',
'name' => 'Node.js',
'version' => '8.1.0',
'version' => '9.0.0',
'url' => 'https://github.com/appwrite/sdk-for-node',
'package' => 'https://www.npmjs.com/package/node-appwrite',
'enabled' => true,
@@ -226,7 +249,7 @@ return [
[
'key' => 'deno',
'name' => 'Deno',
'version' => '6.1.0',
'version' => '7.0.0',
'url' => 'https://github.com/appwrite/sdk-for-deno',
'package' => 'https://deno.land/x/appwrite',
'enabled' => true,
@@ -244,7 +267,7 @@ return [
[
'key' => 'php',
'name' => 'PHP',
'version' => '7.1.0',
'version' => '8.0.0',
'url' => 'https://github.com/appwrite/sdk-for-php',
'package' => 'https://packagist.org/packages/appwrite/appwrite',
'enabled' => true,
@@ -262,7 +285,7 @@ return [
[
'key' => 'python',
'name' => 'Python',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-python',
'package' => 'https://pypi.org/project/appwrite/',
'enabled' => true,
@@ -280,7 +303,7 @@ return [
[
'key' => 'ruby',
'name' => 'Ruby',
'version' => '7.1.0',
'version' => '8.0.0',
'url' => 'https://github.com/appwrite/sdk-for-ruby',
'package' => 'https://rubygems.org/gems/appwrite',
'enabled' => true,
@@ -298,7 +321,7 @@ return [
[
'key' => 'go',
'name' => 'Go',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-go',
'package' => '',
'enabled' => false,
@@ -316,7 +339,7 @@ return [
[
'key' => 'java',
'name' => 'Java',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-java',
'package' => '',
'enabled' => false,
@@ -334,7 +357,7 @@ return [
[
'key' => 'dotnet',
'name' => '.NET',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-dotnet',
'package' => 'https://www.nuget.org/packages/Appwrite',
'enabled' => false,
@@ -352,7 +375,7 @@ return [
[
'key' => 'dart',
'name' => 'Dart',
'version' => '7.1.0',
'version' => '8.0.0',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => 'https://pub.dev/packages/dart_appwrite',
'enabled' => true,
@@ -370,7 +393,7 @@ return [
[
'key' => 'kotlin',
'name' => 'Kotlin',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-kotlin',
'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin',
'enabled' => true,
@@ -392,7 +415,7 @@ return [
[
'key' => 'swift',
'name' => 'Swift',
'version' => '1.1.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-swift',
'package' => 'https://github.com/appwrite/sdk-for-swift',
'enabled' => true,
@@ -407,6 +430,44 @@ return [
'gitUserName' => 'appwrite',
'gitBranch' => 'main',
],
[
'key' => 'graphql',
'name' => 'GraphQL',
'version' => 'October 2021',
'url' => '',
'package' => '',
'enabled' => true,
'beta' => false,
'dev' => false,
'hidden' => true,
'family' => APP_PLATFORM_SERVER,
'prism' => 'graphql',
'source' => \realpath(__DIR__ . '/../sdks/server-graphql'),
'gitUrl' => '',
'gitRepoName' => '',
'gitUserName' => '',
'gitBranch' => '',
'isSDK' => false,
],
[
'key' => 'rest',
'name' => 'REST',
'version' => '',
'url' => '',
'package' => '',
'enabled' => true,
'beta' => false,
'dev' => false,
'hidden' => true,
'family' => APP_PLATFORM_SERVER,
'prism' => 'http',
'source' => \realpath(__DIR__ . '/../sdks/server-rest'),
'gitUrl' => '',
'gitRepoName' => '',
'gitUserName' => '',
'gitBranch' => '',
'isSDK' => false,
],
],
],
];
+4 -1
View File
@@ -6,6 +6,7 @@ $member = [
'public',
'home',
'console',
'graphql',
'account',
'teams.read',
'teams.write',
@@ -22,6 +23,7 @@ $member = [
];
$admins = [
'graphql',
'teams.read',
'teams.write',
'documents.read',
@@ -58,6 +60,7 @@ return [
'public',
'home',
'console',
'graphql',
'documents.read',
'documents.write',
'files.read',
@@ -85,6 +88,6 @@ return [
],
Auth::USER_ROLE_APPS => [
'label' => 'Applications',
'scopes' => ['health.read'],
'scopes' => ['health.read', 'graphql'],
],
];
+23 -10
View File
@@ -1,9 +1,9 @@
<?php
return [
'/' => [
'key' => 'homepage',
'name' => 'Homepage',
'web/home' => [
'key' => 'web/home',
'name' => 'Home',
'subtitle' => '',
'description' => '',
'controller' => 'web/home.php',
@@ -14,8 +14,8 @@ return [
'optional' => false,
'icon' => '',
],
'console' => [
'key' => 'console',
'web/console' => [
'key' => 'web/console',
'name' => 'Console',
'subtitle' => '',
'description' => '',
@@ -176,13 +176,26 @@ return [
'graphql' => [
'key' => 'graphql',
'name' => 'GraphQL',
'subtitle' => 'Appwrite\'s GraphQL Endpoint',
'description' => 'GraphQL Endpoint',
'subtitle' => 'The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.',
'description' => '/docs/services/graphql.md',
'controller' => 'api/graphql.php',
'sdk' => false,
'docs' => false,
'docsUrl' => '',
'sdk' => true,
'docs' => true,
'docsUrl' => 'https://appwrite.io/docs/graphql',
'tests' => true,
'optional' => true,
'icon' => '/images/services/graphql.png',
],
'console' => [
'key' => 'console',
'name' => 'Console',
'subtitle' => 'The Console service allows you to interact with console relevant informations.',
'description' => '',
'controller' => 'api/console.php',
'sdk' => true,
'docs' => true,
'docsUrl' => '',
'tests' => false,
'optional' => false,
'icon' => '',
],
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
+36 -3
View File
@@ -482,9 +482,9 @@ return [
],
[
'name' => '_APP_STORAGE_DEVICE',
'description' => 'Select default storage device. The default value is \'Local\'. List of supported adapters are \'Local\', \'S3\', \'DOSpaces\', \'Backblaze\', \'Linode\' and \'Wasabi\'.',
'description' => 'Select default storage device. The default value is \'local\'. List of supported adapters are \'local\', \'s3\', \'dospaces\', \'backblaze\', \'linode\' and \'wasabi\'.',
'introduction' => '0.13.0',
'default' => 'Local',
'default' => 'local',
'required' => false,
'question' => '',
],
@@ -764,7 +764,7 @@ return [
],
[
'name' => '_APP_FUNCTIONS_INACTIVE_THRESHOLD',
'description' => 'The minimum time a function can be inactive before it\'s container is shutdown and put to sleep. The default value is 60 seconds',
'description' => 'The minimum time a function must be inactive before it can be shut down and cleaned up. This feature is intended to clean up unused containers. Containers may remain active for longer than the interval before being shut down, as Appwrite only cleans up unused containers every hour. If no value is provided, the default is 60 seconds.',
'introduction' => '0.13.0',
'default' => '60',
'required' => false,
@@ -869,4 +869,37 @@ return [
],
],
],
[
'category' => 'GraphQL',
'description' => '',
'variables' => [
[
'name' => '_APP_GRAPHQL_MAX_BATCH_SIZE',
'description' => 'Maximum number of batched queries per request. The default value is 10.',
'introduction' => '1.2.0',
'default' => '10',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_GRAPHQL_MAX_COMPLEXITY',
'description' => 'Maximum complexity of a GraphQL query. One field adds one to query complexity. Lists multiply the complexity by the number of items requested. The default value is 250.',
'introduction' => '1.2.0',
'default' => '250',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_GRAPHQL_MAX_DEPTH',
'description' => 'Maximum depth of a GraphQL query. One nested field level adds one to query depth. The default value is 3.',
'introduction' => '1.2.0',
'default' => '3',
'required' => false,
'question' => '',
'filter' => ''
],
],
],
];
+207 -61
View File
@@ -10,8 +10,8 @@ use Appwrite\Event\Mail;
use Appwrite\Event\Phone as EventPhone;
use Appwrite\Extend\Exception;
use Appwrite\Network\Validator\Email;
use Appwrite\Network\Validator\Host;
use Appwrite\Network\Validator\URL;
use Utopia\Validator\Host;
use Utopia\Validator\URL;
use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Template\Template;
use Appwrite\URL\URL as URLParser;
@@ -29,10 +29,10 @@ use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\DateTime;
use Utopia\Database\Exception\Duplicate;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Query;
use Utopia\Database\Role;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\UID;
use Utopia\Locale\Locale;
@@ -40,6 +40,8 @@ use Utopia\Validator\ArrayList;
use Utopia\Validator\Assoc;
use Utopia\Validator\Text;
use Utopia\Validator\WhiteList;
use Appwrite\Auth\Validator\PasswordHistory;
use Appwrite\Auth\Validator\PasswordDictionary;
$oauthDefaultSuccess = '/auth/oauth2/success';
$oauthDefaultFailure = '/auth/oauth2/failure';
@@ -60,11 +62,11 @@ App::post('/v1/account')
->label('sdk.description', '/docs/references/account/create.md')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->label('sdk.response.model', Response::MODEL_USER)
->label('abuse-limit', 10)
->param('userId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary'])
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('request')
->inject('response')
@@ -72,7 +74,6 @@ App::post('/v1/account')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $project, Database $dbForProject, Event $events) {
$email = \strtolower($email);
if ('console' === $project->getId()) {
$whitelistEmails = $project->getAttribute('authWhitelistEmails');
@@ -97,6 +98,8 @@ App::post('/v1/account')
}
}
$passwordHistory = $project->getAttribute('auths', [])['passwordHistory'] ?? 0;
$password = Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS);
try {
$userId = $userId == 'unique()' ? ID::unique() : $userId;
$user = Authorization::skip(fn() => $dbForProject->createDocument('users', new Document([
@@ -109,10 +112,11 @@ App::post('/v1/account')
'email' => $email,
'emailVerification' => false,
'status' => true,
'password' => Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS),
'password' => $password,
'passwordHistory' => $passwordHistory > 0 ? [$password] : [],
'passwordUpdate' => DateTime::now(),
'hash' => Auth::DEFAULT_ALGO,
'hashOptions' => Auth::DEFAULT_ALGO_OPTIONS,
'passwordUpdate' => DateTime::now(),
'registration' => DateTime::now(),
'reset' => false,
'name' => $name,
@@ -140,7 +144,7 @@ App::post('/v1/account')
App::post('/v1/account/sessions/email')
->alias('/v1/account/sessions')
->desc('Create Email Session')
->groups(['api', 'account', 'auth'])
->groups(['api', 'account', 'auth', 'session'])
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
->label('auth.type', 'emailPassword')
@@ -188,7 +192,7 @@ App::post('/v1/account/sessions/email')
$detector = new Detector($request->getUserAgent('UNKNOWN'));
$record = $geodb->get($request->getIP());
$expire = DateTime::addSeconds(new \DateTime(), $duration);
$expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), $duration));
$secret = Auth::tokenGenerator();
$session = new Document(array_merge(
[
@@ -280,6 +284,12 @@ App::get('/v1/account/sessions/oauth2/:provider')
$protocol = $request->getProtocol();
$callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId();
$providerEnabled = $project->getAttribute('authProviders', [])[$provider . 'Enabled'] ?? false;
if (!$providerEnabled) {
throw new Exception(Exception::PROJECT_PROVIDER_DISABLED, 'This provider is disabled. Please enable the provider from your ' . APP_NAME . ' console to continue.');
}
$appId = $project->getAttribute('authProviders', [])[$provider . 'Appid'] ?? '';
$appSecret = $project->getAttribute('authProviders', [])[$provider . 'Secret'] ?? '{}';
@@ -365,12 +375,13 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
App::get('/v1/account/sessions/oauth2/:provider/redirect')
->desc('OAuth2 Redirect')
->groups(['api', 'account'])
->groups(['api', 'account', 'session'])
->label('error', __DIR__ . '/../../views/general/error.phtml')
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
->label('audits.event', 'session.create')
->label('audits.resource', 'user/{user.$id}')
->label('audits.userId', '{user.$id}')
->label('abuse-limit', 50)
->label('abuse-key', 'ip:{ip}')
->label('docs', false)
@@ -394,6 +405,11 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
$validateURL = new URL();
$appId = $project->getAttribute('authProviders', [])[$provider . 'Appid'] ?? '';
$appSecret = $project->getAttribute('authProviders', [])[$provider . 'Secret'] ?? '{}';
$providerEnabled = $project->getAttribute('authProviders', [])[$provider . 'Enabled'] ?? false;
if (!$providerEnabled) {
throw new Exception(Exception::PROJECT_PROVIDER_DISABLED, 'This provider is disabled. Please enable the provider from your ' . APP_NAME . ' console to continue.');
}
if (!empty($appSecret) && isset($appSecret['version'])) {
$key = App::getEnv('_APP_OPENSSL_KEY_V' . $appSecret['version']);
@@ -489,8 +505,11 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
}
}
$passwordHistory = $project->getAttribute('auths', [])['passwordHistory'] ?? 0;
try {
$userId = ID::unique();
$password = Auth::passwordHash(Auth::passwordGenerator(), Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS);
$user = Authorization::skip(fn() => $dbForProject->createDocument('users', new Document([
'$id' => $userId,
'$permissions' => [
@@ -501,7 +520,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
'email' => $email,
'emailVerification' => true,
'status' => true, // Email should already be authenticated by OAuth2 provider
'password' => Auth::passwordHash(Auth::passwordGenerator(), Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS),
'passwordHistory' => $passwordHistory > 0 ? [$password] : null,
'password' => $password,
'hash' => Auth::DEFAULT_ALGO,
'hashOptions' => Auth::DEFAULT_ALGO_OPTIONS,
'passwordUpdate' => null,
@@ -621,7 +641,7 @@ App::post('/v1/account/sessions/magic-url')
->label('sdk.response.model', Response::MODEL_TOKEN)
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
->param('userId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('url', '', fn($clients) => new Host($clients), 'URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients'])
->inject('request')
@@ -713,11 +733,33 @@ App::post('/v1/account/sessions/magic-url')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $loginSecret, 'expire' => $expire, 'project' => $project->getId()]);
$url = Template::unParseURL($url);
$from = $project->isEmpty() || $project->getId() === 'console' ? '' : \sprintf($locale->getText('emails.sender'), $project->getAttribute('name'));
$body = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-base.tpl');
$subject = $locale->getText("emails.magicSession.subject");
$body
->setParam('{{subject}}', $subject)
->setParam('{{hello}}', $locale->getText("emails.magicSession.hello"))
->setParam('{{name}}', '')
->setParam('{{body}}', $locale->getText("emails.magicSession.body"))
->setParam('{{redirect}}', $url)
->setParam('{{footer}}', $locale->getText("emails.magicSession.footer"))
->setParam('{{thanks}}', $locale->getText("emails.magicSession.thanks"))
->setParam('{{signature}}', $locale->getText("emails.magicSession.signature"))
->setParam('{{project}}', $project->getAttribute('name'))
->setParam('{{direction}}', $locale->getText('settings.direction'))
->setParam('{{bg-body}}', '#f7f7f7')
->setParam('{{bg-content}}', '#ffffff')
->setParam('{{text-content}}', '#000000');
$body = $body->render();
$mails
->setType(MAIL_TYPE_MAGIC_SESSION)
->setSubject($subject)
->setBody($body)
->setFrom($from)
->setRecipient($user->getAttribute('email'))
->setUrl($url)
->setLocale($locale->default)
->trigger()
;
@@ -739,7 +781,7 @@ App::post('/v1/account/sessions/magic-url')
App::put('/v1/account/sessions/magic-url')
->desc('Create Magic URL session (confirmation)')
->groups(['api', 'account'])
->groups(['api', 'account', 'session'])
->label('scope', 'public')
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('audits.event', 'session.update')
@@ -876,7 +918,7 @@ App::post('/v1/account/sessions/phone')
->label('sdk.response.model', Response::MODEL_TOKEN)
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
->param('userId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.')
->inject('request')
->inject('response')
@@ -981,7 +1023,7 @@ App::post('/v1/account/sessions/phone')
App::put('/v1/account/sessions/phone')
->desc('Create Phone Session (confirmation)')
->groups(['api', 'account'])
->groups(['api', 'account', 'session'])
->label('scope', 'public')
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('usage.metric', 'sessions.{scope}.requests.create')
@@ -1096,7 +1138,7 @@ App::put('/v1/account/sessions/phone')
App::post('/v1/account/sessions/anonymous')
->desc('Create Anonymous Session')
->groups(['api', 'account', 'auth'])
->groups(['api', 'account', 'auth', 'session'])
->label('event', 'users.[userId].sessions.[sessionId].create')
->label('scope', 'public')
->label('auth.type', 'anonymous')
@@ -1286,7 +1328,9 @@ App::get('/v1/account')
->label('sdk.description', '/docs/references/account/get.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->label('sdk.response.model', Response::MODEL_USER)
->label('sdk.offline.model', '/account')
->label('sdk.offline.key', 'current')
->inject('response')
->inject('user')
->action(function (Response $response, Document $user) {
@@ -1306,11 +1350,13 @@ App::get('/v1/account/prefs')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PREFERENCES)
->label('sdk.offline.model', '/account/prefs')
->label('sdk.offline.key', 'current')
->inject('response')
->inject('user')
->action(function (Response $response, Document $user) {
$prefs = $user->getAttribute('prefs', new \stdClass());
$prefs = $user->getAttribute('prefs', []);
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
});
@@ -1327,6 +1373,7 @@ App::get('/v1/account/sessions')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_SESSION_LIST)
->label('sdk.offline.model', '/account/sessions')
->inject('response')
->inject('user')
->inject('locale')
@@ -1364,7 +1411,7 @@ App::get('/v1/account/logs')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LOG_LIST)
->param('queries', [], new Queries(new Limit(), new Offset()), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset', true)
->param('queries', [], new Queries(new Limit(), new Offset()), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
->inject('response')
->inject('user')
->inject('locale')
@@ -1425,6 +1472,8 @@ App::get('/v1/account/sessions/:sessionId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_SESSION)
->label('sdk.offline.model', '/account/sessions')
->label('sdk.offline.key', '{sessionId}')
->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.')
->inject('response')
->inject('user')
@@ -1463,6 +1512,7 @@ App::patch('/v1/account/name')
->label('scope', 'account')
->label('audits.event', 'user.update')
->label('audits.resource', 'user/{response.$id}')
->label('audits.userId', '{response.$id}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1470,17 +1520,22 @@ App::patch('/v1/account/name')
->label('sdk.description', '/docs/references/account/update-name.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->label('sdk.response.model', Response::MODEL_USER)
->label('sdk.offline.model', '/account')
->label('sdk.offline.key', 'current')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.')
->inject('requestTimestamp')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $name, Response $response, Document $user, Database $dbForProject, Event $events) {
->action(function (string $name, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
$user = $dbForProject->updateDocument('users', $user->getId(), $user
$user
->setAttribute('name', $name)
->setAttribute('search', implode(' ', [$user->getId(), $name, $user->getAttribute('email', ''), $user->getAttribute('phone', '')])));
->setAttribute('search', implode(' ', [$user->getId(), $name, $user->getAttribute('email', ''), $user->getAttribute('phone', '')]));
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events->setParam('userId', $user->getId());
@@ -1502,25 +1557,46 @@ App::patch('/v1/account/password')
->label('sdk.description', '/docs/references/account/update-password.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->param('password', '', new Password(), 'New user password. Must be at least 8 chars.')
->label('sdk.response.model', Response::MODEL_USER)
->label('sdk.offline.model', '/account')
->label('sdk.offline.key', 'current')
->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary'])
->param('oldPassword', '', new Password(), 'Current user password. Must be at least 8 chars.', true)
->inject('requestTimestamp')
->inject('response')
->inject('user')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $password, string $oldPassword, Response $response, Document $user, Database $dbForProject, Event $events) {
->action(function (string $password, string $oldPassword, ?\DateTime $requestTimestamp, Response $response, Document $user, Document $project, Database $dbForProject, Event $events) {
// 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
throw new Exception(Exception::USER_INVALID_CREDENTIALS);
}
$user = $dbForProject->updateDocument('users', $user->getId(), $user
->setAttribute('password', Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS))
->setAttribute('hash', Auth::DEFAULT_ALGO)
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
->setAttribute('passwordUpdate', DateTime::now()));
$newPassword = Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS);
$historyLimit = $project->getAttribute('auths', [])['passwordHistory'] ?? 0;
$history = [];
if ($historyLimit > 0) {
$history = $user->getAttribute('passwordHistory', []);
$validator = new PasswordHistory($history, $user->getAttribute('hash'), $user->getAttribute('hashOptions'));
if (!$validator->isValid($password)) {
throw new Exception(Exception::USER_PASSWORD_RECENTLY_USED, 'The password was recently used', 409);
}
$history[] = $newPassword;
array_slice($history, (count($history) - $historyLimit), $historyLimit);
}
$user
->setAttribute('password', $newPassword)
->setAttribute('passwordHistory', $history)
->setAttribute('passwordUpdate', DateTime::now())
->setAttribute('hash', Auth::DEFAULT_ALGO)
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events->setParam('userId', $user->getId());
@@ -1534,6 +1610,7 @@ App::patch('/v1/account/email')
->label('scope', 'account')
->label('audits.event', 'user.update')
->label('audits.resource', 'user/{response.$id}')
->label('audits.userId', '{response.$id}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1541,14 +1618,17 @@ App::patch('/v1/account/email')
->label('sdk.description', '/docs/references/account/update-email.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->label('sdk.response.model', Response::MODEL_USER)
->label('sdk.offline.model', '/account')
->label('sdk.offline.key', 'current')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
->inject('requestTimestamp')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $email, string $password, Response $response, Document $user, Database $dbForProject, Event $events) {
->action(function (string $email, string $password, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
$isAnonymousUser = Auth::isAnonymousUser($user); // Check if request is from an anonymous account for converting
if (
@@ -1569,7 +1649,7 @@ App::patch('/v1/account/email')
->setAttribute('search', implode(' ', [$user->getId(), $user->getAttribute('name', ''), $email, $user->getAttribute('phone', '')]));
try {
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
} catch (Duplicate $th) {
throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS);
}
@@ -1586,6 +1666,7 @@ App::patch('/v1/account/phone')
->label('scope', 'account')
->label('audits.event', 'user.update')
->label('audits.resource', 'user/{response.$id}')
->label('audits.userId', '{response.$id}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1593,14 +1674,17 @@ App::patch('/v1/account/phone')
->label('sdk.description', '/docs/references/account/update-phone.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->label('sdk.response.model', Response::MODEL_USER)
->label('sdk.offline.model', '/account')
->label('sdk.offline.key', 'current')
->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.')
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
->inject('requestTimestamp')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (string $phone, string $password, Response $response, Document $user, Database $dbForProject, Event $events) {
->action(function (string $phone, string $password, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
$isAnonymousUser = Auth::isAnonymousUser($user); // Check if request is from an anonymous account for converting
@@ -1617,7 +1701,7 @@ App::patch('/v1/account/phone')
->setAttribute('search', implode(' ', [$user->getId(), $user->getAttribute('name', ''), $user->getAttribute('email', ''), $phone]));
try {
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
} catch (Duplicate $th) {
throw new Exception(Exception::USER_PHONE_ALREADY_EXISTS);
}
@@ -1634,6 +1718,7 @@ App::patch('/v1/account/prefs')
->label('scope', 'account')
->label('audits.event', 'user.update')
->label('audits.resource', 'user/{response.$id}')
->label('audits.userId', '{response.$id}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1641,15 +1726,20 @@ App::patch('/v1/account/prefs')
->label('sdk.description', '/docs/references/account/update-prefs.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->label('sdk.response.model', Response::MODEL_USER)
->label('sdk.offline.model', '/account/prefs')
->label('sdk.offline.key', 'current')
->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.')
->inject('requestTimestamp')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (array $prefs, Response $response, Document $user, Database $dbForProject, Event $events) {
->action(function (array $prefs, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
$user = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('prefs', $prefs));
$user->setAttribute('prefs', $prefs);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events->setParam('userId', $user->getId());
@@ -1663,6 +1753,7 @@ App::patch('/v1/account/status')
->label('scope', 'account')
->label('audits.event', 'user.update')
->label('audits.resource', 'user/{response.$id}')
->label('audits.userId', '{response.$id}')
->label('usage.metric', 'users.{scope}.requests.delete')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1670,15 +1761,17 @@ App::patch('/v1/account/status')
->label('sdk.description', '/docs/references/account/update-status.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ACCOUNT)
->inject('request')
->label('sdk.response.model', Response::MODEL_USER)
->inject('requestTimestamp')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('events')
->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Event $events) {
->action(function (?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $events) {
$user = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('status', false));
$user->setAttribute('status', false);
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
$events
->setParam('userId', $user->getId())
@@ -1698,6 +1791,7 @@ App::delete('/v1/account/sessions/:sessionId')
->label('event', 'users.[userId].sessions.[sessionId].delete')
->label('audits.event', 'session.delete')
->label('audits.resource', 'user/{user.$id}')
->label('audits.userId', '{user.$id}')
->label('usage.metric', 'sessions.{scope}.requests.delete')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1707,6 +1801,7 @@ App::delete('/v1/account/sessions/:sessionId')
->label('sdk.response.model', Response::MODEL_NONE)
->label('abuse-limit', 100)
->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.')
->inject('requestTimestamp')
->inject('request')
->inject('response')
->inject('user')
@@ -1714,7 +1809,7 @@ App::delete('/v1/account/sessions/:sessionId')
->inject('locale')
->inject('events')
->inject('project')
->action(function (?string $sessionId, 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 $events, Document $project) {
$protocol = $request->getProtocol();
$authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
@@ -1726,9 +1821,11 @@ App::delete('/v1/account/sessions/:sessionId')
foreach ($sessions as $key => $session) {/** @var Document $session */
if ($sessionId == $session->getId()) {
unset($sessions[$key]);
$dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $session) {
return $dbForProject->deleteDocument('sessions', $session->getId());
});
$dbForProject->deleteDocument('sessions', $session->getId());
unset($sessions[$key]);
$session->setAttribute('current', false);
@@ -1857,6 +1954,7 @@ App::delete('/v1/account/sessions')
->label('event', 'users.[userId].sessions.[sessionId].delete')
->label('audits.event', 'session.delete')
->label('audits.resource', 'user/{user.$id}')
->label('audits.userId', '{user.$id}')
->label('usage.metric', 'sessions.{scope}.requests.delete')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -1991,12 +2089,35 @@ App::post('/v1/account/recovery')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $profile->getId(), 'secret' => $secret, 'expire' => $expire]);
$url = Template::unParseURL($url);
$projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]');
$from = $project->isEmpty() || $project->getId() === 'console' ? '' : \sprintf($locale->getText('emails.sender'), $projectName);
$body = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-base.tpl');
$subject = $locale->getText("emails.recovery.subject");
$body
->setParam('{{subject}}', $subject)
->setParam('{{hello}}', $locale->getText("emails.recovery.hello"))
->setParam('{{name}}', $profile->getAttribute('name'))
->setParam('{{body}}', $locale->getText("emails.recovery.body"))
->setParam('{{redirect}}', $url)
->setParam('{{footer}}', $locale->getText("emails.recovery.footer"))
->setParam('{{thanks}}', $locale->getText("emails.recovery.thanks"))
->setParam('{{signature}}', $locale->getText("emails.recovery.signature"))
->setParam('{{project}}', $projectName)
->setParam('{{direction}}', $locale->getText('settings.direction'))
->setParam('{{bg-body}}', '#f7f7f7')
->setParam('{{bg-content}}', '#ffffff')
->setParam('{{text-content}}', '#000000');
$body = $body->render();
$mails
->setType(MAIL_TYPE_RECOVERY)
->setRecipient($profile->getAttribute('email', ''))
->setUrl($url)
->setLocale($locale->default)
->setName($profile->getAttribute('name'))
->setBody($body)
->setFrom($from)
->setSubject($subject)
->trigger();
;
@@ -2065,9 +2186,9 @@ App::put('/v1/account/recovery')
$profile = $dbForProject->updateDocument('users', $profile->getId(), $profile
->setAttribute('password', Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS))
->setAttribute('passwordUpdate', DateTime::now())
->setAttribute('hash', Auth::DEFAULT_ALGO)
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
->setAttribute('passwordUpdate', DateTime::now())
->setAttribute('emailVerification', true));
$recoveryDocument = $dbForProject->getDocument('tokens', $recovery);
@@ -2094,6 +2215,7 @@ App::post('/v1/account/verification')
->label('event', 'users.[userId].verification.[tokenId].create')
->label('audits.event', 'verification.create')
->label('audits.resource', 'user/{response.userId}')
->label('audits.userId', '{response.userId}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -2151,11 +2273,32 @@ App::post('/v1/account/verification')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $verificationSecret, 'expire' => $expire]);
$url = Template::unParseURL($url);
$projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]');
$from = $project->isEmpty() || $project->getId() === 'console' ? '' : \sprintf($locale->getText('emails.sender'), $projectName);
$body = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-base.tpl');
$subject = $locale->getText("emails.verification.subject");
$body
->setParam('{{subject}}', $subject)
->setParam('{{hello}}', $locale->getText("emails.verification.hello"))
->setParam('{{name}}', $user->getAttribute('name'))
->setParam('{{body}}', $locale->getText("emails.verification.body"))
->setParam('{{redirect}}', $url)
->setParam('{{footer}}', $locale->getText("emails.verification.footer"))
->setParam('{{thanks}}', $locale->getText("emails.verification.thanks"))
->setParam('{{signature}}', $locale->getText("emails.verification.signature"))
->setParam('{{project}}', $projectName)
->setParam('{{direction}}', $locale->getText('settings.direction'))
->setParam('{{bg-body}}', '#f7f7f7')
->setParam('{{bg-content}}', '#ffffff')
->setParam('{{text-content}}', '#000000');
$body = $body->render();
$mails
->setType(MAIL_TYPE_VERIFICATION)
->setSubject($subject)
->setBody($body)
->setFrom($from)
->setRecipient($user->getAttribute('email'))
->setUrl($url)
->setLocale($locale->default)
->setName($user->getAttribute('name'))
->trigger()
;
@@ -2184,6 +2327,7 @@ App::put('/v1/account/verification')
->label('event', 'users.[userId].verification.[tokenId].update')
->label('audits.event', 'verification.update')
->label('audits.resource', 'user/{response.userId}')
->label('audits.userId', '{response.userId}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -2243,6 +2387,7 @@ App::post('/v1/account/verification/phone')
->label('event', 'users.[userId].verification.[tokenId].create')
->label('audits.event', 'verification.create')
->label('audits.resource', 'user/{response.userId}')
->label('audits.userId', '{response.userId}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
@@ -2328,6 +2473,7 @@ App::put('/v1/account/verification/phone')
->label('event', 'users.[userId].verification.[tokenId].update')
->label('audits.event', 'verification.update')
->label('audits.resource', 'user/{response.userId}')
->label('audits.userId', '{response.userId}')
->label('usage.metric', 'users.{scope}.requests.update')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
+3 -3
View File
@@ -1,7 +1,7 @@
<?php
use Appwrite\Extend\Exception;
use Appwrite\Network\Validator\URL;
use Utopia\Validator\URL;
use Appwrite\URL\URL as URLParse;
use Appwrite\Utopia\Response;
use chillerlan\QRCode\QRCode;
@@ -242,8 +242,8 @@ App::get('/v1/avatars/favicon')
case 'jpeg':
$size = \explode('x', \strtolower($sizes));
$sizeWidth = (int) $size[0] ?? 0;
$sizeHeight = (int) $size[1] ?? 0;
$sizeWidth = (int) ($size[0] ?? 0);
$sizeHeight = (int) ($size[1] ?? 0);
if (($sizeWidth * $sizeHeight) >= $space) {
$space = $sizeWidth * $sizeHeight;
+40
View File
@@ -0,0 +1,40 @@
<?php
use Appwrite\Extend\Exception;
use Appwrite\Utopia\Response;
use Utopia\App;
use Utopia\Database\Document;
App::init()
->groups(['console'])
->inject('project')
->action(function (Document $project) {
if ($project->getId() !== 'console') {
throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN);
}
});
App::get('/v1/console/variables')
->desc('Get Variables')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
->label('sdk.namespace', 'console')
->label('sdk.method', 'variables')
->label('sdk.description', '/docs/references/console/variables.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_CONSOLE_VARIABLES)
->inject('response')
->action(function (Response $response) {
$variables = new Document([
'_APP_DOMAIN_TARGET' => App::getEnv('_APP_DOMAIN_TARGET'),
'_APP_STORAGE_LIMIT' => +App::getEnv('_APP_STORAGE_LIMIT'),
'_APP_FUNCTIONS_SIZE_LIMIT' => +App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT'),
'_APP_USAGE_STATS' => App::getEnv('_APP_USAGE_STATS'),
]);
$response->dynamic($variables, Response::MODEL_CONSOLE_VARIABLES);
});
File diff suppressed because it is too large Load Diff
+22 -18
View File
@@ -9,9 +9,9 @@ use Appwrite\Event\Func;
use Appwrite\Event\Validator\Event as ValidatorEvent;
use Appwrite\Extend\Exception;
use Appwrite\Utopia\Database\Validator\CustomId;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Role;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Validator\UID;
use Appwrite\Usage\Stats;
use Utopia\Storage\Device;
@@ -25,7 +25,6 @@ use Appwrite\Task\Validator\Cron;
use Appwrite\Utopia\Database\Validator\Queries\Deployments;
use Appwrite\Utopia\Database\Validator\Queries\Executions;
use Appwrite\Utopia\Database\Validator\Queries\Functions;
use Appwrite\Utopia\Database\Validator\Queries\Variables;
use Utopia\App;
use Utopia\Database\Database;
use Utopia\Database\Document;
@@ -33,7 +32,6 @@ use Utopia\Database\DateTime;
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
use Utopia\Validator\ArrayList;
use Utopia\Validator\Assoc;
use Utopia\Validator\Text;
use Utopia\Validator\Range;
use Utopia\Validator\WhiteList;
@@ -61,9 +59,9 @@ App::post('/v1/functions')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FUNCTION)
->param('functionId', '', new CustomId(), 'Function ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.')
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true)
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.')
->param('events', [], new ArrayList(new ValidatorEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
@@ -125,7 +123,7 @@ App::get('/v1/functions')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FUNCTION_LIST)
->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -440,7 +438,7 @@ App::put('/v1/functions/:functionId')
->label('sdk.response.model', Response::MODEL_FUNCTION)
->param('functionId', '', new UID(), 'Function ID.')
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.')
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true)
->param('events', [], new ArrayList(new ValidatorEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Maximum execution time in seconds.', true)
@@ -601,8 +599,8 @@ App::post('/v1/functions/:functionId/deployments')
->label('sdk.response.model', Response::MODEL_DEPLOYMENT)
->param('functionId', '', new UID(), 'Function ID.')
->param('entrypoint', '', new Text('1028'), 'Entrypoint File.')
->param('code', [], new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', false)
->param('activate', false, new Boolean(true), 'Automatically activate the deployment when it is finished building.', false)
->param('code', [], new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', skipValidation: true)
->param('activate', false, new Boolean(true), 'Automatically activate the deployment when it is finished building.')
->inject('request')
->inject('response')
->inject('dbForProject')
@@ -619,14 +617,20 @@ App::post('/v1/functions/:functionId/deployments')
}
$file = $request->getFiles('code');
$fileExt = new FileExt([FileExt::TYPE_GZIP]);
$fileSizeValidator = new FileSize(App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', 0));
$upload = new Upload();
// GraphQL multipart spec adds files with index keys
if (empty($file)) {
$file = $request->getFiles(0);
}
if (empty($file)) {
throw new Exception(Exception::STORAGE_FILE_EMPTY, 'No file sent');
}
$fileExt = new FileExt([FileExt::TYPE_GZIP]);
$fileSizeValidator = new FileSize(App::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', 0));
$upload = new Upload();
// Make sure we handle a single file and multiple files the same way
$fileName = (\is_array($file['name']) && isset($file['name'][0])) ? $file['name'][0] : $file['name'];
$fileTmpName = (\is_array($file['tmp_name']) && isset($file['tmp_name'][0])) ? $file['tmp_name'][0] : $file['tmp_name'];
@@ -785,7 +789,7 @@ App::get('/v1/functions/:functionId/deployments')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST)
->param('functionId', '', new UID(), 'Function ID.')
->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -1217,7 +1221,7 @@ App::get('/v1/functions/:functionId/executions')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_EXECUTION_LIST)
->param('functionId', '', new UID(), 'Function ID.')
->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -1342,7 +1346,7 @@ App::post('/v1/functions/:functionId/variables')
->label('sdk.response.model', Response::MODEL_VARIABLE)
->param('functionId', '', new UID(), 'Function unique ID.', false)
->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false)
->param('value', null, new Text(8192), 'Variable value. Max length: 8192 chars.', false)
->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false)
->inject('response')
->inject('dbForProject')
->action(function (string $functionId, string $key, string $value, Response $response, Database $dbForProject) {
@@ -1458,7 +1462,7 @@ App::put('/v1/functions/:functionId/variables/:variableId')
->param('functionId', '', new UID(), 'Function unique ID.', false)
->param('variableId', '', new UID(), 'Variable unique ID.', false)
->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false)
->param('value', null, new Text(8192), 'Variable value. Max length: 8192 chars.', true)
->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', true)
->inject('response')
->inject('dbForProject')
->action(function (string $functionId, string $variableId, string $key, ?string $value, Response $response, Database $dbForProject) {
+288 -15
View File
@@ -1,24 +1,297 @@
<?php
/**
* TODO:
* 1. Map all objects, object-params, object-fields
* 2. Parse GraphQL request payload (use: https://github.com/webonyx/graphql-php)
* 3. Route request to relevant controllers (of REST API?) / resolvers and aggergate data
* 4. Handle errors if any
* 5. Returen JSON response
* 6. Write tests!
*/
use Appwrite\Extend\Exception;
use Appwrite\GraphQL\Promises\Adapter;
use Appwrite\GraphQL\Schema;
use Appwrite\Utopia\Request;
use Appwrite\Utopia\Response;
use GraphQL\Error\DebugFlag;
use GraphQL\GraphQL;
use GraphQL\Type\Schema as GQLSchema;
use GraphQL\Validator\Rules\DisableIntrospection;
use GraphQL\Validator\Rules\QueryComplexity;
use GraphQL\Validator\Rules\QueryDepth;
use Swoole\Coroutine\WaitGroup;
use Utopia\App;
use Utopia\Database\Document;
use Utopia\Validator\JSON;
use Utopia\Validator\Text;
App::get('/v1/graphql')
->desc('GraphQL Endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'graphql')
->label('sdk.hide', true)
->label('sdk.description', '/docs/references/graphql/get.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ANY)
->label('abuse-limit', 60)
->label('abuse-time', 60)
->param('query', '', new Text(0, 0), 'The query to execute.')
->param('operationName', '', new Text(256), 'The name of the operation to execute.', true)
->param('variables', '', new Text(0), 'The JSON encoded variables to use in the query.', true)
->inject('request')
->inject('response')
->inject('schema')
->inject('promiseAdapter')
->action(function (string $query, string $operationName, string $variables, Request $request, Response $response, GQLSchema $schema, Adapter $promiseAdapter) {
$query = [
'query' => $query,
];
if (!empty($operationName)) {
$query['operationName'] = $operationName;
}
if (!empty($variables)) {
$query['variables'] = \json_decode($variables, true);
}
$output = execute($schema, $promiseAdapter, $query);
$response
->setStatusCode(Response::STATUS_CODE_OK)
->json($output);
});
App::post('/v1/graphql/mutation')
->desc('GraphQL Endpoint')
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'graphql')
->label('sdk.method', 'mutation')
->label('sdk.methodType', 'graphql')
->label('sdk.description', '/docs/references/graphql/post.md')
->label('sdk.parameters', [
'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false],
])
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ANY)
->label('abuse-limit', 60)
->label('abuse-time', 60)
->inject('request')
->inject('response')
->inject('schema')
->inject('promiseAdapter')
->action(function (Request $request, Response $response, GQLSchema $schema, Adapter $promiseAdapter) {
$query = $request->getParams();
if ($request->getHeader('x-sdk-graphql') == 'true') {
$query = $query['query'];
}
$type = $request->getHeader('content-type');
if (\str_starts_with($type, 'application/graphql')) {
$query = parseGraphql($request);
}
if (\str_starts_with($type, 'multipart/form-data')) {
$query = parseMultipart($query, $request);
}
$output = execute($schema, $promiseAdapter, $query);
$response
->setStatusCode(Response::STATUS_CODE_OK)
->json($output);
});
App::post('/v1/graphql')
->desc('GraphQL Endpoint')
->groups(['api', 'graphql'])
->label('scope', 'public')
->action(
function () {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'GraphQL support is coming soon!', 503);
->groups(['graphql'])
->label('scope', 'graphql')
->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'graphql')
->label('sdk.method', 'query')
->label('sdk.methodType', 'graphql')
->label('sdk.description', '/docs/references/graphql/post.md')
->label('sdk.parameters', [
'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false],
])
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ANY)
->label('abuse-limit', 60)
->label('abuse-time', 60)
->inject('request')
->inject('response')
->inject('schema')
->inject('promiseAdapter')
->action(function (Request $request, Response $response, GQLSchema $schema, Adapter $promiseAdapter) {
$query = $request->getParams();
if ($request->getHeader('x-sdk-graphql') == 'true') {
$query = $query['query'];
}
$type = $request->getHeader('content-type');
if (\str_starts_with($type, 'application/graphql')) {
$query = parseGraphql($request);
}
if (\str_starts_with($type, 'multipart/form-data')) {
$query = parseMultipart($query, $request);
}
$output = execute($schema, $promiseAdapter, $query);
$response
->setStatusCode(Response::STATUS_CODE_OK)
->json($output);
});
/**
* Execute a GraphQL request
*
* @param GQLSchema $schema
* @param Adapter $promiseAdapter
* @param array $query
* @return array
* @throws Exception
*/
function execute(
GQLSchema $schema,
Adapter $promiseAdapter,
array $query
): array {
$maxBatchSize = App::getEnv('_APP_GRAPHQL_MAX_BATCH_SIZE', 10);
$maxComplexity = App::getEnv('_APP_GRAPHQL_MAX_COMPLEXITY', 250);
$maxDepth = App::getEnv('_APP_GRAPHQL_MAX_DEPTH', 3);
if (!empty($query) && !isset($query[0])) {
$query = [$query];
}
if (empty($query)) {
throw new Exception(Exception::GRAPHQL_NO_QUERY);
}
if (\count($query) > $maxBatchSize) {
throw new Exception(Exception::GRAPHQL_TOO_MANY_QUERIES);
}
foreach ($query as $item) {
if (empty($item['query'])) {
throw new Exception(Exception::GRAPHQL_NO_QUERY);
}
}
$flags = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE;
$validations = GraphQL::getStandardValidationRules();
if (App::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') {
$validations[] = new DisableIntrospection();
$validations[] = new QueryComplexity($maxComplexity);
$validations[] = new QueryDepth($maxDepth);
}
if (App::getMode() === App::MODE_TYPE_PRODUCTION) {
$flags = DebugFlag::NONE;
}
$promises = [];
foreach ($query as $indexed) {
$promises[] = GraphQL::promiseToExecute(
$promiseAdapter,
$schema,
$indexed['query'],
variableValues: $indexed['variables'] ?? null,
operationName: $indexed['operationName'] ?? null,
validationRules: $validations
);
}
$output = [];
$wg = new WaitGroup();
$wg->add();
$promiseAdapter->all($promises)->then(
function (array $results) use (&$output, &$wg, $flags) {
try {
$output = processResult($results, $flags);
} finally {
$wg->done();
}
}
);
$wg->wait();
return $output;
}
/**
* Parse an "application/graphql" type request
*
* @param Request $request
* @return array
*/
function parseGraphql(Request $request): array
{
return ['query' => $request->getRawPayload()];
}
/**
* Parse an "multipart/form-data" type request
*
* @param array $query
* @param Request $request
* @return array
*/
function parseMultipart(array $query, Request $request): array
{
$operations = \json_decode($query['operations'], true);
$map = \json_decode($query['map'], true);
foreach ($map as $fileKey => $locations) {
foreach ($locations as $location) {
$items = &$operations;
foreach (\explode('.', $location) as $key) {
if (!isset($items[$key]) || !\is_array($items[$key])) {
$items[$key] = [];
}
$items = &$items[$key];
}
$items = $request->getFiles($fileKey);
}
}
$query['query'] = $operations['query'];
$query['variables'] = $operations['variables'];
unset($query['operations']);
unset($query['map']);
return $query;
}
/**
* Process an array of results for output.
*
* @param $result
* @param $debugFlags
* @return array
*/
function processResult($result, $debugFlags): array
{
// Only one query, return the result
if (!isset($result[1])) {
return $result[0]->toArray($debugFlags);
}
// Batched queries, return an array of results
return \array_map(
static function ($item) use ($debugFlags) {
return $item->toArray($debugFlags);
},
$result
);
}
App::shutdown()
->groups(['schema'])
->inject('project')
->action(function (Document $project) {
Schema::setDirty($project->getId());
});
+14
View File
@@ -19,6 +19,8 @@ App::get('/v1/locale')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LOCALE)
->label('sdk.offline.model', '/locale')
->label('sdk.offline.key', 'current')
->inject('request')
->inject('response')
->inject('locale')
@@ -77,6 +79,8 @@ App::get('/v1/locale/countries')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_COUNTRY_LIST)
->label('sdk.offline.model', '/locale/countries')
->label('sdk.offline.response.key', 'code')
->inject('response')
->inject('locale')
->action(function (Response $response, Locale $locale) {
@@ -108,6 +112,8 @@ App::get('/v1/locale/countries/eu')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_COUNTRY_LIST)
->label('sdk.offline.model', '/locale/countries/eu')
->label('sdk.offline.response.key', 'code')
->inject('response')
->inject('locale')
->action(function (Response $response, Locale $locale) {
@@ -141,6 +147,8 @@ App::get('/v1/locale/countries/phones')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PHONE_LIST)
->label('sdk.offline.model', '/locale/countries/phones')
->label('sdk.offline.response.key', 'countryCode')
->inject('response')
->inject('locale')
->action(function (Response $response, Locale $locale) {
@@ -173,6 +181,8 @@ App::get('/v1/locale/continents')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_CONTINENT_LIST)
->label('sdk.offline.model', '/locale/continents')
->label('sdk.offline.response.key', 'code')
->inject('response')
->inject('locale')
->action(function (Response $response, Locale $locale) {
@@ -203,6 +213,8 @@ App::get('/v1/locale/currencies')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_CURRENCY_LIST)
->label('sdk.offline.model', '/locale/currencies')
->label('sdk.offline.response.key', 'code')
->inject('response')
->action(function (Response $response) {
$list = Config::getParam('locale-currencies');
@@ -224,6 +236,8 @@ App::get('/v1/locale/languages')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LANGUAGE_LIST)
->label('sdk.offline.model', '/locale/languages')
->label('sdk.offline.response.key', 'code')
->inject('response')
->action(function (Response $response) {
$list = Config::getParam('locale-languages');
+104 -12
View File
@@ -6,9 +6,9 @@ use Appwrite\Event\Certificate;
use Appwrite\Event\Delete;
use Appwrite\Event\Validator\Event;
use Appwrite\Network\Validator\CNAME;
use Appwrite\Network\Validator\Domain as DomainValidator;
use Utopia\Validator\Domain as DomainValidator;
use Appwrite\Network\Validator\Origin;
use Appwrite\Network\Validator\URL;
use Utopia\Validator\URL;
use Appwrite\Utopia\Database\Validator\CustomId;
use Appwrite\Utopia\Response;
use Utopia\Abuse\Adapters\TimeLimit;
@@ -17,13 +17,13 @@ use Utopia\Audit\Audit;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\ID;
use Utopia\Database\Helpers\ID;
use Utopia\Database\DateTime;
use Utopia\Database\Permission;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Query;
use Utopia\Database\Role;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\DatetimeValidator;
use Utopia\Database\Validator\Datetime as DatetimeValidator;
use Utopia\Database\Validator\UID;
use Utopia\Domains\Domain;
use Utopia\Registry\Registry;
@@ -32,7 +32,6 @@ use Appwrite\Utopia\Database\Validator\Queries\Projects;
use Utopia\Validator\ArrayList;
use Utopia\Validator\Boolean;
use Utopia\Validator\Hostname;
use Utopia\Validator\Integer;
use Utopia\Validator\Range;
use Utopia\Validator\Text;
use Utopia\Validator\WhiteList;
@@ -56,7 +55,7 @@ App::post('/v1/projects')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT)
->param('projectId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('projectId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('name', null, new Text(128), 'Project name. Max length: 128 chars.')
->param('teamId', '', new UID(), 'Team unique ID.')
->param('region', App::getEnv('_APP_REGION', 'default'), new Whitelist(array_keys(array_filter(Config::getParam('regions'), fn($config) => !$config['disabled']))), 'Project Region.', true)
@@ -81,7 +80,7 @@ App::post('/v1/projects')
}
$auth = Config::getParam('auth', []);
$auths = ['limit' => 0, 'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG];
$auths = ['limit' => 0, 'maxSessions' => APP_LIMIT_USER_SESSIONS_DEFAULT, 'passwordHistory' => 0, 'passwordDictionary' => false, 'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG];
foreach ($auth as $index => $method) {
$auths[$method['key'] ?? ''] = true;
}
@@ -185,7 +184,7 @@ App::get('/v1/projects')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT_LIST)
->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
@@ -576,6 +575,99 @@ App::patch('/v1/projects/:projectId/auth/:method')
$response->dynamic($project, Response::MODEL_PROJECT);
});
App::patch('/v1/projects/:projectId/auth/password-history')
->desc('Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateAuthPasswordHistory')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT)
->param('projectId', '', new UID(), 'Project unique ID.')
->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, int $limit, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);
if ($project->isEmpty()) {
throw new Exception(Exception::PROJECT_NOT_FOUND);
}
$auths = $project->getAttribute('auths', []);
$auths['passwordHistory'] = $limit;
$dbForConsole->updateDocument('projects', $project->getId(), $project
->setAttribute('auths', $auths));
$response->dynamic($project, Response::MODEL_PROJECT);
});
App::patch('/v1/projects/:projectId/auth/password-dictionary')
->desc('Update authentication password disctionary status. Use this endpoint to enable or disable the dicitonary check for user password')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateAuthPasswordDictionary')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT)
->param('projectId', '', new UID(), 'Project unique ID.')
->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, bool $enabled, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);
if ($project->isEmpty()) {
throw new Exception(Exception::PROJECT_NOT_FOUND);
}
$auths = $project->getAttribute('auths', []);
$auths['passwordDictionary'] = $enabled;
$dbForConsole->updateDocument('projects', $project->getId(), $project
->setAttribute('auths', $auths));
$response->dynamic($project, Response::MODEL_PROJECT);
});
App::patch('/v1/projects/:projectId/auth/max-sessions')
->desc('Update Project user sessions limit')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateAuthSessionsLimit')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT)
->param('projectId', '', new UID(), 'Project unique ID.')
->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT)
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, int $limit, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);
if ($project->isEmpty()) {
throw new Exception(Exception::PROJECT_NOT_FOUND);
}
$auths = $project->getAttribute('auths', []);
$auths['maxSessions'] = $limit;
$dbForConsole->updateDocument('projects', $project->getId(), $project
->setAttribute('auths', $auths));
$response->dynamic($project, Response::MODEL_PROJECT);
});
App::delete('/v1/projects/:projectId')
->desc('Delete Project')
->groups(['api', 'projects'])
@@ -1084,7 +1176,7 @@ App::post('/v1/projects/:projectId/platforms')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PLATFORM)
->param('projectId', '', new UID(), 'Project unique ID.')
->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY], true), 'Platform type.')
->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY], true), 'Platform type.')
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
->param('key', '', new Text(256), 'Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.', true)
->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
@@ -1310,7 +1402,7 @@ App::post('/v1/projects/:projectId/domains')
$target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', ''));
if (!$target->isKnown() || $target->isTest()) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Unreachable CNAME target (' . $target->get() . '), please use a domain with a public suffix.');
throw new Exception(Exception::DOMAIN_TARGET_INVALID, 'Unreachable CNAME target (' . $target->get() . '). Please check the _APP_DOMAIN_TARGET environment variable of your Appwrite server.');
}
$domain = new Domain($domain);
+33 -21
View File
@@ -16,10 +16,10 @@ use Utopia\Database\Exception\Duplicate;
use Utopia\Database\Exception\Authorization as AuthorizationException;
use Utopia\Database\Exception\Duplicate as DuplicateException;
use Utopia\Database\Exception\Structure as StructureException;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Query;
use Utopia\Database\Role;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\Permissions;
use Utopia\Database\Validator\UID;
@@ -58,14 +58,14 @@ App::post('/v1/storage/buckets')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_BUCKET)
->param('bucketId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('name', '', new Text(128), 'Bucket name')
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default no user is granted with any permissions. [Learn more about permissions](/docs/permissions).', true)
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions).', true)
->param('fileSecurity', false, new Boolean(true), 'Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](/docs/permissions).', true)
->param('enabled', true, new Boolean(true), 'Is bucket enabled?', true)
->param('maximumFileSize', (int) App::getEnv('_APP_STORAGE_LIMIT', 0), new Range(1, (int) App::getEnv('_APP_STORAGE_LIMIT', 0)), 'Maximum file size allowed in bytes. Maximum allowed value is ' . Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0), 0) . '. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)', true)
->param('maximumFileSize', (int) App::getEnv('_APP_STORAGE_LIMIT', 0), new Range(1, (int) App::getEnv('_APP_STORAGE_LIMIT', 0)), 'Maximum file size allowed in bytes. Maximum allowed value is ' . Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0), 0) . '. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](/docs/environment-variables#storage)', true)
->param('allowedFileExtensions', [], new ArrayList(new Text(64), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Allowed file extensions. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' extensions are allowed, each 64 characters long.', true)
->param('compression', 'none', new WhiteList([COMPRESSION_TYPE_NONE, COMPRESSION_TYPE_GZIP, COMPRESSION_TYPE_ZSTD]), 'Compression algorithm choosen for compression. Can be one of ' . COMPRESSION_TYPE_NONE . ', [' . COMPRESSION_TYPE_GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . COMPRESSION_TYPE_ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true)
->param('compression', COMPRESSION_TYPE_NONE, new WhiteList([COMPRESSION_TYPE_NONE, COMPRESSION_TYPE_GZIP, COMPRESSION_TYPE_ZSTD]), 'Compression algorithm choosen for compression. Can be one of ' . COMPRESSION_TYPE_NONE . ', [' . COMPRESSION_TYPE_GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . COMPRESSION_TYPE_ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true)
->param('encryption', true, new Boolean(true), 'Is encryption enabled? For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' encryption is skipped even if it\'s enabled', true)
->param('antivirus', true, new Boolean(true), 'Is virus scanning enabled? For file size above ' . Storage::human(APP_LIMIT_ANTIVIRUS, 0) . ' AntiVirus scanning is skipped even if it\'s enabled', true)
->inject('response')
@@ -154,7 +154,7 @@ App::get('/v1/storage/buckets')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_BUCKET_LIST)
->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -232,12 +232,12 @@ App::put('/v1/storage/buckets/:bucketId')
->label('sdk.response.model', Response::MODEL_BUCKET)
->param('bucketId', '', new UID(), 'Bucket unique ID.')
->param('name', null, new Text(128), 'Bucket name', false)
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).', true)
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).', true)
->param('fileSecurity', false, new Boolean(true), 'Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](/docs/permissions).', true)
->param('enabled', true, new Boolean(true), 'Is bucket enabled?', true)
->param('maximumFileSize', null, new Range(1, (int) App::getEnv('_APP_STORAGE_LIMIT', 0)), 'Maximum file size allowed in bytes. Maximum allowed value is ' . Storage::human((int)App::getEnv('_APP_STORAGE_LIMIT', 0), 0) . '. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)', true)
->param('maximumFileSize', null, new Range(1, (int) App::getEnv('_APP_STORAGE_LIMIT', 0)), 'Maximum file size allowed in bytes. Maximum allowed value is ' . Storage::human((int)App::getEnv('_APP_STORAGE_LIMIT', 0), 0) . '. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](/docs/environment-variables#storage)', true)
->param('allowedFileExtensions', [], new ArrayList(new Text(64), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Allowed file extensions. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' extensions are allowed, each 64 characters long.', true)
->param('compression', 'none', new WhiteList([COMPRESSION_TYPE_NONE, COMPRESSION_TYPE_GZIP, COMPRESSION_TYPE_ZSTD]), 'Compression algorithm choosen for compression. Can be one of ' . COMPRESSION_TYPE_NONE . ', [' . COMPRESSION_TYPE_GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . COMPRESSION_TYPE_ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true)
->param('compression', COMPRESSION_TYPE_NONE, new WhiteList([COMPRESSION_TYPE_NONE, COMPRESSION_TYPE_GZIP, COMPRESSION_TYPE_ZSTD]), 'Compression algorithm choosen for compression. Can be one of ' . COMPRESSION_TYPE_NONE . ', [' . COMPRESSION_TYPE_GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . COMPRESSION_TYPE_ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true)
->param('encryption', true, new Boolean(true), 'Is encryption enabled? For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' encryption is skipped even if it\'s enabled', true)
->param('antivirus', true, new Boolean(true), 'Is virus scanning enabled? For file size above ' . Storage::human(APP_LIMIT_ANTIVIRUS, 0) . ' AntiVirus scanning is skipped even if it\'s enabled', true)
->inject('response')
@@ -347,9 +347,9 @@ App::post('/v1/storage/buckets/:bucketId/files')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FILE)
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->param('fileId', '', new CustomId(), 'File ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('file', [], new File(), 'Binary file.', false)
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).', true)
->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](/docs/storage#file-input).', skipValidation: true)
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).', true)
->inject('request')
->inject('response')
->inject('dbForProject')
@@ -417,7 +417,14 @@ App::post('/v1/storage/buckets/:bucketId/files')
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Maximum bucket file size is larger than _APP_STORAGE_LIMIT');
}
$file = $request->getFiles('file');
// GraphQL multipart spec adds files with index keys
if (empty($file)) {
$file = $request->getFiles(0);
}
if (empty($file)) {
throw new Exception(Exception::STORAGE_FILE_EMPTY);
}
@@ -494,7 +501,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
}
if ($chunksUploaded === $chunks) {
if (App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'enabled' && $bucket->getAttribute('antivirus', true) && $fileSize <= APP_LIMIT_ANTIVIRUS && App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL) === Storage::DEVICE_LOCAL) {
if (App::getEnv('_APP_STORAGE_ANTIVIRUS') === 'enabled' && $bucket->getAttribute('antivirus', true) && $fileSize <= APP_LIMIT_ANTIVIRUS && strtolower(App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)) === Storage::DEVICE_LOCAL) {
$antivirus = new Network(
App::getEnv('_APP_STORAGE_ANTIVIRUS_HOST', 'clamav'),
(int) App::getEnv('_APP_STORAGE_ANTIVIRUS_PORT', 3310)
@@ -509,14 +516,14 @@ App::post('/v1/storage/buckets/:bucketId/files')
$mimeType = $deviceFiles->getFileMimeType($path); // Get mime-type before compression and encryption
$data = '';
// Compression
$algorithm = $bucket->getAttribute('compression', 'none');
if ($fileSize <= APP_STORAGE_READ_BUFFER && $algorithm != 'none') {
$algorithm = $bucket->getAttribute('compression', COMPRESSION_TYPE_NONE);
if ($fileSize <= APP_STORAGE_READ_BUFFER && $algorithm != COMPRESSION_TYPE_NONE) {
$data = $deviceFiles->read($path);
switch ($algorithm) {
case 'zstd':
case COMPRESSION_TYPE_ZSTD:
$compressor = new Zstd();
break;
case 'gzip':
case COMPRESSION_TYPE_GZIP:
default:
$compressor = new GZIP();
break;
@@ -542,6 +549,11 @@ App::post('/v1/storage/buckets/:bucketId/files')
$sizeActual = $deviceFiles->getFileSize($path);
$fileHash = $deviceFiles->getFileHash($path);
$openSSLVersion = null;
$openSSLCipher = null;
$openSSLTag = null;
$openSSLIV = null;
if ($bucket->getAttribute('encryption', true) && $fileSize <= APP_STORAGE_READ_BUFFER) {
$openSSLVersion = '1';
$openSSLCipher = OpenSSL::CIPHER_AES_128_GCM;
@@ -668,7 +680,7 @@ App::get('/v1/storage/buckets/:bucketId/files')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FILE_LIST)
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -1256,7 +1268,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
->label('sdk.response.model', Response::MODEL_FILE)
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->param('fileId', '', new UID(), 'File unique ID.')
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).', true)
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).', true)
->inject('response')
->inject('dbForProject')
->inject('user')
+182 -47
View File
@@ -1,13 +1,15 @@
<?php
use Appwrite\Auth\Auth;
use Appwrite\Auth\Validator\Phone;
use Appwrite\Detector\Detector;
use Appwrite\Event\Delete;
use Appwrite\Event\Event;
use Appwrite\Event\Mail;
use Appwrite\Event\Phone as EventPhone;
use Appwrite\Extend\Exception;
use Appwrite\Network\Validator\Email;
use Appwrite\Network\Validator\Host;
use Utopia\Validator\Host;
use Appwrite\Template\Template;
use Appwrite\Utopia\Database\Validator\CustomId;
use Appwrite\Utopia\Database\Validator\Queries;
@@ -20,25 +22,23 @@ use Appwrite\Utopia\Response;
use MaxMind\Db\Reader;
use Utopia\App;
use Utopia\Audit\Audit;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Exception\Authorization as AuthorizationException;
use Utopia\Database\Exception\Duplicate;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Query;
use Utopia\Database\DateTime;
use Utopia\Database\Role;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\UID;
use Utopia\Locale\Locale;
use Utopia\Validator\Text;
use Utopia\Validator\Range;
use Utopia\Validator\ArrayList;
use Utopia\Validator\WhiteList;
use Utopia\Validator\Assoc;
use Utopia\Validator\Text;
App::post('/v1/teams')
->desc('Create Team')
@@ -54,7 +54,7 @@ App::post('/v1/teams')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->param('teamId', '', new CustomId(), 'Team ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
->param('roles', ['owner'], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', true)
->inject('response')
@@ -76,6 +76,7 @@ App::post('/v1/teams')
],
'name' => $name,
'total' => ($isPrivilegedUser || $isAppUser) ? 0 : 1,
'prefs' => new \stdClass(),
'search' => implode(' ', [$teamId, $name]),
])));
@@ -133,7 +134,8 @@ App::get('/v1/teams')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM_LIST)
->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true)
->label('sdk.offline.model', '/teams')
->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -182,6 +184,8 @@ App::get('/v1/teams/:teamId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->label('sdk.offline.model', '/teams')
->label('sdk.offline.key', '{teamId}')
->param('teamId', '', new UID(), 'Team ID.')
->inject('response')
->inject('dbForProject')
@@ -196,26 +200,22 @@ App::get('/v1/teams/:teamId')
$response->dynamic($team, Response::MODEL_TEAM);
});
App::put('/v1/teams/:teamId')
->desc('Update Team')
App::get('/v1/teams/:teamId/prefs')
->desc('Get Team Preferences')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].update')
->label('scope', 'teams.write')
->label('audits.event', 'team.update')
->label('audits.resource', 'team/{response.$id}')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('scope', 'teams.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'update')
->label('sdk.description', '/docs/references/teams/update-team.md')
->label('sdk.method', 'getPrefs')
->label('sdk.description', '/docs/references/teams/get-team-prefs.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->label('sdk.response.model', Response::MODEL_PREFERENCES)
->label('sdk.offline.model', '/teams/{teamId}/prefs')
->param('teamId', '', new UID(), 'Team ID.')
->param('name', null, new Text(128), 'New team name. Max length: 128 chars.')
->inject('response')
->inject('dbForProject')
->inject('events')
->action(function (string $teamId, string $name, Response $response, Database $dbForProject, Event $events) {
->action(function (string $teamId, Response $response, Database $dbForProject) {
$team = $dbForProject->getDocument('teams', $teamId);
@@ -223,15 +223,90 @@ App::put('/v1/teams/:teamId')
throw new Exception(Exception::TEAM_NOT_FOUND);
}
$team = $dbForProject->updateDocument('teams', $team->getId(), $team
$prefs = $team->getAttribute('prefs', []);
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
});
App::put('/v1/teams/:teamId')
->desc('Update Name')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].update')
->label('scope', 'teams.write')
->label('audits.event', 'team.update')
->label('audits.resource', 'team/{response.$id}')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'updateName')
->label('sdk.description', '/docs/references/teams/update-team-name.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->label('sdk.offline.model', '/teams')
->label('sdk.offline.key', '{teamId}')
->param('teamId', '', new UID(), 'Team ID.')
->param('name', null, new Text(128), 'New team name. Max length: 128 chars.')
->inject('requestTimestamp')
->inject('response')
->inject('dbForProject')
->inject('events')
->action(function (string $teamId, string $name, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $events) {
$team = $dbForProject->getDocument('teams', $teamId);
if ($team->isEmpty()) {
throw new Exception(Exception::TEAM_NOT_FOUND);
}
$team
->setAttribute('name', $name)
->setAttribute('search', implode(' ', [$teamId, $name])));
->setAttribute('search', implode(' ', [$teamId, $name]));
$team = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $team) {
return $dbForProject->updateDocument('teams', $team->getId(), $team);
});
$events->setParam('teamId', $team->getId());
$response->dynamic($team, Response::MODEL_TEAM);
});
App::put('/v1/teams/:teamId/prefs')
->desc('Update Preferences')
->groups(['api', 'teams'])
->label('event', 'teams.[teamId].update.prefs')
->label('scope', 'teams.write')
->label('audits.event', 'team.update')
->label('audits.resource', 'team/{response.$id}')
->label('audits.userId', '{response.$id}')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'updatePrefs')
->label('sdk.description', '/docs/references/teams/update-team-prefs.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PREFERENCES)
->label('sdk.offline.model', '/teams/{teamId}/prefs')
->param('teamId', '', new UID(), 'Team ID.')
->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.')
->inject('response')
->inject('dbForProject')
->inject('events')
->action(function (string $teamId, array $prefs, Response $response, Database $dbForProject, Event $events) {
$team = $dbForProject->getDocument('teams', $teamId);
if ($team->isEmpty()) {
throw new Exception(Exception::TEAM_NOT_FOUND);
}
$team = $dbForProject->updateDocument('teams', $team->getId(), $team->setAttribute('prefs', $prefs));
$events->setParam('teamId', $team->getId());
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
});
App::delete('/v1/teams/:teamId')
->desc('Delete Team')
->groups(['api', 'teams'])
@@ -304,7 +379,9 @@ App::post('/v1/teams/:teamId/memberships')
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->label('abuse-limit', 10)
->param('teamId', '', new UID(), 'Team ID.')
->param('email', '', new Email(), 'Email of the new team member.')
->param('email', '', new Email(), 'Email of the new team member.', true)
->param('userId', '', new UID(), 'ID of the user to be added to a team.', true)
->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true)
->param('roles', [], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.')
->param('url', '', fn($clients) => new Host($clients), 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add our own built-in confirm page
->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true)
@@ -314,9 +391,13 @@ App::post('/v1/teams/:teamId/memberships')
->inject('dbForProject')
->inject('locale')
->inject('mails')
->inject('messaging')
->inject('events')
->action(function (string $teamId, string $email, array $roles, string $url, string $name, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Mail $mails, Event $events) {
->action(function (string $teamId, string $email, string $userId, string $phone, array $roles, string $url, string $name, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Mail $mails, EventPhone $messaging, Event $events) {
if (empty($userId) && empty($email) && empty($phone)) {
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'At least one of userId, email, or phone is required');
}
$isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles());
$isAppUser = Auth::isAppUser(Authorization::getRoles());
@@ -331,8 +412,31 @@ App::post('/v1/teams/:teamId/memberships')
if ($team->isEmpty()) {
throw new Exception(Exception::TEAM_NOT_FOUND);
}
$invitee = $dbForProject->findOne('users', [Query::equal('email', [$email])]); // Get user by email address
if (!empty($userId)) {
$invitee = $dbForProject->getDocument('users', $userId);
if ($invitee->isEmpty()) {
throw new Exception(Exception::USER_NOT_FOUND, 'User with given userId doesn\'t exist.', 404);
}
if (!empty($email) && $invitee->getAttribute('email', '') !== $email) {
throw new Exception(Exception::USER_ALREADY_EXISTS, 'Given userId and email doesn\'t match', 409);
}
if (!empty($phone) && $invitee->getAttribute('phone', '') !== $phone) {
throw new Exception(Exception::USER_ALREADY_EXISTS, 'Given userId and phone doesn\'t match', 409);
}
$email = $invitee->getAttribute('email', '');
$phone = $invitee->getAttribute('phone', '');
$name = empty($name) ? $invitee->getAttribute('name', '') : $name;
} elseif (!empty($email)) {
$invitee = $dbForProject->findOne('users', [Query::equal('email', [$email])]); // Get user by email address
if (!empty($invitee) && !empty($phone) && $invitee->getAttribute('phone', '') !== $phone) {
throw new Exception(Exception::USER_ALREADY_EXISTS, 'Given email and phone doesn\'t match', 409);
}
} elseif (!empty($phone)) {
$invitee = $dbForProject->findOne('users', [Query::equal('phone', [$phone])]);
if (!empty($invitee) && !empty($email) && $invitee->getAttribute('email', '') !== $email) {
throw new Exception(Exception::USER_ALREADY_EXISTS, 'Given phone and email doesn\'t match', 409);
}
}
if (empty($invitee)) { // Create new user if no user with same email found
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
@@ -355,7 +459,8 @@ App::post('/v1/teams/:teamId/memberships')
Permission::update(Role::user($userId)),
Permission::delete(Role::user($userId)),
],
'email' => $email,
'email' => empty($email) ? null : $email,
'phone' => empty($phone) ? null : $phone,
'emailVerification' => false,
'status' => true,
'password' => Auth::passwordHash(Auth::passwordGenerator(), Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS),
@@ -427,23 +532,50 @@ App::post('/v1/teams/:teamId/memberships')
} catch (Duplicate $th) {
throw new Exception(Exception::TEAM_INVITE_ALREADY_EXISTS);
}
}
$url = Template::parseURL($url);
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['membershipId' => $membership->getId(), 'userId' => $invitee->getId(), 'secret' => $secret, 'teamId' => $teamId]);
$url = Template::unParseURL($url);
$url = Template::parseURL($url);
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['membershipId' => $membership->getId(), 'userId' => $invitee->getId(), 'secret' => $secret, 'teamId' => $teamId]);
$url = Template::unParseURL($url);
if (!empty($email)) {
$projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]');
if (!$isPrivilegedUser && !$isAppUser) { // No need of confirmation when in admin or app mode
$mails
->setType(MAIL_TYPE_INVITATION)
->setRecipient($email)
->setUrl($url)
->setName($name)
->setLocale($locale->default)
->setTeam($team)
->setUser($user)
->trigger()
;
$from = $project->isEmpty() || $project->getId() === 'console' ? '' : \sprintf($locale->getText('emails.sender'), $projectName);
$body = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-base.tpl');
$subject = \sprintf($locale->getText("emails.invitation.subject"), $team->getAttribute('name'), $projectName);
$body->setParam('{{owner}}', $user->getAttribute('name'));
$body->setParam('{{team}}', $team->getAttribute('name'));
$body
->setParam('{{subject}}', $subject)
->setParam('{{hello}}', $locale->getText("emails.invitation.hello"))
->setParam('{{name}}', $user->getAttribute('name'))
->setParam('{{body}}', $locale->getText("emails.invitation.body"))
->setParam('{{redirect}}', $url)
->setParam('{{footer}}', $locale->getText("emails.invitation.footer"))
->setParam('{{thanks}}', $locale->getText("emails.invitation.thanks"))
->setParam('{{signature}}', $locale->getText("emails.invitation.signature"))
->setParam('{{project}}', $projectName)
->setParam('{{direction}}', $locale->getText('settings.direction'))
->setParam('{{bg-body}}', '#f7f7f7')
->setParam('{{bg-content}}', '#ffffff')
->setParam('{{text-content}}', '#000000');
$body = $body->render();
$mails
->setSubject($subject)
->setBody($body)
->setFrom($from)
->setRecipient($invitee->getAttribute('email'))
->setName($invitee->getAttribute('name'))
->trigger()
;
} elseif (!empty($phone)) {
$messaging
->setRecipient($phone)
->setMessage($url)
->trigger();
}
}
$events
@@ -473,8 +605,9 @@ App::get('/v1/teams/:teamId/memberships')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST)
->label('sdk.offline.model', '/teams/{teamId}/memberships')
->param('teamId', '', new UID(), 'Team ID.')
->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -554,6 +687,8 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->label('sdk.offline.model', '/teams/{teamId}/memberships')
->label('sdk.offline.key', '{membershipId}')
->param('teamId', '', new UID(), 'Team ID.')
->param('membershipId', '', new UID(), 'Membership ID.')
->inject('response')
@@ -867,7 +1002,7 @@ App::get('/v1/teams/:teamId/logs')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LOG_LIST)
->param('teamId', '', new UID(), 'Team ID.')
->param('queries', [], new Queries(new Limit(), new Offset()), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset', true)
->param('queries', [], new Queries(new Limit(), new Offset()), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
->inject('response')
->inject('dbForProject')
->inject('locale')
+74 -42
View File
@@ -16,9 +16,9 @@ use Appwrite\Utopia\Response;
use Utopia\App;
use Utopia\Audit\Audit;
use Utopia\Config\Config;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Role;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
use Utopia\Locale\Locale;
use Appwrite\Extend\Exception;
use Utopia\Database\Document;
@@ -34,11 +34,14 @@ use Utopia\Validator\Text;
use Utopia\Validator\Boolean;
use MaxMind\Db\Reader;
use Utopia\Validator\Integer;
use Appwrite\Auth\Validator\PasswordHistory;
use Appwrite\Auth\Validator\PasswordDictionary;
/** TODO: Remove function when we move to using utopia/platform */
function createUser(string $hash, mixed $hashOptions, string $userId, ?string $email, ?string $password, ?string $phone, string $name, Database $dbForProject, Event $events): Document
function createUser(string $hash, mixed $hashOptions, string $userId, ?string $email, ?string $password, ?string $phone, string $name, Document $project, Database $dbForProject, Event $events): Document
{
$hashOptionsObject = (\is_string($hashOptions)) ? \json_decode($hashOptions, true) : $hashOptions; // Cast to JSON array
$passwordHistory = $project->getAttribute('auths', [])['passwordHistory'] ?? 0;
if (!empty($email)) {
$email = \strtolower($email);
@@ -49,6 +52,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
? ID::unique()
: ID::custom($userId);
$password = (!empty($password)) ? ($hash === 'plaintext' ? Auth::passwordHash($password, $hash, $hashOptionsObject) : $password) : null;
$user = $dbForProject->createDocument('users', new Document([
'$id' => $userId,
'$permissions' => [
@@ -61,10 +65,11 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
'phone' => $phone,
'phoneVerification' => false,
'status' => true,
'password' => (!empty($password)) ? ($hash === 'plaintext' ? Auth::passwordHash($password, $hash, $hashOptionsObject) : $password) : null,
'hash' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO : $hash,
'hashOptions' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO_OPTIONS : $hashOptions,
'password' => $password,
'passwordHistory' => is_null($password) && $passwordHistory === 0 ? [] : [$password],
'passwordUpdate' => (!empty($password)) ? DateTime::now() : null,
'hash' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO : $hash,
'hashOptions' => $hash === 'plaintext' ? Auth::DEFAULT_ALGO_OPTIONS : $hashOptionsObject + ['type' => $hash],
'registration' => DateTime::now(),
'reset' => false,
'name' => $name,
@@ -98,16 +103,18 @@ App::post('/v1/users')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', null, new Email(), 'User email.', true)
->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true)
->param('password', null, new Password(), 'Plain text user password. Must be at least 8 chars.', true)
->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'Plain text user password. Must be at least 8 chars.', true, ['project', 'passwordsDictionary'])
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, ?string $email, ?string $phone, ?string $password, string $name, Response $response, Database $dbForProject, Event $events) {
$user = createUser('plaintext', '{}', $userId, $email, $password, $phone, $name, $dbForProject, $events);
->action(function (string $userId, ?string $email, ?string $phone, ?string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = createUser('plaintext', '{}', $userId, $email, $password, $phone, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -129,15 +136,16 @@ App::post('/v1/users/bcrypt')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using Bcrypt.')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $name, Response $response, Database $dbForProject, Event $events) {
$user = createUser('bcrypt', '{}', $userId, $email, $password, null, $name, $dbForProject, $events);
->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = createUser('bcrypt', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -159,15 +167,16 @@ App::post('/v1/users/md5')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using MD5.')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $name, Response $response, Database $dbForProject, Event $events) {
$user = createUser('md5', '{}', $userId, $email, $password, null, $name, $dbForProject, $events);
->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = createUser('md5', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -189,15 +198,16 @@ App::post('/v1/users/argon2')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using Argon2.')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $name, Response $response, Database $dbForProject, Event $events) {
$user = createUser('argon2', '{}', $userId, $email, $password, null, $name, $dbForProject, $events);
->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = createUser('argon2', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -219,22 +229,23 @@ App::post('/v1/users/sha')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using SHA.')
->param('passwordVersion', '', new WhiteList(['sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512']), "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", true)
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $passwordVersion, string $name, Response $response, Database $dbForProject, Event $events) {
->action(function (string $userId, string $email, string $password, string $passwordVersion, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$options = '{}';
if (!empty($passwordVersion)) {
$options = '{"version":"' . $passwordVersion . '"}';
}
$user = createUser('sha', $options, $userId, $email, $password, null, $name, $dbForProject, $events);
$user = createUser('sha', $options, $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -256,15 +267,16 @@ App::post('/v1/users/phpass')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using PHPass.')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $name, Response $response, Database $dbForProject, Event $events) {
$user = createUser('phpass', '{}', $userId, $email, $password, null, $name, $dbForProject, $events);
->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = createUser('phpass', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -286,7 +298,7 @@ App::post('/v1/users/scrypt')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using Scrypt.')
->param('passwordSalt', '', new Text(128), 'Optional salt used to hash password.')
@@ -296,9 +308,10 @@ App::post('/v1/users/scrypt')
->param('passwordLength', 64, new Integer(), 'Optional hash length used to hash password.')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $passwordSalt, int $passwordCpu, int $passwordMemory, int $passwordParallel, int $passwordLength, string $name, Response $response, Database $dbForProject, Event $events) {
->action(function (string $userId, string $email, string $password, string $passwordSalt, int $passwordCpu, int $passwordMemory, int $passwordParallel, int $passwordLength, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$options = [
'salt' => $passwordSalt,
'costCpu' => $passwordCpu,
@@ -307,7 +320,7 @@ App::post('/v1/users/scrypt')
'length' => $passwordLength
];
$user = createUser('scrypt', \json_encode($options), $userId, $email, $password, null, $name, $dbForProject, $events);
$user = createUser('scrypt', \json_encode($options), $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -329,7 +342,7 @@ App::post('/v1/users/scrypt-modified')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new CustomId(), 'User ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
->param('email', '', new Email(), 'User email.')
->param('password', '', new Password(), 'User password hashed using Scrypt Modified.')
->param('passwordSalt', '', new Text(128), 'Salt used to hash password.')
@@ -337,10 +350,11 @@ App::post('/v1/users/scrypt-modified')
->param('passwordSignerKey', '', new Text(128), 'Signer key used to hash password.')
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $email, string $password, string $passwordSalt, string $passwordSaltSeparator, string $passwordSignerKey, string $name, Response $response, Database $dbForProject, Event $events) {
$user = createUser('scryptMod', '{"signerKey":"' . $passwordSignerKey . '","saltSeparator":"' . $passwordSaltSeparator . '","salt":"' . $passwordSalt . '"}', $userId, $email, $password, null, $name, $dbForProject, $events);
->action(function (string $userId, string $email, string $password, string $passwordSalt, string $passwordSaltSeparator, string $passwordSignerKey, string $name, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = createUser('scryptMod', '{"signerKey":"' . $passwordSignerKey . '","saltSeparator":"' . $passwordSaltSeparator . '","salt":"' . $passwordSalt . '"}', $userId, $email, $password, null, $name, $project, $dbForProject, $events);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
@@ -359,7 +373,7 @@ App::get('/v1/users')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER_LIST)
->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true)
->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForProject')
@@ -414,7 +428,7 @@ App::get('/v1/users/:userId')
$user = $dbForProject->getDocument('users', $userId);
if ($user->isEmpty()) {
throw new Exception('User not found', 404, Exception::USER_NOT_FOUND);
throw new Exception(Exception::USER_NOT_FOUND);
}
$response->dynamic($user, Response::MODEL_USER);
@@ -443,7 +457,7 @@ App::get('/v1/users/:userId/prefs')
throw new Exception(Exception::USER_NOT_FOUND);
}
$prefs = $user->getAttribute('prefs', new \stdClass());
$prefs = $user->getAttribute('prefs', []);
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
});
@@ -543,7 +557,7 @@ App::get('/v1/users/:userId/logs')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LOG_LIST)
->param('userId', '', new UID(), 'User ID.')
->param('queries', [], new Queries(new Limit(), new Offset()), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset', true)
->param('queries', [], new Queries(new Limit(), new Offset()), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true)
->inject('response')
->inject('dbForProject')
->inject('locale')
@@ -779,11 +793,12 @@ App::patch('/v1/users/:userId/password')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_USER)
->param('userId', '', new UID(), 'User ID.')
->param('password', '', new Password(), 'New user password. Must be at least 8 chars.')
->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary'])
->inject('response')
->inject('project')
->inject('dbForProject')
->inject('events')
->action(function (string $userId, string $password, Response $response, Database $dbForProject, Event $events) {
->action(function (string $userId, string $password, Response $response, Document $project, Database $dbForProject, Event $events) {
$user = $dbForProject->getDocument('users', $userId);
@@ -791,11 +806,27 @@ App::patch('/v1/users/:userId/password')
throw new Exception(Exception::USER_NOT_FOUND);
}
$newPassword = Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS);
$historyLimit = $project->getAttribute('auths', [])['passwordHistory'] ?? 0;
$history = [];
if ($historyLimit > 0) {
$history = $user->getAttribute('passwordHistory', []);
$validator = new PasswordHistory($history, $user->getAttribute('hash'), $user->getAttribute('hashOptions'));
if (!$validator->isValid($password)) {
throw new Exception(Exception::USER_PASSWORD_RECENTLY_USED, 'The password was recently used', 409);
}
$history[] = $newPassword;
array_slice($history, (count($history) - $historyLimit), $historyLimit);
}
$user
->setAttribute('password', Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS))
->setAttribute('password', $newPassword)
->setAttribute('passwordHistory', $history)
->setAttribute('passwordUpdate', DateTime::now())
->setAttribute('hash', Auth::DEFAULT_ALGO)
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS)
->setAttribute('passwordUpdate', DateTime::now());
->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS);
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
@@ -1004,7 +1035,8 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
$events
->setParam('userId', $user->getId())
->setParam('sessionId', $sessionId);
->setParam('sessionId', $sessionId)
->setPayload($response->output($session, Response::MODEL_SESSION));
$response->noContent();
});
+8 -4
View File
@@ -3,7 +3,7 @@
require_once __DIR__ . '/../init.php';
use Utopia\App;
use Utopia\Database\Role;
use Utopia\Database\Helpers\Role;
use Utopia\Locale\Locale;
use Utopia\Logger\Logger;
use Utopia\Logger\Log;
@@ -233,7 +233,7 @@ App::init()
->addHeader('Server', 'Appwrite')
->addHeader('X-Content-Type-Options', 'nosniff')
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-Appwrite-ID, Content-Range, Range, Cache-Control, Expires, Pragma')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma')
->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies')
->addHeader('Access-Control-Allow-Origin', $refDomain)
->addHeader('Access-Control-Allow-Credentials', 'true')
@@ -384,7 +384,7 @@ App::options()
$response
->addHeader('Server', 'Appwrite')
->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-Appwrite-ID, Content-Range, Range, Cache-Control, Expires, Pragma, X-Fallback-Cookies')
->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Fallback-Cookies')
->addHeader('Access-Control-Expose-Headers', 'X-Fallback-Cookies')
->addHeader('Access-Control-Allow-Origin', $origin)
->addHeader('Access-Control-Allow-Credentials', 'true')
@@ -485,6 +485,10 @@ App::error()
$error->setType(AppwriteException::GENERAL_ROUTE_NOT_FOUND);
break;
}
} elseif ($error instanceof Utopia\Database\Exception\Conflict) {
$error = new AppwriteException(AppwriteException::DOCUMENT_UPDATE_CONFLICT, null, null, $error);
$code = $error->getCode();
$message = $error->getMessage();
}
/** Wrap all exceptions inside Appwrite\Extend\Exception */
@@ -590,7 +594,7 @@ App::get('/.well-known/acme-challenge')
$uriChunks = \explode('/', $request->getURI());
$token = $uriChunks[\count($uriChunks) - 1];
$validator = new Text(100, [
$validator = new Text(100, allowList: [
...Text::NUMBERS,
...Text::ALPHABET_LOWER,
...Text::ALPHABET_UPPER,
+21 -3
View File
@@ -4,7 +4,7 @@ global $utopia, $request, $response;
use Appwrite\Extend\Exception;
use Utopia\Database\Document;
use Appwrite\Network\Validator\Host;
use Utopia\Validator\Host;
use Appwrite\Utopia\Request;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
@@ -14,7 +14,8 @@ use Utopia\Validator\Integer;
use Utopia\Validator\Text;
use Utopia\Storage\Validator\File;
use Utopia\Validator\WhiteList;
use Utopia\Database\ID;
use Utopia\Database\Helpers\ID;
use Utopia\Validator\Nullable;
App::get('/v1/mock/tests/foo')
->desc('Get Foo')
@@ -135,6 +136,8 @@ App::post('/v1/mock/tests/bar')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_MOCK)
->label('sdk.offline.model', '/mock/tests/bar')
->label('sdk.offline.key', '{required}')
->label('sdk.mock', true)
->param('required', '', new Text(100), 'Sample string param')
->param('default', '', new Integer(true), 'Sample numeric param')
@@ -265,7 +268,7 @@ App::post('/v1/mock/tests/general/upload')
->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Integer(true), 'Sample numeric param')
->param('z', null, new ArrayList(new Text(256), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Sample array param')
->param('file', [], new File(), 'Sample file param', false)
->param('file', [], new File(), 'Sample file param', skipValidation: true)
->inject('request')
->inject('response')
->action(function (string $x, int $y, array $z, mixed $file, Request $request, Response $response) {
@@ -426,6 +429,21 @@ App::get('/v1/mock/tests/general/empty')
$response->noContent();
});
App::post('/v1/mock/tests/general/nullable')
->desc('Nullable Test')
->groups(['mock'])
->label('scope', 'public')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'general')
->label('sdk.method', 'nullable')
->label('sdk.description', 'Mock a nullable parameter.')
->label('sdk.mock', true)
->param('required', '', new Text(100), 'Sample string param')
->param('nullable', '', new Nullable(new Text(100)), 'Sample string param')
->param('optional', '', new Text(100), 'Sample string param', true)
->action(function (string $required, string $nullable, ?string $optional) {
});
/** Endpoint to test if required headers are sent from the SDK */
App::get('/v1/mock/tests/general/headers')
->desc('Get headers')
+41 -9
View File
@@ -5,18 +5,16 @@ use Appwrite\Event\Audit;
use Appwrite\Event\Database as EventDatabase;
use Appwrite\Event\Delete;
use Appwrite\Event\Event;
use Appwrite\Event\Mail;
use Appwrite\Extend\Exception;
use Appwrite\Messaging\Adapter\Realtime;
use Appwrite\Usage\Stats;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Request;
use Utopia\App;
use Appwrite\Extend\Exception;
use Utopia\Abuse\Abuse;
use Utopia\Abuse\Adapters\TimeLimit;
use Utopia\Cache\Adapter\Filesystem;
use Utopia\Cache\Cache;
use Utopia\CLI\Console;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
use Utopia\Database\Document;
@@ -98,13 +96,12 @@ App::init()
->inject('user')
->inject('events')
->inject('audits')
->inject('mails')
->inject('usage')
->inject('deletes')
->inject('database')
->inject('dbForProject')
->inject('mode')
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $events, Audit $audits, Mail $mails, Stats $usage, Delete $deletes, EventDatabase $database, Database $dbForProject, string $mode) use ($databaseListener) {
->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $events, Audit $audits, Stats $usage, Delete $deletes, EventDatabase $database, Database $dbForProject, string $mode) use ($databaseListener) {
$route = $utopia->match($request);
@@ -178,10 +175,6 @@ App::init()
->setProject($project)
->setUser($user);
$mails
->setProject($project)
->setUser($user);
$audits
->setMode($mode)
->setUserAgent($request->getUserAgent(''))
@@ -318,6 +311,45 @@ App::init()
}
});
/**
* Limit user session
*
* Delete older sessions if the number of sessions have crossed
* the session limit set for the project
*/
App::shutdown()
->groups(['session'])
->inject('utopia')
->inject('request')
->inject('response')
->inject('project')
->inject('dbForProject')
->action(function (App $utopia, Request $request, Response $response, Document $project, Database $dbForProject) {
$sessionLimit = $project->getAttribute('auths', [])['maxSessions'] ?? APP_LIMIT_USER_SESSIONS_DEFAULT;
$session = $response->getPayload();
$userId = $session['userId'] ?? '';
if (empty($userId)) {
return;
}
$user = $dbForProject->getDocument('users', $userId);
if ($user->isEmpty()) {
return;
}
$sessions = $user->getAttribute('sessions', []);
$count = \count($sessions);
if ($count <= $sessionLimit) {
return;
}
for ($i = 0; $i < ($count - $sessionLimit); $i++) {
$session = array_shift($sessions);
$dbForProject->deleteDocument('sessions', $session->getId());
}
$dbForProject->deleteCachedDocument('users', $userId);
});
App::shutdown()
->groups(['api'])
->inject('utopia')
+1 -1
View File
@@ -17,7 +17,7 @@ App::get('/versions')
];
foreach ($platforms as $platform) {
$languages = $platform['languages'] ?? [];
$languages = $platform['sdks'] ?? [];
foreach ($languages as $key => $language) {
if (isset($language['dev']) && $language['dev']) {
+8 -4
View File
@@ -119,7 +119,7 @@ function logError(Throwable $error, string $action, Utopia\Route $route = null)
function getStorageDevice($root): Device
{
switch (App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)) {
switch (strtolower(App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL))) {
case Storage::DEVICE_LOCAL:
default:
return new Local($root);
@@ -165,14 +165,14 @@ App::post('/v1/runtimes')
->desc("Create a new runtime server")
->param('runtimeId', '', new Text(64), 'Unique runtime ID.')
->param('source', '', new Text(0), 'Path to source files.')
->param('destination', '', new Text(0), 'Destination folder to store build files into.', true)
->param('destination', '', new Text(0, 0), 'Destination folder to store build files into.', true)
->param('vars', [], new Assoc(), 'Environment Variables required for the build.')
->param('commands', [], new ArrayList(new Text(1024), 100), 'Commands required to build the container. Maximum of 100 commands are allowed, each 1024 characters long.')
->param('runtime', '', new Text(128), 'Runtime for the cloud function.')
->param('baseImage', '', new Text(128), 'Base image name of the runtime.')
->param('entrypoint', '', new Text(256), 'Entrypoint of the code file.', true)
->param('remove', false, new Boolean(), 'Remove a runtime after execution.')
->param('workdir', '', new Text(256), 'Working directory.', true)
->param('workdir', '', new Text(256, 0), 'Working directory.', true)
->inject('orchestrationPool')
->inject('activeRuntimes')
->inject('response')
@@ -459,7 +459,7 @@ App::post('/v1/execution')
->desc('Create an execution')
->param('runtimeId', '', new Text(64), 'The runtimeID to execute.')
->param('vars', [], new Assoc(), 'Environment variables required for the build.')
->param('data', '', new Text(8192), 'Data to be forwarded to the function, this is user specified.', true)
->param('data', '', new Text(8192, 0), 'Data to be forwarded to the function, this is user specified.', true)
->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.')
->inject('activeRuntimes')
->inject('response')
@@ -548,6 +548,10 @@ App::post('/v1/execution')
case $statusCode >= 500:
$stderr = ($executorResponse ?? [])['stderr'] ?? 'Internal Runtime error.';
$stdout = ($executorResponse ?? [])['stdout'] ?? 'Internal Runtime error.';
$res = ($executorResponse ?? [])['response'] ?? '';
if (is_array($res)) {
$res = json_encode($res, JSON_UNESCAPED_UNICODE);
}
break;
case $statusCode >= 100:
$stdout = $executorResponse['stdout'];
+5 -5
View File
@@ -10,9 +10,9 @@ use Swoole\Http\Response as SwooleResponse;
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Role;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Validator\Authorization;
use Utopia\Audit\Audit;
use Utopia\Abuse\Adapters\TimeLimit;
@@ -27,6 +27,7 @@ $http = new Server("0.0.0.0", App::getEnv('PORT', 80));
$payloadSize = 6 * (1024 * 1024); // 6MB
$workerNumber = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6));
$http
->set([
'worker_num' => $workerNumber,
@@ -91,7 +92,6 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
$collections = Config::getParam('collections', []);
try {
$redis->flushAll();
Console::success('[Setup] - Creating database: appwrite...');
$dbForConsole->create();
} catch (\Exception $e) {
@@ -295,7 +295,7 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo
$log->addExtra('line', $th->getLine());
$log->addExtra('trace', $th->getTraceAsString());
$log->addExtra('detailedTrace', $th->getTrace());
$log->addExtra('roles', Authorization::$roles);
$log->addExtra('roles', Authorization::getRoles());
$action = $route->getLabel("sdk.namespace", "UNKNOWN_NAMESPACE") . '.' . $route->getLabel("sdk.method", "UNKNOWN_METHOD");
$log->setAction($action);
+175 -40
View File
@@ -18,10 +18,8 @@ ini_set('display_startup_errors', 1);
ini_set('default_socket_timeout', -1);
error_reporting(E_ALL);
use Appwrite\Extend\PDO;
use Ahc\Jwt\JWT;
use Ahc\Jwt\JWTException;
use Appwrite\Extend\Exception;
use Appwrite\Auth\Auth;
use Appwrite\DSN\DSN;
use Appwrite\Event\Audit;
@@ -30,16 +28,33 @@ use Appwrite\Event\Delete;
use Appwrite\Event\Event;
use Appwrite\Event\Mail;
use Appwrite\Event\Phone;
use Appwrite\Extend\Exception;
use Appwrite\Extend\PDO;
use Appwrite\GraphQL\Promises\Adapter\Swoole;
use Appwrite\GraphQL\Schema;
use Appwrite\Network\Validator\Email;
use Appwrite\Network\Validator\IP;
use Appwrite\Network\Validator\URL;
use Appwrite\Network\Validator\Origin;
use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Usage\Stats;
use Appwrite\Utopia\View;
use MaxMind\Db\Reader;
use PHPMailer\PHPMailer\PHPMailer;
use Swoole\Database\PDOConfig;
use Swoole\Database\PDOPool;
use Swoole\Database\RedisConfig;
use Swoole\Database\RedisPool;
use Utopia\App;
use Utopia\Database\ID;
use Utopia\Database\Helpers\ID;
use Utopia\Logger\Logger;
use Utopia\Cache\Adapter\Redis as RedisCache;
use Utopia\Cache\Cache;
use Utopia\Config\Config;
use Utopia\Database\Adapter\MariaDB;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
use Utopia\Database\Validator\Datetime as DatetimeValidator;
use Utopia\Database\Validator\Structure;
use Utopia\Locale\Locale;
use Utopia\Messaging\Adapters\SMS\Mock;
use Utopia\Messaging\Adapters\SMS\Msg91;
@@ -48,31 +63,18 @@ use Utopia\Messaging\Adapters\SMS\TextMagic;
use Utopia\Messaging\Adapters\SMS\Twilio;
use Utopia\Messaging\Adapters\SMS\Vonage;
use Utopia\Registry\Registry;
use MaxMind\Db\Reader;
use PHPMailer\PHPMailer\PHPMailer;
use Utopia\Cache\Adapter\Redis as RedisCache;
use Utopia\Cache\Cache;
use Utopia\Database\Adapter\MariaDB;
use Utopia\Database\Document;
use Utopia\Database\Database;
use Utopia\Database\Validator\Structure;
use Utopia\Database\Validator\Authorization;
use Utopia\Validator\Range;
use Utopia\Validator\WhiteList;
use Swoole\Database\PDOConfig;
use Swoole\Database\PDOPool;
use Swoole\Database\RedisConfig;
use Swoole\Database\RedisPool;
use Utopia\Database\Query;
use Utopia\Database\Validator\DatetimeValidator;
use Utopia\Storage\Device;
use Utopia\Storage\Storage;
use Utopia\Storage\Device\Backblaze;
use Utopia\Storage\Device\DOSpaces;
use Utopia\Storage\Device\Linode;
use Utopia\Storage\Device\Local;
use Utopia\Storage\Device\S3;
use Utopia\Storage\Device\Linode;
use Utopia\Storage\Device\Wasabi;
use Utopia\Storage\Storage;
use Utopia\Validator\Range;
use Utopia\Validator\IP;
use Utopia\Validator\URL;
use Utopia\Validator\WhiteList;
const APP_NAME = 'Appwrite';
const APP_DOMAIN = 'appwrite.io';
@@ -84,6 +86,9 @@ const APP_MODE_ADMIN = 'admin';
const APP_PAGING_LIMIT = 12;
const APP_LIMIT_COUNT = 5000;
const APP_LIMIT_USERS = 10000;
const APP_LIMIT_USER_PASSWORD_HISTORY = 20;
const APP_LIMIT_USER_SESSIONS_MAX = 100;
const APP_LIMIT_USER_SESSIONS_DEFAULT = 10;
const APP_LIMIT_ANTIVIRUS = 20000000; //20MB
const APP_LIMIT_ENCRYPTION = 20000000; //20MB
const APP_LIMIT_COMPRESSION = 20000000; //20MB
@@ -92,10 +97,11 @@ const APP_LIMIT_ARRAY_ELEMENT_SIZE = 4096; // Default maximum length of element
const APP_LIMIT_SUBQUERY = 1000;
const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period
const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds
const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls
const APP_KEY_ACCCESS = 24 * 60 * 60; // 24 hours
const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours
const APP_CACHE_BUSTER = 501;
const APP_VERSION_STABLE = '1.1.2';
const APP_CACHE_BUSTER = 503;
const APP_VERSION_STABLE = '1.3.1';
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
@@ -279,12 +285,23 @@ Database::addFilter(
return null;
},
function (mixed $value, Document $document, Database $database) {
return $database
->find('attributes', [
Query::equal('collectionInternalId', [$document->getInternalId()]),
Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]),
Query::limit($database->getLimitForAttributes()),
]);
$attributes = $database->find('attributes', [
Query::equal('collectionInternalId', [$document->getInternalId()]),
Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]),
Query::limit($database->getLimitForAttributes()),
]);
foreach ($attributes as $attribute) {
if ($attribute->getAttribute('type') === Database::VAR_RELATIONSHIP) {
$options = $attribute->getAttribute('options');
foreach ($options as $key => $value) {
$attribute->setAttribute($key, $value);
}
$attribute->removeAttribute('options');
}
}
return $attributes;
}
);
@@ -600,7 +617,13 @@ $register->set('smtp', function () {
return $mail;
});
$register->set('geodb', function () {
return new Reader(__DIR__ . '/assets/dbip/dbip-country-lite-2022-06.mmdb');
return new Reader(__DIR__ . '/assets/dbip/dbip-country-lite-2023-01.mmdb');
});
$register->set('passwordsDictionary', function () {
$content = \file_get_contents(__DIR__ . '/assets/security/10k-common-passwords');
$content = explode("\n", $content);
$content = array_flip($content);
return $content;
});
$register->set('db', function () {
// This is usually for our workers or CLI commands scope
@@ -629,6 +652,9 @@ $register->set('cache', function () {
return $redis;
});
$register->set('promiseAdapter', function () {
return new Swoole();
});
/*
* Localization
@@ -747,7 +773,7 @@ App::setResource('clients', function ($request, $console, $project) {
$console->setAttribute('platforms', [ // Always allow current host
'$collection' => ID::custom('platforms'),
'name' => 'Current Host',
'type' => 'web',
'type' => Origin::CLIENT_TYPE_WEB,
'hostname' => $request->getHostname(),
], Document::SET_TYPE_APPEND);
@@ -759,7 +785,7 @@ App::setResource('clients', function ($request, $console, $project) {
fn ($node) => $node['hostname'],
\array_filter(
$console->getAttribute('platforms', []),
fn ($node) => (isset($node['type']) && $node['type'] === 'web' && isset($node['hostname']) && !empty($node['hostname']))
fn ($node) => (isset($node['type']) && ($node['type'] === Origin::CLIENT_TYPE_WEB) && isset($node['hostname']) && !empty($node['hostname']))
)
);
@@ -770,7 +796,7 @@ App::setResource('clients', function ($request, $console, $project) {
fn ($node) => $node['hostname'],
\array_filter(
$project->getAttribute('platforms', []),
fn ($node) => (isset($node['type']) && $node['type'] === 'web' && isset($node['hostname']) && !empty($node['hostname']))
fn ($node) => (isset($node['type']) && ($node['type'] === Origin::CLIENT_TYPE_WEB || $node['type'] === Origin::CLIENT_TYPE_FLUTTER_WEB) && isset($node['hostname']) && !empty($node['hostname']))
)
)
)
@@ -903,7 +929,7 @@ App::setResource('console', function () {
[
'$collection' => ID::custom('platforms'),
'name' => 'Localhost',
'type' => 'web',
'type' => Origin::CLIENT_TYPE_WEB,
'hostname' => 'localhost',
], // Current host is added on app init
],
@@ -961,7 +987,7 @@ App::setResource('deviceBuilds', function ($project) {
function getDevice($root): Device
{
switch (App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)) {
switch (strtolower(App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL))) {
case Storage::DEVICE_LOCAL:
default:
return new Local($root);
@@ -1019,6 +1045,11 @@ App::setResource('geodb', function ($register) {
return $register->get('geodb');
}, ['register']);
App::setResource('passwordsDictionary', function ($register) {
/** @var Utopia\Registry\Registry $register */
return $register->get('passwordsDictionary');
}, ['register']);
App::setResource('sms', function () {
$dsn = new DSN(App::getEnv('_APP_SMS_PROVIDER'));
$user = $dsn->getUser();
@@ -1041,7 +1072,111 @@ App::setResource('servers', function () {
$languages = array_map(function ($language) {
return strtolower($language['name']);
}, $server['languages']);
}, $server['sdks']);
return $languages;
});
App::setResource('promiseAdapter', function ($register) {
return $register->get('promiseAdapter');
}, ['register']);
App::setResource('schema', function ($utopia, $dbForProject) {
$complexity = function (int $complexity, array $args) {
$queries = Query::parseQueries($args['queries'] ?? []);
$query = Query::getByType($queries, Query::TYPE_LIMIT)[0] ?? null;
$limit = $query ? $query->getValue() : APP_LIMIT_LIST_DEFAULT;
return $complexity * $limit;
};
$attributes = function (int $limit, int $offset) use ($dbForProject) {
$attrs = Authorization::skip(fn() => $dbForProject->find('attributes', [
Query::limit($limit),
Query::offset($offset),
]));
return \array_map(function ($attr) {
return $attr->getArrayCopy();
}, $attrs);
};
$urls = [
'list' => function (string $databaseId, string $collectionId, array $args) {
return "/v1/databases/$databaseId/collections/$collectionId/documents";
},
'create' => function (string $databaseId, string $collectionId, array $args) {
return "/v1/databases/$databaseId/collections/$collectionId/documents";
},
'read' => function (string $databaseId, string $collectionId, array $args) {
return "/v1/databases/$databaseId/collections/$collectionId/documents/{$args['documentId']}";
},
'update' => function (string $databaseId, string $collectionId, array $args) {
return "/v1/databases/$databaseId/collections/$collectionId/documents/{$args['documentId']}";
},
'delete' => function (string $databaseId, string $collectionId, array $args) {
return "/v1/databases/$databaseId/collections/$collectionId/documents/{$args['documentId']}";
},
];
$params = [
'list' => function (string $databaseId, string $collectionId, array $args) {
return [ 'queries' => $args['queries']];
},
'create' => function (string $databaseId, string $collectionId, array $args) {
$id = $args['id'] ?? 'unique()';
$permissions = $args['permissions'] ?? null;
unset($args['id']);
unset($args['permissions']);
// Order must be the same as the route params
return [
'databaseId' => $databaseId,
'documentId' => $id,
'collectionId' => $collectionId,
'data' => $args,
'permissions' => $permissions,
];
},
'update' => function (string $databaseId, string $collectionId, array $args) {
$documentId = $args['id'];
$permissions = $args['permissions'] ?? null;
unset($args['id']);
unset($args['permissions']);
// Order must be the same as the route params
return [
'databaseId' => $databaseId,
'collectionId' => $collectionId,
'documentId' => $documentId,
'data' => $args,
'permissions' => $permissions,
];
},
];
return Schema::build(
$utopia,
$complexity,
$attributes,
$urls,
$params,
);
}, ['utopia', 'dbForProject']);
App::setResource('requestTimestamp', function ($request) {
//TODO: Move this to the Request class itself
$timestampHeader = $request->getHeader('x-appwrite-timestamp');
$requestTimestamp = null;
if (!empty($timestampHeader)) {
try {
$requestTimestamp = new \DateTime($timestampHeader);
} catch (\Throwable $e) {
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Invalid X-Appwrite-Timestamp header value');
}
}
return $requestTimestamp;
}, ['request']);
+4 -4
View File
@@ -13,8 +13,8 @@ use Utopia\Abuse\Abuse;
use Utopia\Abuse\Adapters\TimeLimit;
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Database\ID;
use Utopia\Database\Role;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Role;
use Utopia\Logger\Log;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
@@ -237,7 +237,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
'data' => [
'events' => ['stats.connections'],
'channels' => ['project'],
'timestamp' => DateTime::now(),
'timestamp' => DateTime::formatTz(DateTime::now()),
'payload' => [
$projectId => $payload[$projectId]
]
@@ -264,7 +264,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
'data' => [
'events' => ['test.event'],
'channels' => ['tests'],
'timestamp' => DateTime::now(),
'timestamp' => DateTime::formatTz(DateTime::now()),
'payload' => $payload
]
];
+2 -1
View File
@@ -85,10 +85,11 @@ $cli
try {
$migration
->setProject($project, $projectDB, $consoleDB)
->setPDO($register->get('db'))
->execute();
} catch (\Throwable $th) {
throw $th;
Console::error('Failed to update project ("' . $project->getId() . '") version with error: ' . $th->getMessage());
throw $th;
}
clearProjectsCache($redis, $project);
+36 -19
View File
@@ -1,42 +1,49 @@
<?php
use Utopia\Config\Config;
use Utopia\CLI\Console;
use Appwrite\Spec\Swagger2;
use Appwrite\SDK\SDK;
use Appwrite\SDK\Language\Android;
use Appwrite\SDK\Language\CLI;
use Appwrite\SDK\Language\PHP;
use Appwrite\SDK\Language\Web;
use Appwrite\SDK\Language\Node;
use Appwrite\SDK\Language\Python;
use Appwrite\SDK\Language\Ruby;
use Appwrite\SDK\Language\Dart;
use Appwrite\SDK\Language\Deno;
use Appwrite\SDK\Language\DotNet;
use Appwrite\SDK\Language\Flutter;
use Appwrite\SDK\Language\Go;
use Appwrite\SDK\Language\GraphQL;
use Appwrite\SDK\Language\Kotlin;
use Appwrite\SDK\Language\Android;
use Appwrite\SDK\Language\Node;
use Appwrite\SDK\Language\PHP;
use Appwrite\SDK\Language\Python;
use Appwrite\SDK\Language\REST;
use Appwrite\SDK\Language\Ruby;
use Appwrite\SDK\Language\Swift;
use Appwrite\SDK\Language\SwiftClient;
use Appwrite\SDK\Language\Apple;
use Appwrite\SDK\Language\Web;
use Appwrite\SDK\SDK;
use Appwrite\Spec\Swagger2;
use Utopia\CLI\Console;
use Utopia\Config\Config;
$cli
->task('sdks')
->action(function () {
$platforms = Config::getParam('platforms');
$selected = \strtolower(Console::confirm('Choose SDK ("*" for all):'));
$selectedPlatform = Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):');
$selectedSDK = \strtolower(Console::confirm('Choose SDK ("*" for all):'));
$version = Console::confirm('Choose an Appwrite version');
$git = (Console::confirm('Should we use git push? (yes/no)') == 'yes');
$production = ($git) ? (Console::confirm('Type "Appwrite" to push code to production git repos') == 'Appwrite') : false;
$message = ($git) ? Console::confirm('Please enter your commit message:') : '';
if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x', 'latest'])) {
if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x', '1.2.x', '1.3.x', 'latest'])) {
throw new Exception('Unknown version given');
}
foreach ($platforms as $key => $platform) {
foreach ($platform['languages'] as $language) {
if ($selected !== $language['key'] && $selected !== '*') {
if ($selectedPlatform !== $key && $selectedPlatform !== '*') {
continue;
}
foreach ($platform['sdks'] as $language) {
if ($selectedSDK !== $language['key'] && $selectedSDK !== '*') {
continue;
}
@@ -79,8 +86,13 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
switch ($language['key']) {
case 'web':
$config = new Web();
$config->setNPMPackage('appwrite');
$config->setBowerPackage('appwrite');
if ($platform['key'] === APP_PLATFORM_CONSOLE) {
$config->setNPMPackage('@appwrite.io/console');
$config->setBowerPackage('@appwrite.io/console');
} else {
$config->setNPMPackage('appwrite');
$config->setBowerPackage('appwrite');
}
break;
case 'cli':
$config = new CLI();
@@ -148,7 +160,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
$warning = $warning . "\n\n > This is the Swift SDK for integrating with Appwrite from your Swift server-side code. If you're looking for the Apple SDK you should check [appwrite/sdk-for-apple](https://github.com/appwrite/sdk-for-apple)";
break;
case 'apple':
$config = new SwiftClient();
$config = new Apple();
break;
case 'dotnet':
$cover = '';
@@ -161,9 +173,14 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
$config = new Kotlin();
$warning = $warning . "\n\n > This is the Kotlin SDK for integrating with Appwrite from your Kotlin server-side code. If you're looking for the Android SDK you should check [appwrite/sdk-for-android](https://github.com/appwrite/sdk-for-android)";
break;
case 'graphql':
$config = new GraphQL();
break;
case 'rest':
$config = new REST();
break;
default:
throw new Exception('Language "' . $language['key'] . '" not supported');
break;
}
Console::info("Generating {$language['name']} SDK...");
+4
View File
@@ -153,6 +153,9 @@ services:
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
- _APP_SMS_PROVIDER
- _APP_SMS_FROM
- _APP_GRAPHQL_MAX_BATCH_SIZE
- _APP_GRAPHQL_MAX_COMPLEXITY
- _APP_GRAPHQL_MAX_DEPTH
appwrite-realtime:
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
@@ -506,6 +509,7 @@ services:
entrypoint: worker-messaging
<<: *x-logging
container_name: appwrite-worker-messaging
restart: unless-stopped
networks:
- appwrite
depends_on:
+1
View File
@@ -40,6 +40,7 @@ class AuditsV1 extends Worker
$dbForProject = $this->getProjectDB($project->getId());
$audit = new Audit($dbForProject);
$audit->log(
userInternalId: $user->getInternalId(),
userId: $user->getId(),
// Pass first, most verbose event pattern
event: $event,
+2 -2
View File
@@ -11,7 +11,7 @@ use Utopia\Database\Database;
use Utopia\Database\DateTime;
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Database\ID;
use Utopia\Database\Helpers\ID;
use Utopia\Storage\Storage;
use Utopia\Database\Document;
use Utopia\Config\Config;
@@ -91,7 +91,7 @@ class BuildsV1 extends Worker
'outputPath' => '',
'runtime' => $function->getAttribute('runtime'),
'source' => $deployment->getAttribute('path'),
'sourceType' => App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL),
'sourceType' => strtolower(App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)),
'stdout' => '',
'stderr' => '',
'endTime' => null,
+31 -9
View File
@@ -4,14 +4,16 @@ use Appwrite\Event\Event;
use Appwrite\Event\Mail;
use Appwrite\Network\Validator\CNAME;
use Appwrite\Resque\Worker;
use Appwrite\Template\Template;
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\DateTime;
use Utopia\Database\ID;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Query;
use Utopia\Domains\Domain;
use Utopia\Locale\Locale;
require_once __DIR__ . '/../init.php';
@@ -375,18 +377,38 @@ class CertificatesV1 extends Worker
Console::warning('Cannot renew domain (' . $domain . ') on attempt no. ' . $attempt . ' certificate: ' . $errorMessage);
// Send mail to administratore mail
$locale = new Locale(App::getEnv('_APP_LOCALE', 'en'));
if (!$locale->getText('emails.sender') || !$locale->getText("emails.certificate.hello") || !$locale->getText("emails.certificate.subject") || !$locale->getText("emails.certificate.body") || !$locale->getText("emails.certificate.footer") || !$locale->getText("emails.certificate.thanks") || !$locale->getText("emails.certificate.signature")) {
$locale->setDefault('en');
}
$body = Template::fromFile(__DIR__ . '/../config/locale/templates/email-base.tpl');
$subject = \sprintf($locale->getText("emails.certificate.subject"), $domain);
$body->setParam('{{domain}}', $domain);
$body->setParam('{{error}}', $errorMessage);
$body->setParam('{{attempt}}', $attempt);
$body
->setParam('{{subject}}', $subject)
->setParam('{{hello}}', $locale->getText("emails.certificate.hello"))
->setParam('{{body}}', $locale->getText("emails.certificate.body"))
->setParam('{{redirect}}', 'https://' . $domain)
->setParam('{{footer}}', $locale->getText("emails.certificate.footer"))
->setParam('{{thanks}}', $locale->getText("emails.certificate.thanks"))
->setParam('{{signature}}', $locale->getText("emails.certificate.signature"))
->setParam('{{project}}', 'Console')
->setParam('{{direction}}', $locale->getText('settings.direction'))
->setParam('{{bg-body}}', '#f7f7f7')
->setParam('{{bg-content}}', '#ffffff')
->setParam('{{text-content}}', '#000000');
$body = $body->render();
$mail = new Mail();
$mail
->setType(MAIL_TYPE_CERTIFICATE)
->setRecipient(App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'))
->setUrl('https://' . $domain)
->setLocale(App::getEnv('_APP_LOCALE', 'en'))
->setName('Appwrite Administrator')
->setPayload([
'domain' => $domain,
'error' => $errorMessage,
'attempt' => $attempt
])
->trigger();
}
+79 -7
View File
@@ -1,10 +1,13 @@
<?php
use Appwrite\Event\Event;
use Appwrite\Extend\Exception;
use Appwrite\Messaging\Adapter\Realtime;
use Appwrite\Resque\Worker;
use Utopia\CLI\Console;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Helpers\ID;
require_once __DIR__ . '/../init.php';
@@ -89,16 +92,51 @@ class DatabaseV1 extends Worker
$format = $attribute->getAttribute('format', '');
$formatOptions = $attribute->getAttribute('formatOptions', []);
$filters = $attribute->getAttribute('filters', []);
$options = $attribute->getAttribute('options', []);
$project = $dbForConsole->getDocument('projects', $projectId);
try {
if (!$dbForProject->createAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) {
throw new Exception('Failed to create Attribute');
switch ($type) {
case Database::VAR_RELATIONSHIP:
$relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection']);
if ($relatedCollection->isEmpty()) {
throw new Exception('Collection not found');
}
if (
!$dbForProject->createRelationship(
collection: 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(),
relatedCollection: 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId(),
type: $options['relationType'],
twoWay: $options['twoWay'],
id: $key,
twoWayKey: $options['twoWayKey'],
onDelete: $options['onDelete'],
)
) {
throw new Exception('Failed to create Attribute');
}
if ($options['twoWay']) {
$relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $options['twoWayKey']);
$dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'available'));
}
break;
default:
if (!$dbForProject->createAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) {
throw new Exception('Failed to create Attribute');
}
}
$dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'available'));
} catch (\Throwable $th) {
Console::error($th->getMessage());
$dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'failed'));
if ($type === Database::VAR_RELATIONSHIP && $options['twoWay']) {
$relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $options['twoWayKey']);
$dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'failed'));
}
} finally {
$target = Realtime::fromPayload(
// Pass first, most verbose event pattern
@@ -121,6 +159,10 @@ class DatabaseV1 extends Worker
);
}
if ($type === Database::VAR_RELATIONSHIP && $options['twoWay']) {
$dbForProject->deleteCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId());
}
$dbForProject->deleteCachedDocument('database_' . $database->getInternalId(), $collectionId);
}
@@ -129,6 +171,7 @@ class DatabaseV1 extends Worker
* @param Document $collection
* @param Document $attribute
* @param string $projectId
* @throws Throwable
*/
protected function deleteAttribute(Document $database, Document $collection, Document $attribute, string $projectId): void
{
@@ -143,19 +186,43 @@ class DatabaseV1 extends Worker
$collectionId = $collection->getId();
$key = $attribute->getAttribute('key', '');
$status = $attribute->getAttribute('status', '');
$type = $attribute->getAttribute('type', '');
$project = $dbForConsole->getDocument('projects', $projectId);
$options = $attribute->getAttribute('options', []);
$relatedAttribute = new Document();
$relatedCollection = new Document();
// possible states at this point:
// - available: should not land in queue; controller flips these to 'deleting'
// - processing: hasn't finished creating
// - deleting: was available, in deletion queue for first time
// - failed: attribute was never created
// - stuck: attribute was available but cannot be removed
try {
if ($status !== 'failed' && !$dbForProject->deleteAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) {
throw new Exception('Failed to delete Attribute');
if ($status !== 'failed') {
if ($type === Database::VAR_RELATIONSHIP) {
if ($options['twoWay']) {
$relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection']);
if ($relatedCollection->isEmpty()) {
throw new Exception(Exception::COLLECTION_NOT_FOUND);
}
$relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $options['twoWayKey']);
}
if (!$dbForProject->deleteRelationship('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) {
$dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'stuck'));
throw new Exception('Failed to delete Relationship');
}
} elseif (!$dbForProject->deleteAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) {
throw new Exception('Failed to delete Attribute');
}
}
$dbForProject->deleteDocument('attributes', $attribute->getId());
if (!$relatedAttribute->isEmpty()) {
$dbForProject->deleteDocument('attributes', $relatedAttribute->getId());
}
} catch (\Throwable $th) {
Console::error($th->getMessage());
$dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'stuck'));
@@ -199,8 +266,8 @@ class DatabaseV1 extends Worker
// array_values wraps array_diff to reindex array keys
// when found attribute is removed from array
$attributes = \array_values(\array_diff($attributes, [$attributes[$found]]));
$lengths = \array_values(\array_diff($lengths, [$lengths[$found]]));
$orders = \array_values(\array_diff($orders, [$orders[$found]]));
$lengths = \array_values(\array_diff($lengths, isset($lengths[$found]) ? [$lengths[$found]] : []));
$orders = \array_values(\array_diff($orders, isset($orders[$found]) ? [$orders[$found]] : []));
if (empty($attributes)) {
$dbForProject->deleteDocument('indexes', $index->getId());
@@ -235,6 +302,11 @@ class DatabaseV1 extends Worker
$dbForProject->deleteCachedDocument('database_' . $database->getInternalId(), $collectionId);
$dbForProject->deleteCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId());
if (!$relatedCollection->isEmpty() && !$relatedAttribute->isEmpty()) {
$dbForProject->deleteCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId());
$dbForProject->deleteCachedCollection('database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId());
}
}
/**
+97 -10
View File
@@ -44,9 +44,6 @@ class DeletesV1 extends Worker
case DELETE_TYPE_DATABASES:
$this->deleteDatabase($document, $project->getId());
break;
case DELETE_TYPE_COLLECTIONS:
$this->deleteCollection($document, $project->getId());
break;
case DELETE_TYPE_PROJECTS:
$this->deleteProject($document);
break;
@@ -61,11 +58,18 @@ class DeletesV1 extends Worker
break;
case DELETE_TYPE_TEAMS:
$this->deleteMemberships($document, $project->getId());
if ($project->getId() === 'console') {
$this->deleteProjectsByTeam($document);
}
break;
case DELETE_TYPE_BUCKETS:
$this->deleteBucket($document, $project->getId());
break;
default:
if (\str_starts_with($document->getCollection(), 'database_')) {
$this->deleteCollection($document, $project->getId());
break;
}
Console::error('No lazy delete operation available for document of type: ' . $document->getCollection());
break;
}
@@ -172,6 +176,7 @@ class DeletesV1 extends Worker
/**
* @param Document $document database document
* @param string $projectId
* @throws Exception
*/
protected function deleteDatabase(Document $document, string $projectId): void
{
@@ -191,6 +196,7 @@ class DeletesV1 extends Worker
/**
* @param Document $document teams document
* @param string $projectId
* @throws Exception
*/
protected function deleteCollection(Document $document, string $projectId): void
{
@@ -200,6 +206,21 @@ class DeletesV1 extends Worker
$dbForProject = $this->getProjectDB($projectId);
$relationships = \array_filter(
$document->getAttribute('attributes'),
fn ($attribute) => $attribute['type'] === Database::VAR_RELATIONSHIP
);
foreach ($relationships as $relationship) {
if (!$relationship['twoWay']) {
continue;
}
$relatedCollection = $dbForProject->getDocument('database_' . $databaseInternalId, $relationship['relatedCollection']);
$dbForProject->deleteDocument('attributes', $databaseInternalId . '_' . $relatedCollection->getInternalId() . '_' . $relationship['twoWayKey']);
$dbForProject->deleteCachedDocument('database_' . $databaseInternalId, $relatedCollection->getId());
$dbForProject->deleteCachedCollection('database_' . $databaseInternalId . '_collection_' . $relatedCollection->getInternalId());
}
$dbForProject->deleteCollection('database_' . $databaseInternalId . '_collection_' . $document->getInternalId());
$this->deleteByGroup('attributes', [
@@ -217,6 +238,7 @@ class DeletesV1 extends Worker
/**
* @param string $hourlyUsageRetentionDatetime
* @throws Exception
*/
protected function deleteUsageStats(string $hourlyUsageRetentionDatetime)
{
@@ -232,6 +254,7 @@ class DeletesV1 extends Worker
/**
* @param Document $document teams document
* @param string $projectId
* @throws Exception
*/
protected function deleteMemberships(Document $document, string $projectId): void
{
@@ -243,27 +266,82 @@ class DeletesV1 extends Worker
], $this->getProjectDB($projectId));
}
/**
* @param \Utopia\Database\Document $document
* @return void
* @throws \Exception
*/
protected function deleteProjectsByTeam(Document $document): void
{
$dbForConsole = $this->getConsoleDB();
$projects = $dbForConsole->find('projects', [
Query::equal('teamInternalId', [$document->getInternalId()])
]);
foreach ($projects as $project) {
$this->deleteProject($project);
}
}
/**
* @param Document $document project document
* @throws Exception
*/
protected function deleteProject(Document $document): void
{
$projectId = $document->getId();
// Delete all DBs
$this->getProjectDB($projectId)->delete($projectId);
// Delete project domains and certificates
$dbForConsole = $this->getConsoleDB();
$domains = $dbForConsole->find('domains', [
Query::equal('projectInternalId', [$document->getInternalId()])
]);
foreach ($domains as $domain) {
$this->deleteCertificates($domain);
}
// Delete project tables
$dbForProject = $this->getProjectDB($projectId, $document);
while (true) {
$collections = $dbForProject->listCollections();
if (empty($collections)) {
break;
}
foreach ($collections as $collection) {
$dbForProject->deleteCollection($collection->getId());
}
}
// Delete metadata tables
try {
$dbForProject->deleteCollection('_metadata');
} catch (Exception) {
// Ignore: deleteCollection tries to delete a metadata entry after the collection is deleted,
// which will throw an exception here because the metadata collection is already deleted.
}
// Delete all storage directories
$uploads = $this->getFilesDevice($document->getId());
$cache = new Local(APP_STORAGE_CACHE . '/app-' . $document->getId());
$uploads = $this->getFilesDevice($projectId);
$functions = $this->getFunctionsDevice($projectId);
$builds = $this->getBuildsDevice($projectId);
$cache = $this->getCacheDevice($projectId);
$uploads->delete($uploads->getRoot(), true);
$functions->delete($functions->getRoot(), true);
$builds->delete($builds->getRoot(), true);
$cache->delete($cache->getRoot(), true);
}
/**
* @param Document $document user document
* @param string $projectId
* @throws Exception
*/
protected function deleteUser(Document $document, string $projectId): void
{
@@ -305,6 +383,7 @@ class DeletesV1 extends Worker
/**
* @param string $datetime
* @throws Exception
*/
protected function deleteExecutionLogs(string $datetime): void
{
@@ -337,6 +416,7 @@ class DeletesV1 extends Worker
/**
* @param string $datetime
* @throws Exception
*/
protected function deleteRealtimeUsage(string $datetime): void
{
@@ -393,6 +473,7 @@ class DeletesV1 extends Worker
/**
* @param string $resource
* @param string $projectId
* @throws Exception
*/
protected function deleteAuditLogsByResource(string $resource, string $projectId): void
{
@@ -406,6 +487,7 @@ class DeletesV1 extends Worker
/**
* @param Document $document function document
* @param string $projectId
* @throws Exception
*/
protected function deleteFunction(Document $document, string $projectId): void
{
@@ -479,6 +561,7 @@ class DeletesV1 extends Worker
/**
* @param Document $document deployment document
* @param string $projectId
* @throws Exception
*/
protected function deleteDeployment(Document $document, string $projectId): void
{
@@ -528,9 +611,10 @@ class DeletesV1 extends Worker
/**
* @param Document $document to be deleted
* @param Database $database to delete it from
* @param callable $callback to perform after document is deleted
* @param callable|null $callback to perform after document is deleted
*
* @return bool
* @throws \Utopia\Database\Exception\Authorization
*/
protected function deleteById(Document $document, Database $database, callable $callback = null): bool
{
@@ -550,6 +634,7 @@ class DeletesV1 extends Worker
/**
* @param callable $callback
* @throws Exception
*/
protected function deleteForProjectIds(callable $callback): void
{
@@ -584,9 +669,10 @@ class DeletesV1 extends Worker
/**
* @param string $collection collectionID
* @param Query[] $queries
* @param array $queries
* @param Database $database
* @param callable $callback
* @param callable|null $callback
* @throws Exception
*/
protected function deleteByGroup(string $collection, array $queries, Database $database, callable $callback = null): void
{
@@ -620,6 +706,7 @@ class DeletesV1 extends Worker
/**
* @param Document $document certificates document
* @throws \Utopia\Database\Exception\Authorization
*/
protected function deleteCertificates(Document $document): void
{
+3 -3
View File
@@ -14,10 +14,10 @@ use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
use Utopia\Database\Document;
use Utopia\Database\ID;
use Utopia\Database\Permission;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Query;
use Utopia\Database\Role;
use Utopia\Database\Helpers\Role;
require_once __DIR__ . '/../init.php';
+3 -104
View File
@@ -1,11 +1,8 @@
<?php
use Appwrite\Resque\Worker;
use Appwrite\Template\Template;
use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Database\Document;
use Utopia\Locale\Locale;
require_once __DIR__ . '/../init.php';
@@ -32,67 +29,12 @@ class MailsV1 extends Worker
return;
}
$project = new Document($this->args['project'] ?? []);
$user = new Document($this->args['user'] ?? []);
$team = new Document($this->args['team'] ?? []);
$payload = $this->args['payload'] ?? [];
$recipient = $this->args['recipient'];
$url = $this->args['url'];
$subject = $this->args['subject'];
$name = $this->args['name'];
$type = $this->args['type'];
$prefix = $this->getPrefix($type);
$locale = new Locale($this->args['locale']);
$projectName = $project->isEmpty() ? 'Console' : $project->getAttribute('name', '[APP-NAME]');
if (!$this->doesLocaleExist($locale, $prefix)) {
$locale->setDefault('en');
}
$from = $project->isEmpty() || $project->getId() === 'console' ? '' : \sprintf($locale->getText('emails.sender'), $projectName);
$body = Template::fromFile(__DIR__ . '/../config/locale/templates/email-base.tpl');
$subject = '';
switch ($type) {
case MAIL_TYPE_CERTIFICATE:
$domain = $payload['domain'];
$error = $payload['error'];
$attempt = $payload['attempt'];
$subject = \sprintf($locale->getText("$prefix.subject"), $domain);
$body->setParam('{{domain}}', $domain);
$body->setParam('{{error}}', $error);
$body->setParam('{{attempt}}', $attempt);
break;
case MAIL_TYPE_INVITATION:
$subject = \sprintf($locale->getText("$prefix.subject"), $team->getAttribute('name'), $projectName);
$body->setParam('{{owner}}', $user->getAttribute('name'));
$body->setParam('{{team}}', $team->getAttribute('name'));
break;
case MAIL_TYPE_RECOVERY:
case MAIL_TYPE_VERIFICATION:
case MAIL_TYPE_MAGIC_SESSION:
$subject = $locale->getText("$prefix.subject");
break;
default:
throw new Exception('Undefined Mail Type : ' . $type, 500);
}
$body
->setParam('{{subject}}', $subject)
->setParam('{{hello}}', $locale->getText("$prefix.hello"))
->setParam('{{name}}', $name)
->setParam('{{body}}', $locale->getText("$prefix.body"))
->setParam('{{redirect}}', $url)
->setParam('{{footer}}', $locale->getText("$prefix.footer"))
->setParam('{{thanks}}', $locale->getText("$prefix.thanks"))
->setParam('{{signature}}', $locale->getText("$prefix.signature"))
->setParam('{{project}}', $projectName)
->setParam('{{direction}}', $locale->getText('settings.direction'))
->setParam('{{bg-body}}', '#f7f7f7')
->setParam('{{bg-content}}', '#ffffff')
->setParam('{{text-content}}', '#000000');
$body = $body->render();
$body = $this->args['body'];
$from = $this->args['from'];
/** @var \PHPMailer\PHPMailer\PHPMailer $mail */
$mail = $register->get('smtp');
@@ -130,47 +72,4 @@ class MailsV1 extends Worker
public function shutdown(): void
{
}
/**
* Returns a prefix from a mail type
*
* @param $type
*
* @return string
*/
protected function getPrefix(string $type): string
{
switch ($type) {
case MAIL_TYPE_RECOVERY:
return 'emails.recovery';
case MAIL_TYPE_CERTIFICATE:
return 'emails.certificate';
case MAIL_TYPE_INVITATION:
return 'emails.invitation';
case MAIL_TYPE_VERIFICATION:
return 'emails.verification';
case MAIL_TYPE_MAGIC_SESSION:
return 'emails.magicSession';
default:
throw new Exception('Undefined Mail Type : ' . $type, 500);
}
}
/**
* Returns true if all the required terms in a locale exist. False otherwise
*
* @param $locale
* @param $prefix
*
* @return bool
*/
protected function doesLocaleExist(Locale $locale, string $prefix): bool
{
if (!$locale->getText('emails.sender') || !$locale->getText("$prefix.hello") || !$locale->getText("$prefix.subject") || !$locale->getText("$prefix.body") || !$locale->getText("$prefix.footer") || !$locale->getText("$prefix.thanks") || !$locale->getText("$prefix.signature")) {
return false;
}
return true;
}
}
+12 -11
View File
@@ -43,33 +43,34 @@
"ext-sockets": "*",
"appwrite/php-clamav": "1.1.*",
"appwrite/php-runtimes": "0.11.*",
"utopia-php/abuse": "0.16.*",
"utopia-php/abuse": "0.24.*",
"utopia-php/analytics": "0.2.*",
"utopia-php/audit": "0.17.*",
"utopia-php/audit": "0.25.*",
"utopia-php/cache": "0.8.*",
"utopia-php/cli": "0.13.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.28.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/database": "0.35.*",
"utopia-php/domains": "1.1.*",
"utopia-php/framework": "0.25.*",
"utopia-php/framework": "0.28.*",
"utopia-php/image": "0.5.*",
"utopia-php/locale": "0.4.*",
"utopia-php/logger": "0.3.*",
"utopia-php/messaging": "0.1.*",
"utopia-php/orchestration": "0.6.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/registry": "0.5.*",
"utopia-php/storage": "0.11.*",
"utopia-php/swoole": "0.4.*",
"utopia-php/websocket": "0.1.0",
"utopia-php/storage": "0.14.*",
"utopia-php/swoole": "0.5.*",
"utopia-php/websocket": "0.1.*",
"resque/php-resque": "1.3.6",
"matomo/device-detector": "6.0.0",
"matomo/device-detector": "6.0.*",
"dragonmantank/cron-expression": "3.3.1",
"influxdb/influxdb-php": "1.15.2",
"phpmailer/phpmailer": "6.6.0",
"chillerlan/php-qrcode": "4.3.3",
"adhocore/jwt": "1.1.2",
"slickdeals/statsd": "3.1.0"
"slickdeals/statsd": "3.1.0",
"webonyx/graphql-php": "14.11.*"
},
"repositories": [
{
@@ -78,7 +79,7 @@
}
],
"require-dev": {
"appwrite/sdk-generator": "0.28.*",
"appwrite/sdk-generator": "0.32.*",
"ext-fileinfo": "*",
"phpunit/phpunit": "9.5.20",
"squizlabs/php_codesniffer": "^3.6",
Generated
+731 -256
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
<?php
echo 'execute init_file success' . PHP_EOL;
Yasd\Api\setRemoteHost('127.0.0.1'); //Set your development machine's IP
Yasd\Api\setRemoteHost('host.docker.internal'); //Set your development machine's IP
+18 -3
View File
@@ -83,7 +83,7 @@ services:
- ./docs:/usr/src/code/docs
- ./public:/usr/src/code/public
- ./src:/usr/src/code/src
- ./dev:/usr/local/dev
- ./dev:/usr/src/code/dev
depends_on:
- mariadb
- redis
@@ -174,6 +174,9 @@ services:
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY
- _APP_SMS_PROVIDER
- _APP_SMS_FROM
- _APP_GRAPHQL_MAX_BATCH_SIZE
- _APP_GRAPHQL_MAX_COMPLEXITY
- _APP_GRAPHQL_MAX_DEPTH
appwrite-realtime:
entrypoint: realtime
@@ -341,7 +344,6 @@ services:
volumes:
- ./app:/usr/src/code/app
- ./src:/usr/src/code/src
#- ./vendor/utopia-php/database:/usr/src/code/vendor/utopia-php/database
depends_on:
- redis
- mariadb
@@ -471,6 +473,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
- ./app:/usr/src/code/app
- ./src:/usr/src/code/src
- ./dev:/usr/src/code/dev
- appwrite-functions:/storage/functions:rw
- appwrite-builds:/storage/builds:rw
- /tmp:/tmp:rw
@@ -552,6 +555,7 @@ services:
entrypoint: worker-messaging
<<: *x-logging
container_name: appwrite-worker-messaging
restart: unless-stopped
image: appwrite-dev
networks:
- appwrite
@@ -615,7 +619,6 @@ services:
volumes:
- ./app:/usr/src/code/app
- ./src:/usr/src/code/src
- ./dev:/usr/local/dev
depends_on:
- influxdb
- mariadb
@@ -819,6 +822,18 @@ services:
# ports:
# - '3001:80'
graphql-explorer:
container_name: appwrite-graphql-explorer
image: appwrite/altair:0.3.0
restart: unless-stopped
networks:
- appwrite
ports:
- "9509:3000"
environment:
- SERVER_URL=http://localhost/v1/graphql
# Dev Tools End ------------------------------------------------------------------------------------------
networks:
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createAnonymousSession(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createEmailSession(
"email@example.com",
"password"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createJWT(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createMagicURLSession(
"[USER_ID]",
"email@example.com",
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createOAuth2Session(
"amazon",
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createPhoneSession(
"[USER_ID]",
"+12065550100"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createPhoneVerification(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createRecovery(
"email@example.com",
"https://example.com"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.createVerification(
"https://example.com"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,23 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.create(
"[USER_ID]",
"email@example.com",
"password",
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.deleteSession(
"[SESSION_ID]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.deleteSessions(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.getPrefs(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.getSession(
"[SESSION_ID]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.get(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,20 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.listLogs(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,18 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.listSessions(new CoroutineCallback<>((result, error) -> {
if (error != null)
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
}));
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.updateEmail(
"email@example.com",
"password"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.updateMagicURLSession(
"[USER_ID]",
"[SECRET]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.updateName(
"[NAME]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
Client client = new Client(context)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
Account account = new Account(client);
account.updatePassword(
"password",
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);

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