Merge branch '1.0.x' of https://github.com/appwrite/appwrite into chore-prepare-1-0-2
This commit is contained in:
commit
5d32ddb408
15 changed files with 149 additions and 92 deletions
|
@ -1,10 +1,12 @@
|
||||||
# Version 1.0.2
|
# Version 1.0.2
|
||||||
## Bugs
|
## Bugs
|
||||||
- Fixed migration for audit by migrating the `time` attribute [4038](https://github.com/appwrite/appwrite/pull/4038)
|
- Fixed default value for creating Boolean Attribute [#4040](https://github.com/appwrite/appwrite/pull/404)
|
||||||
|
- Fixed migration for audit by migrating the `time` attribute [#4038](https://github.com/appwrite/appwrite/pull/4038)
|
||||||
|
- Fixed phone authentication code to be hashed in the internal database [#3906](https://github.com/appwrite/appwrite/pull/3906)
|
||||||
|
|
||||||
# Version 1.0.1
|
# Version 1.0.1
|
||||||
## Bugs
|
## Bugs
|
||||||
- Fixed migration for abuse by migrating the `time` attribute [3839](https://github.com/appwrite/appwrite/pull/3839)
|
- Fixed migration for abuse by migrating the `time` attribute [#3839](https://github.com/appwrite/appwrite/pull/3839)
|
||||||
|
|
||||||
# Version 1.0.0
|
# Version 1.0.0
|
||||||
## BREAKING CHANGES
|
## BREAKING CHANGES
|
||||||
|
|
|
@ -378,7 +378,7 @@ To run end-2-end tests use:
|
||||||
docker compose exec appwrite test /usr/src/code/tests/e2e
|
docker compose exec appwrite test /usr/src/code/tests/e2e
|
||||||
```
|
```
|
||||||
|
|
||||||
To run end-2-end tests for a spcific service use:
|
To run end-2-end tests for a specific service use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
|
docker compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
|
||||||
|
|
15
README-CN.md
15
README-CN.md
|
@ -8,13 +8,16 @@
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io) -->
|
<!-- [![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) -->
|
||||||
|
|
||||||
|
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io)
|
||||||
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
|
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
|
||||||
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
|
[![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
|
||||||
[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite)
|
|
||||||
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
|
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
|
||||||
[![翻译](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
|
|
||||||
[![周边商店](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
|
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
|
||||||
|
<!-- [![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) -->
|
||||||
|
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
|
||||||
|
|
||||||
[English](README.md) | 简体中文
|
[English](README.md) | 简体中文
|
||||||
|
|
||||||
|
@ -128,7 +131,7 @@ docker run -it --rm ,
|
||||||
|
|
||||||
#### 服务器
|
#### 服务器
|
||||||
* ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (由 Appwrite 团队维护)
|
* ✅ [NodeJS](https://github.com/appwrite/sdk-for-node) (由 Appwrite 团队维护)
|
||||||
* ✅ [PHP](https://github.com/appwrite/sdk-for-php) (由 Appwr实验 团队维护)
|
* ✅ [PHP](https://github.com/appwrite/sdk-for-php) (由 Appwrite 团队维护)
|
||||||
* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) - (由 Appwrite 团队维护)
|
* ✅ [Dart](https://github.com/appwrite/sdk-for-dart) - (由 Appwrite 团队维护)
|
||||||
* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **公测** (由 Appwrite 团队维护)
|
* ✅ [Deno](https://github.com/appwrite/sdk-for-deno) - **公测** (由 Appwrite 团队维护)
|
||||||
* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) (由 Appwrite 团队维护)
|
* ✅ [Ruby](https://github.com/appwrite/sdk-for-ruby) (由 Appwrite 团队维护)
|
||||||
|
|
18
README.md
18
README.md
|
@ -11,15 +11,17 @@
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io) -->
|
|
||||||
<!-- [![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) -->
|
<!-- [![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite) -->
|
||||||
|
|
||||||
|
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=191120&style=flat-square)](https://hacktoberfest.appwrite.io)
|
||||||
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
|
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
|
||||||
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
|
|
||||||
[![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
|
[![Build Status](https://img.shields.io/github/workflow/status/appwrite/appwrite/Tests?label=tests&style=flat-square)](https://github.com/appwrite/appwrite/actions)
|
||||||
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
|
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
|
||||||
[![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
|
|
||||||
[![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
|
<!-- [![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite) -->
|
||||||
|
<!-- [![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md) -->
|
||||||
|
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
|
||||||
|
|
||||||
English | [简体中文](README-CN.md)
|
English | [简体中文](README-CN.md)
|
||||||
|
|
||||||
|
@ -91,10 +93,10 @@ docker run -it --rm ^
|
||||||
#### PowerShell
|
#### PowerShell
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
docker run -it --rm ,
|
docker run -it --rm `
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
--volume /var/run/docker.sock:/var/run/docker.sock `
|
||||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
||||||
--entrypoint="install" ,
|
--entrypoint="install" `
|
||||||
appwrite/appwrite:1.0.2
|
appwrite/appwrite:1.0.2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of publicly accessiable system events
|
* List of publicly accessible system events
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Appwrite\Utopia\Response;
|
use Appwrite\Utopia\Response;
|
||||||
|
|
|
@ -17,7 +17,7 @@ return [ // Ordered by ABC.
|
||||||
'icon' => 'icon-apple',
|
'icon' => 'icon-apple',
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
'sandbox' => false,
|
'sandbox' => false,
|
||||||
'form' => 'apple.phtml', // Perperation for adding ability to customized OAuth UI forms, currently handled hardcoded.
|
'form' => 'apple.phtml', // Preparation for adding ability to customized OAuth UI forms, currently handled hardcoded.
|
||||||
'beta' => true,
|
'beta' => true,
|
||||||
'mock' => false,
|
'mock' => false,
|
||||||
],
|
],
|
||||||
|
|
|
@ -937,7 +937,7 @@ App::post('/v1/account/sessions/phone')
|
||||||
'userId' => $user->getId(),
|
'userId' => $user->getId(),
|
||||||
'userInternalId' => $user->getInternalId(),
|
'userInternalId' => $user->getInternalId(),
|
||||||
'type' => Auth::TOKEN_TYPE_PHONE,
|
'type' => Auth::TOKEN_TYPE_PHONE,
|
||||||
'secret' => $secret,
|
'secret' => Auth::hash($secret),
|
||||||
'expire' => $expire,
|
'expire' => $expire,
|
||||||
'userAgent' => $request->getUserAgent('UNKNOWN'),
|
'userAgent' => $request->getUserAgent('UNKNOWN'),
|
||||||
'ip' => $request->getIP(),
|
'ip' => $request->getIP(),
|
||||||
|
@ -2265,7 +2265,7 @@ App::post('/v1/account/verification/phone')
|
||||||
'userId' => $user->getId(),
|
'userId' => $user->getId(),
|
||||||
'userInternalId' => $user->getInternalId(),
|
'userInternalId' => $user->getInternalId(),
|
||||||
'type' => Auth::TOKEN_TYPE_PHONE,
|
'type' => Auth::TOKEN_TYPE_PHONE,
|
||||||
'secret' => $secret,
|
'secret' => Auth::hash($secret),
|
||||||
'expire' => $expire,
|
'expire' => $expire,
|
||||||
'userAgent' => $request->getUserAgent('UNKNOWN'),
|
'userAgent' => $request->getUserAgent('UNKNOWN'),
|
||||||
'ip' => $request->getIP(),
|
'ip' => $request->getIP(),
|
||||||
|
|
|
@ -89,11 +89,11 @@ function createAttribute(string $databaseId, string $collectionId, Document $att
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must throw here since dbForProject->createAttribute is performed by db worker
|
// Must throw here since dbForProject->createAttribute is performed by db worker
|
||||||
if ($required && $default) {
|
if ($required && isset($default)) {
|
||||||
throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for required attribute');
|
throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for required attribute');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($array && $default) {
|
if ($array && isset($default)) {
|
||||||
throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for array attributes');
|
throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for array attributes');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -935,6 +935,67 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
||||||
$response->noContent();
|
$response->noContent();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
|
||||||
|
->groups(['api', 'functions'])
|
||||||
|
->desc('Create Build')
|
||||||
|
->label('scope', 'functions.write')
|
||||||
|
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
||||||
|
->label('audits.event', 'deployment.update')
|
||||||
|
->label('audits.resource', 'function/{request.functionId}')
|
||||||
|
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||||
|
->label('sdk.namespace', 'functions')
|
||||||
|
->label('sdk.method', 'createBuild')
|
||||||
|
->label('sdk.description', '/docs/references/functions/create-build.md')
|
||||||
|
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||||
|
->label('sdk.response.model', Response::MODEL_NONE)
|
||||||
|
->param('functionId', '', new UID(), 'Function ID.')
|
||||||
|
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||||
|
->param('buildId', '', new UID(), 'Build unique ID.')
|
||||||
|
->inject('response')
|
||||||
|
->inject('dbForProject')
|
||||||
|
->inject('project')
|
||||||
|
->inject('events')
|
||||||
|
->action(function (string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Document $project, Event $events) {
|
||||||
|
|
||||||
|
$function = $dbForProject->getDocument('functions', $functionId);
|
||||||
|
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
||||||
|
|
||||||
|
if ($function->isEmpty()) {
|
||||||
|
throw new Exception(Exception::FUNCTION_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($deployment->isEmpty()) {
|
||||||
|
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
$build = Authorization::skip(fn () => $dbForProject->getDocument('builds', $buildId));
|
||||||
|
|
||||||
|
if ($build->isEmpty()) {
|
||||||
|
throw new Exception(Exception::BUILD_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($build->getAttribute('status') !== 'failed') {
|
||||||
|
throw new Exception(Exception::BUILD_IN_PROGRESS, 'Build not failed');
|
||||||
|
}
|
||||||
|
|
||||||
|
$events
|
||||||
|
->setParam('functionId', $function->getId())
|
||||||
|
->setParam('deploymentId', $deployment->getId());
|
||||||
|
|
||||||
|
// Retry the build
|
||||||
|
$buildEvent = new Build();
|
||||||
|
$buildEvent
|
||||||
|
->setType(BUILD_TYPE_RETRY)
|
||||||
|
->setResource($function)
|
||||||
|
->setDeployment($deployment)
|
||||||
|
->setProject($project)
|
||||||
|
->trigger();
|
||||||
|
|
||||||
|
$response->noContent();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
App::post('/v1/functions/:functionId/executions')
|
App::post('/v1/functions/:functionId/executions')
|
||||||
->groups(['api', 'functions'])
|
->groups(['api', 'functions'])
|
||||||
->desc('Create Execution')
|
->desc('Create Execution')
|
||||||
|
@ -1258,65 +1319,6 @@ App::get('/v1/functions/:functionId/executions/:executionId')
|
||||||
$response->dynamic($execution, Response::MODEL_EXECUTION);
|
$response->dynamic($execution, Response::MODEL_EXECUTION);
|
||||||
});
|
});
|
||||||
|
|
||||||
App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
|
|
||||||
->groups(['api', 'functions'])
|
|
||||||
->desc('Retry Build')
|
|
||||||
->label('scope', 'functions.write')
|
|
||||||
->label('event', 'functions.[functionId].deployments.[deploymentId].update')
|
|
||||||
->label('audits.event', 'deployment.update')
|
|
||||||
->label('audits.resource', 'function/{request.functionId}')
|
|
||||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
|
||||||
->label('sdk.namespace', 'functions')
|
|
||||||
->label('sdk.method', 'retryBuild')
|
|
||||||
->label('sdk.description', '/docs/references/functions/retry-build.md')
|
|
||||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
|
||||||
->label('sdk.response.model', Response::MODEL_NONE)
|
|
||||||
->param('functionId', '', new UID(), 'Function ID.')
|
|
||||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
|
||||||
->param('buildId', '', new UID(), 'Build unique ID.')
|
|
||||||
->inject('response')
|
|
||||||
->inject('dbForProject')
|
|
||||||
->inject('project')
|
|
||||||
->inject('events')
|
|
||||||
->action(function (string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Document $project, Event $events) {
|
|
||||||
|
|
||||||
$function = $dbForProject->getDocument('functions', $functionId);
|
|
||||||
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
|
||||||
|
|
||||||
if ($function->isEmpty()) {
|
|
||||||
throw new Exception(Exception::FUNCTION_NOT_FOUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($deployment->isEmpty()) {
|
|
||||||
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
$build = Authorization::skip(fn () => $dbForProject->getDocument('builds', $buildId));
|
|
||||||
|
|
||||||
if ($build->isEmpty()) {
|
|
||||||
throw new Exception(Exception::BUILD_NOT_FOUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($build->getAttribute('status') !== 'failed') {
|
|
||||||
throw new Exception(Exception::BUILD_IN_PROGRESS, 'Build not failed');
|
|
||||||
}
|
|
||||||
|
|
||||||
$events
|
|
||||||
->setParam('functionId', $function->getId())
|
|
||||||
->setParam('deploymentId', $deployment->getId());
|
|
||||||
|
|
||||||
// Retry the build
|
|
||||||
$buildEvent = new Build();
|
|
||||||
$buildEvent
|
|
||||||
->setType(BUILD_TYPE_RETRY)
|
|
||||||
->setResource($function)
|
|
||||||
->setDeployment($deployment)
|
|
||||||
->setProject($project)
|
|
||||||
->trigger();
|
|
||||||
|
|
||||||
$response->noContent();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
|
||||||
App::post('/v1/functions/:functionId/variables')
|
App::post('/v1/functions/:functionId/variables')
|
||||||
|
|
12
composer.lock
generated
12
composer.lock
generated
|
@ -5283,16 +5283,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/twig",
|
"name": "twig/twig",
|
||||||
"version": "v3.4.2",
|
"version": "v3.4.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/twigphp/Twig.git",
|
"url": "https://github.com/twigphp/Twig.git",
|
||||||
"reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077"
|
"reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077",
|
"url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58",
|
||||||
"reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077",
|
"reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -5343,7 +5343,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/twigphp/Twig/issues",
|
"issues": "https://github.com/twigphp/Twig/issues",
|
||||||
"source": "https://github.com/twigphp/Twig/tree/v3.4.2"
|
"source": "https://github.com/twigphp/Twig/tree/v3.4.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -5355,7 +5355,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-08-12T06:47:24+00:00"
|
"time": "2022-09-28T08:42:51+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
|
|
@ -760,7 +760,7 @@ services:
|
||||||
# MailCatcher - An SMTP server. Catches all system emails and displays them in a nice UI.
|
# MailCatcher - An SMTP server. Catches all system emails and displays them in a nice UI.
|
||||||
# RequestCatcher - An HTTP server. Catches all system https calls and displays them using a simple HTTP API. Used to debug & tests webhooks and HTTP tasks
|
# RequestCatcher - An HTTP server. Catches all system https calls and displays them using a simple HTTP API. Used to debug & tests webhooks and HTTP tasks
|
||||||
# RedisCommander - A nice UI for exploring Redis data
|
# RedisCommander - A nice UI for exploring Redis data
|
||||||
# Resque - A nice UI for exploring Reddis pub/sub, view the different queues workloads, pending and failed tasks
|
# Resque - A nice UI for exploring Redis pub/sub, view the different queues workloads, pending and failed tasks
|
||||||
# Chronograf - A nice UI for exploring InfluxDB data
|
# Chronograf - A nice UI for exploring InfluxDB data
|
||||||
# Webgrind - A nice UI for exploring and debugging code-level stuff
|
# Webgrind - A nice UI for exploring and debugging code-level stuff
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
convertNoticesToExceptions="true"
|
convertNoticesToExceptions="true"
|
||||||
convertWarningsToExceptions="true"
|
convertWarningsToExceptions="true"
|
||||||
processIsolation="false"
|
processIsolation="false"
|
||||||
stopOnFailure="true"
|
stopOnFailure="false"
|
||||||
>
|
>
|
||||||
<extensions>
|
<extensions>
|
||||||
<extension class="Appwrite\Tests\TestHook" />
|
<extension class="Appwrite\Tests\TestHook" />
|
||||||
|
|
|
@ -336,7 +336,7 @@ class Auth
|
||||||
$token->isSet('secret') &&
|
$token->isSet('secret') &&
|
||||||
$token->isSet('expire') &&
|
$token->isSet('expire') &&
|
||||||
$token->getAttribute('type') == Auth::TOKEN_TYPE_PHONE &&
|
$token->getAttribute('type') == Auth::TOKEN_TYPE_PHONE &&
|
||||||
$token->getAttribute('secret') === $secret &&
|
$token->getAttribute('secret') === self::hash($secret) &&
|
||||||
DateTime::formatTz($token->getAttribute('expire')) >= DateTime::formatTz(DateTime::now())
|
DateTime::formatTz($token->getAttribute('expire')) >= DateTime::formatTz(DateTime::now())
|
||||||
) {
|
) {
|
||||||
return (string) $token->getId();
|
return (string) $token->getId();
|
||||||
|
|
|
@ -12,7 +12,7 @@ class Exception extends \Exception
|
||||||
* Naming the error types based on the following convention
|
* Naming the error types based on the following convention
|
||||||
* <ENTITY>_<ERROR_TYPE>
|
* <ENTITY>_<ERROR_TYPE>
|
||||||
*
|
*
|
||||||
* Appwrite has the follwing entities:
|
* Appwrite has the following entities:
|
||||||
* - General
|
* - General
|
||||||
* - Users
|
* - Users
|
||||||
* - Teams
|
* - Teams
|
||||||
|
|
|
@ -2968,4 +2968,52 @@ trait DatabasesBase
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @depends testCreateDatabase
|
||||||
|
*/
|
||||||
|
public function testAttributeBooleanDefault(array $data): void
|
||||||
|
{
|
||||||
|
$databaseId = $data['databaseId'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for SUCCESS
|
||||||
|
*/
|
||||||
|
$collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([
|
||||||
|
'content-type' => 'application/json',
|
||||||
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||||
|
]), [
|
||||||
|
'collectionId' => ID::unique(),
|
||||||
|
'name' => 'Boolean'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertEquals(201, $collection['headers']['status-code']);
|
||||||
|
|
||||||
|
$collectionId = $collection['body']['$id'];
|
||||||
|
|
||||||
|
$true = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/boolean', array_merge([
|
||||||
|
'content-type' => 'application/json',
|
||||||
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||||
|
]), [
|
||||||
|
'key' => 'true',
|
||||||
|
'required' => false,
|
||||||
|
'default' => true
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertEquals(202, $true['headers']['status-code']);
|
||||||
|
|
||||||
|
$false = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/boolean', array_merge([
|
||||||
|
'content-type' => 'application/json',
|
||||||
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
|
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||||
|
]), [
|
||||||
|
'key' => 'false',
|
||||||
|
'required' => false,
|
||||||
|
'default' => false
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertEquals(202, $false['headers']['status-code']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue