1
0
Fork 0
mirror of synced 2024-06-14 08:44:49 +12:00

Merge branch '0.16.x' of github.com:appwrite/appwrite into origin/datetime-attributes

 Conflicts:
	composer.lock
	src/Appwrite/Stats/Usage.php
This commit is contained in:
fogelito 2022-08-09 14:20:26 +03:00
commit 82a240998b
69 changed files with 394 additions and 247 deletions

View file

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

View file

@ -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!

View file

@ -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 的本机主机上完成安装后,服务器可能需要几分钟才能启动。

View file

@ -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.
@ -99,6 +99,30 @@ For advanced production and custom installation, check out our Docker [environme
If you are upgrading your Appwrite server from an older version, you should use the Appwrite migration tool once your setup is completed. For more information regarding this, check out the [Installation Docs](https://appwrite.io/docs/installation).
## One-Click Setups
In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running with Appwrite quickly without installing Docker on your local machine.
Choose from one of the providers below:
<table border="0">
<tr>
<td align="center" width="100" height="100">
<a href="https://marketplace.digitalocean.com/apps/appwrite">
<img width="50" height="39" src="public/images/integrations/digitalocean-logo.svg" alt="DigitalOcean Logo" />
<br /><sub><b>DigitalOcean</b></sub></a>
</a>
</td>
<td align="center" width="100" height="100">
<a href="https://gitpod.io/#https://github.com/appwrite/integration-for-gitpod">
<img width="50" height="39" src="public/images/integrations/gitpod-logo.svg" alt="Gitpod Logo" />
<br /><sub><b>Gitpod</b></sub></a>
</a>
</td>
</tr>
</table>
## Getting Started
Getting started with Appwrite is as easy as creating a new project, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials.

View file

@ -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,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -68,7 +68,7 @@ return [
'default' => 'localhost',
'required' => true,
'question' => 'Enter a DNS A record hostname to serve as a CNAME for your custom domains.' . PHP_EOL . 'You can use the same value as used for the Appwrite hostname.',
'filter' => ''
'filter' => 'domainTarget'
],
[
'name' => '_APP_CONSOLE_WHITELIST_ROOT',
@ -647,7 +647,7 @@ return [
],
[
'name' => '_APP_FUNCTIONS_TIMEOUT',
'description' => 'The maximum number of seconds allowed as a timeout value when creating a new function. The default value is 900 seconds.',
'description' => 'The maximum number of seconds allowed as a timeout value when creating a new function. The default value is 900 seconds. This is the global limit, timeout for individual functions are configured in the function\'s settings or in appwrite.json.',
'introduction' => '0.7.0',
'default' => '900',
'required' => false,

View file

@ -285,7 +285,7 @@ App::get('/v1/databases/:databaseId')
->label('sdk.description', '/docs/references/databases/get.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_COLLECTION)
->label('sdk.response.model', Response::MODEL_DATABASE)
->param('databaseId', '', new UID(), 'Database ID.')
->inject('response')
->inject('dbForProject')
@ -393,7 +393,7 @@ App::put('/v1/databases/:databaseId')
->label('sdk.description', '/docs/references/databases/update.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_COLLECTION)
->label('sdk.response.model', Response::MODEL_DATABASE)
->param('databaseId', '', new UID(), 'Database ID.')
->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.')
->inject('response')
@ -883,7 +883,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.')
@ -916,6 +916,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);
});
@ -929,7 +930,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.')
@ -956,6 +957,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);
});
@ -969,7 +971,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.')
@ -1012,6 +1014,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);
});
@ -1025,7 +1028,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.')
@ -1052,6 +1055,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);
});
@ -1065,7 +1069,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.')
@ -1092,6 +1096,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);
});
@ -1105,7 +1110,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.')
@ -1161,6 +1166,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);
});
@ -1174,7 +1180,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.')
@ -1233,6 +1239,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);
});
@ -1246,7 +1253,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.')
@ -1272,6 +1279,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);
});
@ -1492,7 +1500,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.')
@ -1634,7 +1642,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);
});

