1
0
Fork 0
mirror of synced 2024-05-21 05:02:37 +12:00

Merge branch 'master' of github.com:appwrite/appwrite into 0.7.x

This commit is contained in:
Eldad Fux 2021-03-13 00:25:11 +02:00
commit 99207d5376
7 changed files with 275 additions and 159 deletions

View file

@ -284,12 +284,12 @@ return [
[ [
'key' => 'dart', 'key' => 'dart',
'name' => 'Dart', 'name' => 'Dart',
'version' => '0.3.1', 'version' => '0.4.0',
'url' => 'https://github.com/appwrite/sdk-for-dart', 'url' => 'https://github.com/appwrite/sdk-for-dart',
'package' => 'https://pub.dev/packages/dart_appwrite', 'package' => 'https://pub.dev/packages/dart_appwrite',
'enabled' => true, 'enabled' => true,
'beta' => true, 'beta' => true,
'dev' => true, 'dev' => false,
'hidden' => false, 'hidden' => false,
'family' => APP_PLATFORM_SERVER, 'family' => APP_PLATFORM_SERVER,
'prism' => 'dart', 'prism' => 'dart',

View file

@ -255,8 +255,8 @@ App::get('/v1/account/sessions/oauth2/:provider')
->label('sdk.namespace', 'account') ->label('sdk.namespace', 'account')
->label('sdk.method', 'createOAuth2Session') ->label('sdk.method', 'createOAuth2Session')
->label('sdk.description', '/docs/references/account/create-session-oauth2.md') ->label('sdk.description', '/docs/references/account/create-session-oauth2.md')
->label('sdk.response.code', 301) ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY)
->label('sdk.response.type', 'text/html') ->label('sdk.response.type', Response::CONTENT_TYPE_HTML)
->label('sdk.methodType', 'webAuth') ->label('sdk.methodType', 'webAuth')
->label('abuse-limit', 50) ->label('abuse-limit', 50)
->label('abuse-key', 'ip:{ip}') ->label('abuse-key', 'ip:{ip}')

View file

@ -2,8 +2,9 @@
global $utopia, $request, $response; global $utopia, $request, $response;
use Appwrite\Database\Document;
use Appwrite\Utopia\Response;
use Utopia\App; use Utopia\App;
use Utopia\Response;
use Utopia\Validator\Numeric; use Utopia\Validator\Numeric;
use Utopia\Validator\Text; use Utopia\Validator\Text;
use Utopia\Validator\ArrayList; use Utopia\Validator\ArrayList;
@ -11,13 +12,16 @@ use Utopia\Validator\Host;
use Utopia\Storage\Validator\File; use Utopia\Storage\Validator\File;
App::get('/v1/mock/tests/foo') App::get('/v1/mock/tests/foo')
->desc('Mock a get request for SDK tests') ->desc('Get Foo')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'foo') ->label('sdk.namespace', 'foo')
->label('sdk.method', 'get') ->label('sdk.method', 'get')
->label('sdk.description', 'Mock a get request for SDK tests') ->label('sdk.description', 'Mock a get request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -26,13 +30,16 @@ App::get('/v1/mock/tests/foo')
}); });
App::post('/v1/mock/tests/foo') App::post('/v1/mock/tests/foo')
->desc('Mock a post request for SDK tests') ->desc('Post Foo')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'foo') ->label('sdk.namespace', 'foo')
->label('sdk.method', 'post') ->label('sdk.method', 'post')
->label('sdk.description', 'Mock a post request for SDK tests') ->label('sdk.description', 'Mock a post request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -41,13 +48,16 @@ App::post('/v1/mock/tests/foo')
}); });
App::patch('/v1/mock/tests/foo') App::patch('/v1/mock/tests/foo')
->desc('Mock a patch request for SDK tests') ->desc('Patch Foo')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'foo') ->label('sdk.namespace', 'foo')
->label('sdk.method', 'patch') ->label('sdk.method', 'patch')
->label('sdk.description', 'Mock a get request for SDK tests') ->label('sdk.description', 'Mock a patch request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -56,13 +66,16 @@ App::patch('/v1/mock/tests/foo')
}); });
App::put('/v1/mock/tests/foo') App::put('/v1/mock/tests/foo')
->desc('Mock a put request for SDK tests') ->desc('Put Foo')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'foo') ->label('sdk.namespace', 'foo')
->label('sdk.method', 'put') ->label('sdk.method', 'put')
->label('sdk.description', 'Mock a put request for SDK tests') ->label('sdk.description', 'Mock a put request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -71,13 +84,16 @@ App::put('/v1/mock/tests/foo')
}); });
App::delete('/v1/mock/tests/foo') App::delete('/v1/mock/tests/foo')
->desc('Mock a delete request for SDK tests') ->desc('Delete Foo')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'foo') ->label('sdk.namespace', 'foo')
->label('sdk.method', 'delete') ->label('sdk.method', 'delete')
->label('sdk.description', 'Mock a delete request for SDK tests') ->label('sdk.description', 'Mock a delete request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -86,13 +102,16 @@ App::delete('/v1/mock/tests/foo')
}); });
App::get('/v1/mock/tests/bar') App::get('/v1/mock/tests/bar')
->desc('Mock a get request for SDK tests') ->desc('Get Bar')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'bar') ->label('sdk.namespace', 'bar')
->label('sdk.method', 'get') ->label('sdk.method', 'get')
->label('sdk.description', 'Mock a get request for SDK tests') ->label('sdk.description', 'Mock a get request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -101,13 +120,16 @@ App::get('/v1/mock/tests/bar')
}); });
App::post('/v1/mock/tests/bar') App::post('/v1/mock/tests/bar')
->desc('Mock a post request for SDK tests') ->desc('Post Bar')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'bar') ->label('sdk.namespace', 'bar')
->label('sdk.method', 'post') ->label('sdk.method', 'post')
->label('sdk.description', 'Mock a post request for SDK tests') ->label('sdk.description', 'Mock a post request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -116,13 +138,16 @@ App::post('/v1/mock/tests/bar')
}); });
App::patch('/v1/mock/tests/bar') App::patch('/v1/mock/tests/bar')
->desc('Mock a patch request for SDK tests') ->desc('Patch Bar')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'bar') ->label('sdk.namespace', 'bar')
->label('sdk.method', 'patch') ->label('sdk.method', 'patch')
->label('sdk.description', 'Mock a get request for SDK tests') ->label('sdk.description', 'Mock a patch request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -131,13 +156,16 @@ App::patch('/v1/mock/tests/bar')
}); });
App::put('/v1/mock/tests/bar') App::put('/v1/mock/tests/bar')
->desc('Mock a put request for SDK tests') ->desc('Put Bar')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'bar') ->label('sdk.namespace', 'bar')
->label('sdk.method', 'put') ->label('sdk.method', 'put')
->label('sdk.description', 'Mock a put request for SDK tests') ->label('sdk.description', 'Mock a put request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -146,13 +174,16 @@ App::put('/v1/mock/tests/bar')
}); });
App::delete('/v1/mock/tests/bar') App::delete('/v1/mock/tests/bar')
->desc('Mock a delete request for SDK tests') ->desc('Delete Bar')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'bar') ->label('sdk.namespace', 'bar')
->label('sdk.method', 'delete') ->label('sdk.method', 'delete')
->label('sdk.description', 'Mock a delete request for SDK tests') ->label('sdk.description', 'Mock a delete request.')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -161,14 +192,17 @@ App::delete('/v1/mock/tests/bar')
}); });
App::post('/v1/mock/tests/general/upload') App::post('/v1/mock/tests/general/upload')
->desc('Mock a post request for SDK tests') ->desc('Upload File')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general') ->label('sdk.namespace', 'general')
->label('sdk.method', 'upload') ->label('sdk.method', 'upload')
->label('sdk.description', 'Mock a delete request for SDK tests') ->label('sdk.description', 'Mock a file upload request.')
->label('sdk.request.type', 'multipart/form-data') ->label('sdk.request.type', 'multipart/form-data')
->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.mock', true) ->label('sdk.mock', true)
->param('x', '', new Text(100), 'Sample string param') ->param('x', '', new Text(100), 'Sample string param')
->param('y', '', new Numeric(), 'Sample numeric param') ->param('y', '', new Numeric(), 'Sample numeric param')
@ -203,13 +237,15 @@ App::post('/v1/mock/tests/general/upload')
}); });
App::get('/v1/mock/tests/general/redirect') App::get('/v1/mock/tests/general/redirect')
->desc('Mock a post request for SDK tests') ->desc('Redirect')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general') ->label('sdk.namespace', 'general')
->label('sdk.method', 'redirect') ->label('sdk.method', 'redirect')
->label('sdk.description', 'Mock a redirect request for SDK tests') ->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.mock', true) ->label('sdk.mock', true)
->inject('response') ->inject('response')
->action(function ($response) { ->action(function ($response) {
@ -219,25 +255,31 @@ App::get('/v1/mock/tests/general/redirect')
}); });
App::get('/v1/mock/tests/general/redirect/done') App::get('/v1/mock/tests/general/redirect/done')
->desc('Mock a post request for SDK tests') ->desc('Redirected')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general') ->label('sdk.namespace', 'general')
->label('sdk.method', 'redirected') ->label('sdk.method', 'redirected')
->label('sdk.description', 'Mock a redirected request for SDK tests') ->label('sdk.description', 'Mock a redirected request.')
->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.mock', true) ->label('sdk.mock', true)
->action(function () { ->action(function () {
}); });
App::get('/v1/mock/tests/general/set-cookie') App::get('/v1/mock/tests/general/set-cookie')
->desc('Mock a cookie request for SDK tests') ->desc('Set Cookie')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general') ->label('sdk.namespace', 'general')
->label('sdk.method', 'setCookie') ->label('sdk.method', 'setCookie')
->label('sdk.description', 'Mock a set cookie request for SDK tests') ->label('sdk.description', 'Mock a set cookie request.')
->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.mock', true) ->label('sdk.mock', true)
->inject('response') ->inject('response')
->action(function ($response) { ->action(function ($response) {
@ -247,13 +289,16 @@ App::get('/v1/mock/tests/general/set-cookie')
}); });
App::get('/v1/mock/tests/general/get-cookie') App::get('/v1/mock/tests/general/get-cookie')
->desc('Mock a cookie request for SDK tests') ->desc('Get Cookie')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general') ->label('sdk.namespace', 'general')
->label('sdk.method', 'getCookie') ->label('sdk.method', 'getCookie')
->label('sdk.description', 'Mock a get cookie request for SDK tests') ->label('sdk.description', 'Mock a cookie response.')
->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.mock', true) ->label('sdk.mock', true)
->inject('request') ->inject('request')
->action(function ($request) { ->action(function ($request) {
@ -265,13 +310,15 @@ App::get('/v1/mock/tests/general/get-cookie')
}); });
App::get('/v1/mock/tests/general/empty') App::get('/v1/mock/tests/general/empty')
->desc('Mock a post request for SDK tests') ->desc('Empty Response')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER]) ->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general') ->label('sdk.namespace', 'general')
->label('sdk.method', 'empty') ->label('sdk.method', 'empty')
->label('sdk.description', 'Mock a redirected request for SDK tests') ->label('sdk.description', 'Mock a an empty response.')
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
->label('sdk.response.model', Response::MODEL_NONE)
->label('sdk.mock', true) ->label('sdk.mock', true)
->inject('response') ->inject('response')
->action(function ($response) { ->action(function ($response) {
@ -280,8 +327,40 @@ App::get('/v1/mock/tests/general/empty')
$response->noContent(); $response->noContent();
}); });
App::get('/v1/mock/tests/general/400-error')
->desc('400 Error')
->groups(['mock'])
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general')
->label('sdk.method', 'error400')
->label('sdk.description', 'Mock a an 400 failed request.')
->label('sdk.response.code', Response::STATUS_CODE_BAD_REQUEST)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ERROR)
->label('sdk.mock', true)
->action(function () {
throw new Exception('Mock 400 error', 400);
});
App::get('/v1/mock/tests/general/500-error')
->desc('500 Error')
->groups(['mock'])
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'general')
->label('sdk.method', 'error500')
->label('sdk.description', 'Mock a an 500 failed request.')
->label('sdk.response.code', Response::STATUS_CODE_INTERNAL_SERVER_ERROR)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ERROR)
->label('sdk.mock', true)
->action(function () {
throw new Exception('Mock 500 error', 500);
});
App::get('/v1/mock/tests/general/oauth2') App::get('/v1/mock/tests/general/oauth2')
->desc('Mock an OAuth2 login route') ->desc('OAuth Login')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('docs', false) ->label('docs', false)
@ -298,7 +377,7 @@ App::get('/v1/mock/tests/general/oauth2')
}); });
App::get('/v1/mock/tests/general/oauth2/token') App::get('/v1/mock/tests/general/oauth2/token')
->desc('Mock an OAuth2 login route') ->desc('OAuth2 Token')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('docs', false) ->label('docs', false)
@ -327,7 +406,7 @@ App::get('/v1/mock/tests/general/oauth2/token')
}); });
App::get('/v1/mock/tests/general/oauth2/user') App::get('/v1/mock/tests/general/oauth2/user')
->desc('Mock an OAuth2 user route') ->desc('OAuth2 User')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('docs', false) ->label('docs', false)
@ -348,8 +427,9 @@ App::get('/v1/mock/tests/general/oauth2/user')
}); });
App::get('/v1/mock/tests/general/oauth2/success') App::get('/v1/mock/tests/general/oauth2/success')
->label('scope', 'public') ->desc('OAuth2 Success')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public')
->label('docs', false) ->label('docs', false)
->inject('response') ->inject('response')
->action(function ($response) { ->action(function ($response) {
@ -361,6 +441,7 @@ App::get('/v1/mock/tests/general/oauth2/success')
}); });
App::get('/v1/mock/tests/general/oauth2/failure') App::get('/v1/mock/tests/general/oauth2/failure')
->desc('OAuth2 Failure')
->groups(['mock']) ->groups(['mock'])
->label('scope', 'public') ->label('scope', 'public')
->label('docs', false) ->label('docs', false)
@ -397,5 +478,5 @@ App::shutdown(function($utopia, $response, $request) {
throw new Exception('Failed to save resutls', 500); throw new Exception('Failed to save resutls', 500);
} }
$response->json(['result' => $route->getMethod() . ':' . $route->getURL() . ':passed']); $response->dynamic(new Document(['result' => $route->getMethod() . ':' . $route->getURL() . ':passed']), Response::MODEL_MOCK);
}, ['utopia', 'response', 'request'], 'mock'); }, ['utopia', 'response', 'request'], 'mock');

