diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 2dc9d149da..87d70167d1 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -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') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 6b2591dca2..28694a0b10 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -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, diff --git a/app/http.php b/app/http.php index becb7aa0b0..ee8a073b03 100644 --- a/app/http.php +++ b/app/http.php @@ -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()) { diff --git a/app/workers/tasks.php b/app/workers/tasks.php index 287aea5faa..cb24c65a9f 100644 --- a/app/workers/tasks.php +++ b/app/workers/tasks.php @@ -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; diff --git a/src/Appwrite/Utopia/Response/Model/Task.php b/src/Appwrite/Utopia/Response/Model/Task.php index 69a673ea49..4d5c8a963f 100644 --- a/src/Appwrite/Utopia/Response/Model/Task.php +++ b/src/Appwrite/Utopia/Response/Model/Task.php @@ -21,7 +21,7 @@ class Task extends Model 'default' => '', 'example' => '5e5ea5c16897e', ]) - ->addRule('$projectId', [ + ->addRule('projectId', [ 'type' => self::TYPE_STRING, 'description' => 'Project ID.', 'default' => '', diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index 3bf4b164d9..82fd642a08 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -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);