Merge branch 'feat-database-indexing' into feat-storage-buckets

This commit is contained in:
Damodar Lohani authored and GitHub committed 2021-12-15 15:43:14 +05:45
commit f3e6dfb71d
23 files changed
+101 -111

No files matched your search

+2 -2
View File
@@ -46,8 +46,8 @@ class V06 extends Migration
$document->setAttribute('secret', json_encode([
'data' => OpenSSL::encrypt($document->getAttribute('secret'), OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
'method' => OpenSSL::CIPHER_AES_128_GCM,
'iv' => bin2hex($iv),
'tag' => bin2hex($tag),
'iv' => \bin2hex($iv),
'tag' => \bin2hex($tag ?? ''),
'version' => '1',
]));
}
@@ -392,10 +392,7 @@ class Swagger2 extends Format
foreach ($this->models as $model) {
foreach ($model->getRules() as $rule) {
if (
in_array($model->getType(), $usedModels)
&& !in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])
) {
if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])) {
$usedModels[] = $rule['type'];
}
}
+1 -1
View File
@@ -2,8 +2,8 @@
namespace Appwrite\Template;
use Appwrite\Utopia\View;
use Exception;
use Utopia\View;
class Template extends View
{
-2
View File
@@ -34,7 +34,6 @@ use Appwrite\Utopia\Response\Model\File;
use Appwrite\Utopia\Response\Model\Bucket;
use Appwrite\Utopia\Response\Model\Func;
use Appwrite\Utopia\Response\Model\Index;
use Appwrite\Utopia\Response\Model\FuncPermissions;
use Appwrite\Utopia\Response\Model\JWT;
use Appwrite\Utopia\Response\Model\Key;
use Appwrite\Utopia\Response\Model\Language;
@@ -248,7 +247,6 @@ class Response extends SwooleResponse
->setModel(new Membership())
->setModel(new Func())
->setModel(new Runtime())
->setModel(new FuncPermissions())
->setModel(new Tag())
->setModel(new Execution())
->setModel(new Project())
+4 -4
View File
@@ -17,10 +17,10 @@ class Func extends Model
'example' => '5e5ea5c16897e',
])
->addRule('execute', [
'type' => Response::MODEL_FUNC_PERMISSIONS,
'description' => 'Function permissions.',
'default' => new \stdClass,
'example' => new \stdClass,
'type' => self::TYPE_STRING,
'description' => 'Execution permissions.',
'default' => '',
'example' => 'role:member',
'array' => false,
])
->addRule('name', [
@@ -1,42 +0,0 @@
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class FuncPermissions extends Model
{
public function __construct()
{
$this
->addRule('execute', [
'type' => self::TYPE_STRING,
'description' => 'Execution permissions.',
'default' => [],
'example' => 'user:5e5ea5c16897e',
'array' => true,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'FuncPermissions';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_FUNC_PERMISSIONS;
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Appwrite\Utopia;
use Utopia\View as OldView;
class View extends OldView
{
/**
* Escape
*
* Convert all applicable characters to HTML entities
*
* @param string $str
* @return string
* @deprecated Use print method with escape filter
*/
public function escape($str)
{
return \htmlentities($str, ENT_QUOTES, 'UTF-8');
}
}