1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

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

This commit is contained in:
Damodar Lohani 2021-12-15 15:43:14 +05:45 committed by GitHub
commit f3e6dfb71d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 101 additions and 111 deletions

View file

@ -4,7 +4,7 @@ We would ❤️ for you to contribute to Appwrite and help make it better! We wa
## How to Start?
If you are worried or dont know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite_io](https://twitter.com/appwrite_io) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you!
If you are worried or dont know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite](https://twitter.com/appwrite) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you!
## Code of Conduct
@ -406,7 +406,7 @@ Pull requests are great, but there are many other areas where you can help Appwr
### Blogging & Speaking
Blogging, speaking about, or creating tutorials about one of Appwrites many features. Mention [@appwrite_io](https://twitter.com/appwrite_io) on Twitter and/or [email team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub.
Blogging, speaking about, or creating tutorials about one of Appwrites many features. Mention [@appwrite](https://twitter.com/appwrite) on Twitter and/or [email team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub.
### Presenting at Meetups

View file

@ -9,10 +9,10 @@
</p>
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
@ -155,7 +155,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a
## Follow Us
Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite_io), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) , [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) , [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
## License

View file

@ -1045,7 +1045,7 @@ App::post('/v1/database/collections/:collectionId/attributes/float')
->inject('database')
->inject('audits')
->inject('usage')
->action(function ($collectionId, $attributeId, $required, $min, $max, $default, $array, $response, $dbForInternal, $dbForExternal,$database, $audits, $usage) {
->action(function ($collectionId, $attributeId, $required, $min, $max, $default, $array, $response, $dbForInternal, $dbForExternal, $database, $audits, $usage) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForInternal*/
/** @var Utopia\Database\Database $dbForExternal*/
@ -1060,6 +1060,11 @@ App::post('/v1/database/collections/:collectionId/attributes/float')
if ($min > $max) {
throw new Exception('Minimum value must be lesser than maximum value', 400);
}
// Ensure default value is a float
if (!is_null($default)) {
$default = \floatval($default);
}
$validator = new Range($min, $max, Database::VAR_FLOAT);

View file

@ -628,6 +628,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
if($bucket->getAttribute('encryption', true) && $size <= APP_LIMIT_ENCRYPTION) {
$key = App::getEnv('_APP_OPENSSL_KEY_V1');
$iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
$tag = null;
$data = OpenSSL::encrypt($data, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag);
}
@ -651,6 +652,10 @@ App::post('/v1/storage/buckets/:bucketId/files')
'sizeActual' => $sizeActual,
'algorithm' => empty($compressor) ? '' : $compressor->getName(),
'comment' => '',
'openSSLVersion' => '1',
'openSSLCipher' => OpenSSL::CIPHER_AES_128_GCM,
'openSSLTag' => \bin2hex($tag ?? ''),
'openSSLIV' => \bin2hex($iv),
'search' => implode(' ', [$fileId, $file['name'] ?? '',]),
];

View file

@ -695,7 +695,7 @@ App::delete('/v1/users/:userId/sessions')
$dbForInternal->deleteDocument('sessions', $session->getId());
}
$dbForInternal->updateDocument('users', $user->getId(), $user->getAttribute('sessions', []));
$dbForInternal->updateDocument('users', $user->getId(), $user->setAttribute('sessions', []));
$events
->setParam('eventData', $response->output($user, Response::MODEL_USER))

View file

@ -5,7 +5,7 @@ require_once __DIR__.'/../init.php';
use Utopia\App;
use Utopia\Swoole\Request;
use Appwrite\Utopia\Response;
use Utopia\View;
use Appwrite\Utopia\View;
use Utopia\Exception;
use Utopia\Config\Config;
use Utopia\Domains\Domain;
@ -298,7 +298,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) {
/** @var Utopia\App $utopia */
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
/** @var Utopia\Database\Document $project */
if ($error instanceof PDOException) {

View file

@ -7,7 +7,7 @@ App::init(function ($utopia, $request, $response, $layout) {
/** @var Utopia\App $utopia */
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
/* AJAX check */
if (!empty($request->getQuery('version', ''))) {

View file

@ -1,14 +1,14 @@
<?php
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\View;
use Utopia\Config\Config;
use Utopia\Domains\Domain;
use Utopia\Database\Validator\UID;
use Utopia\Storage\Storage;
App::init(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$layout
->setParam('description', 'Appwrite Console allows you to easily manage, monitor, and control your entire backend API and tools.')
@ -18,7 +18,7 @@ App::init(function ($layout) {
App::shutdown(function ($response, $layout) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$header = new View(__DIR__.'/../../views/console/comps/header.phtml');
$footer = new View(__DIR__.'/../../views/console/comps/footer.phtml');
@ -43,7 +43,7 @@ App::get('/error/:code')
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
->inject('layout')
->action(function ($code, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/error.phtml');
@ -62,7 +62,7 @@ App::get('/console')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/index.phtml');
@ -81,7 +81,7 @@ App::get('/console/account')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/account/index.phtml');
@ -102,7 +102,7 @@ App::get('/console/notifications')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/v1/console/notifications/index.phtml');
@ -117,7 +117,7 @@ App::get('/console/home')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/home/index.phtml');
$page
@ -133,7 +133,7 @@ App::get('/console/settings')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', ''));
@ -157,7 +157,7 @@ App::get('/console/webhooks')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/webhooks/index.phtml');
@ -176,7 +176,7 @@ App::get('/console/keys')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$scopes = array_keys(Config::getParam('scopes'));
$page = new View(__DIR__.'/../../views/console/keys/index.phtml');
@ -194,7 +194,7 @@ App::get('/console/database')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/database/index.phtml');
@ -212,7 +212,7 @@ App::get('/console/database/collection')
->inject('layout')
->action(function ($id, $response, $layout) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$logs = new View(__DIR__.'/../../views/console/comps/logs.phtml');
@ -247,7 +247,7 @@ App::get('/console/database/document')
->param('collection', '', new UID(), 'Collection unique ID.')
->inject('layout')
->action(function ($collection, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$logs = new View(__DIR__.'/../../views/console/comps/logs.phtml');
@ -280,7 +280,7 @@ App::get('/console/database/document/new')
->param('collection', '', new UID(), 'Collection unique ID.')
->inject('layout')
->action(function ($collection, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/database/document.phtml');
@ -301,7 +301,7 @@ App::get('/console/storage')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/storage/index.phtml');
$page
@ -351,7 +351,7 @@ App::get('/console/users')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/users/index.phtml');
@ -372,7 +372,7 @@ App::get('/console/users/user')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/users/user.phtml');
@ -387,7 +387,7 @@ App::get('/console/users/teams/team')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/users/team.phtml');

View file

@ -3,15 +3,15 @@
use Appwrite\Specification\Format\OpenAPI3;
use Appwrite\Specification\Format\Swagger2;
use Appwrite\Specification\Specification;
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\View;
use Utopia\Config\Config;
use Utopia\Exception;
use Utopia\Validator\Range;
use Utopia\Validator\WhiteList;
App::init(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$header = new View(__DIR__.'/../../views/home/comps/header.phtml');
$footer = new View(__DIR__.'/../../views/home/comps/footer.phtml');
@ -32,7 +32,7 @@ App::init(function ($layout) {
App::shutdown(function ($response, $layout) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$response->html($layout->render());
}, ['response', 'layout'], 'home');
@ -76,7 +76,7 @@ App::get('/auth/signin')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/signin.phtml');
@ -95,7 +95,7 @@ App::get('/auth/signup')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/signup.phtml');
$page
@ -113,7 +113,7 @@ App::get('/auth/recovery')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/recovery.phtml');
@ -132,7 +132,7 @@ App::get('/auth/confirm')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/confirm.phtml');
@ -147,7 +147,7 @@ App::get('/auth/join')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/join.phtml');
@ -162,7 +162,7 @@ App::get('/auth/recovery/reset')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/recovery/reset.phtml');
@ -177,7 +177,7 @@ App::get('/auth/oauth2/success')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml');
@ -195,7 +195,7 @@ App::get('/auth/magic-url')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/magicURL.phtml');
@ -213,7 +213,7 @@ App::get('/auth/oauth2/failure')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml');
@ -232,7 +232,7 @@ App::get('/error/:code')
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
->inject('layout')
->action(function ($code, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/error.phtml');

View file

@ -27,8 +27,8 @@ use Appwrite\Network\Validator\IP;
use Appwrite\Network\Validator\URL;
use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Stats\Stats;
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\View;
use Utopia\Config\Config;
use Utopia\Locale\Locale;
use Utopia\Registry\Registry;
@ -76,8 +76,8 @@ const APP_STORAGE_FUNCTIONS = '/storage/functions';
const APP_STORAGE_CACHE = '/storage/cache';
const APP_STORAGE_CERTIFICATES = '/storage/certificates';
const APP_STORAGE_CONFIG = '/storage/config';
const APP_SOCIAL_TWITTER = 'https://twitter.com/appwrite_io';
const APP_SOCIAL_TWITTER_HANDLE = 'appwrite_io';
const APP_SOCIAL_TWITTER = 'https://twitter.com/appwrite';
const APP_SOCIAL_TWITTER_HANDLE = 'appwrite';
const APP_SOCIAL_FACEBOOK = 'https://www.facebook.com/appwrite.io';
const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite';
const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io';
@ -86,7 +86,7 @@ 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';
const APP_SOCIAL_YOUTUBE = 'https://www.youtube.com/c/appwrite';
const APP_SOCIAL_YOUTUBE = 'https://www.youtube.com/c/appwrite?sub_confirmation=1';
// Database Worker Types
const DATABASE_TYPE_CREATE_ATTRIBUTE = 'createAttribute';
const DATABASE_TYPE_CREATE_INDEX = 'createIndex';
@ -290,8 +290,8 @@ Database::addFilter('encrypt',
return json_encode([
'data' => OpenSSL::encrypt($value, 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',
]);
},

View file

@ -5,10 +5,10 @@ global $cli;
use Appwrite\Auth\Auth;
use Appwrite\Docker\Compose;
use Appwrite\Docker\Env;
use Appwrite\Utopia\View;
use Utopia\Analytics\GoogleAnalytics;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\View;
use Utopia\Validator\Text;
$cli

View file

@ -180,7 +180,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
->setShareText('Appwrite is a backend as a service for building web or mobile apps')
->setShareURL('http://appwrite.io')
->setShareTags('JS,javascript,reactjs,angular,ios,android,serverless')
->setShareVia('appwrite_io')
->setShareVia('appwrite')
->setWarning($warning)
->setReadme($readme)
->setGettingStarted($gettingStarted)

View file

@ -467,8 +467,8 @@ $logs = $this->getParam('logs', null);
<div class="col span-1"><input name="permission" value="document" type="radio" class="margin-top-no" data-ls-bind="{{project-collection.permission}}" /></div>
<div class="col span-11">
<b>Document Level</b>
<p class="text-fade margin-top-tiny">With Document Level permissions, you have granular access control over every document, and users will only be able to access documents for which they have explicit permissions.</p>
<p class="text-fade margin-top-tiny">Document permissions are required in this permission model.</p>
<p class="text-fade margin-top-tiny">With Document Level permissions, you have granular access control over every file. Users will only be able to access documents for which they have explicit permissions.</p>
<p class="text-fade margin-top-tiny">In this permission level, document permissions take precedence and bucket permissions are ignored.</p>
</div>
</div>
@ -476,8 +476,8 @@ $logs = $this->getParam('logs', null);
<div class="col span-1"><input name="permission" value="collection" type="radio" class="margin-top-tiny" data-ls-bind="{{project-collection.permission}}" /></div>
<div class="col span-11">
<b>Collection Level</b>
<p class="text-fade margin-top-tiny">With Collection Level permissions, you assign permissions once for every document in the collection - users with read access to the collection can see all documents.</p>
<p class="text-fade margin-top-tiny">Collection permissions are required in this permission model, and document permissions are optional.</p>
<p class="text-fade margin-top-tiny">With Collection Level permissions, you assign permissions only once in the collection.</p>
<p class="text-fade margin-top-tiny">In this permission level, permissions assigned to collection takes the precedence and documents permissions are ignored</p>
<div data-ls-if="{{project-collection.permission}} === 'collection'">
<label for="collection-read">Read Access <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</span></label>
<input type="hidden" id="collection-read" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{project-collection.$read}}" placeholder="User ID, Team ID or Role" />

View file

@ -1,6 +1,6 @@
<?php
use Utopia\View;
use Appwrite\Utopia\View;
$collection = $this->getParam('collection', null);
$collections = $this->getParam('collections', []);

View file

@ -10,7 +10,7 @@ $litespeed = $this->getParam('litespeed', true);
$analytics = $this->getParam('analytics', 'UA-26264668-9');
$mode = $this->getParam('mode', '');
$canonical = $this->getParam('canonical', '');
$image = $this->getParam('image', '/images/logo.png');
$image = $this->getParam('image', '/images/logo.png');
$locale = $this->getParam('locale', null);
$runtimes = $this->getParam('runtimes', null);
@ -53,12 +53,17 @@ if(!empty($platforms)) {
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
<meta name="theme-color" content="#f02e65">
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php echo APP_NAME; ?>">
<meta property="og:title" content="<?php echo $this->escape($this->getParam('title', '')); ?>" />
<meta property="og:description" content="<?php echo $this->escape($this->getParam('description', '')); ?>" />
<?php if (!empty($canonical)): ?>
<meta property="og:url" content="<?php echo $this->escape($canonical); ?>" />
<?php endif; ?>
<meta property="og:image" content="<?php echo $this->escape($endpoint); ?><?php echo $this->escape($image); ?>?v=<?php echo APP_CACHE_BUSTER; ?>" />
<meta name="twitter:site" content="@<?php echo APP_SOCIAL_TWITTER_HANDLE; ?>">
<meta name="twitter:title" content="<?php echo $this->escape($this->getParam('title', '')); ?>">
<meta name="twitter:image:src" content="<?php echo $this->escape($endpoint); ?><?php echo $this->escape($image); ?>?v=<?php echo APP_CACHE_BUSTER; ?>">
<meta name="twitter:card" content="summary_large_image">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 495 KiB

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',
]));
}

View file

@ -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'];
}
}

View file

@ -2,8 +2,8 @@
namespace Appwrite\Template;
use Appwrite\Utopia\View;
use Exception;
use Utopia\View;
class Template extends View
{

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())

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', [

View file

@ -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;
}
}

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');
}
}