diff --git a/.travis-ci/build.sh b/.travis-ci/build.sh index 27b598fd4..050168289 100644 --- a/.travis-ci/build.sh +++ b/.travis-ci/build.sh @@ -15,7 +15,7 @@ then exit 1 fi -if test $(find "./app/db/DBIP/dbip-country-lite-2021-02.mmdb" -mmin +259200) +if test $(find "./app/db/DBIP/dbip-country-lite-2021-06.mmdb" -mmin +259200) then printf "${RED}GEO country DB has not been updated for more than 6 months. Go to https://db-ip.com/db/download/ip-to-country-lite to download a newer version${NC}\n" fi diff --git a/app/config/platforms.php b/app/config/platforms.php index ade2b611a..deec77d98 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -15,7 +15,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '3.0.5', + 'version' => '3.1.0', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -178,7 +178,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '2.2.4', + 'version' => '2.3.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -229,7 +229,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '0.2.2', + 'version' => '0.3.0', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -246,7 +246,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '2.1.2', + 'version' => '2.2.0', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index c3088c5b5..13639c912 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -58,15 +58,16 @@ App::post('/v1/account') /** @var Appwrite\Database\Database $projectDB */ /** @var Appwrite\Event\Event $audits */ + $email = \strtolower($email); if ('console' === $project->getId()) { - $whitlistEmails = $project->getAttribute('authWhitelistEmails'); - $whitlistIPs = $project->getAttribute('authWhitelistIPs'); + $whitelistEmails = $project->getAttribute('authWhitelistEmails'); + $whitelistIPs = $project->getAttribute('authWhitelistIPs'); - if (!empty($whitlistEmails) && !\in_array($email, $whitlistEmails)) { + if (!empty($whitelistEmails) && !\in_array($email, $whitelistEmails)) { throw new Exception('Console registration is restricted to specific emails. Contact your administrator for more information.', 401); } - if (!empty($whitlistIPs) && !\in_array($request->getIP(), $whitlistIPs)) { + if (!empty($whitelistIPs) && !\in_array($request->getIP(), $whitelistIPs)) { throw new Exception('Console registration is restricted to specific IPs. Contact your administrator for more information.', 401); } } @@ -174,6 +175,7 @@ App::post('/v1/account/sessions') /** @var MaxMind\Db\Reader $geodb */ /** @var Appwrite\Event\Event $audits */ + $email = \strtolower($email); $protocol = $request->getProtocol(); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, @@ -1086,6 +1088,7 @@ App::patch('/v1/account/email') throw new Exception('Invalid credentials', 401); } + $email = \strtolower($email); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, 'filters' => [ @@ -1408,7 +1411,8 @@ App::post('/v1/account/recovery') $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::$roles); $isAppUser = Auth::isAppUser(Authorization::$roles); - + + $email = \strtolower($email); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, 'filters' => [ diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 685402b61..598783128 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -285,7 +285,8 @@ App::post('/v1/teams/:teamId/memberships') $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::$roles); $isAppUser = Auth::isAppUser(Authorization::$roles); - + + $email = \strtolower($email); $name = (empty($name)) ? $email : $name; $team = $projectDB->getDocument($teamId); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 03543b7cd..49e201e1d 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -40,6 +40,7 @@ App::post('/v1/users') /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Database $projectDB */ + $email = \strtolower($email); $profile = $projectDB->getCollectionFirst([ // Get user by email address 'limit' => 1, 'filters' => [ diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 307b8c291..80c4c6c42 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -6,9 +6,9 @@ use Appwrite\Database\Document; use Appwrite\Network\Validator\Host; use Appwrite\Utopia\Response; use Utopia\App; -use Utopia\Validator\Numeric; -use Utopia\Validator\Text; use Utopia\Validator\ArrayList; +use Utopia\Validator\Integer; +use Utopia\Validator\Text; use Utopia\Storage\Validator\File; App::get('/v1/mock/tests/foo') @@ -24,7 +24,7 @@ App::get('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -42,7 +42,7 @@ App::post('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -60,7 +60,7 @@ App::patch('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -78,7 +78,7 @@ App::put('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -96,7 +96,7 @@ App::delete('/v1/mock/tests/foo') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -114,7 +114,7 @@ App::get('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -132,7 +132,7 @@ App::post('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -150,7 +150,7 @@ App::patch('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -168,7 +168,7 @@ App::put('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -186,7 +186,7 @@ App::delete('/v1/mock/tests/bar') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->action(function ($x, $y, $z) { }); @@ -230,7 +230,7 @@ App::post('/v1/mock/tests/general/upload') ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->param('x', '', new Text(100), 'Sample string param') - ->param('y', '', new Numeric(), 'Sample numeric param') + ->param('y', '', new Integer(), 'Sample numeric param') ->param('z', null, new ArrayList(new Text(256)), 'Sample array param') ->param('file', [], new File(), 'Sample file param', false) ->inject('request') @@ -271,6 +271,7 @@ App::get('/v1/mock/tests/general/redirect') ->label('sdk.description', 'Mock a redirect request.') ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) + ->label('sdk.response.model', Response::MODEL_MOCK) ->label('sdk.mock', true) ->inject('response') ->action(function ($response) { @@ -394,6 +395,7 @@ App::get('/v1/mock/tests/general/502-error') ->label('sdk.description', 'Mock a 502 bad gateway.') ->label('sdk.response.code', Response::STATUS_CODE_BAD_GATEWAY) ->label('sdk.response.type', Response::CONTENT_TYPE_TEXT) + ->label('sdk.response.model', Response::MODEL_ANY) ->label('sdk.mock', true) ->inject('response') ->action(function ($response) { diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index d76d8da05..f3eeb71c9 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -8,6 +8,7 @@ use Utopia\App; use Utopia\View; use Utopia\Config\Config; use Utopia\Exception; +use Utopia\Validator\Boolean; use Utopia\Validator\Range; use Utopia\Validator\WhiteList; @@ -494,4 +495,4 @@ App::get('/versions') } $response->json($versions); - }); \ No newline at end of file + }); diff --git a/app/db/DBIP/dbip-country-lite-2021-02.mmdb b/app/db/DBIP/dbip-country-lite-2021-02.mmdb deleted file mode 100644 index 6434c220f..000000000 Binary files a/app/db/DBIP/dbip-country-lite-2021-02.mmdb and /dev/null differ diff --git a/app/db/DBIP/dbip-country-lite-2021-06.mmdb b/app/db/DBIP/dbip-country-lite-2021-06.mmdb new file mode 100644 index 000000000..984d200d1 Binary files /dev/null and b/app/db/DBIP/dbip-country-lite-2021-06.mmdb differ diff --git a/app/init.php b/app/init.php index 2f2b27014..e628b56da 100644 --- a/app/init.php +++ b/app/init.php @@ -233,7 +233,7 @@ $register->set('smtp', function () { return $mail; }); $register->set('geodb', function () { - return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2021-02.mmdb'); + return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2021-06.mmdb'); }); /* diff --git a/composer.json b/composer.json index c27cf8276..a22622612 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "slickdeals/statsd": "3.0.2" }, "require-dev": { - "appwrite/sdk-generator": "0.10.10", + "appwrite/sdk-generator": "0.10.11", "swoole/ide-helper": "4.6.6", "phpunit/phpunit": "9.5.4", "vimeo/psalm": "4.7.2" diff --git a/composer.lock b/composer.lock index 82b95e2d2..92e91a62a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d32e708dd70ab32d06b912e74b1194a", + "content-hash": "6704f7df5ffe0baac3633dc8e683ed78", "packages": [ { "name": "adhocore/jwt", @@ -2340,16 +2340,16 @@ }, { "name": "appwrite/sdk-generator", - "version": "0.10.10", + "version": "0.10.11", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "d09a4dbad3a6d63ad1bb1fec9caa9266e1a9575f" + "reference": "f73391d482660798f4077d54760d67e633bdde1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d09a4dbad3a6d63ad1bb1fec9caa9266e1a9575f", - "reference": "d09a4dbad3a6d63ad1bb1fec9caa9266e1a9575f", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/f73391d482660798f4077d54760d67e633bdde1e", + "reference": "f73391d482660798f4077d54760d67e633bdde1e", "shasum": "" }, "require": { @@ -2383,9 +2383,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.10.10" + "source": "https://github.com/appwrite/sdk-generator/tree/0.10.11" }, - "time": "2021-06-03T11:37:55+00:00" + "time": "2021-06-07T11:37:50+00:00" }, { "name": "composer/package-versions-deprecated", diff --git a/docs/examples/0.8.x/server-python/examples/account/create-recovery.md b/docs/examples/0.8.x/server-python/examples/account/create-recovery.md index 3fe4b5b45..71026337a 100644 --- a/docs/examples/0.8.x/server-python/examples/account/create-recovery.md +++ b/docs/examples/0.8.x/server-python/examples/account/create-recovery.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/create-verification.md b/docs/examples/0.8.x/server-python/examples/account/create-verification.md index 94c48c74e..53939ca66 100644 --- a/docs/examples/0.8.x/server-python/examples/account/create-verification.md +++ b/docs/examples/0.8.x/server-python/examples/account/create-verification.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/delete-session.md b/docs/examples/0.8.x/server-python/examples/account/delete-session.md index 494d56023..940367dfc 100644 --- a/docs/examples/0.8.x/server-python/examples/account/delete-session.md +++ b/docs/examples/0.8.x/server-python/examples/account/delete-session.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/delete-sessions.md b/docs/examples/0.8.x/server-python/examples/account/delete-sessions.md index 0dc8773bd..317dd043d 100644 --- a/docs/examples/0.8.x/server-python/examples/account/delete-sessions.md +++ b/docs/examples/0.8.x/server-python/examples/account/delete-sessions.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/delete.md b/docs/examples/0.8.x/server-python/examples/account/delete.md index c0e5dccc5..3ddc987bf 100644 --- a/docs/examples/0.8.x/server-python/examples/account/delete.md +++ b/docs/examples/0.8.x/server-python/examples/account/delete.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/get-logs.md b/docs/examples/0.8.x/server-python/examples/account/get-logs.md index fdeef4139..3ccddc465 100644 --- a/docs/examples/0.8.x/server-python/examples/account/get-logs.md +++ b/docs/examples/0.8.x/server-python/examples/account/get-logs.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/get-prefs.md b/docs/examples/0.8.x/server-python/examples/account/get-prefs.md index 8e44fe58c..616b1774b 100644 --- a/docs/examples/0.8.x/server-python/examples/account/get-prefs.md +++ b/docs/examples/0.8.x/server-python/examples/account/get-prefs.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/get-sessions.md b/docs/examples/0.8.x/server-python/examples/account/get-sessions.md index cd2f91fba..d35dde237 100644 --- a/docs/examples/0.8.x/server-python/examples/account/get-sessions.md +++ b/docs/examples/0.8.x/server-python/examples/account/get-sessions.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/get.md b/docs/examples/0.8.x/server-python/examples/account/get.md index 983801f63..f561eb944 100644 --- a/docs/examples/0.8.x/server-python/examples/account/get.md +++ b/docs/examples/0.8.x/server-python/examples/account/get.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/update-email.md b/docs/examples/0.8.x/server-python/examples/account/update-email.md index 6b2977576..d18eed406 100644 --- a/docs/examples/0.8.x/server-python/examples/account/update-email.md +++ b/docs/examples/0.8.x/server-python/examples/account/update-email.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/update-name.md b/docs/examples/0.8.x/server-python/examples/account/update-name.md index 224b9adde..eec145325 100644 --- a/docs/examples/0.8.x/server-python/examples/account/update-name.md +++ b/docs/examples/0.8.x/server-python/examples/account/update-name.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/update-password.md b/docs/examples/0.8.x/server-python/examples/account/update-password.md index 81a2165da..2e89031dc 100644 --- a/docs/examples/0.8.x/server-python/examples/account/update-password.md +++ b/docs/examples/0.8.x/server-python/examples/account/update-password.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/update-prefs.md b/docs/examples/0.8.x/server-python/examples/account/update-prefs.md index 9295fc883..5bf6d7478 100644 --- a/docs/examples/0.8.x/server-python/examples/account/update-prefs.md +++ b/docs/examples/0.8.x/server-python/examples/account/update-prefs.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/update-recovery.md b/docs/examples/0.8.x/server-python/examples/account/update-recovery.md index f5b156311..badc07d0a 100644 --- a/docs/examples/0.8.x/server-python/examples/account/update-recovery.md +++ b/docs/examples/0.8.x/server-python/examples/account/update-recovery.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/account/update-verification.md b/docs/examples/0.8.x/server-python/examples/account/update-verification.md index d1e583cd5..02d01257c 100644 --- a/docs/examples/0.8.x/server-python/examples/account/update-verification.md +++ b/docs/examples/0.8.x/server-python/examples/account/update-verification.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) account = Account(client) diff --git a/docs/examples/0.8.x/server-python/examples/avatars/get-q-r.md b/docs/examples/0.8.x/server-python/examples/avatars/get-q-r.md index 19551e99d..38378e923 100644 --- a/docs/examples/0.8.x/server-python/examples/avatars/get-q-r.md +++ b/docs/examples/0.8.x/server-python/examples/avatars/get-q-r.md @@ -11,4 +11,4 @@ client = Client() avatars = Avatars(client) -result = avatars.get_q_r('[TEXT]') +result = avatars.get_qr('[TEXT]') diff --git a/docs/examples/0.8.x/server-python/examples/health/get-d-b.md b/docs/examples/0.8.x/server-python/examples/health/get-d-b.md index db8eec5ce..4c2bafec9 100644 --- a/docs/examples/0.8.x/server-python/examples/health/get-d-b.md +++ b/docs/examples/0.8.x/server-python/examples/health/get-d-b.md @@ -11,4 +11,4 @@ client = Client() health = Health(client) -result = health.get_d_b() +result = health.get_db() diff --git a/docs/examples/0.8.x/server-python/examples/locale/get-countries-e-u.md b/docs/examples/0.8.x/server-python/examples/locale/get-countries-e-u.md index 653fdd5ab..51178ddd6 100644 --- a/docs/examples/0.8.x/server-python/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.8.x/server-python/examples/locale/get-countries-e-u.md @@ -11,4 +11,4 @@ client = Client() locale = Locale(client) -result = locale.get_countries_e_u() +result = locale.get_countries_eu() diff --git a/docs/examples/0.8.x/server-python/examples/teams/update-membership-status.md b/docs/examples/0.8.x/server-python/examples/teams/update-membership-status.md index eff599042..357d4091c 100644 --- a/docs/examples/0.8.x/server-python/examples/teams/update-membership-status.md +++ b/docs/examples/0.8.x/server-python/examples/teams/update-membership-status.md @@ -6,7 +6,7 @@ client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ) teams = Teams(client) diff --git a/docs/examples/0.8.x/server-ruby/examples/account/create-recovery.md b/docs/examples/0.8.x/server-ruby/examples/account/create-recovery.md index 7d20fe292..91f929a99 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/create-recovery.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/create-recovery.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/create-verification.md b/docs/examples/0.8.x/server-ruby/examples/account/create-verification.md index e0264f3bd..9ee79d66c 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/create-verification.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/create-verification.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/delete-session.md b/docs/examples/0.8.x/server-ruby/examples/account/delete-session.md index 65f86adcf..747fb27fa 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/delete-session.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/delete-session.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/delete-sessions.md b/docs/examples/0.8.x/server-ruby/examples/account/delete-sessions.md index 6162d872d..b4f1654c1 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/delete-sessions.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/delete-sessions.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/delete.md b/docs/examples/0.8.x/server-ruby/examples/account/delete.md index 319436282..376c239f7 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/delete.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/delete.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/get-logs.md b/docs/examples/0.8.x/server-ruby/examples/account/get-logs.md index 286a0e0da..41d578850 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/get-logs.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/get-logs.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/get-prefs.md b/docs/examples/0.8.x/server-ruby/examples/account/get-prefs.md index d63509e7b..7224ccfb6 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/get-prefs.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/get-prefs.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/get-sessions.md b/docs/examples/0.8.x/server-ruby/examples/account/get-sessions.md index 43af95b52..0136b2a70 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/get-sessions.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/get-sessions.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/get.md b/docs/examples/0.8.x/server-ruby/examples/account/get.md index 71693493d..a58f284f5 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/get.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/get.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/update-email.md b/docs/examples/0.8.x/server-ruby/examples/account/update-email.md index a30c84b3a..d90047bab 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/update-email.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/update-email.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/update-name.md b/docs/examples/0.8.x/server-ruby/examples/account/update-name.md index f9b09667c..e7266ae5e 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/update-name.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/update-name.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/update-password.md b/docs/examples/0.8.x/server-ruby/examples/account/update-password.md index 9cd76089d..babedf533 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/update-password.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/update-password.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/update-prefs.md b/docs/examples/0.8.x/server-ruby/examples/account/update-prefs.md index b1133dc12..1a3e72123 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/update-prefs.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/update-prefs.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/update-recovery.md b/docs/examples/0.8.x/server-ruby/examples/account/update-recovery.md index f402da9f4..c12c7dad9 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/update-recovery.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/update-recovery.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/account/update-verification.md b/docs/examples/0.8.x/server-ruby/examples/account/update-verification.md index 25045898a..ffec50648 100644 --- a/docs/examples/0.8.x/server-ruby/examples/account/update-verification.md +++ b/docs/examples/0.8.x/server-ruby/examples/account/update-verification.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; account = Appwrite::Account.new(client); diff --git a/docs/examples/0.8.x/server-ruby/examples/avatars/get-q-r.md b/docs/examples/0.8.x/server-ruby/examples/avatars/get-q-r.md index f145425ca..20c9bfd1b 100644 --- a/docs/examples/0.8.x/server-ruby/examples/avatars/get-q-r.md +++ b/docs/examples/0.8.x/server-ruby/examples/avatars/get-q-r.md @@ -10,6 +10,6 @@ client avatars = Appwrite::Avatars.new(client); -response = avatars.get_q_r(text: '[TEXT]'); +response = avatars.get_qr(text: '[TEXT]'); puts response \ No newline at end of file diff --git a/docs/examples/0.8.x/server-ruby/examples/health/get-d-b.md b/docs/examples/0.8.x/server-ruby/examples/health/get-d-b.md index 4bb00577a..71a13ad9c 100644 --- a/docs/examples/0.8.x/server-ruby/examples/health/get-d-b.md +++ b/docs/examples/0.8.x/server-ruby/examples/health/get-d-b.md @@ -10,6 +10,6 @@ client health = Appwrite::Health.new(client); -response = health.get_d_b(); +response = health.get_db(); puts response \ No newline at end of file diff --git a/docs/examples/0.8.x/server-ruby/examples/locale/get-countries-e-u.md b/docs/examples/0.8.x/server-ruby/examples/locale/get-countries-e-u.md index b83125d4a..68e2667dd 100644 --- a/docs/examples/0.8.x/server-ruby/examples/locale/get-countries-e-u.md +++ b/docs/examples/0.8.x/server-ruby/examples/locale/get-countries-e-u.md @@ -10,6 +10,6 @@ client locale = Appwrite::Locale.new(client); -response = locale.get_countries_e_u(); +response = locale.get_countries_eu(); puts response \ No newline at end of file diff --git a/docs/examples/0.8.x/server-ruby/examples/teams/update-membership-status.md b/docs/examples/0.8.x/server-ruby/examples/teams/update-membership-status.md index ead789fd3..24a55540c 100644 --- a/docs/examples/0.8.x/server-ruby/examples/teams/update-membership-status.md +++ b/docs/examples/0.8.x/server-ruby/examples/teams/update-membership-status.md @@ -5,7 +5,7 @@ client = Appwrite::Client.new() client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_j_w_t('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token ; teams = Appwrite::Teams.new(client); diff --git a/src/Appwrite/Specification/Format.php b/src/Appwrite/Specification/Format.php index 62447444f..f76a4c1a5 100644 --- a/src/Appwrite/Specification/Format.php +++ b/src/Appwrite/Specification/Format.php @@ -62,6 +62,7 @@ abstract class Format * @param Route[] $routes * @param Model[] $models * @param array $keys + * @param int $authCount */ public function __construct(App $app, array $services, array $routes, array $models, array $keys, int $authCount) { diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index dfd89ab86..9809220f8 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -4,7 +4,6 @@ namespace Appwrite\Specification\Format; use Appwrite\Specification\Format; use Appwrite\Template\Template; -use Appwrite\Utopia\Response\Model; use stdClass; use Utopia\Validator; @@ -188,7 +187,7 @@ class Swagger2 extends Format ]; } - if($route->getLabel('sdk.response.code', 500) === 204) { + if(in_array($route->getLabel('sdk.response.code', 500), [204, 301, 302, 308], true)) { $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); } @@ -218,7 +217,7 @@ class Swagger2 extends Format $bodyRequired = []; foreach ($route->getParams() as $name => $param) { // Set params - $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['injections'])) : $param['validator']; /* @var $validator \Utopia\Validator */ + $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['injections'])) : $param['validator']; /** @var \Utopia\Validator $validator */ $node = [ 'name' => $name, @@ -279,6 +278,7 @@ class Swagger2 extends Format $node['x-example'] = $validator->getMin(); break; case 'Utopia\Validator\Numeric': + case 'Utopia\Validator\Integer': $node['type'] = $validator->getType(); $node['format'] = 'int32'; break; @@ -355,13 +355,16 @@ class Swagger2 extends Format } foreach ($this->models as $model) { foreach ($model->getRules() as $rule) { - if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])) { + if ( + in_array($model->getType(), $usedModels) + && !in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float']) + ) { $usedModels[] = $rule['type']; } } } foreach ($this->models as $model) { - if (!in_array($model->getType(), $usedModels) && $model->getType() !== 'error') { + if (!in_array($model->getType(), $usedModels)) { continue; } diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index 1ada772e8..fa3589e1f 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -90,7 +90,7 @@ class Project extends Model 'example' => '131102020', ]) ->addRule('usersAuthLimit', [ - 'type' => self::TYPE_BOOLEAN, + 'type' => self::TYPE_INTEGER, 'description' => 'Max users allowed. 0 is unlimited.', 'default' => 0, 'example' => 100,