Merge branch '0.16.x' into feat-variables-api
This commit is contained in:
commit
6882ffaa00
11
CHANGES.md
11
CHANGES.md
|
@ -1,3 +1,14 @@
|
|||
# Version 0.15.3
|
||||
## Features
|
||||
- Added hint during Installation for DNS Configuration by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/2450
|
||||
## Bugs
|
||||
- Fixed Migration for Attributes and Indexes by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/3568
|
||||
- Fixed Closed Icon in the alerts to be centered by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/3594
|
||||
- Fixed Response Model for Get and Update Database Endpoint by @ishanvyas22 in https://github.com/appwrite/appwrite/pull/3553
|
||||
- Fixed Missing Usage on Functions exection by @Meldiron in https://github.com/appwrite/appwrite/pull/3543
|
||||
- Fixed Validation for Permissions to only accept a maximum of 100 Permissions for all endpoints by @Meldiron in https://github.com/appwrite/appwrite/pull/3532
|
||||
- Fixed backwards compatibility for Create Email Session Endpoint by @stnguyen90 in https://github.com/appwrite/appwrite/pull/3517
|
||||
|
||||
# Version 0.15.2
|
||||
## Bugs
|
||||
- Fixed Realtime Authentication for the Console by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/3506
|
||||
|
|
|
@ -317,7 +317,7 @@ The Runtimes for all supported cloud functions (multicore builds) can be found a
|
|||
|
||||
For generating a new console SDK follow the next steps:
|
||||
|
||||
1. Update the console spec file located at `app/config/specs/swagger2-0.12.x.console.json` from the dynamic version located at `https://localhost/specs/swagger2?platform=console`
|
||||
1. Update the console spec file located at `app/config/specs/swagger2-<version-number>.console.json` using Appwrite Tasks. Run the `php app/cli.php specs <version-number> normal` command in a running `appwrite/appwrite` container.
|
||||
2. Generate a new SDK using the command `php app/cli.php sdks`
|
||||
3. Change your working dir using `cd app/sdks/console-web`
|
||||
4. Build the new SDK `npm run build`
|
||||
|
@ -462,4 +462,4 @@ Submitting documentation updates, enhancements, designs, or bug fixes. Spelling
|
|||
|
||||
### Helping Someone
|
||||
|
||||
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
|
||||
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
|
||||
|
|
|
@ -59,7 +59,7 @@ docker run -it --rm \
|
|||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||
--entrypoint="install" \
|
||||
appwrite/appwrite:0.15.2
|
||||
appwrite/appwrite:0.15.3
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
@ -71,7 +71,7 @@ docker run -it --rm ^
|
|||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||
--entrypoint="install" ^
|
||||
appwrite/appwrite:0.15.2
|
||||
appwrite/appwrite:0.15.3
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
|
@ -81,7 +81,7 @@ docker run -it --rm ,
|
|||
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
||||
--entrypoint="install" ,
|
||||
appwrite/appwrite:0.15.2
|
||||
appwrite/appwrite:0.15.3
|
||||
```
|
||||
|
||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||
|
|
|
@ -65,7 +65,7 @@ docker run -it --rm \
|
|||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||
--entrypoint="install" \
|
||||
appwrite/appwrite:0.15.2
|
||||
appwrite/appwrite:0.15.3
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
@ -77,7 +77,7 @@ docker run -it --rm ^
|
|||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||
--entrypoint="install" ^
|
||||
appwrite/appwrite:0.15.2
|
||||
appwrite/appwrite:0.15.3
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
|
@ -87,7 +87,7 @@ docker run -it --rm ,
|
|||
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
||||
--entrypoint="install" ,
|
||||
appwrite/appwrite:0.15.2
|
||||
appwrite/appwrite:0.15.3
|
||||
```
|
||||
|
||||
Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after installation completes.
|
||||
|
|
|
@ -180,7 +180,7 @@ return [
|
|||
[
|
||||
'key' => 'cli',
|
||||
'name' => 'Command Line',
|
||||
'version' => '0.18.1',
|
||||
'version' => '0.18.3',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-cli',
|
||||
'package' => 'https://www.npmjs.com/package/appwrite-cli',
|
||||
'enabled' => true,
|
||||
|
|
|
@ -882,7 +882,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
|
|||
->label('sdk.namespace', 'databases')
|
||||
->label('sdk.method', 'createStringAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-string-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -915,6 +915,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string
|
|||
'array' => $array,
|
||||
]), $response, $dbForProject, $database, $audits, $events, $usage);
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_STRING);
|
||||
});
|
||||
|
||||
|
@ -928,7 +929,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createEmailAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-email-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -955,6 +956,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email'
|
|||
'format' => APP_DATABASE_ATTRIBUTE_EMAIL,
|
||||
]), $response, $dbForProject, $database, $audits, $events, $usage);
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_EMAIL);
|
||||
});
|
||||
|
||||
|
@ -968,7 +970,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createEnumAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-attribute-enum.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1011,6 +1013,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum')
|
|||
'formatOptions' => ['elements' => $elements],
|
||||
]), $response, $dbForProject, $database, $audits, $events, $usage);
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_ENUM);
|
||||
});
|
||||
|
||||
|
@ -1024,7 +1027,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createIpAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-ip-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1051,6 +1054,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip')
|
|||
'format' => APP_DATABASE_ATTRIBUTE_IP,
|
||||
]), $response, $dbForProject, $database, $audits, $events, $usage);
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_IP);
|
||||
});
|
||||
|
||||
|
@ -1064,7 +1068,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createUrlAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-url-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1091,6 +1095,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url')
|
|||
'format' => APP_DATABASE_ATTRIBUTE_URL,
|
||||
]), $response, $dbForProject, $database, $audits, $events, $usage);
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_URL);
|
||||
});
|
||||
|
||||
|
@ -1104,7 +1109,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createIntegerAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-integer-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1160,6 +1165,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
|
|||
$attribute->setAttribute('max', \intval($formatOptions['max']));
|
||||
}
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_INTEGER);
|
||||
});
|
||||
|
||||
|
@ -1173,7 +1179,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createFloatAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-float-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1232,6 +1238,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
|
|||
$attribute->setAttribute('max', \floatval($formatOptions['max']));
|
||||
}
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_FLOAT);
|
||||
});
|
||||
|
||||
|
@ -1245,7 +1252,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
|
|||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.method', 'createBooleanAttribute')
|
||||
->label('sdk.description', '/docs/references/databases/create-boolean-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1271,6 +1278,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea
|
|||
'array' => $array,
|
||||
]), $response, $dbForProject, $database, $audits, $events, $usage);
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($attribute, Response::MODEL_ATTRIBUTE_BOOLEAN);
|
||||
});
|
||||
|
||||
|
@ -1491,7 +1499,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
|||
->label('sdk.namespace', 'databases')
|
||||
->label('sdk.method', 'createIndex')
|
||||
->label('sdk.description', '/docs/references/databases/create-index.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_INDEX)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
|
@ -1633,7 +1641,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
|||
->setPayload($index->getArrayCopy())
|
||||
;
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_CREATED);
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($index, Response::MODEL_INDEX);
|
||||
});
|
||||
|
||||
|
|
|
@ -450,7 +450,7 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
->label('sdk.description', '/docs/references/functions/create-deployment.md')
|
||||
->label('sdk.packaging', true)
|
||||
->label('sdk.request.type', 'multipart/form-data')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
|
@ -619,7 +619,7 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
->setParam('functionId', $function->getId())
|
||||
->setParam('deploymentId', $deployment->getId());
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_CREATED);
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
|
||||
});
|
||||
|
||||
|
@ -903,7 +903,7 @@ App::post('/v1/functions/:functionId/executions')
|
|||
|
||||
$event->trigger();
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_CREATED);
|
||||
$response->setStatusCode(Response::STATUS_CODE_ACCEPTED);
|
||||
|
||||
return $response->dynamic($execution, Response::MODEL_EXECUTION);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ const APP_LIMIT_ARRAY_PARAMS_SIZE = 100; // Default maximum of how many elements
|
|||
const APP_LIMIT_ARRAY_ELEMENT_SIZE = 4096; // Default maximum length of element in array parameter represented by maximum URL length.
|
||||
const APP_LIMIT_SUBQUERY = 1000;
|
||||
const APP_CACHE_BUSTER = 402;
|
||||
const APP_VERSION_STABLE = '0.15.2';
|
||||
const APP_VERSION_STABLE = '0.15.3';
|
||||
const APP_DATABASE_ATTRIBUTE_EMAIL = 'email';
|
||||
const APP_DATABASE_ATTRIBUTE_ENUM = 'enum';
|
||||
const APP_DATABASE_ATTRIBUTE_IP = 'ip';
|
||||
|
|
14
composer.lock
generated
14
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "4eef15719e293b4e136e8bd478a1daa3",
|
||||
"content-hash": "677b1b47c8567f0b7b05645e2bbc7bc7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
@ -2828,16 +2828,16 @@
|
|||
"packages-dev": [
|
||||
{
|
||||
"name": "appwrite/sdk-generator",
|
||||
"version": "0.18.8",
|
||||
"version": "0.19.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||
"reference": "8ba45dfb74ff6062f96c0e4d10d7c4fae94768b1"
|
||||
"reference": "04de540cf683e2b08b3192c137dde7f2c37003d9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8ba45dfb74ff6062f96c0e4d10d7c4fae94768b1",
|
||||
"reference": "8ba45dfb74ff6062f96c0e4d10d7c4fae94768b1",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/04de540cf683e2b08b3192c137dde7f2c37003d9",
|
||||
"reference": "04de540cf683e2b08b3192c137dde7f2c37003d9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2872,9 +2872,9 @@
|
|||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"support": {
|
||||
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
||||
"source": "https://github.com/appwrite/sdk-generator/tree/0.18.8"
|
||||
"source": "https://github.com/appwrite/sdk-generator/tree/0.19.5"
|
||||
},
|
||||
"time": "2022-05-19T10:34:06+00:00"
|
||||
"time": "2022-07-06T11:05:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
|
|
2
public/dist/styles/default-ltr.css
vendored
2
public/dist/styles/default-ltr.css
vendored
File diff suppressed because one or more lines are too long
2
public/dist/styles/default-rtl.css
vendored
2
public/dist/styles/default-rtl.css
vendored
File diff suppressed because one or more lines are too long
|
@ -41,14 +41,14 @@
|
|||
i {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
top: 9px;
|
||||
.func-start(9px);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
top: 8px;
|
||||
.func-start(8px);
|
||||
color: var(--config-color-background-dark);
|
||||
background: var(--config-color-normal);
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ abstract class Migration
|
|||
'0.14.2' => 'V13',
|
||||
'0.15.0' => 'V14',
|
||||
'0.15.1' => 'V14',
|
||||
'0.15.2' => 'V14'
|
||||
'0.15.2' => 'V14',
|
||||
'0.15.3' => 'V14'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
namespace Appwrite\Migration\Version;
|
||||
|
||||
use Appwrite\Migration\Migration;
|
||||
use Utopia\App;
|
||||
use Exception;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Query;
|
||||
|
||||
class V14 extends Migration
|
||||
{
|
||||
|
@ -208,6 +209,14 @@ class V14 extends Migration
|
|||
} catch (\Throwable $th) {
|
||||
Console::warning($th->getMessage());
|
||||
}
|
||||
/**
|
||||
* Migrate Attributes
|
||||
*/
|
||||
$this->migrateAttributesAndCollections('attributes', $collection);
|
||||
/**
|
||||
* Migrate Indexes
|
||||
*/
|
||||
$this->migrateAttributesAndCollections('indexes', $collection);
|
||||
}, $document);
|
||||
}
|
||||
}, $documents);
|
||||
|
@ -220,6 +229,53 @@ class V14 extends Migration
|
|||
} while (!is_null($nextCollection));
|
||||
}
|
||||
|
||||
protected function migrateAttributesAndCollections(string $type, Document $collection): void
|
||||
{
|
||||
/**
|
||||
* Offset pagination instead of cursor, since documents are re-created!
|
||||
*/
|
||||
$offset = 0;
|
||||
$attributesCount = $this->projectDB->count($type, queries: [new Query('collectionId', Query::TYPE_EQUAL, [$collection->getId()])]);
|
||||
|
||||
do {
|
||||
$documents = $this->projectDB->find($type, limit: $this->limit, offset: $offset, queries: [new Query('collectionId', Query::TYPE_EQUAL, [$collection->getId()])]);
|
||||
$offset += $this->limit;
|
||||
|
||||
foreach ($documents as $document) {
|
||||
go(function (Document $document, string $internalId, string $type) {
|
||||
try {
|
||||
/**
|
||||
* Skip already migrated Documents.
|
||||
*/
|
||||
if (!is_null($document->getAttribute('databaseId'))) {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Add Internal ID 'collectionInternalId' for Subqueries.
|
||||
*/
|
||||
$document->setAttribute('collectionInternalId', $internalId);
|
||||
/**
|
||||
* Add Internal ID 'databaseInternalId' for Subqueries.
|
||||
*/
|
||||
$document->setAttribute('databaseInternalId', '1');
|
||||
/**
|
||||
* Add Internal ID 'databaseId'.
|
||||
*/
|
||||
$document->setAttribute('databaseId', 'default');
|
||||
|
||||
/**
|
||||
* Re-create Attribute.
|
||||
*/
|
||||
$this->projectDB->deleteDocument($document->getCollection(), $document->getId());
|
||||
$this->projectDB->createDocument($document->getCollection(), $document->setAttribute('$id', "1_{$internalId}_{$document->getAttribute('key')}"));
|
||||
} catch (\Throwable $th) {
|
||||
Console::error("Failed to {$type} document: " . $th->getMessage());
|
||||
}
|
||||
}, $document, $collection->getInternalId(), $type);
|
||||
}
|
||||
} while ($offset < $attributesCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate all Collections.
|
||||
*
|
||||
|
@ -580,40 +636,6 @@ class V14 extends Migration
|
|||
$document->setAttribute('teamInternalId', $internalId);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'attributes':
|
||||
case 'indexes':
|
||||
/**
|
||||
* Add Internal ID 'collectionId' for Subqueries.
|
||||
*/
|
||||
if (!empty($document->getAttribute('collectionId')) && is_null($document->getAttribute('collectionInternalId'))) {
|
||||
$internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId();
|
||||
$document->setAttribute('collectionInternalId', $internalId);
|
||||
}
|
||||
/**
|
||||
* Add Internal ID 'databaseInternalId' for Subqueries.
|
||||
*/
|
||||
if (is_null($document->getAttribute('databaseInternalId'))) {
|
||||
$document->setAttribute('databaseInternalId', '1');
|
||||
}
|
||||
/**
|
||||
* Add Internal ID 'databaseInternalId' for Subqueries.
|
||||
*/
|
||||
if (is_null($document->getAttribute('databaseId'))) {
|
||||
$document->setAttribute('databaseId', 'default');
|
||||
}
|
||||
|
||||
try {
|
||||
/**
|
||||
* Re-create Collection Document
|
||||
*/
|
||||
$internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId();
|
||||
$this->projectDB->deleteDocument($document->getCollection(), $document->getId());
|
||||
$this->projectDB->createDocument($document->getCollection(), $document->setAttribute('$id', "1_{$internalId}_{$document->getAttribute('key')}"));
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("Create Collection Document - {$th->getMessage()}");
|
||||
}
|
||||
$document = null;
|
||||
break;
|
||||
case 'platforms':
|
||||
/**
|
||||
|
|
|
@ -165,23 +165,23 @@ trait DatabasesBase
|
|||
'array' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($title['headers']['status-code'], 201);
|
||||
$this->assertEquals($title['headers']['status-code'], 202);
|
||||
$this->assertEquals($title['body']['key'], 'title');
|
||||
$this->assertEquals($title['body']['type'], 'string');
|
||||
$this->assertEquals($title['body']['size'], 256);
|
||||
$this->assertEquals($title['body']['required'], true);
|
||||
|
||||
$this->assertEquals($releaseYear['headers']['status-code'], 201);
|
||||
$this->assertEquals($releaseYear['headers']['status-code'], 202);
|
||||
$this->assertEquals($releaseYear['body']['key'], 'releaseYear');
|
||||
$this->assertEquals($releaseYear['body']['type'], 'integer');
|
||||
$this->assertEquals($releaseYear['body']['required'], true);
|
||||
|
||||
$this->assertEquals($duration['headers']['status-code'], 201);
|
||||
$this->assertEquals($duration['headers']['status-code'], 202);
|
||||
$this->assertEquals($duration['body']['key'], 'duration');
|
||||
$this->assertEquals($duration['body']['type'], 'integer');
|
||||
$this->assertEquals($duration['body']['required'], false);
|
||||
|
||||
$this->assertEquals($actors['headers']['status-code'], 201);
|
||||
$this->assertEquals($actors['headers']['status-code'], 202);
|
||||
$this->assertEquals($actors['body']['key'], 'actors');
|
||||
$this->assertEquals($actors['body']['type'], 'string');
|
||||
$this->assertEquals($actors['body']['size'], 256);
|
||||
|
@ -318,7 +318,7 @@ trait DatabasesBase
|
|||
'default' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $string['headers']['status-code']);
|
||||
$this->assertEquals(202, $string['headers']['status-code']);
|
||||
$this->assertEquals('string', $string['body']['key']);
|
||||
$this->assertEquals('string', $string['body']['type']);
|
||||
$this->assertEquals(false, $string['body']['required']);
|
||||
|
@ -326,7 +326,7 @@ trait DatabasesBase
|
|||
$this->assertEquals(16, $string['body']['size']);
|
||||
$this->assertEquals('default', $string['body']['default']);
|
||||
|
||||
$this->assertEquals(201, $email['headers']['status-code']);
|
||||
$this->assertEquals(202, $email['headers']['status-code']);
|
||||
$this->assertEquals('email', $email['body']['key']);
|
||||
$this->assertEquals('string', $email['body']['type']);
|
||||
$this->assertEquals(false, $email['body']['required']);
|
||||
|
@ -334,7 +334,7 @@ trait DatabasesBase
|
|||
$this->assertEquals('email', $email['body']['format']);
|
||||
$this->assertEquals('default@example.com', $email['body']['default']);
|
||||
|
||||
$this->assertEquals(201, $enum['headers']['status-code']);
|
||||
$this->assertEquals(202, $enum['headers']['status-code']);
|
||||
$this->assertEquals('enum', $enum['body']['key']);
|
||||
$this->assertEquals('string', $enum['body']['type']);
|
||||
$this->assertEquals(false, $enum['body']['required']);
|
||||
|
@ -344,7 +344,7 @@ trait DatabasesBase
|
|||
$this->assertIsArray($enum['body']['elements']);
|
||||
$this->assertEquals(['yes', 'no', 'maybe'], $enum['body']['elements']);
|
||||
|
||||
$this->assertEquals(201, $ip['headers']['status-code']);
|
||||
$this->assertEquals(202, $ip['headers']['status-code']);
|
||||
$this->assertEquals('ip', $ip['body']['key']);
|
||||
$this->assertEquals('string', $ip['body']['type']);
|
||||
$this->assertEquals(false, $ip['body']['required']);
|
||||
|
@ -352,7 +352,7 @@ trait DatabasesBase
|
|||
$this->assertEquals('ip', $ip['body']['format']);
|
||||
$this->assertEquals('192.0.2.0', $ip['body']['default']);
|
||||
|
||||
$this->assertEquals(201, $url['headers']['status-code']);
|
||||
$this->assertEquals(202, $url['headers']['status-code']);
|
||||
$this->assertEquals('url', $url['body']['key']);
|
||||
$this->assertEquals('string', $url['body']['type']);
|
||||
$this->assertEquals(false, $url['body']['required']);
|
||||
|
@ -360,7 +360,7 @@ trait DatabasesBase
|
|||
$this->assertEquals('url', $url['body']['format']);
|
||||
$this->assertEquals('http://example.com', $url['body']['default']);
|
||||
|
||||
$this->assertEquals(201, $integer['headers']['status-code']);
|
||||
$this->assertEquals(202, $integer['headers']['status-code']);
|
||||
$this->assertEquals('integer', $integer['body']['key']);
|
||||
$this->assertEquals('integer', $integer['body']['type']);
|
||||
$this->assertEquals(false, $integer['body']['required']);
|
||||
|
@ -369,7 +369,7 @@ trait DatabasesBase
|
|||
$this->assertEquals(5, $integer['body']['max']);
|
||||
$this->assertEquals(3, $integer['body']['default']);
|
||||
|
||||
$this->assertEquals(201, $float['headers']['status-code']);
|
||||
$this->assertEquals(202, $float['headers']['status-code']);
|
||||
$this->assertEquals('float', $float['body']['key']);
|
||||
$this->assertEquals('double', $float['body']['type']);
|
||||
$this->assertEquals(false, $float['body']['required']);
|
||||
|
@ -378,7 +378,7 @@ trait DatabasesBase
|
|||
$this->assertEquals(5.5, $float['body']['max']);
|
||||
$this->assertEquals(3.5, $float['body']['default']);
|
||||
|
||||
$this->assertEquals(201, $boolean['headers']['status-code']);
|
||||
$this->assertEquals(202, $boolean['headers']['status-code']);
|
||||
$this->assertEquals('boolean', $boolean['body']['key']);
|
||||
$this->assertEquals('boolean', $boolean['body']['type']);
|
||||
$this->assertEquals(false, $boolean['body']['required']);
|
||||
|
@ -705,7 +705,7 @@ trait DatabasesBase
|
|||
'attributes' => ['title'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $titleIndex['headers']['status-code']);
|
||||
$this->assertEquals(202, $titleIndex['headers']['status-code']);
|
||||
$this->assertEquals('titleIndex', $titleIndex['body']['key']);
|
||||
$this->assertEquals('fulltext', $titleIndex['body']['type']);
|
||||
$this->assertCount(1, $titleIndex['body']['attributes']);
|
||||
|
@ -721,7 +721,7 @@ trait DatabasesBase
|
|||
'attributes' => ['releaseYear'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $releaseYearIndex['headers']['status-code']);
|
||||
$this->assertEquals(202, $releaseYearIndex['headers']['status-code']);
|
||||
$this->assertEquals('releaseYear', $releaseYearIndex['body']['key']);
|
||||
$this->assertEquals('key', $releaseYearIndex['body']['type']);
|
||||
$this->assertCount(1, $releaseYearIndex['body']['attributes']);
|
||||
|
@ -737,7 +737,7 @@ trait DatabasesBase
|
|||
'attributes' => ['releaseYear', '$createdAt', '$updatedAt'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $releaseWithDate['headers']['status-code']);
|
||||
$this->assertEquals(202, $releaseWithDate['headers']['status-code']);
|
||||
$this->assertEquals('releaseYearDated', $releaseWithDate['body']['key']);
|
||||
$this->assertEquals('key', $releaseWithDate['body']['type']);
|
||||
$this->assertCount(3, $releaseWithDate['body']['attributes']);
|
||||
|
@ -1689,15 +1689,15 @@ trait DatabasesBase
|
|||
'default' => 'NORTH'
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $email['headers']['status-code']);
|
||||
$this->assertEquals(201, $ip['headers']['status-code']);
|
||||
$this->assertEquals(201, $url['headers']['status-code']);
|
||||
$this->assertEquals(201, $range['headers']['status-code']);
|
||||
$this->assertEquals(201, $floatRange['headers']['status-code']);
|
||||
$this->assertEquals(201, $probability['headers']['status-code']);
|
||||
$this->assertEquals(201, $upperBound['headers']['status-code']);
|
||||
$this->assertEquals(201, $lowerBound['headers']['status-code']);
|
||||
$this->assertEquals(201, $enum['headers']['status-code']);
|
||||
$this->assertEquals(202, $email['headers']['status-code']);
|
||||
$this->assertEquals(202, $ip['headers']['status-code']);
|
||||
$this->assertEquals(202, $url['headers']['status-code']);
|
||||
$this->assertEquals(202, $range['headers']['status-code']);
|
||||
$this->assertEquals(202, $floatRange['headers']['status-code']);
|
||||
$this->assertEquals(202, $probability['headers']['status-code']);
|
||||
$this->assertEquals(202, $upperBound['headers']['status-code']);
|
||||
$this->assertEquals(202, $lowerBound['headers']['status-code']);
|
||||
$this->assertEquals(202, $enum['headers']['status-code']);
|
||||
$this->assertEquals(400, $invalidRange['headers']['status-code']);
|
||||
$this->assertEquals(400, $defaultArray['headers']['status-code']);
|
||||
$this->assertEquals(400, $defaultRequired['headers']['status-code']);
|
||||
|
@ -2144,7 +2144,7 @@ trait DatabasesBase
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $attribute['headers']['status-code'], 201);
|
||||
$this->assertEquals(202, $attribute['headers']['status-code'], 202);
|
||||
$this->assertEquals('attribute', $attribute['body']['key']);
|
||||
|
||||
// wait for db to add attribute
|
||||
|
@ -2160,7 +2160,7 @@ trait DatabasesBase
|
|||
'attributes' => [$attribute['body']['key']],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $index['headers']['status-code']);
|
||||
$this->assertEquals(202, $index['headers']['status-code']);
|
||||
$this->assertEquals('key_attribute', $index['body']['key']);
|
||||
|
||||
// wait for db to add attribute
|
||||
|
@ -2292,7 +2292,7 @@ trait DatabasesBase
|
|||
'attributes' => ['title'],
|
||||
]);
|
||||
|
||||
$this->assertEquals($uniqueIndex['headers']['status-code'], 201);
|
||||
$this->assertEquals($uniqueIndex['headers']['status-code'], 202);
|
||||
|
||||
sleep(2);
|
||||
|
||||
|
@ -2464,7 +2464,7 @@ trait DatabasesBase
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($title['headers']['status-code'], 201);
|
||||
$this->assertEquals($title['headers']['status-code'], 202);
|
||||
|
||||
// wait for database worker to create attributes
|
||||
sleep(2);
|
||||
|
|
|
@ -63,7 +63,7 @@ class DatabasesCustomClientTest extends Scope
|
|||
'size' => 255,
|
||||
'required' => true,
|
||||
]);
|
||||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertEquals(202, $response['headers']['status-code']);
|
||||
|
||||
// Wait for database worker to finish creating attributes
|
||||
sleep(2);
|
||||
|
|
|
@ -618,8 +618,8 @@ class DatabasesCustomServerTest extends Scope
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $attribute1['headers']['status-code']);
|
||||
$this->assertEquals(201, $attribute2['headers']['status-code']);
|
||||
$this->assertEquals(202, $attribute1['headers']['status-code']);
|
||||
$this->assertEquals(202, $attribute2['headers']['status-code']);
|
||||
$this->assertEquals('attribute1', $attribute1['body']['key']);
|
||||
$this->assertEquals('attribute2', $attribute2['body']['key']);
|
||||
|
||||
|
@ -646,8 +646,8 @@ class DatabasesCustomServerTest extends Scope
|
|||
'attributes' => ['attribute2'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $index1['headers']['status-code']);
|
||||
$this->assertEquals(201, $index2['headers']['status-code']);
|
||||
$this->assertEquals(202, $index1['headers']['status-code']);
|
||||
$this->assertEquals(202, $index2['headers']['status-code']);
|
||||
$this->assertEquals('index1', $index1['body']['key']);
|
||||
$this->assertEquals('index2', $index2['body']['key']);
|
||||
|
||||
|
@ -742,8 +742,8 @@ class DatabasesCustomServerTest extends Scope
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $attribute1['headers']['status-code']);
|
||||
$this->assertEquals(201, $attribute2['headers']['status-code']);
|
||||
$this->assertEquals(202, $attribute1['headers']['status-code']);
|
||||
$this->assertEquals(202, $attribute2['headers']['status-code']);
|
||||
$this->assertEquals('attribute1', $attribute1['body']['key']);
|
||||
$this->assertEquals('attribute2', $attribute2['body']['key']);
|
||||
|
||||
|
@ -770,8 +770,8 @@ class DatabasesCustomServerTest extends Scope
|
|||
'attributes' => ['attribute2'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $index1['headers']['status-code']);
|
||||
$this->assertEquals(201, $index2['headers']['status-code']);
|
||||
$this->assertEquals(202, $index1['headers']['status-code']);
|
||||
$this->assertEquals(202, $index2['headers']['status-code']);
|
||||
$this->assertEquals('index1', $index1['body']['key']);
|
||||
$this->assertEquals('index2', $index2['body']['key']);
|
||||
|
||||
|
@ -980,7 +980,7 @@ class DatabasesCustomServerTest extends Scope
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($attribute['headers']['status-code'], 201);
|
||||
$this->assertEquals($attribute['headers']['status-code'], 202);
|
||||
}
|
||||
|
||||
sleep(5);
|
||||
|
@ -1043,7 +1043,7 @@ class DatabasesCustomServerTest extends Scope
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($attribute['headers']['status-code'], 201);
|
||||
$this->assertEquals($attribute['headers']['status-code'], 202);
|
||||
}
|
||||
|
||||
sleep(20);
|
||||
|
@ -1080,7 +1080,7 @@ class DatabasesCustomServerTest extends Scope
|
|||
'attributes' => ["attribute{$i}"],
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $index['headers']['status-code']);
|
||||
$this->assertEquals(202, $index['headers']['status-code']);
|
||||
$this->assertEquals("key_attribute{$i}", $index['body']['key']);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class DatabasesPermissionsMemberTest extends Scope
|
|||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertEquals(202, $response['headers']['status-code']);
|
||||
|
||||
$private = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', $this->getServerHeader(), [
|
||||
'collectionId' => 'unique()',
|
||||
|
@ -95,7 +95,7 @@ class DatabasesPermissionsMemberTest extends Scope
|
|||
'size' => 256,
|
||||
'required' => true,
|
||||
]);
|
||||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertEquals(202, $response['headers']['status-code']);
|
||||
|
||||
sleep(2);
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ class FunctionsCustomClientTest extends Scope
|
|||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Wait for deployment to be built.
|
||||
sleep(10);
|
||||
|
@ -140,7 +140,7 @@ class FunctionsCustomClientTest extends Scope
|
|||
'async' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
// Cleanup : Delete function
|
||||
$response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $function['body']['$id'], [
|
||||
|
@ -228,7 +228,7 @@ class FunctionsCustomClientTest extends Scope
|
|||
// Wait for deployment to be built.
|
||||
sleep(5);
|
||||
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
$function = $this->client->call(Client::METHOD_PATCH, '/functions/' . $functionId . '/deployments/' . $deploymentId, [
|
||||
'content-type' => 'application/json',
|
||||
|
@ -245,7 +245,7 @@ class FunctionsCustomClientTest extends Scope
|
|||
'data' => 'foobar',
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
@ -320,7 +320,7 @@ class FunctionsCustomClientTest extends Scope
|
|||
'data' => 'foobar',
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
sleep(10);
|
||||
|
||||
|
@ -437,7 +437,7 @@ class FunctionsCustomClientTest extends Scope
|
|||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Wait for deployment to be built.
|
||||
sleep(10);
|
||||
|
|
|
@ -325,7 +325,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
$this->assertNotEmpty($deployment['body']['$id']);
|
||||
$this->assertIsInt($deployment['body']['$createdAt']);
|
||||
$this->assertEquals('index.php', $deployment['body']['entrypoint']);
|
||||
|
@ -374,7 +374,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
}
|
||||
@fclose($handle);
|
||||
|
||||
$this->assertEquals(201, $largeTag['headers']['status-code']);
|
||||
$this->assertEquals(202, $largeTag['headers']['status-code']);
|
||||
$this->assertNotEmpty($largeTag['body']['$id']);
|
||||
$this->assertIsInt($largeTag['body']['$createdAt']);
|
||||
$this->assertEquals('index.php', $largeTag['body']['entrypoint']);
|
||||
|
@ -517,7 +517,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
$this->assertNotEmpty($execution['body']['$id']);
|
||||
$this->assertNotEmpty($execution['body']['functionId']);
|
||||
$this->assertIsInt($execution['body']['$createdAt']);
|
||||
|
@ -765,7 +765,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
'activate' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Allow build step to run
|
||||
sleep(20);
|
||||
|
@ -779,7 +779,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
sleep(10);
|
||||
|
||||
|
@ -849,7 +849,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Allow build step to run
|
||||
sleep(10);
|
||||
|
@ -870,7 +870,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
@ -969,7 +969,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Allow build step to run
|
||||
sleep(10);
|
||||
|
@ -983,7 +983,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
@ -1082,7 +1082,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Allow build step to run
|
||||
sleep(30);
|
||||
|
@ -1096,7 +1096,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
@ -1195,7 +1195,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Allow build step to run
|
||||
sleep(40);
|
||||
|
@ -1209,7 +1209,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
@ -1308,7 +1308,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
$this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// Allow build step to run
|
||||
sleep(30);
|
||||
|
@ -1322,7 +1322,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals(201, $execution['headers']['status-code']);
|
||||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
@ -1413,7 +1413,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
// ]);
|
||||
|
||||
// $deploymentId = $deployment['body']['$id'] ?? '';
|
||||
// $this->assertEquals(201, $deployment['headers']['status-code']);
|
||||
// $this->assertEquals(202, $deployment['headers']['status-code']);
|
||||
|
||||
// // Allow (slow) build step to run
|
||||
// sleep(300);
|
||||
|
@ -1427,7 +1427,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
// $executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
// $this->assertEquals(201, $execution['headers']['status-code']);
|
||||
// $this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
// $executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ class RealtimeConsoleClientTest extends Scope
|
|||
|
||||
$attributeKey = $name['body']['key'];
|
||||
|
||||
$this->assertEquals($name['headers']['status-code'], 201);
|
||||
$this->assertEquals($name['headers']['status-code'], 202);
|
||||
$this->assertEquals($name['body']['key'], 'name');
|
||||
$this->assertEquals($name['body']['type'], 'string');
|
||||
$this->assertEquals($name['body']['size'], 256);
|
||||
|
@ -266,7 +266,7 @@ class RealtimeConsoleClientTest extends Scope
|
|||
],
|
||||
]);
|
||||
|
||||
$this->assertEquals($index['headers']['status-code'], 201);
|
||||
$this->assertEquals($index['headers']['status-code'], 202);
|
||||
$indexKey = $index['body']['key'];
|
||||
|
||||
$response = json_decode($client->receive(), true);
|
||||
|
|
|
@ -661,7 +661,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($name['headers']['status-code'], 201);
|
||||
$this->assertEquals($name['headers']['status-code'], 202);
|
||||
$this->assertEquals($name['body']['key'], 'name');
|
||||
$this->assertEquals($name['body']['type'], 'string');
|
||||
$this->assertEquals($name['body']['size'], 256);
|
||||
|
@ -871,7 +871,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
'required' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($name['headers']['status-code'], 201);
|
||||
$this->assertEquals($name['headers']['status-code'], 202);
|
||||
$this->assertEquals($name['body']['key'], 'name');
|
||||
$this->assertEquals($name['body']['type'], 'string');
|
||||
$this->assertEquals($name['body']['size'], 256);
|
||||
|
@ -1222,7 +1222,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals($deployment['headers']['status-code'], 201);
|
||||
$this->assertEquals($deployment['headers']['status-code'], 202);
|
||||
$this->assertNotEmpty($deployment['body']['$id']);
|
||||
|
||||
// Wait for deployment to be built.
|
||||
|
@ -1242,7 +1242,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals($execution['headers']['status-code'], 201);
|
||||
$this->assertEquals($execution['headers']['status-code'], 202);
|
||||
$this->assertNotEmpty($execution['body']['$id']);
|
||||
|
||||
$response = json_decode($client->receive(), true);
|
||||
|
|
|
@ -115,11 +115,11 @@ trait WebhooksBase
|
|||
|
||||
$attributeId = $extra['body']['key'];
|
||||
|
||||
$this->assertEquals($firstName['headers']['status-code'], 201);
|
||||
$this->assertEquals($firstName['headers']['status-code'], 202);
|
||||
$this->assertEquals($firstName['body']['key'], 'firstName');
|
||||
$this->assertEquals($lastName['headers']['status-code'], 201);
|
||||
$this->assertEquals($lastName['headers']['status-code'], 202);
|
||||
$this->assertEquals($lastName['body']['key'], 'lastName');
|
||||
$this->assertEquals($extra['headers']['status-code'], 201);
|
||||
$this->assertEquals($extra['headers']['status-code'], 202);
|
||||
$this->assertEquals($extra['body']['key'], 'extra');
|
||||
|
||||
// wait for database worker to kick in
|
||||
|
|
|
@ -82,7 +82,7 @@ class WebhooksCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$indexKey = $index['body']['key'];
|
||||
$this->assertEquals($index['headers']['status-code'], 201);
|
||||
$this->assertEquals($index['headers']['status-code'], 202);
|
||||
$this->assertEquals($index['body']['key'], 'fullname');
|
||||
|
||||
// wait for database worker to create index
|
||||
|
@ -512,7 +512,7 @@ class WebhooksCustomServerTest extends Scope
|
|||
$id = $data['functionId'] ?? '';
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals($deployment['headers']['status-code'], 201);
|
||||
$this->assertEquals($deployment['headers']['status-code'], 202);
|
||||
$this->assertNotEmpty($deployment['body']['$id']);
|
||||
|
||||
$webhook = $this->getLastRequest();
|
||||
|
@ -602,7 +602,7 @@ class WebhooksCustomServerTest extends Scope
|
|||
|
||||
$executionId = $execution['body']['$id'] ?? '';
|
||||
|
||||
$this->assertEquals($execution['headers']['status-code'], 201);
|
||||
$this->assertEquals($execution['headers']['status-code'], 202);
|
||||
$this->assertNotEmpty($execution['body']['$id']);
|
||||
|
||||
$webhook = $this->getLastRequest();
|
||||
|
|
Loading…
Reference in a new issue