Compare commits

...
1816 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
Christy JacobandGitHub e22ad54e39 Merge pull request #4814 from appwrite/fix-mimetype-size
Fix: mimetype size
2022-12-16 21:07:43 +05:30
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
Matej Bačo 4ee8fd5629 Add cache clean 2022-12-16 10:39:53 +01: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
Matej Bačo 0a177713f0 Implement migration for mimeType 2022-12-07 11:01:58 +00: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
Matej Bačo ea58cb4aff Update changelog 2022-12-05 14:57:24 +00:00
Matej Bačo 4dfaa5e69a Fix mimetype size 2022-12-05 14:54:13 +00: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
Christy JacobandGitHub 8dfdef6006 Merge pull request #4756 from appwrite/docs-update-examples
Update examples for Swift, Kotlin, Web, Android and Apple
2022-11-26 12:16:24 +05:30
Eldad A. FuxandGitHub 5dbed8329e Merge pull request #4780 from appwrite/fix-region-parameter
Get default region param from env
2022-11-25 21:35:08 +02:00
Eldad A. FuxandGitHub a983630e0e Merge pull request #4740 from appwrite/doc-link-seo
Updated the error descriptions for better SEO.
2022-11-25 17:24:04 +02:00
Jake Barnby f44a642998 Get from env in param call 2022-11-25 17:27:19 +13:00
Jake Barnby cefd5660b9 Merge remote-tracking branch 'origin/master' into fix-region-parameter
# Conflicts:
#	CHANGES.md
2022-11-25 10:42:27 +13:00
Jake Barnby 9d0cbd3b68 Update changelog 2022-11-25 10:39:53 +13:00
Jake Barnby 6070e1de54 Add defaulted region test 2022-11-25 10:37:11 +13:00
Jake Barnby de38fed306 Fix empty check 2022-11-25 10:29:22 +13:00
Christy JacobandGitHub 30eda18ac1 Merge pull request #4776 from appwrite/fix-team-invite-verification-main
Fix: unsaved changes in team invitation
2022-11-24 19:18:47 +05:30
Torsten DittmannandGitHub 25f3d4a59b Merge pull request #4771 from appwrite/chore-release-1-1-2
chore: release 1.1.2
2022-11-24 13:15:37 +01:00
Matej Bačo 8b71e318c2 Fix tests bug 2022-11-24 11:55:49 +00:00
Matej BačoandGitHub 0cb2ed14f4 Improve tests 2022-11-24 12:40:17 +01:00
Matej BačoandGitHub 5e872f2fe5 Update changelog 2022-11-24 12:36:14 +01:00
Matej BačoandGitHub efe093ce3c Fix unsaved changes in team inv 2022-11-24 12:35:26 +01:00
Jake Barnby bb01a6d817 Get default region param from env 2022-11-24 11:23:59 +13:00
Torsten Dittmann b44a100439 Merge branch 'master' of https://github.com/appwrite/appwrite into chore-release-1-1-2 2022-11-23 19:00:15 +01:00
Torsten DittmannandGitHub 6d3adeb4ed Merge pull request #4725 from appwrite/fix-4714-fix-default-oauth-path
Fix the default oauth paths to match the route
2022-11-23 19:00:02 +01:00
Steven Nguyen 01556184c7 Fix the default oauth paths to match the route 2022-11-23 09:57:49 -08:00
Torsten Dittmann dcbdbfa053 Merge branch 'master' of https://github.com/appwrite/appwrite into chore-release-1-1-2 2022-11-23 18:53:51 +01:00
Torsten DittmannandGitHub 4d4ed16839 Merge pull request #4761 from codercatdev/fix-623-locale-api-unknown-continent
Fix: Unknown Continent Issue for Locale API
2022-11-23 18:53:41 +01:00
Torsten DittmannandGitHub b819381bed Merge branch 'master' into fix-623-locale-api-unknown-continent 2022-11-23 18:52:39 +01:00
Torsten DittmannandGitHub 20c538ec83 chore: update changelog 2022-11-23 18:52:09 +01:00
Torsten DittmannandGitHub 991d8749b2 Merge pull request #4757 from gepd/null-failure
bug fix: failure status shoudn't be nulled
2022-11-23 18:51:02 +01:00
Torsten DittmannandGitHub 5f0f03c170 Merge pull request #4737 from appwrite/fix-function-status-missing
Fix: Missing execution status
2022-11-23 18:47:25 +01:00
Torsten DittmannandGitHub 2e9087285d Merge branch 'master' into fix-function-status-missing 2022-11-23 18:47:15 +01:00
Torsten Dittmann b382031ae7 chore: release 1.1.1 2022-11-23 18:43:48 +01:00
Torsten DittmannandGitHub 8406551cef Merge pull request #4739 from appwrite/fix-session-expiry
Fix session expiration
2022-11-23 17:52:20 +01:00
Torsten DittmannandGitHub 0d0de17d15 Merge branch 'master' into fix-session-expiry 2022-11-23 17:51:51 +01:00
fogelito c02d04b5fa Merge remote-tracking branch 'origin/master' 2022-11-23 11:30:43 +02:00
Christy JacobandGitHub 2a7fae54e0 Merge pull request #4763 from appwrite/fix-region-parameter
Make region optional with default of 'default'
2022-11-23 12:06:50 +05:30
Jake Barnby 1e1ab2a8ae Update changelog 2022-11-23 18:22:44 +13:00
Jake Barnby bd0139ef3b Make region optional with default of 'default' 2022-11-23 18:16:57 +13:00
Alex Patterson 5f80f87ba9 fixed continent spelling 2022-11-22 19:00:07 -05:00
Alex Patterson 56d8c176dd add update to changelog 2022-11-22 18:54:50 -05:00
Alex Patterson ad1587872b remove dup line 2022-11-22 18:49:31 -05:00
Christy JacobandGitHub 1f7a4b86d1 Merge pull request #4755 from appwrite/feat-console-build-args
feat: add build args for console
2022-11-23 01:43:57 +05:30
gepdandGitHub a231a9853f Merge branch 'appwrite:master' into null-failure 2022-11-22 17:10:55 -03:00
gepdandGitHub 64ba896738 bug fix: failure status shoudn't be nulled 2022-11-22 17:05:04 -03:00
Christy Jacob 4813e6b4d5 feat: add console mode 2022-11-22 19:32:35 +00:00
Vincent (Wen Yu) Ge 315eaaa562 Update examples for Swift, Kotlin, Web, Android and Apple 2022-11-22 19:19:43 +00:00
fc752039a4 Update Dockerfile
Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
2022-11-23 00:29:26 +05:30
Christy Jacob d2b0218aba feat: add build args for console 2022-11-22 18:26:41 +00: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
Christy JacobandGitHub de8552e901 Merge pull request #4735 from appwrite/fix-hsts
Enable HSTS for all HTTPS requests
2022-11-21 22:11:50 +05:30
Steven Nguyen 7b09fa3f17 Update contributing guide to include submodule update command 2022-11-21 08:28:29 -08:00
Vincent (Wen Yu) Ge 7f95ff31bd Updated the error descriptions for better SEO. 2022-11-21 15:37:34 +00:00
Matej Bačo eda112755a Update changelogs 2022-11-21 14:26:59 +00:00
Matej Bačo dd99ab7b00 Fix session expiration 2022-11-21 14:24:52 +00:00
Matej BačoandGitHub e7fc427291 Remove failing test 2022-11-21 15:10:55 +01:00
Matej Bačo d2362aeab0 Improve performance 2022-11-21 11:43:20 +00:00
Matej Bačo 831960245f Permission bug fix 2022-11-21 11:20:52 +00:00
fogelito 948f09bea9 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	composer.lock
2022-11-21 12:20:28 +02:00
Matej Bačo 8feb3dc43c Update changelog 2022-11-21 09:40:50 +00:00
Matej Bačo 0ee49e7895 Fix missing execution status 2022-11-21 09:38:36 +00:00
Eldad A. FuxandGitHub a80da7526d Merge pull request #4684 from appwrite/fix-gitpod-submodules
Fix: Gitpod prebuilds
2022-11-21 10:36:25 +02:00
Jake Barnby ce1b41b312 Merge branch 'master' into sync-1.2.x 2022-11-21 17:28:43 +13:00
Jake Barnby 4a61718cff Enable HSTS for all HTTPS requests 2022-11-21 16:49:45 +13:00
Matej BačoandGitHub 3353bad8ff Apply suggestions from code review 2022-11-18 08:03:01 +01: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
Christy JacobandGitHub 8f6a151980 Merge pull request #4696 from appwrite/feat-community-files
Feat community files
2022-11-17 23:20:30 +05:30
Torsten DittmannandGitHub 673b0bb083 Merge pull request #4706 from appwrite/chore-prepare-1-1-1
chore: prepare 1.1.1 release
2022-11-17 17:13:03 +01:00
Torsten Dittmann dd34dfce22 fix: migration for oauthproviders 2022-11-17 15:33:46 +01:00
Torsten Dittmann bba9284c3e chore: add comments to v16 migration 2022-11-17 14:58:16 +01:00
Torsten Dittmann d1eae37577 fix: make migration for oauth providers non-destructive 2022-11-17 14:57:27 +01:00
Torsten Dittmann 727c3839d6 feat: upgrade console to 2.0.1 2022-11-17 14:52:44 +01:00
Torsten Dittmann 36cc6d8621 chore: prepare 1.1.1 release 2022-11-17 14:38:49 +01:00
Torsten DittmannandGitHub ac73be78b5 Merge pull request #4704 from appwrite/fix-migration-usage-region
fix: migration for stats region
2022-11-17 14:24:51 +01:00
Torsten Dittmann a252c7e469 chore: update changelog 2022-11-17 13:39:16 +01:00
Torsten Dittmann 8d3903cd37 fix: remove layout 2022-11-17 13:37:59 +01:00
Torsten Dittmann e7189efcff chore: update changelog 2022-11-17 12:38:39 +01:00
Torsten Dittmann 53adb4e114 fix: migration for oauth providers 2022-11-17 12:38:09 +01:00
Torsten Dittmann 6567b23c85 chore: update changelog 2022-11-17 12:26:58 +01:00
Torsten Dittmann 30f088ad35 fix: cache cleaning on migration 2022-11-17 12:26:14 +01:00
Torsten Dittmann 00ec95fc9f chore: add changelog 2022-11-17 11:35:29 +01:00
Torsten Dittmann eb5e853f2d fix: migration for stats region 2022-11-17 11:31:24 +01: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
Steven Nguyen 3d01bf6505 Update links to code of conduct 2022-11-16 20:37:24 -08:00
Christy JacobandGitHub f63aeb50a1 Merge pull request #4699 from appwrite/1.1.x-examples
1.1.x examples
2022-11-17 09:48:31 +05:30
Wen Yu Ge a58dbe7c66 Fix java and kotlin examples folder structure 2022-11-16 18:43:27 -05:00
Wen Yu Ge db79f92b39 Add examples for 1.1.x 2022-11-16 18:35:44 -05:00
Steven Nguyen 2ede405784 Remove issue templates in favor of org level files 2022-11-16 10:51:19 -08:00
Steven Nguyen a309beddf5 Update supported versions 2022-11-16 10:51:19 -08:00
Steven Nguyen 4a495f61d5 Remove code of conduct in favor of the org level file 2022-11-16 10:51:13 -08:00
Christy JacobandGitHub 7d8162309c Merge pull request #4662 from appwrite/fix-deletes-worker
fix: use getDevice in deletes worker
2022-11-16 19:54:33 +05:30
Christy Jacob 17a36dbce3 feat: update changelog 2022-11-16 11:15:24 +00:00
Christy Jacob 956eab5ab5 Merge branch 'master' of https://github.com/appwrite/appwrite into fix-deletes-worker 2022-11-16 11:11:15 +00:00
Christy Jacob 08a986e433 Merge branch '1.1.x' of https://github.com/appwrite/appwrite into fix-deletes-worker 2022-11-16 11:10:39 +00:00
Eldad A. FuxandGitHub 1498d0f628 Merge pull request #4688 from appwrite/update-console-announcement-blog
Fix: Update announcement blog in Readme
2022-11-16 12:34:23 +02:00
Aditya Oberai fbebf7deac Update announcement blog in Readme 2022-11-16 10:31:30 +00:00
Torsten DittmannandGitHub c585dfda16 Merge pull request #4687 from appwrite/christyjacob4-patch-4
Update CHANGES.md
2022-11-16 11:19:44 +01:00
Christy JacobandGitHub 5ca7b5ffe8 Update CHANGES.md 2022-11-16 15:47:40 +05:30
Christy JacobandGitHub 8411e81e28 Update CHANGES.md 2022-11-16 15:43:07 +05:30
Torsten DittmannandGitHub 68cc1b5db4 Merge pull request #4686 from appwrite/chore-generate-specs
chore: generate specs
2022-11-16 11:03:26 +01:00
Torsten Dittmann 410533be27 chore: generate specs 2022-11-16 11:01:49 +01:00
Torsten DittmannandGitHub f85b8a5bdc Merge pull request #4685 from appwrite/fix-github-images
fix: github images
2022-11-16 10:27:06 +01:00
Torsten Dittmann 8faa46de9b fix: remove unused github-logo 2022-11-16 10:26:00 +01:00
Torsten Dittmann d3b8d49a3e fix: github images 2022-11-16 10:18:49 +01:00
Matej Bačo cd4b7c1c36 Improve git prebuilds 2022-11-16 09:15:34 +00:00
Torsten DittmannandGitHub aae2cea73a Merge pull request #4681 from appwrite/1.1.x
1.1.x -> master
2022-11-16 09:52:19 +01:00
Torsten DittmannandGitHub fbb9bb8941 Merge pull request #4682 from appwrite/fix-sync-1-1-x
sync: 1.1.x
2022-11-16 09:05:28 +01:00
Torsten Dittmann 3ffd59f18c update version numbers 2022-11-16 09:03:39 +01:00
Torsten Dittmann da4e7536ca Merge branch 'master' of https://github.com/appwrite/appwrite into 1.1.x 2022-11-16 09:00:50 +01:00
Torsten DittmannandGitHub 3cb97a62c8 Merge pull request #4655 from appwrite/feat-console-rewrite
feat: console submodule
2022-11-16 08:57:03 +01:00
Eldad A. FuxandGitHub b80e82e9c1 Merge pull request #4680 from appwrite/update-console-image-readme
Feat: Update console image in Readme
2022-11-16 09:45:19 +02:00
Aditya Oberai b71ddd1d26 Update console image in Readme 2022-11-16 07:14:44 +00: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
Torsten Dittmann 9c95e40458 fix: console to use tag 2022-11-15 23:56:33 +00:00
Torsten DittmannandGitHub 40c71a7b53 ci. fix submodules 2022-11-16 00:41:37 +01:00
Torsten DittmannandGitHub 9a09ee23f1 ci: fix submodule url 2022-11-16 00:38:48 +01:00
Torsten DittmannandGitHub deefff537d ci: fetch submodules 2022-11-16 00:37:13 +01:00
Torsten Dittmann 3b6035b585 chore: update console 2022-11-15 18:59:04 +01:00
Torsten Dittmann 912636b54c Merge branch '1.1.x' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-15 18:22:49 +01:00
Torsten DittmannandGitHub 27ddf8630b Merge pull request #4661 from appwrite/fix-cache-permissions
enabling file permissions
2022-11-15 18:03:10 +01:00
Torsten Dittmann 50dc4c3790 chore: refresh specs 2022-11-15 16:43:42 +01:00
Torsten Dittmann 841c5479ed Merge branch '1.1.x' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-15 16:39:52 +01:00
Torsten Dittmann 68e1a0b114 fix: remove unused import 2022-11-15 16:31:38 +01:00
Torsten Dittmann 1b533daeaa fix: remove manifest endpoint 2022-11-15 16:30:53 +01:00
Torsten Dittmann 5db924627a fix: tests 2022-11-15 16:28:33 +01:00
Torsten Dittmann 29edecf05d fix: tests 2022-11-15 16:19:13 +01:00
shimon ee0950449a Merge branch '1.1.x' of github.com:appwrite/appwrite into fix-cache-permissions 2022-11-15 17:17:58 +02:00
shimon 18618b8e8b cancel cache via avatar::initials 2022-11-15 17:17:35 +02:00
Torsten DittmannandGitHub 006cb4665e Merge pull request #4674 from appwrite/fix-usage-executions
Fix: usage executions
2022-11-15 15:39:12 +01:00
Torsten Dittmann aff29ed197 fix: update console 2022-11-15 15:36:37 +01:00
Torsten Dittmann ef1e5a9674 Merge branch '1.1.x' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-15 15:36:25 +01:00
Torsten DittmannandGitHub 344669db46 Merge pull request #4677 from appwrite/fix-realtime-console-project
chore: prepare release
2022-11-15 15:35:52 +01:00
Torsten Dittmann 10695a021a fix: usage tests timeout 2022-11-15 15:35:42 +01:00
Torsten DittmannandGitHub 62618445e9 Merge pull request #4675 from appwrite/feat-implement-session-length-api
Fix Session API Defaults and convert from minutes to seconds
2022-11-15 15:34:03 +01:00
Torsten Dittmann 35b7a2ee96 fix: linter 2022-11-15 15:22:57 +01:00
Torsten Dittmann 85ed70f346 fix: remove Dockerfile leftovers 2022-11-15 14:02:14 +01:00
Torsten Dittmann 522ae8d538 feat: migration for 1.1.x 2022-11-15 13:59:35 +01:00
Torsten Dittmann 7288520f38 fix: realtime console project 2022-11-15 13:30:18 +01:00
Bradley Schofield f5a4701944 Run Linter 2022-11-15 10:38:02 +00:00
Bradley Schofield f0052cbd8e Update Tests 2022-11-15 10:31:32 +00:00
Bradley Schofield a51288da57 Update projects.php 2022-11-15 10:25:34 +00:00
Bradley Schofield 64b725a6f7 Update Defaults 2022-11-15 10:19:35 +00:00
Matej Bačo e1ecf9aad7 Fix failing test 2022-11-15 09:41:55 +00:00
Matej Bačo 8dd5eb09f0 Fix executions usage count 2022-11-15 09:33:07 +00:00
Torsten Dittmann c621b66195 fix: upgrade console 2022-11-14 22:54:38 +01:00
Torsten Dittmann aea13bad72 Merge branch 'chore-prepare-1-1-0' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-14 22:54:23 +01:00
Torsten Dittmann 825738ced9 chore: prepare 1.1.x 2022-11-14 22:42:48 +01:00
Torsten DittmannandGitHub a376bdcb60 Merge pull request #4618 from appwrite/feat-implement-session-length-api
Implement Variable Session Duration
2022-11-14 22:35:13 +01:00
Torsten Dittmann 9412013360 feat: remove stuff 2022-11-14 21:58:51 +01:00
Bradley Schofield 3c71164741 Merge branch '1.1.x' into feat-implement-session-length-api 2022-11-14 15:30:38 +00:00
Torsten Dittmann c784cab798 fix: remove asterik 2022-11-14 16:26:10 +01:00
a14ab321bf Update app/controllers/api/projects.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-11-14 15:18:40 +00:00
Torsten Dittmann 310ff90d22 Merge branch '1.1.x' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-14 15:57:40 +01:00
Torsten Dittmann 465dad522e fix: remove unnecessary files 2022-11-14 15:31:24 +01:00
Bradley Schofield a19e668d79 Update storage.php 2022-11-14 13:11:43 +00:00
Bradley Schofield 6260a1a156 change authDuration to duration and update tests 2022-11-14 13:00:50 +00:00
Ikko AshimineandGitHub 956db2ec2f Fix typo in Model/Locale.php
Europian -> European
2022-11-14 21:31:08 +09:00
Bradley Schofield 60a63d9eb9 Update ProjectsConsoleClientTest.php 2022-11-14 11:43:28 +00:00
Bradley Schofield 43d4d6fec3 Address Eldad's Comments 2022-11-14 09:57:37 +00:00
c76057fd37 Update app/controllers/api/projects.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-11-14 09:54:49 +00:00
36d4719a3b Update app/controllers/api/projects.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-11-14 09:54:40 +00:00
Bradley Schofield 0b883df5ec Fix Tests 2022-11-14 09:42:18 +00:00
Bradley Schofield cdb4c60c3c Run Linter 2022-11-14 09:33:49 +00:00
Bradley Schofield 66b805829c Move authDuration into auths attribute in project 2022-11-14 09:30:45 +00:00
Bradley Schofield f6b7e0392b Give auth duration it's own endpoint 2022-11-14 09:15:55 +00:00
Christy Jacob b4bf0cf8d0 Merge branch '1.1.x' of https://github.com/appwrite/appwrite into fix-deletes-worker 2022-11-14 08:11:26 +00:00
Christy Jacob 72a37516d3 feat: address review comments: 2022-11-11 13:54:05 +00:00
shimon 180262d166 Merge branch '1.1.x' of github.com:appwrite/appwrite into fix-cache-permissions 2022-11-11 13:18:33 +02:00
shimon 7723762dd1 cache buster added to cache key 2022-11-11 12:41:41 +02:00
shimon df791068d6 enabling cached file permissions validation
via  storage::preview
2022-11-10 16:43:17 +02:00
Christy Jacob f2f56aa310 chore: update changelog 2022-11-10 13:51:32 +00:00
Christy Jacob d664549495 fix: use getDevice in deletes worker 2022-11-10 13:48:55 +00:00
Eldad A. FuxandGitHub 02a432102d Merge pull request #4652 from appwrite/feat-update-security-policy
Update supported versions in security policy
2022-11-10 12:55:34 +02:00
shimon f9671ee855 enabling file permissions
via cache preview
2022-11-10 12:08:01 +02:00
Eldad A. FuxandGitHub fa591c8c2f Merge pull request #4658 from appwrite/feat-fix-bandwidth-stats
fix difference in naming in inbound and outbound usage metrics
2022-11-10 11:05:47 +02:00
Eldad A. FuxandGitHub 42cedf8ed0 Merge pull request #3909 from appwrite/feat-usage-refactor
new stats to count resources
2022-11-10 11:05:36 +02:00
Damodar Lohani 4479497dfe fix difference in naming 2022-11-10 05:28:56 +00:00
Torsten Dittmann 9f384e016f Merge branch '1.1.x' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-09 15:47:23 +01:00
Torsten Dittmann d307d4f698 revert: dockerfile formatting 2022-11-09 15:45:20 +01:00
Torsten Dittmann a2570f5568 chore: update composer 2022-11-09 15:34:26 +01:00
Torsten Dittmann 9565152ced chore: update console 2022-11-09 15:22:38 +01:00
Torsten Dittmann 4dd919f640 fix 2022-11-09 15:07:39 +01:00
Torsten Dittmann ab5ddc263b Merge branch 'feat-console-rewrite' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-11-09 15:06:32 +01: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
Torsten DittmannandGitHub 5011820f67 Merge pull request #4649 from appwrite/feat-new-usage-stats
feat: add databases and buckets to projects usage
2022-11-09 11:50:15 +01:00
Torsten Dittmann e315f5d2ac fix: database usage tests 2022-11-09 10:29:13 +01:00
Steven Nguyen 239813aec2 Update supported versions in security policy 2022-11-08 08:30:10 -08:00
Torsten Dittmann 4041c4964c tests: fix remaining tests for usage 2022-11-08 15:16:10 +01:00
Torsten Dittmann 1615121b3e tests: adapt to new response model 2022-11-08 14:38:43 +01:00
Torsten Dittmann 4befb19c35 feat: add databases and buckets to projects usage 2022-11-08 13:09:18 +01:00
Bradley Schofield 842185e45d Update projects.php 2022-11-07 11:58:57 +00:00
Bradley Schofield 85cb520dd6 Fix testUpdateProjectAuthDuration 2022-11-07 11:14:01 +00:00
Bradley Schofield 4dfafd1169 Merge branch 'master' into feat-implement-session-length-api 2022-11-04 16:11:38 +00:00
Bradley Schofield e1f9a8e0ce Clean up a couple things and fix tests 2022-11-04 14:48:29 +00:00
Bradley Schofield 4cfc3b3a7f Update authDuration fallback value 2022-11-04 10:12:02 +00:00
Bradley Schofield 94676a6c16 Alter sessionVerify to remove expire 2022-11-04 09:50:59 +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
Eldad A. FuxandGitHub 44ca7d9459 Merge pull request #4631 from appwrite/feat-fix-account-naming
Updated titles on account routes
2022-11-03 18:19:41 +02:00
Torsten DittmannandGitHub df37e1b7a9 Merge pull request #4574 from appwrite/fix-console-realtime-deployment-create
Fix create deployment realtime not triggering
2022-11-03 16:29:32 +01:00
fogelito d2798ea401 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	composer.lock
2022-11-03 17:25:41 +02:00
Eldad Fux 103469928e Updated routes 2022-11-03 17:24:32 +02:00
Bradley Schofield 4b8287c097 Remove 'expire' from sessions 2022-11-03 15:03:39 +00: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
Eldad A. FuxandGitHub 32be6d6816 Merge pull request #4282 from appwrite/doc-unique-id
Update Unique ID references in docs from magic string to ID.unique()
2022-11-02 15:39:46 +02:00
4b5d537eee Apply suggestions from code review
Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
2022-11-02 15:41:50 +05:45
Damodar LohaniandGitHub 41d31c28d0 remove buildTime from deployments collection 2022-11-02 15:38:59 +05:45
Damodar Lohani b66f932b3b Merge remote-tracking branch 'origin/1.1.x' into feat-usage-refactor 2022-11-02 08:43:12 +00:00
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
Christy JacobandGitHub be642762b3 Merge pull request #4611 from appwrite/fix-missing-deployment-attributes
Fix get deployment
2022-11-02 08:05:10 +05:30
Christy JacobandGitHub c074731615 Merge pull request #4590 from rskbansal/master
fixed grammatical and spelling errors
2022-11-02 07:38:45 +05:30
Jake Barnby 0827d59f21 Merge remote-tracking branch 'origin/1.1.x' into fix-missing-deployment-attributes
# Conflicts:
#	tests/e2e/Services/Functions/FunctionsCustomServerTest.php
2022-11-02 13:33:10 +13:00
Christy JacobandGitHub f95145b796 Merge pull request #4620 from appwrite/sync-1.1.x
Sync 1.1.x
2022-11-02 02:14:32 +05:30
Vincent (Wen Yu) Ge a8a23fb8eb Merge branch 'master' into doc-unique-id 2022-11-01 17:53:48 +00:00
Christy Jacob bf34af86ac Merge branch '1.0.x' of github.com:appwrite/appwrite into 1.1.x 2022-11-01 22:24:53 +05:30
Christy Jacob b2d884e329 Merge branch 'master' of github.com:appwrite/appwrite into 1.1.x 2022-11-01 22:21:19 +05:30
Bradley Schofield cddacfbb78 Handle Eldad's Comments 2022-11-01 14:43:18 +00:00
Bradley Schofield 1eea8c6d8b Add Extra Tests 2022-11-01 11:34:56 +00:00
Bradley Schofield 60127cc69d Update CHANGES.md 2022-11-01 11:21:34 +00:00
Bradley Schofield 5dc8a2dee0 Add Tests and fix bugs 2022-11-01 11:15:45 +00:00
Kalpesh cbe7b35436 Update README-CN.md 2022-11-01 16:20:29 +05:30
Christy JacobandGitHub 5ea19cd539 Merge pull request #3848 from appwrite/refactor-remove-beta
Remove beta tag from Android, Kotlin, Apple and Swift
2022-11-01 12:35:56 +05:30
Damodar LohaniandGitHub 4d3ca5a064 revert back function test 2022-11-01 11:41:52 +05:45
Damodar Lohani 8baa95db1c Merge remote-tracking branch 'origin/1.1.x' into feat-usage-refactor 2022-11-01 04:54:48 +00:00
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
Christy JacobandGitHub 622c852367 Merge pull request #4584 from appwrite/test-mysql-adapter
Test mysql adapter
2022-11-01 02:11:54 +05:30
geisterfurz007 e891424c17 fix: empty payload deleting single user session 2022-10-31 21:01:49 +01:00
Christy JacobandGitHub 256046cba7 Merge pull request #4614 from appwrite/update-db-library
feat: update database library
2022-10-31 23:41:15 +05:30
Christy Jacob 629c1b1686 Merge branch 'test-mysql-adapter' of github.com:appwrite/appwrite into update-db-library 2022-10-31 23:38:58 +05:30
Christy JacobandGitHub a450089fe7 Update composer.json 2022-10-31 20:51:32 +05:30
fogelito bf119867e8 change name back to original 'name' 2048 2022-10-31 17:17:37 +02:00
Bradley Schofield d34359fd49 Implement Variable Session Duration 2022-10-31 14:54:15 +00:00
fogelito 1e92bda18b composer changes 2022-10-31 16:50:54 +02:00
fogelito eaf59693b7 composer.json 2022-10-31 15:26:40 +02:00
Torsten DittmannandGitHub ae288ffc9b Merge pull request #4613 from appwrite/rebase-1.1.x
rebase: 1.1.x
2022-10-31 13:59:12 +01:00
Christy Jacob aff7c59097 feat: update database library 2022-10-31 12:02:51 +00:00
Torsten Dittmann 983f885b3f fix: builds worker buildTime 2022-10-31 12:47:41 +01:00
Torsten Dittmann d8717a4a16 fix: console build 2022-10-31 11:50:19 +01:00
Damodar Lohani 24a140c3af assert buildTime is greater than 0 2022-10-31 10:17:08 +00:00
Damodar Lohani 7989518eec buildTime attribute to deployment 2022-10-31 09:07:06 +00:00
Torsten Dittmann 0049a76565 feat: submodule 2022-10-31 09:53:36 +01:00
Torsten Dittmann 4f3188c63f Merge branch 'rebase-1.1.x' of https://github.com/appwrite/appwrite into feat-console-rewrite 2022-10-31 09:47:35 +01:00
Torsten Dittmann d387f198db Merge branch 'master' of https://github.com/appwrite/appwrite into rebase-1.1.x 2022-10-31 09:45:51 +01:00
Damodar Lohani 4efabe9370 fix formatting 2022-10-31 07:44:44 +00:00
Damodar Lohani cf5ecd5a62 ignore data without projectInternalId 2022-10-31 07:27:51 +00:00
Damodar Lohani 67113971d9 fix model 2022-10-31 07:27:43 +00:00
Damodar Lohani 4086ba93ad Merge remote-tracking branch 'origin/1.1.x' into feat-usage-refactor 2022-10-31 06:36:26 +00:00
Jake Barnby dad4e3a2f4 Update changelog 2022-10-31 18:19:55 +13:00
Jake Barnby 2bfbf4acaf Add check to tests 2022-10-31 18:17:13 +13:00
Jake Barnby 049e3a2646 Add missing status, buildStdout, buildStderr to getDeployment 2022-10-31 18:11:55 +13:00
Damodar Lohani bd83da3331 upgrade databases 2022-10-31 04:30:19 +00:00
Karlis SuviandGitHub a82c8e88c2 Add changelog entry for #4610 2022-10-30 12:14:01 +02:00
Eldad A. FuxandGitHub 1b0abf4643 Merge pull request #3836 from appwrite/gewenyu99-patch-1
Update Chinese README-CN.md
2022-10-30 10:09:39 +02:00
Damodar Lohani 7433a260db fix formatting 2022-10-30 05:16:51 +00:00
Damodar Lohani 0d29968169 refactor database listener callback 2022-10-30 05:14:46 +00:00
Damodar Lohani 80972aa4ce update variables descriptions 2022-10-30 05:07:46 +00:00
Eldad A. FuxandGitHub 68d31d4ac7 Merge pull request #4555 from appwrite/feat-4535-remove-pdo-rethrow
Remove PDO rethrow
2022-10-29 17:15:19 +03:00
Karlis Suvi 6ae1a12219 Include response of 5xx status codes for function executions 2022-10-29 09:04:57 +00:00
Vincent (Wen Yu) Ge afa508cbed undo changes in swagger files 2022-10-28 20:45:13 +00:00
Damodar Lohani 60f2d10a50 update variable namings 2022-10-28 09:54:56 +00:00
Damodar Lohani 4c5273b8b2 document the environment variable usage stats retention 2022-10-28 09:16:36 +00:00
Damodar Lohani 6d7b30d77e fix formatting issues 2022-10-28 09:08:58 +00:00
Damodar Lohani a0a0ef2386 update docblock comments and naming 2022-10-28 08:40:04 +00:00
Damodar LohaniandGitHub 1e5c94c2c6 Merge branch 'master' into feat-usage-refactor 2022-10-28 13:17:52 +05:45
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
Rhythm BansalandGitHub 572e5d5f93 Update hi.json 2022-10-27 14:49:58 +05:30
Rhythm BansalandGitHub 569c5644fa Update hi.json 2022-10-27 14:43:59 +05:30
Rhythm BansalandGitHub b5a61d949b fixed grammatical and spelling errors 2022-10-27 14:42:08 +05:30
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
fogelito a5e67db604 fulltext 2022-10-26 23:12:46 +03:00
fogelito 013f4d55c2 docker-compose.yml 2022-10-26 23:07:04 +03:00
fogelito 8e8801b11c adapter change 2022-10-26 23:05:25 +03:00
Torsten Dittmann 7f256e5d06 feat: add console repo 2022-10-26 21:23:02 +02:00
fogelito 08e44f0656 some changes 2022-10-26 22:14:39 +03:00
Torsten DittmannandGitHub eb31bfb78e Merge pull request #4418 from appwrite/feat-deployment-buildtime
Add build time to deployments
2022-10-26 18:42:53 +02:00
Torsten Dittmann 32f2333ab6 test: mysql adapter 2022-10-26 16:38:40 +02:00
Christy JacobandGitHub 73bce1d7d0 Merge pull request #4309 from appwrite/fix-update-docker-compose
fix: docker compose syntax
2022-10-26 09:48:06 +05:30
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
Steven Nguyen ab2bb8176c Fix create deployment realtime not triggering
Because the deployment event was missing the project ID, the realtime
event never fired.
2022-10-25 13:38:04 -07:00
Steven Nguyen 719aa67afa Remove PDO rethrow
The PDOException was rethrown in general.php so that it could be caught
in the catch block of http.php. However, [a change in
utopia-php/framework](https://github.com/utopia-php/framework/commit/9d37326851f65f354344cfe2e3c1a282d5231025)
caused the exception to be masked as an Exception rather than the
underlying PDOException. As such, the `$th instanceof PDOException` in
http.php is always false and `$db = null` is never executed. Since these
snippets of code aren't doing anything or adding value, they should be
removed.

In addition, the `$db = null` may have been added to ensure the
connection was added back to the pool and/or reset if needed, but it
seems like that's not a problem anymore.
2022-10-25 10:05:52 -07:00
Eldad A. FuxandGitHub 4942ba9951 Merge pull request #4569 from appwrite/fix-spec-tests
Fix spec tests
2022-10-25 10:41:18 +03:00
Jake Barnby 1f49985d26 Remove var dumps 2022-10-25 19:38:31 +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 e2a63c10a1 Fix spec tests 2022-10-25 12:37:19 +13:00
Jake Barnby 889db82ad4 Fix spec tests 2022-10-25 12:34:57 +13:00
Torsten DittmannandGitHub 461c12c7fe Merge pull request #3701 from appwrite/feat-oauth-improvements
Feat: OAuth improvements
2022-10-24 17:57:40 +02:00
Damodar Lohani c8b5301267 update maintenance to delete only hourly metrics older than 3 months 2022-10-23 07:29:13 +00:00
Damodar Lohani 8c3cfa877b open api schema validator changes 2022-10-23 07:18:52 +00:00
Damodar Lohani bde7fe21c4 remove unused param 2022-10-23 07:03:50 +00:00
Damodar Lohani cbeb4984ab Merge remote-tracking branch 'origin' into feat-usage-refactor 2022-10-23 05:23:29 +00:00
Damodar Lohani 8048d24857 deprecate database aggregation 2022-10-23 05:17:50 +00:00
Damodar Lohani 3ed3ef9d71 rename variable 2022-10-23 04:46:23 +00:00
Eldad A. FuxandGitHub 04066af992 Merge pull request #4277 from appwrite/feat-phone-examples
Add meaningful phone number to generated examples.
2022-10-22 12:42:31 +03:00
motasimmakki 66893be752 docs: Removed unnecessary $ symbol and spaced correctly. 2022-10-22 10:07:18 +05:30
Vincent (Wen Yu) GeandGitHub 9a1f54baf1 Merge branch 'master' into doc-unique-id 2022-10-21 17:43:52 -04:00
Damodar Lohani 5fe2102e26 remove redundant project 2022-10-21 07:25:42 +00:00
Damodar Lohani 03f8e20dfd Merge remote-tracking branch 'origin/master' into feat-usage-refactor 2022-10-21 06:27:03 +00:00
Damodar Lohani dfa35e0a0b fix periods on usage endpoints 2022-10-21 05:45:25 +00:00
Jake Barnby 2d6974da82 Fix empty examples 2022-10-21 15:28:06 +13:00
Damodar Lohani 9195c813db missing documents total count 2022-10-21 01:53:39 +00:00
Damodar Lohani d35b438255 fix collection and document counts 2022-10-21 01:50:03 +00:00
Damodar Lohani a7e1e5f25f fix period 2022-10-21 01:40:33 +00:00
Damodar Lohani 088fd89294 fix metric name 2022-10-21 01:40:26 +00:00
Damodar Lohani d1b3ca5178 comment database worker 2022-10-21 01:29:13 +00: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
Eldad A. FuxandGitHub 61d6b435b3 Merge pull request #4530 from appwrite/feat-bump-api-specs
Update API specs
2022-10-19 09:28:13 +03:00
Bradley Schofield 60e924b62b Run Linter 2022-10-19 02:50:48 +01:00
Bradley Schofield fe4028f588 Add tests and add buildTime to worker 2022-10-19 02:43:40 +01: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
Steven Nguyen 080116cff8 Update API specs 2022-10-18 21:05:54 +00: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
Eldad A. FuxandGitHub 28252f693b Merge pull request #4517 from appwrite/v1-fix-usage-projects-pagination
V1: Fix: DB Usage projects pagination
2022-10-18 14:39:56 +03:00
Eldad A. FuxandGitHub 0d0cacbf87 Merge pull request #4520 from appwrite/doc-remove-admin-mode
Remove references to admin mode
2022-10-18 14:38:25 +03:00
Christy JacobandGitHub 766cc7fcfa Merge pull request #4524 from appwrite/christyjacob4-patch-3
Update add-environment-variable.md
2022-10-18 12:50:44 +04:00
Damodar Lohani 5ff8ac46aa fix negative stats 2022-10-18 08:28:12 +00:00
Damodar Lohani 868e487a59 fix bucket collection name 2022-10-18 07:52:41 +00:00
Christy JacobandGitHub 28044662f4 Update add-environment-variable.md 2022-10-18 11:44:30 +04:00
Damodar Lohani 8cd4060334 fix storage stats 2022-10-18 07:38:05 +00:00
Christy JacobandGitHub e9ef5b5eac Merge pull request #4303 from MrKrishnaAgarwal/typos
Fixed Typo's and Rephrased words
2022-10-18 11:34:20 +04:00
Damodar Lohani 027dafe906 fix linters 2022-10-18 07:26:28 +00:00
Damodar Lohani e7c82a28dd more fixes 2022-10-18 07:09:11 +00:00
Damodar Lohani 305dafe2ad update missing stats 2022-10-18 06:53:17 +00:00
Damodar Lohani 1fdaaeef71 reduce waiting time 2022-10-18 06:19:57 +00:00
Damodar Lohani d7f87051d6 fix test 2022-10-18 06:10:33 +00:00
Damodar Lohani 8093f034c0 fix inbound and outbount 2022-10-18 03:53:07 +00:00
Damodar Lohani a3f14220d3 take care of negative values 2022-10-18 03:19:12 +00:00
Damodar Lohani b1f3fdce7a fix stats test 2022-10-18 02:26:28 +00:00
Vincent (Wen Yu) Ge f7904af0ed Remove references to admin mode 2022-10-17 20:45:17 +00:00
Matej Bačo 837422145d Update changelog url 2022-10-17 11:46:42 +00:00
Matej Bačo 97df10e6b8 Fix project pagination in usage containers 2022-10-17 11:45:38 +00:00
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
Damodar Lohani e96c0b1127 fix composer 2022-10-17 08:57:12 +00:00
Damodar Lohani f71eb5a169 database listeners 2022-10-17 08:04:12 +00:00
Damodar Lohani 5b90c433ab fix collection id 2022-10-17 07:53:55 +00:00
Damodar Lohani 00d194d5d1 fix linters 2022-10-17 07:37:30 +00:00
Akshay Rana 1fcc5eccb1 updated timestamp format to ISO string in realtime payload 2022-10-17 12:44:44 +05:30
Damodar Lohani f3c183b563 listen to delete events 2022-10-17 07:10:18 +00:00
Damodar Lohani ffe029932d refactor stats 2022-10-17 06:59:27 +00:00
Damodar Lohani f78cb09694 Merge remote-tracking branch 'origin/master' into feat-usage-refactor 2022-10-17 06:55:01 +00:00
Damodar Lohani 84f5842c81 document create listener 2022-10-17 06:52:24 +00:00
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
Eldad A. FuxandGitHub 1c7019a04d Merge pull request #4449 from appwrite/feat-upgrade-framework
chore: upgrade utopia-php/framework
2022-10-16 12:25:55 +03:00
Eldad A. FuxandGitHub 939f974d19 Merge pull request #4450 from appwrite/feat-upgrade-database-0.26
Upgrade to use Database 0.26.0
2022-10-16 12:16:12 +03:00
Damodar Lohani 019fa11616 setup to use database listeners 2022-10-16 08:50:53 +00:00
Damodar Lohani b29e2c1808 use database from master 2022-10-16 08:08:38 +00:00
90e9e5e7fd Update app/http.php
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
2022-10-16 11:49:12 +05:45
Damodar Lohani 00973d4a14 add try catch 2022-10-16 05:58:25 +00:00
Damodar Lohani c635846dba fix missing import 2022-10-16 01:47:38 +00: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
Damodar Lohani f27ccf4212 upgrade database version 2022-10-14 11:40:59 +00:00
Damodar Lohani 51cbc653af use metadata constant 2022-10-14 11:26:33 +00:00
Damodar Lohani e2555e2448 fix metadata creation 2022-10-14 11:25:22 +00:00
Damodar Lohani be3743e227 fix renamed function 2022-10-14 11:24:37 +00:00
Damodar Lohani 185b206076 fix moved constant 2022-10-14 11:23:20 +00:00
Damodar Lohani f86a5b5fcd fix renamed methods 2022-10-14 11:12:59 +00:00
Damodar Lohani 83071d85e3 fix test constant 2022-10-14 11:10:06 +00:00
Damodar Lohani 65337bc9e9 fix metadata creation 2022-10-14 11:07:32 +00:00
Damodar Lohani e7b9ba70b6 fix error 2022-10-14 11:07:20 +00:00
Damodar Lohani dee4f5c517 use metadata constants 2022-10-14 11:07:07 +00:00
Torsten Dittmann 788abad42e chore: upgrade utopia-php/framework 2022-10-14 12:44:52 +02:00
Torsten DittmannandGitHub d0aedf33ba Merge pull request #4058 from appwrite/fix-deprecate-team-deletion-with-project
Deprecate team deletion with project
2022-10-14 11:19:27 +02:00
Damodar Lohani 0316710ee4 update database 2022-10-14 08:51:37 +00:00
Damodar Lohani e7e8c53d89 use same array for all metrics 2022-10-14 08:49:00 +00:00
Christy JacobandGitHub d64effc74f Merge pull request #4312 from tusharxoxoxo/patch-1
Update add-environment-variable.md
2022-10-14 12:07:35 +04:00
Christy JacobandGitHub 98bdcfe04e Merge pull request #4292 from Akshay-Rana-Gujjar/fix-3810-incorrect-error-when-updating-phone-to-existing-number
fixed: wrong error message show on adding duplicate number to a user
2022-10-14 12:02:39 +04:00
Christy JacobandGitHub e9b595bdaa Merge pull request #4430 from shendrekbharath/New
Fixed the broken link
2022-10-14 10:57:33 +04: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
Torsten DittmannandGitHub fe87b754c7 Merge pull request #3824 from appwrite/feat-dev-appwrite-image
Re-use same image for all appwrite containers during dev
2022-10-14 02:45:31 +02: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
Steven Nguyen 0fdfdcf09c Re-use same image for all appwrite containers during dev and CI 2022-10-12 11:34:30 -07:00
Eldad A. FuxandGitHub b6eef3a886 Merge pull request #4435 from appwrite/fix-sdk-license
Update SDK License to match opensource.org
2022-10-12 20:49:02 +03:00
Steven Nguyen 02ab2b8a63 Update SDK License to match opensource.org
The difference made it so pub.dev was unable to detect the license.
2022-10-12 09:57:54 -07:00
Torsten DittmannandGitHub e17188e52c Merge pull request #4053 from geisterfurz007/fix-4052-switch-clips-in-firefox
fix: switch clips in firefox
2022-10-12 13:44:55 +02:00
Torsten DittmannandGitHub 99a6d7044c Merge pull request #4433 from appwrite/1.0.x
sync: master <- 1.0.x
2022-10-12 13:22:40 +02:00
Torsten DittmannandGitHub c4ad832d67 Merge pull request #4422 from appwrite/bug_model_metric
Bug model metric
2022-10-12 12:57:09 +02:00
Torsten DittmannandGitHub d625eb6508 Merge pull request #4432 from appwrite/chore-prepare-1-0-3
chore: prepare 1.0.3
2022-10-12 12:47:17 +02:00
Torsten Dittmann bc66efa1a5 chore: prepare 1.0.3 2022-10-12 12:03:55 +02:00
Torsten DittmannandGitHub bbafadcbf6 Merge pull request #4429 from appwrite/fix-4427-database-delete
Only delete collection data for correct db
2022-10-12 11:59:37 +02: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
Steven Nguyen 99abb200d6 Update CHANGES.md 2022-10-11 22:56:55 +00:00
Steven Nguyen 5542e5b04c Only delete collection data for correct db
Ensure attributes, indexes, and audit for correct database is deleted.
2022-10-11 22:51:10 +00:00
Bharath Shendre 29babb6015 Fixed the broken link 2022-10-12 03:19:27 +05:30
geisterfurz007 367eb4f6d7 Build css files 2022-10-11 19:46:47 +02:00
Torsten Dittmann 4210fdcb27 feat: console rewrite 2022-10-11 16:36:39 +02:00
fogelito 4d2e5c3e94 specs recreate 2022-10-11 17:08:06 +03:00
fogelito 778751160b Merge branch '1.1.x' of github.com:appwrite/appwrite into bug_model_metric
 Conflicts:
	app/config/specs/open-api3-latest-console.json
	app/config/specs/swagger2-latest-console.json
2022-10-11 17:06:37 +03:00
Torsten DittmannandGitHub e9ef7c0ecd Merge pull request #4424 from appwrite/master
sync: 1.1.x <- master
2022-10-11 16:03:43 +02:00
fogelito 9ff918ac6b specs 2022-10-11 15:56:09 +03:00
fogelito 88a19f4bd3 composer.lock 2022-10-11 15:43:56 +03:00
Torsten Dittmann 6a44e82e33 Merge branch '1.1.x' of https://github.com/appwrite/appwrite into 1.1.x 2022-10-11 14:27:13 +02:00
Torsten Dittmann 9d9f96ac1e Merge branch 'master' of https://github.com/appwrite/appwrite into 1.1.x 2022-10-11 14:26:59 +02:00
fogelito 0a4b582dd9 Model MODEL_METRIC changes 2022-10-11 14:35:54 +03:00
fogelito 4250234231 Model MODEL_METRIC changes 2022-10-11 13:34:42 +03:00
Christy JacobandGitHub 75c029c462 Merge pull request #4073 from appwrite/christyjacob4-patch-2
Update PULL_REQUEST_TEMPLATE.md
2022-10-11 13:06:17 +04:00
Damodar Lohani 910c033d2a refactor build and execution time 2022-10-11 05:40:28 +00: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
Torsten DittmannandGitHub 92778baf99 Merge pull request #4042 from Sooraj-s-98/master
sanitized url in url Validation
2022-10-10 22:42:49 +02:00
Bradley Schofield 380a45f987 Add build time to deployment 2022-10-10 16:24:40 +01:00
Damodar Lohani 3ffc31ba58 fix formatting 2022-10-10 09:39:26 +00:00
Damodar Lohani f41d388bf5 separate cumulative metrics 2022-10-10 09:13:20 +00:00
Eldad A. FuxandGitHub 8f3f00fe00 Merge pull request #4055 from appwrite/feat-integrate-messaging
Feat integrate messaging
2022-10-10 09:53:32 +03: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
Jake Barnby 77fccc950a Merge remote-tracking branch 'origin/1.1.x' into feat-integrate-messaging 2022-10-10 17:30:33 +13:00
Eldad A. FuxandGitHub 0733909d04 Merge pull request #4346 from appwrite/master
Sync 1.1.x
2022-10-10 07:27:26 +03:00
Jake Barnby 702710aab1 Fix import 2022-10-10 16:20:46 +13:00
Jake Barnby 2fc22998cf Merge remote-tracking branch 'origin/master' into feat-integrate-messaging 2022-10-10 14:04:51 +13:00
Jake Barnby f93099cbb6 Merge remote-tracking branch 'origin/1.1.x' into feat-integrate-messaging 2022-10-10 14:04:01 +13:00
Jake Barnby 608f1532a6 Merge remote-tracking branch 'origin/1.0.x' into feat-integrate-messaging
# Conflicts:
#	app/workers/messaging.php
#	src/Appwrite/SMS/Adapter/Mock.php
#	tests/e2e/Services/Account/AccountCustomClientTest.php
2022-10-10 14:01:59 +13:00
Jake Barnby a247cc614f Increase sleep 2022-10-10 11:28:26 +13:00
Eldad A. FuxandGitHub 17d7bcca78 Merge pull request #4057 from appwrite/feat-project-queries-by-team
Feat: teamId queries on listProjects
2022-10-09 16:19:19 +03: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
Damodar Lohani 8ddbde62c1 use project internal id 2022-10-09 06:45:46 +00:00
Damodar Lohani 9b2db20b3b fix backfill 2022-10-09 06:33:14 +00:00
Damodar Lohani 22b00c019d update usage period on get for databases 2022-10-09 06:30:26 +00:00
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
sooraj 5958577a6e camel case update 2022-10-08 06:31:28 +05:30
Krishna AgarwalandGitHub de39663095 made changes 2022-10-07 23:16:54 +05:30
Krishna AgarwalandGitHub 00eeebbf04 Update CONTRIBUTING.md 2022-10-07 23:15:50 +05:30
Krishna AgarwalandGitHub 1313a30563 Update CONTRIBUTING.md 2022-10-07 23:14:49 +05:30
Krishna AgarwalandGitHub 11caeaba11 Update CONTRIBUTING.md 2022-10-07 23:13:42 +05:30
Krishna AgarwalandGitHub 36f59375da Update CONTRIBUTING.md 2022-10-07 23:13:19 +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
Tushar DahiyaandGitHub 0bb3aa6c9d Update add-environment-variable.md 2022-10-07 09:10:13 +05:30
sooraj 49c0c2d996 change test case 2022-10-07 07:39:22 +05:30
sooraj 3a2d6da052 sanitized_url add in parse url 2022-10-07 06:11:38 +05:30
Christy Jacob 643b2f1bb4 fix: docker compose synatx 2022-10-06 18:48:50 +05:30
Krishna AgarwalandGitHub 5a9525fb89 fixed typo 2022-10-06 09:08:12 +05:30
Krishna AgarwalandGitHub 5e75fca33f Update avatars.md 2022-10-06 09:04:44 +05:30
Krishna AgarwalandGitHub 187bf0165d rephrased words 2022-10-06 09:02:56 +05:30
Krishna AgarwalandGitHub f794eea2e6 removed space 2022-10-06 09:02:08 +05:30
Sooraj SandGitHub 81fc5ee6b3 Merge pull request #1 from appwrite/master
new
2022-10-06 09:01:55 +05:30
Krishna AgarwalandGitHub d851733f6a fixed typos, removed space 2022-10-06 09:01:31 +05:30
Akshay Rana 57bbf346aa added: test case - failure case to add same number to different user 2022-10-05 23:40:11 +05:30
sooraj 62f63923c1 new test case 2022-10-05 19:40:05 +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
Akshay Rana 737a0ab6d7 added: test case - update user phone number & user search by new phone number 2022-10-05 17:30:53 +05:30
Akshay Rana da9133ae85 fixed: wrong error message show on adding duplicate number to a user 2022-10-04 23:48:15 +05:30
Vincent (Wen Yu) GeandGitHub 4cee87273c Merge branch 'master' into doc-unique-id 2022-10-04 10:51:38 -04:00
Torsten DittmannandGitHub 676709e706 Merge pull request #4289 from appwrite/1.0.x
master <- 1.0.x
2022-10-04 16:15:46 +02:00
Torsten DittmannandGitHub 68df98eaaa Merge pull request #4043 from appwrite/chore-prepare-1-0-2
chore: prepare 1.0.2
2022-10-04 15:36:45 +02:00
Torsten Dittmann 77e8ffe500 chore: update changelog 2022-10-04 15:29:15 +02:00
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
Torsten Dittmann 120216f715 Merge branch '1.0.x' of https://github.com/appwrite/appwrite into chore-prepare-1-0-2 2022-10-04 12:19:18 +02:00
Torsten Dittmann 0c99ceda92 Merge branch 'master' of https://github.com/appwrite/appwrite into 1.0.x 2022-10-04 12:18:43 +02:00
Torsten Dittmann 7a9b25889b Merge branch 'master' of https://github.com/appwrite/appwrite into chore-prepare-1-0-2 2022-10-04 12:07:09 +02:00
Torsten DittmannandGitHub 4bb44ad315 Merge pull request #3757 from appwrite/feat-github-non-self-hosted
ci: update github actions to use github hosted runners
2022-10-04 12:06:42 +02:00
Torsten Dittmann b83a215885 chore: update changelog 2022-10-04 11:32:31 +02:00
Torsten Dittmann 6c10a75c6a chore: update changelog 2022-10-04 11:31:17 +02:00
Torsten DittmannandGitHub b6321a8bed ci: remove php image pre pull 2022-10-04 11:05:52 +02:00
Torsten Dittmann 3e69d8203e chore: update composer lock 2022-10-04 11:04:32 +02:00
73c144a75f Update .github/PULL_REQUEST_TEMPLATE.md
Co-authored-by: Matej Bačo <matejbacocom@gmail.com>
2022-10-04 12:29:52 +05:30
Eldad A. FuxandGitHub 052d35fe59 Update README.md 2022-10-04 08:54:53 +03:00
Vincent (Wen Yu) Ge 55985c47d4 Update specs 2022-10-03 21:21:27 +00:00
Vincent (Wen Yu) Ge ae2100244f Update unique() to be ID.unique() 2022-10-03 20:22:28 +00:00
Vincent (Wen Yu) Ge 207941558f fix typo in email examples 2022-10-03 15:13:04 +00:00
Vincent (Wen Yu) Ge 3281b8bbd4 Add meaningful Phone number examples to specs 2022-10-03 15:06:44 +00:00
Christy JacobandGitHub 0bae88311e Update PULL_REQUEST_TEMPLATE.md 2022-10-03 15:30:47 +05:30
Matej Bačo 3da4b01f4e Deprecate team deletion with project 2022-10-03 08:06:48 +00:00
Matej Bačo a55b149d6f Fix test 2022-10-03 07:54:55 +00:00
Matej Bačo a883d3728f Allow teamId queries on listProjects 2022-10-03 07:16:49 +00:00
Jake Barnby 2fbc40e966 Merge fixes 2022-10-03 13:42:53 +13:00
Jake Barnby 5c6caf5603 Update to messaging lib to tagged release
(cherry picked from commit 580eafffd2a90fb9dccc4554ac9ce388864f1e8d)

# Conflicts:
#	composer.lock
2022-10-03 13:29:24 +13:00
Jake Barnby 2bb8854f61 WIP integrate messaging library
(cherry picked from commit 9a25f77e3e7e76f6c93cc3ce1985f43426a0debf)

# Conflicts:
#	app/workers/messaging.php
#	src/Appwrite/SMS/Adapter/Mock.php
#	tests/e2e/Services/Account/AccountCustomClientTest.php
2022-10-03 13:28:30 +13:00
geisterfurz007 1e0d8d2efb fix: switch clips in firefox 2022-10-02 19:21:43 +02:00
Torsten DittmannandGitHub 146793c42c Merge pull request #3885 from appwrite/fix-function-vars-null
Fix: Function null variables
2022-09-30 15:38:27 +02:00
sooraj 91f16121d1 adding a test 2022-09-30 18:10:02 +05:30
Torsten Dittmann 5d32ddb408 Merge branch '1.0.x' of https://github.com/appwrite/appwrite into chore-prepare-1-0-2 2022-09-30 14:36:53 +02:00
Torsten DittmannandGitHub e5271dbda9 Merge branch '1.0.x' into fix-function-vars-null 2022-09-30 14:29:22 +02:00
Torsten Dittmann 6c2fbec22b chore: add changelog 2022-09-30 14:27:46 +02:00
Torsten Dittmann 0c1222f0f5 Merge branch 'master' of https://github.com/appwrite/appwrite into 1.0.x 2022-09-30 14:23:06 +02:00
Torsten Dittmann fbbb150e86 Revert "Merge pull request #4041 from appwrite/revert-3789-feat-app-region"
This reverts commit 2117fa53f0, reversing
changes made to c634d12ef4.
2022-09-30 14:22:11 +02:00
Torsten DittmannandGitHub 2117fa53f0 Merge pull request #4041 from appwrite/revert-3789-feat-app-region
Revert "Feat app region"
2022-09-30 14:19:30 +02:00
Torsten DittmannandGitHub 1d3bd4e26a Merge pull request #4040 from appwrite/fix-boolean-attribute-default-value
fix: boolean attribute default value
2022-09-30 13:29:44 +02:00
Torsten DittmannandGitHub e0b9f57d85 Revert "Feat app region" 2022-09-30 12:32:58 +02:00
sooraj f6c586986d sanitized url in url Validation 2022-09-30 15:58:56 +05:30
Torsten Dittmann 757a3f8651 chore: prepare 1.0.2 2022-09-30 12:27:26 +02:00
Torsten Dittmann 637a97c4de Merge branch '1.0.x' of https://github.com/appwrite/appwrite into fix-function-vars-null 2022-09-30 12:06:32 +02:00
Torsten Dittmann f8bd3299a3 chore: add changelog 2022-09-30 12:03:08 +02:00
Torsten DittmannandGitHub 6c1e2ae537 Merge branch '1.0.x' into fix-boolean-attribute-default-value 2022-09-30 11:56:31 +02:00
Torsten DittmannandGitHub 1b490233b6 Merge pull request #4038 from appwrite/fix-3949-migrate-audit-time
Fix migration for audit
2022-09-30 11:56:05 +02:00
Torsten DittmannandGitHub d511c2d2ad Merge pull request #3858 from appwrite/fix-certificate-fail-mail
Fix: Certificate -> Mail worker communication
2022-09-30 11:54:31 +02:00
Torsten Dittmann 65b4c9f931 fix: default value for optional function vars 2022-09-30 11:52:35 +02:00
Torsten DittmannandGitHub b1197d581a Merge pull request #3908 from appwrite/fix-function-schedule-loops
Fix schedule loop triggering
2022-09-30 11:45:11 +02:00
Torsten DittmannandGitHub c634d12ef4 Merge pull request #3932 from pcgeek86/patch-1
Fix PowerShell line continuation character
2022-09-30 11:43:54 +02:00
Torsten Dittmann b79fe964b8 chore: add changelog 2022-09-30 11:37:38 +02:00
Torsten Dittmann d45464c6c8 fix: boolean attribute default value 2022-09-30 11:27:19 +02: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
Christy JacobandGitHub 7880adda3f Merge pull request #3947 from appwrite/fix-scrypt-params
Fix scrypt params
2022-09-30 01:33:59 +05:30
Steven Nguyen c97fea37c0 Fix migration for audit
`time` attribute should be a DateTime type rather than int.
2022-09-29 19:15:54 +00:00
Eldad A. FuxandGitHub 09830aecb3 Merge pull request #3948 from appwrite/fix-rename-retry-build
Rename retry build to create build
2022-09-29 14:23:20 +03:00
Christy JacobandGitHub 4150895401 Merge pull request #3865 from eltociear/patch-1
Fix typo in Exception.php
2022-09-29 16:41:02 +05:30
Christy JacobandGitHub 7d5f68a7bf Merge pull request #3871 from toir427/patch-2
Fixed typo in docker-compose.yml
2022-09-29 16:40:43 +05:30
Christy JacobandGitHub 84da2eee8c Merge pull request #3872 from toir427/patch-3
Fixed typo in events.php
2022-09-29 16:40:08 +05:30
Bradley Schofield eeb6ee0821 Update functions.php 2022-09-29 09:42:46 +01:00
Christy JacobandGitHub 912933d4c8 Merge pull request #3936 from appwrite/fix-async-function-console
Update function execution from console to be async
2022-09-29 12:46:04 +05:30
Christy JacobandGitHub c1df8cc5ea Merge pull request #3935 from appwrite/feat-show-function-stdout
Update Console to Show Function Stdout Logs
2022-09-29 12:45:25 +05:30
Christy JacobandGitHub 258ba6e7b4 Merge pull request #3900 from appwrite/fix-team-get-membership-model
Add get team membership tests
2022-09-29 12:44:04 +05:30
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 5e1bb655dc Fix scrypt algo response model rule default types 2022-09-29 16:54:01 +13:00
Jake Barnby 69d42fc980 Fix create scrypt user route param defaults types 2022-09-29 16:52:57 +13:00
Steven NguyenandSteven 3f9a3f72c8 Update function execution from console to be async
Before 1.0.x, function executions were async by default. This ensures
executions starting 1.0.x are still async.
2022-09-28 19:25:59 +00:00
Eldad A. FuxandGitHub 4a4cf77fd6 Update README-CN.md 2022-09-28 10:08:39 +03:00
Eldad A. FuxandGitHub 029fddceb0 Update README.md 2022-09-28 10:08:00 +03:00
Steven Nguyen 8cc768cc50 Update Console to Show Function Stdout Logs
Although there is still a known issue where function stdout logs can
appear in the wrong execution, not having the logs easily accessible
in the console makes troubleshooting functions significantly more
difficult.
2022-09-27 19:48:35 +00:00
Trevor SullivanandGitHub 85cd2c1472 Fix PowerShell line continuation character
PowerShell uses the backtick as line continuation character, not comma.
2022-09-27 01:17:19 -06:00
Eldad A. FuxandGitHub b575df867e Merge pull request #3789 from appwrite/feat-app-region
Feat app region
2022-09-25 15:04:56 +03:00
Damodar Lohani 8c6ef5b26f pass region in constructors 2022-09-25 05:41:13 +00:00
Damodar Lohani 895e12c29b monthly period not supported 2022-09-25 02:08:42 +00:00
Damodar Lohani 4969ceadd4 add project internal id to the timeseries tats 2022-09-25 02:07:26 +00:00
Eldad A. FuxandGitHub 7b0b0ef91a Merge pull request #3921 from WonderfulWan8/doc_update_readme
doc_update_readme
2022-09-24 17:57:14 +03:00
Eldad A. FuxandGitHub 80ce2b2464 Merge pull request #3906 from appwrite/fix-phone-secret-hash
fix: hash phone auth code
2022-09-24 17:49:52 +03:00
Eldad A. FuxandGitHub ef65503173 Merge pull request #3873 from toir427/patch-4
Fixed typo in providers.php
2022-09-24 17:48:17 +03:00
WonderfulWan8 adf4465c27 doc_update_readme 2022-09-24 22:37:30 +08:00
Christy JacobandGitHub 3bbbca87d6 Merge pull request #3910 from appwrite/feat-dart-flutter-changelogs
update Flutter/Dart changelogs
2022-09-23 17:14:16 +05:30
Damodar LohaniandGitHub 651ccef328 correct env value 2022-09-23 14:35:50 +05:45
Christy JacobandGitHub 44cc33284f Merge pull request #3879 from appwrite/feat-improve-sms-e2e-tests
Fix: SMS mock e2e tests
2022-09-23 14:16:37 +05:30
Christy JacobandGitHub 384543c553 Merge pull request #3886 from appwrite/refactor-test-failures
Refactor test failures
2022-09-23 14:10:16 +05:30
Damodar Lohani 69846749bf update changelogs 2022-09-23 06:31:43 +00:00
Christy JacobandGitHub 9524b06d26 Merge pull request #3895 from MrKrishnaAgarwal/typo
fixed typo
2022-09-23 11:59:34 +05:30
Christy Jacob 0533339023 Merge branch '0.16.x' of https://github.com/appwrite/appwrite into fix-team-get-membership-model 2022-09-23 06:27:35 +00:00
Christy Jacob 582b95915a Merge branch 'master' of https://github.com/appwrite/appwrite into 0.16.x 2022-09-23 06:25:59 +00:00
Matej BačoandGitHub 46c91899e7 Merge branch '0.16.x' into feat-improve-sms-e2e-tests 2022-09-23 08:23:29 +02:00
Matej Bačo e850be40b2 Cleanup 2022-09-23 06:21:10 +00:00
Christy JacobandGitHub 54d14a5151 Merge pull request #3883 from appwrite/fix-get-membership-response
Fix: Get Membership response
2022-09-23 11:42:33 +05:30
Matej Bačo 0159079608 Fix schedule loop triggering 2022-09-23 06:12:17 +00:00
Christy JacobandGitHub c38f451c78 Merge pull request #3862 from Faizan-Pasha/master
Fixed the bug #3859
2022-09-23 11:38:39 +05:30
Christy JacobandGitHub 426f50c69c Merge pull request #3852 from appwrite/fix-response-filters
Fix response filters
2022-09-23 11:28:34 +05:30
Damodar Lohani 5e6b8ec506 refactor counters to get sum in period only 2022-09-23 05:51:26 +00:00
Eldad A. FuxandGitHub 5bde5bee16 Update README.md 2022-09-23 07:25:23 +03:00
Eldad A. FuxandGitHub aceb631aac Update README.md 2022-09-23 07:22:32 +03: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
Christy Jacob 7abb426e3f fix: hash phone auth code 2022-09-23 03:55:17 +05:30
Christy JacobandGitHub c2d3544c55 Merge pull request #3884 from appwrite/fix-delete-function-variables
Fix: Function deletes worker
2022-09-23 00:38:18 +05:30
Christy JacobandGitHub ba0be549e3 Merge pull request #3881 from appwrite/fix-null-required-param
Fix: Null required ID params
2022-09-23 00:37:17 +05:30
Christy JacobandGitHub 9caeb62695 Merge pull request #3880 from appwrite/fix-improve-rehash-tests
Fix: Improve password hashing e2e tests
2022-09-23 00:35:03 +05:30
Christy JacobandGitHub f39ed010c7 Merge pull request #3889 from appwrite/fix-permission-selection
Fix permission selection before role entry
2022-09-23 00:33:09 +05:30
Christy JacobandGitHub 792d22cf74 Merge pull request #3904 from appwrite/christyjacob4-patch-1
Add ProductHunt badge
2022-09-22 19:38:43 +05:30
Christy JacobandGitHub 039dde600f Add ProductHunt badge 2022-09-22 18:56:25 +05:30
Christy JacobandGitHub 0eb5a1c61f Merge pull request #3855 from appwrite/fix-usage-stats
Fix date format for usage APIs
2022-09-22 18:21:58 +05:30
Damodar Lohani aee87e3d01 fix stats users 2022-09-22 12:19:43 +00:00
Christy JacobandGitHub f3fac22bab Merge pull request #3902 from appwrite/update-versions
Update SDK generator and versions
2022-09-22 17:13:53 +05:30
Christy JacobandGitHub b99f5b0663 Merge pull request #3896 from appwrite/fix-supported-sms-providers
Update list of supported SMS Providers
2022-09-22 16:44:42 +05:30
Jake Barnby 8cd36b2721 Fix custom entity list 2022-09-22 22:48:22 +12:00
Jake Barnby 1bd55c8d69 Update CLI version 2022-09-22 21:24:50 +12:00
Jake Barnby 7c3732e277 Update SDK generator version 2022-09-22 21:23:51 +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 7f236ed2bb Add get membership tests 2022-09-22 20:06:30 +12:00
Damodar Lohani 80502ff937 collect counter data 2022-09-22 07:34:11 +00:00
Damodar Lohani 2956d5f3eb collect console stats 2022-09-22 07:34:03 +00:00
Jake Barnby 398c3eec29 Fix SDK response model for get team membership 2022-09-22 19:26:54 +12:00
Jake Barnby 2d1cd7cb50 Add queries validators 2022-09-22 18:54:58 +12:00
Christy Jacob fea3580c1c chore: update sdk versions 2022-09-22 09:37:34 +05:30
Christy Jacob a0910a7f58 chore: update sdk generator 2022-09-22 08:39:20 +05:30
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
Steven 87cc201811 Update list of supported SMS Providers 2022-09-21 21:05:59 +00:00
Christy JacobandGitHub e4d186b9a7 Merge pull request #3861 from appwrite/fix-flutter-web-auth-2
Update flutter getting started to match library
2022-09-21 23:53:24 +05:30
Krishna AgarwalandGitHub de0b88737e fixed typo 2022-09-21 22:55:21 +05:30
Krishna AgarwalandGitHub 0ddd2f6c77 fixed typo on line 15 2022-09-21 22:53:36 +05:30
Krishna AgarwalandGitHub 067858ae10 fixed typo 2022-09-21 22:48:51 +05:30
Christy JacobandGitHub ec46fae228 Merge pull request #3890 from zswati/Swati/Typo-Error-fix-Readme-
Typo fix readme.md file
2022-09-21 15:21:15 +05:30
Damodar Lohani 4de148f783 new stats to count resources 2022-09-21 09:36:42 +00: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
Eldad A. FuxandGitHub 6fbbc2bea5 Update README.md 2022-09-21 10:02:44 +03: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
Damodar Lohani e8b63f8c9d fix test 2022-09-21 02:46:18 +00:00
Damodar Lohani 3166be9da0 remove region from update 2022-09-21 02:01:59 +00:00
Damodar Lohani 6d9f43be5d add missing region on list project test 2022-09-21 01:45:16 +00:00
Damodar Lohani fdc5fea887 update project tests 2022-09-21 01:02:58 +00:00
Swati Z 92e3c79812 Update Contributing.md with Typo
Update Contributing.md with Typo
2022-09-20 12:36:16 -04:00
Swati Z fb55f8cdd1 Typo fix readme.md file 2022-09-20 11:02:12 -04:00
Damodar Lohani cde374b505 add region in test 2022-09-20 13:21:05 +00:00
Christy JacobandGitHub 478a92a881 Merge pull request #3888 from christyjacob4/master
add console sdk
2022-09-20 18:35:20 +05:30
Jake Barnby 85ce646e0c Add back prevent enter 2022-09-20 22:04:15 +12:00
Jake Barnby ef4ffcf3a2 Clear existing permissions for a role on keydown 2022-09-20 22:03:13 +12:00
Christy Jacob bf533be331 chore: add console sdk 2022-09-20 14:27:49 +05:30
Christy Jacob 81aa611c74 chore: add console sdk 2022-09-20 14:27:30 +05:30
Christy Jacob 66ffe200d8 chore: add console sdk 2022-09-20 14:24:38 +05:30
Christy Jacob c33a5580fe chore: add console sdk 2022-09-20 14:24:02 +05:30
Christy Jacob 7ec9aef2ed chore: add console sdk 2022-09-20 14:23:30 +05:30
Christy Jacob 5b240a867e chore: add console sdk 2022-09-20 14:23:10 +05:30
Christy Jacob 304e72c7e2 chore: add console sdk 2022-09-20 14:22:50 +05:30
Christy Jacob 8fe71531d6 chore: add console sdk 2022-09-20 14:20:44 +05:30
Christy Jacob 2badad6da5 chore: add console sdk 2022-09-20 14:20:12 +05:30
Christy Jacob 395beb39bc chore: add console sdk 2022-09-20 14:16:35 +05:30
Christy Jacob e5cae42356 chore: add console sdk 2022-09-20 14:15:52 +05:30
Christy Jacob fe82f05462 chore: add console sdk 2022-09-20 14:15:10 +05:30
Christy Jacob c9245748bf chore: add console sdk 2022-09-20 14:13:04 +05:30
Christy Jacob 67c7250b3c chore: add console sdk 2022-09-20 14:09:16 +05:30
Christy Jacob 29e5acb29e chore: add console sdk 2022-09-20 14:08:25 +05:30
Christy Jacob 78f6748fb0 chore: add console sdk 2022-09-20 14:07:51 +05:30
Christy Jacob 7c797515e6 chore: add console sdk 2022-09-20 14:07:10 +05:30
Christy Jacob 044078f7e3 chore: add console sdk 2022-09-20 14:05:49 +05:30
Christy Jacob eb50137ee2 chore: add console sdk 2022-09-20 14:04:43 +05:30
Christy Jacob 9b5db34669 chore: add console sdk 2022-09-20 14:02:54 +05:30
Christy Jacob 9e427d7833 chore: add console sdk 2022-09-20 14:02:05 +05:30
Matej Bačo 96134f2a5e Remove todo 2022-09-20 08:29:34 +00: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
Steven NguyenandSteven 2f08ec0926 Convert Document $collectionId in 0.15 response
Document $collection was renamed to $collectionId to match the naming
convention of referring to other resource IDs. This ensures backwards
compatibility.
2022-09-20 02:48:40 +00:00
Steven NguyenandSteven 01f77fa993 Ensure empty datetimes are 0 in 0.15 response
Because empty datetimes are invalid, strtotime returned false so the
response was false rather than 0.
2022-09-20 02:48:40 +00:00
Jake Barnby 98747c949d Merge remote-tracking branch 'origin/master' into refactor-test-failures 2022-09-20 12:51:42 +12:00
Damodar Lohani e80e65946b Merge branch 'master' of https://github.com/appwrite/appwrite into feat-app-region 2022-09-19 12:01:56 +00:00
Matej Bačo 89afad1a32 Replace nulls with empty strings 2022-09-19 11:58:41 +00:00
Matej Bačo e31c7f7740 Improve delete worker for functions 2022-09-19 11:53:34 +00:00
Matej Bačo c42bf2d8da Fix documentation response model 2022-09-19 11:43:21 +00:00
Matej Bačo a983e792d8 Refactor required param values 2022-09-19 10:05:42 +00:00
Matej Bačo 215c02ac47 e2e tests for password re-hashing 2022-09-19 08:43:59 +00:00
Matej Bačo 6e8a4cc97b Update sms mock to use request catcher 2022-09-19 08:09:48 +00:00
Toir TuychievandGitHub 360054f500 Fixed typo in providers.php
Perperation -> Preparation
2022-09-17 21:29:01 +05:00
Toir TuychievandGitHub fd9d300654 Fixed typo in events.php
accessiable -> accessible
2022-09-17 21:27:32 +05:00
Toir TuychievandGitHub ca318c1842 Fixed typo in docker-compose.yml
Fixed typo in docker-compose.yml
2022-09-17 20:35:33 +05:00
Ikko AshimineandGitHub 82141b7387 Fix typo in Exception.php
follwing -> following
2022-09-17 12:44:20 +09:00
Faizan Pasha ffe525c5cc Removed unused import 2022-09-17 06:02:11 +05:30
Faizan Pasha 12b6e671b0 Fixed the bug #3859 2022-09-17 05:58:14 +05:30
Steven 9985af45fb Update flutter getting started to match library 2022-09-16 20:25:06 +00:00
Matej Baco 81ddc99f7b Improve mail events code quality 2022-09-16 11:54:59 +02:00
Steven Nguyen 00a4929301 Fix date format for usage APIs 2022-09-15 23:48:09 +00:00
Jake Barnby 9ad270ec14 Remove Android, Kotlin, Apple and Swift from beta 2022-09-15 19:38:00 +12:00
Christy JacobandGitHub 19eb6c7e50 Merge pull request #3841 from appwrite/fix-role-all
Change role:all to any in docs
2022-09-15 01:53:09 +05:30
Torsten DittmannandGitHub e04b9fc136 Merge pull request #3843 from appwrite/chore-fix-readme-versions
chore: update readme for 1.0.1
2022-09-14 22:11:21 +02:00
Torsten DittmannandGitHub ed79d4dffb chore: update readme for 1.0.0 2022-09-14 22:08:44 +02:00
StevenandGitHub 6c9e805682 Change role:all to any in docs 2022-09-14 12:18:33 -07:00
Torsten DittmannandGitHub 939b5a00f5 Merge pull request #3840 from appwrite/feat-prepare-1.0.1-release
feat: prepare 1.0.1 release
2022-09-14 21:07:42 +02:00
Torsten Dittmann 95d322dc36 feat: prepare 1.0.1 release 2022-09-14 21:03:00 +02:00
Torsten DittmannandGitHub 192617c9ac Merge pull request #3839 from appwrite/fix-migration-abuse-time
fix: migration for abuse time column
2022-09-14 19:51:42 +02:00
Torsten Dittmann 5fb6d2fa6a chore: add changelog 2022-09-14 19:48:56 +02:00
Torsten Dittmann fab87c7f00 fix: migration for abuse time column 2022-09-14 19:40:03 +02:00
Torsten Dittmann 0e2e7395a9 ci: increase test timeouts 2022-09-14 19:17:03 +02:00
Torsten Dittmann 5fd0de842f ci: fix build args 2022-09-14 17:52:52 +02:00
Torsten Dittmann 6d5aec39fe ci: use faster compose file for ci 2022-09-14 16:44:50 +02:00
Torsten Dittmann b0d6e905f1 Merge branch 'master' of https://github.com/appwrite/appwrite into feat-github-non-self-hosted 2022-09-14 16:29:53 +02:00
Vincent (Wen Yu) GeandGitHub c20d46fef3 Update README-CN.md 2022-09-14 09:40:51 -04:00
Christy JacobandGitHub 700d7bc6aa Merge pull request #3835 from appwrite/update-readme
feat: update readme
2022-09-14 18:52:09 +05:30
Christy Jacob 3b39b3a88d feat: update readme 2022-09-14 18:46:35 +05:30
Jake Barnby d380cb8c47 Revert "Stop tests on failure"
This reverts commit f0626d2ee4.
2022-09-14 19:04:32 +12:00
Damodar Lohani 3beacf0263 add region to usage documents 2022-09-09 06:13:12 +00:00
Damodar Lohani 03fade9501 fix default region value 2022-09-09 05:14:29 +00:00
Damodar Lohani 0cd1da0680 remove dump 2022-09-09 05:06:07 +00:00
Damodar Lohani 9fc800c45a update project create script 2022-09-09 04:57:54 +00:00
Damodar Lohani 3e34e42c93 update console SDK 2022-09-09 01:25:36 +00:00
Damodar Lohani aa2a6d7f11 region in spec 2022-09-09 01:22:04 +00:00
Damodar Lohani 0848815485 remove other regions 2022-09-09 01:00:51 +00:00
Damodar Lohani 4f257f9e7e linter fix 2022-09-09 01:00:27 +00:00
Damodar Lohani 7207d6ab7a default region 2022-09-08 07:20:42 +00:00
Damodar Lohani ed81ff1263 regions using config instead 2022-09-08 07:19:14 +00:00
Damodar Lohani f46327d206 description 2022-09-08 06:25:54 +00:00
Damodar Lohani cf1c9452c1 region in UI 2022-09-08 06:24:58 +00:00
Damodar Lohani 8450a0c213 region in UI 2022-09-08 05:24:46 +00:00
Damodar Lohani 119344031a region on endpoint 2022-09-08 05:04:16 +00:00
Damodar Lohani fafef03512 region attribute on project 2022-09-08 04:53:46 +00:00
Damodar Lohani 349833573f region environment variables 2022-09-08 04:51:08 +00:00
Torsten DittmannandGitHub bcd05bf5a7 ci: force buildkit and settings 2022-09-04 22:23:38 +02:00
Torsten DittmannandGitHub 683a691bf9 ci: update github actions to use github hosted runners 2022-09-04 22:05:30 +02: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
Matej Bačo 30c157c23e Linter fix, update tests 2022-08-19 09:43:03 +00:00
Matej Bačo 61ab41bf86 Implement status of oauth providers, and refactor response models 2022-08-19 09:21:51 +00: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
7951 changed files with 166254 additions and 57898 deletions
+6 -3
View File
@@ -56,7 +56,7 @@ _APP_SMTP_PORT=1025
_APP_SMTP_SECURE=
_APP_SMTP_USERNAME=
_APP_SMTP_PASSWORD=
_APP_SMS_PROVIDER=sms://mock
_APP_SMS_PROVIDER=sms://username:password@mock
_APP_SMS_FROM=+123456789
_APP_STORAGE_LIMIT=30000000
_APP_STORAGE_PREVIEW_LIMIT=20000000
@@ -76,11 +76,14 @@ _APP_MAINTENANCE_RETENTION_CACHE=2592000
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600
_APP_MAINTENANCE_RETENTION_ABUSE=86400
_APP_MAINTENANCE_RETENTION_AUDIT=1209600
_APP_USAGE_TIMESERIES_INTERVAL=2
_APP_USAGE_DATABASE_INTERVAL=15
_APP_USAGE_AGGREGATION_INTERVAL=5
_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 -24
View File
@@ -1,24 +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
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
-88
View File
@@ -1,88 +0,0 @@
name: "🐛 Bug Report"
description: "Submit a bug report to help us improve"
title: "🐛 Bug Report: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out our bug report form 🙏
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: "👟 Reproduction steps"
description: "How do you trigger this bug? Please walk us through it step by step."
placeholder: "When I ..."
- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: "👍 Expected behavior"
description: "What did you think would happen?"
placeholder: "It should ..."
- type: textarea
id: actual-behavior
validations:
required: true
attributes:
label: "👎 Actual Behavior"
description: "What did actually happen? Add screenshots, if applicable."
placeholder: "It actually ..."
- type: dropdown
id: appwrite-version
attributes:
label: "🎲 Appwrite version"
description: "What version of Appwrite are you running?"
options:
- Version 1.0.0-RC1
- Version 0.15.x
- Version 0.14.x
- Version 0.13.x
- Version 0.12.x
- Version 0.11.x
- Version 0.10.x
- Version 0.9.x
- Version 0.8.x
- Version 0.7.x
- Version 0.6.x
- Different version (specify in environment)
validations:
required: true
- type: dropdown
id: operating-system
attributes:
label: "💻 Operating system"
description: "What OS is your server / device running on?"
options:
- Linux
- MacOS
- Windows
- Something else
validations:
required: true
- type: textarea
id: environment
validations:
required: false
attributes:
label: "🧱 Your Environment"
description: "Is your environment customized in any way?"
placeholder: "I use Cloudflare for ..."
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "👀 Have you spent some time to check if this issue has been raised before?"
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
id: read-code-of-conduct
attributes:
label: "🏢 Have you read the Code of Conduct?"
options:
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
required: true
-32
View File
@@ -1,32 +0,0 @@
name: "📚 Documentation"
description: "Report an issue related to documentation"
title: "📚 Documentation: "
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to make our documentation better 🙏
- type: textarea
id: issue-description
validations:
required: true
attributes:
label: "💭 Description"
description: "A clear and concise description of what the issue is."
placeholder: "Documentation should not ..."
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "👀 Have you spent some time to check if this issue has been raised before?"
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
id: read-code-of-conduct
attributes:
label: "🏢 Have you read the Code of Conduct?"
options:
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
required: true
-40
View File
@@ -1,40 +0,0 @@
name: 🚀 Feature
description: "Submit a proposal for a new feature"
title: "🚀 Feature: "
labels: [feature]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out our feature request form 🙏
- type: textarea
id: feature-description
validations:
required: true
attributes:
label: "🔖 Feature description"
description: "A clear and concise description of what the feature is."
placeholder: "You should add ..."
- type: textarea
id: pitch
validations:
required: true
attributes:
label: "🎤 Pitch"
description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable."
placeholder: "In my use-case, ..."
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "👀 Have you spent some time to check if this issue has been raised before?"
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
id: read-code-of-conduct
attributes:
label: "🏢 Have you read the Code of Conduct?"
options:
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
required: true
+6 -5
View File
@@ -11,16 +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 read the [Contributing Guidelines on issues](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md)?
## Checklist
(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 }}
+29 -17
View File
@@ -1,34 +1,53 @@
name: "Tests"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [pull_request]
jobs:
tests:
name: Unit & E2E
runs-on: self-hosted
runs-on: ubuntu-latest
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.
fetch-depth: 2
# Fetch submodules
submodules: recursive
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- 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: |
echo "_APP_FUNCTIONS_RUNTIMES=php-8.0" >> .env
docker pull composer:2.0
docker pull php:8.0-cli-alpine
docker compose build --progress=plain
docker compose up -d
sleep 10
sleep 30
- name: Doctor
run: docker compose exec -T appwrite doctor
@@ -36,11 +55,4 @@ jobs:
run: docker compose exec -T appwrite vars
- name: Run Tests
run: docker compose exec -T appwrite test --debug
- name: Teardown
if: always()
run: |
docker ps -aq | xargs docker rm --force || true
docker volume prune --force || true
docker network prune --force || true
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/
+4
View File
@@ -0,0 +1,4 @@
[submodule "app/console"]
path = app/console
url = https://github.com/appwrite/console
branch = 2.3.3
+2 -1
View File
@@ -1,8 +1,9 @@
tasks:
- name: Run Appwrite Docker Stack
init: |
docker compose pull
git submodule update --init
docker compose build
docker compose pull
docker pull composer
command: |
docker run --rm --interactive --tty \
+109
View File
@@ -1,3 +1,112 @@
# 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)
- Make `region` parameter optional with default for project create [#4763](https://github.com/appwrite/appwrite/pull/4763)
## Bugs
- Fix default oauth paths [#4725](https://github.com/appwrite/appwrite/pull/4725)
- Fix session expiration, and expired session deletion [#4739](https://github.com/appwrite/appwrite/pull/4739)
- Fix processing status on sync executions [#4737](https://github.com/appwrite/appwrite/pull/4737)
- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761)
# Version 1.1.1
## Bugs
- Fix Deletes worker using incorrect device for file deletion [#4662](https://github.com/appwrite/appwrite/pull/4662)
- Fix Migration for Stats adding the region attribute [#4704](https://github.com/appwrite/appwrite/pull/4704)
- Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704)
- Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704)
- Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704)
# Version 1.1.0
## Features
- Added support for the new Appwrite Console [#4655](https://github.com/appwrite/appwrite/pull/4655)
- Added new property to projects configuration: `authDuration` which allows you to alter the duration of signed in sessions for your project. [#4618](https://github.com/appwrite/appwrite/pull/4618)
## 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)
# Version 1.0.3
## Bugs
- Fix document audit deletion [#4429](https://github.com/appwrite/appwrite/pull/4429)
- Fix attribute and index deletion when deleting a collection [#4429](https://github.com/appwrite/appwrite/pull/4429)
# Version 1.0.2
## Bugs
- Fixed nullable values in functions variables [#3885](https://github.com/appwrite/appwrite/pull/3885)
- Fixed migration for audit by migrating the `time` attribute [#4038](https://github.com/appwrite/appwrite/pull/4038)
- Fixed default value for creating Boolean Attribute [#4040](https://github.com/appwrite/appwrite/pull/4040)
- Fixed phone authentication code to be hashed in the internal database [#3906](https://github.com/appwrite/appwrite/pull/3906)
- Fixed `/v1/teams/:teamId/memberships/:membershipId` response [#3883](https://github.com/appwrite/appwrite/pull/3883)
- Fixed removing variables when function is deleted [#3884](https://github.com/appwrite/appwrite/pull/3884)
- Fixed scheduled function not being triggered [#3908](https://github.com/appwrite/appwrite/pull/3908)
- Fixed Phone Provider configuration [#3862](https://github.com/appwrite/appwrite/pull/3883)
- Fixed Queries with `0` values [utopia-php/database#194](https://github.com/utopia-php/database/pull/194)
# Version 1.0.1
## Bugs
- Fixed migration for abuse by migrating the `time` attribute [#3839](https://github.com/appwrite/appwrite/pull/3839)
# Version 1.0.0
## BREAKING CHANGES
- All Date values are now stored as ISO-8601 instead of UNIX timestamps [#3516](https://github.com/appwrite/appwrite/pull/3516)
- Permission levels and syntax have been reworked. See the Permissions V2 section in the document for more information [#3700](https://github.com/appwrite/appwrite/pull/3700)
-76
View File
@@ -1,76 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity, expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at team@appwrite.io. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
+86 -70
View File
@@ -1,14 +1,14 @@
# 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](/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 🚀
@@ -24,13 +24,13 @@ 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
- **refactor** - code change that neither fixes a bug nor adds a feature
**All PRs must include a commit message with the changes description!**
**All PRs must include a commit message with the description of the changes made!**
For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to:
@@ -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,24 @@ $ 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
```
@@ -116,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 advance 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
@@ -149,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.
---
@@ -187,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
@@ -212,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
@@ -226,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
@@ -273,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
@@ -315,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 there change the IP address to your development machine's IP. Without the proper IP address debugger wont 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
@@ -356,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
@@ -378,7 +386,7 @@ To run end-2-end tests use:
docker compose exec appwrite test /usr/src/code/tests/e2e
```
To run end-2-end tests for a spcific service use:
To run end-2-end tests for a specific service use:
```bash
docker compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
@@ -427,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!
+17 -199
View File
@@ -12,157 +12,24 @@ 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
WORKDIR /usr/local/src/
COPY app/console /usr/local/src/console
COPY package-lock.json /usr/local/src/
COPY package.json /usr/local/src/
COPY gulpfile.js /usr/local/src/
COPY public /usr/local/src/public
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"
@@ -246,49 +113,17 @@ ENV _APP_SERVER=swoole \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION \
_APP_USAGE_STATS=enabled \
_APP_USAGE_TIMESERIES_INTERVAL=30 \
_APP_USAGE_DATABASE_INTERVAL=900 \
_APP_USAGE_AGGREGATION_INTERVAL=30 \
# 14 Days = 1209600 s
_APP_MAINTENANCE_RETENTION_EXECUTION=1209600 \
_APP_MAINTENANCE_RETENTION_AUDIT=1209600 \
# 1 Day = 86400 s
_APP_MAINTENANCE_RETENTION_ABUSE=86400 \
_APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000 \
_APP_MAINTENANCE_INTERVAL=86400 \
_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; \
@@ -297,22 +132,12 @@ RUN \
WORKDIR /usr/src/code
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
COPY --from=node /usr/local/src/public/dist /usr/src/code/public/dist
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/
COPY --from=node /usr/local/src/console/build /usr/src/code/console
# Add Source Code
COPY ./app /usr/src/code/app
COPY ./bin /usr/local/bin
COPY ./docs /usr/src/code/docs
COPY ./public/fonts /usr/src/code/public/fonts
COPY ./public/images /usr/src/code/public/images
COPY ./src /usr/src/code/src
# Set Volumes
@@ -357,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
@@ -376,4 +194,4 @@ RUN echo "opcache.jit=1235" >> /usr/local/etc/php/conf.d/appwrite.ini
EXPOSE 80
CMD [ "php", "app/http.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
CMD [ "php", "app/http.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
+25 -17
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>
@@ -8,17 +11,22 @@
<br />
</p>
<!-- [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io) -->
<!-- [![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)
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite)
[![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)
[![翻译](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
[![周边商店](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
<!-- [![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) -->
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
[English](README.md) | 简体中文
Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面极简了从零编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
[**宣布带有数据库关系的 Appwrite 1.3!了解最新消息!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc)
Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面简化了从零开始编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存,图像处理,云函数计算,[等多种服务](https://appwrite.io/docs).
@@ -50,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
@@ -59,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:0.15.3
appwrite/appwrite:1.3.1
```
### Windows
@@ -71,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:0.15.3
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:0.15.3
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 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
@@ -128,7 +136,7 @@ docker run -it --rm ,
#### 服务器
* ✅ &nbsp; [NodeJS](https://github.com/appwrite/sdk-for-node) (由 Appwrite 团队维护)
* ✅ &nbsp; [PHP](https://github.com/appwrite/sdk-for-php) (由 Appwr实验 团队维护)
* ✅ &nbsp; [PHP](https://github.com/appwrite/sdk-for-php) (由 Appwrite 团队维护)
* ✅ &nbsp; [Dart](https://github.com/appwrite/sdk-for-dart) - (由 Appwrite 团队维护)
* ✅ &nbsp; [Deno](https://github.com/appwrite/sdk-for-deno) - **公测** (由 Appwrite 团队维护)
* ✅ &nbsp; [Ruby](https://github.com/appwrite/sdk-for-ruby) (由 Appwrite 团队维护)
@@ -154,7 +162,7 @@ Appwrite API 界面层利用后台缓存和任务委派来提供极速的响应
## 贡献代码
所有代码贡献 - 包括来自具有直接提交更改权限的贡献者 - 都必须提交PR请求并在合并分支之前得到核心开发人员的批准。这是为了确保正确审查所有代码。
为了确保正确审查,所有代码贡献 - 包括来自具有直接提交更改权限的贡献者 - 都必须提交PR请求并在合并分支之前得到核心开发人员的批准。
我们欢迎所有人提交PR!如果您愿意提供帮助,可以在 [贡献指南](CONTRIBUTING.md) 中了解有关如何为项目做出贡献的更多信息。
@@ -164,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) 以获得更多帮助,想法和讨论。
## 版权说明
+65 -54
View File
@@ -11,22 +11,33 @@
<br />
</p>
<!-- [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io) -->
<!-- [![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)
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
[![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)
[![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
[![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
<!-- [![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) -->
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
English | [简体中文](README-CN.md)
[**Appwrite 0.15 has been released! Learn what's new!**](https://dev.to/appwrite/announcing-appwrite-015-with-phone-authentication-more-5cjj)
[**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 />
<a href="https://www.producthunt.com/posts/appwrite-2?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-appwrite-2" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=360315&theme=light&period=daily" alt="Appwrite - 100&#0037;&#0032;open&#0032;source&#0032;alternative&#0032;for&#0032;Firebase | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
<br />
<br />
</p>
![Appwrite](public/images/github.png)
@@ -54,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:
@@ -65,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:0.15.3
appwrite/appwrite:1.3.1
```
### Windows
@@ -77,21 +88,20 @@ 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:0.15.3
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:0.15.3
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
```
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.
@@ -99,10 +109,9 @@ For advanced production and custom installation, check out our Docker [environme
If you are upgrading your Appwrite server from an older version, you should use the Appwrite migration tool once your setup is completed. For more information regarding this, check out the [Installation Docs](https://appwrite.io/docs/installation).
## 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:
@@ -127,66 +136,68 @@ Choose from one of the providers below:
Getting started with Appwrite is as easy as creating a new project, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials.
* [Getting Started for Web](https://appwrite.io/docs/getting-started-for-web)
* [Getting Started for Flutter](https://appwrite.io/docs/getting-started-for-flutter)
* [Getting Started for Apple](https://appwrite.io/docs/getting-started-for-apple)
* [Getting Started for Android](https://appwrite.io/docs/getting-started-for-android)
* [Getting Started for Server](https://appwrite.io/docs/getting-started-for-server)
* [Getting Started for CLI](https://appwrite.io/docs/command-line)
- [Getting Started for Web](https://appwrite.io/docs/getting-started-for-web)
- [Getting Started for Flutter](https://appwrite.io/docs/getting-started-for-flutter)
- [Getting Started for Apple](https://appwrite.io/docs/getting-started-for-apple)
- [Getting Started for Android](https://appwrite.io/docs/getting-started-for-android)
- [Getting Started for Server](https://appwrite.io/docs/getting-started-for-server)
- [Getting Started for CLI](https://appwrite.io/docs/command-line)
### Services
* [**Account**](https://appwrite.io/docs/client/account) - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
* [**Users**](https://appwrite.io/docs/server/users) - Manage and list all project users when in admin mode.
* [**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.
- [**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 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
* ✅ &nbsp; [Web](https://github.com/appwrite/sdk-for-web) (Maintained by the Appwrite Team)
* &nbsp; [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team)
* &nbsp; [Apple](https://github.com/appwrite/sdk-for-apple) - **Beta** (Maintained by the Appwrite Team)
* &nbsp; [Android](https://github.com/appwrite/sdk-for-android) (Maintained by the Appwrite Team)
- ✅ &nbsp; [Web](https://github.com/appwrite/sdk-for-web) (Maintained by the Appwrite Team)
- ✅ &nbsp; [Flutter](https://github.com/appwrite/sdk-for-flutter) (Maintained by the Appwrite Team)
- ✅ &nbsp; [Apple](https://github.com/appwrite/sdk-for-apple) - **Beta** (Maintained by the Appwrite Team)
- ✅ &nbsp; [Android](https://github.com/appwrite/sdk-for-android) (Maintained by the Appwrite Team)
#### Server
* ✅ &nbsp; [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team)
* &nbsp; [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team)
* &nbsp; [Dart](https://github.com/appwrite/sdk-for-dart) - (Maintained by the Appwrite Team)
* &nbsp; [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
* &nbsp; [Ruby](https://github.com/appwrite/sdk-for-ruby) (Maintained by the Appwrite Team)
* &nbsp; [Python](https://github.com/appwrite/sdk-for-python) (Maintained by the Appwrite Team)
* &nbsp; [Kotlin](https://github.com/appwrite/sdk-for-kotlin) - **Beta** (Maintained by the Appwrite Team)
* &nbsp; [Apple](https://github.com/appwrite/sdk-for-apple) - **Beta** (Maintained by the Appwrite Team)
* &nbsp; [.NET](https://github.com/appwrite/sdk-for-dotnet) - **Experimental** (Maintained by the Appwrite Team)
- ✅ &nbsp; [NodeJS](https://github.com/appwrite/sdk-for-node) (Maintained by the Appwrite Team)
- ✅ &nbsp; [PHP](https://github.com/appwrite/sdk-for-php) (Maintained by the Appwrite Team)
- ✅ &nbsp; [Dart](https://github.com/appwrite/sdk-for-dart) - (Maintained by the Appwrite Team)
- ✅ &nbsp; [Deno](https://github.com/appwrite/sdk-for-deno) - **Beta** (Maintained by the Appwrite Team)
- ✅ &nbsp; [Ruby](https://github.com/appwrite/sdk-for-ruby) (Maintained by the Appwrite Team)
- ✅ &nbsp; [Python](https://github.com/appwrite/sdk-for-python) (Maintained by the Appwrite Team)
- ✅ &nbsp; [Kotlin](https://github.com/appwrite/sdk-for-kotlin) - **Beta** (Maintained by the Appwrite Team)
- ✅ &nbsp; [Apple](https://github.com/appwrite/sdk-for-apple) - **Beta** (Maintained by the Appwrite Team)
- ✅ &nbsp; [.NET](https://github.com/appwrite/sdk-for-dotnet) - **Experimental** (Maintained by the Appwrite Team)
#### Community
* ✅ &nbsp; [Appcelerator Titanium](https://github.com/m1ga/ti.appwrite) (Maintained by [Michael Gangolf](https://github.com/m1ga/))
* &nbsp; [Godot Engine](https://github.com/GodotNuts/appwrite-sdk) (Maintained by [fenix-hub @GodotNuts](https://github.com/fenix-hub))
- ✅ &nbsp; [Appcelerator Titanium](https://github.com/m1ga/ti.appwrite) (Maintained by [Michael Gangolf](https://github.com/m1ga/))
- ✅ &nbsp; [Godot Engine](https://github.com/GodotNuts/appwrite-sdk) (Maintained by [fenix-hub @GodotNuts](https://github.com/fenix-hub))
Looking for more SDKs? - Help us by contributing a pull request to our [SDK Generator](https://github.com/appwrite/sdk-generator)!
## Architecture
![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 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).
@@ -196,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 -5
View File
@@ -2,11 +2,13 @@
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| <= 0.10 | :x: |
| 0.11.x | :white_check_mark: |
| 0.12.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.
File diff suppressed because it is too large Load Diff
+79 -29
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' => [
[
@@ -523,6 +533,17 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('region'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 128,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('description'),
'type' => Database::VAR_STRING,
@@ -737,6 +758,13 @@ $collections = [
'lengths' => [128],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_team'),
'type' => Database::INDEX_KEY,
'attributes' => ['teamId'],
'lengths' => [Database::LENGTH_KEY],
'orders' => [Database::ORDER_ASC],
],
],
],
@@ -1216,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,
@@ -1614,17 +1653,6 @@ $collections = [
'array' => false,
'filters' => ['encrypt'],
],
[
'$id' => ID::custom('expire'),
'type' => Database::VAR_DATETIME,
'format' => '',
'size' => 0,
'signed' => false,
'required' => false,
'default' => null,
'array' => false,
'filters' => ['datetime'],
],
[
'$id' => ID::custom('userAgent'),
'type' => Database::VAR_STRING,
@@ -1847,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' => [
[
@@ -2209,14 +2248,14 @@ $collections = [
'$id' => ID::custom('_key_search'),
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['search'],
'lengths' => [2048],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_name'),
'type' => Database::INDEX_KEY,
'attributes' => ['name'],
'lengths' => [2048],
'lengths' => [768],
'orders' => [Database::ORDER_ASC],
],
[
@@ -2230,21 +2269,21 @@ $collections = [
'$id' => ID::custom('_key_runtime'),
'type' => Database::INDEX_KEY,
'attributes' => ['runtime'],
'lengths' => [2048],
'lengths' => [768],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_deployment'),
'type' => Database::INDEX_KEY,
'attributes' => ['deployment'],
'lengths' => [Database::LENGTH_KEY],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_schedule'),
'type' => Database::INDEX_KEY,
'attributes' => ['schedule'],
'lengths' => [128],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
@@ -2403,14 +2442,14 @@ $collections = [
'$id' => ID::custom('_key_resource'),
'type' => Database::INDEX_KEY,
'attributes' => ['resourceId'],
'lengths' => [Database::LENGTH_KEY],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_resource_type'),
'type' => Database::INDEX_KEY,
'attributes' => ['resourceType'],
'lengths' => [Database::LENGTH_KEY],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
@@ -2424,7 +2463,7 @@ $collections = [
'$id' => ID::custom('_key_entrypoint'),
'type' => Database::INDEX_KEY,
'attributes' => ['entrypoint'],
'lengths' => [2048],
'lengths' => [768],
'orders' => [Database::ORDER_ASC],
],
[
@@ -2438,7 +2477,7 @@ $collections = [
'$id' => ID::custom('_key_buildId'),
'type' => Database::INDEX_KEY,
'attributes' => ['buildId'],
'lengths' => [Database::LENGTH_KEY],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
@@ -2939,14 +2978,14 @@ $collections = [
'$id' => ID::custom('_fulltext_name'),
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['name'],
'lengths' => [1024],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_search'),
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['search'],
'lengths' => [2048],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
@@ -2960,7 +2999,7 @@ $collections = [
'$id' => ID::custom('_key_name'),
'type' => Database::INDEX_KEY,
'attributes' => ['name'],
'lengths' => [128],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
@@ -3010,6 +3049,17 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('region'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 255,
'signed' => true,
'required' => true,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('value'),
'type' => Database::VAR_INTEGER,
@@ -3238,7 +3288,7 @@ $collections = [
'$id' => ID::custom('mimeType'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 127, // https://tools.ietf.org/html/rfc4288#section-4.2
'size' => 255, // https://tools.ietf.org/html/rfc4288#section-4.2
'signed' => true,
'required' => false,
'default' => null,
@@ -3383,7 +3433,7 @@ $collections = [
'$id' => ID::custom('_key_search'),
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['search'],
'lengths' => [2048],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
@@ -3397,21 +3447,21 @@ $collections = [
'$id' => ID::custom('_key_name'),
'type' => Database::INDEX_KEY,
'attributes' => ['name'],
'lengths' => [2048],
'lengths' => [768],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_signature'),
'type' => Database::INDEX_KEY,
'attributes' => ['signature'],
'lengths' => [2048],
'lengths' => [768],
'orders' => [Database::ORDER_ASC],
],
[
'$id' => ID::custom('_key_mimeType'),
'type' => Database::INDEX_KEY,
'attributes' => ['mimeType'],
'lengths' => [127],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
],
[
+35 -5
View File
@@ -70,7 +70,7 @@ return [
],
Exception::GENERAL_ROUTE_NOT_FOUND => [
'name' => Exception::GENERAL_ROUTE_NOT_FOUND,
'description' => 'The requested route was not found. Please refer to the docs and try again.',
'description' => 'The requested route was not found. Please refer to the API docs and try again.',
'code' => 404,
],
Exception::GENERAL_CURSOR_NOT_FOUND => [
@@ -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 => [
@@ -486,7 +501,7 @@ return [
],
Exception::PROJECT_PROVIDER_UNSUPPORTED => [
'name' => Exception::PROJECT_PROVIDER_UNSUPPORTED,
'description' => 'The chosen OAuth provider is unsupported. Please check <a href="/docs/client/account?sdk=web-default#accountCreateOAuth2Session"> the docs</a> for the complete list of supported OAuth providers.',
'description' => 'The chosen OAuth provider is unsupported. Please check the <a href="/docs/client/account?sdk=web-default#accountCreateOAuth2Session">Create OAuth2 Session docs</a> for the complete list of supported OAuth providers.',
'code' => 501,
],
Exception::PROJECT_INVALID_SUCCESS_URL => [
@@ -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,
],
];
+7 -4
View File
@@ -1,7 +1,7 @@
<?php
/**
* List of publicly accessiable system events
* List of publicly accessible system events
*/
use Appwrite\Utopia\Response;
@@ -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}}",
+7 -7
View File
@@ -6,25 +6,25 @@
"emails.verification.subject": "अकाउंट वेरिफिकेशन ",
"emails.verification.hello": "नमस्ते {{name}}",
"emails.verification.body": "इस लिंक के माध्यम से अपने ईमेल को सत्यापित कीजिये।",
"emails.verification.footer": "यदि आपने इस पते को सत्यापित नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"emails.verification.footer": "यदि आप इस पते को सत्यापित नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"emails.verification.thanks": "धन्यवाद",
"emails.verification.signature": "{{project}} टीम",
"emails.magicSession.subject": "लॉग इन",
"emails.magicSession.hello": "नमस्ते,",
"emails.magicSession.body": "इस लिंक के माध्यम से लॉग-इन करें।",
"emails.magicSession.footer": "यदि आप इस ईमेल द्वारा लॉगिन नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"emails.magicSession.footer": "यदि आप इस ईमेल द्वारा लॉगिन नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"emails.magicSession.thanks": "धन्यवाद",
"emails.magicSession.signature": "{{project}} टीम",
"emails.recovery.subject": "पासवर्ड रीसेट",
"emails.recovery.hello": "नमस्ते {{name}}",
"emails.recovery.body": "इस लिंक के माध्यम से अपना {{project}} पासवर्ड रीसेट करें।",
"emails.recovery.footer": "यदि आप अपना पासवर्ड रिसेट नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"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.footer": "यदि आप इसमे रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"emails.invitation.body": "यह मेल आपको इसलिए भेजा गया है क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनाना चाहते है, जो {{project}} से जुड़ा हुआ है।",
"emails.invitation.footer": "यदि आप इसमे रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
"emails.invitation.thanks": "धन्यवाद",
"emails.invitation.signature": "{{project}} टीम",
"locale.country.unknown": "अज्ञात",
@@ -35,7 +35,7 @@
"countries.ae": "संयुक्त अरब अमीरात",
"countries.ar": "अर्जेंटीना",
"countries.am": "आर्मीनिया",
"countries.ag": "ंटीगुआ और बारबूडा",
"countries.ag": "ंटीगुआ और बारबूडा",
"countries.au": "ऑस्ट्रेलिया",
"countries.at": "ऑस्ट्रिया",
"countries.az": "अज़रबैजान",
@@ -46,7 +46,7 @@
"countries.bd": "बांग्लादेश",
"countries.bg": "बुल्गारिया",
"countries.bh": "बहरीन",
"countries.bs": "हामास",
"countries.bs": "द बाहामास",
"countries.ba": "बॉस्निया और हर्ज़ेगोविना",
"countries.by": "बेलारूस",
"countries.bz": "बेलीज़",
+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": "南美洲"
}
}
+103 -42
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.0.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.0.0',
'version' => '9.0.0',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'package' => 'https://pub.dev/packages/appwrite',
'enabled' => true,
@@ -81,11 +81,11 @@ return [
[
'key' => 'apple',
'name' => 'Apple',
'version' => '1.0.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-apple',
'package' => 'https://github.com/appwrite/sdk-for-apple',
'enabled' => true,
'beta' => true,
'beta' => false,
'dev' => false,
'hidden' => false,
'family' => APP_PLATFORM_CLIENT,
@@ -116,11 +116,11 @@ return [
[
'key' => 'android',
'name' => 'Android',
'version' => '1.0.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,
'beta' => true,
'beta' => false,
'dev' => false,
'hidden' => false,
'family' => APP_PLATFORM_CLIENT,
@@ -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.0.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.0.0',
'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.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.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.0.0',
'version' => '8.0.0',
'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => 'https://pub.dev/packages/dart_appwrite',
'enabled' => true,
@@ -370,11 +393,11 @@ return [
[
'key' => 'kotlin',
'name' => 'Kotlin',
'version' => '1.0.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,
'beta' => true,
'beta' => false,
'dev' => false,
'hidden' => false,
'family' => APP_PLATFORM_SERVER,
@@ -392,11 +415,11 @@ return [
[
'key' => 'swift',
'name' => 'Swift',
'version' => '1.0.0',
'version' => '2.0.0',
'url' => 'https://github.com/appwrite/sdk-for-swift',
'package' => 'https://github.com/appwrite/sdk-for-swift',
'enabled' => true,
'beta' => true,
'beta' => false,
'dev' => false,
'hidden' => false,
'family' => APP_PLATFORM_SERVER,
@@ -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,
],
],
],
];
+1 -1
View File
@@ -17,7 +17,7 @@ return [ // Ordered by ABC.
'icon' => 'icon-apple',
'enabled' => true,
'sandbox' => false,
'form' => 'apple.phtml', // Perperation for adding ability to customized OAuth UI forms, currently handled hardcoded.
'form' => 'apple.phtml', // Preparation for adding ability to customized OAuth UI forms, currently handled hardcoded.
'beta' => true,
'mock' => false,
],
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'default' => [
'name' => 'Default',
'default' => true,
'disabled' => 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
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
+51 -9
View File
@@ -170,8 +170,8 @@ return [
],
[
'name' => '_APP_USAGE_AGGREGATION_INTERVAL',
'description' => 'Deprecated since 1.0.0, use `_APP_USAGE_TIMESERIES_INTERVAL` and `_APP_USAGE_DATABASE_INTERVAL` instead.',
'introduction' => '0.10.0',
'description' => 'Interval value containing the number of seconds that the Appwrite usage process should wait before aggregating stats and syncing it to Database from TimeSeries data. The default value is 30 seconds. Reintroduced in 1.1.0.',
'introduction' => '1.1.0',
'default' => '30',
'required' => false,
'question' => '',
@@ -179,7 +179,7 @@ return [
],
[
'name' => '_APP_USAGE_TIMESERIES_INTERVAL',
'description' => 'Interval value containing the number of seconds that the Appwrite usage process should wait before aggregating stats and syncing it to Appwrite Database from Timeseries Database. The default value is 30 seconds.',
'description' => 'Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead.',
'introduction' => '1.0.0',
'default' => '30',
'required' => false,
@@ -188,7 +188,7 @@ return [
],
[
'name' => '_APP_USAGE_DATABASE_INTERVAL',
'description' => 'Interval value containing the number of seconds that the Appwrite usage process should wait before aggregating stats from data in Appwrite Database. The default value is 15 minutes.',
'description' => 'Deprecated since 1.1.0 use _APP_USAGE_AGGREGATION_INTERVAL instead.',
'introduction' => '1.0.0',
'default' => '900',
'required' => false,
@@ -413,7 +413,7 @@ return [
'variables' => [
[
'name' => '_APP_SMS_PROVIDER',
'description' => "Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'. \n\nAvailable providers are twilio, text-magic and telesign.",
'description' => "Provider used for delivering SMS for Phone authentication. Use the following format: 'sms://[USER]:[SECRET]@[PROVIDER]'. \n\nAvailable providers are twilio, text-magic, telesign, msg91, and vonage.",
'introduction' => '0.15.0',
'default' => '',
'required' => false,
@@ -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,
@@ -857,7 +857,49 @@ return [
'required' => false,
'question' => '',
'filter' => ''
]
],
[
'name' => '_APP_MAINTENANCE_RETENTION_USAGE_HOURLY',
'description' => 'The maximum duration (in seconds) upto which to retain hourly usage metrics. The default value is 8640000 seconds (100 days).',
'introduction' => '',
'default' => '8640000',
'required' => false,
'question' => '',
'filter' => ''
],
],
],
[
'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' => ''
],
],
],
];
Submodule
+1
Submodule app/console added at ac4181aea4
File diff suppressed because it is too large Load Diff
+5 -6
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;
@@ -342,7 +342,6 @@ App::get('/v1/avatars/initials')
->desc('Get User Initials')
->groups(['api', 'avatars'])
->label('scope', 'avatars.read')
->label('cache', true)
->label('cache.resource', 'avatar/initials')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'avatars')
@@ -399,8 +398,8 @@ App::get('/v1/avatars/initials')
$punch->newImage($width, $height, 'transparent');
$draw->setFont(__DIR__ . "/../../../public/fonts/poppins-v9-latin-500.ttf");
$image->setFont(__DIR__ . "/../../../public/fonts/poppins-v9-latin-500.ttf");
$draw->setFont(__DIR__ . "/../../assets/fonts/poppins-v9-latin-500.ttf");
$image->setFont(__DIR__ . "/../../assets/fonts/poppins-v9-latin-500.ttf");
$draw->setFillColor(new ImagickPixel('black'));
$draw->setFontSize($fontSize);
+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
+137 -125
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 "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)
@@ -71,8 +69,13 @@ App::post('/v1/functions')
->param('enabled', true, new Boolean(), 'Is function enabled?', true)
->inject('response')
->inject('dbForProject')
->inject('project')
->inject('user')
->inject('events')
->action(function (string $functionId, string $name, array $execute, string $runtime, array $events, string $schedule, int $timeout, bool $enabled, Response $response, Database $dbForProject, Event $eventsInstance) {
->action(function (string $functionId, string $name, array $execute, string $runtime, array $events, string $schedule, int $timeout, bool $enabled, Response $response, Database $dbForProject, Document $project, Document $user, Event $eventsInstance) {
$cron = !empty($schedule) ? new CronExpression($schedule) : null;
$next = !empty($schedule) ? DateTime::format($cron->getNextRunDate()) : null;
$functionId = ($functionId == 'unique()') ? ID::unique() : $functionId;
$function = $dbForProject->createDocument('functions', new Document([
@@ -86,11 +89,22 @@ App::post('/v1/functions')
'schedule' => $schedule,
'scheduleUpdatedAt' => DateTime::now(),
'schedulePrevious' => null,
'scheduleNext' => null,
'scheduleNext' => $next,
'timeout' => $timeout,
'search' => implode(' ', [$functionId, $name, $runtime])
]));
if ($next) {
// Async task reschedule
$functionEvent = new Func();
$functionEvent
->setFunction($function)
->setType('schedule')
->setUser($user)
->setProject($project)
->schedule(new \DateTime($next));
}
$eventsInstance->setParam('functionId', $function->getId());
$response
@@ -109,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')
@@ -221,8 +235,8 @@ App::get('/v1/functions/:functionId/usage')
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
$periods = [
'24h' => [
'period' => '30m',
'limit' => 48,
'period' => '1h',
'limit' => 24,
],
'7d' => [
'period' => '1d',
@@ -276,12 +290,12 @@ App::get('/v1/functions/:functionId/usage')
while ($backfill > 0) {
$last = $limit - $backfill - 1; // array index of last added metric
$diff = match ($period) { // convert period to seconds for unix timestamp math
'30m' => 1800,
'1h' => 3600,
'1d' => 86400,
};
$stats[$metric][] = [
'value' => 0,
'date' => DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff),
'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)),
];
$backfill--;
}
@@ -324,8 +338,8 @@ App::get('/v1/functions/usage')
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
$periods = [
'24h' => [
'period' => '30m',
'limit' => 48,
'period' => '1h',
'limit' => 24,
],
'7d' => [
'period' => '1d',
@@ -379,12 +393,12 @@ App::get('/v1/functions/usage')
while ($backfill > 0) {
$last = $limit - $backfill - 1; // array index of last added metric
$diff = match ($period) { // convert period to seconds for unix timestamp math
'30m' => 1800,
'1h' => 3600,
'1d' => 86400,
};
$stats[$metric][] = [
'value' => 0,
'date' => DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff),
'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)),
];
$backfill--;
}
@@ -424,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)
@@ -442,11 +456,9 @@ App::put('/v1/functions/:functionId')
throw new Exception(Exception::FUNCTION_NOT_FOUND);
}
$original = $function->getAttribute('schedule', '');
$cron = (!empty($function->getAttribute('deployment')) && !empty($schedule)) ? new CronExpression($schedule) : null;
$next = (!empty($function->getAttribute('deployment')) && !empty($schedule)) ? DateTime::format($cron->getNextRunDate()) : null;
$cron = !empty($schedule) ? new CronExpression($schedule) : null;
$next = !empty($schedule) ? DateTime::format($cron->getNextRunDate()) : null;
$scheduleUpdatedAt = $schedule !== $original ? DateTime::now() : $function->getAttribute('scheduleUpdatedAt');
$enabled ??= $function->getAttribute('enabled', true);
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
@@ -454,14 +466,14 @@ App::put('/v1/functions/:functionId')
'name' => $name,
'events' => $events,
'schedule' => $schedule,
'scheduleUpdatedAt' => $scheduleUpdatedAt,
'scheduleUpdatedAt' => DateTime::now(),
'scheduleNext' => $next,
'timeout' => $timeout,
'enabled' => $enabled,
'search' => implode(' ', [$functionId, $name, $function->getAttribute('runtime')]),
])));
if ($next && $schedule !== $original) {
if ($next) {
// Async task reschedule
$functionEvent = new Func();
$functionEvent
@@ -519,24 +531,10 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
throw new Exception(Exception::BUILD_NOT_READY);
}
$schedule = $function->getAttribute('schedule', '');
$cron = (empty($function->getAttribute('deployment')) && !empty($schedule)) ? new CronExpression($schedule) : null;
$next = (empty($function->getAttribute('deployment')) && !empty($schedule)) ? DateTime::format($cron->getNextRunDate()) : null;
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
'deployment' => $deployment->getId(),
'scheduleNext' => $next,
'deployment' => $deployment->getId()
])));
if ($next) { // Init first schedule
$functionEvent = new Func();
$functionEvent
->setType('schedule')
->setFunction($function)
->setProject($project)
->schedule(new \DateTime($next));
}
$events
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
@@ -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')
@@ -832,6 +836,7 @@ App::get('/v1/functions/:functionId/deployments')
$result->setAttribute('status', $build->getAttribute('status', 'processing'));
$result->setAttribute('buildStderr', $build->getAttribute('stderr', ''));
$result->setAttribute('buildStdout', $build->getAttribute('stdout', ''));
$result->setAttribute('buildTime', $build->getAttribute('duration', 0));
}
$response->dynamic(new Document([
@@ -873,6 +878,11 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId')
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
$build = $dbForProject->getDocument('builds', $deployment->getAttribute('buildId', ''));
$deployment->setAttribute('status', $build->getAttribute('status', 'processing'));
$deployment->setAttribute('buildStderr', $build->getAttribute('stderr', ''));
$deployment->setAttribute('buildStdout', $build->getAttribute('stdout', ''));
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
});
@@ -935,6 +945,67 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
$response->noContent();
});
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
->groups(['api', 'functions'])
->desc('Create Build')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
->label('audits.event', 'deployment.update')
->label('audits.resource', 'function/{request.functionId}')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'functions')
->label('sdk.method', 'createBuild')
->label('sdk.description', '/docs/references/functions/create-build.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('functionId', '', new UID(), 'Function ID.')
->param('deploymentId', '', new UID(), 'Deployment ID.')
->param('buildId', '', new UID(), 'Build unique ID.')
->inject('response')
->inject('dbForProject')
->inject('project')
->inject('events')
->action(function (string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Document $project, Event $events) {
$function = $dbForProject->getDocument('functions', $functionId);
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
if ($function->isEmpty()) {
throw new Exception(Exception::FUNCTION_NOT_FOUND);
}
if ($deployment->isEmpty()) {
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
$build = Authorization::skip(fn () => $dbForProject->getDocument('builds', $buildId));
if ($build->isEmpty()) {
throw new Exception(Exception::BUILD_NOT_FOUND);
}
if ($build->getAttribute('status') !== 'failed') {
throw new Exception(Exception::BUILD_IN_PROGRESS, 'Build not failed');
}
$events
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
// Retry the build
$buildEvent = new Build();
$buildEvent
->setType(BUILD_TYPE_RETRY)
->setResource($function)
->setDeployment($deployment)
->setProject($project)
->trigger();
$response->noContent();
});
App::post('/v1/functions/:functionId/executions')
->groups(['api', 'functions'])
->desc('Create Execution')
@@ -1013,7 +1084,7 @@ App::post('/v1/functions/:functionId/executions')
'functionId' => $function->getId(),
'deploymentId' => $deployment->getId(),
'trigger' => 'http', // http / schedule / event
'status' => 'waiting', // waiting / processing / completed / failed
'status' => $async ? 'waiting' : 'processing', // waiting / processing / completed / failed
'statusCode' => 0,
'response' => '',
'stderr' => '',
@@ -1066,21 +1137,21 @@ App::post('/v1/functions/:functionId/executions')
}
$vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) {
$carry[$var->getAttribute('key')] = $var->getAttribute('value');
$carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? '';
return $carry;
}, []);
$vars = \array_merge($vars, [
'APPWRITE_FUNCTION_ID' => $function->getId(),
'APPWRITE_FUNCTION_NAME' => $function->getAttribute('name', ''),
'APPWRITE_FUNCTION_NAME' => $function->getAttribute('name'),
'APPWRITE_FUNCTION_DEPLOYMENT' => $deployment->getId(),
'APPWRITE_FUNCTION_TRIGGER' => 'http',
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'],
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'],
'APPWRITE_FUNCTION_DATA' => $data,
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
'APPWRITE_FUNCTION_USER_ID' => $user->getId(),
'APPWRITE_FUNCTION_JWT' => $jwt,
'APPWRITE_FUNCTION_TRIGGER' => 'http',
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
'APPWRITE_FUNCTION_DATA' => $data ?? '',
'APPWRITE_FUNCTION_USER_ID' => $user->getId() ?? '',
'APPWRITE_FUNCTION_JWT' => $jwt ?? '',
]);
/** Execute function */
@@ -1150,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')
@@ -1258,65 +1329,6 @@ App::get('/v1/functions/:functionId/executions/:executionId')
$response->dynamic($execution, Response::MODEL_EXECUTION);
});
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
->groups(['api', 'functions'])
->desc('Retry Build')
->label('scope', 'functions.write')
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
->label('audits.event', 'deployment.update')
->label('audits.resource', 'function/{request.functionId}')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'functions')
->label('sdk.method', 'retryBuild')
->label('sdk.description', '/docs/references/functions/retry-build.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('functionId', '', new UID(), 'Function ID.')
->param('deploymentId', '', new UID(), 'Deployment ID.')
->param('buildId', '', new UID(), 'Build unique ID.')
->inject('response')
->inject('dbForProject')
->inject('project')
->inject('events')
->action(function (string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Document $project, Event $events) {
$function = $dbForProject->getDocument('functions', $functionId);
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
if ($function->isEmpty()) {
throw new Exception(Exception::FUNCTION_NOT_FOUND);
}
if ($deployment->isEmpty()) {
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
}
$build = Authorization::skip(fn () => $dbForProject->getDocument('builds', $buildId));
if ($build->isEmpty()) {
throw new Exception(Exception::BUILD_NOT_FOUND);
}
if ($build->getAttribute('status') !== 'failed') {
throw new Exception(Exception::BUILD_IN_PROGRESS, 'Build not failed');
}
$events
->setParam('functionId', $function->getId())
->setParam('deploymentId', $deployment->getId());
// Retry the build
$buildEvent = new Build();
$buildEvent
->setType(BUILD_TYPE_RETRY)
->setResource($function)
->setDeployment($deployment)
->setProject($project)
->trigger();
$response->noContent();
});
// Variables
App::post('/v1/functions/:functionId/variables')
@@ -1332,9 +1344,9 @@ App::post('/v1/functions/:functionId/variables')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_VARIABLE)
->param('functionId', null, new UID(), 'Function unique ID.', false)
->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) {
@@ -1384,7 +1396,7 @@ App::get('/v1/functions/:functionId/variables')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_VARIABLE_LIST)
->param('functionId', null, new UID(), 'Function unique ID.', false)
->param('functionId', '', new UID(), 'Function unique ID.', false)
->inject('response')
->inject('dbForProject')
->action(function (string $functionId, Response $response, Database $dbForProject) {
@@ -1411,8 +1423,8 @@ App::get('/v1/functions/:functionId/variables/:variableId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_VARIABLE)
->param('functionId', null, new UID(), 'Function unique ID.', false)
->param('variableId', null, new UID(), 'Variable unique ID.', false)
->param('functionId', '', new UID(), 'Function unique ID.', false)
->param('variableId', '', new UID(), 'Variable unique ID.', false)
->inject('response')
->inject('dbForProject')
->action(function (string $functionId, string $variableId, Response $response, Database $dbForProject) {
@@ -1447,10 +1459,10 @@ App::put('/v1/functions/:functionId/variables/:variableId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_VARIABLE)
->param('functionId', null, new UID(), 'Function unique ID.', false)
->param('variableId', null, new UID(), 'Variable unique ID.', false)
->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) {
@@ -1499,8 +1511,8 @@ App::delete('/v1/functions/:functionId/variables/:variableId')
->label('sdk.description', '/docs/references/functions/delete-variable.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('functionId', null, new UID(), 'Function unique ID.', false)
->param('variableId', null, new UID(), 'Variable unique ID.', false)
->param('functionId', '', new UID(), 'Function unique ID.', false)
->param('variableId', '', new UID(), 'Variable unique ID.', false)
->inject('response')
->inject('dbForProject')
->action(function (string $functionId, string $variableId, 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 -1
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')
@@ -40,7 +42,6 @@ App::get('/v1/locale')
$output['countryCode'] = $record['country']['iso_code'];
$output['country'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown'));
$output['continent'] = $locale->getText('continents.' . strtolower($record['continent']['code']), $locale->getText('locale.country.unknown'));
$output['continent'] = (isset($continents[$record['continent']['code']])) ? $continents[$record['continent']['code']] : $locale->getText('locale.country.unknown');
$output['continentCode'] = $record['continent']['code'];
$output['eu'] = (\in_array($record['country']['iso_code'], $eu)) ? true : false;
@@ -78,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) {
@@ -109,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) {
@@ -142,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) {
@@ -174,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) {
@@ -204,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');
@@ -225,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');
+195 -60
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;
@@ -55,9 +55,10 @@ 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 "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)
->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true)
->param('logo', '', new Text(1024), 'Project logo.', true)
->param('url', '', new URL(), 'Project URL.', true)
@@ -70,7 +71,7 @@ App::post('/v1/projects')
->inject('response')
->inject('dbForConsole')
->inject('dbForProject')
->action(function (string $projectId, string $name, string $teamId, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForConsole, Database $dbForProject) {
->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForConsole, Database $dbForProject) {
$team = $dbForConsole->getDocument('teams', $teamId);
@@ -79,7 +80,7 @@ App::post('/v1/projects')
}
$auth = Config::getParam('auth', []);
$auths = ['limit' => 0];
$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;
}
@@ -102,6 +103,7 @@ App::post('/v1/projects')
'name' => $name,
'teamInternalId' => $team->getInternalId(),
'teamId' => $team->getId(),
'region' => $region,
'description' => $description,
'logo' => $logo,
'url' => $url,
@@ -125,7 +127,7 @@ App::post('/v1/projects')
$collections = Config::getParam('collections', []);
$dbForProject->setNamespace("_{$project->getInternalId()}");
$dbForProject->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
$dbForProject->create();
$audit = new Audit($dbForProject);
$audit->setup();
@@ -182,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')
@@ -269,8 +271,8 @@ App::get('/v1/projects/:projectId/usage')
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
$periods = [
'24h' => [
'period' => '30m',
'limit' => 48,
'period' => '1h',
'limit' => 24,
],
'7d' => [
'period' => '1d',
@@ -293,9 +295,10 @@ App::get('/v1/projects/:projectId/usage')
'project.$all.network.bandwidth',
'project.$all.storage.size',
'users.$all.count.total',
'collections.$all.count.total',
'databases.$all.count.total',
'documents.$all.count.total',
'executions.$all.compute.total',
'buckets.$all.count.total'
];
$stats = [];
@@ -325,12 +328,12 @@ App::get('/v1/projects/:projectId/usage')
while ($backfill > 0) {
$last = $limit - $backfill - 1; // array index of last added metric
$diff = match ($period) { // convert period to seconds for unix timestamp math
'30m' => 1800,
'1h' => 3600,
'1d' => 86400,
};
$stats[$metric][] = [
'value' => 0,
'date' => DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff),
'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)),
];
$backfill--;
}
@@ -344,9 +347,10 @@ App::get('/v1/projects/:projectId/usage')
'network' => $stats[$metrics[1]] ?? [],
'storage' => $stats[$metrics[2]] ?? [],
'users' => $stats[$metrics[3]] ?? [],
'collections' => $stats[$metrics[4]] ?? [],
'databases' => $stats[$metrics[4]] ?? [],
'documents' => $stats[$metrics[5]] ?? [],
'executions' => $stats[$metrics[6]] ?? [],
'buckets' => $stats[$metrics[7]] ?? [],
]);
}
@@ -442,12 +446,13 @@ App::patch('/v1/projects/:projectId/oauth2')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT)
->param('projectId', '', new UID(), 'Project unique ID.')
->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'Provider Name', false)
->param('appId', '', new Text(256), 'Provider app ID. Max length: 256 chars.', true)
->param('secret', '', new text(512), 'Provider secret key. Max length: 512 chars.', true)
->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'Provider Name')
->param('appId', null, new Text(256), 'Provider app ID. Max length: 256 chars.', true)
->param('secret', null, new text(512), 'Provider secret key. Max length: 512 chars.', true)
->param('enabled', null, new Boolean(), 'Provider status. Set to \'false\' to disable new session creation.', true)
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $provider, string $appId, string $secret, Response $response, Database $dbForConsole) {
->action(function (string $projectId, string $provider, ?string $appId, ?string $secret, ?bool $enabled, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);
@@ -456,8 +461,18 @@ App::patch('/v1/projects/:projectId/oauth2')
}
$providers = $project->getAttribute('authProviders', []);
$providers[$provider . 'Appid'] = $appId;
$providers[$provider . 'Secret'] = $secret;
if ($appId !== null) {
$providers[$provider . 'Appid'] = $appId;
}
if ($secret !== null) {
$providers[$provider . 'Secret'] = $secret;
}
if ($enabled !== null) {
$providers[$provider . 'Enabled'] = $enabled;
}
$project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('authProviders', $providers));
@@ -495,6 +510,37 @@ App::patch('/v1/projects/:projectId/auth/limit')
$response->dynamic($project, Response::MODEL_PROJECT);
});
App::patch('/v1/projects/:projectId/auth/duration')
->desc('Update Project Authentication Duration')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk.auth', [APP_AUTH_TYPE_ADMIN])
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateAuthDuration')
->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('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, int $duration, Response $response, Database $dbForConsole) {
$project = $dbForConsole->getDocument('projects', $projectId);
if ($project->isEmpty()) {
throw new Exception(Exception::PROJECT_NOT_FOUND);
}
$auths = $project->getAttribute('auths', []);
$auths['duration'] = $duration;
$dbForConsole->updateDocument('projects', $project->getId(), $project
->setAttribute('auths', $auths));
$response->dynamic($project, Response::MODEL_PROJECT);
});
App::patch('/v1/projects/:projectId/auth/:method')
->desc('Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.')
->groups(['api', 'projects'])
@@ -529,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'])
@@ -561,10 +700,6 @@ App::delete('/v1/projects/:projectId')
->setDocument($project)
;
if (!$dbForConsole->deleteDocument('teams', $project->getAttribute('teamId', null))) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove project team from DB');
}
if (!$dbForConsole->deleteDocument('projects', $projectId)) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove project from DB');
}
@@ -584,7 +719,7 @@ App::post('/v1/projects/:projectId/webhooks')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_WEBHOOK)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
->param('events', null, new ArrayList(new Event(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
->param('url', null, new URL(['http', 'https']), 'Webhook URL.')
@@ -672,8 +807,8 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_WEBHOOK)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('webhookId', null, new UID(), 'Webhook unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('webhookId', '', new UID(), 'Webhook unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) {
@@ -706,8 +841,8 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_WEBHOOK)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('webhookId', null, new UID(), 'Webhook unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('webhookId', '', new UID(), 'Webhook unique ID.')
->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
->param('events', null, new ArrayList(new Event(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
->param('url', null, new URL(['http', 'https']), 'Webhook URL.')
@@ -760,8 +895,8 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_WEBHOOK)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('webhookId', null, new UID(), 'Webhook unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('webhookId', '', new UID(), 'Webhook unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) {
@@ -798,8 +933,8 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
->label('sdk.method', 'deleteWebhook')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('webhookId', null, new UID(), 'Webhook unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('webhookId', '', new UID(), 'Webhook unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) {
@@ -838,7 +973,7 @@ App::post('/v1/projects/:projectId/keys')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_KEY)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
->param('expire', null, new DatetimeValidator(), 'Expiration time in ISO 8601 format. Use null for unlimited expiration.', true)
@@ -888,7 +1023,7 @@ App::get('/v1/projects/:projectId/keys')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_KEY_LIST)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, Response $response, Database $dbForConsole) {
@@ -920,8 +1055,8 @@ App::get('/v1/projects/:projectId/keys/:keyId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_KEY)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('keyId', null, new UID(), 'Key unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('keyId', '', new UID(), 'Key unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) {
@@ -954,8 +1089,8 @@ App::put('/v1/projects/:projectId/keys/:keyId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_KEY)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('keyId', null, new UID(), 'Key unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('keyId', '', new UID(), 'Key unique ID.')
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
->param('expire', null, new DatetimeValidator(), 'Expiration time in ISO 8601 format. Use null for unlimited expiration.', true)
@@ -1000,8 +1135,8 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
->label('sdk.method', 'deleteKey')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('keyId', null, new UID(), 'Key unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('keyId', '', new UID(), 'Key unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) {
@@ -1040,8 +1175,8 @@ App::post('/v1/projects/:projectId/platforms')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PLATFORM)
->param('projectId', null, 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('projectId', '', new UID(), 'Project unique ID.')
->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)
@@ -1122,8 +1257,8 @@ App::get('/v1/projects/:projectId/platforms/:platformId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PLATFORM)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('platformId', null, new UID(), 'Platform unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('platformId', '', new UID(), 'Platform unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $platformId, Response $response, Database $dbForConsole) {
@@ -1156,8 +1291,8 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PLATFORM)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('platformId', null, new UID(), 'Platform unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('platformId', '', new UID(), 'Platform unique ID.')
->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. Max length: 256 chars.', true)
->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
@@ -1203,8 +1338,8 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
->label('sdk.method', 'deletePlatform')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('platformId', null, new UID(), 'Platform unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('platformId', '', new UID(), 'Platform unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $platformId, Response $response, Database $dbForConsole) {
@@ -1243,7 +1378,7 @@ App::post('/v1/projects/:projectId/domains')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_DOMAIN)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('domain', null, new DomainValidator(), 'Domain name.')
->inject('response')
->inject('dbForConsole')
@@ -1267,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);
@@ -1340,8 +1475,8 @@ App::get('/v1/projects/:projectId/domains/:domainId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_DOMAIN)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('domainId', null, new UID(), 'Domain unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('domainId', '', new UID(), 'Domain unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $domainId, Response $response, Database $dbForConsole) {
@@ -1374,8 +1509,8 @@ App::patch('/v1/projects/:projectId/domains/:domainId/verification')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_DOMAIN)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('domainId', null, new UID(), 'Domain unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('domainId', '', new UID(), 'Domain unique ID.')
->inject('response')
->inject('dbForConsole')
->action(function (string $projectId, string $domainId, Response $response, Database $dbForConsole) {
@@ -1433,8 +1568,8 @@ App::delete('/v1/projects/:projectId/domains/:domainId')
->label('sdk.method', 'deleteDomain')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('domainId', null, new UID(), 'Domain unique ID.')
->param('projectId', '', new UID(), 'Project unique ID.')
->param('domainId', '', new UID(), 'Domain unique ID.')
->inject('response')
->inject('dbForConsole')
->inject('deletes')
+50 -40
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 `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')
@@ -346,10 +346,10 @@ App::post('/v1/storage/buckets/:bucketId/files')
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FILE)
->param('bucketId', null, 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 "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('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 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;
@@ -667,8 +679,8 @@ App::get('/v1/storage/buckets/:bucketId/files')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FILE_LIST)
->param('bucketId', null, 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('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/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')
@@ -744,7 +756,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FILE)
->param('bucketId', null, new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->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 ID.')
->inject('response')
->inject('dbForProject')
@@ -783,6 +795,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
->groups(['api', 'storage'])
->label('scope', 'files.read')
->label('cache', true)
->label('cache.resourceType', 'bucket/{request.bucketId}')
->label('cache.resource', 'file/{request.fileId}')
->label('usage.metric', 'files.{scope}.requests.read')
->label('usage.params', ['bucketId:{request.bucketId}'])
@@ -793,7 +806,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE)
->label('sdk.methodType', 'location')
->param('bucketId', null, new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->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 ID')
->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true)
->param('height', 0, new Range(0, 4000), 'Resize preview image height, Pass an integer between 0 to 4000.', true)
@@ -840,9 +853,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$outputs = Config::getParam('storage-outputs');
$fileLogos = Config::getParam('storage-logos');
$date = \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT'; // 45 days cache
$key = \md5($fileId . $width . $height . $gravity . $quality . $borderWidth . $borderColor . $borderRadius . $opacity . $rotation . $background . $output);
if ($fileSecurity && !$valid) {
$file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId);
} else {
@@ -959,7 +969,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', '*/*')
->label('sdk.methodType', 'location')
->param('bucketId', null, new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->param('fileId', '', new UID(), 'File ID.')
->inject('request')
->inject('response')
@@ -1099,7 +1109,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', '*/*')
->label('sdk.methodType', 'location')
->param('bucketId', null, new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->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 ID.')
->inject('response')
->inject('request')
@@ -1256,9 +1266,9 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FILE)
->param('bucketId', null, new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->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')
@@ -1358,7 +1368,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
->label('sdk.description', '/docs/references/storage/delete-file.md')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('bucketId', null, new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).')
->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 ID.')
->inject('response')
->inject('dbForProject')
@@ -1454,8 +1464,8 @@ App::get('/v1/storage/usage')
if (App::getEnv('_APP_USAGE_STATS', 'enabled') === 'enabled') {
$periods = [
'24h' => [
'period' => '30m',
'limit' => 48,
'period' => '1h',
'limit' => 24,
],
'7d' => [
'period' => '1d',
@@ -1513,12 +1523,12 @@ App::get('/v1/storage/usage')
while ($backfill > 0) {
$last = $limit - $backfill - 1; // array index of last added metric
$diff = match ($period) { // convert period to seconds for unix timestamp math
'30m' => 1800,
'1h' => 3600,
'1d' => 86400,
};
$stats[$metric][] = [
'value' => 0,
'date' => DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff),
'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)),
];
$backfill--;
}
@@ -1571,8 +1581,8 @@ App::get('/v1/storage/:bucketId/usage')
if (App::getEnv('_APP_USAGE_STATS', 'enabled') === 'enabled') {
$periods = [
'24h' => [
'period' => '30m',
'limit' => 48,
'period' => '1h',
'limit' => 24,
],
'7d' => [
'period' => '1d',
@@ -1624,12 +1634,12 @@ App::get('/v1/storage/:bucketId/usage')
while ($backfill > 0) {
$last = $limit - $backfill - 1; // array index of last added metric
$diff = match ($period) { // convert period to seconds for unix timestamp math
'30m' => 1800,
'1h' => 3600,
'1d' => 86400,
};
$stats[$metric][] = [
'value' => 0,
'date' => DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff),
'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)),
];
$backfill--;
}
+189 -53
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 "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')
@@ -553,7 +686,9 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
->label('sdk.description', '/docs/references/teams/get-team-member.md')
->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.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')
@@ -677,9 +812,10 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
->inject('response')
->inject('user')
->inject('dbForProject')
->inject('project')
->inject('geodb')
->inject('events')
->action(function (string $teamId, string $membershipId, string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Reader $geodb, Event $events) {
->action(function (string $teamId, string $membershipId, string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Reader $geodb, Event $events) {
$protocol = $request->getProtocol();
$membership = $dbForProject->getDocument('memberships', $membershipId);
@@ -723,7 +859,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
->setAttribute('confirm', true)
;
$user->setAttribute('emailVerification', true);
$user = Authorization::skip(fn() => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true)));
// Log user in
@@ -731,7 +867,8 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
$detector = new Detector($request->getUserAgent('UNKNOWN'));
$record = $geodb->get($request->getIP());
$expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_LOGIN_LONG);
$authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
$expire = DateTime::addSeconds(new \DateTime(), $authDuration);
$secret = Auth::tokenGenerator();
$session = new Document(array_merge([
'$id' => ID::unique(),
@@ -740,7 +877,6 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
'provider' => Auth::SESSION_PROVIDER_EMAIL,
'providerUid' => $user->getAttribute('email'),
'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak
'expire' => $expire,
'userAgent' => $request->getUserAgent('UNKNOWN'),
'ip' => $request->getIP(),
'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--',
@@ -865,8 +1001,8 @@ App::get('/v1/teams/:teamId/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('teamId', null, 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('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/queries). Only supported methods are limit and offset', true)
->inject('response')
->inject('dbForProject')
->inject('locale')
+84 -52
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 "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 "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 "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 "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 "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 "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,19 +298,20 @@ 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 "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.')
->param('passwordCpu', '', new Integer(), 'Optional CPU cost used to hash password.')
->param('passwordMemory', '', new Integer(), 'Optional memory cost used to hash password.')
->param('passwordParallel', '', new Integer(), 'Optional parallelization cost used to hash password.')
->param('passwordLength', '', new Integer(), 'Optional hash length used to hash password.')
->param('passwordCpu', 8, new Integer(), 'Optional CPU cost used to hash password.')
->param('passwordMemory', 14, new Integer(), 'Optional memory cost used to hash password.')
->param('passwordParallel', 1, new Integer(), 'Optional parallelization cost used to hash password.')
->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 "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);
@@ -888,7 +919,7 @@ App::patch('/v1/users/:userId/phone')
try {
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
} catch (Duplicate $th) {
throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS);
throw new Exception(Exception::USER_PHONE_ALREADY_EXISTS);
}
$events->setParam('userId', $user->getId());
@@ -981,7 +1012,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->param('userId', '', new UID(), 'User ID.')
->param('sessionId', null, new UID(), 'Session ID.')
->param('sessionId', '', new UID(), 'Session ID.')
->inject('response')
->inject('dbForProject')
->inject('events')
@@ -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();
});
@@ -1116,8 +1148,8 @@ App::get('/v1/users/usage')
if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') {
$periods = [
'24h' => [
'period' => '30m',
'limit' => 48,
'period' => '1h',
'limit' => 24,
],
'7d' => [
'period' => '1d',
@@ -1171,12 +1203,12 @@ App::get('/v1/users/usage')
while ($backfill > 0) {
$last = $limit - $backfill - 1; // array index of last added metric
$diff = match ($period) { // convert period to seconds for unix timestamp math
'30m' => 1800,
'1h' => 3600,
'1d' => 86400,
};
$stats[$metric][] = [
'value' => 0,
'date' => DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff),
'date' => DateTime::formatTz(DateTime::addSeconds(new \DateTime($stats[$metric][$last]['date'] ?? null), -1 * $diff)),
];
$backfill--;
}
+14 -48
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;
@@ -223,7 +223,9 @@ App::init()
return $response->redirect('https://' . $request->getHostname() . $request->getURI());
}
}
if ($request->getProtocol() === 'https') {
$response->addHeader('Strict-Transport-Security', 'max-age=' . (60 * 60 * 24 * 126)); // 126 days
}
@@ -231,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')
@@ -382,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')
@@ -394,20 +396,14 @@ App::error()
->inject('utopia')
->inject('request')
->inject('response')
->inject('layout')
->inject('project')
->inject('logger')
->inject('loggerBreadcrumbs')
->action(function (Throwable $error, App $utopia, Request $request, Response $response, View $layout, Document $project, ?Logger $logger, array $loggerBreadcrumbs) {
->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, array $loggerBreadcrumbs) {
$version = App::getEnv('_APP_VERSION', 'UNKNOWN');
$route = $utopia->match($request);
/** Delegate PDO exceptions to the global handler so the database connection can be returned to the pool */
if ($error instanceof PDOException) {
throw $error;
}
if ($logger) {
if ($error->getCode() >= 500 || $error->getCode() === 0) {
try {
@@ -489,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 */
@@ -543,9 +543,10 @@ App::error()
$template = ($route) ? $route->getLabel('error', null) : null;
if ($template) {
$comp = new View($template);
$layout = new View($template);
$comp
$layout
->setParam('title', $project->getAttribute('name') . ' - Error')
->setParam('development', App::isDevelopment())
->setParam('projectName', $project->getAttribute('name'))
->setParam('projectURL', $project->getAttribute('url'))
@@ -554,14 +555,6 @@ App::error()
->setParam('trace', $trace)
;
$layout
->setParam('title', $project->getAttribute('name') . ' - Error')
->setParam('description', 'No Description')
->setParam('body', $comp)
->setParam('version', $version)
->setParam('litespeed', false)
;
$response->html($layout->render());
}
@@ -571,32 +564,6 @@ App::error()
);
});
App::get('/manifest.json')
->desc('Progressive app manifest file')
->label('scope', 'public')
->label('docs', false)
->inject('response')
->action(function (Response $response) {
$response->json([
'name' => APP_NAME,
'short_name' => APP_NAME,
'start_url' => '.',
'url' => 'https://appwrite.io/',
'display' => 'standalone',
'background_color' => '#fff',
'theme_color' => '#f02e65',
'description' => 'End to end backend server for frontend and mobile apps. 👩‍💻👨‍💻',
'icons' => [
[
'src' => 'images/favicon.png',
'sizes' => '256x256',
'type' => 'image/png',
],
],
]);
});
App::get('/robots.txt')
->desc('Robots.txt File')
->label('scope', 'public')
@@ -627,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,
@@ -668,7 +635,6 @@ App::get('/.well-known/acme-challenge')
});
include_once __DIR__ . '/shared/api.php';
include_once __DIR__ . '/shared/web.php';
foreach (Config::getParam('services', []) as $service) {
include_once $service['controller'];
+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')
+132 -14
View File
@@ -5,13 +5,12 @@ 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;
@@ -47,6 +46,47 @@ $parseLabel = function (string $label, array $responsePayload, array $requestPar
return $label;
};
$databaseListener = function (string $event, Document $document, Stats $usage) {
$multiplier = 1;
if ($event === Database::EVENT_DOCUMENT_DELETE) {
$multiplier = -1;
}
$collection = $document->getCollection();
switch ($collection) {
case 'users':
$usage->setParam('users.{scope}.count.total', 1 * $multiplier);
break;
case 'databases':
$usage->setParam('databases.{scope}.count.total', 1 * $multiplier);
break;
case 'buckets':
$usage->setParam('buckets.{scope}.count.total', 1 * $multiplier);
break;
case 'deployments':
$usage->setParam('deployments.{scope}.storage.size', $document->getAttribute('size') * $multiplier);
break;
default:
if (strpos($collection, 'bucket_') === 0) {
$usage
->setParam('bucketId', $document->getAttribute('bucketId'))
->setParam('files.{scope}.storage.size', $document->getAttribute('sizeOriginal') * $multiplier)
->setParam('files.{scope}.count.total', 1 * $multiplier);
} elseif (strpos($collection, 'database_') === 0) {
$usage
->setParam('databaseId', $document->getAttribute('databaseId'));
if (strpos($collection, '_collection_') !== false) {
$usage
->setParam('collectionId', $document->getAttribute('$collectionId'))
->setParam('documents.{scope}.count.total', 1 * $multiplier);
} else {
$usage->setParam('collections.{scope}.count.total', 1 * $multiplier);
}
}
break;
}
};
App::init()
->groups(['api'])
->inject('utopia')
@@ -56,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) {
->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);
@@ -136,10 +175,6 @@ App::init()
->setProject($project)
->setUser($user);
$mails
->setProject($project)
->setUser($user);
$audits
->setMode($mode)
->setUserAgent($request->getUserAgent(''))
@@ -149,6 +184,7 @@ App::init()
->setUser($user);
$usage
->setParam('projectInternalId', $project->getInternalId())
->setParam('projectId', $project->getId())
->setParam('project.{scope}.network.requests', 1)
->setParam('httpMethod', $request->getMethod())
@@ -158,22 +194,59 @@ App::init()
$deletes->setProject($project);
$database->setProject($project);
$dbForProject->on(Database::EVENT_DOCUMENT_CREATE, fn ($event, Document $document) => $databaseListener($event, $document, $usage));
$dbForProject->on(Database::EVENT_DOCUMENT_DELETE, fn ($event, Document $document) => $databaseListener($event, $document, $usage));
$useCache = $route->getLabel('cache', false);
if ($useCache) {
$key = md5($request->getURI() . implode('*', $request->getParams()));
$key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER;
$cache = new Cache(
new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId())
);
$timestamp = 60 * 60 * 24 * 30;
$data = $cache->load($key, $timestamp);
if (!empty($data)) {
$data = json_decode($data, true);
$parts = explode('/', $data['resourceType']);
$type = $parts[0] ?? null;
if ($type === 'bucket') {
$bucketId = $parts[1] ?? null;
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && $mode !== APP_MODE_ADMIN)) {
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
}
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
$validator = new Authorization(Database::PERMISSION_READ);
$valid = $validator->isValid($bucket->getRead());
if (!$fileSecurity && !$valid) {
throw new Exception(Exception::USER_UNAUTHORIZED);
}
$parts = explode('/', $data['resource']);
$fileId = $parts[1] ?? null;
if ($fileSecurity && !$valid) {
$file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId);
} else {
$file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId));
}
if ($file->isEmpty()) {
throw new Exception(Exception::STORAGE_FILE_NOT_FOUND);
}
}
$response
->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $timestamp) . ' GMT')
->addHeader('X-Appwrite-Cache', 'hit')
->setContentType($data['content-type'])
->setContentType($data['contentType'])
->send(base64_decode($data['payload']))
;
@@ -238,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')
@@ -361,7 +473,7 @@ App::shutdown()
*/
$useCache = $route->getLabel('cache', false);
if ($useCache) {
$resource = null;
$resource = $resourceType = null;
$data = $response->getPayload();
if (!empty($data['payload'])) {
@@ -370,9 +482,16 @@ App::shutdown()
$resource = $parseLabel($pattern, $responsePayload, $requestParams, $user);
}
$key = md5($request->getURI() . implode('*', $request->getParams()));
$pattern = $route->getLabel('cache.resourceType', null);
if (!empty($pattern)) {
$resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user);
}
$key = md5($request->getURI() . implode('*', $request->getParams())) . '*' . APP_CACHE_BUSTER;
$data = json_encode([
'content-type' => $response->getContentType(),
'resourceType' => $resourceType,
'resource' => $resource,
'contentType' => $response->getContentType(),
'payload' => base64_encode($data['payload']),
]) ;
@@ -404,7 +523,6 @@ App::shutdown()
if (
App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled'
&& $project->getId()
&& $mode !== APP_MODE_ADMIN // TODO: add check to make sure user is admin
&& !empty($route->getLabel('sdk.namespace', null))
) { // Don't calculate console usage on admin mode
$metric = $route->getLabel('usage.metric', '');
-64
View File
@@ -1,64 +0,0 @@
<?php
use Utopia\App;
use Utopia\Config\Config;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Request;
use Appwrite\Utopia\View;
App::init()
->groups(['web'])
->inject('utopia')
->inject('request')
->inject('response')
->inject('layout')
->action(function (App $utopia, Request $request, Response $response, View $layout) {
/* AJAX check */
if (!empty($request->getQuery('version', ''))) {
$layout->setPath(__DIR__ . '/../../views/layouts/empty.phtml');
}
$port = $request->getPort();
$protocol = $request->getProtocol();
$domain = $request->getHostname();
$layout
->setParam('title', APP_NAME)
->setParam('protocol', $protocol)
->setParam('domain', $domain)
->setParam('endpoint', $protocol . '://' . $domain . ($port != 80 && $port != 443 ? ':' . $port : ''))
->setParam('home', App::getEnv('_APP_HOME'))
->setParam('setup', App::getEnv('_APP_SETUP'))
->setParam('class', 'unknown')
->setParam('icon', '/images/favicon.png')
->setParam('roles', [
['type' => 'owner', 'label' => 'Owner'],
['type' => 'developer', 'label' => 'Developer'],
['type' => 'admin', 'label' => 'Admin'],
])
->setParam('runtimes', Config::getParam('runtimes'))
->setParam('mode', App::getMode())
;
$time = (60 * 60 * 24 * 45); // 45 days cache
$response
->addHeader('Cache-Control', 'public, max-age=' . $time)
->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time) . ' GMT') // 45 days cache
->addHeader('X-Frame-Options', 'SAMEORIGIN') // Avoid console and homepage from showing in iframes
->addHeader('X-XSS-Protection', '1; mode=block; report=/v1/xss?url=' . \urlencode($request->getURI()))
->addHeader('X-UA-Compatible', 'IE=Edge') // Deny IE browsers from going into quirks mode
;
$route = $utopia->match($request);
$route->label('error', __DIR__ . '/../../views/general/error.phtml');
$scope = $route->getLabel('scope', '');
$layout
->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN'))
->setParam('isDev', App::isDevelopment())
->setParam('class', $scope)
;
});
+10 -596
View File
@@ -1,605 +1,19 @@
<?php
use Appwrite\Extend\Exception;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Domains\Domain;
use Utopia\Database\Validator\UID;
use Utopia\Storage\Storage;
App::init()
->groups(['console'])
->inject('layout')
->action(function (View $layout) {
$layout
->setParam('description', 'Appwrite Console allows you to easily manage, monitor, and control your entire backend API and tools.')
->setParam('analytics', 'UA-26264668-5')
;
});
App::shutdown()
->groups(['console'])
->inject('response')
->inject('layout')
->action(function (Response $response, View $layout) {
$header = new View(__DIR__ . '/../../views/console/comps/header.phtml');
$footer = new View(__DIR__ . '/../../views/console/comps/footer.phtml');
$footer
->setParam('home', App::getEnv('_APP_HOME', ''))
->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN'))
;
$layout
->setParam('header', [$header])
->setParam('footer', [$footer])
;
$response->html($layout->render());
});
App::get('/error/:code')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'home')
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
->inject('layout')
->action(function (int $code, View $layout) {
$page = new View(__DIR__ . '/../../views/error.phtml');
$page
->setParam('code', $code)
;
$layout
->setParam('title', APP_NAME . ' - Error')
->setParam('body', $page);
});
App::get('/console')
->groups(['web', 'console'])
->alias('/')
->alias('/invite')
->alias('/login')
->alias('/recover')
->alias('/register')
->groups(['web'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/index.phtml');
$page
->setParam('home', App::getEnv('_APP_HOME', ''))
;
$layout
->setParam('title', APP_NAME . ' - Console')
->setParam('body', $page);
});
App::get('/console/account')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/account/index.phtml');
$cc = new View(__DIR__ . '/../../views/console/forms/credit-card.phtml');
$page
->setParam('cc', $cc)
;
$layout
->setParam('title', 'Account - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/console/notifications')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/v1/console/notifications/index.phtml');
$layout
->setParam('title', APP_NAME . ' - Notifications')
->setParam('body', $page);
});
App::get('/console/home')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/home/index.phtml');
$page
->setParam('usageStatsEnabled', App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled');
$layout
->setParam('title', APP_NAME . ' - Console')
->setParam('body', $page);
});
App::get('/console/settings')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', ''));
$page = new View(__DIR__ . '/../../views/console/settings/index.phtml');
$page->setParam('services', array_filter(Config::getParam('services'), fn($element) => $element['optional']))
->setParam('customDomainsEnabled', ($target->isKnown() && !$target->isTest()))
->setParam('customDomainsTarget', $target->get())
->setParam('smtpEnabled', (!empty(App::getEnv('_APP_SMTP_HOST'))))
;
$layout
->setParam('title', APP_NAME . ' - Settings')
->setParam('body', $page);
});
App::get('/console/webhooks')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/webhooks/index.phtml');
$page->setParam('events', Config::getParam('events', []));
$layout
->setParam('title', APP_NAME . ' - Webhooks')
->setParam('body', $page);
});
App::get('/console/webhooks/webhook')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->param('id', '', new UID(), 'Webhook unique ID.')
->inject('layout')
->action(function (string $id, View $layout) {
$page = new View(__DIR__ . '/../../views/console/webhooks/webhook.phtml');
$page
->setParam('events', Config::getParam('events', []))
->setParam('new', false)
;
$layout
->setParam('title', APP_NAME . ' - Webhooks')
->setParam('body', $page);
});
App::get('/console/webhooks/webhook/new')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/webhooks/webhook.phtml');
$page
->setParam('events', Config::getParam('events', []))
->setParam('new', true)
;
$layout
->setParam('title', APP_NAME . ' - Webhooks')
->setParam('body', $page);
});
App::get('/console/keys')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$scopes = array_keys(Config::getParam('scopes'));
$page = new View(__DIR__ . '/../../views/console/keys/index.phtml');
$page->setParam('scopes', $scopes);
$layout
->setParam('title', APP_NAME . ' - API Keys')
->setParam('body', $page);
});
App::get('/console/databases')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/databases/index.phtml');
$layout
->setParam('title', APP_NAME . ' - Database')
->setParam('body', $page);
});
App::get('/console/databases/database')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->param('id', '', new UID(), 'Database unique ID.')
->label('scope', 'home')
->inject('response')
->inject('layout')
->action(function (string $id, Response $response, View $layout) {
$logs = new View(__DIR__ . '/../../views/console/comps/logs.phtml');
$logs
->setParam('interval', App::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 0))
->setParam('method', 'database.listLogs')
->setParam('params', [
'database-id' => '{{router.params.id}}',
])
;
$page = new View(__DIR__ . '/../../views/console/databases/database.phtml');
$page->setParam('logs', $logs);
$layout
->setParam('title', APP_NAME . ' - Database')
->setParam('body', $page)
;
$response
->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->addHeader('Expires', 0)
->addHeader('Pragma', 'no-cache')
;
});
App::get('/console/databases/collection')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->param('id', '', new UID(), 'Collection unique ID.')
->inject('response')
->inject('layout')
->action(function (string $id, Response $response, View $layout) {
$logs = new View(__DIR__ . '/../../views/console/comps/logs.phtml');
$logs
->setParam('interval', App::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 0))
->setParam('method', 'databases.listCollectionLogs')
->setParam('params', [
'collection-id' => '{{router.params.id}}',
'database-id' => '{{router.params.databaseId}}'
])
;
$permissions = new View(__DIR__ . '/../../views/console/comps/permissions-matrix.phtml');
$permissions
->setParam('method', 'databases.getCollection')
->setParam('events', 'load,databases.updateCollection')
->setParam('form', 'collectionPermissions')
->setParam('data', 'project-collection')
->setParam('params', [
'collection-id' => '{{router.params.id}}',
'database-id' => '{{router.params.databaseId}}'
]);
$page = new View(__DIR__ . '/../../views/console/databases/collection.phtml');
$page
->setParam('permissions', $permissions)
->setParam('logs', $logs)
;
$layout
->setParam('title', APP_NAME . ' - Database Collection')
->setParam('body', $page)
;
$response
->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->addHeader('Expires', 0)
->addHeader('Pragma', 'no-cache')
;
});
App::get('/console/databases/document')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->param('databaseId', '', new UID(), 'Database unique ID.')
->param('collectionId', '', new UID(), 'Collection unique ID.')
->inject('layout')
->action(function (string $databaseId, string $collectionId, View $layout) {
$logs = new View(__DIR__ . '/../../views/console/comps/logs.phtml');
$logs
->setParam('interval', App::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', 0))
->setParam('method', 'databases.listDocumentLogs')
->setParam('params', [
'database-id' => '{{router.params.databaseId}}',
'collection-id' => '{{router.params.collectionId}}',
'document-id' => '{{router.params.id}}',
])
;
$permissions = new View(__DIR__ . '/../../views/console/comps/permissions-matrix.phtml');
$permissions
->setParam('method', 'databases.getDocument')
->setParam('events', 'load,databases.updateDocument')
->setParam('form', 'documentPermissions')
->setParam('data', 'project-document')
->setParam('permissions', [
Database::PERMISSION_READ,
Database::PERMISSION_UPDATE,
Database::PERMISSION_DELETE,
])
->setParam('params', [
'collection-id' => '{{router.params.collectionId}}',
'database-id' => '{{router.params.databaseId}}',
'document-id' => '{{router.params.id}}',
]);
$page = new View(__DIR__ . '/../../views/console/databases/document.phtml');
$page
->setParam('new', false)
->setParam('database', $databaseId)
->setParam('collection', $collectionId)
->setParam('permissions', $permissions)
->setParam('logs', $logs)
;
$layout
->setParam('title', APP_NAME . ' - Database Document')
->setParam('body', $page);
});
App::get('/console/databases/document/new')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->param('databaseId', '', new UID(), 'Database unique ID.')
->param('collectionId', '', new UID(), 'Collection unique ID.')
->inject('layout')
->action(function (string $databaseId, string $collectionId, View $layout) {
$permissions = new View(__DIR__ . '/../../views/console/comps/permissions-matrix.phtml');
$permissions
->setParam('data', 'project-document')
->setParam('form', 'documentPermissions')
->setParam('permissions', [
Database::PERMISSION_READ,
Database::PERMISSION_UPDATE,
Database::PERMISSION_DELETE,
])
->setParam('params', [
'collection-id' => '{{router.params.collectionId}}',
'database-id' => '{{router.params.databaseId}}',
'document-id' => '{{router.params.id}}',
]);
$page = new View(__DIR__ . '/../../views/console/databases/document.phtml');
$page
->setParam('new', true)
->setParam('database', $databaseId)
->setParam('collection', $collectionId)
->setParam('permissions', $permissions)
->setParam('logs', new View())
;
$layout
->setParam('title', APP_NAME . ' - Database Document')
->setParam('body', $page);
});
App::get('/console/storage')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/storage/index.phtml');
$page
->setParam('home', App::getEnv('_APP_HOME', 0))
->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0))
->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0)))
;
$layout
->setParam('title', APP_NAME . ' - Storage')
->setParam('body', $page);
});
App::get('/console/storage/bucket')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->param('id', '', new UID(), 'Bucket unique ID.')
->inject('response')
->inject('layout')
->action(function (string $id, Response $response, View $layout) {
$bucketPermissions = new View(__DIR__ . '/../../views/console/comps/permissions-matrix.phtml');
$bucketPermissions
->setParam('method', 'databases.getBucket')
->setParam('events', 'load,databases.updateBucket')
->setParam('data', 'project-bucket')
->setParam('form', 'bucketPermissions')
->setParam('params', [
'bucket-id' => '{{router.params.id}}',
]);
$fileCreatePermissions = new View(__DIR__ . '/../../views/console/comps/permissions-matrix.phtml');
$fileCreatePermissions
->setParam('form', 'fileCreatePermissions')
->setParam('permissions', [
Database::PERMISSION_READ,
Database::PERMISSION_UPDATE,
Database::PERMISSION_DELETE,
]);
$fileUpdatePermissions = new View(__DIR__ . '/../../views/console/comps/permissions-matrix.phtml');
$fileUpdatePermissions
->setParam('method', 'storage.getFile')
->setParam('data', 'file')
->setParam('form', 'fileUpdatePermissions')
->setParam('permissions', [
Database::PERMISSION_READ,
Database::PERMISSION_UPDATE,
Database::PERMISSION_DELETE,
])
->setParam('params', [
'bucket-id' => '{{router.params.id}}',
]);
$page = new View(__DIR__ . '/../../views/console/storage/bucket.phtml');
$page
->setParam('home', App::getEnv('_APP_HOME', 0))
->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0))
->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0)))
->setParam('bucketPermissions', $bucketPermissions)
->setParam('fileCreatePermissions', $fileCreatePermissions)
->setParam('fileUpdatePermissions', $fileUpdatePermissions)
;
$layout
->setParam('title', APP_NAME . ' - Storage Buckets')
->setParam('body', $page)
;
$response
->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->addHeader('Expires', 0)
->addHeader('Pragma', 'no-cache')
;
});
App::get('/console/users')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/users/index.phtml');
$page
->setParam('auth', Config::getParam('auth'))
->setParam('providers', Config::getParam('providers'))
->setParam('smtpEnabled', (!empty(App::getEnv('_APP_SMTP_HOST'))))
;
$layout
->setParam('title', APP_NAME . ' - Users')
->setParam('body', $page);
});
App::get('/console/users/user')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/users/user.phtml');
$layout
->setParam('title', APP_NAME . ' - User')
->setParam('body', $page);
});
App::get('/console/users/teams/team')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/users/team.phtml');
$layout
->setParam('title', APP_NAME . ' - Team')
->setParam('body', $page);
});
App::get('/console/functions')
->groups(['web', 'console'])
->desc('Platform console project functions')
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/functions/index.phtml');
$page
->setParam('runtimes', Config::getParam('runtimes'))
;
$layout
->setParam('title', APP_NAME . ' - Functions')
->setParam('body', $page);
});
App::get('/console/functions/function')
->groups(['web', 'console'])
->desc('Platform console project function')
->label('permission', 'public')
->label('scope', 'console')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/console/functions/function.phtml');
$page
->setParam('events', Config::getParam('events', []))
->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0))
->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0)))
->setParam('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))
->setParam('usageStatsEnabled', App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled');
;
$layout
->setParam('title', APP_NAME . ' - Function')
->setParam('body', $page);
});
App::get('/console/version')
->groups(['web', 'console'])
->desc('Check for new version')
->label('permission', 'public')
->label('scope', 'console')
->inject('response')
->action(function ($response) {
try {
$version = \json_decode(@\file_get_contents(App::getEnv('_APP_HOME', 'http://localhost') . '/v1/health/version'), true);
if ($version && isset($version['version'])) {
return $response->json(['version' => $version['version']]);
} else {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to check for a newer version');
}
} catch (\Throwable $th) {
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to check for a newer version');
}
->action(function (Response $response) {
$fallback = file_get_contents(__DIR__ . '/../../../console/index.html');
$response->html($fallback);
});
+1 -230
View File
@@ -1,236 +1,8 @@
<?php
use Appwrite\Utopia\View;
use Appwrite\Utopia\Response;
use Utopia\App;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\Document;
App::init()
->groups(['home'])
->inject('layout')
->action(function (View $layout) {
$header = new View(__DIR__ . '/../../views/home/comps/header.phtml');
$footer = new View(__DIR__ . '/../../views/home/comps/footer.phtml');
$footer
->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN'))
;
$layout
->setParam('title', APP_NAME)
->setParam('description', '')
->setParam('class', 'home')
->setParam('platforms', Config::getParam('platforms'))
->setParam('header', [$header])
->setParam('footer', [$footer])
;
});
App::shutdown()
->groups(['home'])
->inject('response')
->inject('layout')
->action(function (Response $response, View $layout) {
$response->html($layout->render());
});
App::get('/')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('response')
->inject('dbForConsole')
->inject('project')
->action(function (Response $response, Database $dbForConsole, Document $project) {
$response
->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->addHeader('Expires', 0)
->addHeader('Pragma', 'no-cache')
;
if ('console' === $project->getId() || $project->isEmpty()) {
$whitelistRoot = App::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled');
if ($whitelistRoot !== 'disabled') {
$count = $dbForConsole->count('users', [], 1);
if ($count !== 0) {
return $response->redirect('/auth/signin');
}
}
}
$response->redirect('/auth/signup');
});
App::get('/auth/signin')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/signin.phtml');
$page
->setParam('root', App::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled'))
;
$layout
->setParam('title', 'Sign In - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/auth/signup')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/signup.phtml');
$page
->setParam('root', App::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled'))
;
$layout
->setParam('title', 'Sign Up - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/auth/recovery')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/recovery.phtml');
$page
->setParam('smtpEnabled', (!empty(App::getEnv('_APP_SMTP_HOST'))))
;
$layout
->setParam('title', 'Password Recovery - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/auth/confirm')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/confirm.phtml');
$layout
->setParam('title', 'Account Confirmation - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/auth/join')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/join.phtml');
$layout
->setParam('title', 'Invitation - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/auth/recovery/reset')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/recovery/reset.phtml');
$layout
->setParam('title', 'Password Reset - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/auth/oauth2/success')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/oauth2.phtml');
$layout
->setParam('title', APP_NAME)
->setParam('body', $page)
->setParam('header', [])
->setParam('footer', [])
;
});
App::get('/auth/magic-url')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/magicURL.phtml');
$layout
->setParam('title', APP_NAME)
->setParam('body', $page)
->setParam('header', [])
->setParam('footer', [])
;
});
App::get('/auth/oauth2/failure')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->inject('layout')
->action(function (View $layout) {
$page = new View(__DIR__ . '/../../views/home/auth/oauth2.phtml');
$layout
->setParam('title', APP_NAME)
->setParam('body', $page)
->setParam('header', [])
->setParam('footer', [])
;
});
App::get('/error/:code')
->groups(['web', 'home'])
->label('permission', 'public')
->label('scope', 'home')
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
->inject('layout')
->action(function (int $code, View $layout) {
$page = new View(__DIR__ . '/../../views/error.phtml');
$page
->setParam('code', $code)
;
$layout
->setParam('title', 'Error' . ' - ' . APP_NAME)
->setParam('body', $page);
});
App::get('/versions')
->desc('Get Version')
@@ -238,7 +10,6 @@ App::get('/versions')
->label('scope', 'public')
->inject('response')
->action(function (Response $response) {
$platforms = Config::getParam('platforms');
$versions = [
@@ -246,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']) {
Binary file not shown.
+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'];
+8 -23
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;
@@ -52,7 +52,7 @@ $http->on('AfterReload', function ($server, $workerId) {
Console::success('Reload completed...');
});
Files::load(__DIR__ . '/../public');
Files::load(__DIR__ . '/../console');
include __DIR__ . '/controllers/general.php';
@@ -91,18 +91,10 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
/** @var array $collections */
$collections = Config::getParam('collections', []);
if (!$dbForConsole->exists(App::getEnv('_APP_DB_SCHEMA', 'appwrite'))) {
$redis->flushAll();
Console::success('[Setup] - Creating database: appwrite...');
$dbForConsole->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
}
try {
Console::success('[Setup] - Creating metadata table: appwrite...');
$dbForConsole->createMetadata();
} catch (\Throwable $th) {
Console::success('[Setup] - Creating database: appwrite...');
$dbForConsole->create();
} catch (\Exception $e) {
Console::success('[Setup] - Skip: metadata table already exists');
}
@@ -303,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);
@@ -324,13 +316,6 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo
Console::error('[Error] File: ' . $th->getFile());
Console::error('[Error] Line: ' . $th->getLine());
/**
* Reset Database connection if PDOException was thrown.
*/
if ($th instanceof PDOException) {
$db = null;
}
$swooleResponse->setStatusCode(500);
$output = ((App::isDevelopment())) ? [
+185 -53
View File
@@ -18,17 +18,9 @@ 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\SMS\Adapter\Mock;
use Appwrite\SMS\Adapter\Telesign;
use Appwrite\SMS\Adapter\TextMagic;
use Appwrite\SMS\Adapter\Twilio;
use Appwrite\SMS\Adapter\Msg91;
use Appwrite\SMS\Adapter\Vonage;
use Appwrite\DSN\DSN;
use Appwrite\Event\Audit;
use Appwrite\Event\Database as EventDatabase;
@@ -36,43 +28,53 @@ 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 Utopia\App;
use Utopia\Database\ID;
use Utopia\Logger\Logger;
use Utopia\Config\Config;
use Utopia\Locale\Locale;
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\App;
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\DatetimeValidator;
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;
use Utopia\Messaging\Adapters\SMS\Telesign;
use Utopia\Messaging\Adapters\SMS\TextMagic;
use Utopia\Messaging\Adapters\SMS\Twilio;
use Utopia\Messaging\Adapters\SMS\Vonage;
use Utopia\Registry\Registry;
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 = 500;
const APP_VERSION_STABLE = '1.0.0';
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';
@@ -188,6 +194,7 @@ Config::load('roles', __DIR__ . '/config/roles.php'); // User roles and scopes
Config::load('scopes', __DIR__ . '/config/scopes.php'); // User roles and scopes
Config::load('services', __DIR__ . '/config/services.php'); // List of services
Config::load('variables', __DIR__ . '/config/variables.php'); // List of env variables
Config::load('regions', __DIR__ . '/config/regions.php'); // List of available regions
Config::load('avatar-browsers', __DIR__ . '/config/avatars/browsers.php');
Config::load('avatar-credit-cards', __DIR__ . '/config/avatars/credit-cards.php');
Config::load('avatar-flags', __DIR__ . '/config/avatars/flags.php');
@@ -278,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->getAttributeLimit()),
]);
$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;
}
);
@@ -599,7 +617,13 @@ $register->set('smtp', function () {
return $mail;
});
$register->set('geodb', function () {
return new Reader(__DIR__ . '/db/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
@@ -628,6 +652,9 @@ $register->set('cache', function () {
return $redis;
});
$register->set('promiseAdapter', function () {
return new Swoole();
});
/*
* Localization
@@ -729,13 +756,6 @@ App::setResource('loggerBreadcrumbs', function () {
App::setResource('register', fn() => $register);
App::setResource('layout', function ($locale) {
$layout = new View(__DIR__ . '/views/layouts/default.phtml');
$layout->setParam('locale', $locale);
return $layout;
}, ['locale']);
App::setResource('locale', fn() => new Locale(App::getEnv('_APP_LOCALE', 'en')));
// Queues
@@ -753,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);
@@ -765,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']))
)
);
@@ -776,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']))
)
)
)
@@ -796,9 +816,11 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons
Authorization::setDefaultStatus(true);
Auth::setCookieName('a_session_' . $project->getId());
$authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
if (APP_MODE_ADMIN === $mode) {
Auth::setCookieName('a_session_' . $console->getId());
$authDuration = Auth::TOKEN_EXPIRATION_LOGIN_LONG;
}
$session = Auth::decodeSession(
@@ -837,7 +859,7 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons
if (
$user->isEmpty() // Check a document has been found in the DB
|| !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret)
|| !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret, $authDuration)
) { // Validate user has valid login token
$user = new Document(['$id' => ID::custom(''), '$collection' => 'users']);
}
@@ -907,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
],
@@ -919,6 +941,7 @@ App::setResource('console', function () {
'legalTaxId' => '',
'auths' => [
'limit' => (App::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user
'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds
],
'authWhitelistEmails' => (!empty(App::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', App::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [],
'authWhitelistIPs' => (!empty(App::getEnv('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', App::getEnv('_APP_CONSOLE_WHITELIST_IPS', null)) : [],
@@ -964,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);
@@ -1022,13 +1045,18 @@ 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();
$secret = $dsn->getPassword();
return match ($dsn->getHost()) {
'mock' => new Mock('', ''), // used for tests
'mock' => new Mock($user, $secret), // used for tests
'twilio' => new Twilio($user, $secret),
'text-magic' => new TextMagic($user, $secret),
'telesign' => new Telesign($user, $secret),
@@ -1044,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']);
+1
View File
@@ -35,6 +35,7 @@ foreach (
realpath(__DIR__ . '/../vendor/symfony'),
realpath(__DIR__ . '/../vendor/mongodb'),
realpath(__DIR__ . '/../vendor/utopia-php/websocket'), // TODO: remove workerman autoload
realpath(__DIR__ . '/../vendor/utopia-php/cache'), // TODO: remove memcache autoload
] as $key => $value
) {
if ($value !== false) {
+10 -12
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
]
];
@@ -306,7 +306,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
if ($realtime->hasSubscriber($projectId, 'user:' . $userId)) {
$connection = array_key_first(reset($realtime->subscriptions[$projectId]['user:' . $userId]));
[$consoleDatabase, $returnConsoleDatabase] = getDatabase($register, '_console');
$project = Authorization::skip(fn() => $consoleDatabase->getDocument('projects', $projectId));
$project = Authorization::skip(fn () => $consoleDatabase->getDocument('projects', $projectId));
[$database, $returnDatabase] = getDatabase($register, "_{$project->getInternalId()}");
$user = $database->getDocument('users', $userId);
@@ -484,6 +484,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server,
$server->onMessage(function (int $connection, string $message) use ($server, $register, $realtime, $containerId) {
try {
$app = new App('UTC');
$response = new Response(new SwooleResponse());
$db = $register->get('dbPool')->get();
$redis = $register->get('redisPool')->get();
@@ -493,12 +494,8 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
$database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
$database->setNamespace("_console");
$projectId = $realtime->connections[$connection]['projectId'];
if ($projectId !== 'console') {
$project = Authorization::skip(fn() => $database->getDocument('projects', $projectId));
$database->setNamespace("_{$project->getInternalId()}");
}
$project = $projectId === 'console' ? $app->getResource('console') : Authorization::skip(fn () => $database->getDocument('projects', $projectId));
$database->setNamespace("_{$project->getInternalId()}");
/*
* Abuse Check
*
@@ -536,10 +533,11 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
Auth::$secret = $session['secret'] ?? '';
$user = $database->getDocument('users', Auth::$unique);
$authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG;
if (
empty($user->getId()) // Check a document has been found in the DB
|| !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret) // Validate user has valid login token
|| !Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret, $authDuration) // Validate user has valid login token
) {
// cookie not valid
throw new Exception('Session is not valid.', 1003);
+6 -8
View File
@@ -78,12 +78,11 @@ $cli
->trigger();
}
function notifyDeleteUsageStats(int $interval30m, int $interval1d)
function notifyDeleteUsageStats(int $usageStatsRetentionHourly)
{
(new Delete())
->setType(DELETE_TYPE_USAGE)
->setDateTime1d(DateTime::addSeconds(new \DateTime(), -1 * $interval1d))
->setDateTime30m(DateTime::addSeconds(new \DateTime(), -1 * $interval30m))
->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly))
->trigger();
}
@@ -99,7 +98,6 @@ $cli
{
(new Delete())
->setType(DELETE_TYPE_SESSIONS)
->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * Auth::TOKEN_EXPIRATION_LOGIN_LONG))
->trigger();
}
@@ -144,11 +142,11 @@ $cli
$executionLogsRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_EXECUTION', '1209600');
$auditLogRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_AUDIT', '1209600');
$abuseLogsRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', '86400');
$usageStatsRetention30m = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_USAGE_30M', '129600'); //36 hours
$usageStatsRetention1d = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_USAGE_1D', '8640000'); // 100 days
$usageStatsRetentionHourly = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_USAGE_HOURLY', '8640000'); //100 days
$cacheRetention = (int) App::getEnv('_APP_MAINTENANCE_RETENTION_CACHE', '2592000'); // 30 days
Console::loop(function () use ($interval, $executionLogsRetention, $abuseLogsRetention, $auditLogRetention, $usageStatsRetention30m, $usageStatsRetention1d, $cacheRetention) {
Console::loop(function () use ($interval, $executionLogsRetention, $abuseLogsRetention, $auditLogRetention, $usageStatsRetentionHourly, $cacheRetention) {
$database = getConsoleDB();
$time = DateTime::now();
@@ -157,7 +155,7 @@ $cli
notifyDeleteExecutionLogs($executionLogsRetention);
notifyDeleteAbuseLogs($abuseLogsRetention);
notifyDeleteAuditLogs($auditLogRetention);
notifyDeleteUsageStats($usageStatsRetention30m, $usageStatsRetention1d);
notifyDeleteUsageStats($usageStatsRetentionHourly);
notifyDeleteConnections();
notifyDeleteExpiredSessions();
renewCertificates($database);
+17 -3
View File
@@ -9,10 +9,20 @@ use Utopia\Cache\Cache;
use Utopia\Cache\Adapter\Redis as RedisCache;
use Utopia\Database\Adapter\MariaDB;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
use Utopia\Validator\Text;
function clearProjectsCache(Redis $redis, Document $project)
{
try {
$redis->del($redis->keys("cache-_{$project->getInternalId()}:*"));
} catch (\Throwable $th) {
Console::error('Failed to clear project ("' . $project->getId() . '") cache with error: ' . $th->getMessage());
}
}
$cli
->task('migrate')
->param('version', APP_VERSION_STABLE, new Text(32), 'Version to migrate to.', true)
@@ -30,7 +40,7 @@ $cli
$db = $register->get('db', true);
$redis = $register->get('cache', true);
$redis->flushAll();
$cache = new Cache(new RedisCache($redis));
$projectDB = new Database(new MariaDB($db), $cache);
@@ -70,14 +80,19 @@ $cli
continue;
}
clearProjectsCache($redis, $project);
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);
}
$sum = \count($projects);
@@ -90,6 +105,5 @@ $cli
}
Swoole\Event::wait(); // Wait for Coroutines to finish
$redis->flushAll();
Console::success('Data Migration Completed');
});
+37 -20
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', '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;
}
@@ -72,15 +79,20 @@ Redistribution and use in source and binary forms, with or without modification,
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.';
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...");
+16 -54
View File
@@ -2,10 +2,6 @@
global $cli, $register;
use Appwrite\Stats\Usage;
use Appwrite\Stats\UsageDB;
use Appwrite\Usage\Calculators\Aggregator;
use Appwrite\Usage\Calculators\Database;
use Appwrite\Usage\Calculators\TimeSeries;
use InfluxDB\Database as InfluxDatabase;
use Utopia\App;
@@ -114,63 +110,29 @@ $logError = function (Throwable $error, string $action = 'syncUsageStats') use (
Console::warning($error->getTraceAsString());
};
function aggregateTimeseries(UtopiaDatabase $database, InfluxDatabase $influxDB, callable $logError): void
{
$interval = (int) App::getEnv('_APP_USAGE_TIMESERIES_INTERVAL', '30'); // 30 seconds (by default)
$usage = new TimeSeries($database, $influxDB, $logError);
Console::loop(function () use ($interval, $usage) {
$now = date('d-m-Y H:i:s', time());
Console::info("[{$now}] Aggregating Timeseries Usage data every {$interval} seconds");
$loopStart = microtime(true);
$usage->collect();
$loopTook = microtime(true) - $loopStart;
$now = date('d-m-Y H:i:s', time());
Console::info("[{$now}] Aggregation took {$loopTook} seconds");
}, $interval);
}
function aggregateDatabase(UtopiaDatabase $database, callable $logError): void
{
$interval = (int) App::getEnv('_APP_USAGE_DATABASE_INTERVAL', '900'); // 15 minutes (by default)
$usage = new Database($database, $logError);
$aggregrator = new Aggregator($database, $logError);
Console::loop(function () use ($interval, $usage, $aggregrator) {
$now = date('d-m-Y H:i:s', time());
Console::info("[{$now}] Aggregating database usage every {$interval} seconds.");
$loopStart = microtime(true);
$usage->collect();
$aggregrator->collect();
$loopTook = microtime(true) - $loopStart;
$now = date('d-m-Y H:i:s', time());
Console::info("[{$now}] Aggregation took {$loopTook} seconds");
}, $interval);
}
$cli
->task('usage')
->param('type', 'timeseries', new WhiteList(['timeseries', 'database']))
->desc('Schedules syncing data from influxdb to Appwrite console db')
->action(function (string $type) use ($register, $logError) {
->action(function () use ($register, $logError) {
Console::title('Usage Aggregation V1');
Console::success(APP_NAME . ' usage aggregation process v1 has started');
$database = getDatabase($register, '_console');
$influxDB = getInfluxDB($register);
switch ($type) {
case 'timeseries':
aggregateTimeseries($database, $influxDB, $logError);
break;
case 'database':
aggregateDatabase($database, $logError);
break;
default:
Console::error("Unsupported usage aggregation type");
}
$interval = (int) App::getEnv('_APP_USAGE_AGGREGATION_INTERVAL', '30'); // 30 seconds (by default)
$region = App::getEnv('region', 'default');
$usage = new TimeSeries($region, $database, $influxDB, $logError);
Console::loop(function () use ($interval, $usage) {
$now = date('d-m-Y H:i:s', time());
Console::info("[{$now}] Aggregating Timeseries Usage data every {$interval} seconds");
$loopStart = microtime(true);
$usage->collect();
$loopTook = microtime(true) - $loopStart;
$now = date('d-m-Y H:i:s', time());
Console::info("[{$now}] Aggregation took {$loopTook} seconds");
}, $interval);
});
-369
View File
@@ -1,369 +0,0 @@
<div class="cover">
<h1 class="zone xl margin-bottom-large">
<a data-ls-attrs="href=/console" class="back text-size-small link-return-animation--start"><i class="icon-left-open"></i> Home</a>
<br />
<span>Your Account</span>
</h1>
</div>
<div class="zone xl">
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
<li data-state="/console/account">
<h2 class="margin-bottom">Overview</h2>
<div
data-service="account.get"
data-scope="console"
data-name="account"
data-event="load"
data-failure="trigger"
data-failure-param-trigger-events="account.deleteSession">
<div class="row responsive force-reverse">
<div class="col span-3 text-align-center margin-bottom">
<img src="" data-ls-attrs="src={{account|avatar}}" data-size="200" height="150" alt="User Avatar" class="avatar huge huge margin-bottom-small" />
</div>
<div class="col span-9">
<div class="box margin-bottom-xl">
<div>
<form name="account.update"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Update Account Name"
data-service="account.updateName"
data-scope="console"
data-event="submit"
data-success="trigger,alert"
data-success-param-alert-text="Your name was updated successfully"
data-success-param-trigger-events="account.update"
data-failure="alert"
data-failure-param-alert-text="Failed to update your name"
data-failure-param-alert-classname="error">
<label for="name">Name</label>
<div class="row responsive">
<div class="col span-8 margin-bottom-small">
<input name="name" id="name" type="text" autocomplete="off" data-ls-bind="{{account.name}}" required class="margin-bottom-no" maxlength="128">
</div>
<div class="col span-4">
<button type="submit" class="fill margin-bottom-no">Update Name</button>
</div>
</div>
</form>
</div>
<hr />
<form name="update-email"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Update Account Email"
data-service="account.updateEmail"
data-scope="console"
data-event="submit"
data-success="trigger,alert"
data-success-param-alert-text="Email address updated successfully"
data-success-param-trigger-events="account-update,modal-close"
data-failure="alert"
data-failure-param-alert-text="Failed updating email address"
data-failure-param-alert-classname="error">
<label>Email</label>
<div class="row responsive">
<div class="col span-8 margin-bottom-small">
<input name="email" type="email" class="margin-bottom-no" autocomplete="off" placeholder="me@example.com" data-ls-bind="{{account.email}}" required>
</div>
<div class="col span-4">
<div data-ui-modal class="modal box close width-small height-small" data-button-text="Update Email" data-button-class="fill">
<h3>Confirm Password</h3>
<hr />
<label>Password</label>
<input name="password" type="password" class="full-width" autocomplete="off" placeholder="" required>
<hr />
<button type="submit" class="margin-bottom-no">Update</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</div>
</div>
</div>
</form>
<hr />
<div data-ui-modal class="modal box close width-small" data-button-text="Update Password" data-button-class="">
<h1>Update Password</h1>
<form name="update-password"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Update Account Password"
data-service="account.updatePassword"
data-scope="console"
data-event="submit"
data-success="trigger,alert,reset"
data-success-param-trigger-events="account-update"
data-success-param-alert-text="Password updated successfully"
data-failure="alert"
data-failure-param-alert-text="Failed updating password"
data-failure-param-alert-classname="error">
<label>Current Password</label>
<input name="oldPassword" type="password" class="full-width" autocomplete="off" placeholder="" required>
<label>New Password</label>
<input name="password" type="password" class="full-width" autocomplete="off" placeholder="" required data-forms-password-meter>
<hr />
<footer>
<button type="submit">Update Password</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</footer>
</form>
</div>
<hr />
<form class="margin-top"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Account Current Session"
data-service="account.deleteSession"
data-scope="console"
data-event="submit"
data-success="trigger"
data-success-param-trigger-events="account.deleteSession"
data-failure="alert"
data-failure-param-alert-text="Logout failed"
data-failure-param-alert-classname="error">
<input type="hidden" name="sessionId" value="current">
<button class="fill danger icon fill"><i class="icon-login"></i> Logout</button>
</form>
</div>
</div>
</div>
<div class="row responsive">
<div class="col span-9">
<h3 class="text-danger">Danger Zone</h3>
<div class="box danger">
<p>This is the area where you can delete your account.</p>
<p>By deleting your account you will lose access to any of your teams and shared data.</p>
<p>PLEASE NOTE: Account deletion is irreversible.</p>
<form class="inline"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Account"
data-service="account.delete"
data-scope="console"
data-event="submit"
data-confirm="Are you sure you want to delete your account?"
data-success="trigger"
data-success-param-trigger-events="account.delete"
data-failure="alert"
data-failure-param-alert-text="Account deactivation failed"
data-failure-param-alert-classname="error">
<button class="danger reverse">Delete Account</button>
</form>
</div>
</div>
<div class="col span-3"></div>
</div>
</div>
</li>
<li data-state="/console/account/sessions">
<h2>Sessions</h2>
<div class="box margin-bottom"
data-service="account.listSessions"
data-scope="console"
data-name="sessions"
data-event="load,account.deleteRemoteSession">
<ul data-ls-loop="sessions.sessions" data-ls-as="session" class="list">
<li class="clear">
<span data-ls-if="true != {{session.current}}">
<!-- From remote session (-logout event) -->
<form class="pull-end"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Account Session"
data-service="account.deleteSession"
data-scope="console"
data-event="submit"
data-loading="Loading..."
data-success="trigger"
data-success-param-trigger-events="account.deleteRemoteSession"
data-failure="alert"
data-failure-param-alert-text="Logout from Session Failed"
data-failure-param-alert-classname="error">
<input type="hidden" name="sessionId" data-ls-bind="{{session.$id}}">
<button class="danger">Logout</button>
</form>
</span>
<span data-ls-if="true == {{session.current}}">
<!-- From current session (+logout event) -->
<form class="pull-end"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Account Current Session"
data-service="account.deleteSession"
data-scope="console"
data-event="submit"
data-loading="Loading..."
data-success="trigger,redirect"
data-success-param-trigger-events="account.deleteSession"
data-success-param-redirect-url="/"
data-failure="alert"
data-failure-param-alert-text="Logout from Session Failed"
data-failure-param-alert-classname="error">
<input type="hidden" name="sessionId" data-ls-bind="{{session.$id}}">
<button class="danger">Logout</button>
</form>
</span>
<div class="pull-start margin-end avatar-container">
<img onerror="this.onerror=null;this.className='avatar hide'" data-ls-attrs="src={{env.API}}/avatars/browsers/{{session.clientCode|lowercase}}?width=120&height=120&project={{env.PROJECT}},title={{session.clientName}},alt={{session.clientName}}" class="avatar" loading="lazy" width="60" height="60" data-ls-if="{{session.clientCode|lowercase}} !== 'cli'"/>
<img onerror="this.onerror=null;this.className='avatar hide'" data-ls-attrs="src=/images/clients/terminal.png?buster=<?php echo APP_CACHE_BUSTER; ?>,title={{session.clientName}},alt={{session.clientName}}" class="avatar" loading="lazy" width="60" height="60" data-ls-if="{{session.clientCode|lowercase}} === 'cli'" >
<div data-ls-if="{{session.provider}} !== 'email'" class="corner">
<img data-ls-attrs="src=/images/users/{{session.provider}}.png?buster=<?php echo APP_CACHE_BUSTER; ?>,title={{session.provider}},alt={{session.provider}}" class="avatar xs" loading="lazy" width="30" height="30" />
</div>
</div>
<span data-ls-if="(!{{log.clientName}})">Unknown</span>
<span data-ls-if="({{log.clientName}})" data-ls-bind="{{session.clientName}}"></span> <span data-ls-bind="{{session.clientVersion}}"></span> on <span data-ls-bind="{{session.deviceModel}}"></span> <span data-ls-bind="{{session.osName}}"></span> <span data-ls-bind="{{session.osVersion}}"></span>
&nbsp;
<span data-ls-if="true == {{session.current}}">
<span class="tag green">Current Session</span>
</span>
<div class="margin-top-small">
<img onerror="this.onerror=null;this.className='avatar hide'" data-ls-if="{{session.countryCode}} !== '--'" data-ls-attrs="src={{env.API}}/avatars/flags/{{session.countryCode}}?width=80&height=80&project={{env.PROJECT}}" class="avatar xxs margin-end-small inline" />
<small data-ls-bind="{{session.ip}}"></small> / <small data-ls-bind="{{session.countryName}}"></small>
</div>
</li>
</ul>
</div>
<form class="inline margin-bottom-large"
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Account Sessions"
data-service="account.deleteSessions"
data-scope="console"
data-event="submit"
data-success="trigger,redirect"
data-success-param-trigger-events="account.deleteSession"
data-success-param-redirect-url="/"
data-failure="alert"
data-failure-param-alert-text="Logout from All Sessions Failed"
data-failure-param-alert-classname="error">
<input type="hidden" name="id" value="0">
<button class="danger">Logout from all sessions</button>
</form>
</li>
<li data-state="/console/account/activity">
<h2>Activity</h2>
<div
data-service="account.listLogs"
data-scope="console"
data-param-queries="limit(<?php echo APP_PAGING_LIMIT; ?>),offset({{router.params.offset|orZero}})"
data-param-queries-cast-to="array"
data-param-queries-cast-from="csv"
data-name="securityLogs"
data-event="load">
<div class="box margin-bottom">
<table class="vertical small">
<thead>
<tr>
<th width="120">Date</th>
<th width="175">Event</th>
<th>Client</th>
<th width="110">Location</th>
<th width="90">IP</th>
</tr>
</thead>
<tbody data-ls-loop="securityLogs.logs" data-ls-as="log">
<tr>
<td data-title="Date: "><span data-ls-bind="{{log.time|dateTime}}"></span></td>
<td data-title="Event: "><span data-ls-bind="{{log.event}}"></span></td>
<td data-title="Client: ">
<img onerror="this.onerror=null;this.className='avatar hide'" data-ls-attrs="src={{env.API}}/avatars/browsers/{{log.clientCode|lowercase}}?width=80&height=80&project={{env.PROJECT}},title={{log.clientName}},alt={{log.clientName}}" class="avatar xxs inline margin-end-small" data-ls-if="{{log.clientCode|lowercase}} !== 'cli'"/>
<img onerror="this.onerror=null;this.className='avatar hide'" data-ls-attrs="src=/images/clients/terminal.png?buster=<?php echo APP_CACHE_BUSTER; ?>,title={{log.clientName}},alt={{log.clientName}}" class="avatar xxs inline margin-end-small" data-ls-if="{{log.clientCode|lowercase}} === 'cli'" />
<span data-ls-if="(!{{log.clientName}})">Unknown</span>
<span data-ls-if="({{log.clientName}})" data-ls-bind="{{log.clientName}} {{log.clientVersion}} on {{log.model}} {{log.osName}} {{log.osVersion}}"></span>
</td>
<td data-title="Location: ">
<img onerror="this.onerror=null;this.className='avatar xxs hide'" data-ls-attrs="src={{env.API}}/avatars/flags/{{log.countryCode}}?width=80&height=80&project={{env.PROJECT}}" class="avatar xxs inline margin-end-small" />
<span data-ls-bind="{{log.countryName}}"></span>
</td>
<td data-title="IP: "><span data-ls-bind="{{log.ip}}"></span></td>
</tr>
</tbody>
</table>
</div>
<div class="pull-end text-align-center paging">
<form
data-service="account.listLogs"
data-event="submit"
data-scope="console"
data-name="securityLogs"
data-success="state"
data-success-param-state-keys="offset">
<input type="hidden" name="offset">
<button name="queries" data-cast-to="array" data-cast-from="csv" data-paging-back data-offset="{{router.params.offset}}" data-total="{{securityLogs.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
</form>
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{securityLogs.total|pageTotal}}"></span>
<form
data-service="account.listLogs"
data-event="submit"
data-scope="console"
data-name="securityLogs"
data-success="state"
data-success-param-state-keys="offset">
<input type="hidden" name="offset">
<button name="queries" data-cast-to="array" data-cast-from="csv" data-paging-next data-offset="{{router.params.offset}}" data-total="{{securityLogs.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
</div>
</li>
</ul>
</div>
-43
View File
@@ -1,43 +0,0 @@
<?php
$home = $this->getParam('home', '');
$version = $this->getParam('version', '') . '.' . APP_CACHE_BUSTER;
?>
<footer class="clear margin-top-large">
<ul class="copyright pull-start">
<li>
<a class="link-animation-enabled"
data-analytics
data-analytics-event="click"
data-analytics-category="console/footer"
data-analytics-label="GitHub Link"
href="https://github.com/appwrite/appwrite" target="_blank" rel="noopener"><i class="icon-github"></i> GitHub</a>
</li>
<li>
<a class="link-animation-enabled"
data-analytics
data-analytics-event="click"
data-analytics-category="console/footer"
data-analytics-label="Discord Link"
href="https://appwrite.io/discord" target="_blank" rel="noopener"><i class="icon-discord"></i> Discord</a>
</li>
<li>
<a class="link-animation-enabled"
data-analytics
data-analytics-event="click"
data-analytics-category="console/footer"
data-analytics-label="New GitHub Issue"
href="https://github.com/appwrite/appwrite/issues/new?assignees=&labels=bug&template=bug.yaml&title=[<?php echo $version; ?>]%20%F0%9F%90%9B+Bug+Report%3A+" target="_blank" rel="noopener">Open an Issue</a>
</li>
<li>
<a class="link-animation-enabled"
data-analytics
data-analytics-event="click"
data-analytics-category="console/footer"
data-analytics-label="Docs Link"
href="<?php echo $home; ?>/docs" target="_blank" rel="noopener">Docs</a>
</li>
<li>
v:<?php echo $version; ?>
</li>
</ul>
</footer>
-259
View File
@@ -1,259 +0,0 @@
<header class="clear" data-version>
<a href="/console" class="logo pull-start">
<img src="/images/appwrite.svg" alt="Appwrite Light Logo" class="force-light" loading="lazy" />
<img src="/images/appwrite-footer-dark.svg" alt="Appwrite Dark Logo" class="force-dark" loading="lazy" />
</a>
<div class="change-project pull-start desktops-only">
<div class="list project-only margin-end-small">
<label class="margin-bottom-no">
<select class="margin-bottom-no"
data-xanalytics-event="change"
data-xanalytics-category="console/header"
data-xanalytics-label="Project Switch"
data-switch
data-ls-bind="{{router.params.project}}"
data-unsync="1"
data-ls-loop="projects.projects" data-ls-as="option" aria-label="Switch Project">
<option data-ls-attrs="value={{option.$id}}" data-ls-bind="{{option.name}}"></option>
</select>
</label>
</div>
<button style="overflow: visible;" class="project-only setup-new tooltip round down pull-end" aria-label="Quick Start" data-tooltip="Create a new project"><i class="icon-plus"></i></button>
</div>
<div class="account-box pull-end"
data-service="account.get"
data-name="account"
data-scope="console"
data-event="load"
data-success="trigger"
data-success-param-trigger-events="account.get"
data-failure="trigger"
data-failure-param-trigger-events="account.deleteSession">
<div class="console-back">
<a href="/console" class="link-return-animation--end">Back to Console &nbsp;<i class="icon-right-open"></i></a>
</div>
<div class="account link pull-end clear">
<img src="" data-ls-attrs="src={{account|avatar}}" alt="User Avatar" class="avatar margin-start pull-end" />
<span class="name pull-end desktops-only" data-ls-bind="{{account.name}}"></span>
</div>
<div class="console-index drop-list bottom end" data-ls-ui-open="" data-button-text="" data-button-aria="Account Options" data-button-icon="" data-button-selector="[data-toggler]" data-button-class="account-button" data-blur="1">
<ul class="margin-top-large arrow-end">
<li>
<a href="/console/account"><i class="icon-user"></i> &nbsp; Your Account</a>
</li>
<li>
<span class="link"><i class="icon-sun-inv force-dark pull-start"></i><i class="icon-moon-inv force-light pull-start"></i> &nbsp; Change Theme
<div class="pull-end switch-theme">
<button data-general-theme
data-analytics
data-analytics-event="click"
data-analytics-category="console/header"
data-analytics-label="Switch Theme">
<i class="icon-sun-inv force-light"></i>
<i class="icon-moon-inv force-dark"></i>
</button>
</div>
</span>
</li>
</ul>
</div>
</div>
<nav class="project-only" data-ls-ui-open="" data-button-class="round icon-btn phones-only tablets-only" data-button-aria="Navigation" data-button-icon="icon-dot-3">
<a class="logo" href="/console"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Logo Link">
<img src="/images/appwrite-nav.svg" loading="lazy" alt="Appwrite Logo" class="nav" />
<img src="/images/appwrite.svg" loading="lazy" alt="Appwrite Light Logo" class="top force-light" loading="lazy" />
<img src="/images/appwrite-footer-dark.svg" loading="lazy" alt="Appwrite Dark Logo" class="top force-dark" loading="lazy" />
</a>
<div data-ui-highlight class="container">
<ul class="links">
<li>
<a data-ls-attrs="href=/console/home?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Home Link">
<i class="icon-home"></i>
Home
</a>
</li>
</ul>
<b class="subtitle">DEVELOP</b>
<ul class="links">
<li>
<a data-ls-attrs="href=/console/databases?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Database Link">
<i class="icon-database"></i>
Database
</a>
</li>
<li>
<a data-ls-attrs="href=/console/storage?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Storage Link">
<i class="icon-folder"></i>
Storage
</a>
</li>
<li>
<a data-ls-attrs="href=/console/users?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Users Link">
<i class="icon-users"></i>
Authentication
</a>
</li>
<li>
<a data-ls-attrs="href=/console/functions?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Functions Link"
class="link-animation-disabled">
<i class="icon-lightning"></i>
Functions
</a>
</li>
</ul>
<b class="subtitle">MANAGE</b>
<ul class="links">
<li>
<a data-ls-attrs="href=/console/webhooks?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Webhooks Links">
<i class="icon-link"></i>
Webhooks
</a>
</li>
<li>
<a data-ls-attrs="href=/console/keys?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="API Keys Link">
<i class="icon-key-inv"></i>
API Keys
</a>
</li>
</ul>
</div>
<ul class="links bottom">
<li>
<a data-ls-attrs="href=/console/settings?project={{router.params.project}}"
data-analytics
data-analytics-event="click"
data-analytics-category="console/navigation"
data-analytics-label="Settings Link">
<i class="icon-cog"></i> Settings</a>
</li>
</ul>
</nav>
</header>
<div class=""
data-service="projects.list"
data-event="load,projects.update"
data-name="projects"
data-scope="console"></div>
<div class="load-screen" data-ls-ui-loader>
<div class="animation"><div></div><div></div><div></div><div></div></div>
<img src="/images/appwrite.svg" alt="Appwrite Light Logo" class="force-light" loading="lazy" />
<img src="/images/appwrite-footer-dark.svg" alt="Appwrite Dark Logo" class="force-dark" loading="lazy" />
</div>
<div data-ui-modal class="modal box close sticky-footer" data-button-alias=".setup-new" data-button-icon="icon-plus" data-button-class="project-only" data-open-event="create-project">
<h1>Create Project</h1>
<form
data-setup
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Create Project">
<p>Appwrite projects are containers for your resources and apps across different platforms.</p>
<label>Project ID</label>
<input
type="hidden"
data-custom-id
data-id-type="auto"
data-validator="projects.get"
required
maxlength="36"
class=""
pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$"
name="projectId" />
<label>Name</label>
<input type="text" class="full-width margin-bottom-xl" name="name" required autocomplete="off" maxlength="128" />
<footer>
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</footer>
</form>
</div>
<section class="upload-box" x-data x-show="$store.uploader.files().length > 0">
<div class="upload-box-header">
<h4 class="upload-box-title">
<span class="text">Uploading files</span>
<span class="amount" x-text="$store.uploader.files().length"></span>
</h4>
<button class="icon-button" :class="$store.uploader.isOpen ? '' : 'is-open'" aria-label="toggle upload box" @click="$store.uploader.toggle()"><span class="icon-chevron-down" aria-hidden="true"></span></button>
<button class="icon-button" @click="$store.uploader.cancelAll()" aria-label="close upload box"><span class="icon-x" aria-hidden="true"></span></button>
</div>
<div class="upload-box-content" :class="$store.uploader.isOpen ? 'is-open' : ''">
<ul class="upload-box-list">
<template x-if="$store.uploader.files().length > 0">
<template x-for="file in $store.uploader.files()" :key="file.id">
<li x-show="!file.cancelled" class="upload-box-item">
<div class="upload-image u-margin-inline-end-16" :class="file.completed ? 'is-finished' : ''">
<div class="progress"
:style="'--progress-value:' + file.progress"
:aria-valuenow="file.progress"
role="progressbar"
aria-valuemin="0"
aria-valuemax="100"></div>
<span x-show="!file.completed" class="icon" x-text="file.progress + '%'"></span>
<span x-show="file.completed" class="icon icon-file"></span>
</div>
<label for="file1" class="file-name trim-inner-text" x-text="file.name" :title="file.name"></label>
<span class="pill is-failed" x-show="file.failed" :title="file.error">failed</span>
<button x-show="file.completed" class="icon-button is-success" aria-label="Uploading"><span class="icon-check"></span></button>
<button x-show="!file.completed" class="icon-button" aria-label="Uploading" @click="$store.uploader.removeFile(file.id)"><span class="icon-x"></span></button>
</li>
</template>
</template>
</ul>
</div>
</section>
-96
View File
@@ -1,96 +0,0 @@
<?php
$interval = floor((int)$this->getParam('interval', 0) / 86400);
$method = $this->getParam('method', '');
$params = $this->getParam('params', []);
?>
<div
data-service="<?php echo $method; ?>"
<?php foreach($params as $key => $value): ?>
data-param-<?php echo $key; ?>="<?php echo $value; ?>"
<?php endforeach; ?>
data-param-queries="limit(<?php echo APP_PAGING_LIMIT; ?>),offset({{router.params.offset|orZero}})"
data-param-queries-cast-to="array"
data-param-queries-cast-from="csv"
data-scope="sdk"
data-event="load"
data-name="logs">
<div data-ls-if="0 == {{logs.logs.length}}">
<div class="box margin-bottom">
<h3 class="margin-bottom-small text-bold">No Logs Found</h3>
<p class="margin-bottom-no">Logs are retained for <?php echo $this->escape($interval); ?> days.</p>
</div>
</div>
<div data-ls-if="0 != {{logs.total}}">
<div class="margin-bottom-small margin-top-negative text-align-end text-size-small text-fade">Showing logs from the last <?php echo $this->escape($interval); ?> days</div>
<div class="box margin-bottom">
<table class="vertical small">
<thead>
<tr>
<th width="120">Date</th>
<th width="180">By</th>
<th>Event</th>
<th width="110">Location</th>
<th width="90">IP</th>
</tr>
</thead>
<tbody data-ls-loop="logs.logs" data-ls-as="log" class="text-size-small">
<tr>
<td data-title="Date: "><span class="text-fade" data-ls-bind="{{log.time|dateTime}}"></span></td>
<td data-title="By: ">
<span data-ls-if="{{log.userName|escape}} !== '' && {{log.mode}} === ''"><i class="icon-user"></i>&nbsp; <a data-ls-attrs="href=/console/users/user?id={{log.userId}}&project={{router.params.project}}" data-ls-bind="{{log.userName}}"></a></span>
<span data-ls-if="{{log.userName|escape}} === '' && {{log.userEmail}} !== '' && {{log.mode}} !== 'key'"><i class="icon-user"></i>&nbsp; Unknown</span>
<span data-ls-if="{{log.userName|escape}} === '' && {{log.userEmail}} === '' && {{log.mode}} !== 'key'"><i class="icon-user"></i>&nbsp; Anonymous User</span>
<span data-ls-if="{{log.mode}} === 'admin'">
<img src="" data-ls-attrs="src={{log.userName|avatar}}" data-size="45" alt="User Avatar" class="avatar xxs inline margin-end-small" loading="lazy" width="30" height="30" /> <span data-ls-bind="{{log.userName}}"></span> <span class="text-fade text-size-xs">(Admin)</span>
</span>
<span data-ls-if="{{log.mode}} === 'key'"> <i class="icon-key"></i>&nbsp; API Key</span>
</td>
<td data-title="Event: "><span data-ls-bind="{{log.event}}"></span></td>
<td data-title="Location: ">
<img onerror="this.onerror=null;this.className='avatar xxs hide'" data-ls-attrs="src={{env.API}}/avatars/flags/{{log.countryCode}}?width=80&height=80&project={{env.PROJECT}}" class="avatar xxs inline margin-end-small" />
<span data-ls-bind="{{log.countryName}}"></span>
</td>
<td data-title="IP: "><span data-ls-bind="{{log.ip}}"></span></td>
</tr>
</tbody>
</table>
</div>
<div class="pull-end text-align-center paging">
<form
data-service="<?php echo $method; ?>"
<?php foreach($params as $key => $value): ?>
data-param-<?php echo $key; ?>="<?php echo $value; ?>"
<?php endforeach; ?>
data-event="submit"
data-param-collection-id="{{router.params.id}}"
data-scope="sdk"
data-name="logs"
data-success="state"
data-success-param-state-keys="search,offset">
<input type="hidden" name="offset">
<button name="queries" data-cast-to="array" data-cast-from="csv" data-paging-back data-offset="{{router.params.offset}}" data-total="{{logs.total}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
</form>
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{logs.total|pageTotal}}"></span>
<form
data-service="<?php echo $method; ?>"
<?php foreach($params as $key => $value): ?>
data-param-<?php echo $key; ?>="<?php echo $value; ?>"
<?php endforeach; ?>
data-event="submit"
data-param-collection-id="{{router.params.id}}"
data-scope="sdk"
data-name="logs"
data-success="state"
data-success-param-state-keys="search,offset">
<input type="hidden" name="offset">
<button name="queries" data-cast-to="array" data-cast-from="csv" data-paging-next data-offset="{{router.params.offset}}" data-total="{{logs.total}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
</div>
</div>
@@ -1,111 +0,0 @@
<?php
use Utopia\Database\Database;
$method = $this->getParam('method', '');
$params = $this->getParam('params', []);
$events = $this->getParam('events', '');
$permissions = $this->getParam('permissions', Database::PERMISSIONS);
$data = $this->getParam('data', '');
$form = $this->getParam('form');
$escapedPermissions = \array_map(function ($perm) {
// Alpine won't bind to a parameter named delete
if ($perm == 'delete') {
return 'xdelete';
}
return $perm;
}, $permissions);
?>
<div
x-data="permissionsMatrix"
class="permissions-matrix margin-bottom-large"
data-scope="sdk"
<?php if (!empty($method)): ?>
data-method="<?php echo $method; ?>"
<?php endif; ?>
<?php foreach ($params as $key => $value): ?>
data-param-<?php echo $key; ?>="<?php echo $value; ?>"
<?php endforeach; ?>
<?php if (!empty($events)): ?>
data-events="<?php echo $events; ?>"
<?php endif; ?>
<?php if (!empty($data)): ?>
data-name="<?php echo $data; ?>"
<?php endif; ?>
@reset.window="permissions.length = rawPermissions.length = 0">
<input
type="hidden"
name="permissions"
data-cast-from="csv"
data-cast-to="array"
<?php if (!empty(($data))): ?>
data-ls-bind="{{<?php echo $data ?>.$permissions}}"
<?php endif; ?>
:value="rawPermissions"/>
<datalist id="types">
<option value="user:">
<option value="team:">
<option value="member:">
<option value="users">
<option value="guests">
<option value="any">
</datalist>
<table
class="u-table-layout-normal"
data-ls-attrs="x-init=load({{<?php if (!empty($data)) echo $data . '.$permissions' ?>}})">
<thead x-show="permissions.length > 0">
<tr>
<th>Role</th>
<?php foreach ($permissions as $permission): ?>
<th class="u-no-trim"><?php echo \ucfirst($permission); ?></th>
<?php endforeach; ?>
<th></th>
</tr>
</thead>
<tbody>
<template x-for="(permission, index) in permissions">
<tr>
<td>
<input
required
autocomplete="off"
:id="'<?php echo $form; ?>Input' + index"
name="<?php echo $form; ?>"
form="<?php echo $form ?>"
list="types"
type="text"
x-model="permission.role"
@keyup="updatePermission(index)"/>
</td>
<?php foreach ($escapedPermissions as $permission): ?>
<td>
<input
type="checkbox"
name="<?php echo $permission ?>"
x-model="permission.<?php echo $permission; ?>"
@click="updatePermission(index)"/>
</td>
<?php endforeach; ?>
<td>
<span class="action" @click="removePermission(index)">
<i class="icon-trash"></i>
</span>
</td>
</tr>
</template>
</tbody>
<tfoot>
<tr>
<td colspan="<?php \count($permissions) + 2 ?>">
<button type="button" class="margin-top reverse" @click="addPermission('<?php echo $form ?>')">Add Role</button>
</td>
</tr>
</tfoot>
</table>
</div>
@@ -1,6 +0,0 @@
<div x-data id="upload-modal">
<template x-for="$store.uploader.files as file">
<p x-text="file"></p>
</template>
<button @click="$store.uploader.addFile('file-x')">add</button>
</div>
File diff suppressed because it is too large Load Diff

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