mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge branches 'feat-database-indexing' and '0.8.x' of github.com:appwrite/appwrite into feat-database-indexing
This commit is contained in:
commit
00d95cb533
5 changed files with 87 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ use Appwrite\Database\Document;
|
||||||
use Appwrite\Database\Validator\Authorization;
|
use Appwrite\Database\Validator\Authorization;
|
||||||
use Appwrite\Network\Validator\Origin;
|
use Appwrite\Network\Validator\Origin;
|
||||||
use Appwrite\Utopia\Response\Filters\V06;
|
use Appwrite\Utopia\Response\Filters\V06;
|
||||||
|
use Appwrite\Utopia\Response\Filters\V07;
|
||||||
use Utopia\CLI\Console;
|
use Utopia\CLI\Console;
|
||||||
use Utopia\Database\Validator\Authorization as Authorization2;
|
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', '<=') :
|
case version_compare ($responseFormat , '0.6.2', '<=') :
|
||||||
Response::setFilter(new V06());
|
Response::setFilter(new V06());
|
||||||
break;
|
break;
|
||||||
|
case version_compare ($responseFormat , '0.7.2', '<=') :
|
||||||
|
Response::setFilter(new V07());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Response::setFilter(null);
|
Response::setFilter(null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ $auth = $this->getParam('auth', []);
|
||||||
<td data-title="Name: ">
|
<td data-title="Name: ">
|
||||||
<a data-ls-attrs="href=/console/users/user?id={{user.$id}}&project={{router.params.project}}">
|
<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-bind="{{user.name}}"></span>
|
||||||
<span data-ls-if="{{user.name}} === ''">-----</span>
|
<span data-ls-if="{{user.name|escape}} === ''">-----</span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-title="Email: ">
|
<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>
|
<h1><?php echo $this->escape($name); ?> <?php if($sandbox): ?>Sandbox<?php endif; ?> OAuth2 Settings</h1>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
|
autocomplete="off"
|
||||||
data-analytics
|
data-analytics
|
||||||
data-analytics-activity
|
data-analytics-activity
|
||||||
data-analytics-event="submit"
|
data-analytics-event="submit"
|
||||||
|
|
@ -429,6 +430,10 @@ $auth = $this->getParam('auth', []);
|
||||||
data-failure="alert"
|
data-failure="alert"
|
||||||
data-failure-param-alert-text="Failed to update project OAuth2 settings"
|
data-failure-param-alert-text="Failed to update project OAuth2 settings"
|
||||||
data-failure-param-alert-classname="error">
|
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); ?>">
|
<input name="provider" id="provider<?php echo $this->escape(ucfirst($provider)); ?>" type="hidden" autocomplete="off" value="<?php echo $this->escape($provider); ?>">
|
||||||
|
|
||||||
<?php if(!$form): ?>
|
<?php if(!$form): ?>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
$root = ($this->getParam('root') !== 'disabled');
|
$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">
|
<h1 class="zone xl margin-bottom-large margin-top">
|
||||||
Sign Up
|
Sign Up
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class V06 extends Filter {
|
||||||
|
|
||||||
$parsedResponse = [];
|
$parsedResponse = [];
|
||||||
|
|
||||||
switch($model) {
|
switch($model) {
|
||||||
|
|
||||||
case Response::MODEL_DOCUMENT_LIST:
|
case Response::MODEL_DOCUMENT_LIST:
|
||||||
$parsedResponse = $content;
|
$parsedResponse = $content;
|
||||||
|
|
@ -114,7 +114,7 @@ class V06 extends Filter {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Exception('Recevied invalid model : '.$model);
|
throw new Exception('Received invalid model : '.$model);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $parsedResponse;
|
return $parsedResponse;
|
||||||
|
|
|
||||||
67
src/Appwrite/Utopia/Response/Filters/V07.php
Normal file
67
src/Appwrite/Utopia/Response/Filters/V07.php
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue