Merge remote-tracking branch 'origin/master' into feat-graphql-support
This commit is contained in:
commit
85873c9efb
2 changed files with 10 additions and 15 deletions
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Appwrite\Extend\Exception;
|
||||||
|
use Appwrite\Network\Validator\URL;
|
||||||
use Appwrite\URL\URL as URLParse;
|
use Appwrite\URL\URL as URLParse;
|
||||||
use Appwrite\Utopia\Response;
|
use Appwrite\Utopia\Response;
|
||||||
use chillerlan\QRCode\QRCode;
|
use chillerlan\QRCode\QRCode;
|
||||||
|
@ -8,17 +10,15 @@ use Utopia\App;
|
||||||
use Utopia\Cache\Adapter\Filesystem;
|
use Utopia\Cache\Adapter\Filesystem;
|
||||||
use Utopia\Cache\Cache;
|
use Utopia\Cache\Cache;
|
||||||
use Utopia\Config\Config;
|
use Utopia\Config\Config;
|
||||||
use Appwrite\Extend\Exception;
|
use Utopia\Database\Document;
|
||||||
use Utopia\Image\Image;
|
use Utopia\Image\Image;
|
||||||
use Utopia\Validator\Boolean;
|
use Utopia\Validator\Boolean;
|
||||||
use Utopia\Validator\HexColor;
|
use Utopia\Validator\HexColor;
|
||||||
use Utopia\Validator\Range;
|
use Utopia\Validator\Range;
|
||||||
use Utopia\Validator\Text;
|
use Utopia\Validator\Text;
|
||||||
use Appwrite\Network\Validator\URL;
|
|
||||||
use Utopia\Validator\WhiteList;
|
use Utopia\Validator\WhiteList;
|
||||||
|
|
||||||
$avatarCallback = function ($type, $code, $width, $height, $quality, $response) {
|
$avatarCallback = function ($type, $code, $width, $height, $quality, Response $response) {
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
|
||||||
|
|
||||||
$code = \strtolower($code);
|
$code = \strtolower($code);
|
||||||
$type = \strtolower($type);
|
$type = \strtolower($type);
|
||||||
|
@ -148,8 +148,7 @@ App::get('/v1/avatars/image')
|
||||||
->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000.', true)
|
->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000.', true)
|
||||||
->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000.', true)
|
->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000.', true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function ($url, $width, $height, $response) {
|
->action(function ($url, $width, $height, Response $response) {
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
|
||||||
|
|
||||||
$quality = 80;
|
$quality = 80;
|
||||||
$output = 'png';
|
$output = 'png';
|
||||||
|
@ -215,8 +214,7 @@ App::get('/v1/avatars/favicon')
|
||||||
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE)
|
->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE)
|
||||||
->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.')
|
->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function ($url, $response) {
|
->action(function ($url, Response $response) {
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
|
||||||
|
|
||||||
$width = 56;
|
$width = 56;
|
||||||
$height = 56;
|
$height = 56;
|
||||||
|
@ -371,8 +369,7 @@ App::get('/v1/avatars/qr')
|
||||||
->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true)
|
->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true)
|
||||||
->param('download', false, new Boolean(true), 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true)
|
->param('download', false, new Boolean(true), 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function ($text, $size, $margin, $download, $response) {
|
->action(function ($text, $size, $margin, $download, Response $response) {
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
|
||||||
|
|
||||||
$download = ($download === '1' || $download === 'true' || $download === 1 || $download === true);
|
$download = ($download === '1' || $download === 'true' || $download === 1 || $download === true);
|
||||||
$options = new QROptions([
|
$options = new QROptions([
|
||||||
|
@ -416,9 +413,7 @@ App::get('/v1/avatars/initials')
|
||||||
->param('background', '', new HexColor(), 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true)
|
->param('background', '', new HexColor(), 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('user')
|
->inject('user')
|
||||||
->action(function ($name, $width, $height, $color, $background, $response, $user) {
|
->action(function ($name, $width, $height, $color, $background, Response $response, Document $user) {
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
|
||||||
/** @var Utopia\Database\Document $user */
|
|
||||||
|
|
||||||
$themes = [
|
$themes = [
|
||||||
['color' => '#27005e', 'background' => '#e1d2f6'], // VIOLET
|
['color' => '#27005e', 'background' => '#e1d2f6'], // VIOLET
|
||||||
|
|
|
@ -150,7 +150,7 @@ App::post('/v1/database/collections')
|
||||||
->label('sdk.response.model', Response::MODEL_COLLECTION)
|
->label('sdk.response.model', Response::MODEL_COLLECTION)
|
||||||
->param('collectionId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
->param('collectionId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||||
->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.')
|
->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.')
|
||||||
->param('permission', null, new WhiteList(['document', 'collection']), 'Permissions type model to use for reading documents in this collection. You can use collection-level permission set once on the collection using the `read` and `write` params, or you can set document-level permission where each document read and write params will decide who has access to read and write to each document individually. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.')
|
->param('permission', null, new WhiteList(['document', 'collection']), 'Specifies the permissions model used in this collection, which accepts either \'collection\' or \'document\'. For \'collection\' level permission, the permissions specified in read and write params are applied to all documents in the collection. For \'document\' level permissions, read and write permissions are specified in each document. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.')
|
||||||
->param('read', null, new Permissions(), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.')
|
->param('read', null, new Permissions(), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.')
|
||||||
->param('write', null, new Permissions(), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.')
|
->param('write', null, new Permissions(), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
|
|
Loading…
Reference in a new issue