View file

@ -453,7 +453,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.')
@ -622,7 +622,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);
});
@ -806,7 +806,8 @@ App::post('/v1/functions/:functionId/executions')
->inject('dbForProject')
->inject('user')
->inject('events')
->action(function (string $functionId, string $data, bool $async, Response $response, Document $project, Database $dbForProject, Document $user, Event $events) {
->inject('usage')
->action(function (string $functionId, string $data, bool $async, Response $response, Document $project, Database $dbForProject, Document $user, Event $events, Stats $usage) {
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
@ -905,7 +906,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);
}
@ -957,6 +958,12 @@ App::post('/v1/functions/:functionId/executions')
Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution));
$usage
->setParam('functionId', $function->getId())
->setParam('functionExecution', 1)
->setParam('functionStatus', $execution->getAttribute('status', ''))
->setParam('functionExecutionTime', $execution->getAttribute('time') * 1000); // ms
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
->dynamic($execution, Response::MODEL_EXECUTION);

View file

@ -28,6 +28,7 @@ use Appwrite\Auth\Phone\Telesign;
use Appwrite\Auth\Phone\TextMagic;
use Appwrite\Auth\Phone\Twilio;
use Appwrite\Auth\Phone\Msg91;
use Appwrite\Auth\Phone\Vonage;
use Appwrite\DSN\DSN;
use Appwrite\Event\Audit;
use Appwrite\Event\Database as EventDatabase;
@ -88,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';
@ -992,6 +993,7 @@ App::setResource('phone', function () {
'text-magic' => new TextMagic($user, $secret),
'telesign' => new Telesign($user, $secret),
'msg91' => new Msg91($user, $secret),
'vonage' => new Vonage($user, $secret),
default => null
};
});

View file

@ -173,6 +173,16 @@ $cli
if (empty($input[$var['name']])) {
$input[$var['name']] = $var['default'];
}
if ($var['filter'] === 'domainTarget') {
if ($input[$var['name']] !== 'localhost') {
Console::warning("\nIf you haven't already done so, set the following record for {$input[$var['name']]} on your DNS provider:\n");
$mask = "%-15.15s %-10.10s %-30.30s\n";
printf($mask, "Type", "Name", "Value");
printf($mask, "A or AAAA", "@", "<YOUR PUBLIC IP>");
Console::warning("\nUse 'AAAA' if you're using an IPv6 address and 'A' if you're using an IPv4 address.\n");
}
}
}
$templateForCompose = new View(__DIR__ . '/../views/install/compose.phtml');

View file

@ -6,6 +6,7 @@ use Appwrite\Auth\Phone\Telesign;
use Appwrite\Auth\Phone\TextMagic;
use Appwrite\Auth\Phone\Twilio;
use Appwrite\Auth\Phone\Msg91;
use Appwrite\Auth\Phone\Vonage;
use Appwrite\DSN\DSN;
use Appwrite\Resque\Worker;
use Utopia\App;
@ -38,6 +39,7 @@ class MessagingV1 extends Worker
'text-magic' => new TextMagic($user, $secret),
'telesign' => new Telesign($user, $secret),
'msg91' => new Msg91($user, $secret),
'vonage' => new Vonage($user, $secret),
default => null
};

View file

@ -48,7 +48,7 @@
"utopia-php/analytics": "0.2.*",
"utopia-php/audit": "dev-origin/unix-to-datetime as 0.8.2",
"utopia-php/cache": "0.6.*",
"utopia-php/cli": "0.12.*",
"utopia-php/cli": "0.13.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "dev-feat-attr-datetime as 0.18.7",
"utopia-php/locale": "0.4.*",
@ -59,7 +59,7 @@
"utopia-php/storage": "0.9.*",
"utopia-php/websocket": "0.1.0",
"utopia-php/image": "0.5.*",
"utopia-php/orchestration": "0.4.*",
"utopia-php/orchestration": "0.6.*",
"resque/php-resque": "1.3.6",
"matomo/device-detector": "6.0.0",
"dragonmantank/cron-expression": "3.3.1",

98
composer.lock generated
View file

@ -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": "ee1576a5196e871bbb6e4c5e9216798a",
"content-hash": "677b1b47c8567f0b7b05645e2bbc7bc7",
"packages": [
{
"name": "adhocore/jwt",
@ -1733,23 +1733,22 @@
},
{
"name": "utopia-php/abuse",
"version": "dev-origin/timestamp-to-datetime",
"version": "0.7.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/abuse.git",
"reference": "24fea23637e08267c2f35ae7704b249566d8333f"
"reference": "52fb20e39e2e9619948bc0a73b52e10caa71350d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/abuse/zipball/24fea23637e08267c2f35ae7704b249566d8333f",
"reference": "24fea23637e08267c2f35ae7704b249566d8333f",
"url": "https://api.github.com/repos/utopia-php/abuse/zipball/52fb20e39e2e9619948bc0a73b52e10caa71350d",
"reference": "52fb20e39e2e9619948bc0a73b52e10caa71350d",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-pdo": "*",
"php": ">=8.0",
"utopia-php/database": "dev-feat-attr-datetime as 0.18.7"
"utopia-php/database": ">=0.11 <1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.4",
@ -1781,9 +1780,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/abuse/issues",
"source": "https://github.com/utopia-php/abuse/tree/origin/timestamp-to-datetime"
"source": "https://github.com/utopia-php/abuse/tree/0.7.0"
},
"time": "2022-07-21T08:08:35+00:00"
"time": "2021-12-27T13:06:45+00:00"
},
{
"name": "utopia-php/analytics",
@ -1842,22 +1841,22 @@
},
{
"name": "utopia-php/audit",
"version": "dev-origin/unix-to-datetime",
"version": "0.8.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/audit.git",
"reference": "5ac8411ad876b1e2fd81a70aacc8342266b40776"
"reference": "b46dc42614a69437c45eb229249b6a6d000122c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/audit/zipball/5ac8411ad876b1e2fd81a70aacc8342266b40776",
"reference": "5ac8411ad876b1e2fd81a70aacc8342266b40776",
"url": "https://api.github.com/repos/utopia-php/audit/zipball/b46dc42614a69437c45eb229249b6a6d000122c1",
"reference": "b46dc42614a69437c45eb229249b6a6d000122c1",
"shasum": ""
},
"require": {
"ext-pdo": "*",
"php": ">=8.0",
"utopia-php/database": "dev-feat-attr-datetime as 0.18.7"
"utopia-php/database": ">=0.11 <1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
@ -1889,9 +1888,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/audit/issues",
"source": "https://github.com/utopia-php/audit/tree/origin/unix-to-datetime"
"source": "https://github.com/utopia-php/audit/tree/0.8.0"
},
"time": "2022-07-20T16:51:33+00:00"
"time": "2021-12-27T13:05:56+00:00"
},
{
"name": "utopia-php/cache",
@ -1948,16 +1947,16 @@
},
{
"name": "utopia-php/cli",
"version": "0.12.0",
"version": "0.13.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/cli.git",
"reference": "6d164b752efeb1ca089e3a517bc274d8b383474b"
"reference": "69e68f8ed525fe162fae950a0507ed28a0f179bc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/cli/zipball/6d164b752efeb1ca089e3a517bc274d8b383474b",
"reference": "6d164b752efeb1ca089e3a517bc274d8b383474b",
"url": "https://api.github.com/repos/utopia-php/cli/zipball/69e68f8ed525fe162fae950a0507ed28a0f179bc",
"reference": "69e68f8ed525fe162fae950a0507ed28a0f179bc",
"shasum": ""
},
"require": {
@ -1995,9 +1994,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/cli/issues",
"source": "https://github.com/utopia-php/cli/tree/0.12.0"
"source": "https://github.com/utopia-php/cli/tree/0.13.0"
},
"time": "2022-02-18T22:10:41+00:00"
"time": "2022-04-26T08:41:22+00:00"
},
{
"name": "utopia-php/config",
@ -2052,16 +2051,16 @@
},
{
"name": "utopia-php/database",
"version": "dev-feat-attr-datetime",
"version": "0.18.9",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "6bcbf8d5a55f9da6d955f6428eff4724d04f60d8"
"reference": "227b3ca919149b7b0d6556c8effe9ee46ed081e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/6bcbf8d5a55f9da6d955f6428eff4724d04f60d8",
"reference": "6bcbf8d5a55f9da6d955f6428eff4724d04f60d8",
"url": "https://api.github.com/repos/utopia-php/database/zipball/227b3ca919149b7b0d6556c8effe9ee46ed081e6",
"reference": "227b3ca919149b7b0d6556c8effe9ee46ed081e6",
"shasum": ""
},
"require": {
@ -2110,9 +2109,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/feat-attr-datetime"
"source": "https://github.com/utopia-php/database/tree/0.18.9"
},
"time": "2022-07-20T17:14:33+00:00"
"time": "2022-07-19T09:42:53+00:00"
},
{
"name": "utopia-php/domains",
@ -2388,21 +2387,21 @@
},
{
"name": "utopia-php/orchestration",
"version": "0.4.1",
"version": "0.6.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/orchestration.git",
"reference": "67cf0ab15a096d274c093ea918aa4ace14ac7af7"
"reference": "94263976413871efb6b16157a7101a81df3b6d78"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/orchestration/zipball/67cf0ab15a096d274c093ea918aa4ace14ac7af7",
"reference": "67cf0ab15a096d274c093ea918aa4ace14ac7af7",
"url": "https://api.github.com/repos/utopia-php/orchestration/zipball/94263976413871efb6b16157a7101a81df3b6d78",
"reference": "94263976413871efb6b16157a7101a81df3b6d78",
"shasum": ""
},
"require": {
"php": ">=8.0",
"utopia-php/cli": "0.12.*"
"utopia-php/cli": "0.13.*"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
@ -2437,9 +2436,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/orchestration/issues",
"source": "https://github.com/utopia-php/orchestration/tree/0.4.1"
"source": "https://github.com/utopia-php/orchestration/tree/0.6.0"
},
"time": "2022-02-20T09:23:06+00:00"
"time": "2022-07-13T16:47:18+00:00"
},
{
"name": "utopia-php/preloader",
@ -5347,32 +5346,9 @@
"time": "2022-05-17T05:48:52+00:00"
}
],
"aliases": [
{
"package": "utopia-php/abuse",
"version": "dev-origin/timestamp-to-datetime",
"alias": "0.7.2",
"alias_normalized": "0.7.2.0"
},
{
"package": "utopia-php/audit",
"version": "dev-origin/unix-to-datetime",
"alias": "0.8.2",
"alias_normalized": "0.8.2.0"
},
{
"package": "utopia-php/database",
"version": "dev-feat-attr-datetime",
"alias": "0.18.7",
"alias_normalized": "0.18.7.0"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"utopia-php/abuse": 20,
"utopia-php/audit": 20,
"utopia-php/database": 20
},
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
@ -5394,5 +5370,5 @@
"platform-overrides": {
"php": "8.0"
},
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.3.0"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="65.2 173.5 180 180" style="enable-background:new 65.2 173.5 180 180;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0080FF;}
</style>
<g id="XMLID_229_">
<g id="XMLID_690_">
<g id="XMLID_691_">
<g>
<g id="XMLID_44_">
<g id="XMLID_48_">
<path id="XMLID_49_" class="st0" d="M155.2,351.7v-34.2c36.2,0,64.3-35.9,50.4-74c-5.1-14.1-16.4-25.4-30.5-30.5
c-38.1-13.8-74,14.2-74,50.4l0,0H67c0-57.7,55.8-102.7,116.3-83.8c26.4,8.3,47.5,29.3,55.7,55.7
C257.9,295.9,213,351.7,155.2,351.7z"/>
</g>
<polygon id="XMLID_47_" class="st0" points="155.3,317.6 121.3,317.6 121.3,283.6 121.3,283.6 155.3,283.6 155.3,283.6
"/>
<polygon id="XMLID_46_" class="st0" points="121.3,343.8 95.1,343.8 95.1,343.8 95.1,317.6 121.3,317.6 "/>
<path id="XMLID_45_" class="st0" d="M95.1,317.6H73.2l0,0v-21.9l0,0h21.9l0,0V317.6z"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,9 @@
<svg viewBox="0 0 189 208" width="90" height="100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M112.287 10.3584C117.9 20.2129 114.487 32.7666 104.664 38.3978L43.5862 73.41C41.9693 74.3369 40.972 76.0577 40.972 77.9209V132.899C40.972 134.763 41.9693 136.483 43.5862 137.41L91.9123 165.113C93.515 166.032 95.485 166.032 97.0877 165.113L145.414 137.41C147.031 136.483 148.028 134.763 148.028 132.899V98.7091L104.567 123.309C94.7131 128.886 82.2179 125.394 76.6581 115.509C71.0983 105.624 74.5793 93.0891 84.4331 87.5117L146.62 52.3128C165.563 41.591 189 55.321 189 77.1398V137.066C189 151.102 181.503 164.062 169.355 171.026L113.844 202.847C101.858 209.718 87.1424 209.718 75.1558 202.847L19.6453 171.026C7.49714 164.062 0 151.102 0 137.066V73.7544C0 59.7184 7.49714 46.7585 19.6453 39.7947L84.3361 2.71125C94.1595 -2.91993 106.673 0.503802 112.287 10.3584Z" fill="url(#paint0_linear)"/>
<defs>
<linearGradient id="paint0_linear" x1="142.253" y1="31.4537" x2="44.8052" y2="184.17" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFB45B"/>
<stop offset="1" stop-color="#FF8A00"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

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

View file

@ -0,0 +1,41 @@
<?php
namespace Appwrite\Auth\Phone;
use Appwrite\Auth\Phone;
// Reference Material
// https://developer.vonage.com/api/sms
class Vonage extends Phone
{
/**
* @var string
*/
private string $endpoint = 'https://rest.nexmo.com/sms/json';
/**
* @param string $from
* @param string $to
* @param string $message
* @return void
*/
public function send(string $from, string $to, string $message): void
{
$to = ltrim($to, '+');
$headers = ['Content-Type: application/x-www-form-urlencoded'];
$this->request(
method: 'POST',
url: $this->endpoint,
headers: $headers,
payload: \http_build_query([
'text' => $message,
'from' => $from,
'to' => $to,
'api_key' => $this->user,
'api_secret' => $this->secret
])
);
}
}

View file

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

View file

@ -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':
/**

View file

@ -95,7 +95,7 @@ class Usage
],
'databases.databaseId.collections.collectionId.documents.create' => [
'table' => 'appwrite_usage_databases_documents_create',
'groupBy' => ['collectionId'],
'groupBy' => ['databaseId', 'collectionId'],
],
'databases.databaseId.collections.collectionId.documents.read' => [
'table' => 'appwrite_usage_databases_documents_read',
@ -292,37 +292,44 @@ class Usage
$query .= "GROUP BY time({$period['key']}), \"projectId\" {$groupBy} ";
$query .= "FILL(null)";
$result = $this->influxDB->query($query);
try {
$result = $this->influxDB->query($query);
$points = $result->getPoints();
foreach ($points as $point) {
$projectId = $point['projectId'];
$points = $result->getPoints();
foreach ($points as $point) {
$projectId = $point['projectId'];
if (!empty($projectId) && $projectId !== 'console') {
$metricUpdated = $metric;
if (!empty($projectId) && $projectId !== 'console') {
$metricUpdated = $metric;
if (!empty($groupBy)) {
foreach ($options['groupBy'] as $groupBy) {
$groupedBy = $point[$groupBy] ?? '';
if (empty($groupedBy)) {
continue;
if (!empty($groupBy)) {
foreach ($options['groupBy'] as $groupBy) {
$groupedBy = $point[$groupBy] ?? '';
if (empty($groupedBy)) {
continue;
}
$metricUpdated = str_replace($groupBy, $groupedBy, $metricUpdated);
}
$metricUpdated = str_replace($groupBy, $groupedBy, $metric);
}
}
//$time = \strtotime($point['time']);
$time = $point['time']; //todo: check is this datetime format?
$value = (!empty($point['value'])) ? $point['value'] : 0;
$this->createOrUpdateMetric(
$projectId,
$time,
$period['key'],
$metricUpdated,
$value,
0
);
$this->createOrUpdateMetric(
$projectId,
$time,
$period['key'],
$metricUpdated,
$value,
0
);
}
}
} catch (\Exception $e) { // if projects are deleted this might fail
if (is_callable($this->errorHandler)) {
call_user_func($this->errorHandler, $e, "sync_metric_{$metric}_influxdb");
} else {
throw $e;
}
}
}

View file

@ -166,23 +166,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);
@ -319,7 +319,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']);
@ -327,7 +327,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']);
@ -335,7 +335,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']);
@ -345,7 +345,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']);
@ -353,7 +353,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']);
@ -361,7 +361,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']);
@ -370,7 +370,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']);
@ -379,7 +379,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']);
@ -706,7 +706,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']);
@ -722,7 +722,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']);
@ -738,7 +738,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']);
@ -1690,15 +1690,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']);
@ -2145,7 +2145,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
@ -2161,7 +2161,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
@ -2293,7 +2293,7 @@ trait DatabasesBase
'attributes' => ['title'],
]);
$this->assertEquals($uniqueIndex['headers']['status-code'], 201);
$this->assertEquals($uniqueIndex['headers']['status-code'], 202);
sleep(2);
@ -2465,7 +2465,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);

View file

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

View file

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

View file

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

View file

@ -89,7 +89,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);
@ -118,7 +118,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'], [
@ -179,7 +179,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',
@ -196,7 +196,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'] ?? '';
@ -271,7 +271,7 @@ class FunctionsCustomClientTest extends Scope
'data' => 'foobar',
]);
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals(202, $execution['headers']['status-code']);
sleep(10);
@ -361,7 +361,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);

View file

@ -293,7 +293,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->assertEquals(true, DateTime::isValid($deployment['body']['$createdAt']));
$this->assertEquals('index.php', $deployment['body']['entrypoint']);
@ -342,7 +342,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->assertEquals(true, DateTime::isValid($largeTag['body']['$createdAt']));
$this->assertEquals('index.php', $largeTag['body']['entrypoint']);
@ -485,7 +485,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->assertEquals(true, DateTime::isValid($execution['body']['$createdAt']));
@ -734,7 +734,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);
@ -748,7 +748,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);
@ -819,7 +819,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);
@ -840,7 +840,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'] ?? '';
@ -931,7 +931,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);
@ -945,7 +945,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'] ?? '';
@ -1036,7 +1036,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);
@ -1050,7 +1050,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'] ?? '';
@ -1141,7 +1141,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);
@ -1155,7 +1155,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'] ?? '';
@ -1246,7 +1246,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);
@ -1260,7 +1260,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'] ?? '';
@ -1351,7 +1351,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);
@ -1365,7 +1365,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'] ?? '';

View file

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

View file

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

View file

@ -116,11 +116,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

View file

@ -83,7 +83,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
@ -506,7 +506,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();
@ -596,7 +596,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();