View file

@ -60,7 +60,7 @@
"slickdeals/statsd": "~3.0" "slickdeals/statsd": "~3.0"
}, },
"require-dev": { "require-dev": {
"appwrite/sdk-generator": "0.6.2", "appwrite/sdk-generator": "0.6.3",
"phpunit/phpunit": "9.4.2", "phpunit/phpunit": "9.4.2",
"swoole/ide-helper": "4.5.5", "swoole/ide-helper": "4.5.5",
"vimeo/psalm": "4.1.1" "vimeo/psalm": "4.1.1"

220
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "442d6d8b6c76ef7ae5ea26e500af6479", "content-hash": "3463ecea7830f29a67317097ad2aeb66",
"packages": [ "packages": [
{ {
"name": "adhocore/jwt", "name": "adhocore/jwt",
@ -466,12 +466,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "ddfeedfff2a52661429437da0702979f708e6ac6" "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/ddfeedfff2a52661429437da0702979f708e6ac6", "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"reference": "ddfeedfff2a52661429437da0702979f708e6ac6", "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -512,9 +512,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/master" "source": "https://github.com/guzzle/promises/tree/1.4.1"
}, },
"time": "2020-10-19T16:50:15+00:00" "time": "2021-03-07T09:25:29+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
@ -522,12 +522,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "2f3e4f6cf8fd4aad7624c90a94f0ab38fde25976" "reference": "d7fe0a0eabc266c3dcf2f20aa12121044ff196a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/2f3e4f6cf8fd4aad7624c90a94f0ab38fde25976", "url": "https://api.github.com/repos/guzzle/psr7/zipball/d7fe0a0eabc266c3dcf2f20aa12121044ff196a4",
"reference": "2f3e4f6cf8fd4aad7624c90a94f0ab38fde25976", "reference": "d7fe0a0eabc266c3dcf2f20aa12121044ff196a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -589,7 +589,7 @@
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.x" "source": "https://github.com/guzzle/psr7/tree/1.x"
}, },
"time": "2021-03-02T18:57:24+00:00" "time": "2021-03-09T14:42:40+00:00"
}, },
{ {
"name": "influxdb/influxdb-php", "name": "influxdb/influxdb-php",
@ -2063,20 +2063,20 @@
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "dev-master", "version": "1.9.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozarts/assert.git", "url": "https://github.com/webmozarts/assert.git",
"reference": "4631e2c7d2d7132adac9fd84d4c1a98c10a6e049" "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/4631e2c7d2d7132adac9fd84d4c1a98c10a6e049", "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
"reference": "4631e2c7d2d7132adac9fd84d4c1a98c10a6e049", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2 || ^8.0", "php": "^5.3.3 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.8" "symfony/polyfill-ctype": "^1.8"
}, },
"conflict": { "conflict": {
@ -2084,15 +2084,9 @@
"vimeo/psalm": "<3.9.1" "vimeo/psalm": "<3.9.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^8.5.13" "phpunit/phpunit": "^4.8.36 || ^7.5.13"
}, },
"default-branch": true,
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.10-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Webmozart\\Assert\\": "src/" "Webmozart\\Assert\\": "src/"
@ -2116,9 +2110,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/webmozarts/assert/issues", "issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/master" "source": "https://github.com/webmozarts/assert/tree/1.9.1"
}, },
"time": "2021-02-28T20:01:57+00:00" "time": "2020-07-08T17:02:28+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -2292,11 +2286,11 @@
}, },
{ {
"name": "appwrite/sdk-generator", "name": "appwrite/sdk-generator",
"version": "0.6.2", "version": "0.6.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/appwrite/sdk-generator", "url": "https://github.com/appwrite/sdk-generator",
"reference": "d96376295c9265a054634d21dcdbfc02b832c677" "reference": "583248c57c5bcbd9c74f8312cc7fc3ab6cda51a3"
}, },
"require": { "require": {
"ext-curl": "*", "ext-curl": "*",
@ -2326,7 +2320,7 @@
} }
], ],
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"time": "2021-03-03T12:53:32+00:00" "time": "2021-03-07T08:45:05+00:00"
}, },
{ {
"name": "composer/package-versions-deprecated", "name": "composer/package-versions-deprecated",
@ -3277,12 +3271,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "e3324ecbde7319b0bbcf0fd7ca4af19469c38da9" "reference": "f8d350d8514ff60b5993dd0121c62299480c989c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e3324ecbde7319b0bbcf0fd7ca4af19469c38da9", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f8d350d8514ff60b5993dd0121c62299480c989c",
"reference": "e3324ecbde7319b0bbcf0fd7ca4af19469c38da9", "reference": "f8d350d8514ff60b5993dd0121c62299480c989c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3326,7 +3320,7 @@
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
}, },
"time": "2020-11-18T14:27:38+00:00" "time": "2021-03-07T11:12:25+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
@ -3528,12 +3522,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "dae425925709122f7584cadeeb838edcaa491bb1" "reference": "be176a771658571c68e432ef2b92766323500396"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/dae425925709122f7584cadeeb838edcaa491bb1", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/be176a771658571c68e432ef2b92766323500396",
"reference": "dae425925709122f7584cadeeb838edcaa491bb1", "reference": "be176a771658571c68e432ef2b92766323500396",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3581,7 +3575,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:43+00:00" "time": "2021-03-12T06:35:26+00:00"
}, },
{ {
"name": "phpunit/php-invoker", "name": "phpunit/php-invoker",
@ -3589,12 +3583,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git", "url": "https://github.com/sebastianbergmann/php-invoker.git",
"reference": "5ad9e5f5d6ee1a837e1d50bab1017e0daf423b40" "reference": "7d0466dfe8d95401153dbd342a68d2dc5f97aa65"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5ad9e5f5d6ee1a837e1d50bab1017e0daf423b40", "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7d0466dfe8d95401153dbd342a68d2dc5f97aa65",
"reference": "5ad9e5f5d6ee1a837e1d50bab1017e0daf423b40", "reference": "7d0466dfe8d95401153dbd342a68d2dc5f97aa65",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3645,7 +3639,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:51+00:00" "time": "2021-03-12T06:35:32+00:00"
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
@ -3653,12 +3647,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git", "url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "4ec5a2ac79a19b35d0cf83cce30604f77743067a" "reference": "937d542664c42822dc8da4c41b096b44926b35ef"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/4ec5a2ac79a19b35d0cf83cce30604f77743067a", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/937d542664c42822dc8da4c41b096b44926b35ef",
"reference": "4ec5a2ac79a19b35d0cf83cce30604f77743067a", "reference": "937d542664c42822dc8da4c41b096b44926b35ef",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3705,7 +3699,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:49:24+00:00" "time": "2021-03-12T06:35:57+00:00"
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
@ -3713,12 +3707,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git", "url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "705821b0927b5e69e9e016c84de68dc6195c71b9" "reference": "c2e5a4f63ab592d38a758be6b8655f12b8ab0e94"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/705821b0927b5e69e9e016c84de68dc6195c71b9", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c2e5a4f63ab592d38a758be6b8655f12b8ab0e94",
"reference": "705821b0927b5e69e9e016c84de68dc6195c71b9", "reference": "c2e5a4f63ab592d38a758be6b8655f12b8ab0e94",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3765,7 +3759,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:59+00:00" "time": "2021-03-12T06:35:39+00:00"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
@ -3872,28 +3866,22 @@
}, },
{ {
"name": "psr/container", "name": "psr/container",
"version": "dev-master", "version": "1.1.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/container.git", "url": "https://github.com/php-fig/container.git",
"reference": "381524e8568e07f31d504a945b88556548c8c42e" "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/381524e8568e07f31d504a945b88556548c8c42e", "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
"reference": "381524e8568e07f31d504a945b88556548c8c42e", "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.0" "php": ">=7.2.0"
}, },
"default-branch": true,
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Psr\\Container\\": "src/" "Psr\\Container\\": "src/"
@ -3920,9 +3908,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-fig/container/issues", "issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/master" "source": "https://github.com/php-fig/container/tree/1.1.x"
}, },
"time": "2020-10-13T07:07:53+00:00" "time": "2021-03-05T17:36:06+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -3930,12 +3918,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git", "url": "https://github.com/sebastianbergmann/cli-parser.git",
"reference": "3a42d843af4d27ca1155e1d926881af162733655" "reference": "dd99fa1f5e462d834febfd531068e79b94f63826"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/3a42d843af4d27ca1155e1d926881af162733655", "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/dd99fa1f5e462d834febfd531068e79b94f63826",
"reference": "3a42d843af4d27ca1155e1d926881af162733655", "reference": "dd99fa1f5e462d834febfd531068e79b94f63826",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3979,7 +3967,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:49:50+00:00" "time": "2021-03-12T06:36:17+00:00"
}, },
{ {
"name": "sebastian/code-unit", "name": "sebastian/code-unit",
@ -4043,12 +4031,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "5f5db0b35f586eb5bca0581a10bb42dd56575986" "reference": "2e341ac378f28444e8d5a9b1ca878f3e10d095c5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5f5db0b35f586eb5bca0581a10bb42dd56575986", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/2e341ac378f28444e8d5a9b1ca878f3e10d095c5",
"reference": "5f5db0b35f586eb5bca0581a10bb42dd56575986", "reference": "2e341ac378f28444e8d5a9b1ca878f3e10d095c5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4091,7 +4079,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:47:39+00:00" "time": "2021-03-12T06:34:30+00:00"
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
@ -4099,12 +4087,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "dbc5fb421f242a5749845dc8dd0dc8cde2979dd9" "reference": "da86fed339815cda8c93d24184902837e46f3dcf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dbc5fb421f242a5749845dc8dd0dc8cde2979dd9", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/da86fed339815cda8c93d24184902837e46f3dcf",
"reference": "dbc5fb421f242a5749845dc8dd0dc8cde2979dd9", "reference": "da86fed339815cda8c93d24184902837e46f3dcf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4166,7 +4154,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:47:47+00:00" "time": "2021-03-12T06:34:37+00:00"
}, },
{ {
"name": "sebastian/complexity", "name": "sebastian/complexity",
@ -4231,12 +4219,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "93e6aa13f3dc5f8327e7fb9756e9655fc4c23e90" "reference": "d6a6f22f17c5a6c7454eedc4d202aad1bcd69f97"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/93e6aa13f3dc5f8327e7fb9756e9655fc4c23e90", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/d6a6f22f17c5a6c7454eedc4d202aad1bcd69f97",
"reference": "93e6aa13f3dc5f8327e7fb9756e9655fc4c23e90", "reference": "d6a6f22f17c5a6c7454eedc4d202aad1bcd69f97",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4290,7 +4278,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:47:55+00:00" "time": "2021-03-12T06:34:45+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
@ -4298,12 +4286,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "6e1743b808be9cfd33a716583ccb94b7d4d32e94" "reference": "2b55055f427dd8c7274b87f8fcebeca063553827"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e1743b808be9cfd33a716583ccb94b7d4d32e94", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2b55055f427dd8c7274b87f8fcebeca063553827",
"reference": "6e1743b808be9cfd33a716583ccb94b7d4d32e94", "reference": "2b55055f427dd8c7274b87f8fcebeca063553827",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4354,7 +4342,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:03+00:00" "time": "2021-03-12T06:34:52+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
@ -4362,12 +4350,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git", "url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "eca7281ab29075df68b113a37a83be616b629b12" "reference": "eac28a6ba06c1d2f4592caab3ecb5a573719dead"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/eca7281ab29075df68b113a37a83be616b629b12", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/eac28a6ba06c1d2f4592caab3ecb5a573719dead",
"reference": "eca7281ab29075df68b113a37a83be616b629b12", "reference": "eac28a6ba06c1d2f4592caab3ecb5a573719dead",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4432,7 +4420,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:12+00:00" "time": "2021-03-12T06:34:58+00:00"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
@ -4440,12 +4428,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git", "url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "0ac702e6d13725242edb9b294c5d20b92fcfb8b4" "reference": "fdc815035b99d311787aaddee356bcdbfdacd264"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ac702e6d13725242edb9b294c5d20b92fcfb8b4", "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/fdc815035b99d311787aaddee356bcdbfdacd264",
"reference": "0ac702e6d13725242edb9b294c5d20b92fcfb8b4", "reference": "fdc815035b99d311787aaddee356bcdbfdacd264",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4497,7 +4485,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:19+00:00" "time": "2021-03-12T06:35:06+00:00"
}, },
{ {
"name": "sebastian/lines-of-code", "name": "sebastian/lines-of-code",
@ -4562,12 +4550,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git", "url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "8cc80b4bda00a4c5997c3fc597a34872f3a1007d" "reference": "cc061578620fe00922c20aa0f563cc48c7260867"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/8cc80b4bda00a4c5997c3fc597a34872f3a1007d", "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/cc061578620fe00922c20aa0f563cc48c7260867",
"reference": "8cc80b4bda00a4c5997c3fc597a34872f3a1007d", "reference": "cc061578620fe00922c20aa0f563cc48c7260867",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4612,7 +4600,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:28+00:00" "time": "2021-03-12T06:35:13+00:00"
}, },
{ {
"name": "sebastian/object-reflector", "name": "sebastian/object-reflector",
@ -4620,12 +4608,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git", "url": "https://github.com/sebastianbergmann/object-reflector.git",
"reference": "1d33587c2c3e636936f895e103a9e82dd8102a8e" "reference": "c792bcd052c3290774390afd13c19bb3a96b94e6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d33587c2c3e636936f895e103a9e82dd8102a8e", "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/c792bcd052c3290774390afd13c19bb3a96b94e6",
"reference": "1d33587c2c3e636936f895e103a9e82dd8102a8e", "reference": "c792bcd052c3290774390afd13c19bb3a96b94e6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4668,7 +4656,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:48:35+00:00" "time": "2021-03-12T06:35:20+00:00"
}, },
{ {
"name": "sebastian/recursion-context", "name": "sebastian/recursion-context",
@ -4676,12 +4664,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git", "url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "43f58a51e8f853aadb228ba818d2be388af7237b" "reference": "c07d99ada2b8e6e5ade4c2522af54b0f3c796387"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/43f58a51e8f853aadb228ba818d2be388af7237b", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c07d99ada2b8e6e5ade4c2522af54b0f3c796387",
"reference": "43f58a51e8f853aadb228ba818d2be388af7237b", "reference": "c07d99ada2b8e6e5ade4c2522af54b0f3c796387",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4732,7 +4720,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:49:08+00:00" "time": "2021-03-12T06:35:45+00:00"
}, },
{ {
"name": "sebastian/resource-operations", "name": "sebastian/resource-operations",
@ -4796,12 +4784,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/type.git", "url": "https://github.com/sebastianbergmann/type.git",
"reference": "557863473c1de00e165a288d5b547f1f83652e7e" "reference": "3bbff26dad4e0aadda7d8a0b598b903fbef6c3e6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/557863473c1de00e165a288d5b547f1f83652e7e", "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3bbff26dad4e0aadda7d8a0b598b903fbef6c3e6",
"reference": "557863473c1de00e165a288d5b547f1f83652e7e", "reference": "3bbff26dad4e0aadda7d8a0b598b903fbef6c3e6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4845,7 +4833,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-02-23T15:49:16+00:00" "time": "2021-03-12T06:35:51+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",
@ -4944,12 +4932,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "c08d7d0d458eceb62996d81d3be8d9fbf5564ec4" "reference": "e8bee16c337d9553fb737adf79d6aabe330fd982"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/c08d7d0d458eceb62996d81d3be8d9fbf5564ec4", "url": "https://api.github.com/repos/symfony/console/zipball/e8bee16c337d9553fb737adf79d6aabe330fd982",
"reference": "c08d7d0d458eceb62996d81d3be8d9fbf5564ec4", "reference": "e8bee16c337d9553fb737adf79d6aabe330fd982",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5034,7 +5022,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-23T10:10:15+00:00" "time": "2021-03-12T08:40:58+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-grapheme", "name": "symfony/polyfill-intl-grapheme",
@ -5454,17 +5442,17 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "e830e6ceebd6377b019e4c9a523d6f2c27007e4a" "reference": "96cd360b9f03a22a30cf5354e630c557bd3aac33"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/e830e6ceebd6377b019e4c9a523d6f2c27007e4a", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/96cd360b9f03a22a30cf5354e630c557bd3aac33",
"reference": "e830e6ceebd6377b019e4c9a523d6f2c27007e4a", "reference": "96cd360b9f03a22a30cf5354e630c557bd3aac33",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=7.2.5",
"psr/container": "^1.0" "psr/container": "^1.1"
}, },
"suggest": { "suggest": {
"symfony/service-implementation": "" "symfony/service-implementation": ""
@ -5526,7 +5514,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-25T16:38:04+00:00" "time": "2021-03-05T22:51:52+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
@ -5668,12 +5656,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "728c611e8643a5dd44839ffa791e21763b04a694" "reference": "37e48403c21e06f63bc27d7ccd997fbb72b0ae2a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/728c611e8643a5dd44839ffa791e21763b04a694", "url": "https://api.github.com/repos/twigphp/Twig/zipball/37e48403c21e06f63bc27d7ccd997fbb72b0ae2a",
"reference": "728c611e8643a5dd44839ffa791e21763b04a694", "reference": "37e48403c21e06f63bc27d7ccd997fbb72b0ae2a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5739,7 +5727,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-02-22T11:56:05+00:00" "time": "2021-03-10T10:07:14+00:00"
}, },
{ {
"name": "vimeo/psalm", "name": "vimeo/psalm",

View file

@ -39,6 +39,7 @@ use Appwrite\Utopia\Response\Model\Tag;
use Appwrite\Utopia\Response\Model\Task; use Appwrite\Utopia\Response\Model\Task;
use Appwrite\Utopia\Response\Model\Token; use Appwrite\Utopia\Response\Model\Token;
use Appwrite\Utopia\Response\Model\Webhook; use Appwrite\Utopia\Response\Model\Webhook;
use Appwrite\Utopia\Response\Model\Mock; // Keep last
use stdClass; use stdClass;
/** /**
@ -115,6 +116,9 @@ class Response extends SwooleResponse
const MODEL_PLATFORM_LIST = 'platformList'; const MODEL_PLATFORM_LIST = 'platformList';
const MODEL_DOMAIN = 'domain'; const MODEL_DOMAIN = 'domain';
const MODEL_DOMAIN_LIST = 'domainList'; const MODEL_DOMAIN_LIST = 'domainList';
// Tests (keep last)
const MODEL_MOCK = 'mock';
/** /**
* @var Filter * @var Filter
@ -191,6 +195,8 @@ class Response extends SwooleResponse
->setModel(new Phone()) ->setModel(new Phone())
// Verification // Verification
// Recovery // Recovery
// Tests (keep last)
->setModel(new Mock())
; ;
parent::__construct($response); parent::__construct($response);

View file

@ -0,0 +1,41 @@
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Mock extends Model
{
public function __construct()
{
$this
->addRule('result', [
'type' => self::TYPE_STRING,
'description' => 'Result message.',
'default' => '',
'example' => 'Success',
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'Mock';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_MOCK;
}
}