1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00

Merge branches 'feat-database-indexing' and '0.8.x' of github.com:appwrite/appwrite into feat-database-indexing

This commit is contained in:
Eldad Fux 2021-05-15 14:11:14 +03:00
commit 00d95cb533
5 changed files with 87 additions and 4 deletions

View file

@ -15,6 +15,7 @@ use Appwrite\Database\Document;
use Appwrite\Database\Validator\Authorization;
use Appwrite\Network\Validator\Origin;
use Appwrite\Utopia\Response\Filters\V06;
use Appwrite\Utopia\Response\Filters\V07;
use Utopia\CLI\Console;
use Utopia\Database\Validator\Authorization as Authorization2;
@ -136,6 +137,9 @@ App::init(function ($utopia, $request, $response, $console, $project, $consoleDB
case version_compare ($responseFormat , '0.6.2', '<=') :
Response::setFilter(new V06());
break;
case version_compare ($responseFormat , '0.7.2', '<=') :
Response::setFilter(new V07());
break;
default:
Response::setFilter(null);
}

View file

@ -77,7 +77,7 @@ $auth = $this->getParam('auth', []);
<td data-title="Name: ">
<a data-ls-attrs="href=/console/users/user?id={{user.$id}}&project={{router.params.project}}">
<span data-ls-bind="{{user.name}}"></span>
<span data-ls-if="{{user.name}} === ''">-----</span>
<span data-ls-if="{{user.name|escape}} === ''">-----</span>
</a>
</td>
<td data-title="Email: ">
@ -414,6 +414,7 @@ $auth = $this->getParam('auth', []);
<h1><?php echo $this->escape($name); ?> <?php if($sandbox): ?>Sandbox<?php endif; ?> OAuth2 Settings</h1>
<form
autocomplete="off"
data-analytics
data-analytics-activity
data-analytics-event="submit"
@ -429,6 +430,10 @@ $auth = $this->getParam('auth', []);
data-failure="alert"
data-failure-param-alert-text="Failed to update project OAuth2 settings"
data-failure-param-alert-classname="error">
<input style="display: none" type="text" /> <?php /** Disabling Chrone Autofill @see https://stackoverflow.com/a/15917221/2299554 */ ?>
<input style="display: none" type="password" /> <?php /** Disabling Chrone Autofill @see https://stackoverflow.com/a/15917221/2299554 */ ?>
<input name="provider" id="provider<?php echo $this->escape(ucfirst($provider)); ?>" type="hidden" autocomplete="off" value="<?php echo $this->escape($provider); ?>">
<?php if(!$form): ?>

View file

@ -1,7 +1,14 @@
<?php
$root = ($this->getParam('root') !== 'disabled');
?>
<div class="zone medium signup">
<div class="zone medium signup"
data-service="account.get"
data-name="account"
data-scope="console"
data-event="load"
data-success="redirect"
data-success-param-redirect-url="/console"
data-success-param-trigger-events="account.get">
<h1 class="zone xl margin-bottom-large margin-top">
Sign Up
</h1>

View file

@ -21,7 +21,7 @@ class V06 extends Filter {
$parsedResponse = [];
switch($model) {
switch($model) {
case Response::MODEL_DOCUMENT_LIST:
$parsedResponse = $content;
@ -114,7 +114,7 @@ class V06 extends Filter {
break;
default:
throw new Exception('Recevied invalid model : '.$model);
throw new Exception('Received invalid model : '.$model);
}
return $parsedResponse;

View file

@ -0,0 +1,67 @@
<?php
namespace Appwrite\Utopia\Response\Filters;
use Appwrite\Auth\Auth;
use Appwrite\Database\Database;
use Appwrite\Database\Validator\Authorization;
use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter;
use Exception;
use Utopia\Config\Config;
use Utopia\Locale\Locale as Locale;
use function PHPSTORM_META\map;
class V07 extends Filter {
// Convert 0.8 Data format to 0.7 format
public function parse(array $content, string $model): array {
$parsedResponse = [];
switch($model) {
case Response::MODEL_DOCUMENT_LIST: /** ANY was replaced by DOCUMENT in 0.8.x but this is backward compatible with 0.7.x */
case Response::MODEL_DOCUMENT: /** ANY was replaced by DOCUMENT in 0.8.x but this is backward compatible with 0.7.x */
case Response::MODEL_USER_LIST: /** [FIELDS ADDED in 0.8.x] passwordUpdate */
case Response::MODEL_USER: /** [FIELDS ADDED in 0.8.x] passwordUpdate */
case Response::MODEL_COLLECTION_LIST:
case Response::MODEL_COLLECTION:
case Response::MODEL_FILE_LIST:
case Response::MODEL_FILE:
case Response::MODEL_FUNCTION_LIST:
case Response::MODEL_FUNCTION:
case Response::MODEL_TAG_LIST:
case Response::MODEL_TAG:
case Response::MODEL_EXECUTION_LIST:
case Response::MODEL_EXECUTION:
case Response::MODEL_TEAM_LIST:
case Response::MODEL_TEAM:
case Response::MODEL_MEMBERSHIP_LIST:
case Response::MODEL_MEMBERSHIP:
case Response::MODEL_SESSION_LIST: /** [FIELDS ADDED in 0.8.x] provider, providerUid, providerToken */
case Response::MODEL_SESSION: /** [FIELDS ADDED in 0.8.x] provider, providerUid, providerToken */
case Response::MODEL_JWT:
case Response::MODEL_LOG_LIST:
case Response::MODEL_TOKEN:
case Response::MODEL_LOCALE:
case Response::MODEL_COUNTRY_LIST:
case Response::MODEL_PHONE_LIST:
case Response::MODEL_CONTINENT_LIST:
case Response::MODEL_CURRENCY_LIST:
case Response::MODEL_LANGUAGE_LIST:
case Response::MODEL_ANY:
case Response::MODEL_PREFERENCES: /** ANY was replaced by PREFERENCES in 0.8.x but this is backward compatible with 0.7.x */
case Response::MODEL_NONE:
$parsedResponse = $content;
break;
default:
throw new Exception('Received invalid model : '.$model);
}
return $parsedResponse;
}
}