Merge branch 'feat-database-indexing' of github.com:appwrite/appwrite into feat-sync-session-collection

This commit is contained in:
Eldad Fux 2021-07-16 18:00:05 +03:00
commit 78689f2878
6 changed files with 11 additions and 4 deletions

View file

@ -237,8 +237,11 @@ App::post('/v1/database/collections/:collectionId/attributes')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_ATTRIBUTE)
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
// TODO@kodumbeats attributeId
->param('id', '', new Key(), 'Attribute ID.')
// TODO@kodumbeats whitelist (allowlist)
->param('type', null, new Text(8), 'Attribute type.')
// TODO@kodumbeats hide size for ints/floats/bools
->param('size', null, new Integer(), 'Attribute size for text attributes, in number of characters. For integers, floats, or bools, use 0.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Wildcard(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true)
@ -745,6 +748,7 @@ App::get('/v1/database/collections/:collectionId/documents')
->param('queries', [], new ArrayList(new Text(128)), 'Array of query strings.', true)
->param('limit', 25, new Range(0, 100), 'Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0, new Range(0, 900000000), 'Offset value. The default value is 0. Use this param to manage pagination.', true)
// TODO@kodumbeats 'after' param for pagination
->param('orderAttributes', [], new ArrayList(new Text(128)), 'Array of attributes used to sort results.', true)
->param('orderTypes', [], new ArrayList(new WhiteList(['DESC', 'ASC'], true)), 'Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.', true)
->inject('response')

View file

@ -1006,7 +1006,7 @@ App::post('/v1/projects/:projectId/tasks')
$task = new Document([
'$id' => $dbForConsole->getId(),
'$projectId' => $project->getId(),
'projectId' => $project->getId(),
'name' => $name,
'status' => $status,
'schedule' => $schedule,

View file

@ -69,6 +69,9 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
return $app;
});
// wait for database to be ready
sleep(5);
$dbForConsole = $app->getResource('dbForConsole'); /** @var Utopia\Database\Database $dbForConsole */
if(!$dbForConsole->exists()) {

View file

@ -33,7 +33,7 @@ class TasksV1 extends Worker
$db = $register->get('db');
$cache = $register->get('cache');
$projectId = $this->args['$projectId'] ?? null;
$projectId = $this->args['projectId'] ?? null;
$taskId = $this->args['$id'] ?? null;
$updated = $this->args['updated'] ?? null;
$next = $this->args['next'] ?? null;

View file

@ -21,7 +21,7 @@ class Task extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$projectId', [
->addRule('projectId', [
'type' => self::TYPE_STRING,
'description' => 'Project ID.',
'default' => '',

View file

@ -189,7 +189,7 @@ class Client
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders) {
$len = strlen($header);
$header = explode(':', $header, 2);