Merge pull request #1127 from TorstenDittmann/merge-dev-into-0.8.x
0.8 - Sync dev into 0.8.x
This commit is contained in:
commit
a512edf7c3
46 changed files with 6266 additions and 4089 deletions
38
CHANGES.md
38
CHANGES.md
|
@ -4,42 +4,42 @@
|
|||
|
||||
- Added Anonymous Login ([RFC-010](https://github.com/appwrite/rfc/blob/main/010-anonymous-login.md), #914)
|
||||
- Added events for functions and executions (#971)
|
||||
- Added JWT support
|
||||
- Added ARM support
|
||||
- Added JWT support (#784)
|
||||
- Added ARM support (#726)
|
||||
- Splitted token & session models to become 2 different internal entities (#922)
|
||||
- Added Dart 2.12 as a new Cloud Functions runtime (#989)
|
||||
- Added option to disable email/password
|
||||
- Added option to disable anonymous login (need to merge and apply changed)
|
||||
- Added option to disable JWT auth
|
||||
- Added option to disable team invites
|
||||
- Option to limit number of users (good for app launches + god account PR)
|
||||
- Added option to disable email/password (#947)
|
||||
- Added option to disable anonymous login (need to merge and apply changed) (#947)
|
||||
- Added option to disable JWT auth (#947)
|
||||
- Added option to disable team invites (#947)
|
||||
- Option to limit number of users (good for app launches + god account PR) (#947)
|
||||
- Added 2 new endpoints to the projects API to allow new settings
|
||||
- Enabled 501 errors (Not Implemented) from the error handler
|
||||
- Added Python 3.9 as a new Cloud Functions runtime
|
||||
- Added Python 3.9 as a new Cloud Functions runtime (#1044)
|
||||
- Added Deno 1.8 as a new Cloud Functions runtime (#989)
|
||||
- Upgraded to PHP 8.0 (#713)
|
||||
- ClamAV is now disabled by default to allow lower min requirments for Appwrite (#1064)
|
||||
- Added a new env var named `_APP_LOCALE` that allow to change the default `en` locale value (#1056)
|
||||
- Updated all the console bottom control to be consistent. Dropped the `+` icon (#1062)
|
||||
- Added Response Models for Documents and Preferences
|
||||
- Added Response Models for Documents and Preferences (#1075, #1102)
|
||||
|
||||
## Bugs
|
||||
|
||||
- Fixed default value for HTTPS force option
|
||||
- Fixed form array casting in dashboard
|
||||
- Fixed collection document rule form in dashboard
|
||||
- Fixed form array casting in dashboard (#1070)
|
||||
- Fixed collection document rule form in dashboard (#1069)
|
||||
|
||||
## Breaking Changes (Read before upgrading!)
|
||||
|
||||
- Rename `deleteuser` to `delete` on Users Api
|
||||
- Environment variable `_APP_FUNCTIONS_ENVS` renamed to `_APP_FUNCTIONS_RUNTIMES`
|
||||
- Only logged in users can execute functions (for guests, use anonymous login)
|
||||
- Only the user who has triggered the execution get access to the relevant execution logs
|
||||
- Function execution environment variable `APPWRITE_FUNCTION_EVENT_PAYLOAD` renamed to `APPWRITE_FUNCTION_EVENT_DATA`
|
||||
- Function execution environment variable `APPWRITE_FUNCTION_ENV_NAME` renamed to `APPWRITE_FUNCTION_RUNTIME_NAME`
|
||||
- Function execution environment variable `APPWRITE_FUNCTION_ENV_VERSION` renamed to `APPWRITE_FUNCTION_RUNTIME_VERSION`
|
||||
- Rename `deleteuser` to `delete` on Users Api (#1089)
|
||||
- Environment variable `_APP_FUNCTIONS_ENVS` renamed to `_APP_FUNCTIONS_RUNTIMES` (#1101)
|
||||
- Only logged in users can execute functions (for guests, use anonymous login) (#976)
|
||||
- Only the user who has triggered the execution get access to the relevant execution logs (#1045)
|
||||
- Function execution environment variable `APPWRITE_FUNCTION_EVENT_PAYLOAD` renamed to `APPWRITE_FUNCTION_EVENT_DATA` (#1045)
|
||||
- Function execution environment variable `APPWRITE_FUNCTION_ENV_NAME` renamed to `APPWRITE_FUNCTION_RUNTIME_NAME` (#1101)
|
||||
- Function execution environment variable `APPWRITE_FUNCTION_ENV_VERSION` renamed to `APPWRITE_FUNCTION_RUNTIME_VERSION` (#1101)
|
||||
- Introdcues rate limits for:
|
||||
- Team invite (10 requests in every 60 minutes per IP address)
|
||||
- Team invite (10 requests in every 60 minutes per IP address) (#1088)
|
||||
|
||||
# Version 0.7.2
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<br />
|
||||
<p align="center">
|
||||
<a href="https://appwrite.io" target="_blank"><img width="260" height="39" src="https://appwrite.io/images/github-logo.png" alt="Appwrite Logo"></a>
|
||||
<br />
|
||||
|
|
|
@ -28,11 +28,41 @@ return [
|
|||
'gitUrl' => 'git@github.com:appwrite/sdk-for-web.git',
|
||||
'gitRepoName' => 'sdk-for-web',
|
||||
'gitUserName' => 'appwrite',
|
||||
'demos' => [
|
||||
[
|
||||
'icon' => 'react.svg',
|
||||
'name' => 'Todo App with React JS',
|
||||
'description' => 'A simple Todo app that uses both the Appwrite account and database APIs.',
|
||||
'source' => 'https://github.com/appwrite/todo-with-react',
|
||||
'url' => 'https://appwrite-todo-with-react.vercel.app/',
|
||||
],
|
||||
[
|
||||
'icon' => 'vue.svg',
|
||||
'name' => 'Todo App with Vue JS',
|
||||
'description' => 'A simple Todo app that uses both the Appwrite account and database APIs.',
|
||||
'source' => 'https://github.com/appwrite/todo-with-vue',
|
||||
'url' => 'https://appwrite-todo-with-vue.vercel.app/',
|
||||
],
|
||||
[
|
||||
'icon' => 'angular.svg',
|
||||
'name' => 'Todo App with Angular.js',
|
||||
'description' => 'A simple Todo app that uses both the Appwrite account and database APIs.',
|
||||
'source' => 'https://github.com/appwrite/todo-with-angular',
|
||||
'url' => 'https://appwrite-todo-with-angular.vercel.app/',
|
||||
],
|
||||
[
|
||||
'icon' => 'svelte.svg',
|
||||
'name' => 'Todo App with Svelte',
|
||||
'description' => 'A simple Todo app that uses both the Appwrite account and database APIs.',
|
||||
'source' => 'https://github.com/appwrite/todo-with-svelte',
|
||||
'url' => 'https://appwrite-todo-with-svelte.vercel.app/',
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'key' => 'flutter',
|
||||
'name' => 'Flutter',
|
||||
'version' => '0.4.0',
|
||||
'version' => '0.5.0-dev.1',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-flutter',
|
||||
'package' => 'https://pub.dev/packages/appwrite',
|
||||
'enabled' => true,
|
||||
|
@ -148,7 +178,7 @@ return [
|
|||
[
|
||||
'key' => 'nodejs',
|
||||
'name' => 'Node.js',
|
||||
'version' => '2.0.0',
|
||||
'version' => '2.1.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-node',
|
||||
'package' => 'https://www.npmjs.com/package/node-appwrite',
|
||||
'enabled' => true,
|
||||
|
@ -267,7 +297,7 @@ return [
|
|||
[
|
||||
'key' => 'dotnet',
|
||||
'name' => '.NET',
|
||||
'version' => '0.1.0',
|
||||
'version' => '0.2.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-dotnet',
|
||||
'package' => 'https://www.nuget.org/packages/Appwrite',
|
||||
'enabled' => true,
|
||||
|
@ -284,7 +314,7 @@ return [
|
|||
[
|
||||
'key' => 'dart',
|
||||
'name' => 'Dart',
|
||||
'version' => '0.4.0',
|
||||
'version' => '0.5.0-dev.1',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-dart',
|
||||
'package' => 'https://pub.dev/packages/dart_appwrite',
|
||||
'enabled' => true,
|
||||
|
@ -301,7 +331,7 @@ return [
|
|||
[
|
||||
'key' => 'cli',
|
||||
'name' => 'Command Line',
|
||||
'version' => '0.6.0',
|
||||
'version' => '0.8.0',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-cli',
|
||||
'package' => 'https://github.com/appwrite/sdk-for-cli',
|
||||
'enabled' => true,
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,7 @@
|
|||
|
||||
use Utopia\App;
|
||||
use Utopia\Exception;
|
||||
use Utopia\Validator;
|
||||
use Utopia\Validator\Assoc;
|
||||
use Utopia\Validator\WhiteList;
|
||||
use Appwrite\Network\Validator\Email;
|
||||
|
@ -343,7 +344,7 @@ App::patch('/v1/users/:userId/status')
|
|||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->param('userId', '', new UID(), 'User unique ID.')
|
||||
->param('status', '', new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED], true), 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED)
|
||||
->param('status', '', new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED], true, Validator::TYPE_INTEGER), 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED)
|
||||
->inject('response')
|
||||
->inject('projectDB')
|
||||
->action(function ($userId, $status, $response, $projectDB) {
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
global $utopia, $request, $response;
|
||||
|
||||
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\Host;
|
||||
use Utopia\Storage\Validator\File;
|
||||
|
||||
App::get('/v1/mock/tests/foo')
|
||||
|
|
|
@ -53,6 +53,7 @@ const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite';
|
|||
const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io';
|
||||
const APP_SOCIAL_GITHUB = 'https://github.com/appwrite';
|
||||
const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord';
|
||||
const APP_SOCIAL_DISCORD_CHANNEL = '564160730845151244';
|
||||
const APP_SOCIAL_DEV = 'https://dev.to/appwrite';
|
||||
const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite';
|
||||
// Deletion Types
|
||||
|
|
|
@ -143,8 +143,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
case 'dart':
|
||||
$config = new Dart();
|
||||
$config->setPackageName('dart_appwrite');
|
||||
$warning = $warning."\n\n > This is the Dart SDK for integrating with Appwrite from your Dart server-side code.
|
||||
If you're looking for the Flutter SDK you should check [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter)";
|
||||
$warning = $warning."\n\n > This is the Dart SDK for integrating with Appwrite from your Dart server-side code. If you're looking for the Flutter SDK you should check [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter)";
|
||||
break;
|
||||
case 'go':
|
||||
$config = new Go();
|
||||
|
@ -192,6 +191,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
->setGettingStarted($gettingStarted)
|
||||
->setChangelog($changelog)
|
||||
->setExamples($examples)
|
||||
->setTwitter(APP_SOCIAL_TWITTER_HANDLE)
|
||||
->setDiscord(APP_SOCIAL_DISCORD_CHANNEL, APP_SOCIAL_DISCORD)
|
||||
;
|
||||
|
||||
try {
|
||||
|
|
|
@ -93,7 +93,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
|
|||
|
||||
<div class="chart-metric">
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-bind="{{usage.requests.total|statsTotal}}">N/A</span></div>
|
||||
<div class="metric margin-bottom-small">Requests <span class="tooltip" data-tooltip="Total number of API requests last 30 days"><i class="icon-info-circled"></i></span></div>
|
||||
<div class="metric margin-bottom-small">Requests <span class="tooltip" data-tooltip="Total number of API requests"><i class="icon-info-circled"></i></span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col span-3">
|
||||
|
|
|
@ -38,25 +38,25 @@
|
|||
"appwrite/php-clamav": "1.1.*",
|
||||
"appwrite/php-runtimes": "0.2.*",
|
||||
|
||||
"utopia-php/framework": "0.12.*",
|
||||
"utopia-php/framework": "0.14.*",
|
||||
"utopia-php/abuse": "0.4.*",
|
||||
"utopia-php/analytics": "0.2.*",
|
||||
"utopia-php/audit": "0.5.*",
|
||||
"utopia-php/cache": "0.2.*",
|
||||
"utopia-php/cli": "0.10.*",
|
||||
"utopia-php/cli": "0.11.*",
|
||||
"utopia-php/config": "0.2.*",
|
||||
"utopia-php/locale": "0.3.*",
|
||||
"utopia-php/registry": "0.4.*",
|
||||
"utopia-php/preloader": "0.2.*",
|
||||
"utopia-php/domains": "1.1.*",
|
||||
"utopia-php/swoole": "0.2.*",
|
||||
"utopia-php/storage": "0.4.*",
|
||||
"utopia-php/storage": "0.5.*",
|
||||
"utopia-php/image": "0.2.*",
|
||||
"resque/php-resque": "1.3.6",
|
||||
"matomo/device-detector": "4.2.2",
|
||||
"dragonmantank/cron-expression": "3.1.0",
|
||||
"influxdb/influxdb-php": "1.15.2",
|
||||
"phpmailer/phpmailer": "6.4.0",
|
||||
"phpmailer/phpmailer": "6.4.1",
|
||||
"chillerlan/php-qrcode": "4.3.0",
|
||||
"adhocore/jwt": "1.1.2",
|
||||
"slickdeals/statsd": "3.0.2"
|
||||
|
@ -65,7 +65,7 @@
|
|||
"appwrite/sdk-generator": "dev-feat-preps-for-0.8",
|
||||
"swoole/ide-helper": "4.6.6",
|
||||
"phpunit/phpunit": "9.5.4",
|
||||
"vimeo/psalm": "4.7.1"
|
||||
"vimeo/psalm": "4.7.2"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
|
|
80
composer.lock
generated
80
composer.lock
generated
|
@ -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": "32ceddda707fb8f625f84eec08dc3871",
|
||||
"content-hash": "407185a7ffb14acda25f4a449cdb5ffb",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
@ -834,16 +834,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.4.0",
|
||||
"version": "v6.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "050d430203105c27c30efd1dce7aa421ad882d01"
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/050d430203105c27c30efd1dce7aa421ad882d01",
|
||||
"reference": "050d430203105c27c30efd1dce7aa421ad882d01",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -898,7 +898,7 @@
|
|||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.0"
|
||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -906,7 +906,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-03-31T20:06:42+00:00"
|
||||
"time": "2021-04-29T12:25:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
|
@ -1535,16 +1535,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/cli",
|
||||
"version": "0.10.0",
|
||||
"version": "0.11.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/cli.git",
|
||||
"reference": "69ae40187fb4b68ef14f0224a68d9cc016b83634"
|
||||
"reference": "c7a6908a8dbe9234b8b2c954e5487d34cb079af6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/cli/zipball/69ae40187fb4b68ef14f0224a68d9cc016b83634",
|
||||
"reference": "69ae40187fb4b68ef14f0224a68d9cc016b83634",
|
||||
"url": "https://api.github.com/repos/utopia-php/cli/zipball/c7a6908a8dbe9234b8b2c954e5487d34cb079af6",
|
||||
"reference": "c7a6908a8dbe9234b8b2c954e5487d34cb079af6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1582,9 +1582,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/cli/issues",
|
||||
"source": "https://github.com/utopia-php/cli/tree/0.10.0"
|
||||
"source": "https://github.com/utopia-php/cli/tree/0.11.0"
|
||||
},
|
||||
"time": "2021-01-26T16:35:15+00:00"
|
||||
"time": "2021-04-16T15:16:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/config",
|
||||
|
@ -1693,16 +1693,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/framework",
|
||||
"version": "0.12.3",
|
||||
"version": "0.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/framework.git",
|
||||
"reference": "78be43a0eb711f3677769dfb445e5111bfafaa88"
|
||||
"reference": "92d4a36f3b0e22393a31877c5317c96e01760339"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/framework/zipball/78be43a0eb711f3677769dfb445e5111bfafaa88",
|
||||
"reference": "78be43a0eb711f3677769dfb445e5111bfafaa88",
|
||||
"url": "https://api.github.com/repos/utopia-php/framework/zipball/92d4a36f3b0e22393a31877c5317c96e01760339",
|
||||
"reference": "92d4a36f3b0e22393a31877c5317c96e01760339",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1736,9 +1736,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/framework/issues",
|
||||
"source": "https://github.com/utopia-php/framework/tree/0.12.3"
|
||||
"source": "https://github.com/utopia-php/framework/tree/0.14.0"
|
||||
},
|
||||
"time": "2021-03-22T22:02:23+00:00"
|
||||
"time": "2021-04-15T21:01:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/image",
|
||||
|
@ -1951,16 +1951,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/storage",
|
||||
"version": "0.4.3",
|
||||
"version": "0.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/storage.git",
|
||||
"reference": "9db3ab713a6d392c3c2c799aeea751f6c8dc2ff7"
|
||||
"reference": "92ae20c7a2ac329f573a58a82dc245134cc63408"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/storage/zipball/9db3ab713a6d392c3c2c799aeea751f6c8dc2ff7",
|
||||
"reference": "9db3ab713a6d392c3c2c799aeea751f6c8dc2ff7",
|
||||
"url": "https://api.github.com/repos/utopia-php/storage/zipball/92ae20c7a2ac329f573a58a82dc245134cc63408",
|
||||
"reference": "92ae20c7a2ac329f573a58a82dc245134cc63408",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1997,9 +1997,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/storage/issues",
|
||||
"source": "https://github.com/utopia-php/storage/tree/0.4.3"
|
||||
"source": "https://github.com/utopia-php/storage/tree/0.5.0"
|
||||
},
|
||||
"time": "2021-03-02T20:25:02+00:00"
|
||||
"time": "2021-04-15T16:43:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/swoole",
|
||||
|
@ -2344,7 +2344,7 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "5bb8ceaf0ff9da85fcca840285d6896a7594f435"
|
||||
"reference": "a8d90fd59db39ec04914692bd6ab06e013977b77"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
@ -2352,7 +2352,7 @@
|
|||
"ext-mbstring": "*",
|
||||
"matthiasmullie/minify": "^1.3",
|
||||
"php": ">=7.0.0",
|
||||
"twig/twig": "^2.12"
|
||||
"twig/twig": "^2.14"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.0"
|
||||
|
@ -2374,7 +2374,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2021-03-28T22:18:36+00:00"
|
||||
"time": "2021-05-05T12:50:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/package-versions-deprecated",
|
||||
|
@ -2532,16 +2532,16 @@
|
|||
},
|
||||
{
|
||||
"name": "composer/xdebug-handler",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/xdebug-handler.git",
|
||||
"reference": "31d57697eb1971712a08031cfaff5a846d10bdf5"
|
||||
"reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/31d57697eb1971712a08031cfaff5a846d10bdf5",
|
||||
"reference": "31d57697eb1971712a08031cfaff5a846d10bdf5",
|
||||
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496",
|
||||
"reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2576,7 +2576,7 @@
|
|||
"support": {
|
||||
"irc": "irc://irc.freenode.org/composer",
|
||||
"issues": "https://github.com/composer/xdebug-handler/issues",
|
||||
"source": "https://github.com/composer/xdebug-handler/tree/2.0.0"
|
||||
"source": "https://github.com/composer/xdebug-handler/tree/2.0.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -2592,7 +2592,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-04-09T19:40:06+00:00"
|
||||
"time": "2021-05-05T19:37:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "dnoegel/php-xdg-base-dir",
|
||||
|
@ -5768,16 +5768,16 @@
|
|||
},
|
||||
{
|
||||
"name": "vimeo/psalm",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vimeo/psalm.git",
|
||||
"reference": "cd53e047a58f71f646dd6bf45476076ab07b5d44"
|
||||
"reference": "83a0325c0a95c0ab531d6b90c877068b464377b5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vimeo/psalm/zipball/cd53e047a58f71f646dd6bf45476076ab07b5d44",
|
||||
"reference": "cd53e047a58f71f646dd6bf45476076ab07b5d44",
|
||||
"url": "https://api.github.com/repos/vimeo/psalm/zipball/83a0325c0a95c0ab531d6b90c877068b464377b5",
|
||||
"reference": "83a0325c0a95c0ab531d6b90c877068b464377b5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -5867,9 +5867,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/vimeo/psalm/issues",
|
||||
"source": "https://github.com/vimeo/psalm/tree/4.7.1"
|
||||
"source": "https://github.com/vimeo/psalm/tree/4.7.2"
|
||||
},
|
||||
"time": "2021-04-25T21:26:25+00:00"
|
||||
"time": "2021-05-01T20:56:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/path-util",
|
||||
|
|
|
@ -1 +1 @@
|
|||
appwrite database createCollection --name="[NAME]" "--read[]=" "--write[]=" "--rules[]="
|
||||
appwrite database createCollection --name="[NAME]" --read="" --write="" --rules=""
|
|
@ -1 +1 @@
|
|||
appwrite database createDocument --collectionId="[COLLECTION_ID]" --data="{}" "--read[]=" "--write[]=" --parentDocument="[PARENT_DOCUMENT]" --parentProperty="" --parentPropertyType="assign"
|
||||
appwrite database createDocument --collectionId="[COLLECTION_ID]" --data="{}" --read="" --write="" --parentDocument="[PARENT_DOCUMENT]" --parentProperty="" --parentPropertyType="assign"
|
|
@ -1 +1 @@
|
|||
appwrite database listDocuments --collectionId="[COLLECTION_ID]" "--filters[]=" --limit="0" --offset="0" --orderField="[ORDER_FIELD]" --orderType="DESC" --orderCast="int" --search="[SEARCH]"
|
||||
appwrite database listDocuments --collectionId="[COLLECTION_ID]" --filters="" --limit="0" --offset="0" --orderField="[ORDER_FIELD]" --orderType="DESC" --orderCast="int" --search="[SEARCH]"
|
|
@ -1 +1 @@
|
|||
appwrite database updateCollection --collectionId="[COLLECTION_ID]" --name="[NAME]" "--read[]=" "--write[]=" "--rules[]="
|
||||
appwrite database updateCollection --collectionId="[COLLECTION_ID]" --name="[NAME]" --read="" --write="" --rules=""
|
|
@ -1 +1 @@
|
|||
appwrite database updateDocument --collectionId="[COLLECTION_ID]" --documentId="[DOCUMENT_ID]" --data="{}" "--read[]=" "--write[]="
|
||||
appwrite database updateDocument --collectionId="[COLLECTION_ID]" --documentId="[DOCUMENT_ID]" --data="{}" --read="" --write=""
|
|
@ -1 +1 @@
|
|||
appwrite functions create --name="[NAME]" "--execute[]=" --env="node-14.5" --vars="{}" "--events[]=" --schedule="" --timeout="1"
|
||||
appwrite functions create --name="[NAME]" --execute="" --env="node-14.5" --vars="{}" --events="" --schedule="" --timeout="1"
|
|
@ -1 +1 @@
|
|||
appwrite functions update --functionId="[FUNCTION_ID]" --name="[NAME]" "--execute[]=" --vars="{}" "--events[]=" --schedule="" --timeout="1"
|
||||
appwrite functions update --functionId="[FUNCTION_ID]" --name="[NAME]" --execute="" --vars="{}" --events="" --schedule="" --timeout="1"
|
|
@ -1 +1 @@
|
|||
appwrite storage createFile --file="" "--read[]=" "--write[]="
|
||||
appwrite storage createFile --file="" --read="" --write=""
|
|
@ -1 +1 @@
|
|||
appwrite storage updateFile --fileId="[FILE_ID]" "--read[]=" "--write[]="
|
||||
appwrite storage updateFile --fileId="[FILE_ID]" --read="" --write=""
|
|
@ -1 +1 @@
|
|||
appwrite teams createMembership --teamId="[TEAM_ID]" --email="email@example.com" "--roles[]=" --url="https://example.com" --name="[NAME]"
|
||||
appwrite teams createMembership --teamId="[TEAM_ID]" --email="email@example.com" --roles="" --url="https://example.com" --name="[NAME]"
|
|
@ -1 +1 @@
|
|||
appwrite teams create --name="[NAME]" "--roles[]="
|
||||
appwrite teams create --name="[NAME]" --roles=""
|
|
@ -1 +1 @@
|
|||
Update currently logged in user password. For validation, user is required to pass the password twice.
|
||||
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password.
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
## 0.5.0-dev.1
|
||||
|
||||
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0
|
||||
- Upgraded all underlying dependencies to null safe version
|
||||
|
||||
## 0.3.1
|
||||
|
||||
- Minor fixes for custom exceptions
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
## 0.5.0-dev.1
|
||||
|
||||
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0 and minimum Flutter SDK version required 2.0.0
|
||||
- Upgraded all underlying dependencies to null safe version
|
||||
- All of Avatars service now return Future<Response></Response> instead of String like the Storage getFilePreview, getFileView and getFileDownload
|
||||
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0
|
||||
- Upgraded all underlying dependencies to null safe version
|
||||
|
||||
## 0.4.0
|
||||
|
||||
- Improved code quality
|
||||
|
|
9677
package-lock.json
generated
9677
package-lock.json
generated
File diff suppressed because it is too large
Load diff
11
package.json
11
package.json
|
@ -3,14 +3,19 @@
|
|||
"version": "0.1.0",
|
||||
"license": "BSD-3-Clause",
|
||||
"repository": "public",
|
||||
"scripts": {
|
||||
"build": "npm run gulp:less && npm run gulp:import && npm run gulp:build",
|
||||
"gulp:less": "gulp less",
|
||||
"gulp:import": "gulp import",
|
||||
"gulp:build": "gulp build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"yargs-parser": ">=20.2.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-clean-css": "^4.3.0",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-jsmin": "^0.1.5",
|
||||
"gulp-less": "^4.0.1",
|
||||
"jest": "^26.4.2",
|
||||
"ls-service-form2json": "^1.0.0"
|
||||
"ls-service-form2json": "^1.0.0",
|
||||
"yargs-parser": "^20.2.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,4 +40,28 @@ class Password extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,4 +188,28 @@ class Authorization extends Validator
|
|||
{
|
||||
self::$status = self::$statusDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_ARRAY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,4 +78,28 @@ class DocumentId extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,4 +48,27 @@ class Key extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,4 +74,27 @@ class Permissions extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_ARRAY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Appwrite\Database\Validator;
|
|||
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Document;
|
||||
use Appwrite\Network\Validator as NetworkValidator;
|
||||
use Utopia\Validator;
|
||||
|
||||
class Structure extends Validator
|
||||
|
@ -187,16 +188,16 @@ class Structure extends Validator
|
|||
$validator = new Validator\Boolean();
|
||||
break;
|
||||
case self::RULE_TYPE_EMAIL:
|
||||
$validator = new Validator\Email();
|
||||
$validator = new NetworkValidator\Email();
|
||||
break;
|
||||
case self::RULE_TYPE_URL:
|
||||
$validator = new Validator\URL();
|
||||
$validator = new NetworkValidator\URL();
|
||||
break;
|
||||
case self::RULE_TYPE_IP:
|
||||
$validator = new Validator\IP();
|
||||
$validator = new NetworkValidator\IP();
|
||||
break;
|
||||
case self::RULE_TYPE_WILDCARD:
|
||||
$validator = new Validator\Mock();
|
||||
$validator = new Validator\Wildcard();
|
||||
break;
|
||||
case self::RULE_TYPE_DOCUMENT:
|
||||
$validator = new Collection($this->database, (isset($rule['list'])) ? $rule['list'] : []);
|
||||
|
@ -285,4 +286,28 @@ class Structure extends Validator
|
|||
{
|
||||
return $this->database->getDocument($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_OBJECT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,4 +43,28 @@ class UID extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,4 +54,28 @@ class CNAME extends Validator
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,4 +51,28 @@ class Domain extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,18 +25,6 @@ class Email extends Validator
|
|||
return 'Value must be a valid email address';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
/**
|
||||
* Is valid
|
||||
*
|
||||
|
@ -53,4 +41,28 @@ class Email extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,18 +35,6 @@ class Host extends Validator
|
|||
return 'URL host must be one of: ' . \implode(', ', $this->whitelist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
/**
|
||||
* Is valid
|
||||
*
|
||||
|
@ -69,4 +57,28 @@ class Host extends Validator
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,18 +51,6 @@ class IP extends Validator
|
|||
return 'Value must be a valid IP address';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
/**
|
||||
* Is valid
|
||||
*
|
||||
|
@ -99,4 +87,28 @@ class IP extends Validator
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,4 +119,28 @@ class Origin extends Validator
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,18 +25,6 @@ class URL extends Validator
|
|||
return 'Value must be a valid URL';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
/**
|
||||
* Is valid
|
||||
*
|
||||
|
@ -53,4 +41,28 @@ class URL extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,12 +218,12 @@ class OpenAPI3 extends Format
|
|||
$node['schema']['type'] = 'string';
|
||||
$node['schema']['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']';
|
||||
break;
|
||||
case 'Utopia\Validator\Email':
|
||||
case 'Appwrite\Network\Validator\Email':
|
||||
$node['schema']['type'] = 'string';
|
||||
$node['schema']['format'] = 'email';
|
||||
$node['schema']['x-example'] = 'email@example.com';
|
||||
break;
|
||||
case 'Utopia\Validator\URL':
|
||||
case 'Appwrite\Network\Validator\URL':
|
||||
$node['schema']['type'] = 'string';
|
||||
$node['schema']['format'] = 'url';
|
||||
$node['schema']['x-example'] = 'https://example.com';
|
||||
|
@ -264,14 +264,18 @@ class OpenAPI3 extends Format
|
|||
case 'Utopia\Validator\Length':
|
||||
$node['schema']['type'] = 'string';
|
||||
break;
|
||||
case 'Utopia\Validator\Host':
|
||||
case 'Appwrite\Network\Validator\Host':
|
||||
$node['schema']['type'] = 'string';
|
||||
$node['schema']['format'] = 'url';
|
||||
$node['schema']['x-example'] = 'https://example.com';
|
||||
break;
|
||||
case 'Utopia\Validator\WhiteList': /** @var \Utopia\Validator\WhiteList $validator */
|
||||
$node['schema']['type'] = 'string';
|
||||
$node['schema']['type'] = $validator->getType();
|
||||
$node['schema']['x-example'] = $validator->getList()[0];
|
||||
|
||||
if ($validator->getType() === 'integer') {
|
||||
$node['format'] = 'int32';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$node['schema']['type'] = 'string';
|
||||
|
|
|
@ -215,12 +215,12 @@ class Swagger2 extends Format
|
|||
$node['type'] = 'string';
|
||||
$node['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']';
|
||||
break;
|
||||
case 'Utopia\Validator\Email':
|
||||
case 'Appwrite\Network\Validator\Email':
|
||||
$node['type'] = 'string';
|
||||
$node['format'] = 'email';
|
||||
$node['x-example'] = 'email@example.com';
|
||||
break;
|
||||
case 'Utopia\Validator\URL':
|
||||
case 'Appwrite\Network\Validator\URL':
|
||||
$node['type'] = 'string';
|
||||
$node['format'] = 'url';
|
||||
$node['x-example'] = 'https://example.com';
|
||||
|
@ -261,14 +261,18 @@ class Swagger2 extends Format
|
|||
case 'Utopia\Validator\Length':
|
||||
$node['type'] = 'string';
|
||||
break;
|
||||
case 'Utopia\Validator\Host':
|
||||
case 'Appwrite\Network\Validator\Host':
|
||||
$node['type'] = 'string';
|
||||
$node['format'] = 'url';
|
||||
$node['x-example'] = 'https://example.com';
|
||||
break;
|
||||
case 'Utopia\Validator\WhiteList': /** @var \Utopia\Validator\WhiteList $validator */
|
||||
$node['type'] = 'string';
|
||||
$node['type'] = $validator->getType();
|
||||
$node['x-example'] = $validator->getList()[0];
|
||||
|
||||
if ($validator->getType() === 'integer') {
|
||||
$node['format'] = 'int32';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$node['type'] = 'string';
|
||||
|
|
|
@ -40,4 +40,28 @@ class Cron extends Validator
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is array
|
||||
*
|
||||
* Function will return true if object is array.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isArray(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* Returns validator type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return self::TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue