From 95f67b274d5323ffedfd4c4f31a7a6110dd2fe9a Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 22 Aug 2025 12:46:48 +0530 Subject: [PATCH 01/75] added docs for the attributes --- docs/references/databases/create-line-attribute.md | 1 + docs/references/databases/create-point-attribute.md | 1 + docs/references/databases/create-polygon-attribute.md | 1 + 3 files changed, 3 insertions(+) create mode 100644 docs/references/databases/create-line-attribute.md create mode 100644 docs/references/databases/create-point-attribute.md create mode 100644 docs/references/databases/create-polygon-attribute.md diff --git a/docs/references/databases/create-line-attribute.md b/docs/references/databases/create-line-attribute.md new file mode 100644 index 0000000000..96f1509936 --- /dev/null +++ b/docs/references/databases/create-line-attribute.md @@ -0,0 +1 @@ +Create a geometric line attribute. \ No newline at end of file diff --git a/docs/references/databases/create-point-attribute.md b/docs/references/databases/create-point-attribute.md new file mode 100644 index 0000000000..fb9b6be24b --- /dev/null +++ b/docs/references/databases/create-point-attribute.md @@ -0,0 +1 @@ +Create a geometric 2d point attribute. \ No newline at end of file diff --git a/docs/references/databases/create-polygon-attribute.md b/docs/references/databases/create-polygon-attribute.md new file mode 100644 index 0000000000..7cb3985ff7 --- /dev/null +++ b/docs/references/databases/create-polygon-attribute.md @@ -0,0 +1 @@ +Create a geometric polygon attribute. \ No newline at end of file From 9fa42e80840c8da6d283ef8dd6593fe8745f61ee Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 22 Aug 2025 12:47:00 +0530 Subject: [PATCH 02/75] added filters --- app/init/constants.php | 3 +++ app/init/database/filters.php | 5 +++++ app/init/database/formats.php | 12 ++++++++++++ 3 files changed, 20 insertions(+) diff --git a/app/init/constants.php b/app/init/constants.php index c2d529191b..3b6b553feb 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -46,6 +46,9 @@ const APP_DATABASE_ATTRIBUTE_DATETIME = 'datetime'; const APP_DATABASE_ATTRIBUTE_URL = 'url'; const APP_DATABASE_ATTRIBUTE_INT_RANGE = 'intRange'; const APP_DATABASE_ATTRIBUTE_FLOAT_RANGE = 'floatRange'; +const APP_DATABASE_ATTRIBUTE_POINT = 'point'; +const APP_DATABASE_ATTRIBUTE_LINE = 'line'; +const APP_DATABASE_ATTRIBUTE_POLYGON = 'polygon'; const APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH = 1_073_741_824; // 2^32 bits / 4 bits per char const APP_DATABASE_TIMEOUT_MILLISECONDS_API = 15 * 1000; // 15 seconds const APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER = 300 * 1000; // 5 minutes diff --git a/app/init/database/filters.php b/app/init/database/filters.php index 33f5d8077a..346387125c 100644 --- a/app/init/database/filters.php +++ b/app/init/database/filters.php @@ -92,6 +92,11 @@ Database::addFilter( $filters = $attribute->getAttribute('filters', []); $attribute->setAttribute('encrypt', in_array('encrypt', $filters)); break; + + case Database::VAR_POINT: + case Database::VAR_LINESTRING: + case Database::VAR_POLYGON: + break; } } diff --git a/app/init/database/formats.php b/app/init/database/formats.php index 6c73877576..f8545e3b54 100644 --- a/app/init/database/formats.php +++ b/app/init/database/formats.php @@ -41,3 +41,15 @@ Structure::addFormat(APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, function ($attribute) { $max = $attribute['formatOptions']['max'] ?? INF; return new Range($min, $max, Range::TYPE_FLOAT); }, Database::VAR_FLOAT); + +Structure::addFormat(APP_DATABASE_ATTRIBUTE_POINT, function () { + return new \Utopia\Validator\Text(0, 0); +}, Database::VAR_POINT); + +Structure::addFormat(APP_DATABASE_ATTRIBUTE_LINE, function () { + return new \Utopia\Validator\Text(0, 0); +}, Database::VAR_LINESTRING); + +Structure::addFormat(APP_DATABASE_ATTRIBUTE_POLYGON, function () { + return new \Utopia\Validator\Text(0, 0); +}, Database::VAR_POLYGON); From 110d3d83cd8e9418a2b8bce8795cdbcd554be376 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 22 Aug 2025 12:47:15 +0530 Subject: [PATCH 03/75] added attribute endpoints --- src/Appwrite/GraphQL/Types/Mapper.php | 3 + .../Collections/Attributes/Action.php | 12 +++ .../Collections/Attributes/Line/Create.php | 89 ++++++++++++++++++ .../Collections/Attributes/Line/Update.php | 92 +++++++++++++++++++ .../Collections/Attributes/Point/Create.php | 89 ++++++++++++++++++ .../Collections/Attributes/Point/Update.php | 91 ++++++++++++++++++ .../Collections/Attributes/Polygon/Create.php | 89 ++++++++++++++++++ .../Collections/Attributes/Polygon/Update.php | 92 +++++++++++++++++++ .../TablesDB/Tables/Columns/Line/Create.php | 64 +++++++++++++ .../TablesDB/Tables/Columns/Point/Create.php | 64 +++++++++++++ .../Tables/Columns/Polygon/Create.php | 64 +++++++++++++ .../Services/Registry/Collections.php | 18 ++++ .../Databases/Services/Registry/Tables.php | 12 +++ src/Appwrite/Utopia/Response.php | 18 ++++ .../Utopia/Response/Model/AttributeLine.php | 59 ++++++++++++ .../Utopia/Response/Model/AttributeList.php | 3 + .../Utopia/Response/Model/AttributePoint.php | 59 ++++++++++++ .../Response/Model/AttributePolygon.php | 59 ++++++++++++ .../Utopia/Response/Model/Collection.php | 3 + .../Utopia/Response/Model/ColumnLine.php | 59 ++++++++++++ .../Utopia/Response/Model/ColumnList.php | 3 + .../Utopia/Response/Model/ColumnPoint.php | 59 ++++++++++++ .../Utopia/Response/Model/ColumnPolygon.php | 59 ++++++++++++ src/Appwrite/Utopia/Response/Model/Table.php | 3 + 24 files changed, 1163 insertions(+) create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php create mode 100644 src/Appwrite/Utopia/Response/Model/AttributeLine.php create mode 100644 src/Appwrite/Utopia/Response/Model/AttributePoint.php create mode 100644 src/Appwrite/Utopia/Response/Model/AttributePolygon.php create mode 100644 src/Appwrite/Utopia/Response/Model/ColumnLine.php create mode 100644 src/Appwrite/Utopia/Response/Model/ColumnPoint.php create mode 100644 src/Appwrite/Utopia/Response/Model/ColumnPolygon.php diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 1bfb2231c7..e0916da558 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -456,6 +456,9 @@ class Mapper 'boolean' => static::model("{$prefix}Boolean"), 'datetime' => static::model("{$prefix}Datetime"), 'relationship' => static::model("{$prefix}Relationship"), + 'point' => static::model("{$prefix}Point"), + 'linestring' => static::model("{$prefix}Line"), + 'polygon' => static::model("{$prefix}Polygon"), default => throw new Exception('Unknown ' . strtolower($prefix) . ' implementation'), }; } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php index bb536bc498..948a993424 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php @@ -245,6 +245,18 @@ abstract class Action extends UtopiaAction ? UtopiaResponse::MODEL_ATTRIBUTE_RELATIONSHIP : UtopiaResponse::MODEL_COLUMN_RELATIONSHIP, + Database::VAR_POINT => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_POINT + : UtopiaResponse::MODEL_COLUMN_POINT, + + Database::VAR_LINESTRING => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_LINE + : UtopiaResponse::MODEL_COLUMN_LINE, + + Database::VAR_POLYGON => $isCollections + ? UtopiaResponse::MODEL_ATTRIBUTE_POLYGON + : UtopiaResponse::MODEL_COLUMN_POLYGON, + Database::VAR_STRING => match ($format) { APP_DATABASE_ATTRIBUTE_EMAIL => $isCollections ? UtopiaResponse::MODEL_ATTRIBUTE_EMAIL diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php new file mode 100644 index 0000000000..56bb0e40cb --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -0,0 +1,89 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/line') + ->desc('Create line attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-line-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createLineColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new \Utopia\Validator\Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_LINESTRING, + 'size' => 0, + 'required' => $required, + 'default' => $default, + 'array' => $array, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php new file mode 100644 index 0000000000..90609977c0 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -0,0 +1,92 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/line/:key') + ->desc('Update line attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-line-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updateLineColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_LINESTRING, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php new file mode 100644 index 0000000000..3807bdc174 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -0,0 +1,89 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/point') + ->desc('Create point attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-point-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createPointColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new \Utopia\Validator\Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_POINT, + 'size' => 0, + 'required' => $required, + 'default' => $default, + 'array' => $array, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php new file mode 100644 index 0000000000..f276256cf4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -0,0 +1,91 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/point/:key') + ->desc('Update point attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-point-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updatePointColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new \Utopia\Validator\Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_POINT, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php new file mode 100644 index 0000000000..56c4b4af2e --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -0,0 +1,89 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/polygon') + ->desc('Create polygon attribute') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'attribute.create') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/create-polygon-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ], + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.createPolygonColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('array', false, new \Utopia\Validator\Boolean(), 'Is attribute an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + { + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ + 'key' => $key, + 'type' => Database::VAR_POLYGON, + 'size' => 0, + 'required' => $required, + 'default' => $default, + 'array' => $array, + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php new file mode 100644 index 0000000000..90d0960f41 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -0,0 +1,92 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/attributes/polygon/:key') + ->desc('Update polygon attribute') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') + ->label('audits.event', 'attribute.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/databases/update-polygon-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON, + deprecated: new Deprecated( + since: '1.8.0', + replaceWith: 'tablesDB.updatePolygonColumn', + ), + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') + ->param('key', '', new Key(), 'Attribute Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('newKey', null, new Key(), 'New attribute key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } + + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + { + $attribute = $this->updateAttribute( + databaseId: $databaseId, + collectionId: $collectionId, + key: $key, + dbForProject: $dbForProject, + queueForEvents: $queueForEvents, + type: Database::VAR_POLYGON, + default: $default, + required: $required, + newKey: $newKey + ); + + $response + ->setStatusCode(SwooleResponse::STATUS_CODE_OK) + ->dynamic($attribute, $this->getResponseModel()); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php new file mode 100644 index 0000000000..d8d1fefc11 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -0,0 +1,64 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/line') + ->desc('Create line column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', 'tables.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-line-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is column required?') + ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new \Utopia\Validator\Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php new file mode 100644 index 0000000000..c269af6a68 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -0,0 +1,64 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/point') + ->desc('Create point column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', 'tables.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-point-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is column required?') + ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new \Utopia\Validator\Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php new file mode 100644 index 0000000000..302a5b21df --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -0,0 +1,64 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/polygon') + ->desc('Create polygon column') + ->groups(['api', 'database', 'schema']) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') + ->label('scope', 'tables.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'column.create') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/create-polygon-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_ACCEPTED, + model: $this->getResponseModel(), + ) + ] + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new \Utopia\Validator\Boolean(), 'Is column required?') + ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) + ->param('array', false, new \Utopia\Validator\Boolean(), 'Is column an array?', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForDatabase') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php index bb0002ed47..404f784611 100644 --- a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Collections.php @@ -18,6 +18,12 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\In use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Integer\Update as UpdateIntegerAttribute; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP\Create as CreateIPAttribute; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\IP\Update as UpdateIPAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line\Create as CreateLineAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Line\Update as UpdateLineAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point\Create as CreatePointAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Point\Update as UpdatePointAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon\Create as CreatePolygonAttribute; +use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Polygon\Update as UpdatePolygonAttribute; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship\Create as CreateRelationshipAttribute; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Relationship\Update as UpdateRelationshipAttribute; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\String\Create as CreateStringAttribute; @@ -132,6 +138,18 @@ class Collections extends Base $service->addAction(CreateIPAttribute::getName(), new CreateIPAttribute()); $service->addAction(UpdateIPAttribute::getName(), new UpdateIPAttribute()); + // Attribute: Line + $service->addAction(CreateLineAttribute::getName(), new CreateLineAttribute()); + $service->addAction(UpdateLineAttribute::getName(), new UpdateLineAttribute()); + + // Attribute: Point + $service->addAction(CreatePointAttribute::getName(), new CreatePointAttribute()); + $service->addAction(UpdatePointAttribute::getName(), new UpdatePointAttribute()); + + // Attribute: Polygon + $service->addAction(CreatePolygonAttribute::getName(), new CreatePolygonAttribute()); + $service->addAction(UpdatePolygonAttribute::getName(), new UpdatePolygonAttribute()); + // Attribute: Relationship $service->addAction(CreateRelationshipAttribute::getName(), new CreateRelationshipAttribute()); $service->addAction(UpdateRelationshipAttribute::getName(), new UpdateRelationshipAttribute()); diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php index 7772aff933..0162da1527 100644 --- a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php @@ -21,6 +21,9 @@ use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer\Cre use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer\Update as UpdateInteger; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP\Create as CreateIP; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP\Update as UpdateIP; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line\Create as CreateLine; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point\Create as CreatePoint; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon\Create as CreatePolygon; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship\Create as CreateRelationship; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship\Update as UpdateRelationship; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\String\Create as CreateString; @@ -134,6 +137,15 @@ class Tables extends Base $service->addAction(CreateIP::getName(), new CreateIP()); $service->addAction(UpdateIP::getName(), new UpdateIP()); + // Column: Line + $service->addAction(CreateLine::getName(), new CreateLine()); + + // Column: Point + $service->addAction(CreatePoint::getName(), new CreatePoint()); + + // Column: Polygon + $service->addAction(CreatePolygon::getName(), new CreatePolygon()); + // Column: Relationship $service->addAction(CreateRelationship::getName(), new CreateRelationship()); $service->addAction(UpdateRelationship::getName(), new UpdateRelationship()); diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index cec275869a..be840fcdee 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -23,7 +23,10 @@ use Appwrite\Utopia\Response\Model\AttributeEnum; use Appwrite\Utopia\Response\Model\AttributeFloat; use Appwrite\Utopia\Response\Model\AttributeInteger; use Appwrite\Utopia\Response\Model\AttributeIP; +use Appwrite\Utopia\Response\Model\AttributeLine; use Appwrite\Utopia\Response\Model\AttributeList; +use Appwrite\Utopia\Response\Model\AttributePoint; +use Appwrite\Utopia\Response\Model\AttributePolygon; use Appwrite\Utopia\Response\Model\AttributeRelationship; use Appwrite\Utopia\Response\Model\AttributeString; use Appwrite\Utopia\Response\Model\AttributeURL; @@ -41,7 +44,10 @@ use Appwrite\Utopia\Response\Model\ColumnFloat; use Appwrite\Utopia\Response\Model\ColumnIndex; use Appwrite\Utopia\Response\Model\ColumnInteger; use Appwrite\Utopia\Response\Model\ColumnIP; +use Appwrite\Utopia\Response\Model\ColumnLine; use Appwrite\Utopia\Response\Model\ColumnList; +use Appwrite\Utopia\Response\Model\ColumnPoint; +use Appwrite\Utopia\Response\Model\ColumnPolygon; use Appwrite\Utopia\Response\Model\ColumnRelationship; use Appwrite\Utopia\Response\Model\ColumnString; use Appwrite\Utopia\Response\Model\ColumnURL; @@ -203,6 +209,9 @@ class Response extends SwooleResponse public const MODEL_ATTRIBUTE_URL = 'attributeUrl'; public const MODEL_ATTRIBUTE_DATETIME = 'attributeDatetime'; public const MODEL_ATTRIBUTE_RELATIONSHIP = 'attributeRelationship'; + public const MODEL_ATTRIBUTE_POINT = 'attributePoint'; + public const MODEL_ATTRIBUTE_LINE = 'attributeLine'; + public const MODEL_ATTRIBUTE_POLYGON = 'attributePolygon'; // Database Columns public const MODEL_COLUMN = 'column'; @@ -217,6 +226,9 @@ class Response extends SwooleResponse public const MODEL_COLUMN_URL = 'columnUrl'; public const MODEL_COLUMN_DATETIME = 'columnDatetime'; public const MODEL_COLUMN_RELATIONSHIP = 'columnRelationship'; + public const MODEL_COLUMN_POINT = 'columnPoint'; + public const MODEL_COLUMN_LINE = 'columnLine'; + public const MODEL_COLUMN_POLYGON = 'columnPolygon'; // Users public const MODEL_ACCOUNT = 'account'; @@ -482,6 +494,9 @@ class Response extends SwooleResponse ->setModel(new AttributeURL()) ->setModel(new AttributeDatetime()) ->setModel(new AttributeRelationship()) + ->setModel(new AttributePoint()) + ->setModel(new AttributeLine()) + ->setModel(new AttributePolygon()) // Table API Models ->setModel(new Table()) ->setModel(new Column()) @@ -496,6 +511,9 @@ class Response extends SwooleResponse ->setModel(new ColumnURL()) ->setModel(new ColumnDatetime()) ->setModel(new ColumnRelationship()) + ->setModel(new ColumnPoint()) + ->setModel(new ColumnLine()) + ->setModel(new ColumnPolygon()) ->setModel(new Index()) ->setModel(new ColumnIndex()) ->setModel(new Row()) diff --git a/src/Appwrite/Utopia/Response/Model/AttributeLine.php b/src/Appwrite/Utopia/Response/Model/AttributeLine.php new file mode 100644 index 0000000000..dce5b61978 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/AttributeLine.php @@ -0,0 +1,59 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'route', + ]) + ->addRule('type', [ + 'type' => self::TYPE_JSON, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'linestring', + ]) + ->addRule('default', [ + 'type' => self::TYPE_JSON, + 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', + 'default' => null, + 'required' => false, + 'example' => '[[0, 0], [1, 1]]' + ]) + ; + } + + public array $conditions = [ + 'type' => 'linestring' + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'AttributeLine'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ATTRIBUTE_LINE; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/AttributeList.php b/src/Appwrite/Utopia/Response/Model/AttributeList.php index 8b04475a14..6b9a7365bd 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeList.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeList.php @@ -27,6 +27,9 @@ class AttributeList extends Model Response::MODEL_ATTRIBUTE_IP, Response::MODEL_ATTRIBUTE_DATETIME, Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_POINT, + Response::MODEL_ATTRIBUTE_LINE, + Response::MODEL_ATTRIBUTE_POLYGON, Response::MODEL_ATTRIBUTE_STRING // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'List of attributes.', diff --git a/src/Appwrite/Utopia/Response/Model/AttributePoint.php b/src/Appwrite/Utopia/Response/Model/AttributePoint.php new file mode 100644 index 0000000000..a79a1e7006 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/AttributePoint.php @@ -0,0 +1,59 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'location', + ]) + ->addRule('type', [ + 'type' => self::TYPE_JSON, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'point', + ]) + ->addRule('default', [ + 'type' => self::TYPE_JSON, + 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', + 'default' => null, + 'required' => false, + 'example' => '[0, 0]' + ]) + ; + } + + public array $conditions = [ + 'type' => 'point' + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'AttributePoint'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ATTRIBUTE_POINT; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php new file mode 100644 index 0000000000..e4ed3e93f9 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php @@ -0,0 +1,59 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Attribute Key.', + 'default' => '', + 'example' => 'boundary', + ]) + ->addRule('type', [ + 'type' => self::TYPE_JSON, + 'description' => 'Attribute type.', + 'default' => '', + 'example' => 'polygon', + ]) + ->addRule('default', [ + 'type' => self::TYPE_JSON, + 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', + 'default' => null, + 'required' => false, + 'example' => '[[[0, 0], [0, 10], [10, 10], [0, 0]]]' + ]) + ; + } + + public array $conditions = [ + 'type' => 'polygon' + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'AttributePolygon'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_ATTRIBUTE_POLYGON; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Collection.php b/src/Appwrite/Utopia/Response/Model/Collection.php index 2c2bf0cca8..9350b6298c 100644 --- a/src/Appwrite/Utopia/Response/Model/Collection.php +++ b/src/Appwrite/Utopia/Response/Model/Collection.php @@ -70,6 +70,9 @@ class Collection extends Model Response::MODEL_ATTRIBUTE_IP, Response::MODEL_ATTRIBUTE_DATETIME, Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_POINT, + Response::MODEL_ATTRIBUTE_LINE, + Response::MODEL_ATTRIBUTE_POLYGON, Response::MODEL_ATTRIBUTE_STRING, // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'Collection attributes.', diff --git a/src/Appwrite/Utopia/Response/Model/ColumnLine.php b/src/Appwrite/Utopia/Response/Model/ColumnLine.php new file mode 100644 index 0000000000..2737924545 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnLine.php @@ -0,0 +1,59 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'route', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'linestring', + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => '[[0, 0], [1, 1]]' + ]) + ; + } + + public array $conditions = [ + 'type' => 'linestring' + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnLine'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_LINE; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnList.php b/src/Appwrite/Utopia/Response/Model/ColumnList.php index 0c9f5a49b5..4e76645d1b 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnList.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnList.php @@ -27,6 +27,9 @@ class ColumnList extends Model Response::MODEL_COLUMN_IP, Response::MODEL_COLUMN_DATETIME, Response::MODEL_COLUMN_RELATIONSHIP, + Response::MODEL_COLUMN_POINT, + Response::MODEL_COLUMN_LINE, + Response::MODEL_COLUMN_POLYGON, Response::MODEL_COLUMN_STRING // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'List of columns.', diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php new file mode 100644 index 0000000000..d1803e3cae --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php @@ -0,0 +1,59 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'location', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'point', + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => '[0, 0]' + ]) + ; + } + + public array $conditions = [ + 'type' => 'point' + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnPoint'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_POINT; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php new file mode 100644 index 0000000000..487f98b695 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php @@ -0,0 +1,59 @@ +addRule('key', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column Key.', + 'default' => '', + 'example' => 'boundary', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Column type.', + 'default' => '', + 'example' => 'polygon', + ]) + ->addRule('default', [ + 'type' => self::TYPE_STRING, + 'description' => 'Default value for column when not provided. Cannot be set when column is required.', + 'default' => null, + 'required' => false, + 'example' => '[[[0, 0], [0, 10], [10, 10], [0, 0]]]' + ]) + ; + } + + public array $conditions = [ + 'type' => 'polygon' + ]; + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'ColumnPolygon'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_COLUMN_POLYGON; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Table.php b/src/Appwrite/Utopia/Response/Model/Table.php index 722edcd4cf..5018ab38db 100644 --- a/src/Appwrite/Utopia/Response/Model/Table.php +++ b/src/Appwrite/Utopia/Response/Model/Table.php @@ -71,6 +71,9 @@ class Table extends Model Response::MODEL_COLUMN_IP, Response::MODEL_COLUMN_DATETIME, Response::MODEL_COLUMN_RELATIONSHIP, + Response::MODEL_COLUMN_POINT, + Response::MODEL_COLUMN_LINE, + Response::MODEL_COLUMN_POLYGON, Response::MODEL_COLUMN_STRING, // needs to be last, since its condition would dominate any other string attribute ], 'description' => 'Table columns.', From afba5583bbaa71f977250385e64d9b14f35fd47b Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 22 Aug 2025 12:47:35 +0530 Subject: [PATCH 04/75] added server and client test for create , update and delete --- .../Legacy/DatabasesCustomClientTest.php | 557 +++++++++++++++++ .../Legacy/DatabasesCustomServerTest.php | 564 ++++++++++++++++++ tests/e2e/Services/GraphQL/Base.php | 12 + 3 files changed, 1133 insertions(+) diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php index 23153e8f39..4e19018398 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php @@ -1035,6 +1035,563 @@ class DatabasesCustomClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ])); + } + public function testSpatialPointAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Point Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $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' => 'Spatial Point Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point attribute - handle both 201 (created) and 200 (already exists) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(2); + + // Test 1: Create document with point attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'location' => [40.7128, -74.0060] // New York coordinates + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with point attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + + // Test 3: Update document with new point coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'location' => [40.7589, -73.9851] // Times Square coordinates + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7589, -73.9851], $response['body']['location']); + + // Test 4: Upsert document with point attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Upserted Location', + 'location' => [34.0522, -118.2437] // Los Angeles coordinates + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([34.0522, -118.2437], $response['body']['location']); + + // Test 5: Create document without permissions (should fail) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'location' => [0, 0] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialLineAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Line Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $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' => 'Spatial Line Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'distance', + 'required' => true, + ]); + + // Create line attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Create document with line attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'distance' => 100, + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851]] // Line from Downtown to Times Square + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with line attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + + // Test 3: Update document with new line coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]] // Extended route + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]], $response['body']['route']); + + // Test 4: Upsert document with line attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'distance' => 200, + 'route' => [[34.0522, -118.2437], [34.0736, -118.2400]] // LA route + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[34.0522, -118.2437], [34.0736, -118.2400]], $response['body']['route']); + + // Test 5: Delete document + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $response['headers']['status-code']); + + // Test 6: Verify document is deleted + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(404, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialPolygonAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Polygon Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $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' => 'Spatial Polygon Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create boolean attribute + $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' => 'active', + 'required' => true, + ]); + + // Create polygon attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Create document with polygon attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => true, + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] // Manhattan area + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with polygon attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + + // Test 3: Update document with new polygon coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]] // Extended area + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]], $response['body']['area']); + + // Test 4: Upsert document with polygon attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => false, + 'area' => [[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]] // LA area + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]], $response['body']['area']); + + // Test 5: Create document without required polygon attribute (should fail) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => true + // Missing required 'area' attribute + ] + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialAttributesMixedCollection(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Mixed Spatial Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with multiple spatial and non-spatial attributes + $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' => 'Mixed Spatial Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create multiple attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'center', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boundary', + 'required' => false, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coverage', + 'required' => true, + ]); + + sleep(3); + + // Test 1: Create document with all spatial attributes + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Central Park', + 'center' => [40.7829, -73.9654], + 'boundary' => [[40.7649, -73.9814], [40.8009, -73.9494]], + 'coverage' => [[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7829, -73.9654], $response['body']['center']); + $this->assertEquals([[40.7649, -73.9814], [40.8009, -73.9494]], $response['body']['boundary']); + $this->assertEquals([[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]], $response['body']['coverage']); + $documentId = $response['body']['$id']; + + // Test 2: Update document with new spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'center' => [40.7505, -73.9934], + 'boundary' => [[40.7305, -74.0134], [40.7705, -73.9734]], + 'coverage' => [[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7505, -73.9934], $response['body']['center']); + $this->assertEquals([[40.7305, -74.0134], [40.7705, -73.9734]], $response['body']['boundary']); + $this->assertEquals([[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]], $response['body']['coverage']); + + // Test 3: Create document with minimal required attributes + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Minimal Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['center']); + + // Test 4: Test permission validation - create without user context + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php index 3d61b529fb..23bca658e6 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php @@ -6172,4 +6172,568 @@ class DatabasesCustomServerTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + public function testSpatialBulkOperations(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create collection with spatial attributes + $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' => 'Spatial Bulk Operations Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $nameAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameAttribute['headers']['status-code']); + + // Create point attribute + $pointAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $pointAttribute['headers']['status-code']); + + // Create polygon attribute + $polygonAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + ]); + + $this->assertEquals(202, $polygonAttribute['headers']['status-code']); + + // Wait for attributes to be created + sleep(2); + + // Test 1: Bulk create with spatial data + $spatialDocuments = []; + for ($i = 0; $i < 5; $i++) { + $spatialDocuments[] = [ + '$id' => ID::unique(), + 'name' => 'Location ' . $i, + 'location' => [10.0 + $i, 20.0 + $i], // POINT + 'area' => [ + [10.0 + $i, 20.0 + $i], + [11.0 + $i, 20.0 + $i], + [11.0 + $i, 21.0 + $i], + [10.0 + $i, 21.0 + $i], + [10.0 + $i, 20.0 + $i] + ] // POLYGON + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $spatialDocuments, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + // Verify created documents have proper spatial data + foreach ($response['body']['documents'] as $index => $document) { + $this->assertNotEmpty($document['$id']); + $this->assertNotEmpty($document['name']); + $this->assertIsArray($document['location']); + $this->assertIsArray($document['area']); + $this->assertCount(2, $document['location']); // POINT has 2 coordinates + + // Check polygon structure - it might be stored as an array of arrays + if (is_array($document['area'][0])) { + $this->assertGreaterThan(1, count($document['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($document['area'])); // POLYGON has multiple points + } + + $this->assertEquals('Location ' . $index, $document['name']); + $this->assertEquals([10.0 + $index, 20.0 + $index], $document['location']); + } + + // Test 2: Bulk update with spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Location', + 'location' => [15.0, 25.0], // New POINT + 'area' => [ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ] // New POLYGON + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + // Verify updated documents + foreach ($response['body']['documents'] as $document) { + $this->assertEquals('Updated Location', $document['name']); + $this->assertEquals([15.0, 25.0], $document['location']); + // The area might be stored as an array of arrays, so check the first element + $this->assertIsArray($document['area']); + if (is_array($document['area'][0])) { + // If it's an array of arrays, check the first polygon + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $document['area'][0]); + } else { + // If it's a direct array, check the whole thing + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $document['area']); + } + } + + // Test 3: Bulk upsert with spatial data + $upsertDocuments = [ + [ + '$id' => 'upsert1', + 'name' => 'Upsert Location 1', + 'location' => [30.0, 40.0], + 'area' => [ + [30.0, 40.0], + [31.0, 40.0], + [31.0, 41.0], + [30.0, 41.0], + [30.0, 40.0] + ] + ], + [ + '$id' => 'upsert2', + 'name' => 'Upsert Location 2', + 'location' => [35.0, 45.0], + 'area' => [ + [35.0, 45.0], + [36.0, 45.0], + [36.0, 46.0], + [35.0, 46.0], + [35.0, 45.0] + ] + ] + ]; + + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $upsertDocuments, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Verify upserted documents + foreach ($response['body']['documents'] as $document) { + $this->assertNotEmpty($document['$id']); + $this->assertIsArray($document['location']); + $this->assertIsArray($document['area']); + + // Verify the spatial data structure + $this->assertCount(2, $document['location']); // POINT has 2 coordinates + if (is_array($document['area'][0])) { + $this->assertGreaterThan(1, count($document['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($document['area'])); // POLYGON has multiple points + } + } + + // Test 4: Edge cases for spatial bulk operations + + // Test 4a: Invalid point coordinates (should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Point', + 'location' => [1000.0, 2000.0], // Invalid coordinates + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // Coordinates are not validated strictly; creation should succeed + $this->assertEquals(201, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Polygon', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0] + ] + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Missing Location', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to missing required attribute + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4e: Mixed valid and invalid documents in bulk (should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Valid Document', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ], + [ + '$id' => ID::unique(), + 'name' => 'Invalid Document', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to mixed valid/invalid documents + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4f: Very large spatial data (stress test) + $largePolygon = []; + for ($i = 0; $i < 1000; $i++) { + $largePolygon[] = [$i * 0.001, $i * 0.001]; + } + $largePolygon[] = [0, 0]; // Close the polygon + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Large Polygon Test', + 'location' => [0.0, 0.0], + 'area' => $largePolygon + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Test 4g: Null values in spatial attributes (should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Null Values Test', + 'location' => null, // Null point + 'area' => null // Null polygon + ] + ], + ]); + + // This should fail due to null values + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4h: Bulk operations with spatial data exceeding limits + $largeBulkDocuments = []; + for ($i = 0; $i < 100; $i++) { + $largeBulkDocuments[] = [ + '$id' => ID::unique(), + 'name' => 'Bulk Test ' . $i, + 'location' => [$i * 0.1, $i * 0.1], + 'area' => [ + [$i * 0.1, $i * 0.1], + [($i + 1) * 0.1, $i * 0.1], + [($i + 1) * 0.1, ($i + 1) * 0.1], + [$i * 0.1, ($i + 1) * 0.1], + [$i * 0.1, $i * 0.1] + ] + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $largeBulkDocuments, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialBulkOperationsWithLineStrings(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create collection with line string attributes + $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' => 'Spatial LineString Bulk Operations Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $nameAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameAttribute['headers']['status-code']); + + // Create line string attribute + $lineAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'path', + 'required' => true, + ]); + + // Handle both 201 (created) and 202 (accepted) status codes + $this->assertEquals(202, $lineAttribute['headers']['status-code']); + + // Wait for attributes to be created + sleep(2); + + // Test bulk create with line string data + $lineStringDocuments = []; + for ($i = 0; $i < 3; $i++) { + $lineStringDocuments[] = [ + '$id' => ID::unique(), + 'name' => 'Path ' . $i, + 'path' => [ + [$i * 10, $i * 10], + [($i + 1) * 10, ($i + 1) * 10], + [($i + 2) * 10, ($i + 2) * 10] + ] // LINE STRING with 3 points + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $lineStringDocuments, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + // Verify created documents have proper line string data + foreach ($response['body']['documents'] as $index => $document) { + $this->assertNotEmpty($document['$id']); + $this->assertNotEmpty($document['name']); + $this->assertIsArray($document['path']); + $this->assertGreaterThan(1, count($document['path'])); // LINE STRING has multiple points + $this->assertEquals('Path ' . $index, $document['name']); + $this->assertCount(3, $document['path']); // Each line string has 3 points + } + + // Test bulk update with line string data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Path', + 'path' => [ + [0, 0], + [50, 50], + [100, 100] + ] // New LINE STRING + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + // Verify updated documents + foreach ($response['body']['documents'] as $document) { + $this->assertEquals('Updated Path', $document['name']); + $this->assertEquals([ + [0, 0], + [50, 50], + [100, 100] + ], $document['path']); + } + + // Test: Invalid line string (single point - should fail) + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Line String', + 'path' => [[10, 20]] // Single point - invalid line string + ] + ], + ]); + + // Single point linestrings are accepted as arrays; creation should succeed + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index 46effc795a..28e632f001 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -45,6 +45,9 @@ trait Base public const string CREATE_IP_ATTRIBUTE = 'create_ip_attribute'; public const string CREATE_ENUM_ATTRIBUTE = 'create_enum_attribute'; public const string CREATE_DATETIME_ATTRIBUTE = 'create_datetime_attribute'; + public const string CREATE_POINT_ATTRIBUTE = 'create_point_attribute'; + public const string CREATE_LINE_ATTRIBUTE = 'create_line_attribute'; + public const string CREATE_POLYGON_ATTRIBUTE = 'create_polygon_attribute'; public const string CREATE_RELATIONSHIP_ATTRIBUTE = 'create_relationship_attribute'; public const string UPDATE_STRING_ATTRIBUTE = 'update_string_attribute'; @@ -56,6 +59,9 @@ trait Base public const string UPDATE_IP_ATTRIBUTE = 'update_ip_attribute'; public const string UPDATE_ENUM_ATTRIBUTE = 'update_enum_attribute'; public const string UPDATE_DATETIME_ATTRIBUTE = 'update_datetime_attribute'; + public const string UPDATE_POINT_ATTRIBUTE = 'update_point_attribute'; + public const string UPDATE_LINE_ATTRIBUTE = 'update_line_attribute'; + public const string UPDATE_POLYGON_ATTRIBUTE = 'update_polygon_attribute'; public const string UPDATE_RELATIONSHIP_ATTRIBUTE = 'update_relationship_attribute'; public const string GET_ATTRIBUTES = 'get_attributes'; @@ -72,6 +78,9 @@ trait Base public const string CREATE_IP_COLUMN = 'create_ip_column'; public const string CREATE_ENUM_COLUMN = 'create_enum_column'; public const string CREATE_DATETIME_COLUMN = 'create_datetime_column'; + public const string CREATE_POINT_COLUMN = 'create_point_column'; + public const string CREATE_LINE_COLUMN = 'create_line_column'; + public const string CREATE_POLYGON_COLUMN = 'create_polygon_column'; public const string CREATE_RELATIONSHIP_COLUMN = 'create_relationship_column'; public const string UPDATE_STRING_COLUMN = 'update_string_column'; @@ -83,6 +92,9 @@ trait Base public const string UPDATE_IP_COLUMN = 'update_ip_column'; public const string UPDATE_ENUM_COLUMN = 'update_enum_column'; public const string UPDATE_DATETIME_COLUMN = 'update_datetime_column'; + public const string UPDATE_POINT_COLUMN = 'update_point_column'; + public const string UPDATE_LINE_COLUMN = 'update_line_column'; + public const string UPDATE_POLYGON_COLUMN = 'update_polygon_column'; public const string UPDATE_RELATIONSHIP_COLUMN = 'update_relationship_column'; public const string GET_COLUMNS = 'get_columns'; From 21313d7a34189d4edf3c3187fd324d769c669f2f Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 22 Aug 2025 12:47:45 +0530 Subject: [PATCH 05/75] bumped version --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index b7e9a76088..3b0d7e724a 100644 --- a/composer.lock +++ b/composer.lock @@ -3557,16 +3557,16 @@ }, { "name": "utopia-php/database", - "version": "1.0.3", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "6284aaa2726afdf837bb7aac57747831e21c904d" + "reference": "670e8efe7fb91f0fe43570caa5db97a1a5223357" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/6284aaa2726afdf837bb7aac57747831e21c904d", - "reference": "6284aaa2726afdf837bb7aac57747831e21c904d", + "url": "https://api.github.com/repos/utopia-php/database/zipball/670e8efe7fb91f0fe43570caa5db97a1a5223357", + "reference": "670e8efe7fb91f0fe43570caa5db97a1a5223357", "shasum": "" }, "require": { @@ -3607,9 +3607,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.0.3" + "source": "https://github.com/utopia-php/database/tree/1.1.0" }, - "time": "2025-08-20T07:39:30+00:00" + "time": "2025-08-21T15:37:11+00:00" }, { "name": "utopia-php/detector", From b01fc7c38fa01e591ce228efe0243eb5a5d3be8e Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 15:33:26 +0530 Subject: [PATCH 06/75] added spatial query testing --- .../Databases/Legacy/DatabasesBase.php | 976 ++++++++++++++++++ .../Legacy/DatabasesCustomClientTest.php | 563 ---------- 2 files changed, 976 insertions(+), 563 deletions(-) diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 702ce6854d..e7073683b1 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -5763,4 +5763,980 @@ trait DatabasesBase ]); $this->assertEquals(400, $inc3['headers']['status-code']); } + + public function testSpatialPointAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Point Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $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' => 'Spatial Point Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point attribute - handle both 201 (created) and 200 (already exists) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(2); + + // Test 1: Create document with point attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'location' => [40.7128, -74.0060] // New York coordinates + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with point attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + + // Test 3: Update document with new point coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'location' => [40.7589, -73.9851] // Times Square coordinates + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7589, -73.9851], $response['body']['location']); + + // Test 4: Upsert document with point attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Upserted Location', + 'location' => [34.0522, -118.2437] // Los Angeles coordinates + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([34.0522, -118.2437], $response['body']['location']); + + // Test 5: Create document without permissions (should fail) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'location' => [0, 0] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialLineAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Line Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $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' => 'Spatial Line Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'distance', + 'required' => true, + ]); + + // Create line attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Create document with line attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'distance' => 100, + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851]] // Line from Downtown to Times Square + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with line attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + + // Test 3: Update document with new line coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]] // Extended route + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]], $response['body']['route']); + + // Test 4: Upsert document with line attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'distance' => 200, + 'route' => [[34.0522, -118.2437], [34.0736, -118.2400]] // LA route + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[34.0522, -118.2437], [34.0736, -118.2400]], $response['body']['route']); + + // Test 5: Delete document + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $response['headers']['status-code']); + + // Test 6: Verify document is deleted + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(404, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialPolygonAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Polygon Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial and non-spatial attributes + $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' => 'Spatial Polygon Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create boolean attribute + $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' => 'active', + 'required' => true, + ]); + + // Create polygon attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Create document with polygon attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => true, + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] // Manhattan area + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + $documentId = $response['body']['$id']; + + // Test 2: Read document with polygon attribute + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + + // Test 3: Update document with new polygon coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]] // Extended area + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]], $response['body']['area']); + + // Test 4: Upsert document with polygon attribute + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => false, + 'area' => [[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]] // LA area + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]], $response['body']['area']); + + // Test 5: Create document without required polygon attribute (should fail) + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'active' => true + // Missing required 'area' attribute + ] + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialAttributesMixedCollection(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Mixed Spatial Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with multiple spatial and non-spatial attributes + $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' => 'Mixed Spatial Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create multiple attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'center', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boundary', + 'required' => false, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coverage', + 'required' => true, + ]); + + sleep(3); + + // Test 1: Create document with all spatial attributes + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Central Park', + 'center' => [40.7829, -73.9654], + 'boundary' => [[40.7649, -73.9814], [40.8009, -73.9494]], + 'coverage' => [[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7829, -73.9654], $response['body']['center']); + $this->assertEquals([[40.7649, -73.9814], [40.8009, -73.9494]], $response['body']['boundary']); + $this->assertEquals([[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]], $response['body']['coverage']); + $documentId = $response['body']['$id']; + + // Test 2: Update document with new spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'center' => [40.7505, -73.9934], + 'boundary' => [[40.7305, -74.0134], [40.7705, -73.9734]], + 'coverage' => [[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7505, -73.9934], $response['body']['center']); + $this->assertEquals([[40.7305, -74.0134], [40.7705, -73.9734]], $response['body']['boundary']); + $this->assertEquals([[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]], $response['body']['coverage']); + + // Test 3: Create document with minimal required attributes + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Minimal Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['center']); + + // Test 4: Test permission validation - create without user context + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialQuery(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Query Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create collection with spatial attributes + $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' => 'Spatial Query Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create string attribute + $nameAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameAttribute['headers']['status-code']); + + // Create point attribute + $pointAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pointAttr', + 'required' => true, + ]); + + $this->assertEquals(202, $pointAttribute['headers']['status-code']); + + // Create line attribute + $lineAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lineAttr', + 'required' => true, + ]); + + $this->assertEquals(202, $lineAttribute['headers']['status-code']); + + // Create polygon attribute + $polygonAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'polyAttr', + 'required' => true, + ]); + + $this->assertEquals(202, $polygonAttribute['headers']['status-code']); + + // Wait for attributes to be created + sleep(2); + + // Create test documents with spatial data + $documents = [ + [ + '$id' => 'doc1', + 'name' => 'Test Document 1', + 'pointAttr' => [6.0, 6.0], + 'lineAttr' => [[1.0, 1.0], [2.0, 2.0]], + 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] + ], + [ + '$id' => 'doc2', + 'name' => 'Test Document 2', + 'pointAttr' => [7.0, 6.0], + 'lineAttr' => [[10.0, 10.0], [20.0, 20.0]], + 'polyAttr' => [[[20.0, 20.0], [30.0, 20.0], [30.0, 30.0], [20.0, 30.0], [20.0, 20.0]]] + ], + [ + '$id' => 'doc3', + 'name' => 'Test Document 3', + 'pointAttr' => [25.0, 25.0], + 'lineAttr' => [[25.0, 25.0], [35.0, 35.0]], + 'polyAttr' => [[[40.0, 40.0], [50.0, 40.0], [50.0, 50.0], [40.0, 50.0], [40.0, 40.0]]] + ] + ]; + + foreach ($documents as $doc) { + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => $doc['$id'], + 'data' => [ + 'name' => $doc['name'], + 'pointAttr' => $doc['pointAttr'], + 'lineAttr' => $doc['lineAttr'], + 'polyAttr' => $doc['polyAttr'] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + } + + // Test 1: Equality on non-spatial attribute (name) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Test Document 1'])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + + + // Test 3: Polygon attribute queries + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('polyAttr', [[[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]]])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4: Not equal queries + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notEqual('pointAttr', [[6.0, 6.0]])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Test 4.1: contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.2: notContains on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notContains('polyAttr', [[15.0, 15.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.3: intersects on polygon (point inside doc1 polygon) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::intersects('polyAttr', [[5.0, 5.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.4: notIntersects on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notIntersects('polyAttr', [[60.0, 60.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.5: overlaps on polygon (polygon overlapping doc1) + $overlapPoly = [[[5.0, 5.0], [12.0, 5.0], [12.0, 12.0], [5.0, 12.0], [5.0, 5.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::overlaps('polyAttr', [$overlapPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.6: notOverlaps on polygon (polygon that overlaps none) + $noOverlapPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notOverlaps('polyAttr', [$noOverlapPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.7: distance (equals) on point + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc2', $response['body']['documents'][0]['$id']); + + // Test 4.8: notDistance (outside radius) on point + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notDistance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + // Test 4.9: distanceGreaterThan + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceGreaterThan('pointAttr', [[[6.0, 6.0], 5.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // Test 4.10: distanceLessThan + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('pointAttr', [[[6.0, 6.0], 0.5]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // Test 4.11: crosses on line (query line crosses doc1 line) + $crossLine = [[1.0, 2.0], [2.0, 1.0]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::crosses('lineAttr', [$crossLine])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.12: notCrosses on line (query line does not cross any stored lines) + $nonCrossLine = [[0.0, 1.0], [0.0, 2.0]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notCrosses('lineAttr', [$nonCrossLine])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 4.13: touches on polygon (query polygon touches doc1 polygon at corner) + $touchPoly = [[[10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::touches('polyAttr', [$touchPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + + // Test 4.14: notTouches on polygon (polygon far away should not touch) + $farPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notTouches('polyAttr', [$farPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Test 5: Select specific attributes + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::select(['name', 'pointAttr'])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + foreach ($response['body']['documents'] as $doc) { + $this->assertArrayHasKey('name', $doc); + $this->assertArrayHasKey('pointAttr', $doc); + $this->assertArrayNotHasKey('lineAttr', $doc); + $this->assertArrayNotHasKey('polyAttr', $doc); + } + + // Test 6: Order by name + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::orderAsc('name')->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + $this->assertEquals('Test Document 1', $response['body']['documents'][0]['name']); + $this->assertEquals('Test Document 2', $response['body']['documents'][1]['name']); + $this->assertEquals('Test Document 3', $response['body']['documents'][2]['name']); + + // Test 7: Limit results + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::limit(2)->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Test 8: Offset results + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::offset(1)->toString(), Query::limit(2)->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Test 9: Complex query with multiple conditions + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name', 'pointAttr'])->toString(), + Query::orderAsc('name')->toString(), + Query::limit(1)->toString() + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('Test Document 1', $response['body']['documents'][0]['name']); + + // Test 11: Query with no results + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Non-existent Document'])->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(0, $response['body']['documents']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php index 4e19018398..6ca59e386d 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php @@ -1036,567 +1036,4 @@ class DatabasesCustomClientTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } - public function testSpatialPointAttributes(): void - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Spatial Point Test Database' - ]); - - $databaseId = $database['body']['$id']; - - // Create collection with spatial and non-spatial attributes - $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' => 'Spatial Point Collection', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], - ]); - - $collectionId = $collection['body']['$id']; - - // Create string attribute - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - // Create point attribute - handle both 201 (created) and 200 (already exists) - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'location', - 'required' => true, - ]); - - $this->assertEquals(202, $response['headers']['status-code']); - - sleep(2); - - // Test 1: Create document with point attribute - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Test Location', - 'location' => [40.7128, -74.0060] // New York coordinates - ] - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals([40.7128, -74.0060], $response['body']['location']); - $documentId = $response['body']['$id']; - - // Test 2: Read document with point attribute - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([40.7128, -74.0060], $response['body']['location']); - - // Test 3: Update document with new point coordinates - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'location' => [40.7589, -73.9851] // Times Square coordinates - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([40.7589, -73.9851], $response['body']['location']); - - // Test 4: Upsert document with point attribute - $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Upserted Location', - 'location' => [34.0522, -118.2437] // Los Angeles coordinates - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([34.0522, -118.2437], $response['body']['location']); - - // Test 5: Create document without permissions (should fail) - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Unauthorized Location', - 'location' => [0, 0] - ] - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - - // Cleanup - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - } - - public function testSpatialLineAttributes(): void - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Spatial Line Test Database' - ]); - - $databaseId = $database['body']['$id']; - - // Create collection with spatial and non-spatial attributes - $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' => 'Spatial Line Collection', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], - ]); - - $collectionId = $collection['body']['$id']; - - // Create integer attribute - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'distance', - 'required' => true, - ]); - - // Create line attribute - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'route', - 'required' => true, - ]); - - sleep(2); - - // Test 1: Create document with line attribute - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'distance' => 100, - 'route' => [[40.7128, -74.0060], [40.7589, -73.9851]] // Line from Downtown to Times Square - ] - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); - $documentId = $response['body']['$id']; - - // Test 2: Read document with line attribute - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); - - // Test 3: Update document with new line coordinates - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'route' => [[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]] // Extended route - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]], $response['body']['route']); - - // Test 4: Upsert document with line attribute - $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'distance' => 200, - 'route' => [[34.0522, -118.2437], [34.0736, -118.2400]] // LA route - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[34.0522, -118.2437], [34.0736, -118.2400]], $response['body']['route']); - - // Test 5: Delete document - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(204, $response['headers']['status-code']); - - // Test 6: Verify document is deleted - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(404, $response['headers']['status-code']); - - // Cleanup - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - } - - public function testSpatialPolygonAttributes(): void - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Spatial Polygon Test Database' - ]); - - $databaseId = $database['body']['$id']; - - // Create collection with spatial and non-spatial attributes - $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' => 'Spatial Polygon Collection', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], - ]); - - $collectionId = $collection['body']['$id']; - - // Create boolean attribute - $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' => 'active', - 'required' => true, - ]); - - // Create polygon attribute - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'area', - 'required' => true, - ]); - - sleep(2); - - // Test 1: Create document with polygon attribute - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'active' => true, - 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] // Manhattan area - ] - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); - $documentId = $response['body']['$id']; - - // Test 2: Read document with polygon attribute - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); - - // Test 3: Update document with new polygon coordinates - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]] // Extended area - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]], $response['body']['area']); - - // Test 4: Upsert document with polygon attribute - $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . ID::unique(), array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'active' => false, - 'area' => [[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]] // LA area - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]], $response['body']['area']); - - // Test 5: Create document without required polygon attribute (should fail) - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'active' => true - // Missing required 'area' attribute - ] - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - - // Cleanup - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - } - - public function testSpatialAttributesMixedCollection(): void - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Mixed Spatial Test Database' - ]); - - $databaseId = $database['body']['$id']; - - // Create collection with multiple spatial and non-spatial attributes - $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' => 'Mixed Spatial Collection', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], - ]); - - $collectionId = $collection['body']['$id']; - - // Create multiple attributes - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'center', - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'boundary', - 'required' => false, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'coverage', - 'required' => true, - ]); - - sleep(3); - - // Test 1: Create document with all spatial attributes - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Central Park', - 'center' => [40.7829, -73.9654], - 'boundary' => [[40.7649, -73.9814], [40.8009, -73.9494]], - 'coverage' => [[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]] - ] - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals([40.7829, -73.9654], $response['body']['center']); - $this->assertEquals([[40.7649, -73.9814], [40.8009, -73.9494]], $response['body']['boundary']); - $this->assertEquals([[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]], $response['body']['coverage']); - $documentId = $response['body']['$id']; - - // Test 2: Update document with new spatial data - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'center' => [40.7505, -73.9934], - 'boundary' => [[40.7305, -74.0134], [40.7705, -73.9734]], - 'coverage' => [[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]] - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([40.7505, -73.9934], $response['body']['center']); - $this->assertEquals([[40.7305, -74.0134], [40.7705, -73.9734]], $response['body']['boundary']); - $this->assertEquals([[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]], $response['body']['coverage']); - - // Test 3: Create document with minimal required attributes - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Minimal Location', - 'center' => [0, 0], - 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] - ] - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals([0, 0], $response['body']['center']); - - // Test 4: Test permission validation - create without user context - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Unauthorized Location', - 'center' => [0, 0], - 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] - ] - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - - // Cleanup - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - } } From a80c410d07893fe1bb7d00bb01ab7d6dace37c6c Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 16:15:26 +0530 Subject: [PATCH 07/75] added relationship tests for the spatial type attributes --- .../Databases/Legacy/DatabasesBase.php | 522 ++++++++++++++++++ 1 file changed, 522 insertions(+) diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index e7073683b1..c046a3f588 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6739,4 +6739,526 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + public function testSpatialRelationshipOneToOne(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial OneToOne Test DB' + ]); + + $databaseId = $database['body']['$id']; + + $place = $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' => 'Place', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $placeId = $place['body']['$id']; + + $location = $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' => 'Location', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $locationId = $location['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $placeId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $locationId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coordinates', + 'required' => true, + ]); + + sleep(2); + + // relationship: place.oneToOne -> location + $relation = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $placeId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $locationId, + 'type' => Database::RELATION_ONE_TO_ONE, + 'key' => 'location', + 'twoWay' => true, + 'twoWayKey' => 'place', + 'onDelete' => Database::RELATION_MUTATE_CASCADE, + ]); + $this->assertEquals(202, $relation['headers']['status-code']); + + sleep(2); + + // create doc with nested spatial related doc + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $placeId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Museum', + 'location' => [ + '$id' => ID::unique(), + 'coordinates' => [40.7794, -73.9632], + ], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $doc['headers']['status-code']); + $this->assertEquals([40.7794, -73.9632], $doc['body']['location']['coordinates']); + + // fetch with select to ensure relationship shape + $fetched = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $placeId . '/documents/' . $doc['body']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name', 'location.coordinates'])->toString() + ] + ]); + $this->assertEquals(200, $fetched['headers']['status-code']); + $this->assertEquals([40.7794, -73.9632], $fetched['body']['location']['coordinates']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $placeId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $locationId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipOneToMany(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial OneToMany Test DB' + ]); + $databaseId = $database['body']['$id']; + + $person = $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' => 'Person', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $personId = $person['body']['$id']; + + $visit = $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' => 'Visit', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + $visitId = $visit['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $personId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'fullName', + 'size' => 255, + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $visitId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'point', + 'required' => true, + ]); + + sleep(2); + + // relationship person.oneToMany -> visit + $rel = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $personId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $visitId, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'visits', + 'twoWay' => true, + 'twoWayKey' => 'person', + ]); + $this->assertEquals(202, $rel['headers']['status-code']); + + sleep(2); + + $personDoc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $personId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'person-spatial-1', + 'data' => [ + 'fullName' => 'Alice', + 'visits' => [ + [ '$id' => 'visit-1', 'point' => [40.7589, -73.9851] ], + [ '$id' => 'visit-2', 'point' => [40.7505, -73.9934] ], + ], + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + $this->assertEquals(201, $personDoc['headers']['status-code']); + $this->assertCount(2, $personDoc['body']['visits']); + $this->assertEquals([40.7589, -73.9851], $personDoc['body']['visits'][0]['point']); + + $visitDoc = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $visitId . '/documents/visit-2', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['point', 'person.$id'])->toString() + ] + ]); + $this->assertEquals(200, $visitDoc['headers']['status-code']); + $this->assertEquals('person-spatial-1', $visitDoc['body']['person']['$id']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $personId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $visitId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipManyToOne(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial ManyToOne Test DB' + ]); + $databaseId = $database['body']['$id']; + + $cities = $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' => 'City', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $citiesId = $cities['body']['$id']; + + $stores = $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' => 'Store', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $storesId = $stores['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $citiesId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $storesId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 255, + 'required' => true, + ]); + + sleep(2); + + // relationship stores.manyToOne -> cities + $rel = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $storesId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $citiesId, + 'type' => Database::RELATION_MANY_TO_ONE, + 'key' => 'city', + 'twoWay' => true, + 'twoWayKey' => 'stores', + ]); + $this->assertEquals(202, $rel['headers']['status-code']); + + sleep(2); + + $store = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $storesId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'store-1', + 'data' => [ + 'name' => 'Main Store', + 'city' => [ + '$id' => ID::unique(), + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] + ], + ] + ]); + $this->assertEquals(201, $store['headers']['status-code']); + $this->assertEquals('Main Store', $store['body']['name']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $store['body']['city']['area']); + + $city = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $citiesId . '/documents/' . $store['body']['city']['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['stores.$id'])->toString() + ] + ]); + $this->assertEquals(200, $city['headers']['status-code']); + $this->assertEquals('store-1', $city['body']['stores'][0]['$id']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $storesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $citiesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialRelationshipManyToMany(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial ManyToMany Test DB' + ]); + $databaseId = $database['body']['$id']; + + $drivers = $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' => 'Drivers', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $driversId = $drivers['body']['$id']; + + $zones = $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' => 'Zones', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $zonesId = $zones['body']['$id']; + + // attributes + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $driversId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'home', + 'required' => true, + ]); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $zonesId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // relationship drivers.manyToMany <-> zones + $rel = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $driversId . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $zonesId, + 'type' => Database::RELATION_MANY_TO_MANY, + 'key' => 'zones', + 'twoWay' => true, + 'twoWayKey' => 'drivers', + ]); + $this->assertEquals(202, $rel['headers']['status-code']); + + sleep(2); + + // create driver with two zones containing spatial polygons + $driver = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $driversId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'driver-1', + 'data' => [ + 'home' => [40.7128, -74.0060], + 'zones' => [ + [ '$id' => 'zone-1', 'area' => [[[0,0],[10,0],[10,10],[0,10],[0,0]]]], + [ '$id' => 'zone-2', 'area' => [[[20,20],[30,20],[30,30],[20,30],[20,20]]]], + ], + ] + ]); + $this->assertEquals(201, $driver['headers']['status-code']); + $this->assertCount(2, $driver['body']['zones']); + $this->assertEquals([40.7128, -74.0060], $driver['body']['home']); + + $zone = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $zonesId . '/documents/zone-1', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['drivers.$id'])->toString() + ] + ]); + $this->assertEquals(200, $zone['headers']['status-code']); + $this->assertEquals('driver-1', $zone['body']['drivers'][0]['$id']); + + // cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $driversId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $zonesId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } From fb82ba39518533f3d501ce81f3cc5ecb5230b1d9 Mon Sep 17 00:00:00 2001 From: Veeresh <75656445+Veera-mulge@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:41:24 +0530 Subject: [PATCH 08/75] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 27d6dd9006..fe380c130e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -> We just announced Timestamp Overrides for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-timestamp-overrides) - -> Appwrite Cloud is now Generally Available - [Learn more](https://appwrite.io/cloud-ga) +> Appwrite Databases just got the most significant update to date. We proudly present new terminology, a new TablesDB UI, and a supporting TablesDB API, all built to make working with databases simpler and faster. - [Learn more](https://appwrite.io/blog/post/announcing-appwrite-databases-new-ui) > [Get started with Appwrite](https://apwr.dev/appcloud) From 3755d58d62f3fe8fa45e064008dddb7c0fd7d7db Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 17:07:20 +0530 Subject: [PATCH 09/75] added tests for bulk operation --- .../Databases/TablesDB/DatabasesBase.php | 952 ++++++++++++++++++ .../TablesDB/DatabasesCustomServerTest.php | 566 +++++++++++ 2 files changed, 1518 insertions(+) diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index e36543fd55..ace0778c46 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -7029,4 +7029,956 @@ trait DatabasesBase ]); $this->assertEquals(400, $inc3['headers']['status-code']); } + + public function testSpatialPointColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Point Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Point Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(2); + + // Create row with point column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'location' => [40.7128, -74.0060] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + $rowId = $response['body']['$id']; + + // Read row with point column + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7128, -74.0060], $response['body']['location']); + + // Update row with new point coordinates + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'location' => [40.7589, -73.9851] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7589, -73.9851], $response['body']['location']); + + // Upsert row with point column + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Upserted Location', + 'location' => [34.0522, -118.2437] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([34.0522, -118.2437], $response['body']['location']); + + // Create row without permissions (should fail) + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'location' => [0, 0] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialLineColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Line Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Line Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create integer column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'distance', + 'required' => true, + ]); + + // Create line column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => true, + ]); + + sleep(2); + + // Create row with line column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'distance' => 100, + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + $rowId = $response['body']['$id']; + + // Read row + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851]], $response['body']['route']); + + // Update row + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'route' => [[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[40.7128, -74.0060], [40.7589, -73.9851], [40.7505, -73.9934]], $response['body']['route']); + + // Upsert row with line column + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'distance' => 200, + 'route' => [[34.0522, -118.2437], [34.0736, -118.2400]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[34.0522, -118.2437], [34.0736, -118.2400]], $response['body']['route']); + + // Delete row + $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(204, $response['headers']['status-code']); + + // Verify row is deleted + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(404, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialPolygonColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Polygon Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Polygon Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create boolean column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/boolean', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'active', + 'required' => true, + ]); + + // Create polygon column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Create row with polygon column + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'active' => true, + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + $rowId = $response['body']['$id']; + + // Read row + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7128, -74.0060]]], $response['body']['area']); + + // Update row with new polygon + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'area' => [[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[40.7128, -74.0060], [40.7589, -74.0060], [40.7589, -73.9851], [40.7128, -73.9851], [40.7505, -73.9934], [40.7128, -74.0060]]], $response['body']['area']); + + // Upsert row with polygon column + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . ID::unique(), array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'active' => false, + 'area' => [[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]], $response['body']['area']); + + // Create row missing required polygon (should fail) + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'active' => true + ] + ]); + $this->assertEquals(400, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialColumnsMixedTable(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Mixed Spatial Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with multiple spatial and non-spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Mixed Spatial Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create multiple columns + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'center', + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'boundary', + 'required' => false, + ]); + + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'coverage', + 'required' => true, + ]); + + sleep(3); + + // Create row with all spatial columns + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Central Park', + 'center' => [40.7829, -73.9654], + 'boundary' => [[40.7649, -73.9814], [40.8009, -73.9494]], + 'coverage' => [[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([40.7829, -73.9654], $response['body']['center']); + $this->assertEquals([[40.7649, -73.9814], [40.8009, -73.9494]], $response['body']['boundary']); + $this->assertEquals([[[40.7649, -73.9814], [40.8009, -73.9814], [40.8009, -73.9494], [40.7649, -73.9494], [40.7649, -73.9814]]], $response['body']['coverage']); + $rowId = $response['body']['$id']; + + // Update row with new spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'center' => [40.7505, -73.9934], + 'boundary' => [[40.7305, -74.0134], [40.7705, -73.9734]], + 'coverage' => [[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]] + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([40.7505, -73.9934], $response['body']['center']); + $this->assertEquals([[40.7305, -74.0134], [40.7705, -73.9734]], $response['body']['boundary']); + $this->assertEquals([[[40.7305, -74.0134], [40.7705, -74.0134], [40.7705, -73.9734], [40.7305, -73.9734], [40.7305, -74.0134]]], $response['body']['coverage']); + + // Create row with minimal required columns + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Minimal Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['center']); + + // Permission validation - create without user context + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Unauthorized Location', + 'center' => [0, 0], + 'coverage' => [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialQuery(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Query Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create table with spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Query Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $nameColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + $this->assertEquals(202, $nameColumn['headers']['status-code']); + + // Create point column + $pointColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pointAttr', + 'required' => true, + ]); + $this->assertEquals(202, $pointColumn['headers']['status-code']); + + // Create line column + $lineColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'lineAttr', + 'required' => true, + ]); + $this->assertEquals(202, $lineColumn['headers']['status-code']); + + // Create polygon column + $polygonColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'polyAttr', + 'required' => true, + ]); + $this->assertEquals(202, $polygonColumn['headers']['status-code']); + + // Wait for columns to be created + sleep(2); + + // Create test rows with spatial data + $rows = [ + [ + '$id' => 'row1', + 'name' => 'Test Row 1', + 'pointAttr' => [6.0, 6.0], + 'lineAttr' => [[1.0, 1.0], [2.0, 2.0]], + 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] + ], + [ + '$id' => 'row2', + 'name' => 'Test Row 2', + 'pointAttr' => [7.0, 6.0], + 'lineAttr' => [[10.0, 10.0], [20.0, 20.0]], + 'polyAttr' => [[[20.0, 20.0], [30.0, 20.0], [30.0, 30.0], [20.0, 30.0], [20.0, 20.0]]] + ], + [ + '$id' => 'row3', + 'name' => 'Test Row 3', + 'pointAttr' => [25.0, 25.0], + 'lineAttr' => [[25.0, 25.0], [35.0, 35.0]], + 'polyAttr' => [[[40.0, 40.0], [50.0, 40.0], [50.0, 50.0], [40.0, 50.0], [40.0, 40.0]]] + ] + ]; + + foreach ($rows as $r) { + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => $r['$id'], + 'data' => [ + 'name' => $r['name'], + 'pointAttr' => $r['pointAttr'], + 'lineAttr' => $r['lineAttr'], + 'polyAttr' => $r['polyAttr'] + ] + ]); + $this->assertEquals(201, $response['headers']['status-code']); + } + + // Equality on non-spatial column (name) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Test Row 1'])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // Polygon column queries + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('polyAttr', [[[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // Not equal queries + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notEqual('pointAttr', [[6.0, 6.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // notContains on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notContains('polyAttr', [[15.0, 15.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // intersects on polygon (point inside row1 polygon) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::intersects('polyAttr', [[5.0, 5.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // notIntersects on polygon (point outside all polygons) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notIntersects('polyAttr', [[60.0, 60.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // overlaps on polygon (polygon overlapping row1) + $overlapPoly = [[[5.0, 5.0], [12.0, 5.0], [12.0, 12.0], [5.0, 12.0], [5.0, 5.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::overlaps('polyAttr', [$overlapPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // notOverlaps on polygon (polygon that overlaps none) + $noOverlapPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notOverlaps('polyAttr', [$noOverlapPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // distance (equals) on point + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row2', $response['body']['documents'][0]['$id']); + + // notDistance (outside radius) on point + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notDistance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + // distanceGreaterThan + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceGreaterThan('pointAttr', [[[6.0, 6.0], 5.0]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // distanceLessThan + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('pointAttr', [[[6.0, 6.0], 0.5]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + // crosses on line (query line crosses row1 line) + $crossLine = [[1.0, 2.0], [2.0, 1.0]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::crosses('lineAttr', [$crossLine])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // notCrosses on line (query line does not cross any stored lines) + $nonCrossLine = [[0.0, 1.0], [0.0, 2.0]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notCrosses('lineAttr', [$nonCrossLine])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // touches on polygon (query polygon touches row1 polygon at corner) + $touchPoly = [[[10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::touches('polyAttr', [$touchPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + + // notTouches on polygon (polygon far away should not touch) + $farPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::notTouches('polyAttr', [$farPoly])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + // Select specific columns + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::select(['name', 'pointAttr'])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + foreach ($response['body']['documents'] as $doc) { + $this->assertArrayHasKey('name', $doc); + $this->assertArrayHasKey('pointAttr', $doc); + $this->assertArrayNotHasKey('lineAttr', $doc); + $this->assertArrayNotHasKey('polyAttr', $doc); + } + + // Order by name + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::orderAsc('name')->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + $this->assertEquals('Test Row 1', $response['body']['documents'][0]['name']); + $this->assertEquals('Test Row 2', $response['body']['documents'][1]['name']); + $this->assertEquals('Test Row 3', $response['body']['documents'][2]['name']); + + // Limit results + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::limit(2)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + + // Offset results + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::offset(1)->toString(), Query::limit(2)->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['documents']); + + // Complex query with multiple conditions + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::select(['name', 'pointAttr'])->toString(), + Query::orderAsc('name')->toString(), + Query::limit(1)->toString() + ] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('Test Row 1', $response['body']['documents'][0]['name']); + + // Query with no results + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('name', ['Non-existent Row'])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(0, $response['body']['documents']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php index d987019d7a..74f8a0432d 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php @@ -6132,4 +6132,570 @@ class DatabasesCustomServerTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + public function testSpatialBulkOperations(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create table with spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Bulk Operations Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $nameColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameColumn['headers']['status-code']); + + // Create point column + $pointColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + $this->assertEquals(202, $pointColumn['headers']['status-code']); + + // Create polygon column + $polygonColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => false, + ]); + + $this->assertEquals(202, $polygonColumn['headers']['status-code']); + + // Wait for columns to be created + sleep(2); + + // Test 1: Bulk create with spatial data + $spatialRows = []; + for ($i = 0; $i < 5; $i++) { + $spatialRows[] = [ + '$id' => ID::unique(), + 'name' => 'Location ' . $i, + 'location' => [10.0 + $i, 20.0 + $i], // POINT + 'area' => [ + [10.0 + $i, 20.0 + $i], + [11.0 + $i, 20.0 + $i], + [11.0 + $i, 21.0 + $i], + [10.0 + $i, 21.0 + $i], + [10.0 + $i, 20.0 + $i] + ] // POLYGON + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $spatialRows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['rows']); + + // Verify created rows have proper spatial data + foreach ($response['body']['rows'] as $index => $row) { + $this->assertNotEmpty($row['$id']); + $this->assertNotEmpty($row['name']); + $this->assertIsArray($row['location']); + $this->assertIsArray($row['area']); + $this->assertCount(2, $row['location']); // POINT has 2 coordinates + + // Check polygon structure - it might be stored as an array of arrays + if (is_array($row['area'][0])) { + $this->assertGreaterThan(1, count($row['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($row['area'])); // POLYGON has multiple points + } + + $this->assertEquals('Location ' . $index, $row['name']); + $this->assertEquals([10.0 + $index, 20.0 + $index], $row['location']); + } + + // Test 2: Bulk update with spatial data + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Location', + 'location' => [15.0, 25.0], // New POINT + 'area' => [ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ] // New POLYGON + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['rows']); + + // Verify updated rows + foreach ($response['body']['rows'] as $row) { + $this->assertEquals('Updated Location', $row['name']); + $this->assertEquals([15.0, 25.0], $row['location']); + // The area might be stored as an array of arrays, so check the first element + $this->assertIsArray($row['area']); + if (is_array($row['area'][0])) { + // If it's an array of arrays, check the first polygon + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $row['area'][0]); + } else { + // If it's a direct array, check the whole thing + $this->assertEquals([ + [15.0, 25.0], + [16.0, 25.0], + [16.0, 26.0], + [15.0, 26.0], + [15.0, 25.0] + ], $row['area']); + } + } + + // Test 3: Bulk upsert with spatial data + $upsertRows = [ + [ + '$id' => 'upsert1', + 'name' => 'Upsert Location 1', + 'location' => [30.0, 40.0], + 'area' => [ + [30.0, 40.0], + [31.0, 40.0], + [31.0, 41.0], + [30.0, 41.0], + [30.0, 40.0] + ] + ], + [ + '$id' => 'upsert2', + 'name' => 'Upsert Location 2', + 'location' => [35.0, 45.0], + 'area' => [ + [35.0, 45.0], + [36.0, 45.0], + [36.0, 46.0], + [35.0, 46.0], + [35.0, 45.0] + ] + ] + ]; + + $response = $this->client->call(Client::METHOD_PUT, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $upsertRows, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['rows']); + + // Verify upserted rows + foreach ($response['body']['rows'] as $row) { + $this->assertNotEmpty($row['$id']); + $this->assertIsArray($row['location']); + $this->assertIsArray($row['area']); + + // Verify the spatial data structure + $this->assertCount(2, $row['location']); // POINT has 2 coordinates + if (is_array($row['area'][0])) { + $this->assertGreaterThan(1, count($row['area'][0])); // POLYGON has multiple points + } else { + $this->assertGreaterThan(1, count($row['area'])); // POLYGON has multiple points + } + } + + // Test 4: Edge cases for spatial bulk operations + + // Test 4a: Invalid point coordinates (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Point', + 'location' => [1000.0, 2000.0], // Invalid coordinates + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // Coordinates are not validated strictly; creation should succeed + $this->assertEquals(201, $response['headers']['status-code']); + + // Test 4b: Invalid polygon (insufficient points - should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Polygon', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0] + ] + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Test 4c: Missing required location (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Missing Location', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to missing required attribute + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4d: Mixed valid and invalid rows in bulk (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Valid Row', + 'location' => [10.0, 20.0], + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ], + [ + '$id' => ID::unique(), + 'name' => 'Invalid Row', + // Missing required 'location' attribute + 'area' => [ + [10.0, 20.0], + [11.0, 20.0], + [11.0, 21.0], + [10.0, 21.0], + [10.0, 20.0] + ] + ] + ], + ]); + + // This should fail due to mixed valid/invalid rows + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4e: Very large spatial data (stress test) + $largePolygon = []; + for ($i = 0; $i < 1000; $i++) { + $largePolygon[] = [$i * 0.001, $i * 0.001]; + } + $largePolygon[] = [0, 0]; // Close the polygon + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Large Polygon Test', + 'location' => [0.0, 0.0], + 'area' => $largePolygon + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Test 4f: Null values in spatial attributes (should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Null Values Test', + 'location' => null, // Null point + 'area' => null // Null polygon + ] + ], + ]); + + // This should fail due to null values + $this->assertEquals(400, $response['headers']['status-code']); + + // Test 4g: Bulk operations with spatial data exceeding limits + $largeBulkRows = []; + for ($i = 0; $i < 100; $i++) { + $largeBulkRows[] = [ + '$id' => ID::unique(), + 'name' => 'Bulk Test ' . $i, + 'location' => [$i * 0.1, $i * 0.1], + 'area' => [ + [$i * 0.1, $i * 0.1], + [($i + 1) * 0.1, $i * 0.1], + [($i + 1) * 0.1, ($i + 1) * 0.1], + [$i * 0.1, ($i + 1) * 0.1], + [$i * 0.1, $i * 0.1] + ] + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $largeBulkRows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialBulkOperationsWithLineStrings(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Test Database' + ]); + + $this->assertNotEmpty($database['body']['$id']); + $databaseId = $database['body']['$id']; + + // Create table with line string columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Spatial LineString Bulk Operations Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create string column + $nameColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals(202, $nameColumn['headers']['status-code']); + + // Create line string column + $lineColumn = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'path', + 'required' => true, + ]); + + // Handle both 201 (created) and 202 (accepted) status codes + $this->assertEquals(202, $lineColumn['headers']['status-code']); + + // Wait for columns to be created + sleep(2); + + // Test bulk create with line string data + $lineStringRows = []; + for ($i = 0; $i < 3; $i++) { + $lineStringRows[] = [ + '$id' => ID::unique(), + 'name' => 'Path ' . $i, + 'path' => [ + [$i * 10, $i * 10], + [($i + 1) * 10, ($i + 1) * 10], + [($i + 2) * 10, ($i + 2) * 10] + ] // LINE STRING with 3 points + ]; + } + + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => $lineStringRows, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + + // Verify created rows have proper line string data + foreach ($response['body']['rows'] as $index => $row) { + $this->assertNotEmpty($row['$id']); + $this->assertNotEmpty($row['name']); + $this->assertIsArray($row['path']); + $this->assertGreaterThan(1, count($row['path'])); // LINE STRING has multiple points + $this->assertEquals('Path ' . $index, $row['name']); + $this->assertCount(3, $row['path']); // Each line string has 3 points + } + + // Test bulk update with line string data + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Updated Path', + 'path' => [ + [0, 0], + [50, 50], + [100, 100] + ] // New LINE STRING + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['rows']); + + // Verify updated rows + foreach ($response['body']['rows'] as $row) { + $this->assertEquals('Updated Path', $row['name']); + $this->assertEquals([ + [0, 0], + [50, 50], + [100, 100] + ], $row['path']); + } + + // Test: Invalid line string (single point - should fail) + $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rows' => [ + [ + '$id' => ID::unique(), + 'name' => 'Invalid Line String', + 'path' => [[10, 20]] // Single point - invalid line string + ] + ], + ]); + + // Single point linestrings are accepted as arrays; creation should succeed + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } From ca2bdc1cd2c66b58d63907aa575654fb3eb2e64b Mon Sep 17 00:00:00 2001 From: Veeresh <75656445+Veera-mulge@users.noreply.github.com> Date: Tue, 26 Aug 2025 17:41:49 +0530 Subject: [PATCH 10/75] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe380c130e..c210784737 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -> Appwrite Databases just got the most significant update to date. We proudly present new terminology, a new TablesDB UI, and a supporting TablesDB API, all built to make working with databases simpler and faster. - [Learn more](https://appwrite.io/blog/post/announcing-appwrite-databases-new-ui) +> We just announced a brand new TablesDB UI for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-appwrite-databases-new-ui) + +> Appwrite Cloud is now Generally Available - [Learn more](https://appwrite.io/cloud-ga) > [Get started with Appwrite](https://apwr.dev/appcloud) From b28ec182d795b2828e5e07acfa1682849cd820e1 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 20:54:55 +0530 Subject: [PATCH 11/75] added spatial index tests --- .../Databases/Collections/Indexes/Create.php | 26 ++++- .../Http/TablesDB/Tables/Indexes/Create.php | 2 +- .../Databases/Legacy/DatabasesBase.php | 100 ++++++++++++++++++ .../Databases/TablesDB/DatabasesBase.php | 100 ++++++++++++++++++ 4 files changed, 223 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php index 04baa093d8..93f095e1dd 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -71,7 +71,7 @@ class Create extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') - ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE]), 'Index type.') + ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE, Database::INDEX_SPATIAL]), 'Index type.') ->param('attributes', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of attributes to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' attributes are allowed, each 32 characters long.') ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional: true) @@ -190,11 +190,29 @@ class Create extends Action 'orders' => $orders, ]); + // Determine adapter capabilities. For TablesDB, be permissive to accept requests + // and let the background worker enforce engine-specific constraints. + $maxIndexLength = $dbForProject->getAdapter()->getMaxIndexLength(); + $internalIndexesKeys = $dbForProject->getAdapter()->getInternalIndexesKeys(); + $supportForIndexArray = $dbForProject->getAdapter()->getSupportForIndexArray(); + $supportForSpatialAttributes = $dbForProject->getAdapter()->getSupportForSpatialAttributes(); + $supportForSpatialIndexNull = $dbForProject->getAdapter()->getSupportForSpatialIndexNull(); + $supportForSpatialIndexOrder = $dbForProject->getAdapter()->getSupportForSpatialIndexOrder(); + + if (!$this->isCollectionsAPI()) { + // Relax spatial constraints for TablesDB API + $supportForSpatialIndexNull = true; + $supportForSpatialIndexOrder = true; + } + $validator = new IndexValidator( $collection->getAttribute('attributes'), - $dbForProject->getAdapter()->getMaxIndexLength(), - $dbForProject->getAdapter()->getInternalIndexesKeys(), - $dbForProject->getAdapter()->getSupportForIndexArray() + $maxIndexLength, + $internalIndexesKeys, + $supportForIndexArray, + $supportForSpatialAttributes, + $supportForSpatialIndexNull, + $supportForSpatialIndexOrder ); if (!$validator->isValid($index)) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php index 34d594bebd..dbcdbc90d1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php @@ -58,7 +58,7 @@ class Create extends IndexCreate ->param('databaseId', '', new UID(), 'Database ID.') ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', null, new Key(), 'Index Key.') - ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE]), 'Index type.') + ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE, Database::INDEX_SPATIAL]), 'Index type.') ->param('columns', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of columns to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' columns are allowed, each 32 characters long.') ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional: true) diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index c046a3f588..ede9abf658 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -7261,4 +7261,104 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + public function testSpatialIndex(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Index Test DB' + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $databaseId = $database['body']['$id']; + + $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' => 'SpatialIdx', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $collection['headers']['status-code']); + $collectionId = $collection['body']['$id']; + + // Create spatial attributes: one required, one optional + $reqPoint = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pRequired', + 'required' => true, + ]); + $this->assertEquals(202, $reqPoint['headers']['status-code']); + + $optPoint = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pOptional', + 'required' => false, + ]); + $this->assertEquals(202, $optPoint['headers']['status-code']); + + // Ensure attributes are available + sleep(2); + + // Create index on required spatial attribute (should succeed) + $okIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_required_point', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pRequired'], + ]); + $this->assertEquals(202, $okIndex['headers']['status-code']); + + // Create index on optional spatial attribute (should fail in case of mariadb) + $badIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pOptional'], + ]); + $this->assertEquals(400, $badIndex['headers']['status-code']); + + // Passing orders to spatial index should not throw error(in case of mariadb) + $ordersIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_required_point_with_orders', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pRequired'], + 'orders' => ['ASC'] + ]); + $this->assertEquals(202, $ordersIndex['headers']['status-code']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index ace0778c46..8c0670e191 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -7969,6 +7969,106 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(0, $response['body']['documents']); + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + + public function testSpatialIndex(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Index Test DB' + ]); + $this->assertEquals(201, $database['headers']['status-code']); + $databaseId = $database['body']['$id']; + + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'SpatialIdx', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $table['headers']['status-code']); + $tableId = $table['body']['$id']; + + // Create spatial columns: one required, one optional + $reqPoint = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pRequired', + 'required' => true, + ]); + $this->assertEquals(202, $reqPoint['headers']['status-code']); + + $optPoint = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'pOptional', + 'required' => false, + ]); + $this->assertEquals(202, $optPoint['headers']['status-code']); + + // Ensure columns are available + sleep(2); + + // Create index on required spatial column (should succeed) + $okIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_required_point', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pRequired'], + ]); + $this->assertEquals(202, $okIndex['headers']['status-code']); + + // Create index on optional spatial column (should fail in case of mariadb) + $badIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pOptional'], + ]); + $this->assertEquals(202, $badIndex['headers']['status-code']); + + // Passing orders to spatial index should not throw error (in case of mariadb) + $ordersIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_required_point_with_orders', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pRequired'], + 'orders' => ['ASC'] + ]); + $this->assertEquals(202, $ordersIndex['headers']['status-code']); + // Cleanup $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ 'content-type' => 'application/json', From 0aee34185a3b8b19f5cfd3b7efafc3cdeabcda81 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 21:11:30 +0530 Subject: [PATCH 12/75] updated distance queries --- composer.json | 8 +- composer.lock | 87 ++++++++++++++----- .../Databases/Legacy/DatabasesBase.php | 8 +- .../Databases/TablesDB/DatabasesBase.php | 54 ++++++------ 4 files changed, 101 insertions(+), 56 deletions(-) diff --git a/composer.json b/composer.json index 0c662c775f..cb8ac9c744 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,12 @@ "Appwrite\\Tests\\": "tests/extensions" } }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/ArnabChatterjee20k/php-utopia-database.git" + } + ], "require": { "php": ">=8.3.0", "ext-curl": "*", @@ -52,7 +58,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "1.*", + "utopia-php/database": "dev-spatial-attribute-support as 1.1.6", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", "utopia-php/dns": "0.3.*", diff --git a/composer.lock b/composer.lock index 3b0d7e724a..d36f3cc2b9 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "0da713ee5642eba1d30bc51c1a04a723", + "content-hash": "cc71910a644cb4707dcf1b9503acc458", "packages": [ { "name": "adhocore/jwt", @@ -3557,16 +3557,16 @@ }, { "name": "utopia-php/database", - "version": "1.1.0", + "version": "dev-spatial-attribute-support", "source": { "type": "git", - "url": "https://github.com/utopia-php/database.git", - "reference": "670e8efe7fb91f0fe43570caa5db97a1a5223357" + "url": "https://github.com/ArnabChatterjee20k/php-utopia-database.git", + "reference": "88998edfc808821fc0c04883b922335ae090e5b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/670e8efe7fb91f0fe43570caa5db97a1a5223357", - "reference": "670e8efe7fb91f0fe43570caa5db97a1a5223357", + "url": "https://api.github.com/repos/ArnabChatterjee20k/php-utopia-database/zipball/88998edfc808821fc0c04883b922335ae090e5b5", + "reference": "88998edfc808821fc0c04883b922335ae090e5b5", "shasum": "" }, "require": { @@ -3593,7 +3593,38 @@ "Utopia\\Database\\": "src/Database" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Tests\\E2E\\": "tests/e2e", + "Tests\\Unit\\": "tests/unit" + } + }, + "scripts": { + "build": [ + "Composer\\Config::disableProcessTimeout", + "docker compose build" + ], + "start": [ + "Composer\\Config::disableProcessTimeout", + "docker compose up -d" + ], + "test": [ + "Composer\\Config::disableProcessTimeout", + "docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml" + ], + "lint": [ + "php -d memory_limit=2G ./vendor/bin/pint --test" + ], + "format": [ + "php -d memory_limit=2G ./vendor/bin/pint" + ], + "check": [ + "./vendor/bin/phpstan analyse --level 7 src tests --memory-limit 2G" + ], + "coverage": [ + "./vendor/bin/coverage-check ./tmp/clover.xml 90" + ] + }, "license": [ "MIT" ], @@ -3606,10 +3637,9 @@ "utopia" ], "support": { - "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.1.0" + "source": "https://github.com/ArnabChatterjee20k/php-utopia-database/tree/spatial-attribute-support" }, - "time": "2025-08-21T15:37:11+00:00" + "time": "2025-08-26T15:18:37+00:00" }, { "name": "utopia-php/detector", @@ -3861,16 +3891,16 @@ }, { "name": "utopia-php/framework", - "version": "0.33.21", + "version": "0.33.22", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "eb0e82e90b8fa493f99b8d131bdd25173422c493" + "reference": "c01a815cb976c9255e045fc3bcc3f5fcf477e0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/eb0e82e90b8fa493f99b8d131bdd25173422c493", - "reference": "eb0e82e90b8fa493f99b8d131bdd25173422c493", + "url": "https://api.github.com/repos/utopia-php/http/zipball/c01a815cb976c9255e045fc3bcc3f5fcf477e0bc", + "reference": "c01a815cb976c9255e045fc3bcc3f5fcf477e0bc", "shasum": "" }, "require": { @@ -3902,9 +3932,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.21" + "source": "https://github.com/utopia-php/http/tree/0.33.22" }, - "time": "2025-08-19T10:52:15+00:00" + "time": "2025-08-26T10:29:50+00:00" }, { "name": "utopia-php/image", @@ -4926,16 +4956,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "1.1.4", + "version": "1.1.14", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "4196a50d4cd847e2d7f8dd1136fc0ee96e931043" + "reference": "662c7a53e683ed941c7d1374cfd32533bf54fbca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/4196a50d4cd847e2d7f8dd1136fc0ee96e931043", - "reference": "4196a50d4cd847e2d7f8dd1136fc0ee96e931043", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/662c7a53e683ed941c7d1374cfd32533bf54fbca", + "reference": "662c7a53e683ed941c7d1374cfd32533bf54fbca", "shasum": "" }, "require": { @@ -4971,9 +5001,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/1.1.4" + "source": "https://github.com/appwrite/sdk-generator/tree/1.1.14" }, - "time": "2025-08-21T09:46:01+00:00" + "time": "2025-08-26T13:17:07+00:00" }, { "name": "doctrine/annotations", @@ -8425,9 +8455,18 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-spatial-attribute-support", + "alias": "1.1.6", + "alias_normalized": "1.1.6.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index ede9abf658..cb1244aad3 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6563,7 +6563,7 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::distance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + 'queries' => [Query::distanceEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); @@ -6574,7 +6574,7 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::notDistance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + 'queries' => [Query::distanceNotEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(2, $response['body']['total']); @@ -6584,7 +6584,7 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::distanceGreaterThan('pointAttr', [[[6.0, 6.0], 5.0]])->toString()] + 'queries' => [Query::distanceGreaterThan('pointAttr', [6.0, 6.0], 5.0)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); @@ -6594,7 +6594,7 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::distanceLessThan('pointAttr', [[[6.0, 6.0], 0.5]])->toString()] + 'queries' => [Query::distanceLessThan('pointAttr', [6.0, 6.0], 0.5)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index 8c0670e191..2e83719909 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -7719,8 +7719,8 @@ trait DatabasesBase 'queries' => [Query::equal('name', ['Test Row 1'])->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['documents']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // Polygon column queries $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7730,8 +7730,8 @@ trait DatabasesBase 'queries' => [Query::equal('polyAttr', [[[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]]])->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['documents']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // Not equal queries $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7741,7 +7741,7 @@ trait DatabasesBase 'queries' => [Query::notEqual('pointAttr', [[6.0, 6.0]])->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(2, $response['body']['documents']); + $this->assertCount(2, $response['body']['rows']); // contains on line (point on line) $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7751,8 +7751,8 @@ trait DatabasesBase 'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['documents']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7773,7 +7773,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // notIntersects on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7795,7 +7795,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // notOverlaps on polygon (polygon that overlaps none) $noOverlapPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; @@ -7813,18 +7813,18 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::distance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + 'queries' => [Query::distanceEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); - $this->assertEquals('row2', $response['body']['documents'][0]['$id']); + $this->assertEquals('row2', $response['body']['rows'][0]['$id']); // notDistance (outside radius) on point $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::notDistance('pointAttr', [[[6.0, 6.0], 1.0]])->toString()] + 'queries' => [Query::distanceNotEqual('pointAttr', [6.0, 6.0], 1.0)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(2, $response['body']['total']); @@ -7834,7 +7834,7 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::distanceGreaterThan('pointAttr', [[[6.0, 6.0], 5.0]])->toString()] + 'queries' => [Query::distanceGreaterThan('pointAttr', [6.0, 6.0], 5.0)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); @@ -7844,7 +7844,7 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::distanceLessThan('pointAttr', [[[6.0, 6.0], 0.5]])->toString()] + 'queries' => [Query::distanceLessThan('pointAttr', [6.0, 6.0], 0.5)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); @@ -7859,7 +7859,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // notCrosses on line (query line does not cross any stored lines) $nonCrossLine = [[0.0, 1.0], [0.0, 2.0]]; @@ -7882,7 +7882,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(2, $response['body']['total']); - $this->assertEquals('row1', $response['body']['documents'][0]['$id']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); // notTouches on polygon (polygon far away should not touch) $farPoly = [[[60.0, 60.0], [70.0, 60.0], [70.0, 70.0], [60.0, 70.0], [60.0, 60.0]]]; @@ -7903,8 +7903,8 @@ trait DatabasesBase 'queries' => [Query::select(['name', 'pointAttr'])->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(3, $response['body']['documents']); - foreach ($response['body']['documents'] as $doc) { + $this->assertCount(3, $response['body']['rows']); + foreach ($response['body']['rows'] as $doc) { $this->assertArrayHasKey('name', $doc); $this->assertArrayHasKey('pointAttr', $doc); $this->assertArrayNotHasKey('lineAttr', $doc); @@ -7919,10 +7919,10 @@ trait DatabasesBase 'queries' => [Query::orderAsc('name')->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(3, $response['body']['documents']); - $this->assertEquals('Test Row 1', $response['body']['documents'][0]['name']); - $this->assertEquals('Test Row 2', $response['body']['documents'][1]['name']); - $this->assertEquals('Test Row 3', $response['body']['documents'][2]['name']); + $this->assertCount(3, $response['body']['rows']); + $this->assertEquals('Test Row 1', $response['body']['rows'][0]['name']); + $this->assertEquals('Test Row 2', $response['body']['rows'][1]['name']); + $this->assertEquals('Test Row 3', $response['body']['rows'][2]['name']); // Limit results $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7932,7 +7932,7 @@ trait DatabasesBase 'queries' => [Query::limit(2)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(2, $response['body']['documents']); + $this->assertCount(2, $response['body']['rows']); // Offset results $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7942,7 +7942,7 @@ trait DatabasesBase 'queries' => [Query::offset(1)->toString(), Query::limit(2)->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['documents']); + $this->assertCount(2, $response['body']['rows']); // Complex query with multiple conditions $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7956,8 +7956,8 @@ trait DatabasesBase ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['documents']); - $this->assertEquals('Test Row 1', $response['body']['documents'][0]['name']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('Test Row 1', $response['body']['rows'][0]['name']); // Query with no results $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -7967,7 +7967,7 @@ trait DatabasesBase 'queries' => [Query::equal('name', ['Non-existent Row'])->toString()] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(0, $response['body']['documents']); + $this->assertCount(0, $response['body']['rows']); // Cleanup $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ From 0d41d8b6c0dee90e7f8863fdd6d082837e1da99f Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 21:30:36 +0530 Subject: [PATCH 13/75] empty commit From 67903fcf085f555a664092e966d46390b9ed3047 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 26 Aug 2025 21:48:22 +0530 Subject: [PATCH 14/75] updated composer --- composer.json | 8 +------ composer.lock | 60 +++++++++------------------------------------------ 2 files changed, 11 insertions(+), 57 deletions(-) diff --git a/composer.json b/composer.json index cb8ac9c744..0c662c775f 100644 --- a/composer.json +++ b/composer.json @@ -30,12 +30,6 @@ "Appwrite\\Tests\\": "tests/extensions" } }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/ArnabChatterjee20k/php-utopia-database.git" - } - ], "require": { "php": ">=8.3.0", "ext-curl": "*", @@ -58,7 +52,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "dev-spatial-attribute-support as 1.1.6", + "utopia-php/database": "1.*", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", "utopia-php/dns": "0.3.*", diff --git a/composer.lock b/composer.lock index 23d21b2713..79dfc9372a 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "cc71910a644cb4707dcf1b9503acc458", + "content-hash": "0da713ee5642eba1d30bc51c1a04a723", "packages": [ { "name": "adhocore/jwt", @@ -3557,16 +3557,16 @@ }, { "name": "utopia-php/database", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "653e19d26c5607b9dce917c50737824772cd3dd8" + "reference": "99beaf1dd6dc3561c8332f9893325777553644a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/653e19d26c5607b9dce917c50737824772cd3dd8", - "reference": "653e19d26c5607b9dce917c50737824772cd3dd8", + "url": "https://api.github.com/repos/utopia-php/database/zipball/99beaf1dd6dc3561c8332f9893325777553644a4", + "reference": "99beaf1dd6dc3561c8332f9893325777553644a4", "shasum": "" }, "require": { @@ -3593,38 +3593,7 @@ "Utopia\\Database\\": "src/Database" } }, - "autoload-dev": { - "psr-4": { - "Tests\\E2E\\": "tests/e2e", - "Tests\\Unit\\": "tests/unit" - } - }, - "scripts": { - "build": [ - "Composer\\Config::disableProcessTimeout", - "docker compose build" - ], - "start": [ - "Composer\\Config::disableProcessTimeout", - "docker compose up -d" - ], - "test": [ - "Composer\\Config::disableProcessTimeout", - "docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml" - ], - "lint": [ - "php -d memory_limit=2G ./vendor/bin/pint --test" - ], - "format": [ - "php -d memory_limit=2G ./vendor/bin/pint" - ], - "check": [ - "./vendor/bin/phpstan analyse --level 7 src tests --memory-limit 2G" - ], - "coverage": [ - "./vendor/bin/coverage-check ./tmp/clover.xml 90" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3638,9 +3607,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.2.0" + "source": "https://github.com/utopia-php/database/tree/1.2.1" }, - "time": "2025-08-26T12:51:42+00:00" + "time": "2025-08-26T16:05:26+00:00" }, { "name": "utopia-php/detector", @@ -8456,18 +8425,9 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-spatial-attribute-support", - "alias": "1.1.6", - "alias_normalized": "1.1.6.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { From a1be47e669e1b479670fc920663ea1a93c8e4a5b Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 27 Aug 2025 10:17:29 +0530 Subject: [PATCH 15/75] linting fix --- src/Appwrite/Utopia/Request/Filters/V20.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Request/Filters/V20.php b/src/Appwrite/Utopia/Request/Filters/V20.php index 939eeeabe7..30de1fb2d3 100644 --- a/src/Appwrite/Utopia/Request/Filters/V20.php +++ b/src/Appwrite/Utopia/Request/Filters/V20.php @@ -52,7 +52,7 @@ class V20 extends Filter if (empty($selections)) { $hasWildcard = true; $parsed[] = Query::select(['*']); - } else if (!$hasWildcard) { + } elseif (!$hasWildcard) { // check if any select includes a wildcard as we added one above foreach ($selections as $select) { if (\in_array('*', $select->getValues(), true)) { From 7a4929a51f369ada8c036a9c899208a5b0769d5f Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 27 Aug 2025 16:30:25 +0530 Subject: [PATCH 16/75] added update and default cases for the spatial attributes endpoints --- .../Collections/Attributes/Action.php | 2 +- .../Collections/Attributes/Line/Create.php | 14 +- .../Collections/Attributes/Line/Update.php | 11 +- .../Collections/Attributes/Point/Create.php | 14 +- .../Collections/Attributes/Point/Update.php | 10 +- .../Collections/Attributes/Polygon/Create.php | 14 +- .../Collections/Attributes/Polygon/Update.php | 8 +- .../TablesDB/Tables/Columns/Line/Create.php | 10 +- .../TablesDB/Tables/Columns/Line/Update.php | 67 ++++++++ .../TablesDB/Tables/Columns/Point/Create.php | 10 +- .../TablesDB/Tables/Columns/Point/Update.php | 67 ++++++++ .../Tables/Columns/Polygon/Create.php | 10 +- .../Tables/Columns/Polygon/Update.php | 67 ++++++++ .../Databases/Services/Registry/Tables.php | 6 + .../Databases/Legacy/DatabasesBase.php | 159 ++++++++++++++++++ .../Databases/TablesDB/DatabasesBase.php | 159 ++++++++++++++++++ 16 files changed, 590 insertions(+), 38 deletions(-) create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php create mode 100644 src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php index 948a993424..ccf886b029 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php @@ -446,7 +446,7 @@ abstract class Action extends UtopiaAction return $attribute; } - protected function updateAttribute(string $databaseId, string $collectionId, string $key, Database $dbForProject, Event $queueForEvents, string $type, int $size = null, string $filter = null, string|bool|int|float $default = null, bool $required = null, int|float|null $min = null, int|float|null $max = null, array $elements = null, array $options = [], string $newKey = null): Document + protected function updateAttribute(string $databaseId, string $collectionId, string $key, Database $dbForProject, Event $queueForEvents, string $type, int $size = null, string $filter = null, string|bool|int|float|array $default = null, bool $required = null, int|float|null $min = null, int|float|null $max = null, array $elements = null, array $options = [], string $newKey = null): Document { $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index 56bb0e40cb..f1ab5673b1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -15,7 +15,9 @@ use Utopia\Database\Document; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\Text; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; +use Utopia\Validator\Nullable; class Create extends Action { @@ -61,9 +63,9 @@ class Create extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new \Utopia\Validator\Boolean(), 'Is attribute an array?', true) + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -73,12 +75,14 @@ class Create extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { + $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_LINESTRING, 'size' => 0, 'required' => $required, - 'default' => $default, + 'default' => $decodedDefault, 'array' => $array, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php index 90609977c0..2ffc6f7d3f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -14,8 +14,9 @@ use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; use Utopia\Validator\Nullable; -use Utopia\Validator\Text; class Update extends Action { @@ -62,8 +63,8 @@ class Update extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') @@ -73,6 +74,8 @@ class Update extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void { + $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $attribute = $this->updateAttribute( databaseId: $databaseId, collectionId: $collectionId, @@ -80,7 +83,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, type: Database::VAR_LINESTRING, - default: $default, + default: $decodedDefault, required: $required, newKey: $newKey ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php index 3807bdc174..0a6e486f88 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -15,7 +15,9 @@ use Utopia\Database\Document; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\Text; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; +use Utopia\Validator\Nullable; class Create extends Action { @@ -61,9 +63,9 @@ class Create extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new \Utopia\Validator\Boolean(), 'Is attribute an array?', true) + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -73,12 +75,14 @@ class Create extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { + $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POINT, 'size' => 0, 'required' => $required, - 'default' => $default, + 'default' => $decodedDefault, 'array' => $array, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php index f276256cf4..3113ff7014 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -14,6 +14,8 @@ use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends Action @@ -61,8 +63,8 @@ class Update extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new \Utopia\Validator\Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') @@ -72,6 +74,8 @@ class Update extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void { + $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $attribute = $this->updateAttribute( databaseId: $databaseId, collectionId: $collectionId, @@ -79,7 +83,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, type: Database::VAR_POINT, - default: $default, + default: $decodedDefault, required: $required, newKey: $newKey ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index 56c4b4af2e..9a4d534c17 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -15,7 +15,9 @@ use Utopia\Database\Document; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\Text; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; +use Utopia\Validator\Nullable; class Create extends Action { @@ -61,9 +63,9 @@ class Create extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Text(0, 0), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) - ->param('array', false, new \Utopia\Validator\Boolean(), 'Is attribute an array?', true) + ->param('required', null, new Boolean(), 'Is attribute required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) + ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -73,12 +75,14 @@ class Create extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { + $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POLYGON, 'size' => 0, 'required' => $required, - 'default' => $default, + 'default' => $decodedDefault, 'array' => $array, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php index 90d0960f41..8f41630ba4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -14,8 +14,8 @@ use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\JSON; use Utopia\Validator\Nullable; -use Utopia\Validator\Text; class Update extends Action { @@ -63,7 +63,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') @@ -73,6 +73,8 @@ class Update extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void { + $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $attribute = $this->updateAttribute( databaseId: $databaseId, collectionId: $collectionId, @@ -80,7 +82,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, type: Database::VAR_POLYGON, - default: $default, + default: $decodedDefault, required: $required, newKey: $newKey ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php index d8d1fefc11..6df33e8f96 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -10,7 +10,9 @@ use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\Text; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; +use Utopia\Validator\Nullable; class Create extends LineCreate { @@ -52,9 +54,9 @@ class Create extends LineCreate ->param('databaseId', '', new UID(), 'Database ID.') ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is column required?') - ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) - ->param('array', false, new \Utopia\Validator\Boolean(), 'Is column an array?', true) + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php new file mode 100644 index 0000000000..4360d85bfe --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php @@ -0,0 +1,67 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/line/:key') + ->desc('Update line column') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'tables.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-line-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php index c269af6a68..d763ec681f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -10,7 +10,9 @@ use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\Text; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; +use Utopia\Validator\Nullable; class Create extends PointCreate { @@ -52,9 +54,9 @@ class Create extends PointCreate ->param('databaseId', '', new UID(), 'Database ID.') ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is column required?') - ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) - ->param('array', false, new \Utopia\Validator\Boolean(), 'Is column an array?', true) + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php new file mode 100644 index 0000000000..8cf89eb0ef --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -0,0 +1,67 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/point/:key') + ->desc('Update point column') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'tables.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-point-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php index 302a5b21df..f764fcaee4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -10,7 +10,9 @@ use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\Text; +use Utopia\Validator\Boolean; +use Utopia\Validator\JSON; +use Utopia\Validator\Nullable; class Create extends PolygonCreate { @@ -52,9 +54,9 @@ class Create extends PolygonCreate ->param('databaseId', '', new UID(), 'Database ID.') ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is column required?') - ->param('default', null, new Text(0, 0), 'Default value for column when not provided. Cannot be set when column is required.', true) - ->param('array', false, new \Utopia\Validator\Boolean(), 'Is column an array?', true) + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) + ->param('array', false, new Boolean(), 'Is column an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php new file mode 100644 index 0000000000..0b731362d2 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php @@ -0,0 +1,67 @@ +setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/polygon/:key') + ->desc('Update polygon column') + ->groups(['api', 'database', 'schema']) + ->label('scope', 'tables.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') + ->label('audits.event', 'column.update') + ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') + ->label('sdk', new Method( + namespace: $this->getSdkNamespace(), + group: $this->getSdkGroup(), + name: self::getName(), + description: '/docs/references/tablesdb/update-polygon-column.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: SwooleResponse::STATUS_CODE_OK, + model: $this->getResponseModel(), + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('key', '', new Key(), 'Column Key.') + ->param('required', null, new Boolean(), 'Is column required?') + ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.') + ->param('newKey', null, new Key(), 'New Column Key.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback($this->action(...)); + } +} diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php index 0162da1527..d570745148 100644 --- a/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/Tables.php @@ -22,8 +22,11 @@ use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Integer\Upd use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP\Create as CreateIP; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\IP\Update as UpdateIP; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line\Create as CreateLine; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Line\Update as UpdateLine; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point\Create as CreatePoint; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Point\Update as UpdatePoint; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon\Create as CreatePolygon; +use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Polygon\Update as UpdatePolygon; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship\Create as CreateRelationship; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\Relationship\Update as UpdateRelationship; use Appwrite\Platform\Modules\Databases\Http\TablesDB\Tables\Columns\String\Create as CreateString; @@ -139,12 +142,15 @@ class Tables extends Base // Column: Line $service->addAction(CreateLine::getName(), new CreateLine()); + $service->addAction(UpdateLine::getName(), new UpdateLine()); // Column: Point $service->addAction(CreatePoint::getName(), new CreatePoint()); + $service->addAction(UpdatePoint::getName(), new UpdatePoint()); // Column: Polygon $service->addAction(CreatePolygon::getName(), new CreatePolygon()); + $service->addAction(UpdatePolygon::getName(), new UpdatePolygon()); // Column: Relationship $service->addAction(CreateRelationship::getName(), new CreateRelationship()); diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index def54c4b9d..c740ebb194 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6359,6 +6359,165 @@ trait DatabasesBase ])); } + public function testUpdateSpatialAttributes(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Update Spatial Attributes Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial attributes + $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' => 'Update Spatial Attributes Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create string attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + // Create line attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + ]); + + // Create polygon attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Update point attribute - change required status + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + + // Test 2: Update line attribute - change required status and add default value + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/line/route', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => json_encode([[0, 0], [1, 1]]), + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(true, $response['body']['required']); + $this->assertEquals('[[0, 0], [1, 1]]', $response['body']['default']); + + // Test 3: Update polygon attribute - change key name + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon/area', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'coverage', + 'default' => null, + 'required' => false + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('coverage', $response['body']['key']); + + // Test 4: Update point attribute - add default value + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => json_encode([0, 0]), + 'required' => true + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('[0, 0]', $response['body']['default']); + + // Test 5: Verify attribute updates by creating a document + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'coverage' => [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['location']); // Should use default value + $this->assertEquals([[0, 0], [1, 1]], $response['body']['route']); // Should use default value + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } + public function testSpatialQuery(): void { $database = $this->client->call(Client::METHOD_POST, '/databases', [ diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index 3e7eba94bd..f1f2e13579 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -8131,4 +8131,163 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + public function testUpdateSpatialColumns(): void + { + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Update Spatial Columns Test Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create table with spatial columns + $table = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'tableId' => ID::unique(), + 'name' => 'Update Spatial Columns Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + ]); + + $tableId = $table['body']['$id']; + + // Create string column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + // Create point column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'location', + 'required' => true, + ]); + + // Create line column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'route', + 'required' => false, + ]); + + // Create polygon column + $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'area', + 'required' => true, + ]); + + sleep(2); + + // Test 1: Update point column - change required status + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => null, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + + // Test 2: Update line column - change required status and add default value + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/line/route', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => false, + 'default' => json_encode([[0, 0], [1, 1]]), + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(false, $response['body']['required']); + $this->assertEquals([[0, 0], [1, 1]], $response['body']['default']); + + // Test 3: Update polygon column - change key name + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/polygon/area', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'newKey' => 'coverage', + 'default' => null, + 'required' => false + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('coverage', $response['body']['key']); + + // Test 4: Update point column - add default value + $response = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point/location', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'default' => json_encode([0, 0]), + 'required' => false + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['default']); + + // Test 5: Verify column updates by creating a row + $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'rowId' => ID::unique(), + 'data' => [ + 'name' => 'Test Location', + 'coverage' => [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]] + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals([0, 0], $response['body']['location']); // Should use default value + $this->assertEquals([[0, 0], [1, 1]], $response['body']['route']); // Should use default value + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } From 0e343125b75065fcd623f1d9a60bfce125e09740 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 27 Aug 2025 16:35:55 +0530 Subject: [PATCH 17/75] updated graphql queries --- tests/e2e/Services/GraphQL/Base.php | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index 28e632f001..9f5a93dd00 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -942,6 +942,35 @@ trait Base array } }'; + case self::CREATE_POINT_COLUMN: + return 'mutation createPointColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $array: Boolean){ + tablesDBCreatePointColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, array: $array) { + key + required + array + status + } + }'; + + case self::CREATE_LINE_COLUMN: + return 'mutation createLineColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $array: Boolean){ + tablesDBCreateLineColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, array: $array) { + key + required + array + status + } + }'; + + case self::CREATE_POLYGON_COLUMN: + return 'mutation createPolygonColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!, $array: Boolean){ + tablesDBCreatePolygonColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required, array: $array) { + key + required + array + status + } + }'; case self::CREATE_RELATIONSHIP_COLUMN: return 'mutation createRelationshipColumn($databaseId: String!, $tableId: String!, $relatedTableId: String!, $type: String!, $twoWay: Boolean, $key: String, $twoWayKey: String, $onDelete: String){ tablesDBCreateRelationshipColumn(databaseId: $databaseId, tableId: $tableId, relatedTableId: $relatedTableId, type: $type, twoWay: $twoWay, key: $key, twoWayKey: $twoWayKey, onDelete: $onDelete) { @@ -1021,6 +1050,27 @@ trait Base default } }'; + case self::UPDATE_POINT_COLUMN: + return 'mutation updatePointColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!){ + tablesDBUpdatePointColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required) { + required + } + }'; + + case self::UPDATE_LINE_COLUMN: + return 'mutation updateLineColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!){ + tablesDBUpdateLineColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required) { + required + } + }'; + + case self::UPDATE_POLYGON_COLUMN: + return 'mutation updatePolygonColumn($databaseId: String!, $tableId: String!, $key: String!, $required: Boolean!){ + tablesDBUpdatePolygonColumn(databaseId: $databaseId, tableId: $tableId, key: $key, required: $required) { + required + } + }'; + case self::UPDATE_RELATIONSHIP_COLUMN: return 'mutation updateRelationshipColumn($databaseId: String!, $tableId: String!, $key: String!, $onDelete: String){ tablesDBUpdateRelationshipColumn(databaseId: $databaseId, tableId: $tableId, key: $key, onDelete: $onDelete) { From 2ec0da3c22f0e851e33a3cc69db1dc7c3dca9a6c Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 27 Aug 2025 16:58:24 +0530 Subject: [PATCH 18/75] updated composer lock --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index 79dfc9372a..5ddac255ac 100644 --- a/composer.lock +++ b/composer.lock @@ -3557,16 +3557,16 @@ }, { "name": "utopia-php/database", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "99beaf1dd6dc3561c8332f9893325777553644a4" + "reference": "d59a207c079cc9e821ee4cab045a411bdad79e8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/99beaf1dd6dc3561c8332f9893325777553644a4", - "reference": "99beaf1dd6dc3561c8332f9893325777553644a4", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d59a207c079cc9e821ee4cab045a411bdad79e8c", + "reference": "d59a207c079cc9e821ee4cab045a411bdad79e8c", "shasum": "" }, "require": { @@ -3607,9 +3607,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.2.1" + "source": "https://github.com/utopia-php/database/tree/1.2.2" }, - "time": "2025-08-26T16:05:26+00:00" + "time": "2025-08-27T11:27:06+00:00" }, { "name": "utopia-php/detector", @@ -4926,16 +4926,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "1.1.14", + "version": "1.1.15", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "662c7a53e683ed941c7d1374cfd32533bf54fbca" + "reference": "8e8e39634ba7558704522959d88f3542563a5444" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/662c7a53e683ed941c7d1374cfd32533bf54fbca", - "reference": "662c7a53e683ed941c7d1374cfd32533bf54fbca", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8e8e39634ba7558704522959d88f3542563a5444", + "reference": "8e8e39634ba7558704522959d88f3542563a5444", "shasum": "" }, "require": { @@ -4971,9 +4971,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/1.1.14" + "source": "https://github.com/appwrite/sdk-generator/tree/1.1.15" }, - "time": "2025-08-26T13:17:07+00:00" + "time": "2025-08-27T04:59:35+00:00" }, { "name": "doctrine/annotations", From 8338a7318fbe2bb1c9dcbe979606183526000cae Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 27 Aug 2025 17:02:52 +0530 Subject: [PATCH 19/75] updated composer and merge conflicts --- composer.lock | 6 ------ 1 file changed, 6 deletions(-) diff --git a/composer.lock b/composer.lock index 74b43a29ae..5ddac255ac 100644 --- a/composer.lock +++ b/composer.lock @@ -4927,19 +4927,15 @@ { "name": "appwrite/sdk-generator", "version": "1.1.15", - "version": "1.1.15", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", "reference": "8e8e39634ba7558704522959d88f3542563a5444" - "reference": "8e8e39634ba7558704522959d88f3542563a5444" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8e8e39634ba7558704522959d88f3542563a5444", "reference": "8e8e39634ba7558704522959d88f3542563a5444", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/8e8e39634ba7558704522959d88f3542563a5444", - "reference": "8e8e39634ba7558704522959d88f3542563a5444", "shasum": "" }, "require": { @@ -4976,10 +4972,8 @@ "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", "source": "https://github.com/appwrite/sdk-generator/tree/1.1.15" - "source": "https://github.com/appwrite/sdk-generator/tree/1.1.15" }, "time": "2025-08-27T04:59:35+00:00" - "time": "2025-08-27T04:59:35+00:00" }, { "name": "doctrine/annotations", From 30ca2fb2514496b37e9e0000dd2f3ed23c216f25 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Wed, 27 Aug 2025 17:13:10 +0530 Subject: [PATCH 20/75] Replace %s with mustache placeholder --- app/config/locale/translations/af.json | 4 ++-- app/config/locale/translations/ar-ma.json | 6 +++--- app/config/locale/translations/ar.json | 4 ++-- app/config/locale/translations/as.json | 6 +++--- app/config/locale/translations/az.json | 4 ++-- app/config/locale/translations/be.json | 6 +++--- app/config/locale/translations/bg.json | 2 +- app/config/locale/translations/bh.json | 6 +++--- app/config/locale/translations/bn.json | 4 ++-- app/config/locale/translations/bs.json | 2 +- app/config/locale/translations/ca.json | 4 ++-- app/config/locale/translations/cs.json | 2 +- app/config/locale/translations/da.json | 4 ++-- app/config/locale/translations/de.json | 4 ++-- app/config/locale/translations/el.json | 4 ++-- app/config/locale/translations/en.json | 8 ++++---- app/config/locale/translations/eo.json | 4 ++-- app/config/locale/translations/es.json | 4 ++-- app/config/locale/translations/fa.json | 4 ++-- app/config/locale/translations/fi.json | 2 +- app/config/locale/translations/fo.json | 2 +- app/config/locale/translations/fr.json | 4 ++-- app/config/locale/translations/ga.json | 4 ++-- app/config/locale/translations/gu.json | 4 ++-- app/config/locale/translations/he.json | 4 ++-- app/config/locale/translations/hi.json | 4 ++-- app/config/locale/translations/hr.json | 4 ++-- app/config/locale/translations/hu.json | 4 ++-- app/config/locale/translations/hy.json | 2 +- app/config/locale/translations/id.json | 4 ++-- app/config/locale/translations/is.json | 2 +- app/config/locale/translations/it.json | 4 ++-- app/config/locale/translations/ja.json | 4 ++-- app/config/locale/translations/jv.json | 4 ++-- app/config/locale/translations/km.json | 2 +- app/config/locale/translations/kn.json | 4 ++-- app/config/locale/translations/ko.json | 4 ++-- app/config/locale/translations/la.json | 6 +++--- app/config/locale/translations/lb.json | 4 ++-- app/config/locale/translations/lt.json | 4 ++-- app/config/locale/translations/lv.json | 4 ++-- app/config/locale/translations/ml.json | 6 +++--- app/config/locale/translations/mr.json | 4 ++-- app/config/locale/translations/ms.json | 4 ++-- app/config/locale/translations/nb.json | 4 ++-- app/config/locale/translations/ne.json | 4 ++-- app/config/locale/translations/nl.json | 4 ++-- app/config/locale/translations/nn.json | 6 +++--- app/config/locale/translations/or.json | 4 ++-- app/config/locale/translations/pa.json | 2 +- app/config/locale/translations/pl.json | 4 ++-- app/config/locale/translations/pt-br.json | 4 ++-- app/config/locale/translations/pt-pt.json | 4 ++-- app/config/locale/translations/ro.json | 4 ++-- app/config/locale/translations/ru.json | 4 ++-- app/config/locale/translations/sa.json | 4 ++-- app/config/locale/translations/sd.json | 6 +++--- app/config/locale/translations/si.json | 4 ++-- app/config/locale/translations/sk.json | 4 ++-- app/config/locale/translations/sl.json | 2 +- app/config/locale/translations/sn.json | 4 ++-- app/config/locale/translations/sq.json | 2 +- app/config/locale/translations/sv.json | 4 ++-- app/config/locale/translations/ta.json | 4 ++-- app/config/locale/translations/te.json | 4 ++-- app/config/locale/translations/th.json | 4 ++-- app/config/locale/translations/tl.json | 4 ++-- app/config/locale/translations/tr.json | 4 ++-- app/config/locale/translations/uk.json | 4 ++-- app/config/locale/translations/ur.json | 4 ++-- app/config/locale/translations/vi.json | 4 ++-- app/config/locale/translations/zh-cn.json | 4 ++-- app/config/locale/translations/zh-tw.json | 4 ++-- app/controllers/api/teams.php | 2 +- src/Appwrite/Platform/Workers/Certificates.php | 5 +++-- 75 files changed, 149 insertions(+), 148 deletions(-) diff --git a/app/config/locale/translations/af.json b/app/config/locale/translations/af.json index 86da260a90..db2a234d5e 100644 --- a/app/config/locale/translations/af.json +++ b/app/config/locale/translations/af.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Wie nie waag nie, sal nie wen nie.\"", "settings.locale": "af", "settings.direction": "ltr", - "emails.sender": "%s span", + "emails.sender": "{{project}} span", "emails.verification.subject": "Rekening Bevestiging", "emails.verification.hello": "Goeie dag {{user}},", "emails.verification.body": "Volg hierdie skakel om u e-pos adres te bevestig.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Baie dankie,", "emails.recovery.buttonText": "Stel wagwoord terug", "emails.recovery.signature": "Die {{project}} span", - "emails.invitation.subject": "Uitnodiging om by die %s span aan te sluit by %s", + "emails.invitation.subject": "Uitnodiging om by die {{team}} span aan te sluit by {{project}}", "emails.invitation.hello": "Goeie dag,", "emails.invitation.body": "Hierdie boodskap is aan u gestuur omdat {{owner}} u uitnooi om 'n lid van die {{team}} groep by die {{project}} projek te wees.", "emails.invitation.footer": "As u nie belang stel nie, kan u gerus hierdie boodskap ignoreer.", diff --git a/app/config/locale/translations/ar-ma.json b/app/config/locale/translations/ar-ma.json index 31b656da60..f0a7132aed 100644 --- a/app/config/locale/translations/ar-ma.json +++ b/app/config/locale/translations/ar-ma.json @@ -2,7 +2,7 @@ "settings.inspire": "\"الفن ديال الحكمة هو الفن ديال أنك تعرف أش تنخّل.\"", "settings.locale": "ar-ma", "settings.direction": "rtl", - "emails.sender": "فرقة %s", + "emails.sender": "فرقة {{project}}", "emails.verification.subject": "التيْقان ديال الحساب", "emails.verification.hello": "السلام {{user}}،", "emails.verification.body": "تبّع هاد الوصلة باش تيقّن لادريسة تاع ليميل ديالك.", @@ -21,14 +21,14 @@ "emails.recovery.thanks": "شكرا،", "emails.recovery.buttonText": "إعادة تعيين كلمة السر", "emails.recovery.signature": "فرقة {{project}}", - "emails.invitation.subject": "عراضة ل فرقة %s ف %s", + "emails.invitation.subject": "عراضة ل فرقة {{team}} ف {{project}}", "emails.invitation.hello": "السلام،", "emails.invitation.body": "هاد البرية تصيفطات ليك حيت {{owner}} بغى يعرض عليك تولّي عضو ف فرقة {{team}} عند {{project}}.", "emails.invitation.footer": "إلا كنتي ما مسوّقش, ممكن تنخّل هاد البرية.", "emails.invitation.thanks": "شكرا،", "emails.invitation.buttonText": "اقبل الدعوة إلى {{team}}", "emails.invitation.signature": "فرقة {{project}}", - "emails.certificate.subject": "السرتافيكة فشلات ل %s", + "emails.certificate.subject": "السرتافيكة فشلات ل {{domain}}", "emails.certificate.hello": "السلام،", "emails.certificate.body": "السرتافيكة ديال الضومين ديالك '{{domain}}' ما قدّاتش تجينيرا. هادي هي المحاولة نمرة {{attempt}}, السبب ديال هاد الفشل هو: {{error}}", "emails.certificate.footer": "السرتافيكة الفايتة ديالك غاتبقى مزيانة لمدة 30 يوم من عند أول فشل. كانشجعوك بزاف أنك تبقشش فهاد الموضوع, وا إلّا الضومين ديالك ما غايبقاش خدّام فيه الـ SSL.", diff --git a/app/config/locale/translations/ar.json b/app/config/locale/translations/ar.json index d005009275..df077c8685 100644 --- a/app/config/locale/translations/ar.json +++ b/app/config/locale/translations/ar.json @@ -2,7 +2,7 @@ "settings.inspire": "\"فن الحكمة هو فن معرفة ما يجب التغاضي عنه.\"", "settings.locale": "ar", "settings.direction": "rtl", - "emails.sender": "فريق %s", + "emails.sender": "فريق {{project}}", "emails.verification.subject": "تأكيد الحساب", "emails.verification.hello": "مرحبا {{user}}،", "emails.verification.body": "برجاء اتباع الرابط التالي لتأكيد بريدك الإلكتروني", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "شكرا،", "emails.recovery.buttonText": "إعادة تعيين كلمة المرور", "emails.recovery.signature": "فريق {{project}}", - "emails.invitation.subject": "دعوة لفريق %s في %s", + "emails.invitation.subject": "دعوة لفريق {{team}} في {{project}}", "emails.invitation.hello": "أهلا،", "emails.invitation.body": "هذة الرسالة تم ارسالها لك لأن {{owner}} ارسل لك دعوة لتكون عضوا بفريق {{team}} في {{project}}", "emails.invitation.footer": "اذا كنت غير مهتم، يمكنك تجاهل هذه الرسالة", diff --git a/app/config/locale/translations/as.json b/app/config/locale/translations/as.json index 0cad3e1000..f750c6f3e4 100644 --- a/app/config/locale/translations/as.json +++ b/app/config/locale/translations/as.json @@ -2,7 +2,7 @@ "settings.inspire": "\"জ্ঞানী হোৱাৰ কলা হৈছে কি উপেক্ষা কৰিব লাগে জনাৰ কলা।\"", "settings.locale": "as", "settings.direction": "ltr", - "emails.sender": "%s দল", + "emails.sender": "{{project}} দল", "emails.verification.subject": "একাউণ্ট প্ৰমাণীকৰণ", "emails.verification.hello": "নমস্কাৰ {{user}},", "emails.verification.body": "আপোনাৰ ইমেইল ঠিকনা প্ৰমাণিত কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ধন্যবাদ,", "emails.recovery.buttonText": "পাছৱৰ্ড ৰিছেট কৰক", "emails.recovery.signature": "{{project}} দল", - "emails.invitation.subject": "%s বছৰত %s দললৈ নিমন্ত্ৰণ", + "emails.invitation.subject": "{{team}} বছৰত {{project}} দললৈ নিমন্ত্ৰণ", "emails.invitation.hello": "নমস্কাৰ,", "emails.invitation.body": "এই মেইলটো আপোনালৈ প্ৰেৰণ কৰা হৈছিল কাৰণ {{owner}} জনে আপোনাক {{project}} বছৰবয়সত {{team}} দলৰ সদস্য হ'বলৈ আমন্ত্ৰণ জনাব বিচাৰিছিল।", "emails.invitation.footer": "যদি আপুনি আগ্ৰহী নহয়, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "এই ইমেইলৰ সুৰক্ষা বাক্যটো হৈছে {{phrase}}। আপুনি এই ইমেইলটোত আস্থা ৰাখিব পাৰে যদি প্ৰবেশৰ সময়ত দেখুৱাই থকা বাক্যটোৰ লগত এই বাক্যটো মেলে।", "emails.otpSession.thanks": "ধন্যবাদ,", "emails.otpSession.signature": "{{project}} দল", - "emails.certificate.subject": "%sৰ বাবে প্ৰমাণপত্ৰ ব্যৰ্থতা", + "emails.certificate.subject": "{{domain}}ৰ বাবে প্ৰমাণপত্ৰ ব্যৰ্থতা", "emails.certificate.hello": "নমস্কাৰ,", "emails.certificate.body": "আপোনাৰ ডোমেইন '{{domain}}' ৰ বাবে প্ৰমাণপত্ৰটো উত্‌পন্ন কৰিব পৰা নগ'ল। এয়া প্ৰচেষ্টা নম্বৰ {{attempt}}, আৰু বিফলতাৰ কাৰণ হ'ল: {{error}}", "emails.certificate.footer": "আপোনাৰ পূৰ্বৰ প্ৰমাণপত্ৰটো প্ৰথম ব্ৰিফল হোৱাৰ দিনৰ পৰা ৩০ দিনলৈ বৈধ থাকিব। আমি এই ঘটনাটোৰ তদন্ত কৰিবলৈ উচ্চ পৰামৰ্শ দিয়ে, অন্যথা আপোনাৰ ডোমেইনটো অবৈধ SSL যোগাযোগ অবিহনে থাকিব।", diff --git a/app/config/locale/translations/az.json b/app/config/locale/translations/az.json index 7e0d206ff1..7b94b4424e 100644 --- a/app/config/locale/translations/az.json +++ b/app/config/locale/translations/az.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Ağıllı olmaq sənəti, nəyi gözdən qaçıracağını bilmək sənətidir.\"", "settings.locale": "az", "settings.direction": "ltr", - "emails.sender": "%s Komandası", + "emails.sender": "{{project}} Komandası", "emails.verification.subject": "Hesab Doğrulama", "emails.verification.hello": "Salam {{user}},", "emails.verification.body": "E-poçt ünvanınızı təsdiq etmək üçün bu linki izləyin.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Təşəkkürlər,", "emails.recovery.buttonText": "Şifrəni sıfırla", "emails.recovery.signature": "{{project}} komandası", - "emails.invitation.subject": "%s Komandasına Dəvət %sdə", + "emails.invitation.subject": "{{team}} Komandasına Dəvət {{project}}də", "emails.invitation.hello": "Salam,", "emails.invitation.body": "{{owner}}, {{project}}də {{team}} komandasına üzv olmağa dəvət etmək istədiyi üçün bu məktub sizə göndərildi.", "emails.invitation.footer": "Əgər maraqlanmırsınızsa, bu mesajı gözardı edə bilərsiniz.", diff --git a/app/config/locale/translations/be.json b/app/config/locale/translations/be.json index b64ed20bc6..2c6d14d79e 100644 --- a/app/config/locale/translations/be.json +++ b/app/config/locale/translations/be.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Мастацтва быць мудрым - гэта мастацтва ведаць, на што нельга звярнуць увагу.\"", "settings.locale": "be", "settings.direction": "ltr", - "emails.sender": "Каманда %s", + "emails.sender": "Каманда {{project}}", "emails.verification.subject": "Верыфікацыя акаўнта", "emails.verification.hello": "Прывітанне {{user}},", "emails.verification.body": "Перайдзіце па гэтай спасылцы, каб пацвердзіць свой адрас электроннай пошты", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Дзякуем,", "emails.recovery.buttonText": "Аднавіць пароль", "emails.recovery.signature": "каманда {{project}}", - "emails.invitation.subject": "Запрошення до Команди %s у %s", + "emails.invitation.subject": "Запрошення до Команди {{team}} у {{project}}", "emails.invitation.hello": "Прывітанне,", "emails.invitation.body": "Гэта паведамленне было адпраўлена вам, таму што {{owner}} хацеў запрасіць вас стаць членам каманды {{team}} у {{project}}.", "emails.invitation.footer": "Калі вам гэта не цікава, вы можаце праігнараваць гэтае паведамленне.", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "Фраза бяспекі для гэтага ліста - {{phrase}}. Вы можаце давяраць гэтаму лісту, калі гэтая фраза супадае з фразай, паказанай пры ўваходзе.", "emails.otpSession.thanks": "Дзякуй,", "emails.otpSession.signature": "каманда {{project}}", - "emails.certificate.subject": "Сведчанне няўдалае для %s", + "emails.certificate.subject": "Сведчанне няўдалае для {{domain}}", "emails.certificate.hello": "Прывітанне,", "emails.certificate.body": "Сертыфікат для вашага дамена '{{domain}}' не можа быць створаны. Гэта спроба нумар {{attempt}}, і прычынай няўдачы з'яўляецца: {{error}}", "emails.certificate.footer": "Ваш папярэдні сертыфікат будзе дзейнічаць 30 дзён з моманту першай няўдачы. Мы высока рэкамендуем расследаваць гэтую сітуацыю, інакш ваш дамен апынецца без дзейнага сертыфіката SSL-злучэння.", diff --git a/app/config/locale/translations/bg.json b/app/config/locale/translations/bg.json index f3ed2e7642..4fd1e6fdbf 100644 --- a/app/config/locale/translations/bg.json +++ b/app/config/locale/translations/bg.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Изкуството да бъдеш мъдър е изкуството да знаеш какво да пренебрегнеш.\"", "settings.locale": "bg", "settings.direction": "ltr", - "emails.sender": "%s Екип", + "emails.sender": "{{project}} Екип", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/bh.json b/app/config/locale/translations/bh.json index 04ef824f2b..7067795661 100644 --- a/app/config/locale/translations/bh.json +++ b/app/config/locale/translations/bh.json @@ -2,7 +2,7 @@ "settings.inspire": "\"बुद्धिमान होइत क कला ई जाने क कला अछि जे की अनदेखा कर्मा चाहि| \"", "settings.locale": "bh", "settings.direction": "ltr", - "emails.sender": "%s टीम", + "emails.sender": "{{project}} टीम", "emails.verification.subject": "खाता प्रमाणिकरण", "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "ईमेल प्रमाणिकरण करे क लेल दिहल गइल लिंक फॉलो करें|", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.buttonText": "पासवर्ड रीसेट करीं", "emails.recovery.signature": "{{project}} टीम", - "emails.invitation.subject": "%s टीम क %s पे न्योता देवे क लेल|", + "emails.invitation.subject": "{{team}} टीम क {{project}} पे न्योता देवे क लेल|", "emails.invitation.hello": "प्रणाम,", "emails.invitation.body": "ई मेल आपके एही लेल भेजल गईल रहल काहे क {{owner}} आपके {{project}} क {{team}} टीम का सदस्य बनावे चाहित रहे|", "emails.invitation.footer": "अगर आवे क इच्छा ना होवत, तो आप ई संदेश क अनदेखा कर सकत अछि।", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "एही ईमेल खातिर सुरक्षा वाक्य {{phrase}} हऽ। अगर ई वाक्य साइन इन कइला के समय देखावल गेल वाक्य से मेल खाता, त एह ईमेल पर भरोसा कर सकैत छी।", "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} टीम", - "emails.certificate.subject": "%s लेल प्रमाणपत्र असफलта", + "emails.certificate.subject": "{{domain}} लेल प्रमाणपत्र असफलта", "emails.certificate.hello": "नमस्ते,", "emails.certificate.body": "आपके डोमेन '{{domain}}' के लिए प्रमाणपत्र नहीं बनाया जा सका। ई प्रयास संख्या {{attempt}} है, और ई असफलता के कारण रहे: {{error}}", "emails.certificate.footer": "तोहार पिछलका प्रमाणपत्र पहिल असफलता से 30 दिन धरी मान्य होईत। हम बहुत जोर देके सलाह देतानी कि एह मामला के जांच करीं, नहीं त तोहार डोमेन बिना कोनो मान्य SSL संवाद के रहि जाईत।", diff --git a/app/config/locale/translations/bn.json b/app/config/locale/translations/bn.json index 617d5815a0..a1be879e0c 100644 --- a/app/config/locale/translations/bn.json +++ b/app/config/locale/translations/bn.json @@ -2,7 +2,7 @@ "settings.inspire": "\"জ্ঞানী হওয়ার শিল্প হলো কোন বিষয়টিকে উপেক্ষা করা উচিত তা জানার শিল্প\"", "settings.locale": "bn", "settings.direction": "ltr", - "emails.sender": "%s টীম", + "emails.sender": "{{project}} টীম", "emails.verification.subject": "বিষয়", "emails.verification.hello": "নমস্কার {{user}},", "emails.verification.body": "এই লিঙ্কের মাধ্যমে ইমেইল যাচাই করুন।", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ধন্যবাদ,", "emails.recovery.buttonText": "পাসওয়ার্ড রিসেট করুন", "emails.recovery.signature": "{{project}} টীম", - "emails.invitation.subject": "%s টিমকে %s তে আমন্ত্রণ জানান", + "emails.invitation.subject": "{{team}} টিমকে {{project}} তে আমন্ত্রণ জানান", "emails.invitation.hello": "নমস্কার,", "emails.invitation.body": "এই মেইলটি আপনাকে পাঠানো হয়েছে কারণ {{owner}} আপনাকে {{project}} এর সাথে যুক্ত {{team}} টিমের সদস্য হওয়ার জন্য আমন্ত্রণ জানাতে চেয়েছিলেন।", "emails.invitation.footer": "যদি এটি আপনার জন্য প্রয়োজনীয় না হয়, আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", diff --git a/app/config/locale/translations/bs.json b/app/config/locale/translations/bs.json index 29c081c069..22a54383a9 100644 --- a/app/config/locale/translations/bs.json +++ b/app/config/locale/translations/bs.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Umjetnost mudrosti je umjetnost znanja o tome šta zanemariti.\"", "settings.locale": "bs", "settings.direction": "ltr", - "emails.sender": "%s Tim", + "emails.sender": "{{project}} Tim", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/ca.json b/app/config/locale/translations/ca.json index 38519f10c9..7f4be27f1c 100644 --- a/app/config/locale/translations/ca.json +++ b/app/config/locale/translations/ca.json @@ -2,7 +2,7 @@ "settings.inspire": "\"L'art de ser savi és l'art de saber què passar per alt\"", "settings.locale": "ca", "settings.direction": "ltr", - "emails.sender": "%s Equip", + "emails.sender": "{{project}} Equip", "emails.verification.subject": "Verificació del compte", "emails.verification.hello": "Hola {{user}},", "emails.verification.body": "Accedeix a aquest enllaç per tal de verificar la teva adreça electrònica.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Gràcies,", "emails.recovery.buttonText": "Restableix la contrasenya", "emails.recovery.signature": "Equip {{project}}", - "emails.invitation.subject": "Invitació a l'equip %s a s%", + "emails.invitation.subject": "Invitació a l'equip {{team}} a {{project}}", "emails.invitation.hello": "Hola,", "emails.invitation.body": "Aquest correu se t'ha enviat perquè {{owner}} vol convidar-te a formar part de l'equip {{team}} al {{project}}.", "emails.invitation.footer": "Si no és del teu interès, pots ignorar aquest missatge.", diff --git a/app/config/locale/translations/cs.json b/app/config/locale/translations/cs.json index f043a6a5c7..609f064969 100644 --- a/app/config/locale/translations/cs.json +++ b/app/config/locale/translations/cs.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Umění moudrosti je umění vědět, co přehlédnout.\"", "settings.locale": "cs", "settings.direction": "ltr", - "emails.sender": "%s tým", + "emails.sender": "{{project}} tým", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/da.json b/app/config/locale/translations/da.json index 4b4af3446d..2b52bdb6a9 100644 --- a/app/config/locale/translations/da.json +++ b/app/config/locale/translations/da.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Kunsten at være klog er kunsten at vide, hvad man skal overse.\"", "settings.locale": "da", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Konto Verifikation", "emails.verification.hello": "Hej {{user}},", "emails.verification.body": "Følg dette link, for at verificere din email adresse.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Tak,", "emails.recovery.buttonText": "Nulstil adgangskode", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitation til %s Team på %s", + "emails.invitation.subject": "Invitation til {{team}} Team på {{project}}", "emails.invitation.hello": "Hej,", "emails.invitation.body": "Denne mail blev sendt til dig, fordi {{owner}} vil invitere dig til at blive medlem af {{team}} teamet på {{project}}.", "emails.invitation.footer": "Hvis du ikke er interesseret, ignorer venligst denne besked.", diff --git a/app/config/locale/translations/de.json b/app/config/locale/translations/de.json index 8f17faf136..0793753789 100644 --- a/app/config/locale/translations/de.json +++ b/app/config/locale/translations/de.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Die Kunst, weise zu sein, ist die Kunst, zu wissen, was zu übersehen ist.\"", "settings.locale": "de", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kontoverifizierung", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Folge diesem Link, um deine E-Mail-Adresse zu bestätigen.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Danke,", "emails.recovery.buttonText": "Passwort zurücksetzen", "emails.recovery.signature": "{{project}}-Team", - "emails.invitation.subject": "Einladung zum %s-Team auf %s", + "emails.invitation.subject": "Einladung zum {{team}}-Team auf {{project}}", "emails.invitation.hello": "Hello,", "emails.invitation.body": "Du erhälst diese E-Mail, weil {{owner}} dich in das Team {{team}} auf {{project}} eingeladen hat.", "emails.invitation.footer": "Wenn du nicht interessiert bist, kannst du diese Nachricht ignorieren.", diff --git a/app/config/locale/translations/el.json b/app/config/locale/translations/el.json index ec3b02c691..54b14c1846 100644 --- a/app/config/locale/translations/el.json +++ b/app/config/locale/translations/el.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Η τέχνη του να είσαι σοφός, είναι η τέχνη να ξέρεις τι πρέπει να παραβλέψεις.\"", "settings.locale": "gr", "settings.direction": "ltr", - "emails.sender": "Ομάδα %s", + "emails.sender": "Ομάδα {{project}}", "emails.verification.subject": "Επαλήθευση Λογαριασμού", "emails.verification.hello": "Γεια σου {{user}},", "emails.verification.body": "Ακολουθήστε αυτό το link για να επαληθεύσετε τη δ/νση του email σας", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Ευχαριστούμε,", "emails.recovery.buttonText": "Επαναφορά κωδικού πρόσβασης", "emails.recovery.signature": "Η ομάδα του {{project}}", - "emails.invitation.subject": "Πρόσκληση στην %s Ομάδα στον %s", + "emails.invitation.subject": "Πρόσκληση στην {{team}} Ομάδα στον {{project}}", "emails.invitation.hello": "Γεια σου,", "emails.invitation.body": "Αυτό το email στάλθηκε επειδή ο/η {{owner}} θέλει να σας προσκαλέσει να γίνετε μέλος της ομάδας {{team}} του {{project}}.", "emails.invitation.footer": "Εάν δεν ενδιαφέρεστε, μπορείτε να αγνοήσετε αυτό το μήνυμα.", diff --git a/app/config/locale/translations/en.json b/app/config/locale/translations/en.json index a3284440f4..e2ee20b2d7 100644 --- a/app/config/locale/translations/en.json +++ b/app/config/locale/translations/en.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "en", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Account Verification", "emails.verification.preview": "Verify your email to activate your {{project}} account.", "emails.verification.hello": "Hello {{user}},", @@ -54,7 +54,7 @@ "emails.recovery.thanks": "Thanks,", "emails.recovery.buttonText": "Reset password", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitation to %s Team at %s", + "emails.invitation.subject": "Invitation to {{team}} Team at {{project}}", "emails.invitation.preview": "{{owner}} invited you to join {{team}} at {{project}}", "emails.invitation.hello": "Hello {{user}},", "emails.invitation.body": "This mail was sent to you because {{b}}{{owner}}{{/b}} invited you to become a member of the {{b}}{{team}}{{/b}} team at {{b}}{{project}}{{/b}}.", @@ -62,8 +62,8 @@ "emails.invitation.thanks": "Thanks,", "emails.invitation.buttonText": "Accept invite to {{team}}", "emails.invitation.signature": "{{project}} team", - "emails.certificate.subject": "Certificate failure for %s", - "emails.certificate.preview": "Your domain %s certificate generation has failed.", + "emails.certificate.subject": "Certificate failure for {{domain}}", + "emails.certificate.preview": "Your domain {{domain}} certificate generation has failed.", "emails.certificate.hello": "Hello,", "emails.certificate.body": "Certificate for your domain '{{domain}}' could not be generated. This is attempt no. {{attempt}}, and the failure was caused by: {{error}}", "emails.certificate.footer": "Your previous certificate will be valid for 30 days since the first failure. We highly recommend investigating this case, otherwise your domain will end up without a valid SSL communication.", diff --git a/app/config/locale/translations/eo.json b/app/config/locale/translations/eo.json index 82d7eb53f0..8b5eb0fe90 100644 --- a/app/config/locale/translations/eo.json +++ b/app/config/locale/translations/eo.json @@ -1,7 +1,7 @@ { "settings.locale": "eo", "settings.direction": "ltr", - "emails.sender": "Teamo %s", + "emails.sender": "Teamo {{project}}", "emails.verification.subject": "Konta Konfirmo", "emails.verification.hello": "Saluton {{user}},", "emails.verification.body": "Alklaku ĉi tiun ligon por kontroli vian retpoŝtan adreson.", @@ -20,7 +20,7 @@ "emails.recovery.thanks": "Dankegon,", "emails.recovery.buttonText": "Pasvorton restarigi", "emails.recovery.signature": "Teamo {{project}}", - "emails.invitation.subject": "Invito al la Teamo %s em %s", + "emails.invitation.subject": "Invito al la Teamo {{team}} em {{project}}", "emails.invitation.hello": "Dankegon,", "emails.invitation.body": "Ĉi tiu retpoŝto estis sendita ĉar la {{owner}} volas inviti vin fariĝi membro de la Teamo {{team}} en {{project}}.", "emails.invitation.footer": "Se vi ne interesiĝas, vi povas ignori ĉi tiun mesaĝon.", diff --git a/app/config/locale/translations/es.json b/app/config/locale/translations/es.json index 27955eae30..21a406b418 100644 --- a/app/config/locale/translations/es.json +++ b/app/config/locale/translations/es.json @@ -2,7 +2,7 @@ "settings.inspire": "\"El arte de ser sabio es el arte de saber qué pasar por alto\"", "settings.locale": "es", "settings.direction": "ltr", - "emails.sender": "El equipo de %s", + "emails.sender": "El equipo de {{project}}", "emails.verification.subject": "Verificación de cuenta", "emails.verification.hello": "Hola, {{name}}.,", "emails.verification.body": "Haz clic en este enlace para verificar tu correo:", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Gracias.,", "emails.recovery.buttonText": "Restablecer contraseña", "emails.recovery.signature": "El equipo de {{project}}", - "emails.invitation.subject": "Invitación al equipo %s en %s", + "emails.invitation.subject": "Invitación al equipo {{team}} en {{project}}", "emails.invitation.hello": "Hola,", "emails.invitation.body": "Este correo ha sido enviado a petición de {{owner}} quién quiere invitarte a formar parte del equipo {{team}} en {{project}}.", "emails.invitation.footer": "Si no estás interesado, puedes ignorar este mensaje.", diff --git a/app/config/locale/translations/fa.json b/app/config/locale/translations/fa.json index f8420288df..84cd154f4e 100644 --- a/app/config/locale/translations/fa.json +++ b/app/config/locale/translations/fa.json @@ -2,7 +2,7 @@ "settings.inspire": "\"هنر خردمند بودن این است که بدانید چه چیزی را نادیده بگیرید.\"", "settings.locale": "fa", "settings.direction": "rtl", - "emails.sender": "تیم %s", + "emails.sender": "تیم {{project}}", "emails.verification.subject": "تأیید حساب", "emails.verification.hello": "سلام {{user}}،", "emails.verification.body": "برای تأیید ایمیل‌تان پیوند زیر را دنبال کنید.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "سپاس فراوان،", "emails.recovery.buttonText": "بازنشانی رمز عبور", "emails.recovery.signature": "تیم {{user}}", - "emails.invitation.subject": "دعوت به تیم %s در %s", + "emails.invitation.subject": "دعوت به تیم {{team}} در {{project}}", "emails.invitation.hello": "سلام،", "emails.invitation.body": "این ایمیل برای شما فرستاده شده‌است زیرا {{owner}} می‌خواهد شما را به تیم {{team}} در پروژه‌ی {{project}} بیفزاید.", "emails.invitation.footer": "اگر علاقه ندارید، می‌توانید این پیام را نادیده بگیرید.", diff --git a/app/config/locale/translations/fi.json b/app/config/locale/translations/fi.json index da4599bb58..2a5ff54078 100644 --- a/app/config/locale/translations/fi.json +++ b/app/config/locale/translations/fi.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "fi", "settings.direction": "ltr", - "emails.sender": "%s Tiimi", + "emails.sender": "{{project}} Tiimi", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/fo.json b/app/config/locale/translations/fo.json index cfe63322b4..e301d158fa 100644 --- a/app/config/locale/translations/fo.json +++ b/app/config/locale/translations/fo.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Kunstin om at vera vís er at vita hvat man skal misrøkja.\"", "settings.locale": "fo", "settings.direction": "ltr", - "emails.sender": "%s Lið", + "emails.sender": "{{project}} Lið", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/fr.json b/app/config/locale/translations/fr.json index 7f3fca739d..95abe15787 100644 --- a/app/config/locale/translations/fr.json +++ b/app/config/locale/translations/fr.json @@ -2,7 +2,7 @@ "settings.inspire": "\"L'art d'être sage est l'art de savoir quoi négliger.\"", "settings.locale": "fr", "settings.direction": "ltr", - "emails.sender": "Équipe %s", + "emails.sender": "Équipe {{project}}", "emails.verification.subject": "Vérification du compte", "emails.verification.hello": "Bonjour {{user}},", "emails.verification.body": "Suivez ce lien pour vérifier votre adresse e-mail.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Merci,", "emails.recovery.buttonText": "Réinitialisation du mot de passe", "emails.recovery.signature": "L'équipe {{project}}", - "emails.invitation.subject": "Invitation à l'équipe %s de %s", + "emails.invitation.subject": "Invitation à l'équipe {{team}} de {{project}}", "emails.invitation.hello": "Bonjour,", "emails.invitation.body": "Cet e-mail vous a été envoyé parce que {{owner}} souhaite vous inviter à devenir membre de l'équipe {{team}} pour {{project}}.", "emails.invitation.footer": "Si vous n'êtes pas intéressé, vous pouvez ignorer ce message.", diff --git a/app/config/locale/translations/ga.json b/app/config/locale/translations/ga.json index f9611e07b5..b3e480c22c 100644 --- a/app/config/locale/translations/ga.json +++ b/app/config/locale/translations/ga.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Is í ealaín na críonnachta ná rudaí a aithint chun cluas bhodhar a thabhairt dóibh.\"", "settings.locale": "ga", "settings.direction": "ltr", - "emails.sender": "%s Foireann", + "emails.sender": "{{project}} Foireann", "emails.verification.subject": "Fíoraithe cuntais", "emails.verification.hello": "Haigh {{user}},", "emails.verification.body": "Lean an nasc seo chun do ríomhphost a fhíorú.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Go raibh maith agat,", "emails.recovery.buttonText": "Athshocraigh focal faire", "emails.recovery.signature": "{{project}} foireann", - "emails.invitation.subject": "Cuireadh do %s foireann ag %s", + "emails.invitation.subject": "Cuireadh do {{team}} foireann ag {{project}}", "emails.invitation.hello": "Haigh,", "emails.invitation.body": "Seoladh an ríomhphost seo chugat mar ba mhaith le {{owner}} cuireadh a thabhairt duit bheith mar bhall den fhoireann {{team}} ag obair ar {{project}}.", "emails.invitation.footer": "Is cuma leat? Déan neamhaird den teachtaireacht seo.", diff --git a/app/config/locale/translations/gu.json b/app/config/locale/translations/gu.json index 8b9b41c0c9..97d73b8d5c 100644 --- a/app/config/locale/translations/gu.json +++ b/app/config/locale/translations/gu.json @@ -2,7 +2,7 @@ "settings.inspire": "\"સ્માર્ટ બનવાની કળા એ છે કે શું અવગણવું તે જાણવાની કળા છે.\"", "settings.locale": "gu", "settings.direction": "ltr", - "emails.sender": "%s ટીમ", + "emails.sender": "{{project}} ટીમ", "emails.verification.subject": "ખાતાની ચકાસણી", "emails.verification.hello": "નમસ્કાર {{user}},", "emails.verification.body": "તમારું ઇમેઇલ સરનામું ચકાસવા માટે આ લિંકને અનુસરો.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "આભાર,", "emails.recovery.buttonText": "પાસવર્ડ રીસેટ કરો", "emails.recovery.signature": "{{project}} ટીમ", - "emails.invitation.subject": "%s ટીમને %s પર આમંત્રણ", + "emails.invitation.subject": "{{team}} ટીમને {{project}} પર આમંત્રણ", "emails.invitation.hello": "નમસ્કાર,", "emails.invitation.body": "આ મેઇલ તમને મોકલવામાં આવ્યો હતો કારણ કે {{owner}} તમને {{project}} માં {{team}} ટીમના સભ્ય બનવા માટે આમંત્રિત કરવા માંગતા હતો.", "emails.invitation.footer": "જો તમને રસ નથી, તો તમે આ સંદેશને અવગણી શકો છો.", diff --git a/app/config/locale/translations/he.json b/app/config/locale/translations/he.json index ab61085fa1..96c9eb3d50 100644 --- a/app/config/locale/translations/he.json +++ b/app/config/locale/translations/he.json @@ -2,7 +2,7 @@ "settings.inspire": "\"להיות חכם זה לדעת ממה להתעלם.\"", "settings.locale": "he", "settings.direction": "rtl", - "emails.sender": "צוות %s", + "emails.sender": "צוות {{project}}", "emails.verification.subject": "אימות חשבון", "emails.verification.hello": "שלום {{user}},", "emails.verification.body": "לחץ על קישור זה כדי לאמת את כתובת הדוא\"ל שלך.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "תודה,", "emails.recovery.buttonText": "סיסמא איפוס", "emails.recovery.signature": "צוות {{project}}", - "emails.invitation.subject": "הזמנה לצוות %s ב- %s", + "emails.invitation.subject": "הזמנה לצוות {{team}} ב- {{project}}", "emails.invitation.hello": "שלום,", "emails.invitation.body": "דואר זה נשלח אליך מכיוון ש {{owner}} רצה להזמין אותך להיות חבר בצוות {{team}} ב-{{project}}.", "emails.invitation.footer": "אם אינך מעוניין, תוכל להתעלם מהודעה זו.", diff --git a/app/config/locale/translations/hi.json b/app/config/locale/translations/hi.json index fe2aa9b5d2..51f404260e 100644 --- a/app/config/locale/translations/hi.json +++ b/app/config/locale/translations/hi.json @@ -2,7 +2,7 @@ "settings.inspire": "\"बुद्धिमान होने की कला यह जानने की कला है कि क्या अनदेखा किया जाए |\"", "settings.locale": "hi", "settings.direction": "ltr", - "emails.sender": "%s टीम", + "emails.sender": "{{project}} टीम", "emails.verification.subject": "अकाउंट वेरिफिकेशन ", "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "इस लिंक के माध्यम से अपने ईमेल को सत्यापित कीजिये।", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.buttonText": "पासवर्ड रीसेट करें", "emails.recovery.signature": "{{project}} टीम", - "emails.invitation.subject": "%s टीम का यहाँ %s पर आमंत्रण", + "emails.invitation.subject": "{{team}} टीम का यहाँ {{project}} पर आमंत्रण", "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "यह मेल आपको इसलिए भेजा गया है क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनाना चाहते है, जो {{project}} से जुड़ा हुआ है।", "emails.invitation.footer": "यदि आप इसमें रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", diff --git a/app/config/locale/translations/hr.json b/app/config/locale/translations/hr.json index 7ffe10668b..e956a530c1 100644 --- a/app/config/locale/translations/hr.json +++ b/app/config/locale/translations/hr.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Umjetnost mudrosti je umjetnost znanja o tome što zanemariti.\"", "settings.locale": "hr", "settings.direction": "ltr", - "emails.sender": "%s Tim", + "emails.sender": "{{project}} Tim", "emails.verification.subject": "Verifikacija računa", "emails.verification.hello": "Pozdrav {{user}},", "emails.verification.body": "Slijedite ovu poveznicu da biste potvrdili svoju adresu e-pošte.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Hvala,", "emails.recovery.buttonText": "Resetiraj lozinku", "emails.recovery.signature": "{{project}} tim", - "emails.invitation.subject": "Pozivnica za %s tim na %s", + "emails.invitation.subject": "Pozivnica za {{team}} tim na {{project}}", "emails.invitation.hello": "Pozdrav,", "emails.invitation.body": "Ova poruka Vam je poslana jer Vas je {{owner}} htio pozvati da postanete član {{team}} tima na {{project}}.", "emails.invitation.footer": "Ukoliko niste zainteresirani, možete zanemariti ovu poruku.", diff --git a/app/config/locale/translations/hu.json b/app/config/locale/translations/hu.json index 54e204e798..2593099c52 100644 --- a/app/config/locale/translations/hu.json +++ b/app/config/locale/translations/hu.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "hu", "settings.direction": "ltr", - "emails.sender": "%s Csapat", + "emails.sender": "{{project}} Csapat", "emails.verification.subject": "Fiók Megerősítése", "emails.verification.hello": "Szia {{user}},", "emails.verification.body": "Kattints a linkre, hogy megerősítsd az email címedet.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Köszönettel,", "emails.recovery.buttonText": "Jelszó visszaállítása", "emails.recovery.signature": "a {{project}} csapat", - "emails.invitation.subject": "Meghívó a(z) %s csapatba, a(z) %s projektbe", + "emails.invitation.subject": "Meghívó a(z) {{team}} csapatba, a(z) {{project}} projektbe", "emails.invitation.hello": "Szia,", "emails.invitation.body": "Ezt a levelet azért kaptad, mert {{owner}} meghívott, hogy légy a {{team}} csapat tagja a {{project}} projektben.", "emails.invitation.footer": "Ha nem érdekel a lehetőség, nyugodtan hagyd figyelmen kívül ezt az üzenetet.", diff --git a/app/config/locale/translations/hy.json b/app/config/locale/translations/hy.json index 08dcbb59eb..b0c264d87c 100644 --- a/app/config/locale/translations/hy.json +++ b/app/config/locale/translations/hy.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Искусство быть мудрым — это искусство знать, чем можно пренебречь.\"", "settings.locale": "ru", "settings.direction": "ltr", - "emails.sender": "Թիմ %s", + "emails.sender": "Թիմ {{project}}", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/id.json b/app/config/locale/translations/id.json index cd9cadc4b1..0e716f1e80 100644 --- a/app/config/locale/translations/id.json +++ b/app/config/locale/translations/id.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Seni menjadi bijak adalah seni mengetahui apa yang harus diabaikan.\"", "settings.locale": "id", "settings.direction": "ltr", - "emails.sender": "Tim %s", + "emails.sender": "Tim {{project}}", "emails.verification.subject": "Verifikasi Akun", "emails.verification.hello": "Hai {{user}},", "emails.verification.body": "Ikuti tautan ini untuk memverifikasi alamat email Anda.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Terima kasih,", "emails.recovery.buttonText": "Atur ulang kata sandi", "emails.recovery.signature": "Tim {{project}}", - "emails.invitation.subject": "Undangan ke Tim %s di %s", + "emails.invitation.subject": "Undangan ke Tim {{team}} di {{project}}", "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email ini dikirimkan kepada Anda karena {{owner}} ingin mengundang Anda untuk menjadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Jika Anda tidak tertarik, Anda dapat mengabaikan pesan ini.", diff --git a/app/config/locale/translations/is.json b/app/config/locale/translations/is.json index 4b21e9939b..e387058d17 100644 --- a/app/config/locale/translations/is.json +++ b/app/config/locale/translations/is.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Listin að vera vitur er listin að vita hvað á að líta framhjá.\"", "settings.locale": "is", "settings.direction": "ltr", - "emails.sender": "%s Teymi", + "emails.sender": "{{project}} Teymi", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/it.json b/app/config/locale/translations/it.json index 7b419858a3..1b07f7e95c 100644 --- a/app/config/locale/translations/it.json +++ b/app/config/locale/translations/it.json @@ -2,7 +2,7 @@ "settings.inspire": "\"L'arte di essere saggi è l'arte di saper cosa trascurare.\"", "settings.locale": "it", "settings.direction": "ltr", - "emails.sender": "Team %s", + "emails.sender": "Team {{project}}", "emails.verification.subject": "Verifica account", "emails.verification.hello": "Ciao {{user}},", "emails.verification.body": "Clicca questo link per verificare il tuo indirizzo email.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Grazie,", "emails.recovery.buttonText": "Reimposta password", "emails.recovery.signature": "Il team {{project}}", - "emails.invitation.subject": "Invito al Team %s per %s", + "emails.invitation.subject": "Invito al Team {{team}} per {{project}}", "emails.invitation.hello": "Ciao,", "emails.invitation.body": "Hai ricevuto questa email perché {{owner}} ti ha invitato a diventare un membro del team {{team}} di {{project}}.", "emails.invitation.footer": "Ignora questo messaggio se non sei interessatə.", diff --git a/app/config/locale/translations/ja.json b/app/config/locale/translations/ja.json index 6ecfed55a2..40c84e4a80 100644 --- a/app/config/locale/translations/ja.json +++ b/app/config/locale/translations/ja.json @@ -2,7 +2,7 @@ "settings.inspire": "\"賢明になる術は何を捨てるべきかを心得る術である。\"", "settings.locale": "ja", "settings.direction": "ltr", - "emails.sender": "%s チーム", + "emails.sender": "{{project}} チーム", "emails.verification.subject": "アカウント認証", "emails.verification.hello": "こんにちは{{user}}さん、", "emails.verification.body": "メールアドレスを有効化するためには下記リンクをクリックして下さい。", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ご利用いただきありがとうございます。、", "emails.recovery.buttonText": "パスワードをリセット", "emails.recovery.signature": "{{project}}チーム", - "emails.invitation.subject": "%sチームへの招待が%sから来ました。", + "emails.invitation.subject": "{{team}}チームへの招待が{{project}}から来ました。", "emails.invitation.hello": "こんにちは、", "emails.invitation.body": "{{owner}}さんが{{project}}の{{team}}チームにあなたを招待しています。", "emails.invitation.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", diff --git a/app/config/locale/translations/jv.json b/app/config/locale/translations/jv.json index 3f6b6b9fe2..962ded4fdc 100644 --- a/app/config/locale/translations/jv.json +++ b/app/config/locale/translations/jv.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Kesenian sing wicaksana yaiku seni sing ngerti apa sing kudu dilalekake.\"", "settings.locale": "jv", "settings.direction": "ltr", - "emails.sender": "Tim %s", + "emails.sender": "Tim {{project}}", "emails.verification.subject": "Verifikasi Akun", "emails.verification.hello": "Hai {{user}},", "emails.verification.body": "Klik link iki kanggo verifikasi alamat email sampeyan.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Matur nuwun,", "emails.recovery.buttonText": "Reset sandhi", "emails.recovery.signature": "Tim {{project}}", - "emails.invitation.subject": "Undangan ke Tim %s di %s", + "emails.invitation.subject": "Undangan ke Tim {{team}} di {{project}}", "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email iki dikirim menyang sampeyan amarga {{owner}} pengin ngajak sampeyan dadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Yen sampeyan ora tertarik, sampeyan iso nglirwakake pesen iki.", diff --git a/app/config/locale/translations/km.json b/app/config/locale/translations/km.json index 9e93162a6a..e673a7916f 100644 --- a/app/config/locale/translations/km.json +++ b/app/config/locale/translations/km.json @@ -2,7 +2,7 @@ "settings.inspire": "\"សិល្បៈនៃប្រាជ្ញាគឺជាសិល្បៈនៃការស្គាល់ពីអ្វីដែលត្រូវមើលរំលង។\"", "settings.locale": "km", "settings.direction": "ltr", - "emails.sender": "ក្រុម %s", + "emails.sender": "ក្រុម {{project}}", "emails.verification.subject": "", "emails.verification.hello": "", "emails.verification.body": "", diff --git a/app/config/locale/translations/kn.json b/app/config/locale/translations/kn.json index 40b51c0944..4d69b6c0dc 100644 --- a/app/config/locale/translations/kn.json +++ b/app/config/locale/translations/kn.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ಬುದ್ಧಿವಂತಿಕೆಯ ಕಲೆ ಏನು ಕಡೆಗಣಿಸಬೇಕೆಂದು ತಿಳಿಯುವ ಕಲೆ.\"", "settings.locale": "ka", "settings.direction": "ltr", - "emails.sender": "%s ತಂಡ", + "emails.sender": "{{project}} ತಂಡ", "emails.verification.subject": "ಖಾತೆ ಪರಿಶೀಲನೆ", "emails.verification.hello": "ನಮಸ್ಕಾರ {{user}},", "emails.verification.body": "ನಿಮ್ಮ ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.recovery.buttonText": "ಗುಪ್ತಪದವನ್ನು ಮರುಸೆಟ್ ಮಾಡಿ", "emails.recovery.signature": "{{project}} ತಂಡ", - "emails.invitation.subject": "%s ತಂಡಕ್ಕೆ %s ರಲ್ಲಿ ಆಹ್ವಾನ", + "emails.invitation.subject": "{{team}} ತಂಡಕ್ಕೆ {{project}} ರಲ್ಲಿ ಆಹ್ವಾನ", "emails.invitation.hello": "ನಮಸ್ಕಾರ,", "emails.invitation.body": "ಈ ಇಮೇಲ್ ನಿಮಗೆ ಬಂದಿದೆ ಏಕೆಂದರೆ {{owner}} ನಿಮ್ಮನ್ನು {{team}} ತಂಡದ {{project}}ರಲ್ಲಿ ಸದಸ್ಯ ಆಗಲಿಕ್ಕೆ ಆಹ್ವಾನಿಸಿದ್ದಾರೆ", "emails.invitation.footer": "ನಿಮಗೆ ಆಸಕ್ತಿಯಿಲ್ಲದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", diff --git a/app/config/locale/translations/ko.json b/app/config/locale/translations/ko.json index 3bae815d75..192af7ab93 100644 --- a/app/config/locale/translations/ko.json +++ b/app/config/locale/translations/ko.json @@ -2,7 +2,7 @@ "settings.inspire": "\"지혜롭게 되는 묘책은 그동안 간과했던 것을 알아내는 것에 있다\"", "settings.locale": "ko", "settings.direction": "ltr", - "emails.sender": "%s 팀", + "emails.sender": "{{project}} 팀", "emails.verification.subject": "계정 인증", "emails.verification.hello": "안녕하세요 {{user}}님、", "emails.verification.body": "이메일 인증을 위해 링크를 클릭하여주세요.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "감사합니다、", "emails.recovery.buttonText": "비밀번호 재설정", "emails.recovery.signature": "{{project}} 팀", - "emails.invitation.subject": "초대장 %s 팀 - %s", + "emails.invitation.subject": "초대장 {{team}} 팀 - {{project}}", "emails.invitation.hello": "안녕하세요、", "emails.invitation.body": "{{owner}}님이 귀하를 {{project}}의 {{team}} 팀으로 초대합니다.", "emails.invitation.footer": "팀에 합류할 의사가 없으시면 이 메세지를 무시하여주세요.", diff --git a/app/config/locale/translations/la.json b/app/config/locale/translations/la.json index bf58232b9a..242e563c8c 100644 --- a/app/config/locale/translations/la.json +++ b/app/config/locale/translations/la.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Ars sapiendi est ars sciendi quid negligat.\"", "settings.locale": "la", "settings.direction": "ltr*", - "emails.sender": "%s team", + "emails.sender": "{{project}} team", "emails.verification.subject": "Ratio comprobatio", "emails.verification.hello": "Salve ibi {{user}},", "emails.verification.body": "Sequere hanc nexum ut quin inscriptionem tuum.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Gratias,", "emails.recovery.buttonText": "Reset password", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitatio pro %s in quadrigis %s", + "emails.invitation.subject": "Invitatio pro {{team}} in quadrigis {{project}}", "emails.invitation.hello": "Salve ibi,", "emails.invitation.body": "Haec inscriptio ad te missa est quia dominus incepto {{owner}} te invitare vult ut membrum {{team}} quadrigis fias ad {{project}}", "emails.invitation.footer": "Si non quaero, potes hunc nuntium ignorare", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "Sententia securitatis huius epistulae est {{phrase}}. Epistulae confidere potes si haec sententia cum ea quae ostensa est in signo ingressus convenit.", "emails.otpSession.thanks": "Gratias,", "emails.otpSession.signature": "{{project}} team -> {{project}} grex", - "emails.certificate.subject": "Defectio testimonii pro %s", + "emails.certificate.subject": "Defectio testimonii pro {{domain}}", "emails.certificate.hello": "Salve,", "emails.certificate.body": "Certificatum pro dominio tuo '{{domain}}' generari non potuit. Hoc conatus num. {{attempt}} est, et defectus causatus est ab: {{error}}", "emails.certificate.footer": "Praeclarum tuum testificationem valet ad XXX dies a primo defectu. Magnopere suademus ut hoc casum investiges, alioquin dominium tuum sine valida SSL communicatione erit.", diff --git a/app/config/locale/translations/lb.json b/app/config/locale/translations/lb.json index 77245036ac..075c29ef11 100644 --- a/app/config/locale/translations/lb.json +++ b/app/config/locale/translations/lb.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "lb", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kont Verifikatioun", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Follegt dëse Link fir Är E -Mail Adress z'iwwerpréiwen.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Merci,", "emails.recovery.buttonText": "Passwuert zrécksetzen", "emails.recovery.signature": "{{project}} équipe", - "emails.invitation.subject": "Invitatioun un %s équipe bei %s", + "emails.invitation.subject": "Invitatioun un {{team}} équipe bei {{project}}", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Dës E -Mail gouf un Iech geschéckt well {{owner}} Iech invitéiere wëllt fir Member vum {{team}} Team bei {{project}} ze ginn.", "emails.invitation.footer": "Wann Dir net interesséiert sidd, kënnt Dir dëse Message ignoréieren.", diff --git a/app/config/locale/translations/lt.json b/app/config/locale/translations/lt.json index e0a3a84340..3e32658947 100644 --- a/app/config/locale/translations/lt.json +++ b/app/config/locale/translations/lt.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Menas būti išmintingu — tai menas žinoti, ko galima nepamatyti.\"", "settings.locale": "lt", "settings.direction": "ltr", - "emails.sender": "%s komanda", + "emails.sender": "{{project}} komanda", "emails.verification.subject": "Paskyros Patvirtinimas", "emails.verification.hello": "Labas {{user}},", "emails.verification.body": "Spauskite šią nuorodą, kad patvirtintumėte savo el. paštą.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Ačiū,", "emails.recovery.buttonText": "Atstatyti slaptažodį", "emails.recovery.signature": "{{project}} komanda", - "emails.invitation.subject": "Pakvietimas į %s komandą %s projekte", + "emails.invitation.subject": "Pakvietimas į {{team}} komandą {{project}} projekte", "emails.invitation.hello": "Labas,", "emails.invitation.body": "Šis el. laiškas buvo atsiųstas jums, nes {{owner}} norėjo jus pakviesti tapti projekto {{project}} dalimi {{team}} komandoje.", "emails.invitation.footer": "Jei jūsų tai nedomina, galite ignoruoti šį pranešimą.", diff --git a/app/config/locale/translations/lv.json b/app/config/locale/translations/lv.json index d91977ebad..9083fd3fc4 100644 --- a/app/config/locale/translations/lv.json +++ b/app/config/locale/translations/lv.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Māksla būt gudram ir māksla zināt, ko aizmirst.\"", "settings.locale": "lv", "settings.direction": "ltr", - "emails.sender": "%s komanda", + "emails.sender": "{{project}} komanda", "emails.verification.subject": "Konta verifikācija", "emails.verification.hello": "Sveicināti, {{user}},", "emails.verification.body": "Sekojiet saitei, lai apstiprinātu savu e-pasta adresi.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Paldies,", "emails.recovery.buttonText": "Atiestatīt paroli", "emails.recovery.signature": "{{project}} komanda", - "emails.invitation.subject": "Ielūgums piebiedroties %s komandai %s projektā.", + "emails.invitation.subject": "Ielūgums piebiedroties {{team}} komandai {{project}} projektā.", "emails.invitation.hello": "Labdien,", "emails.invitation.body": "Šis e-pasts tika nosūtīts Jums, jo {{owner}} vēlējās Jūs ielūgt kļūt par {{team}} komandas biedru {{project}} projektā.", "emails.invitation.footer": "Ja Jūs neesat ieinteresēts, lūdzu, ignorējiet šo ziņu.", diff --git a/app/config/locale/translations/ml.json b/app/config/locale/translations/ml.json index ffc9f12a7e..720f568879 100644 --- a/app/config/locale/translations/ml.json +++ b/app/config/locale/translations/ml.json @@ -2,7 +2,7 @@ "settings.inspire": "\"എന്താണ് അവഗണിക്കേണ്ടതെന്ന് അറിയാനുള്ള കലയാണ് ബുദ്ധിമാനായിരിക്കുക എന്നത്.\"", "settings.locale": "ml", "settings.direction": "ltr", - "emails.sender": "%s ടീം", + "emails.sender": "{{project}} ടീം", "emails.verification.subject": "അക്കൗണ്ട് സ്ഥിരീകരണം", "emails.verification.hello": "നമസ്കാരം {{user}},", "emails.verification.body": "നിങ്ങളുടെ ഇമെയിൽ വിലാസം സ്ഥിരീകരിക്കുന്നതിനായി ഈ ലിങ്ക് പിന്തുടരുക.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "നന്ദി,", "emails.recovery.buttonText": "പാസ്‌വേഡ് റീസെറ്റ് ചെയ്യുക", "emails.recovery.signature": "{{project}} ടീം", - "emails.invitation.subject": "%s -ലെ %s ടീമിലേക്കുള്ള ക്ഷണം", + "emails.invitation.subject": "{{team}} -ലെ {{project}} ടീമിലേക്കുള്ള ക്ഷണം", "emails.invitation.hello": "നമസ്കാരം,", "emails.invitation.body": "നിങ്ങളെ {{project}} -ലെ {{team}} ടീമിലെ അംഗമാകുവാന്‍ ക്ഷണിക്കാൻ {{owner}} ആഗ്രഹിക്കുന്നതിനാലാണ് ഈ മെയിൽ നിങ്ങൾക്ക് അയക്കുന്നത്.", "emails.invitation.footer": "നിങ്ങൾക്ക് താൽപ്പര്യമില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "ഈ ഇമെയിലിന്റെ സുരക്ഷാ വാചകം {{phrase}} ആണ്. സൈൻ ഇൻ ചെയ്യുമ്പോൾ കാണിച്ച വാചകവുമായി ഈ വാചകം പൊരുത്തപ്പെടുന്നുണ്ടെങ്കിൽ ഈ ഇമെയിലിന് വിശ്വസിക്കാം.", "emails.otpSession.thanks": "നന്ദി,", "emails.otpSession.signature": "പ്രോജക്ട് ടീം", - "emails.certificate.subject": "%s ന് സർട്ടിഫിക്കറ്റ് പരാജയപ്പെട്ടു", + "emails.certificate.subject": "{{domain}} ന് സർട്ടിഫിക്കറ്റ് പരാജയപ്പെട്ടു", "emails.certificate.hello": "ഹലോ,", "emails.certificate.body": "നിങ്ങളുടെ ഡൊമൈൻ '{{domain}}'നു വേണ്ടിയുള്ള സർട്ടിഫിക്കറ്റ് ഉണ്ടാക്കാനായില്ല. ഇത് ശ്രമം നമ്പർ {{attempt}} ആണ്, പരാജയപ്പെട്ടത് ഇതു മൂലമാണ്: {{error}}", "emails.certificate.footer": "നിങ്ങളുടെ മുൻപത്തെ സർട്ടിഫിക്കറ്റ് ആദ്യ പരാജയത്തിനു ശേഷം 30 ദിവസം വരെ സാധുവായിരിക്കും. ഈ കേസ് അന്വേഷിച്ചു നോക്കുന്നത് ഞങ്ങൾ ശക്തമായി ശുപാർശ ചെയ്യുന്നു, അല്ലെങ്കിൽ നിങ്ങളുടെ ഡൊമെയ്‌ൻ സാധുവായ SSL കമ്മ്യൂണിക്കേഷനില്ലാത്ത ഒരു അവസ്ഥയിലാകും.", diff --git a/app/config/locale/translations/mr.json b/app/config/locale/translations/mr.json index d417ac305f..533d0ec92c 100644 --- a/app/config/locale/translations/mr.json +++ b/app/config/locale/translations/mr.json @@ -2,7 +2,7 @@ "settings.inspire": "\"हुशार असण्याची कला म्हणजे कोणत्या गोष्टीकडे दुर्लक्ष करावे हे जाणून घेण्याची कला.\"", "settings.locale": "mr", "settings.direction": "ltr", - "emails.sender": "%s टीम", + "emails.sender": "{{project}} टीम", "emails.verification.subject": "खाते सत्यापन", "emails.verification.hello": "नमस्कार {{user}},", "emails.verification.body": "आपला ईमेल पत्ता सत्यापित करण्यासाठी या दुव्याचे अनुसरण करा.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.buttonText": "पासवर्ड रीसेट करा", "emails.recovery.signature": "{{project}} संघ", - "emails.invitation.subject": "%s संघ %s येथे सामील होण्यासाठी आमंत्रण", + "emails.invitation.subject": "{{team}} संघ {{project}} येथे सामील होण्यासाठी आमंत्रण", "emails.invitation.hello": "नमस्कार,", "emails.invitation.body": "हा मेल तुम्हाला पाठवला होता कारण {{owner}} तुम्हाला {{project}} येथे {{team}} टीमचे सदस्य होण्यासाठी आमंत्रित करू इच्छित होते.", "emails.invitation.footer": "आपल्याला स्वारस्य नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", diff --git a/app/config/locale/translations/ms.json b/app/config/locale/translations/ms.json index 99d086cd81..c19fa48f52 100644 --- a/app/config/locale/translations/ms.json +++ b/app/config/locale/translations/ms.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Seni menjadi pandai adalah seni mengetahui apa yang dilihatnya.\"", "settings.locale": "ms", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Pengesahan Akaun", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Tekan pautan ini untuk mengesahkan alamat email anda.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Terima kasih,", "emails.recovery.buttonText": "Tetapkan semula kata laluan", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Jemputan ke pasukan %s di %s", + "emails.invitation.subject": "Jemputan ke pasukan {{team}} di {{project}}", "emails.invitation.hello": "Hello,", "emails.invitation.body": "Anda menerima mel ini kerana {{owner}} ingin menjemput anda untuk menjadi ahli pasukan {{team}} di {{project}}.", "emails.invitation.footer": "Sekiranya anda tidak berminat, sila abaikan mesej ini.", diff --git a/app/config/locale/translations/nb.json b/app/config/locale/translations/nb.json index 36e28072d4..3236f267b8 100644 --- a/app/config/locale/translations/nb.json +++ b/app/config/locale/translations/nb.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Kunsten å være klok er kunsten å vite hva man skal overse.\"", "settings.locale": "nb", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kontobekreftelse", "emails.verification.hello": "Hei {{user}},", "emails.verification.body": "Følg denne lenken for å bekrefte din e-postadresse.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Takk,", "emails.recovery.buttonText": "Tilbakestill passord", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Invitasjon til %s Team ved %s", + "emails.invitation.subject": "Invitasjon til {{team}} Team ved {{project}}", "emails.invitation.hello": "Hei,", "emails.invitation.body": "Denne meldingen ble sendt til deg fordi {{owner}} ønsket å invitere deg til å bli medlem av {{team}} team ved {{project}}.", "emails.invitation.footer": "Dersom du ikke er interessert, kan du se bort fra denne meldingen.", diff --git a/app/config/locale/translations/ne.json b/app/config/locale/translations/ne.json index 545810d871..b8dd495814 100644 --- a/app/config/locale/translations/ne.json +++ b/app/config/locale/translations/ne.json @@ -2,7 +2,7 @@ "settings.inspire": "\"के लाई बेवास्ता गर्ने भन्ने जान्नुनै बुद्धिमान हुनुको कला हो ।\"", "settings.locale": "ne", "settings.direction": "ltr", - "emails.sender": "%s समूह", + "emails.sender": "{{project}} समूह", "emails.verification.subject": "खाता प्रमाणिकरण", "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "इमेल ठेगाना प्रमाणित गर्नको लागी यो लिंकमा जानुहोस।", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.buttonText": "रिसेट पासवर्ड", "emails.recovery.signature": "{{project}} समूह", - "emails.invitation.subject": "%s समूहको लागि %s मा निमन्त्रणा", + "emails.invitation.subject": "{{team}} समूहको लागि {{project}} मा निमन्त्रणा", "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "{{owner}}ले तपाइँलाई {{project}}मा {{team}}को सदस्य बन्न आमन्त्रित गर्न चाहनु भएको छ। त्येसैले तपाइँलाई यो सन्देश पठाइएको हो।", "emails.invitation.footer": "यदि तपाइँ इच्छुक हुनुहुन्न भने, तपाइँले यो सन्देशलाई बेवास्ता गर्न सक्नुहुन्छ।", diff --git a/app/config/locale/translations/nl.json b/app/config/locale/translations/nl.json index 9949a2b4b8..9b051b6dc6 100644 --- a/app/config/locale/translations/nl.json +++ b/app/config/locale/translations/nl.json @@ -2,7 +2,7 @@ "settings.inspire": "\"De kunst om wijs te zijn is de kunst om te weten wat over het hoofd gezien moet worden.\"", "settings.locale": "nl", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Account Verificatie", "emails.verification.hello": "Hoi {{user}},", "emails.verification.body": "Volg deze link om uw e-mail te verifieren", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Bedankt,", "emails.recovery.buttonText": "Wachtwoord opnieuw instellen", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Uitnodiging van %s Team uit %s", + "emails.invitation.subject": "Uitnodiging van {{team}} Team uit {{project}}", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "U ontvangt deze mail want u was uitgenodig door {{owner}} om lid van het {{team}} team te worden in {{project}} ", "emails.invitation.footer": "Als u niet geintereseerd bent, kan u deze mail negeren.", diff --git a/app/config/locale/translations/nn.json b/app/config/locale/translations/nn.json index cb5084011e..9fc77a7faa 100644 --- a/app/config/locale/translations/nn.json +++ b/app/config/locale/translations/nn.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Kunsten å væra klok er kunsten å vita kva man skal oversjå.\"", "settings.locale": "nn", "settings.direction": "ltr", - "emails.sender": "%s Team", + "emails.sender": "{{project}} Team", "emails.verification.subject": "Kontostadfesting", "emails.verification.hello": "Hallo {{user}},", "emails.verification.body": "Følg denne lenkja for å bekrefta din e-postadresse.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Takk,", "emails.recovery.buttonText": "Nullstill passord", "emails.recovery.signature": "{{project}} team", - "emails.invitation.subject": "Innbyding til %s Team ved %s", + "emails.invitation.subject": "Innbyding til {{team}} Team ved {{project}}", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Denne meldinga ble sendt til deg fordi {{owner}} ynskja å invitera deg til å bli medlem av {{team}} team i {{project}}.", "emails.invitation.footer": "Om du ikkje er interessert, kan du ignorera denne meldinga.", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "Tryggingsfrasen for denne e-posten er {{phrase}}. Du kan stole på denne e-posten om frasen stemmer med frasen vist under pålogging.", "emails.otpSession.thanks": "Takk,", "emails.otpSession.signature": "{{project}}-laget", - "emails.certificate.subject": "Sertifikatfeil for %s", + "emails.certificate.subject": "Sertifikatfeil for {{domain}}", "emails.certificate.hello": "Hei,", "emails.certificate.body": "Sertifikatet for domenet ditt '{{domain}}' kunne ikkje opprettast. Dette er forsøk nr. {{attempt}}, og feilen blei forårsaka av: {{error}}", "emails.certificate.footer": "Førre sertifikatet ditt vil vere gyldig i 30 dagar sidan den første feilen. Vi rår sterkt til at du undersøkjer denne saka, elles vil domenet ditt ende opp utan gyldig SSL-kommunikasjon.", diff --git a/app/config/locale/translations/or.json b/app/config/locale/translations/or.json index 6393067089..c565804e22 100644 --- a/app/config/locale/translations/or.json +++ b/app/config/locale/translations/or.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ବୁଦ୍ଧିମାନ ହେବାର କଳା ହେଉଛି କ’ଣ ଅଣଦେଖା କରାଯିବ ଜାଣିବାର କଳା |\"", "settings.locale": "or", "settings.direction": "ltr", - "emails.sender": "%s ଦଳ", + "emails.sender": "{{project}} ଦଳ", "emails.verification.subject": "ଖାତା ଯାଞ୍ଚ", "emails.verification.hello": "ନମସ୍କାର {{user}},", "emails.verification.body": "ଆପଣଙ୍କର ଇମେଲ୍ ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ |", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ଧନ୍ୟବାଦ,", "emails.recovery.buttonText": "ପାସୱାର୍ଡ ପୁନଃସେଟ୍ କରନ୍ତୁ", "emails.recovery.signature": "{{project}} ଦଳ", - "emails.invitation.subject": "%s ରେ %s ଦଳକୁ ନିମନ୍ତ୍ରଣ |", + "emails.invitation.subject": "{{team}} ରେ {{project}} ଦଳକୁ ନିମନ୍ତ୍ରଣ |", "emails.invitation.hello": "ନମସ୍କାର,", "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", "emails.invitation.footer": "ଯଦି ଆପଣ ଆଗ୍ରହୀ ନୁହଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଅଣଦେଖା କରିପାରିବେ |", diff --git a/app/config/locale/translations/pa.json b/app/config/locale/translations/pa.json index 2c3d90604c..48ff17c174 100644 --- a/app/config/locale/translations/pa.json +++ b/app/config/locale/translations/pa.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ਬੁੱਧੀਮਾਨ ਬਣਨ ਦੀ ਕਲਾ ਇਹ ਜਾਣਨ ਦੀ ਕਲਾ ਹੈ ਕਿ ਕਿਸ ਨੂੰ ਨਜ਼ਰਅੰਦਾਜ਼ ਕਰਨਾ ਹੈ.\"", "settings.locale": "pa", "settings.direction": "ltr", - "emails.sender": "%s ਟੀਮ", + "emails.sender": "{{project}} ਟੀਮ", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/pl.json b/app/config/locale/translations/pl.json index e10e47f50d..4ca95614a1 100644 --- a/app/config/locale/translations/pl.json +++ b/app/config/locale/translations/pl.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Sztuka bycia mądrym to sztuka wiedzieć, co przeoczyć.\"", "settings.locale": "pl", "settings.direction": "ltr", - "emails.sender": "Zespół %s", + "emails.sender": "Zespół {{project}}", "emails.verification.subject": "Weryfikacja konta", "emails.verification.hello": "Cześć {{user}},", "emails.verification.body": "Przejdź do tego linku, aby zweryfikować swój adres e-mail.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Dziękujemy,", "emails.recovery.buttonText": "Zresetuj hasło", "emails.recovery.signature": "Zespół {{project}}", - "emails.invitation.subject": "Zaproszenie do zespołu %s w %s", + "emails.invitation.subject": "Zaproszenie do zespołu {{team}} w {{project}}", "emails.invitation.hello": "Cześć,", "emails.invitation.body": "Otrzymujesz tę wiadomość, ponieważ {{owner}} zaprasza Cię do grona członków zespołu {{team}} w projekcie {{project}}.", "emails.invitation.footer": "Jeśli nie jesteś zainteresowany, zignoruj tę wiadomość.", diff --git a/app/config/locale/translations/pt-br.json b/app/config/locale/translations/pt-br.json index 75ad38f887..617db1f857 100644 --- a/app/config/locale/translations/pt-br.json +++ b/app/config/locale/translations/pt-br.json @@ -2,7 +2,7 @@ "settings.inspire": "\"A arte de ser sábio é a arte de saber o que deixar passar.\"", "settings.locale": "pt-br", "settings.direction": "ltr", - "emails.sender": "Time %s", + "emails.sender": "Time {{project}}", "emails.verification.subject": "Verificação da Conta", "emails.verification.hello": "Olá {{user}},", "emails.verification.body": "Clique neste link para verificar o seu endereço de e-mail.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Muito obrigado,", "emails.recovery.buttonText": "Redefinir senha", "emails.recovery.signature": "Time {{project}}", - "emails.invitation.subject": "Convite para o Time %s em %s", + "emails.invitation.subject": "Convite para o Time {{team}} em {{project}}", "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este e-mail foi enviado porque {{owner}} deseja convidar você a se tornar membro do Time {{team}} em {{project}}.", "emails.invitation.footer": "Caso não tenha interesse, ignore essa mensagem.", diff --git a/app/config/locale/translations/pt-pt.json b/app/config/locale/translations/pt-pt.json index f0c84ab9e6..66a58ed7ce 100644 --- a/app/config/locale/translations/pt-pt.json +++ b/app/config/locale/translations/pt-pt.json @@ -2,7 +2,7 @@ "settings.inspire": "\"A arte de ser sábio é a arte de saber o que ultrapassar.\"", "settings.locale": "pt-pt", "settings.direction": "ltr", - "emails.sender": "Equipa %s", + "emails.sender": "Equipa {{project}}", "emails.verification.subject": "Verificação de contas", "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Siga esta ligação para verificar o seu endereço de correio electrónico.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Obrigado,", "emails.recovery.buttonText": "Repor palavra-passe", "emails.recovery.signature": "Equipa {{project}}", - "emails.invitation.subject": "Convite à equipa de %s às %s", + "emails.invitation.subject": "Convite à equipa de {{team}} às {{project}}", "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este correio foi-lhe enviado porque {{owner}} queria convidá-lo a tornar-se membro da equipa {{team}} da {{project}}.", "emails.invitation.footer": "Se não estiver interessado, pode ignorar esta mensagem.", diff --git a/app/config/locale/translations/ro.json b/app/config/locale/translations/ro.json index 5def77fa61..6af6be8e38 100644 --- a/app/config/locale/translations/ro.json +++ b/app/config/locale/translations/ro.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Arta de a fi înţelept este arta de a intui ce trebuie trecut cu vederea.\"", "settings.locale": "ro", "settings.direction": "ltr", - "emails.sender": "%s Echipa", + "emails.sender": "{{project}} Echipa", "emails.verification.subject": "Verificare cont", "emails.verification.hello": "Bună ziua, {{user}},", "emails.verification.body": "Click pe acest link pentru a valida adresa de email.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Mulțumim,", "emails.recovery.buttonText": "Resetează parola", "emails.recovery.signature": "Echipa {{project}}", - "emails.invitation.subject": "Invitatie catre %s Echipa la %s", + "emails.invitation.subject": "Invitatie catre {{team}} Echipa la {{project}}", "emails.invitation.hello": "Bună ziua,", "emails.invitation.body": "Acest email a fost trimis pentru că {{owner}} a vrut ca tu să devii membru al echipei {{team}} la {{project}}.", "emails.invitation.footer": "Dacă nu esti interesat, poți ignora acest email.", diff --git a/app/config/locale/translations/ru.json b/app/config/locale/translations/ru.json index 322404abd6..61ff4f94b3 100644 --- a/app/config/locale/translations/ru.json +++ b/app/config/locale/translations/ru.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Искусство быть мудрым — это искусство знать, чем можно пренебречь.\"", "settings.locale": "ru", "settings.direction": "ltr", - "emails.sender": "Команда %s", + "emails.sender": "Команда {{project}}", "emails.verification.subject": "Верификация аккаунта", "emails.verification.hello": "Здравствуйте, {{user}},", "emails.verification.body": "Перейдите по ссылке, чтобы подтвердить свой адрес электронной почты.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Спасибо,", "emails.recovery.buttonText": "Сбросить пароль", "emails.recovery.signature": "команда {{project}}", - "emails.invitation.subject": "Приглашение в команду %s по проекту %s", + "emails.invitation.subject": "Приглашение в команду {{team}} по проекту {{project}}", "emails.invitation.hello": "Здравствуйте,", "emails.invitation.body": "Это письмо отправлено вам, потому что {{owner}} приглашает стать членом команды {{team}} в проекте {{project}}.", "emails.invitation.footer": "Если вы не заинтересованы, проигнорируйте это сообщение.", diff --git a/app/config/locale/translations/sa.json b/app/config/locale/translations/sa.json index 36025af90c..6bd7c903d3 100644 --- a/app/config/locale/translations/sa.json +++ b/app/config/locale/translations/sa.json @@ -2,7 +2,7 @@ "settings.inspire": "\"किं हेयमित्यस्य ज्ञानमेव ज्ञानिलक्षणम्‌।\"", "settings.locale": "sa", "settings.direction": "ltr", - "emails.sender": "%s गणः", + "emails.sender": "{{project}} गणः", "emails.verification.subject": "पञ्जिकानिर्णायनम्‌", "emails.verification.hello": "अयि {{user}},", "emails.verification.body": "ई-पत्रनिर्णायनार्थमिदं संयोगसूत्रमनुसरतु।", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "धन्यवादः,", "emails.recovery.buttonText": "गुप्तशब्दं पुनः स्थापित करें", "emails.recovery.signature": "{{project}} गणः", - "emails.invitation.subject": "गणस्य आमन्त्रणम्‌ %s इति %s", + "emails.invitation.subject": "गणस्य आमन्त्रणम्‌ {{team}} इति {{project}}", "emails.invitation.hello": "अयि भो,", "emails.invitation.body": "{{owner}} {{team}} गणे {{project}} मध्ये भवद्योगदानमच्छितीति हेतोः पत्रमदिं भवत्सकाशं प्रेषतिम्।", "emails.invitation.footer": "यदि भवदनिच्छा तर्हि वात्र्तामिमामुपेक्षताम्‌।", diff --git a/app/config/locale/translations/sd.json b/app/config/locale/translations/sd.json index c3371903c4..d862a7d29c 100644 --- a/app/config/locale/translations/sd.json +++ b/app/config/locale/translations/sd.json @@ -2,7 +2,7 @@ "settings.inspire": "\"سمجھدار ھجڻ جو فن آھي اھو .اڻڻاڻڻ جو فن جيڪو نظر انداز ڪجي.\"", "settings.locale": "sd", "settings.direction": "ltr", - "emails.sender": "%s ٽيم", + "emails.sender": "{{project}} ٽيم", "emails.verification.subject": " اڪائونٽ جي تصديق", "emails.verification.hello": "سلام {{user}},", "emails.verification.body": "پنھنجي اي ميل ايڊريس جي تصديق ڪرڻ لاءِ ھن لنڪ تي عمل ڪريو.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "مهرباني,", "emails.recovery.buttonText": "پاسورڊ ري سيٽ ڪريو", "emails.recovery.signature": "{{project}} ٽيم", - "emails.invitation.subject": "%s ٽيم %s تيجي دعوت", + "emails.invitation.subject": "{{team}} ٽيم {{project}} تيجي دعوت", "emails.invitation.hello": "هيلو,", "emails.invitation.body": "ھي اي ميل توھان ڏانھن موڪليو ويو آھي {اڪاڻ ته {{owner}} توھان کي دعوت ڏيڻ چاھي ٿو ته توھان {{team}} ٽيم جو ميمبر بڻجي {{project}} تي.", "emails.invitation.footer": "جيڪڏھن توھان دلچسپي نٿا رکو ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "هن ای میل لاءِ سیکيورٽي جملو {{phrase}} آھي. توهان هن ای میل تي اعتماد ڪري سگهو ٿا جيڪڏهن هن جملو لاڳو ٿيندڙ جملي سان ميل کاندي.", "emails.otpSession.thanks": "مهرباني,", "emails.otpSession.signature": "پروجيڪٽ جي ٽيم", - "emails.certificate.subject": "%s لاءِ سند جو ناکامی", + "emails.certificate.subject": "{{domain}} لاءِ سند جو ناکامی", "emails.certificate.hello": "هيلو,", "emails.certificate.body": "توهان جي ڊومين '{{domain}}' لاءِ سرٽيفڪيٽ ٺاهڻ جو نه ٿي سگهيو. هي ڪوشش نمبر {{attempt}} آهي، ۽ ناڪامي جو سبب ٿيو: {{error}}", "emails.certificate.footer": "توهان جو اڳيون سرٽيفڪيٽ اولهو فئيلر جي ݙينهن کان ٣٠ ݙينهن لاءِ ماني ويندو. اسان ان جي چھان بني جي بھرپور خواهش ڪنداسين، نہ ته توهان جو ݙومين بغير ڪوري SSL ڪميونڪيشن آڻي ويندي.", diff --git a/app/config/locale/translations/si.json b/app/config/locale/translations/si.json index 03415c3c2d..7461376428 100644 --- a/app/config/locale/translations/si.json +++ b/app/config/locale/translations/si.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ප්‍රඥාවන්ත වීමේ කලාව යනු නොසලකා හැරිය යුතු දේ දැන ගැනීමේ කලාවයි.\"", "settings.locale": "si", "settings.direction": "ltr", - "emails.sender": "%s කණ්ඩායම", + "emails.sender": "{{project}} කණ්ඩායම", "emails.verification.subject": "ගිණුම් සත්‍යාපනය", "emails.verification.hello": "හේයි {{user}},", "emails.verification.body": "ඔබගේ විද්‍යුත් තැපැල් ලිපිනය සත්‍යාපනය කිරීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ස්තුතියි,", "emails.recovery.buttonText": "මුරපදය යළි පිහිටුවන්න", "emails.recovery.signature": "{{project}} කණ්ඩායම", - "emails.invitation.subject": "%s කණ්ඩායමට ආරාධනා %s හි", + "emails.invitation.subject": "{{team}} කණ්ඩායමට ආරාධනා {{project}} හි", "emails.invitation.hello": "ආයුබෝවන්,", "emails.invitation.body": "මෙම තැපැල් ඔබට එව්වේ, {{owner}} හට {{project}} හි {{team}} කණ්ඩායමේ සාමාජිකයෙකු වීමට ඔබට ආරාධනා කිරීමට අවශ්‍ය වූ බැවිනි.", "emails.invitation.footer": "ඔබ උනන්දුවක් නොදක්වන්නේ නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", diff --git a/app/config/locale/translations/sk.json b/app/config/locale/translations/sk.json index 9fe7a39619..ee14066aef 100644 --- a/app/config/locale/translations/sk.json +++ b/app/config/locale/translations/sk.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Umenie múdrosti je umenie vedieť, čo prehliadnuť.\"", "settings.locale": "sk", "settings.direction": "ltr", - "emails.sender": "%s Tím", + "emails.sender": "{{project}} Tím", "emails.verification.subject": "Overenie účtu", "emails.verification.hello": "Ahoj {{user}},", "emails.verification.body": "Použi tento link pre overenie svojej emailovej adresy.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Ďakujeme,", "emails.recovery.buttonText": "Obnoviť heslo", "emails.recovery.signature": "{{project}} tím", - "emails.invitation.subject": "Pozvánka do %s Tímu v %s", + "emails.invitation.subject": "Pozvánka do {{team}} Tímu v {{project}}", "emails.invitation.hello": "Ahoj,", "emails.invitation.body": "Tento email ti bol zaslaný, pretože {{owner}} ťa pozval, aby si sa stal členom {{team}} tímu v projekte {{project}}.", "emails.invitation.footer": "Ak nemáš záujem, môžeš túto správu ignorovať.", diff --git a/app/config/locale/translations/sl.json b/app/config/locale/translations/sl.json index 23efd4c675..9d441ba6c9 100644 --- a/app/config/locale/translations/sl.json +++ b/app/config/locale/translations/sl.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Srčika modrosti je umetnost védenja, kaj spregledati.\"", "settings.locale": "sl", "settings.direction": "ltr", - "emails.sender": "%s Ekipa", + "emails.sender": "{{project}} Ekipa", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/sn.json b/app/config/locale/translations/sn.json index 29cb79142c..7c088f8b38 100644 --- a/app/config/locale/translations/sn.json +++ b/app/config/locale/translations/sn.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Unyanzvi hwekuchenjera kuziva zvekufuratira.\"", "settings.locale": "sn", "settings.direction": "ltr", - "emails.sender": "Chikwata che%s", + "emails.sender": "Chikwata che{{project}}", "emails.verification.subject": "Kuratidzi kuti ndiwe muridzi weakaundi", "emails.verification.hello": "Hesi {{user}},", "emails.verification.body": "Tevedza chinongedzo ichi kuti uratidze kuti kero iyi ndeyako.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Ndatenda,", "emails.recovery.buttonText": "Gadzirisa password", "emails.recovery.signature": "Chikwata che{{project}}", - "emails.invitation.subject": "Kukokwa kuchikwata che%s ku%s", + "emails.invitation.subject": "Kukokwa kuchikwata che{{team}} ku{{project}}", "emails.invitation.hello": "Mhoro,", "emails.invitation.body": "Tsamba iyi yatumirwa kwauri nekuti {{owner}} anga achida kuti uve nhengo yechikwata che{{team}} pachirongwa che{{project}}.", "emails.invitation.footer": "Kana usiri kufarira kuve nhengo yechikwata ichi, unogona kufuratira meseji iyi.", diff --git a/app/config/locale/translations/sq.json b/app/config/locale/translations/sq.json index 39e6aa0d7c..1e8eede0f5 100644 --- a/app/config/locale/translations/sq.json +++ b/app/config/locale/translations/sq.json @@ -2,7 +2,7 @@ "settings.inspire": "\"The art of being wise is the art of knowing what to overlook.\"", "settings.locale": "sq", "settings.direction": "ltr", - "emails.sender": "Grup %s", + "emails.sender": "Grup {{project}}", "emails.verification.subject": "", "emails.verification.hello": ",", "emails.verification.body": "", diff --git a/app/config/locale/translations/sv.json b/app/config/locale/translations/sv.json index 6c6ebf6d16..4751e2ad65 100644 --- a/app/config/locale/translations/sv.json +++ b/app/config/locale/translations/sv.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Vishet är konsten att förstå vad man ska förbise.\"", "settings.locale": "sv", "settings.direction": "ltr", - "emails.sender": "%s-teamet", + "emails.sender": "{{project}}-teamet", "emails.verification.subject": "Verifiera konto", "emails.verification.hello": "Hej {{user}},", "emails.verification.body": "Klicka på denna länk för att verifiera din email", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Tack,", "emails.recovery.buttonText": "Återställ lösenord", "emails.recovery.signature": "{{project}} teamet", - "emails.invitation.subject": "Inbjudan till %s teamet på %s", + "emails.invitation.subject": "Inbjudan till {{team}} teamet på {{project}}", "emails.invitation.hello": "Hej,", "emails.invitation.body": "Detta mail skickades till dig eftersom {{owner}} ville bjuda in dig att bli medlem i teamet {{team}} på {{project}}.", "emails.invitation.footer": "Om du inte är intresserad kan du ignorera detta mail.", diff --git a/app/config/locale/translations/ta.json b/app/config/locale/translations/ta.json index 32e7a5d79d..54ecc2436d 100644 --- a/app/config/locale/translations/ta.json +++ b/app/config/locale/translations/ta.json @@ -2,7 +2,7 @@ "settings.inspire": "\"புத்திசாலித்தனம் என்னும் கலை என்பது எதனை புறக்கணிக்க வேண்டும் என அறியும் கலையாகும்.\"", "settings.locale": "ta", "settings.direction": "ltr", - "emails.sender": "%s குழு", + "emails.sender": "{{project}} குழு", "emails.verification.subject": "கணக்கு சரிபார்ப்பு", "emails.verification.hello": "ஏய் {{user}},", "emails.verification.body": "உங்கள் மின்னஞ்சல் முகவரியைச் சரிபார்க்க இந்த இணைப்பைப் பின்தொடரவும்.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "நன்றி,", "emails.recovery.buttonText": "கடவுச்சொல்லை மீட்டமைக்கவும்", "emails.recovery.signature": "{{project}} குழு", - "emails.invitation.subject": "அழைப்பிதழ் %s குழு %s ", + "emails.invitation.subject": "அழைப்பிதழ் {{team}} குழு {{project}} ", "emails.invitation.hello": "வணக்கம்,", "emails.invitation.body": "{{project}} இல் {{team}} குழுவில் உறுப்பினராக உங்களை {{owner}} அழைக்க விரும்புவதால், இந்த அஞ்சல் உங்களுக்கு அனுப்பப்பட்டது.", "emails.invitation.footer": "உங்களுக்கு ஆர்வம் இல்லை என்றால், இந்த செய்தியை நீங்கள் புறக்கணிக்கலாம்.", diff --git a/app/config/locale/translations/te.json b/app/config/locale/translations/te.json index e9d7574675..74713ef47e 100644 --- a/app/config/locale/translations/te.json +++ b/app/config/locale/translations/te.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ఏది విస్మరించాలో తెలుసుకోవడమే తెలివైన వ్యక్తి యొక్క కళ.\"", "settings.locale": "te", "settings.direction": "ltr", - "emails.sender": "%s జట్టు", + "emails.sender": "{{project}} జట్టు", "emails.verification.subject": "ఖాతా ధృవీకరణ", "emails.verification.hello": "నమస్కారము {{user}},", "emails.verification.body": "ఈ లింక్ ద్వారా ఇమెయిల్ ని ధృవీకరించండి", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ధన్యవాదాల,", "emails.recovery.buttonText": "పాస్‌వర్డ్‌ను రీసెట్ చేయండి", "emails.recovery.signature": "{{project}} జట్", - "emails.invitation.subject": "%s వద్ద %s బృందానికి ఆహ్వానం", + "emails.invitation.subject": "{{team}} వద్ద {{project}} బృందానికి ఆహ్వానం", "emails.invitation.hello": "నమస్కారమ,", "emails.invitation.body": "{{owner}} మిమ్మల్ని {{project}} లో {{team}} బృందంలో సభ్యునిగా ఉండమని ఆహ్వానించాలనుకుంటున్నందున ఈ మెయిల్ మీకు పంపబడింది.", "emails.invitation.footer": "మీకు ఆసక్తి లేకుంటే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు.", diff --git a/app/config/locale/translations/th.json b/app/config/locale/translations/th.json index 91e7dff7f6..2d27a9eb4d 100644 --- a/app/config/locale/translations/th.json +++ b/app/config/locale/translations/th.json @@ -2,7 +2,7 @@ "settings.inspire": "\"ศิลปะของการมีปัญญา คือการตระหนักได้ว่าควรจะมองข้ามเรื่องอะไร\"", "settings.locale": "th", "settings.direction": "ltr", - "emails.sender": "ทีม %s", + "emails.sender": "ทีม {{project}}", "emails.verification.subject": "การยืนยันบัญชีผู้ใช้", "emails.verification.hello": "เรียนคุณ {{user}}", "emails.verification.body": "กดเข้าไปที่ลิงก์นี้เพื่อยืนยันอีเมลของท่าน", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "ขอบคุณ", "emails.recovery.buttonText": "รีเซ็ตรหัสผ่าน", "emails.recovery.signature": "ทีม {{project}}", - "emails.invitation.subject": "เรียนเชิญเข้าร่วม ทีม %s จากโปรเจกต์ %s", + "emails.invitation.subject": "เรียนเชิญเข้าร่วม ทีม {{team}} จากโปรเจกต์ {{project}}", "emails.invitation.hello": "สวัสดี", "emails.invitation.body": "ท่านได้รับอีเมลฉบับนี้เนื่องจาก {{owner}} ต้องการที่จะเชิญชวนคุณเข้าร่วมเป็นส่วนหนึ่งของ ทีม {{team}} จากโปรเจกต์ {{project}}", "emails.invitation.footer": "หากท่านไม่ได้สนใจที่จะเข้าร่วม ท่านสามารถเพิกเฉยข้อความนี้ได้", diff --git a/app/config/locale/translations/tl.json b/app/config/locale/translations/tl.json index af018bf567..51190a6d32 100644 --- a/app/config/locale/translations/tl.json +++ b/app/config/locale/translations/tl.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Ang sining ng pagiging matalino ay ang sining ng pag-alam kung ano ang dapat kaligtaan.\"", "settings.locale": "tl", "settings.direction": "ltr", - "emails.sender": "Pangkat ng %s", + "emails.sender": "Pangkat ng {{project}}", "emails.verification.subject": "Pagpapatunay ng account", "emails.verification.hello": "Kamusta {{user}},", "emails.verification.body": "Sundin ang link na ito upang ma-verify ang iyong email address.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Salamat,", "emails.recovery.buttonText": "I-reset ang password", "emails.recovery.signature": "Pangkat ng {{project}}", - "emails.invitation.subject": "Imbitasyon para sa Pangkat %s sa %s", + "emails.invitation.subject": "Imbitasyon para sa Pangkat {{team}} sa {{project}}", "emails.invitation.hello": "Kamusta,", "emails.invitation.body": "Ipinadala sa iyo ang mail na ito dahil gusto kang imbitahan ni {{owner}} na maging miyembro ng Pangkat {{team}} sa ilalim ng proyektong {{project}}.", "emails.invitation.footer": "Kung ikaw ay hindi interesado, maaari mong balewalain ang mensaheng ito.", diff --git a/app/config/locale/translations/tr.json b/app/config/locale/translations/tr.json index 5fd2447d2b..f6cd6d8687 100644 --- a/app/config/locale/translations/tr.json +++ b/app/config/locale/translations/tr.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Bilge olma sanatı, neyi ihmal edeceğini bilme sanatıdır.\"", "settings.locale": "tr", "settings.direction": "ltr", - "emails.sender": "%s Takımı", + "emails.sender": "{{project}} Takımı", "emails.verification.subject": "Hesabını Doğrula", "emails.verification.hello": "Merhaba {{user}},", "emails.verification.body": "Eposta adresini doğrulamak için bu bağlantıyı kullanın.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Teşekkürler,", "emails.recovery.buttonText": "Şifreyi sıfırla", "emails.recovery.signature": "{{project}} takımı", - "emails.invitation.subject": "%s üzerinde %s Takımına Davet", + "emails.invitation.subject": "{{team}} üzerinde {{project}} Takımına Davet", "emails.invitation.hello": "Merhaba,", "emails.invitation.body": "Bu epostayı aldınız, çünkü {{owner}} sizi {{project}} üzerinde {{team}} takımının üyesi olmaya davet etti.", "emails.invitation.footer": "Eğer ilgilenmiyorsanız devam etmeyin.", diff --git a/app/config/locale/translations/uk.json b/app/config/locale/translations/uk.json index b7b2c2905d..057c1dc5f4 100644 --- a/app/config/locale/translations/uk.json +++ b/app/config/locale/translations/uk.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Мистецтво бути мудрим - це мистецтво знати, чим можна знехтувати\"", "settings.locale": "uk", "settings.direction": "ltr", - "emails.sender": "Команда %s", + "emails.sender": "Команда {{project}}", "emails.verification.subject": "Верифікація акаунта", "emails.verification.hello": "Вітаємо, {{user}},", "emails.verification.body": "Перейдіть за цим посиланням, щоб підтвердити свою електронну адресу.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Дякуємо,", "emails.recovery.buttonText": "Скинути пароль", "emails.recovery.signature": "команда {{project}}", - "emails.invitation.subject": "Запрошення до %s Команди у %s", + "emails.invitation.subject": "Запрошення до {{team}} Команди у {{project}}", "emails.invitation.hello": "Вітаємо,", "emails.invitation.body": "Цей лист був надісланий вам тому що {{owner}} запрошує вас стати членом команди {{team}} у проекті {{project}}.", "emails.invitation.footer": "Якщо ви не зацікавлені, проігноруйте це повідомлення.", diff --git a/app/config/locale/translations/ur.json b/app/config/locale/translations/ur.json index f8f0284bcf..0c2283d1e4 100644 --- a/app/config/locale/translations/ur.json +++ b/app/config/locale/translations/ur.json @@ -2,7 +2,7 @@ "settings.inspire": "\"عقلمند ہونے کا فن یہ جاننے کا فن ہے کہ کیا نظرانداز کیا جائے۔\"", "settings.locale": "ur", "settings.direction": "rtl", - "emails.sender": "%s ٹیم", + "emails.sender": "{{project}} ٹیم", "emails.verification.subject": "اکاؤنٹ کی تصدیق", "emails.verification.hello": "خوش آمدید {{user}}،", "emails.verification.body": "براہ کرم اپنے ای میل کی تصدیق کے لیے درج ذیل لنک پر عمل کریں۔", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "شکریہ،", "emails.recovery.buttonText": "پاس ورڈ ری سیٹ کریں", "emails.recovery.signature": "ٹیم۔ {{project}}", - "emails.invitation.subject": "%s پر %s ٹیم کو دعوت", + "emails.invitation.subject": "{{team}} پر {{project}} ٹیم کو دعوت", "emails.invitation.hello": "خوش آمدید،", "emails.invitation.body": "یہ پیغام آپ کو اس لیے بھیجا گیا تھا کہ {{owner}} نے آپ کو {{project}} میں {{team}} ٹیم کا رکن بننے کی دعوت بھیجی", "emails.invitation.footer": "اگر آپ دلچسپی نہیں رکھتے تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", diff --git a/app/config/locale/translations/vi.json b/app/config/locale/translations/vi.json index 5ed045ce19..4a6172d479 100644 --- a/app/config/locale/translations/vi.json +++ b/app/config/locale/translations/vi.json @@ -2,7 +2,7 @@ "settings.inspire": "\"Nghệ thuật khôn ngoan là nghệ thuật biết những gì cần bỏ qua.\"", "settings.locale": "vi", "settings.direction": "ltr", - "emails.sender": "Nhóm %s", + "emails.sender": "Nhóm {{project}}", "emails.verification.subject": "Xác minh tài khoản", "emails.verification.hello": "Chào {{user}}", "emails.verification.body": "Nhấn vào đường dẫn sau để xác minh địa chỉ email của bạn.", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "Cảm ơn", "emails.recovery.buttonText": "Đặt lại mật khẩu", "emails.recovery.signature": "Nhóm {{project}}", - "emails.invitation.subject": "Lời mời tham gia nhóm %s tại %s", + "emails.invitation.subject": "Lời mời tham gia nhóm {{team}} tại {{project}}", "emails.invitation.hello": "Xin chào", "emails.invitation.body": "Email này được gửi cho bạn vì {{owner}} muốn mời bạn trở thành một thành viên của nhóm {{team}} tại {{project}}.", "emails.invitation.footer": "Nếu bạn không quan tâm, bạn có thể bỏ qua email này.", diff --git a/app/config/locale/translations/zh-cn.json b/app/config/locale/translations/zh-cn.json index b9319badfc..5bda45728d 100644 --- a/app/config/locale/translations/zh-cn.json +++ b/app/config/locale/translations/zh-cn.json @@ -2,7 +2,7 @@ "settings.inspire": "\"懂得取舍,方显睿智。\"", "settings.locale": "zh", "settings.direction": "ltr", - "emails.sender": "%s 小组", + "emails.sender": "{{project}} 小组", "emails.verification.subject": "帐户验证", "emails.verification.hello": "你好 {{user}}、", "emails.verification.body": "点此链接验证您的电子邮件地址。", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "谢谢、", "emails.recovery.buttonText": "重置密码", "emails.recovery.signature": "{{project}} 团队", - "emails.invitation.subject": "邀请 %s 团队在 %s", + "emails.invitation.subject": "邀请 {{team}} 团队在 {{project}}", "emails.invitation.hello": "你好、", "emails.invitation.body": "这封邮件发送给您是因为 {{owner}} 想邀请您成为 {{team}} 团队在 {{project}}.", "emails.invitation.footer": "如果您不感兴趣,可以忽略此消息。", diff --git a/app/config/locale/translations/zh-tw.json b/app/config/locale/translations/zh-tw.json index 0c2ba309d9..3c7df3e668 100644 --- a/app/config/locale/translations/zh-tw.json +++ b/app/config/locale/translations/zh-tw.json @@ -2,7 +2,7 @@ "settings.inspire": "\"懂得取捨,方顯睿智。\"", "settings.locale": "zh-tw", "settings.direction": "ltr", - "emails.sender": "%s 小組", + "emails.sender": "{{project}} 小組", "emails.verification.subject": "帳戶驗證", "emails.verification.hello": "嗨 {{user}}、", "emails.verification.body": "按照此連結驗證您的電子郵件地址。", @@ -21,7 +21,7 @@ "emails.recovery.thanks": "謝謝、", "emails.recovery.buttonText": "重設密碼", "emails.recovery.signature": "{{project}} 團隊", - "emails.invitation.subject": "邀請 %s 團隊在 %s", + "emails.invitation.subject": "邀請 {{team}} 團隊在 {{project}}", "emails.invitation.hello": "您好、", "emails.invitation.body": "發送這封郵件給您是因為 {{owner}} 想邀請您成為 {{team}} 團隊在 {{project}}。", "emails.invitation.footer": "如果您不感興趣,可以忽略此消息。", diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index fe411d53ab..2873d7c69b 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -658,7 +658,7 @@ App::post('/v1/teams/:teamId/memberships') $body = $locale->getText("emails.invitation.body"); $preview = $locale->getText("emails.invitation.preview"); - $subject = \sprintf($locale->getText("emails.invitation.subject"), $team->getAttribute('name'), $projectName); + $subject = $locale->getText("emails.invitation.subject"); $customTemplate = $project->getAttribute('templates', [])['email.invitation-' . $locale->default] ?? []; $message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-inner-base.tpl'); diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index a3fad056bf..793683a094 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -393,10 +393,11 @@ class Certificates extends Action $emailVariables = [ 'direction' => $locale->getText('settings.direction'), + 'domain' => $domain, ]; - $subject = \sprintf($locale->getText("emails.certificate.subject"), $domain); - $preview = \sprintf($locale->getText("emails.certificate.preview"), $domain); + $subject = $locale->getText("emails.certificate.subject"); + $preview = $locale->getText("emails.certificate.preview"); $queueForMails ->setSubject($subject) From 7360dd68e015b78797c11ef3d7bbc2040d7aa01a Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 27 Aug 2025 17:41:52 +0530 Subject: [PATCH 21/75] updated tests --- tests/e2e/Services/Databases/Legacy/DatabasesBase.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index c740ebb194..0485331613 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6453,13 +6453,13 @@ trait DatabasesBase 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ]), [ - 'required' => true, + 'required' => false, 'default' => json_encode([[0, 0], [1, 1]]), ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(true, $response['body']['required']); - $this->assertEquals('[[0, 0], [1, 1]]', $response['body']['default']); + $this->assertEquals(false, $response['body']['required']); + $this->assertEquals([[0, 0], [1, 1]], $response['body']['default']); // Test 3: Update polygon attribute - change key name $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/polygon/area', array_merge([ @@ -6482,11 +6482,11 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ]), [ 'default' => json_encode([0, 0]), - 'required' => true + 'required' => false ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals('[0, 0]', $response['body']['default']); + $this->assertEquals([0, 0], $response['body']['default']); // Test 5: Verify attribute updates by creating a document $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ From 3a5878890dd2f80d97d9cef4abf946fa8772e45c Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Wed, 27 Aug 2025 18:02:59 +0530 Subject: [PATCH 22/75] Fix language specific things --- app/config/locale/translations/bh.json | 2 +- app/config/locale/translations/kn.json | 2 +- app/config/locale/translations/ml.json | 2 +- app/config/locale/translations/or.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config/locale/translations/bh.json b/app/config/locale/translations/bh.json index 7067795661..8543e4f241 100644 --- a/app/config/locale/translations/bh.json +++ b/app/config/locale/translations/bh.json @@ -245,7 +245,7 @@ "emails.otpSession.securityPhrase": "एही ईमेल खातिर सुरक्षा वाक्य {{phrase}} हऽ। अगर ई वाक्य साइन इन कइला के समय देखावल गेल वाक्य से मेल खाता, त एह ईमेल पर भरोसा कर सकैत छी।", "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} टीम", - "emails.certificate.subject": "{{domain}} लेल प्रमाणपत्र असफलта", + "emails.certificate.subject": "{{domain}} लेल प्रमाणपत्र असफलता", "emails.certificate.hello": "नमस्ते,", "emails.certificate.body": "आपके डोमेन '{{domain}}' के लिए प्रमाणपत्र नहीं बनाया जा सका। ई प्रयास संख्या {{attempt}} है, और ई असफलता के कारण रहे: {{error}}", "emails.certificate.footer": "तोहार पिछलका प्रमाणपत्र पहिल असफलता से 30 दिन धरी मान्य होईत। हम बहुत जोर देके सलाह देतानी कि एह मामला के जांच करीं, नहीं त तोहार डोमेन बिना कोनो मान्य SSL संवाद के रहि जाईत।", diff --git a/app/config/locale/translations/kn.json b/app/config/locale/translations/kn.json index 4d69b6c0dc..ede9d020b8 100644 --- a/app/config/locale/translations/kn.json +++ b/app/config/locale/translations/kn.json @@ -1,6 +1,6 @@ { "settings.inspire": "\"ಬುದ್ಧಿವಂತಿಕೆಯ ಕಲೆ ಏನು ಕಡೆಗಣಿಸಬೇಕೆಂದು ತಿಳಿಯುವ ಕಲೆ.\"", - "settings.locale": "ka", + "settings.locale": "kn", "settings.direction": "ltr", "emails.sender": "{{project}} ತಂಡ", "emails.verification.subject": "ಖಾತೆ ಪರಿಶೀಲನೆ", diff --git a/app/config/locale/translations/ml.json b/app/config/locale/translations/ml.json index 720f568879..064df28413 100644 --- a/app/config/locale/translations/ml.json +++ b/app/config/locale/translations/ml.json @@ -21,7 +21,7 @@ "emails.recovery.thanks": "നന്ദി,", "emails.recovery.buttonText": "പാസ്‌വേഡ് റീസെറ്റ് ചെയ്യുക", "emails.recovery.signature": "{{project}} ടീം", - "emails.invitation.subject": "{{team}} -ലെ {{project}} ടീമിലേക്കുള്ള ക്ഷണം", + "emails.invitation.subject": "{{project}} -ലെ {{team}} ടീമിലേക്കുള്ള ക്ഷണം", "emails.invitation.hello": "നമസ്കാരം,", "emails.invitation.body": "നിങ്ങളെ {{project}} -ലെ {{team}} ടീമിലെ അംഗമാകുവാന്‍ ക്ഷണിക്കാൻ {{owner}} ആഗ്രഹിക്കുന്നതിനാലാണ് ഈ മെയിൽ നിങ്ങൾക്ക് അയക്കുന്നത്.", "emails.invitation.footer": "നിങ്ങൾക്ക് താൽപ്പര്യമില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", diff --git a/app/config/locale/translations/or.json b/app/config/locale/translations/or.json index c565804e22..73f47881c0 100644 --- a/app/config/locale/translations/or.json +++ b/app/config/locale/translations/or.json @@ -23,7 +23,7 @@ "emails.recovery.signature": "{{project}} ଦଳ", "emails.invitation.subject": "{{team}} ରେ {{project}} ଦଳକୁ ନିମନ୍ତ୍ରଣ |", "emails.invitation.hello": "ନମସ୍କାର,", - "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", + "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project}} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", "emails.invitation.footer": "ଯଦି ଆପଣ ଆଗ୍ରହୀ ନୁହଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଅଣଦେଖା କରିପାରିବେ |", "emails.invitation.thanks": "ଧନ୍ୟବାଦ,", "emails.invitation.buttonText": "{{team}} ପାଇଁ ଆମନ୍ତ୍ରଣ ଗ୍ରହଣ କରନ୍ତୁ", From 45518cead83494783709b9004ecb3ecd172bfe7f Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Wed, 27 Aug 2025 18:31:24 +0530 Subject: [PATCH 23/75] Fix logo and links in certificate failure email --- src/Appwrite/Platform/Workers/Certificates.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 793683a094..2138e440b6 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -381,19 +381,18 @@ class Certificates extends Action $template->setParam('{{error}}', \nl2br($errorMessage)); $template->setParam('{{attempts}}', $attempt); - $template->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL); - $template->setParam('{{accentColor}}', $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR); - $template->setParam('{{twitterUrl}}', $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER); - $template->setParam('{{discordUrl}}', $plan['discordUrl'] ?? APP_SOCIAL_DISCORD); - $template->setParam('{{githubUrl}}', $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE); - $template->setParam('{{termsUrl}}', $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL); - $template->setParam('{{privacyUrl}}', $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL); - $body = $template->render(); $emailVariables = [ 'direction' => $locale->getText('settings.direction'), 'domain' => $domain, + 'logoUrl' => $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL, + 'accentColor' => $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR, + 'twitterUrl' => $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER, + 'discordUrl' => $plan['discordUrl'] ?? APP_SOCIAL_DISCORD, + 'githubUrl' => $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE, + 'termsUrl' => $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL, + 'privacyUrl' => $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL, ]; $subject = $locale->getText("emails.certificate.subject"); From 5eb52d312b03c91546268ec4f0d6b98b85156f74 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Wed, 27 Aug 2025 20:05:27 +0530 Subject: [PATCH 24/75] Add previewUrl to vcs comment from vcs controller --- app/controllers/api/vcs.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 9271e87448..5541b99318 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -271,6 +271,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); $domain = ID::unique() . "." . $sitesDomain; $ruleId = md5($domain); + $previewRuleId = $ruleId; Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, @@ -362,6 +363,24 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } + if ($resource->getCollection() === 'sites' && !empty($latestCommentId) && !empty($previewRuleId)) { + try { + $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); + + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $previewUrl = !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : ''; + + if (!empty($previewUrl)) { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, $previewUrl); + $github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment()); + } + } catch (\Throwable $th) { + // Ignore, rule already exists; will be updated by builds worker + } + } + if (!empty($providerCommitHash) && $resource->getAttribute('providerSilentMode', false) === false) { $resourceName = $resource->getAttribute('name'); $projectName = $project->getAttribute('name'); From a737328bf038fb99197ba061a33897863c26f817 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Thu, 28 Aug 2025 12:22:55 +0530 Subject: [PATCH 25/75] Use branch url as preview url in comment --- app/controllers/api/vcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 5541b99318..85b63916d7 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -271,7 +271,6 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); $domain = ID::unique() . "." . $sitesDomain; $ruleId = md5($domain); - $previewRuleId = $ruleId; Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, @@ -304,6 +303,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); + $previewRuleId = $ruleId; try { Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ From f3204d25207bc67ead344836da4edeae026a953e Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Thu, 28 Aug 2025 17:51:37 +0530 Subject: [PATCH 26/75] Use branch domain in preview urls in builds worker --- .../Modules/Functions/Workers/Builds.php | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 9547a752ef..18c746e9cd 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1554,16 +1554,30 @@ class Builds extends Action default => throw new \Exception('Invalid resource type') }; - $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ - Query::equal("projectInternalId", [$project->getSequence()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentInternalId", [$deployment->getSequence()]), - ])); - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; $previewUrl = match($resource->getCollection()) { 'functions' => '', - 'sites' => !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : '', + 'sites' => (function () use ($deployment, $project, $dbForPlatform, $protocol, $resource) { + $providerBranch = $deployment->getAttribute('providerBranch', ''); + if (!empty($providerBranch)) { + $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + $branchPrefix = substr($providerBranch, 0, 16); + if (strlen($providerBranch) > 16) { + $remainingChars = substr($providerBranch, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; + $ruleId = md5($domain); + + $branchRule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $ruleId)); + + if (!empty($branchRule) && !$branchRule->isEmpty()) { + return "{$protocol}://" . $branchRule->getAttribute('domain', ''); + } + } + return ''; + })(), default => throw new \Exception('Invalid resource type') }; From 2f49722092aafa12581d250eaae70bec286bfc16 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Thu, 28 Aug 2025 19:17:07 +0530 Subject: [PATCH 27/75] Revert to use deployment preview --- app/controllers/api/vcs.php | 2 +- .../Modules/Functions/Workers/Builds.php | 28 +++++-------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 85b63916d7..5541b99318 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -271,6 +271,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); $domain = ID::unique() . "." . $sitesDomain; $ruleId = md5($domain); + $previewRuleId = $ruleId; Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, @@ -303,7 +304,6 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); - $previewRuleId = $ruleId; try { Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 18c746e9cd..9547a752ef 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -1554,30 +1554,16 @@ class Builds extends Action default => throw new \Exception('Invalid resource type') }; + $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ + Query::equal("projectInternalId", [$project->getSequence()]), + Query::equal("type", ["deployment"]), + Query::equal("deploymentInternalId", [$deployment->getSequence()]), + ])); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; $previewUrl = match($resource->getCollection()) { 'functions' => '', - 'sites' => (function () use ($deployment, $project, $dbForPlatform, $protocol, $resource) { - $providerBranch = $deployment->getAttribute('providerBranch', ''); - if (!empty($providerBranch)) { - $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); - $branchPrefix = substr($providerBranch, 0, 16); - if (strlen($providerBranch) > 16) { - $remainingChars = substr($providerBranch, 16); - $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); - } - $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); - $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; - $ruleId = md5($domain); - - $branchRule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $ruleId)); - - if (!empty($branchRule) && !$branchRule->isEmpty()) { - return "{$protocol}://" . $branchRule->getAttribute('domain', ''); - } - } - return ''; - })(), + 'sites' => !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : '', default => throw new \Exception('Invalid resource type') }; From 51b98b6976226ddeaf6ee46739c352c7c0e596e8 Mon Sep 17 00:00:00 2001 From: Veeresh <75656445+Veera-mulge@users.noreply.github.com> Date: Thu, 28 Aug 2025 21:13:29 +0530 Subject: [PATCH 28/75] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c210784737..375b1ad48c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -> We just announced a brand new TablesDB UI for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-appwrite-databases-new-ui) +> We just announced Opt-in relationship loading for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-opt-in-relationship-loading) > Appwrite Cloud is now Generally Available - [Learn more](https://appwrite.io/cloud-ga) From c96b6300daa54603518a7198873a457e9f1569c5 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 31 Aug 2025 12:39:32 +0300 Subject: [PATCH 29/75] Check audits --- src/Appwrite/Platform/Workers/Audits.php | 38 +++++++++++++++++++----- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 04b562a219..869ef7a285 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -18,7 +18,7 @@ use Utopia\System\System; class Audits extends Action { - protected const int BATCH_AGGREGATION_INTERVAL = 60; // in seconds + protected const int BATCH_AGGREGATION_INTERVAL = 10000; // in seconds private int $lastTriggeredTime = 0; @@ -40,6 +40,8 @@ class Audits extends Action */ public function __construct() { + Console::error('__construct Audits'); + $this ->desc('Audits worker') ->inject('message') @@ -71,6 +73,9 @@ class Audits extends Action Console::info('Aggregating audit logs'); + Console::error('project '.$project->getSequence()); + Console::error('lastTriggeredTime '.$this->lastTriggeredTime); + $event = $payload['event'] ?? ''; $auditPayload = ''; @@ -121,27 +126,46 @@ class Audits extends Action // Check if we should process the batch by checking both for the batch size and the elapsed time $batchSize = $this->getBatchSize(); + $batchSize = 3; + $logCount = array_reduce($this->logs, fn (int $current, $logs) => $current + count($logs['logs']), 0); $shouldProcessBatch = $logCount >= $batchSize; + + var_dump('$logCount'); + var_dump($logCount); + var_dump('$shouldProcessBatch 1'); + var_dump($shouldProcessBatch); + if (!$shouldProcessBatch && $logCount > 0) { $shouldProcessBatch = (\time() - $this->lastTriggeredTime) >= self::BATCH_AGGREGATION_INTERVAL; } + var_dump('$shouldProcessBatch 2'); + var_dump($shouldProcessBatch); + + var_dump($this->logs); + if (!$shouldProcessBatch) { return new NoCommit(); } - try { - foreach ($this->logs as $sequence => $projectLogs) { - $dbForProject = $getProjectDB($projectLogs['project']); + $logs = $this->logs; + $this->logs = []; + + try { + foreach ($logs as $projectLogs) { + /** + * @var $projectDocument Document + */ + $projectDocument = $projectLogs['project']; + $dbForProject = $getProjectDB($projectDocument); + + Console::log('Processing Project "'.$projectDocument->getSequence().'" batch with ' . count($projectLogs['logs']) . ' events'); - Console::log('Processing batch with ' . count($projectLogs['logs']) . ' events'); $audit = new Audit($dbForProject); $audit->logBatch($projectLogs['logs']); Console::success('Audit logs processed successfully'); - - unset($this->logs[$sequence]); } } catch (Throwable $e) { Console::error('Error processing audit logs: ' . $e->getMessage()); From dffbe2e4abb9d18c639005f7f9fe324b051d679a Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 31 Aug 2025 12:52:51 +0300 Subject: [PATCH 30/75] Check audits --- src/Appwrite/Platform/Workers/Audits.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 869ef7a285..966a17808f 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -158,10 +158,11 @@ class Audits extends Action * @var $projectDocument Document */ $projectDocument = $projectLogs['project']; - $dbForProject = $getProjectDB($projectDocument); Console::log('Processing Project "'.$projectDocument->getSequence().'" batch with ' . count($projectLogs['logs']) . ' events'); + $dbForProject = $getProjectDB($projectDocument); + $audit = new Audit($dbForProject); $audit->logBatch($projectLogs['logs']); @@ -170,7 +171,9 @@ class Audits extends Action } catch (Throwable $e) { Console::error('Error processing audit logs: ' . $e->getMessage()); } + $this->lastTriggeredTime = time(); + return new Commit(); } } From f4caa69840615004246fd20d18b13d2fff246f10 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 31 Aug 2025 13:07:31 +0300 Subject: [PATCH 31/75] Remove dbg --- src/Appwrite/Platform/Workers/Audits.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 966a17808f..d2cb55fe20 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -18,7 +18,7 @@ use Utopia\System\System; class Audits extends Action { - protected const int BATCH_AGGREGATION_INTERVAL = 10000; // in seconds + protected const int BATCH_AGGREGATION_INTERVAL = 60; // in seconds private int $lastTriggeredTime = 0; @@ -73,9 +73,6 @@ class Audits extends Action Console::info('Aggregating audit logs'); - Console::error('project '.$project->getSequence()); - Console::error('lastTriggeredTime '.$this->lastTriggeredTime); - $event = $payload['event'] ?? ''; $auditPayload = ''; @@ -126,25 +123,14 @@ class Audits extends Action // Check if we should process the batch by checking both for the batch size and the elapsed time $batchSize = $this->getBatchSize(); - $batchSize = 3; $logCount = array_reduce($this->logs, fn (int $current, $logs) => $current + count($logs['logs']), 0); $shouldProcessBatch = $logCount >= $batchSize; - var_dump('$logCount'); - var_dump($logCount); - var_dump('$shouldProcessBatch 1'); - var_dump($shouldProcessBatch); - if (!$shouldProcessBatch && $logCount > 0) { $shouldProcessBatch = (\time() - $this->lastTriggeredTime) >= self::BATCH_AGGREGATION_INTERVAL; } - var_dump('$shouldProcessBatch 2'); - var_dump($shouldProcessBatch); - - var_dump($this->logs); - if (!$shouldProcessBatch) { return new NoCommit(); } From 52141b825c7326d80887affa4861be75b7861eb1 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 31 Aug 2025 13:08:24 +0300 Subject: [PATCH 32/75] Remove dbg --- src/Appwrite/Platform/Workers/Audits.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index d2cb55fe20..e52ad613ed 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -40,8 +40,6 @@ class Audits extends Action */ public function __construct() { - Console::error('__construct Audits'); - $this ->desc('Audits worker') ->inject('message') From 97ce2bdc3a31823cfb315592fde3b3da0c0f5fff Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 31 Aug 2025 13:09:23 +0300 Subject: [PATCH 33/75] Lines --- src/Appwrite/Platform/Workers/Audits.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index e52ad613ed..6fa81c5772 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -121,10 +121,8 @@ class Audits extends Action // Check if we should process the batch by checking both for the batch size and the elapsed time $batchSize = $this->getBatchSize(); - $logCount = array_reduce($this->logs, fn (int $current, $logs) => $current + count($logs['logs']), 0); $shouldProcessBatch = $logCount >= $batchSize; - if (!$shouldProcessBatch && $logCount > 0) { $shouldProcessBatch = (\time() - $this->lastTriggeredTime) >= self::BATCH_AGGREGATION_INTERVAL; } From ad4e3be80c2a0b7003e5bb155776c9846f3b93e6 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 31 Aug 2025 13:10:04 +0300 Subject: [PATCH 34/75] Lines --- src/Appwrite/Platform/Workers/Audits.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 6fa81c5772..c99c5eafe4 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -153,9 +153,7 @@ class Audits extends Action } catch (Throwable $e) { Console::error('Error processing audit logs: ' . $e->getMessage()); } - $this->lastTriggeredTime = time(); - return new Commit(); } } From 043ca48f91e594017e55ec1548dacf0b4d2e462d Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Mon, 1 Sep 2025 11:27:57 +0530 Subject: [PATCH 35/75] updated response model and docs --- docs/references/databases/update-line-attribute.md | 1 + docs/references/databases/update-point-attribute.md | 1 + docs/references/databases/update-polygon-attribute.md | 1 + docs/references/tablesdb/create-line-column.md | 1 + docs/references/tablesdb/create-point-column.md | 1 + docs/references/tablesdb/create-polygon-column.md | 1 + docs/references/tablesdb/update-line-column.md | 1 + docs/references/tablesdb/update-point-column.md | 1 + docs/references/tablesdb/update-polygon-column.md | 1 + src/Appwrite/Utopia/Response/Model/AttributeLine.php | 2 +- src/Appwrite/Utopia/Response/Model/AttributePoint.php | 2 +- src/Appwrite/Utopia/Response/Model/AttributePolygon.php | 2 +- src/Appwrite/Utopia/Response/Model/ColumnLine.php | 2 +- src/Appwrite/Utopia/Response/Model/ColumnPoint.php | 2 +- src/Appwrite/Utopia/Response/Model/ColumnPolygon.php | 2 +- 15 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 docs/references/databases/update-line-attribute.md create mode 100644 docs/references/databases/update-point-attribute.md create mode 100644 docs/references/databases/update-polygon-attribute.md create mode 100644 docs/references/tablesdb/create-line-column.md create mode 100644 docs/references/tablesdb/create-point-column.md create mode 100644 docs/references/tablesdb/create-polygon-column.md create mode 100644 docs/references/tablesdb/update-line-column.md create mode 100644 docs/references/tablesdb/update-point-column.md create mode 100644 docs/references/tablesdb/update-polygon-column.md diff --git a/docs/references/databases/update-line-attribute.md b/docs/references/databases/update-line-attribute.md new file mode 100644 index 0000000000..b55d31c5f6 --- /dev/null +++ b/docs/references/databases/update-line-attribute.md @@ -0,0 +1 @@ +Update a line attribute. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/databases/update-point-attribute.md b/docs/references/databases/update-point-attribute.md new file mode 100644 index 0000000000..f40d18c6e5 --- /dev/null +++ b/docs/references/databases/update-point-attribute.md @@ -0,0 +1 @@ +Update a point attribute. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/databases/update-polygon-attribute.md b/docs/references/databases/update-polygon-attribute.md new file mode 100644 index 0000000000..0d9718e41e --- /dev/null +++ b/docs/references/databases/update-polygon-attribute.md @@ -0,0 +1 @@ +Update a polygon attribute. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/tablesdb/create-line-column.md b/docs/references/tablesdb/create-line-column.md new file mode 100644 index 0000000000..96f1509936 --- /dev/null +++ b/docs/references/tablesdb/create-line-column.md @@ -0,0 +1 @@ +Create a geometric line attribute. \ No newline at end of file diff --git a/docs/references/tablesdb/create-point-column.md b/docs/references/tablesdb/create-point-column.md new file mode 100644 index 0000000000..dd92ffc98e --- /dev/null +++ b/docs/references/tablesdb/create-point-column.md @@ -0,0 +1 @@ +Create a geometric point attribute. \ No newline at end of file diff --git a/docs/references/tablesdb/create-polygon-column.md b/docs/references/tablesdb/create-polygon-column.md new file mode 100644 index 0000000000..7cb3985ff7 --- /dev/null +++ b/docs/references/tablesdb/create-polygon-column.md @@ -0,0 +1 @@ +Create a geometric polygon attribute. \ No newline at end of file diff --git a/docs/references/tablesdb/update-line-column.md b/docs/references/tablesdb/update-line-column.md new file mode 100644 index 0000000000..1cd3b53d07 --- /dev/null +++ b/docs/references/tablesdb/update-line-column.md @@ -0,0 +1 @@ +Update a line column. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/tablesdb/update-point-column.md b/docs/references/tablesdb/update-point-column.md new file mode 100644 index 0000000000..251e6de260 --- /dev/null +++ b/docs/references/tablesdb/update-point-column.md @@ -0,0 +1 @@ +Update a point column. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/docs/references/tablesdb/update-polygon-column.md b/docs/references/tablesdb/update-polygon-column.md new file mode 100644 index 0000000000..fc46a223cf --- /dev/null +++ b/docs/references/tablesdb/update-polygon-column.md @@ -0,0 +1 @@ +Update a polygon column. Changing the `default` value will not update already existing documents. \ No newline at end of file diff --git a/src/Appwrite/Utopia/Response/Model/AttributeLine.php b/src/Appwrite/Utopia/Response/Model/AttributeLine.php index dce5b61978..ceebfc067d 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeLine.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeLine.php @@ -18,7 +18,7 @@ class AttributeLine extends Attribute 'example' => 'route', ]) ->addRule('type', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_STRING, 'description' => 'Attribute type.', 'default' => '', 'example' => 'linestring', diff --git a/src/Appwrite/Utopia/Response/Model/AttributePoint.php b/src/Appwrite/Utopia/Response/Model/AttributePoint.php index a79a1e7006..f93e5a8954 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePoint.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePoint.php @@ -18,7 +18,7 @@ class AttributePoint extends Attribute 'example' => 'location', ]) ->addRule('type', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_STRING, 'description' => 'Attribute type.', 'default' => '', 'example' => 'point', diff --git a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php index e4ed3e93f9..46e95e954e 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php @@ -18,7 +18,7 @@ class AttributePolygon extends Attribute 'example' => 'boundary', ]) ->addRule('type', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_STRING, 'description' => 'Attribute type.', 'default' => '', 'example' => 'polygon', diff --git a/src/Appwrite/Utopia/Response/Model/ColumnLine.php b/src/Appwrite/Utopia/Response/Model/ColumnLine.php index 2737924545..1e2c4d9bde 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnLine.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnLine.php @@ -18,7 +18,7 @@ class ColumnLine extends Column 'example' => 'route', ]) ->addRule('type', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_JSON, 'description' => 'Column type.', 'default' => '', 'example' => 'linestring', diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php index d1803e3cae..29d39e5678 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php @@ -24,7 +24,7 @@ class ColumnPoint extends Column 'example' => 'point', ]) ->addRule('default', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_JSON, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php index 487f98b695..e68baa65ad 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php @@ -24,7 +24,7 @@ class ColumnPolygon extends Column 'example' => 'polygon', ]) ->addRule('default', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_JSON, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, From bd8d6fdc59e43af2d3e6461e401b2713cf042c26 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 1 Sep 2025 18:35:12 +0300 Subject: [PATCH 36/75] Try catch inside --- src/Appwrite/Platform/Workers/Audits.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index c99c5eafe4..e8ae2f2168 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -134,25 +134,19 @@ class Audits extends Action $logs = $this->logs; $this->logs = []; - try { - foreach ($logs as $projectLogs) { - /** - * @var $projectDocument Document - */ + foreach ($logs as $projectLogs) { + try { $projectDocument = $projectLogs['project']; - - Console::log('Processing Project "'.$projectDocument->getSequence().'" batch with ' . count($projectLogs['logs']) . ' events'); - + Console::log('Processing Project "' . $projectDocument->getSequence() . '" batch with ' . count($projectLogs['logs']) . ' events'); $dbForProject = $getProjectDB($projectDocument); - $audit = new Audit($dbForProject); - $audit->logBatch($projectLogs['logs']); Console::success('Audit logs processed successfully'); + } catch (Throwable $e) { + Console::error('Error processing audit logs for Project "' . $projectDocument->getSequence() . '": ' . $e->getMessage()); } - } catch (Throwable $e) { - Console::error('Error processing audit logs: ' . $e->getMessage()); } + $this->lastTriggeredTime = time(); return new Commit(); } From 0af3734b6f20c6f19be97dd30ee283b6836798c8 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 2 Sep 2025 13:41:10 +0300 Subject: [PATCH 37/75] finally unset --- src/Appwrite/Platform/Workers/Audits.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index e8ae2f2168..4f6485efe5 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -131,19 +131,19 @@ class Audits extends Action return new NoCommit(); } - $logs = $this->logs; - $this->logs = []; - - foreach ($logs as $projectLogs) { + foreach ($this->logs as $sequence => $projectLogs) { try { + Console::log('Processing Project "' . $sequence . '" batch with ' . count($projectLogs['logs']) . ' events'); + $projectDocument = $projectLogs['project']; - Console::log('Processing Project "' . $projectDocument->getSequence() . '" batch with ' . count($projectLogs['logs']) . ' events'); $dbForProject = $getProjectDB($projectDocument); $audit = new Audit($dbForProject); $audit->logBatch($projectLogs['logs']); - Console::success('Audit logs processed successfully'); + } catch (Throwable $e) { Console::error('Error processing audit logs for Project "' . $projectDocument->getSequence() . '": ' . $e->getMessage()); + } finally { + unset($this->logs[$sequence]); } } From c2adf79511ea8af9953279b46ec42ab82a3b7e2c Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 2 Sep 2025 13:43:42 +0300 Subject: [PATCH 38/75] message --- src/Appwrite/Platform/Workers/Audits.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 4f6485efe5..7316f5c8a9 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -140,6 +140,7 @@ class Audits extends Action $audit = new Audit($dbForProject); $audit->logBatch($projectLogs['logs']); + Console::success('Audit logs processed successfully'); } catch (Throwable $e) { Console::error('Error processing audit logs for Project "' . $projectDocument->getSequence() . '": ' . $e->getMessage()); } finally { From 711d31b56536650c252e37d9a303c19c534fa408 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 2 Sep 2025 13:48:17 +0300 Subject: [PATCH 39/75] Console::error message fix --- src/Appwrite/Platform/Workers/Audits.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 7316f5c8a9..a88e2e641f 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -142,7 +142,7 @@ class Audits extends Action Console::success('Audit logs processed successfully'); } catch (Throwable $e) { - Console::error('Error processing audit logs for Project "' . $projectDocument->getSequence() . '": ' . $e->getMessage()); + Console::error('Error processing audit logs for Project "' . $sequence . '": ' . $e->getMessage()); } finally { unset($this->logs[$sequence]); } From cfe9b34cd57c1bbc0f5f71774b1409373a7125a9 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 2 Sep 2025 17:33:30 +0530 Subject: [PATCH 40/75] updated pr followups --- app/config/errors.php | 11 +++++ app/init/database/filters.php | 5 --- app/init/database/formats.php | 12 ------ src/Appwrite/Extend/Exception.php | 4 ++ .../Collections/Attributes/Action.php | 12 ++++++ .../Collections/Attributes/Line/Create.php | 11 ++--- .../Collections/Attributes/Line/Update.php | 4 +- .../Collections/Attributes/Point/Create.php | 9 ++-- .../Collections/Attributes/Point/Update.php | 4 +- .../Collections/Attributes/Polygon/Create.php | 9 ++-- .../Collections/Attributes/Polygon/Update.php | 4 +- .../Databases/Collections/Indexes/Create.php | 6 --- .../TablesDB/Tables/Columns/Line/Create.php | 2 +- .../TablesDB/Tables/Columns/Line/Update.php | 2 +- .../TablesDB/Tables/Columns/Point/Create.php | 2 +- .../TablesDB/Tables/Columns/Point/Update.php | 2 +- .../Tables/Columns/Polygon/Create.php | 2 +- .../Tables/Columns/Polygon/Update.php | 2 +- .../Utopia/Database/Validator/Spatial.php | 43 +++++++++++++++++++ src/Appwrite/Utopia/Response/Model.php | 1 + .../Utopia/Response/Model/AttributeLine.php | 14 +----- .../Utopia/Response/Model/AttributePoint.php | 14 +----- .../Response/Model/AttributePolygon.php | 16 +------ .../Utopia/Response/Model/ColumnLine.php | 14 +----- .../Utopia/Response/Model/ColumnPoint.php | 14 +----- .../Utopia/Response/Model/ColumnPolygon.php | 16 +------ .../Databases/Legacy/DatabasesBase.php | 2 - 27 files changed, 101 insertions(+), 136 deletions(-) create mode 100644 src/Appwrite/Utopia/Database/Validator/Spatial.php diff --git a/app/config/errors.php b/app/config/errors.php index 23df60f4ba..eba6e4bbac 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -837,6 +837,12 @@ return [ 'code' => 400, ], + Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED => [ + 'name' => Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED, + 'description' => "Attribute type not supported by the adapter.", + 'code' => 400, + ], + /** Exists for both Attributes & Columns */ Exception::RELATIONSHIP_VALUE_INVALID => [ 'name' => Exception::RELATIONSHIP_VALUE_INVALID, @@ -895,6 +901,11 @@ return [ 'description' => "Existing data is too large for new size, truncate your existing data then try again.", 'code' => 400, ], + Exception::COLUMN_TYPE_NOT_SUPPORTED => [ + 'name' => Exception::COLUMN_TYPE_NOT_SUPPORTED, + 'description' => "Column type not supported by the adapter.", + 'code' => 400, + ], /** Indexes */ Exception::INDEX_NOT_FOUND => [ diff --git a/app/init/database/filters.php b/app/init/database/filters.php index 346387125c..33f5d8077a 100644 --- a/app/init/database/filters.php +++ b/app/init/database/filters.php @@ -92,11 +92,6 @@ Database::addFilter( $filters = $attribute->getAttribute('filters', []); $attribute->setAttribute('encrypt', in_array('encrypt', $filters)); break; - - case Database::VAR_POINT: - case Database::VAR_LINESTRING: - case Database::VAR_POLYGON: - break; } } diff --git a/app/init/database/formats.php b/app/init/database/formats.php index f8545e3b54..6c73877576 100644 --- a/app/init/database/formats.php +++ b/app/init/database/formats.php @@ -41,15 +41,3 @@ Structure::addFormat(APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, function ($attribute) { $max = $attribute['formatOptions']['max'] ?? INF; return new Range($min, $max, Range::TYPE_FLOAT); }, Database::VAR_FLOAT); - -Structure::addFormat(APP_DATABASE_ATTRIBUTE_POINT, function () { - return new \Utopia\Validator\Text(0, 0); -}, Database::VAR_POINT); - -Structure::addFormat(APP_DATABASE_ATTRIBUTE_LINE, function () { - return new \Utopia\Validator\Text(0, 0); -}, Database::VAR_LINESTRING); - -Structure::addFormat(APP_DATABASE_ATTRIBUTE_POLYGON, function () { - return new \Utopia\Validator\Text(0, 0); -}, Database::VAR_POLYGON); diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 8eded2dbe0..ae9b09e85c 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -234,6 +234,8 @@ class Exception extends \Exception public const ATTRIBUTE_TYPE_INVALID = 'attribute_type_invalid'; public const ATTRIBUTE_INVALID_RESIZE = 'attribute_invalid_resize'; + public const ATTRIBUTE_TYPE_NOT_SUPPORTED = 'ATTRIBUTE_TYPE_NOT_SUPPORTED'; + /** Columns */ public const COLUMN_NOT_FOUND = 'column_not_found'; public const COLUMN_UNKNOWN = 'column_unknown'; @@ -246,6 +248,8 @@ class Exception extends \Exception public const COLUMN_TYPE_INVALID = 'column_type_invalid'; public const COLUMN_INVALID_RESIZE = 'column_invalid_resize'; + public const COLUMN_TYPE_NOT_SUPPORTED = 'COLUMN_TYPE_NOT_SUPPORTED'; + /** Relationship */ public const RELATIONSHIP_VALUE_INVALID = 'relationship_value_invalid'; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php index ccf886b029..f3903d91a7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php @@ -209,6 +209,14 @@ abstract class Action extends UtopiaAction : Exception::COLUMN_NOT_AVAILABLE; } + /** + * Get the exception for spatial type attribute not supported by the database adapter + */ + protected function getSpatialTypeNotSupportedException(): string + { + return $this->isCollectionsAPI() ? Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED : Exception::COLUMN_TYPE_NOT_SUPPORTED; + } + /** * Get the correct collections context for Events queue. */ @@ -298,6 +306,10 @@ abstract class Action extends UtopiaAction $default = $attribute->getAttribute('default'); $options = $attribute->getAttribute('options', []); + if (in_array($type, Database::SPATIAL_TYPES) && !$dbForProject->getAdapter()->getSupportForSpatialAttributes()) { + throw new Exception($this->getSpatialTypeNotSupportedException()); + } + $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($db->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index f1ab5673b1..8ca08b01ae 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -9,6 +9,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; @@ -16,7 +17,6 @@ use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Create extends Action @@ -64,8 +64,7 @@ class Create extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -73,17 +72,15 @@ class Create extends Action ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_LINESTRING, - 'size' => 0, 'required' => $required, - 'default' => $decodedDefault, - 'array' => $array, + 'default' => $decodedDefault ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php index 2ffc6f7d3f..f8d7738434 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -9,13 +9,13 @@ use Appwrite\SDK\ContentType; use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends Action @@ -64,7 +64,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php index 0a6e486f88..08dbda651a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -9,6 +9,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; @@ -16,7 +17,6 @@ use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Create extends Action @@ -64,8 +64,7 @@ class Create extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -73,17 +72,15 @@ class Create extends Action ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POINT, - 'size' => 0, 'required' => $required, 'default' => $decodedDefault, - 'array' => $array, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php index 3113ff7014..c1fb4e82be 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -9,13 +9,13 @@ use Appwrite\SDK\ContentType; use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends Action @@ -64,7 +64,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index 9a4d534c17..a2d9f68b40 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -13,10 +13,10 @@ use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Create extends Action @@ -64,8 +64,7 @@ class Create extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) - ->param('array', false, new Boolean(), 'Is attribute an array?', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -73,17 +72,15 @@ class Create extends Action ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POLYGON, - 'size' => 0, 'required' => $required, 'default' => $decodedDefault, - 'array' => $array, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php index 8f41630ba4..9faee180f0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -9,12 +9,12 @@ use Appwrite\SDK\ContentType; use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends Action @@ -63,7 +63,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php index 93f095e1dd..c5a429a79b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -199,12 +199,6 @@ class Create extends Action $supportForSpatialIndexNull = $dbForProject->getAdapter()->getSupportForSpatialIndexNull(); $supportForSpatialIndexOrder = $dbForProject->getAdapter()->getSupportForSpatialIndexOrder(); - if (!$this->isCollectionsAPI()) { - // Relax spatial constraints for TablesDB API - $supportForSpatialIndexNull = true; - $supportForSpatialIndexOrder = true; - } - $validator = new IndexValidator( $collection->getAttribute('attributes'), $maxIndexLength, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php index 6df33e8f96..a6fc5d1e9a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -34,7 +34,7 @@ class Create extends LineCreate ->desc('Create line column') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') - ->label('scope', 'tables.write') + ->label('scope', ['tables.write', 'collections.write']) ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'column.create') ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php index 4360d85bfe..b7e2e43db8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php @@ -34,7 +34,7 @@ class Update extends LineUpdate ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/line/:key') ->desc('Update line column') ->groups(['api', 'database', 'schema']) - ->label('scope', 'tables.write') + ->label('scope', ['tables.write', 'collections.write']) ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') ->label('audits.event', 'column.update') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php index d763ec681f..cfded0e430 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -34,7 +34,7 @@ class Create extends PointCreate ->desc('Create point column') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') - ->label('scope', 'tables.write') + ->label('scope', ['tables.write', 'collections.write']) ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'column.create') ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php index 8cf89eb0ef..4d04ac882e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -34,7 +34,7 @@ class Update extends PointUpdate ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/point/:key') ->desc('Update point column') ->groups(['api', 'database', 'schema']) - ->label('scope', 'tables.write') + ->label('scope', ['tables.write', 'collections.write']) ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') ->label('audits.event', 'column.update') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php index f764fcaee4..fdc11791e8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -34,7 +34,7 @@ class Create extends PolygonCreate ->desc('Create polygon column') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].create') - ->label('scope', 'tables.write') + ->label('scope', ['tables.write', 'collections.write']) ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'column.create') ->label('audits.resource', 'database/{request.databaseId}/table/{request.tableId}') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php index 0b731362d2..65f26b7a0a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php @@ -34,7 +34,7 @@ class Update extends PolygonUpdate ->setHttpPath('/v1/tablesdb/:databaseId/tables/:tableId/columns/polygon/:key') ->desc('Update polygon column') ->groups(['api', 'database', 'schema']) - ->label('scope', 'tables.write') + ->label('scope', ['tables.write', 'collections.write']) ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].tables.[tableId].columns.[columnId].update') ->label('audits.event', 'column.update') diff --git a/src/Appwrite/Utopia/Database/Validator/Spatial.php b/src/Appwrite/Utopia/Database/Validator/Spatial.php new file mode 100644 index 0000000000..3c28b66ce7 --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Spatial.php @@ -0,0 +1,43 @@ +spatialAttributeType = $spatialAttributeType; + } + /** + * Is valid. + * + * Returns true if valid or false if not. + * + * @param $value + * + * @return bool + */ + public function isValid($value): bool + { + + if (!parent::isValid($value)) { + return false; + } + $value = \json_decode($value, true); + $validator = new SpatialVaildator($this->spatialAttributeType); + return $validator->isValid($value); + } +} diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index 962da4834c..71443098ce 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -15,6 +15,7 @@ abstract class Model public const TYPE_DATETIME_EXAMPLE = '2020-10-15T06:38:00.000+00:00'; public const TYPE_RELATIONSHIP = 'relationship'; public const TYPE_PAYLOAD = 'payload'; + public const TYPE_SPATIAL = 'spatial'; /** * @var bool diff --git a/src/Appwrite/Utopia/Response/Model/AttributeLine.php b/src/Appwrite/Utopia/Response/Model/AttributeLine.php index ceebfc067d..6e0586e8b4 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeLine.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeLine.php @@ -11,20 +11,8 @@ class AttributeLine extends Attribute parent::__construct(); $this - ->addRule('key', [ - 'type' => self::TYPE_STRING, - 'description' => 'Attribute Key.', - 'default' => '', - 'example' => 'route', - ]) - ->addRule('type', [ - 'type' => self::TYPE_STRING, - 'description' => 'Attribute type.', - 'default' => '', - 'example' => 'linestring', - ]) ->addRule('default', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_SPATIAL, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/AttributePoint.php b/src/Appwrite/Utopia/Response/Model/AttributePoint.php index f93e5a8954..4a13054d96 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePoint.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePoint.php @@ -11,20 +11,8 @@ class AttributePoint extends Attribute parent::__construct(); $this - ->addRule('key', [ - 'type' => self::TYPE_STRING, - 'description' => 'Attribute Key.', - 'default' => '', - 'example' => 'location', - ]) - ->addRule('type', [ - 'type' => self::TYPE_STRING, - 'description' => 'Attribute type.', - 'default' => '', - 'example' => 'point', - ]) ->addRule('default', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_SPATIAL, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php index 46e95e954e..c28d8f66ed 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php @@ -11,24 +11,12 @@ class AttributePolygon extends Attribute parent::__construct(); $this - ->addRule('key', [ - 'type' => self::TYPE_STRING, - 'description' => 'Attribute Key.', - 'default' => '', - 'example' => 'boundary', - ]) - ->addRule('type', [ - 'type' => self::TYPE_STRING, - 'description' => 'Attribute type.', - 'default' => '', - 'example' => 'polygon', - ]) ->addRule('default', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_SPATIAL, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', 'default' => null, 'required' => false, - 'example' => '[[[0, 0], [0, 10], [10, 10], [0, 0]]]' + 'example' => '[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]' ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/ColumnLine.php b/src/Appwrite/Utopia/Response/Model/ColumnLine.php index 1e2c4d9bde..08bd66ce9c 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnLine.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnLine.php @@ -11,20 +11,8 @@ class ColumnLine extends Column parent::__construct(); $this - ->addRule('key', [ - 'type' => self::TYPE_STRING, - 'description' => 'Column Key.', - 'default' => '', - 'example' => 'route', - ]) - ->addRule('type', [ - 'type' => self::TYPE_JSON, - 'description' => 'Column type.', - 'default' => '', - 'example' => 'linestring', - ]) ->addRule('default', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_SPATIAL, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php index 29d39e5678..ffc6ed6789 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php @@ -11,20 +11,8 @@ class ColumnPoint extends Column parent::__construct(); $this - ->addRule('key', [ - 'type' => self::TYPE_STRING, - 'description' => 'Column Key.', - 'default' => '', - 'example' => 'location', - ]) - ->addRule('type', [ - 'type' => self::TYPE_STRING, - 'description' => 'Column type.', - 'default' => '', - 'example' => 'point', - ]) ->addRule('default', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_SPATIAL, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php index e68baa65ad..9b3a6f1030 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php @@ -11,24 +11,12 @@ class ColumnPolygon extends Column parent::__construct(); $this - ->addRule('key', [ - 'type' => self::TYPE_STRING, - 'description' => 'Column Key.', - 'default' => '', - 'example' => 'boundary', - ]) - ->addRule('type', [ - 'type' => self::TYPE_STRING, - 'description' => 'Column type.', - 'default' => '', - 'example' => 'polygon', - ]) ->addRule('default', [ - 'type' => self::TYPE_JSON, + 'type' => self::TYPE_SPATIAL, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, - 'example' => '[[[0, 0], [0, 10], [10, 10], [0, 0]]]' + 'example' => '[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]' ]) ; } diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 0485331613..90fdc4cd62 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6658,8 +6658,6 @@ trait DatabasesBase $this->assertCount(1, $response['body']['documents']); $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); - - // Test 3: Polygon attribute queries $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ 'content-type' => 'application/json', From 11120586897d1381ce951bc5c17a0f6d450a9d66 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 2 Sep 2025 18:07:34 +0530 Subject: [PATCH 41/75] pr followups --- .../Collections/Attributes/Line/Create.php | 2 +- .../Collections/Attributes/Line/Update.php | 2 +- .../Collections/Attributes/Point/Update.php | 2 +- .../TablesDB/Tables/Columns/Line/Create.php | 6 ++--- .../TablesDB/Tables/Columns/Line/Update.php | 5 ++-- .../TablesDB/Tables/Columns/Point/Create.php | 6 ++--- .../TablesDB/Tables/Columns/Point/Update.php | 5 ++-- .../Tables/Columns/Polygon/Create.php | 5 ++-- .../Tables/Columns/Polygon/Update.php | 5 ++-- .../Databases/Legacy/DatabasesBase.php | 23 +++++++++++++++++++ 10 files changed, 44 insertions(+), 17 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index 8ca08b01ae..ce2452bba1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -64,7 +64,7 @@ class Create extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php index f8d7738434..c9bdb7d02b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -64,7 +64,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php index c1fb4e82be..289606b983 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -64,7 +64,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.',true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php index a6fc5d1e9a..4777b99398 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -6,12 +6,13 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Li use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Create extends LineCreate @@ -55,8 +56,7 @@ class Create extends LineCreate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) - ->param('array', false, new Boolean(), 'Is column an array?', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php index b7e2e43db8..65910b62f7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php @@ -7,12 +7,13 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends LineUpdate @@ -57,7 +58,7 @@ class Update extends LineUpdate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) ->param('newKey', null, new Key(), 'New Column Key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php index cfded0e430..6b2da4f266 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -6,12 +6,13 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Po use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Create extends PointCreate @@ -55,8 +56,7 @@ class Create extends PointCreate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) - ->param('array', false, new Boolean(), 'Is column an array?', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.',true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php index 4d04ac882e..5310d79829 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -8,11 +8,12 @@ use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; use Utopia\Database\Validator\Key; +use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends PointUpdate @@ -57,7 +58,7 @@ class Update extends PointUpdate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.',true) ->param('newKey', null, new Key(), 'New Column Key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php index fdc11791e8..54f04b19f0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -6,12 +6,13 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Po use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Create extends PolygonCreate @@ -55,7 +56,7 @@ class Create extends PolygonCreate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) ->param('array', false, new Boolean(), 'Is column an array?', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php index 65f26b7a0a..7e06aafdca 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php @@ -7,12 +7,13 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; -use Utopia\Validator\JSON; use Utopia\Validator\Nullable; class Update extends PolygonUpdate @@ -57,7 +58,7 @@ class Update extends PolygonUpdate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new JSON()), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.') + ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) ->param('newKey', null, new Key(), 'New Column Key.', true) ->inject('response') ->inject('dbForProject') diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 90fdc4cd62..0c7daa32b5 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -7529,6 +7529,29 @@ trait DatabasesBase ]); $this->assertEquals(400, $badIndex['headers']['status-code']); + // updating the attribute to required to create index + $updated = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point/'.'pOptional', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => null + ]); + $this->assertEquals(200, $updated['headers']['status-code']); + + sleep(2); + $retriedIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['pOptional'], + ]); + $this->assertEquals(202, $retriedIndex['headers']['status-code']); + // Passing orders to spatial index should not throw error(in case of mariadb) $ordersIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ 'content-type' => 'application/json', From 8f7085ccfccd8388d90fd9c70d62d433ed37130a Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 2 Sep 2025 23:00:31 +0530 Subject: [PATCH 42/75] pr followups --- composer.lock | 169 +++++++++++++----- .../Collections/Attributes/Point/Update.php | 2 +- .../TablesDB/Tables/Columns/Point/Create.php | 2 +- .../TablesDB/Tables/Columns/Point/Update.php | 2 +- .../Tables/Columns/Polygon/Create.php | 1 - .../Databases/Legacy/DatabasesBase.php | 155 ++++++++++++++++ .../Legacy/DatabasesCustomServerTest.php | 19 +- .../Databases/TablesDB/DatabasesBase.php | 122 ++++++++++++- .../TablesDB/DatabasesCustomServerTest.php | 5 +- 9 files changed, 414 insertions(+), 63 deletions(-) diff --git a/composer.lock b/composer.lock index 5ddac255ac..c22b7f4b05 100644 --- a/composer.lock +++ b/composer.lock @@ -2599,16 +2599,16 @@ }, { "name": "symfony/http-client", - "version": "v7.3.2", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "1c064a0c67749923483216b081066642751cc2c7" + "reference": "333b9bd7639cbdaecd25a3a48a9d2dcfaa86e019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/1c064a0c67749923483216b081066642751cc2c7", - "reference": "1c064a0c67749923483216b081066642751cc2c7", + "url": "https://api.github.com/repos/symfony/http-client/zipball/333b9bd7639cbdaecd25a3a48a9d2dcfaa86e019", + "reference": "333b9bd7639cbdaecd25a3a48a9d2dcfaa86e019", "shasum": "" }, "require": { @@ -2616,6 +2616,7 @@ "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/polyfill-php83": "^1.29", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -2674,7 +2675,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.3.2" + "source": "https://github.com/symfony/http-client/tree/v7.3.3" }, "funding": [ { @@ -2694,7 +2695,7 @@ "type": "tidelift" } ], - "time": "2025-07-15T11:36:08+00:00" + "time": "2025-08-27T07:45:05+00:00" }, { "name": "symfony/http-client-contracts", @@ -2939,6 +2940,86 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php83", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-08T02:45:35+00:00" + }, { "name": "symfony/service-contracts", "version": "v3.6.0", @@ -3557,16 +3638,16 @@ }, { "name": "utopia-php/database", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "d59a207c079cc9e821ee4cab045a411bdad79e8c" + "reference": "06ffa2b1c977f5451200a1ee82a500be1390a789" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/d59a207c079cc9e821ee4cab045a411bdad79e8c", - "reference": "d59a207c079cc9e821ee4cab045a411bdad79e8c", + "url": "https://api.github.com/repos/utopia-php/database/zipball/06ffa2b1c977f5451200a1ee82a500be1390a789", + "reference": "06ffa2b1c977f5451200a1ee82a500be1390a789", "shasum": "" }, "require": { @@ -3607,9 +3688,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.2.2" + "source": "https://github.com/utopia-php/database/tree/1.3.0" }, - "time": "2025-08-27T11:27:06+00:00" + "time": "2025-09-02T16:20:02+00:00" }, { "name": "utopia-php/detector", @@ -4109,16 +4190,16 @@ }, { "name": "utopia-php/migration", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "0e4499d9dd2c90c2be188cc5fb7a32d9a892b569" + "reference": "38171023efd3abe650d2abc5ac65f5df52311da6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/0e4499d9dd2c90c2be188cc5fb7a32d9a892b569", - "reference": "0e4499d9dd2c90c2be188cc5fb7a32d9a892b569", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/38171023efd3abe650d2abc5ac65f5df52311da6", + "reference": "38171023efd3abe650d2abc5ac65f5df52311da6", "shasum": "" }, "require": { @@ -4159,9 +4240,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.0.0" + "source": "https://github.com/utopia-php/migration/tree/1.0.1" }, - "time": "2025-08-13T09:15:53+00:00" + "time": "2025-08-28T13:41:25+00:00" }, { "name": "utopia-php/orchestration", @@ -7410,16 +7491,16 @@ }, { "name": "symfony/console", - "version": "v7.3.2", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5f360ebc65c55265a74d23d7fe27f957870158a1" + "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5f360ebc65c55265a74d23d7fe27f957870158a1", - "reference": "5f360ebc65c55265a74d23d7fe27f957870158a1", + "url": "https://api.github.com/repos/symfony/console/zipball/cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7", + "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7", "shasum": "" }, "require": { @@ -7484,7 +7565,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.3.2" + "source": "https://github.com/symfony/console/tree/v7.3.3" }, "funding": [ { @@ -7504,7 +7585,7 @@ "type": "tidelift" } ], - "time": "2025-07-30T17:13:41+00:00" + "time": "2025-08-25T06:35:40+00:00" }, { "name": "symfony/filesystem", @@ -7646,16 +7727,16 @@ }, { "name": "symfony/options-resolver", - "version": "v7.3.2", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "119bcf13e67dbd188e5dbc74228b1686f66acd37" + "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/119bcf13e67dbd188e5dbc74228b1686f66acd37", - "reference": "119bcf13e67dbd188e5dbc74228b1686f66acd37", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", + "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", "shasum": "" }, "require": { @@ -7693,7 +7774,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.3.2" + "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" }, "funding": [ { @@ -7713,7 +7794,7 @@ "type": "tidelift" } ], - "time": "2025-07-15T11:36:08+00:00" + "time": "2025-08-05T10:16:07+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8047,16 +8128,16 @@ }, { "name": "symfony/process", - "version": "v7.3.0", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" + "reference": "32241012d521e2e8a9d713adb0812bb773b907f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", - "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "url": "https://api.github.com/repos/symfony/process/zipball/32241012d521e2e8a9d713adb0812bb773b907f1", + "reference": "32241012d521e2e8a9d713adb0812bb773b907f1", "shasum": "" }, "require": { @@ -8088,7 +8169,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.3.0" + "source": "https://github.com/symfony/process/tree/v7.3.3" }, "funding": [ { @@ -8099,25 +8180,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-17T09:11:12+00:00" + "time": "2025-08-18T09:42:54+00:00" }, { "name": "symfony/string", - "version": "v7.3.2", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "42f505aff654e62ac7ac2ce21033818297ca89ca" + "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/42f505aff654e62ac7ac2ce21033818297ca89ca", - "reference": "42f505aff654e62ac7ac2ce21033818297ca89ca", + "url": "https://api.github.com/repos/symfony/string/zipball/17a426cce5fd1f0901fefa9b2a490d0038fd3c9c", + "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c", "shasum": "" }, "require": { @@ -8175,7 +8260,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.3.2" + "source": "https://github.com/symfony/string/tree/v7.3.3" }, "funding": [ { @@ -8195,7 +8280,7 @@ "type": "tidelift" } ], - "time": "2025-07-10T08:47:49+00:00" + "time": "2025-08-25T06:35:40+00:00" }, { "name": "textalk/websocket", diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php index 289606b983..02b8bff2e5 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -64,7 +64,7 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.',true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php index 6b2da4f266..d0cc9a34d3 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -56,7 +56,7 @@ class Create extends PointCreate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.',true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php index 5310d79829..dedc90f312 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -58,7 +58,7 @@ class Update extends PointUpdate ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.',true) + ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) ->param('newKey', null, new Key(), 'New Column Key.', true) ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php index 54f04b19f0..d261c4ec14 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -57,7 +57,6 @@ class Create extends PolygonCreate ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) - ->param('array', false, new Boolean(), 'Is column an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 0c7daa32b5..ea67fb1bbc 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -7572,4 +7572,159 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + public function testSpatialDistanceInMeter(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Distance Meters Database' + ]); + + $databaseId = $database['body']['$id']; + + // Create collection with spatial attribute + $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' => 'Spatial Distance Meters Collection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Create point attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/point', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'loc', + 'required' => true, + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + sleep(2); + + // Create spatial index + $indexResponse = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_loc', + 'type' => Database::INDEX_SPATIAL, + 'attributes' => ['loc'], + ]); + + sleep(2); + $this->assertEquals(202, $indexResponse['headers']['status-code']); + + + // Two points roughly ~1000 meters apart by latitude delta (~0.009 deg ≈ 1km) + $p0 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'p0', + 'data' => [ + 'loc' => [0.0000, 0.0000] + ] + ]); + + $p1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => 'p1', + 'data' => [ + 'loc' => [0.0090, 0.0000] + ] + ]); + + $this->assertEquals(201, $p0['headers']['status-code']); + $this->assertEquals(201, $p1['headers']['status-code']); + + // distanceLessThan with meters=true: within 1500m should include both + $within1_5km = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('loc', [0.0000, 0.0000], 1500, true)->toString()] + ]); + + $this->assertEquals(200, $within1_5km['headers']['status-code']); + $this->assertCount(2, $within1_5km['body']['documents']); + + // Within 500m should include only p0 (exact point) + $within500m = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceLessThan('loc', [0.0000, 0.0000], 500, true)->toString()] + ]); + + $this->assertEquals(200, $within500m['headers']['status-code']); + $this->assertCount(1, $within500m['body']['documents']); + $this->assertEquals('p0', $within500m['body']['documents'][0]['$id']); + + // distanceGreaterThan 500m should include only p1 + $greater500m = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceGreaterThan('loc', [0.0000, 0.0000], 500, true)->toString()] + ]); + + $this->assertEquals(200, $greater500m['headers']['status-code']); + $this->assertCount(1, $greater500m['body']['documents']); + $this->assertEquals('p1', $greater500m['body']['documents'][0]['$id']); + + // distanceEqual with 0m should return exact match p0 + $equalZero = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceEqual('loc', [0.0000, 0.0000], 0, true)->toString()] + ]); + + $this->assertEquals(200, $equalZero['headers']['status-code']); + $this->assertEquals('p0', $equalZero['body']['documents'][0]['$id']); + + // distanceNotEqual with 0m should return p1 + $notEqualZero = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::distanceNotEqual('loc', [0.0000, 0.0000], 0, true)->toString()] + ]); + + $this->assertEquals(200, $notEqualZero['headers']['status-code']); + $this->assertEquals('p1', $notEqualZero['body']['documents'][0]['$id']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + } } diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php index 23bca658e6..2c603233a3 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php @@ -6406,20 +6406,14 @@ class DatabasesCustomServerTest extends Scope [ '$id' => ID::unique(), 'name' => 'Invalid Point', - 'location' => [1000.0, 2000.0], // Invalid coordinates - 'area' => [ - [10.0, 20.0], - [11.0, 20.0], - [11.0, 21.0], - [10.0, 21.0], - [10.0, 20.0] - ] + 'location' => [1000.0, 2000.0], + 'area' => [10.0 , 10.0] ] ], ]); - // Coordinates are not validated strictly; creation should succeed - $this->assertEquals(201, $response['headers']['status-code']); + // invalid polygon + $this->assertEquals(400, $response['headers']['status-code']); $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', @@ -6438,7 +6432,7 @@ class DatabasesCustomServerTest extends Scope ], ]); - $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(400, $response['headers']['status-code']); $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', @@ -6720,8 +6714,7 @@ class DatabasesCustomServerTest extends Scope ], ]); - // Single point linestrings are accepted as arrays; creation should succeed - $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(400, $response['headers']['status-code']); // Cleanup $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index 6d7050ec60..c521928327 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -8106,7 +8106,31 @@ trait DatabasesBase 'type' => Database::INDEX_SPATIAL, 'columns' => ['pOptional'], ]); - $this->assertEquals(202, $badIndex['headers']['status-code']); + $this->assertEquals(400, $badIndex['headers']['status-code']); + + // making it required to create index on it + $updated = $this->client->call(Client::METHOD_PATCH, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/point/'.'pOptional', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'required' => true, + 'default' => null + ]); + $this->assertEquals(200, $updated['headers']['status-code']); + + sleep(2); + + $retriedIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'idx_optional_point', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['pOptional'], + ]); + $this->assertEquals(202, $retriedIndex['headers']['status-code']); // Passing orders to spatial index should not throw error (in case of mariadb) $ordersIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ @@ -8292,4 +8316,100 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + public function testSpatialDistanceInMeter(): void + { + $headers = [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]; + + // Create database + $database = $this->client->call(Client::METHOD_POST, '/tablesdb', $headers, [ + 'databaseId' => ID::unique(), + 'name' => 'Spatial Distance Meters Database' + ]); + $databaseId = $database['body']['$id']; + + // Create table + $table = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables", $headers, [ + 'tableId' => ID::unique(), + 'name' => 'Spatial Distance Meters Table', + 'rowSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $tableId = $table['body']['$id']; + + // Create point column + $resp = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/columns/point", $headers, [ + 'key' => 'loc', + 'required' => true, + ]); + $this->assertEquals(202, $resp['headers']['status-code']); + + sleep(2); + + // Create spatial index + $indexResp = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/indexes", $headers, [ + 'key' => 'idx_loc', + 'type' => Database::INDEX_SPATIAL, + 'columns' => ['loc'], + ]); + $this->assertEquals(202, $indexResp['headers']['status-code']); + + + // Insert two points ~1km apart + $points = [ + 'p0' => [0.0000, 0.0000], + 'p1' => [0.0090, 0.0000] + ]; + + foreach ($points as $id => $loc) { + $rowResp = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", $headers, [ + 'rowId' => $id, + 'data' => ['loc' => $loc] + ]); + $this->assertEquals(201, $rowResp['headers']['status-code']); + } + + // Queries + $queries = [ + 'within1_5km' => Query::distanceLessThan('loc', [0.0, 0.0], 1500, true), + 'within500m' => Query::distanceLessThan('loc', [0.0, 0.0], 500, true), + 'greater500m' => Query::distanceGreaterThan('loc', [0.0, 0.0], 500, true), + 'equal0m' => Query::distanceEqual('loc', [0.0, 0.0], 0, true), + 'notEqual0m' => Query::distanceNotEqual('loc', [0.0, 0.0], 0, true), + ]; + + // Assertions + $results = [ + 'within1_5km' => 2, + 'within500m' => 1, + 'greater500m' => 1, + 'equal0m' => 'p0', + 'notEqual0m' => 'p1' + ]; + + foreach ($queries as $key => $query) { + $resp = $this->client->call(Client::METHOD_GET, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", $headers, [ + 'queries' => [$query->toString()] + ]); + $this->assertEquals(200, $resp['headers']['status-code']); + if (is_int($results[$key])) { + $this->assertCount($results[$key], $resp['body']['rows']); + } else { + $this->assertEquals($results[$key], $resp['body']['rows'][0]['$id']); + } + } + + // Cleanup + $this->client->call(Client::METHOD_DELETE, "/tablesdb/{$databaseId}/tables/{$tableId}", $headers); + $this->client->call(Client::METHOD_DELETE, "/tablesdb/{$databaseId}", $headers); + } + } diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php index 74f8a0432d..0f68d9ea7b 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php @@ -6399,7 +6399,7 @@ class DatabasesCustomServerTest extends Scope ], ]); - $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(400, $response['headers']['status-code']); // Test 4c: Missing required location (should fail) $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ @@ -6682,8 +6682,7 @@ class DatabasesCustomServerTest extends Scope ], ]); - // Single point linestrings are accepted as arrays; creation should succeed - $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(400, $response['headers']['status-code']); // Cleanup $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ From 72f5ac26fc2b63e78c6ed39ad82eb845dc604f30 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 2 Sep 2025 23:04:42 +0530 Subject: [PATCH 43/75] updated composer --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index f6490134d8..c22b7f4b05 100644 --- a/composer.lock +++ b/composer.lock @@ -3638,16 +3638,16 @@ }, { "name": "utopia-php/database", - "version": "1.2.3", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "8a536fead840d9da6ee819fe6b80e0f047997f69" + "reference": "06ffa2b1c977f5451200a1ee82a500be1390a789" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/8a536fead840d9da6ee819fe6b80e0f047997f69", - "reference": "8a536fead840d9da6ee819fe6b80e0f047997f69", + "url": "https://api.github.com/repos/utopia-php/database/zipball/06ffa2b1c977f5451200a1ee82a500be1390a789", + "reference": "06ffa2b1c977f5451200a1ee82a500be1390a789", "shasum": "" }, "require": { @@ -3688,9 +3688,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.2.3" + "source": "https://github.com/utopia-php/database/tree/1.3.0" }, - "time": "2025-08-27T11:47:04+00:00" + "time": "2025-09-02T16:20:02+00:00" }, { "name": "utopia-php/detector", From 044e68499b9f7ae38bff61b0045482aa23fb38e9 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 2 Sep 2025 23:08:01 +0530 Subject: [PATCH 44/75] update composer --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 03202639f0..c22b7f4b05 100644 --- a/composer.lock +++ b/composer.lock @@ -4190,16 +4190,16 @@ }, { "name": "utopia-php/migration", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "0e4499d9dd2c90c2be188cc5fb7a32d9a892b569" + "reference": "38171023efd3abe650d2abc5ac65f5df52311da6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/0e4499d9dd2c90c2be188cc5fb7a32d9a892b569", - "reference": "0e4499d9dd2c90c2be188cc5fb7a32d9a892b569", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/38171023efd3abe650d2abc5ac65f5df52311da6", + "reference": "38171023efd3abe650d2abc5ac65f5df52311da6", "shasum": "" }, "require": { @@ -4240,9 +4240,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.0.0" + "source": "https://github.com/utopia-php/migration/tree/1.0.1" }, - "time": "2025-08-13T09:15:53+00:00" + "time": "2025-08-28T13:41:25+00:00" }, { "name": "utopia-php/orchestration", From 0d77a33cf1be2fe97cc4ab23a6de6dab18e25edf Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 00:40:04 +0530 Subject: [PATCH 45/75] updated update endpoint to spatial appwrite validator --- .../Databases/Http/TablesDB/Tables/Columns/Point/Update.php | 2 +- tests/e2e/Services/Databases/TablesDB/DatabasesBase.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php index dedc90f312..230750b23d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -7,10 +7,10 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Validator\Key; -use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index 0246188a7a..ada7a73301 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -8284,7 +8284,6 @@ trait DatabasesBase 'default' => json_encode([0, 0]), 'required' => false ]); - $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals([0, 0], $response['body']['default']); From 0f6b4e07d518fd8785a5553e8f6a8da9810b1fe8 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 00:41:12 +0530 Subject: [PATCH 46/75] updated validator for the create polygon --- .../Http/Databases/Collections/Attributes/Polygon/Create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index a2d9f68b40..4f66f8bb79 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -13,7 +13,7 @@ use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Key; -use Utopia\Database\Validator\Spatial; +use Appwrite\Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; From 2755fd1fe6a4df52345bb93630845c9fa0e77d69 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 00:47:05 +0530 Subject: [PATCH 47/75] updated graphql mappers --- src/Appwrite/GraphQL/Types/Mapper.php | 1 + .../Http/Databases/Collections/Attributes/Polygon/Create.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index e0916da558..244a0c0ccb 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -58,6 +58,7 @@ class Mapper 'json' => Types::json(), 'none' => Types::json(), 'any' => Types::json(), + 'spatial' => Types::json(), ]; foreach ($defaults as $type => $default) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index 4f66f8bb79..5ef77fd32f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -9,11 +9,11 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Deprecated; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Spatial; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Key; -use Appwrite\Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; From 5423b63c8ad4fae353d149275f9b72ee329eeb64 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:03:49 +0100 Subject: [PATCH 48/75] refactor: prevent direct publisher calls --- app/cli.php | 19 +-- app/controllers/api/health.php | 136 ++++++++++++------ app/controllers/shared/api.php | 29 ++-- app/init/resources.php | 28 +--- app/worker.php | 32 ----- src/Appwrite/Event/Event.php | 35 +++++ src/Appwrite/Event/Func.php | 19 +++ src/Appwrite/Platform/Tasks/ScheduleBase.php | 29 +--- .../Platform/Tasks/ScheduleExecutions.php | 27 +++- .../Platform/Tasks/ScheduleFunctions.php | 24 +++- .../Platform/Tasks/ScheduleMessages.php | 23 ++- 11 files changed, 237 insertions(+), 164 deletions(-) diff --git a/app/cli.php b/app/cli.php index 0f98cf3458..ecb1675567 100644 --- a/app/cli.php +++ b/app/cli.php @@ -5,6 +5,7 @@ require_once __DIR__ . '/init.php'; use Appwrite\Event\Certificate; use Appwrite\Event\Delete; use Appwrite\Event\Func; +use Appwrite\Event\Messaging; use Appwrite\Event\StatsResources; use Appwrite\Event\StatsUsage; use Appwrite\Platform\Appwrite; @@ -191,21 +192,6 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { CLI::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); -CLI::setResource('publisherDatabases', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); -CLI::setResource('publisherFunctions', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); -CLI::setResource('publisherMigrations', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); -CLI::setResource('publisherStatsUsage', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); -CLI::setResource('publisherMessaging', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); CLI::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); @@ -218,6 +204,9 @@ CLI::setResource('queueForFunctions', function (Publisher $publisher) { CLI::setResource('queueForDeletes', function (Publisher $publisher) { return new Delete($publisher); }, ['publisher']); +CLI::setResource('queueForMessaging', function (Publisher $publisher) { + return new Messaging($publisher); +}, ['publisher']); CLI::setResource('queueForCertificates', function (Publisher $publisher) { return new Certificate($publisher); }, ['publisher']); diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index fb084fddb3..818c431de7 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -1,7 +1,19 @@ param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForWebhooks') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Webhook $queueForWebhooks, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::WEBHOOK_QUEUE_NAME)); + $size = $queueForWebhooks->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -367,12 +377,12 @@ App::get('/v1/health/queue/logs') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForAudits') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Audit $queueForAudits, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::AUDITS_QUEUE_NAME)); + $size = $queueForAudits->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -457,12 +467,12 @@ App::get('/v1/health/queue/certificates') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForCertificates') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Certificate $queueForCertificates, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::CERTIFICATES_QUEUE_NAME)); + $size = $queueForCertificates->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -490,12 +500,12 @@ App::get('/v1/health/queue/builds') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForBuilds') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Build $queueForBuilds, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::BUILDS_QUEUE_NAME)); + $size = $queueForBuilds->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -524,11 +534,11 @@ App::get('/v1/health/queue/databases') )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherDatabases') + ->inject('queueForDatabase') ->inject('response') - ->action(function (string $name, int|string $threshold, Publisher $publisherDatabases, Response $response) { + ->action(function (string $name, int|string $threshold, Database $queueForDatabase, Response $response) { $threshold = \intval($threshold); - $size = $publisherDatabases->getQueueSize(new Queue($name)); + $size = $queueForDatabase->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -556,12 +566,12 @@ App::get('/v1/health/queue/deletes') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherDeletes') + ->inject('queueForDeletes') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisherDeletes, Response $response) { + ->action(function (int|string $threshold, Delete $queueForDeletes, Response $response) { $threshold = \intval($threshold); - $size = $publisherDeletes->getQueueSize(new Queue(Event::DELETE_QUEUE_NAME)); + $size = $queueForDeletes->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -589,12 +599,12 @@ App::get('/v1/health/queue/mails') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherMails') + ->inject('queueForMails') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisherMails, Response $response) { + ->action(function (int|string $threshold, Mail $queueForMails, Response $response) { $threshold = \intval($threshold); - $size = $publisherMails->getQueueSize(new Queue(Event::MAILS_QUEUE_NAME)); + $size = $queueForMails->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -622,12 +632,12 @@ App::get('/v1/health/queue/messaging') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherMessaging') + ->inject('queueForMessaging') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisherMessaging, Response $response) { + ->action(function (int|string $threshold, Messaging $queueForMessaging, Response $response) { $threshold = \intval($threshold); - $size = $publisherMessaging->getQueueSize(new Queue(Event::MESSAGING_QUEUE_NAME)); + $size = $queueForMessaging->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -655,12 +665,12 @@ App::get('/v1/health/queue/migrations') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherMigrations') + ->inject('queueForMigrations') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisherMigrations, Response $response) { + ->action(function (int|string $threshold, Migration $queueForMigrations, Response $response) { $threshold = \intval($threshold); - $size = $publisherMigrations->getQueueSize(new Queue(Event::MIGRATIONS_QUEUE_NAME)); + $size = $queueForMigrations->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -688,12 +698,12 @@ App::get('/v1/health/queue/functions') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherFunctions') + ->inject('queueForFunctions') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisherFunctions, Response $response) { + ->action(function (int|string $threshold, Func $queueForFunctions, Response $response) { $threshold = \intval($threshold); - $size = $publisherFunctions->getQueueSize(new Queue(Event::FUNCTIONS_QUEUE_NAME)); + $size = $queueForFunctions->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -703,7 +713,7 @@ App::get('/v1/health/queue/functions') }); App::get('/v1/health/queue/stats-resources') - ->desc('Get stats resources queue') + ->desc('Get stats resources queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk', new Method( @@ -721,12 +731,12 @@ App::get('/v1/health/queue/stats-resources') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForStatsResources') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, StatsResources $queueForStatsResources, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::STATS_RESOURCES_QUEUE_NAME)); + $size = $queueForStatsResources->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -754,12 +764,12 @@ App::get('/v1/health/queue/stats-usage') contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisher') + ->inject('queueForStatsUsage') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, StatsUsage $queueForStatsUsage, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::STATS_USAGE_QUEUE_NAME)); + $size = $queueForStatsUsage->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -950,11 +960,53 @@ App::get('/v1/health/queue/failed/:name') ]), 'The name of the queue') ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('response') - ->inject('publisher') - ->action(function (string $name, int|string $threshold, Response $response, Publisher $publisher) { + ->inject('queueForDatabase') + ->inject('queueForDeletes') + ->inject('queueForAudits') + ->inject('queueForMails') + ->inject('queueForFunctions') + ->inject('queueForStatsResources') + ->inject('queueForStatsUsage') + ->inject('queueForWebhooks') + ->inject('queueForCertificates') + ->inject('queueForBuilds') + ->inject('queueForMessaging') + ->inject('queueForMigrations') + ->action(function ( + string $name, + int|string $threshold, + Response $response, + Database $queueForDatabase, + Database $queueForDeletes, + Database $queueForAudits, + Database $queueForMails, + Database $queueForFunctions, + Database $queueForStatsResources, + Database $queueForStatsUsage, + Database $queueForWebhooks, + Database $queueForCertificates, + Database $queueForBuilds, + Database $queueForMessaging, + Database $queueForMigrations + ) { $threshold = \intval($threshold); - $failed = $publisher->getQueueSize(new Queue($name), failedJobs: true); + /** @var Event $queue */ + $queue = match ($name) { + Event::DATABASE_QUEUE_NAME => $queueForDatabase, + Event::DELETE_QUEUE_NAME => $queueForDeletes, + Event::AUDITS_QUEUE_NAME => $queueForAudits, + Event::MAILS_QUEUE_NAME => $queueForMails, + Event::FUNCTIONS_QUEUE_NAME => $queueForFunctions, + Event::STATS_RESOURCES_QUEUE_NAME => $queueForStatsResources, + Event::STATS_USAGE_QUEUE_NAME => $queueForStatsUsage, + Event::WEBHOOK_QUEUE_NAME => $queueForWebhooks, + Event::CERTIFICATES_QUEUE_NAME => $queueForCertificates, + Event::BUILDS_QUEUE_NAME => $queueForBuilds, + Event::MESSAGING_QUEUE_NAME => $queueForMessaging, + Event::MIGRATIONS_QUEUE_NAME => $queueForMigrations, + }; + $failed = $queue->getSize(failed: true); if ($failed >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue failed jobs threshold hit. Current size is {$failed} and threshold is {$threshold}."); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 6dcb99b56f..f6eb5a0f3d 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -29,7 +29,6 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; -use Utopia\Queue\Publisher; use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Validator\WhiteList; @@ -413,9 +412,6 @@ App::init() ->inject('response') ->inject('project') ->inject('user') - ->inject('publisher') - ->inject('publisherFunctions') - ->inject('publisherWebhooks') ->inject('queueForEvents') ->inject('queueForMessaging') ->inject('queueForAudits') @@ -423,6 +419,9 @@ App::init() ->inject('queueForDatabase') ->inject('queueForBuilds') ->inject('queueForStatsUsage') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') + ->inject('queueForRealtime') ->inject('dbForProject') ->inject('timelimit') ->inject('resourceToken') @@ -431,7 +430,7 @@ App::init() ->inject('plan') ->inject('devKey') ->inject('telemetry') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Publisher $publisherFunctions, Publisher $publisherWebhooks, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) { + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Webhook $queueForWebhooks, Realtime $queueForRealtime, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -539,13 +538,9 @@ App::init() $queueForDatabase->setProject($project); $queueForBuilds->setProject($project); $queueForMessaging->setProject($project); - - // Clone the queues, to prevent events triggered by the database listener - // from overwriting the events that are supposed to be triggered in the shutdown hook. - $queueForEventsClone = new Event($publisher); - $queueForFunctions = new Func($publisherFunctions); - $queueForWebhooks = new Webhook($publisherWebhooks); - $queueForRealtime = new Realtime(); + $queueForFunctions->setProject($project); + $queueForWebhooks->setProject($project); + $queueForRealtime->setProject($project); $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForStatsUsage)) @@ -557,10 +552,12 @@ App::init() $project, $document, $response, - $queueForEventsClone->from($queueForEvents), - $queueForFunctions->from($queueForEvents), - $queueForWebhooks->from($queueForEvents), - $queueForRealtime->from($queueForEvents) + // Clone the queues used by database, to prevent overwriting the events that are supposed to be triggered in the shutdown hook. + // This is a hack, we should define this listener in the domain layer and allow it to inject it's own dependencies. + clone $queueForEvents, + clone $queueForFunctions, + clone $queueForWebhooks, + clone $queueForRealtime )); $useCache = $route->getLabel('cache', false); diff --git a/app/init/resources.php b/app/init/resources.php index d4f0433447..71680cf32b 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -15,6 +15,7 @@ use Appwrite\Event\Mail; use Appwrite\Event\Messaging; use Appwrite\Event\Migration; use Appwrite\Event\Realtime; +use Appwrite\Event\StatsResources; use Appwrite\Event\StatsUsage; use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; @@ -84,30 +85,6 @@ App::setResource('localeCodes', function () { App::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); -App::setResource('publisherDatabases', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherFunctions', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherMigrations', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherStatsUsage', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherMails', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherDeletes', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherMessaging', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); -App::setResource('publisherWebhooks', function (Publisher $publisher) { - return $publisher; -}, ['publisher']); App::setResource('queueForMessaging', function (Publisher $publisher) { return new Messaging($publisher); }, ['publisher']); @@ -132,6 +109,9 @@ App::setResource('queueForWebhooks', function (Publisher $publisher) { App::setResource('queueForRealtime', function () { return new Realtime(); }, []); +App::setResource('queueForStatsResources', function (Publisher $publisher) { + return new StatsResources($publisher); +}, ['publisher']); App::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); diff --git a/app/worker.php b/app/worker.php index bf0a6583ec..845914c923 100644 --- a/app/worker.php +++ b/app/worker.php @@ -247,42 +247,10 @@ Server::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); -Server::setResource('publisherDatabases', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); - -Server::setResource('publisherFunctions', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); - -Server::setResource('publisherMigrations', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); - -Server::setResource('publisherStatsUsage', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); - -Server::setResource('publisherMessaging', function (BrokerPool $publisher) { - return $publisher; -}, ['publisher']); - Server::setResource('consumer', function (Group $pools) { return new BrokerPool(consumer: $pools->get('consumer')); }, ['pools']); -Server::setResource('consumerDatabases', function (BrokerPool $consumer) { - return $consumer; -}, ['consumer']); - -Server::setResource('consumerMigrations', function (BrokerPool $consumer) { - return $consumer; -}, ['consumer']); - -Server::setResource('consumerStatsUsage', function (BrokerPool $consumer) { - return $consumer; -}, ['consumer']); - Server::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 2557bf3f26..c88b886c70 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -638,4 +638,39 @@ class Event return $events; } + + /** + * Clone the event instance. + * + * Creates a deep copy of the event with all properties, + * including nested objects and arrays. + */ + public function __clone(): void + { + if ($this->project !== null) { + $this->project = clone $this->project; + } + + if ($this->user !== null) { + $this->user = clone $this->user; + } + + $clonedContext = []; + foreach ($this->context as $key => $document) { + $clonedContext[$key] = clone $document; + } + $this->context = $clonedContext; + } + + /** + * Returns the size of the queue. + * + * @param bool $failed Whether to include failed events in the count. + * @return int The size of the queue. + */ + public function getSize(bool $failed = false): int + { + $queue = new Queue($this->getQueue()); + return $this->publisher->getQueueSize($queue, $failed); + } } diff --git a/src/Appwrite/Event/Func.php b/src/Appwrite/Event/Func.php index ae316c84e5..df356b1ad5 100644 --- a/src/Appwrite/Event/Func.php +++ b/src/Appwrite/Event/Func.php @@ -219,4 +219,23 @@ class Func extends Event 'method' => $this->method, ]; } + + /** + * Clone the function event instance. + * + * Handles deep copying of Func-specific properties + * after parent cloning completes. + */ + public function __clone(): void + { + parent::__clone(); + + if ($this->function !== null) { + $this->function = clone $this->function; + } + + if ($this->execution !== null) { + $this->execution = clone $this->execution; + } + } } diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 5cd25b09b4..22636e578f 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -11,7 +11,6 @@ use Utopia\Database\Exception; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; -use Utopia\Queue\Broker\Pool as BrokerPool; use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Gauge; @@ -24,10 +23,6 @@ abstract class ScheduleBase extends Action protected array $schedules = []; - protected BrokerPool $publisher; - protected BrokerPool $publisherMigrations; - protected BrokerPool $publisherFunctions; - protected BrokerPool $publisherMessaging; private ?Histogram $collectSchedulesTelemetryDuration = null; private ?Gauge $collectSchedulesTelemetryCount = null; @@ -39,21 +34,6 @@ abstract class ScheduleBase extends Action abstract public static function getCollectionId(): string; abstract protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void; - public function __construct() - { - $type = static::getSupportedResource(); - - $this - ->desc("Execute {$type}s scheduled in Appwrite") - ->inject('publisher') - ->inject('publisherMigrations') - ->inject('publisherFunctions') - ->inject('publisherMessaging') - ->inject('dbForPlatform') - ->inject('getProjectDB') - ->inject('telemetry') - ->callback($this->action(...)); - } protected function updateProjectAccess(Document $project, Database $dbForPlatform): void { @@ -71,16 +51,11 @@ abstract class ScheduleBase extends Action * 2. Create timer that sync all changes from 'schedules' collection to local copy. Only reading changes thanks to 'resourceUpdatedAt' attribute * 3. Create timer that prepares coroutines for soon-to-execute schedules. When it's ready, coroutine sleeps until exact time before sending request to worker. */ - public function action(BrokerPool $publisher, BrokerPool $publisherMigrations, BrokerPool $publisherFunctions, BrokerPool $publisherMessaging, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void + protected function schedule(Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void { Console::title(\ucfirst(static::getSupportedResource()) . ' scheduler V1'); Console::success(APP_NAME . ' ' . \ucfirst(static::getSupportedResource()) . ' scheduler v1 has started'); - $this->publisher = $publisher; - $this->publisherMigrations = $publisherMigrations; - $this->publisherFunctions = $publisherFunctions; - $this->publisherMessaging = $publisherMessaging; - $this->scheduleTelemetryCount = $telemetry->createGauge('task.schedule.count'); $this->collectSchedulesTelemetryDuration = $telemetry->createHistogram('task.schedule.collect_schedules.duration', 's'); $this->collectSchedulesTelemetryCount = $telemetry->createGauge('task.schedule.collect_schedules.count'); @@ -112,7 +87,7 @@ abstract class ScheduleBase extends Action } } - private function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void + protected function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void { // If we haven't synced yet, load all active schedules $initialLoad = $lastSyncUpdate === "0"; diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 14a4259e17..6b19ef24e6 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -5,12 +5,15 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Func; use Swoole\Coroutine as Co; use Utopia\Database\Database; +use Utopia\Telemetry\Adapter as Telemetry; class ScheduleExecutions extends ScheduleBase { public const UPDATE_TIMER = 3; // seconds public const ENQUEUE_TIMER = 4; // seconds + protected Func $queueForFunctions; + public static function getName(): string { return 'schedule-executions'; @@ -26,12 +29,29 @@ class ScheduleExecutions extends ScheduleBase return 'executions'; } + public function __construct() + { + $type = static::getSupportedResource(); + + $this + ->desc("Execute executions scheduled in Appwrite") + ->inject('queueForFunctions') + ->inject('dbForPlatform') + ->inject('getProjectDB') + ->inject('telemetry') + ->callback($this->action(...)); + } + + public function action(Func $queueForFunctions, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void + { + $this->queueForFunctions = $queueForFunctions; + $this->schedule($dbForPlatform, $getProjectDB, $telemetry); + } + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { $intervalEnd = (new \DateTime())->modify('+' . self::ENQUEUE_TIMER . ' seconds'); - $queueForFunctions = new Func($this->publisherFunctions); - foreach ($this->schedules as $schedule) { if (!$schedule['active']) { $dbForPlatform->deleteDocument( @@ -57,7 +77,8 @@ class ScheduleExecutions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); - \go(function () use ($queueForFunctions, $schedule, $scheduledAt, $delay, $data) { + \go(function () use ($schedule, $scheduledAt, $delay, $data) { + $queueForFunctions = clone $this->queueForFunctions; Co::sleep($delay); $queueForFunctions->setType('schedule') diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 6f072425e4..6e45fda408 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -7,7 +7,7 @@ use Cron\CronExpression; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Pools\Group; +use Utopia\Telemetry\Adapter as Telemetry; class ScheduleFunctions extends ScheduleBase { @@ -15,6 +15,7 @@ class ScheduleFunctions extends ScheduleBase public const ENQUEUE_TIMER = 60; // seconds private ?float $lastEnqueueUpdate = null; + protected Func $queueForFunctions; public static function getName(): string { @@ -31,6 +32,23 @@ class ScheduleFunctions extends ScheduleBase return 'functions'; } + public function __construct() + { + $this + ->desc("Execute functions scheduled in Appwrite") + ->inject('queueForFunctions') + ->inject('dbForPlatform') + ->inject('getProjectDB') + ->inject('telemetry') + ->callback($this->action(...)); + } + + public function action(Func $queueForFunctions, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void + { + $this->queueForFunctions = $queueForFunctions; + $this->schedule($dbForPlatform, $getProjectDB, $telemetry); + } + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { $timerStart = \microtime(true); @@ -77,6 +95,8 @@ class ScheduleFunctions extends ScheduleBase foreach ($delayedExecutions as $delay => $schedules) { \go(function () use ($delay, $schedules, $dbForPlatform) { + $queueForFunctions = clone $this->queueForFunctions; + \sleep($delay); // in seconds foreach ($schedules as $delayConfig) { @@ -90,8 +110,6 @@ class ScheduleFunctions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); - $queueForFunctions = new Func($this->publisherFunctions); - $queueForFunctions ->setType('schedule') ->setFunction($schedule['resource']) diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index fe4afbe69c..62d5344e0d 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -4,12 +4,15 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Messaging; use Utopia\Database\Database; +use Utopia\Telemetry\Adapter as Telemetry; class ScheduleMessages extends ScheduleBase { public const UPDATE_TIMER = 3; // seconds public const ENQUEUE_TIMER = 4; // seconds + protected Messaging $queueForMessaging; + public static function getName(): string { return 'schedule-messages'; @@ -25,6 +28,23 @@ class ScheduleMessages extends ScheduleBase return 'messages'; } + public function __construct() + { + $this + ->desc("Execute messages scheduled in Appwrite") + ->inject('queueForMessaging') + ->inject('dbForPlatform') + ->inject('getProjectDB') + ->inject('telemetry') + ->callback($this->action(...)); + } + + public function action(Messaging $queueForMessaging, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void + { + $this->queueForMessaging = $queueForMessaging; + $this->schedule($dbForPlatform, $getProjectDB, $telemetry); + } + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { foreach ($this->schedules as $schedule) { @@ -40,10 +60,9 @@ class ScheduleMessages extends ScheduleBase } \go(function () use ($schedule, $scheduledAt, $dbForPlatform) { - $queueForMessaging = new Messaging($this->publisherMessaging); - $this->updateProjectAccess($schedule['project'], $dbForPlatform); + $queueForMessaging = clone $this->queueForMessaging; $queueForMessaging ->setType(MESSAGE_SEND_TYPE_EXTERNAL) ->setMessageId($schedule['resourceId']) From e4adff4edcecea89340fef3cb58dfbb359558584 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 3 Sep 2025 10:29:49 +0100 Subject: [PATCH 49/75] chore: jake review --- app/controllers/api/health.php | 22 +++++++-------- src/Appwrite/Event/Database.php | 28 +++++++++++++++++++ src/Appwrite/Event/Func.php | 3 -- .../Platform/Tasks/ScheduleExecutions.php | 4 +-- .../Platform/Tasks/ScheduleFunctions.php | 2 +- .../Platform/Tasks/ScheduleMessages.php | 2 +- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 818c431de7..988f061ed5 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -977,17 +977,17 @@ App::get('/v1/health/queue/failed/:name') int|string $threshold, Response $response, Database $queueForDatabase, - Database $queueForDeletes, - Database $queueForAudits, - Database $queueForMails, - Database $queueForFunctions, - Database $queueForStatsResources, - Database $queueForStatsUsage, - Database $queueForWebhooks, - Database $queueForCertificates, - Database $queueForBuilds, - Database $queueForMessaging, - Database $queueForMigrations + Delete $queueForDeletes, + Audit $queueForAudits, + Mail $queueForMails, + Func $queueForFunctions, + StatsResources $queueForStatsResources, + StatsUsage $queueForStatsUsage, + Webhook $queueForWebhooks, + Certificate $queueForCertificates, + Build $queueForBuilds, + Messaging $queueForMessaging, + Migration $queueForMigrations ) { $threshold = \intval($threshold); diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index 70051f9055..26639fc60b 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -193,4 +193,32 @@ class Database extends Event 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) ]; } + + /** + * Clone the database event instance. + */ + public function __clone(): void + { + parent::__clone(); + + if ($this->database !== null) { + $this->database = clone $this->database; + } + + if ($this->row !== null) { + $this->row = clone $this->row; + } + + if ($this->table !== null) { + $this->table = clone $this->table; + } + + if ($this->document !== null) { + $this->document = clone $this->document; + } + + if ($this->collection !== null) { + $this->collection = clone $this->collection; + } + } } diff --git a/src/Appwrite/Event/Func.php b/src/Appwrite/Event/Func.php index df356b1ad5..9741576ecc 100644 --- a/src/Appwrite/Event/Func.php +++ b/src/Appwrite/Event/Func.php @@ -222,9 +222,6 @@ class Func extends Event /** * Clone the function event instance. - * - * Handles deep copying of Func-specific properties - * after parent cloning completes. */ public function __clone(): void { diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 6b19ef24e6..cdfb188190 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -31,10 +31,8 @@ class ScheduleExecutions extends ScheduleBase public function __construct() { - $type = static::getSupportedResource(); - $this - ->desc("Execute executions scheduled in Appwrite") + ->desc('Execute executions scheduled in Appwrite') ->inject('queueForFunctions') ->inject('dbForPlatform') ->inject('getProjectDB') diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 6e45fda408..d8ded60ec6 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -35,7 +35,7 @@ class ScheduleFunctions extends ScheduleBase public function __construct() { $this - ->desc("Execute functions scheduled in Appwrite") + ->desc('Execute functions scheduled in Appwrite') ->inject('queueForFunctions') ->inject('dbForPlatform') ->inject('getProjectDB') diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 62d5344e0d..58a0a76b3e 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -31,7 +31,7 @@ class ScheduleMessages extends ScheduleBase public function __construct() { $this - ->desc("Execute messages scheduled in Appwrite") + ->desc('Execute messages scheduled in Appwrite') ->inject('queueForMessaging') ->inject('dbForPlatform') ->inject('getProjectDB') From b32e1ad930326c6b7e02a7c6924bbef2a96dfb72 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Wed, 3 Sep 2025 16:57:15 +0530 Subject: [PATCH 50/75] Add vcsCommentLock before updating comment --- app/controllers/api/vcs.php | 89 ++++++++++++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 10 deletions(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 5541b99318..9448618cb7 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -135,11 +135,35 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if (!$latestComment->isEmpty()) { $latestCommentId = $latestComment->getAttribute('providerCommentId', ''); - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + $retries = 0; - $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + while (true) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $latestCommentId + ])); + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + throw $err; + } + + \sleep(1); + } + } + + // Wrap in try/finally to ensure lock file gets deleted + try { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + + $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } } else { $comment = new Comment(); $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); @@ -177,11 +201,36 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId foreach ($latestComments as $comment) { $latestCommentId = $comment->getAttribute('providerCommentId', ''); - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); - $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + $retries = 0; + + while (true) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $latestCommentId + ])); + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + throw $err; + } + + \sleep(1); + } + } + + // Wrap in try/finally to ensure lock file gets deleted + try { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + + $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } } } @@ -364,6 +413,26 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } if ($resource->getCollection() === 'sites' && !empty($latestCommentId) && !empty($previewRuleId)) { + $retries = 0; + + while (true) { + $retries++; + + try { + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ + '$id' => $latestCommentId + ])); + break; + } catch (\Throwable $err) { + if ($retries >= 9) { + throw $err; + } + + \sleep(1); + } + } + + // Wrap in try/finally to ensure lock file gets deleted try { $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); @@ -376,8 +445,8 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, $previewUrl); $github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment()); } - } catch (\Throwable $th) { - // Ignore, rule already exists; will be updated by builds worker + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); } } From 1b586bbc51a916d00eb17c418716e730d30abf4d Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:08:07 +0100 Subject: [PATCH 51/75] chore: revert scheduler & hook changes --- app/cli.php | 19 ++++++++--- app/controllers/shared/api.php | 29 +++++++++-------- app/init/resources.php | 30 +++++++++++++++-- app/worker.php | 32 +++++++++++++++++++ src/Appwrite/Event/Database.php | 28 ---------------- src/Appwrite/Event/Event.php | 23 ------------- src/Appwrite/Event/Func.php | 16 ---------- src/Appwrite/Platform/Tasks/ScheduleBase.php | 29 +++++++++++++++-- .../Platform/Tasks/ScheduleExecutions.php | 25 ++------------- .../Platform/Tasks/ScheduleFunctions.php | 24 ++------------ .../Platform/Tasks/ScheduleMessages.php | 23 ++----------- 11 files changed, 125 insertions(+), 153 deletions(-) diff --git a/app/cli.php b/app/cli.php index ecb1675567..0f98cf3458 100644 --- a/app/cli.php +++ b/app/cli.php @@ -5,7 +5,6 @@ require_once __DIR__ . '/init.php'; use Appwrite\Event\Certificate; use Appwrite\Event\Delete; use Appwrite\Event\Func; -use Appwrite\Event\Messaging; use Appwrite\Event\StatsResources; use Appwrite\Event\StatsUsage; use Appwrite\Platform\Appwrite; @@ -192,6 +191,21 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { CLI::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); +CLI::setResource('publisherDatabases', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherFunctions', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherMigrations', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherStatsUsage', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); +CLI::setResource('publisherMessaging', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); CLI::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); @@ -204,9 +218,6 @@ CLI::setResource('queueForFunctions', function (Publisher $publisher) { CLI::setResource('queueForDeletes', function (Publisher $publisher) { return new Delete($publisher); }, ['publisher']); -CLI::setResource('queueForMessaging', function (Publisher $publisher) { - return new Messaging($publisher); -}, ['publisher']); CLI::setResource('queueForCertificates', function (Publisher $publisher) { return new Certificate($publisher); }, ['publisher']); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index f6eb5a0f3d..6dcb99b56f 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -29,6 +29,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Queue\Publisher; use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Validator\WhiteList; @@ -412,6 +413,9 @@ App::init() ->inject('response') ->inject('project') ->inject('user') + ->inject('publisher') + ->inject('publisherFunctions') + ->inject('publisherWebhooks') ->inject('queueForEvents') ->inject('queueForMessaging') ->inject('queueForAudits') @@ -419,9 +423,6 @@ App::init() ->inject('queueForDatabase') ->inject('queueForBuilds') ->inject('queueForStatsUsage') - ->inject('queueForFunctions') - ->inject('queueForWebhooks') - ->inject('queueForRealtime') ->inject('dbForProject') ->inject('timelimit') ->inject('resourceToken') @@ -430,7 +431,7 @@ App::init() ->inject('plan') ->inject('devKey') ->inject('telemetry') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Webhook $queueForWebhooks, Realtime $queueForRealtime, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) { + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Publisher $publisherFunctions, Publisher $publisherWebhooks, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -538,9 +539,13 @@ App::init() $queueForDatabase->setProject($project); $queueForBuilds->setProject($project); $queueForMessaging->setProject($project); - $queueForFunctions->setProject($project); - $queueForWebhooks->setProject($project); - $queueForRealtime->setProject($project); + + // Clone the queues, to prevent events triggered by the database listener + // from overwriting the events that are supposed to be triggered in the shutdown hook. + $queueForEventsClone = new Event($publisher); + $queueForFunctions = new Func($publisherFunctions); + $queueForWebhooks = new Webhook($publisherWebhooks); + $queueForRealtime = new Realtime(); $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForStatsUsage)) @@ -552,12 +557,10 @@ App::init() $project, $document, $response, - // Clone the queues used by database, to prevent overwriting the events that are supposed to be triggered in the shutdown hook. - // This is a hack, we should define this listener in the domain layer and allow it to inject it's own dependencies. - clone $queueForEvents, - clone $queueForFunctions, - clone $queueForWebhooks, - clone $queueForRealtime + $queueForEventsClone->from($queueForEvents), + $queueForFunctions->from($queueForEvents), + $queueForWebhooks->from($queueForEvents), + $queueForRealtime->from($queueForEvents) )); $useCache = $route->getLabel('cache', false); diff --git a/app/init/resources.php b/app/init/resources.php index 71680cf32b..e4e8fbef5e 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -85,6 +85,30 @@ App::setResource('localeCodes', function () { App::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); +App::setResource('publisherDatabases', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherFunctions', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherMigrations', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherStatsUsage', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherMails', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherDeletes', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherMessaging', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); +App::setResource('publisherWebhooks', function (Publisher $publisher) { + return $publisher; +}, ['publisher']); App::setResource('queueForMessaging', function (Publisher $publisher) { return new Messaging($publisher); }, ['publisher']); @@ -109,9 +133,6 @@ App::setResource('queueForWebhooks', function (Publisher $publisher) { App::setResource('queueForRealtime', function () { return new Realtime(); }, []); -App::setResource('queueForStatsResources', function (Publisher $publisher) { - return new StatsResources($publisher); -}, ['publisher']); App::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); @@ -127,6 +148,9 @@ App::setResource('queueForCertificates', function (Publisher $publisher) { App::setResource('queueForMigrations', function (Publisher $publisher) { return new Migration($publisher); }, ['publisher']); +App::setResource('queueForStatsResources', function (Publisher $publisher) { + return new StatsResources($publisher); +}, ['publisher']); App::setResource('platforms', function (Request $request, Document $console, Document $project) { $console->setAttribute('platforms', [ // Always allow current host '$collection' => ID::custom('platforms'), diff --git a/app/worker.php b/app/worker.php index 845914c923..bf0a6583ec 100644 --- a/app/worker.php +++ b/app/worker.php @@ -247,10 +247,42 @@ Server::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); +Server::setResource('publisherDatabases', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherFunctions', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherMigrations', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherStatsUsage', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + +Server::setResource('publisherMessaging', function (BrokerPool $publisher) { + return $publisher; +}, ['publisher']); + Server::setResource('consumer', function (Group $pools) { return new BrokerPool(consumer: $pools->get('consumer')); }, ['pools']); +Server::setResource('consumerDatabases', function (BrokerPool $consumer) { + return $consumer; +}, ['consumer']); + +Server::setResource('consumerMigrations', function (BrokerPool $consumer) { + return $consumer; +}, ['consumer']); + +Server::setResource('consumerStatsUsage', function (BrokerPool $consumer) { + return $consumer; +}, ['consumer']); + Server::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index 26639fc60b..70051f9055 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -193,32 +193,4 @@ class Database extends Event 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) ]; } - - /** - * Clone the database event instance. - */ - public function __clone(): void - { - parent::__clone(); - - if ($this->database !== null) { - $this->database = clone $this->database; - } - - if ($this->row !== null) { - $this->row = clone $this->row; - } - - if ($this->table !== null) { - $this->table = clone $this->table; - } - - if ($this->document !== null) { - $this->document = clone $this->document; - } - - if ($this->collection !== null) { - $this->collection = clone $this->collection; - } - } } diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index c88b886c70..e9f3ccc2a2 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -639,29 +639,6 @@ class Event return $events; } - /** - * Clone the event instance. - * - * Creates a deep copy of the event with all properties, - * including nested objects and arrays. - */ - public function __clone(): void - { - if ($this->project !== null) { - $this->project = clone $this->project; - } - - if ($this->user !== null) { - $this->user = clone $this->user; - } - - $clonedContext = []; - foreach ($this->context as $key => $document) { - $clonedContext[$key] = clone $document; - } - $this->context = $clonedContext; - } - /** * Returns the size of the queue. * diff --git a/src/Appwrite/Event/Func.php b/src/Appwrite/Event/Func.php index 9741576ecc..ae316c84e5 100644 --- a/src/Appwrite/Event/Func.php +++ b/src/Appwrite/Event/Func.php @@ -219,20 +219,4 @@ class Func extends Event 'method' => $this->method, ]; } - - /** - * Clone the function event instance. - */ - public function __clone(): void - { - parent::__clone(); - - if ($this->function !== null) { - $this->function = clone $this->function; - } - - if ($this->execution !== null) { - $this->execution = clone $this->execution; - } - } } diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 22636e578f..5cd25b09b4 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -11,6 +11,7 @@ use Utopia\Database\Exception; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; +use Utopia\Queue\Broker\Pool as BrokerPool; use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Gauge; @@ -23,6 +24,10 @@ abstract class ScheduleBase extends Action protected array $schedules = []; + protected BrokerPool $publisher; + protected BrokerPool $publisherMigrations; + protected BrokerPool $publisherFunctions; + protected BrokerPool $publisherMessaging; private ?Histogram $collectSchedulesTelemetryDuration = null; private ?Gauge $collectSchedulesTelemetryCount = null; @@ -34,6 +39,21 @@ abstract class ScheduleBase extends Action abstract public static function getCollectionId(): string; abstract protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void; + public function __construct() + { + $type = static::getSupportedResource(); + + $this + ->desc("Execute {$type}s scheduled in Appwrite") + ->inject('publisher') + ->inject('publisherMigrations') + ->inject('publisherFunctions') + ->inject('publisherMessaging') + ->inject('dbForPlatform') + ->inject('getProjectDB') + ->inject('telemetry') + ->callback($this->action(...)); + } protected function updateProjectAccess(Document $project, Database $dbForPlatform): void { @@ -51,11 +71,16 @@ abstract class ScheduleBase extends Action * 2. Create timer that sync all changes from 'schedules' collection to local copy. Only reading changes thanks to 'resourceUpdatedAt' attribute * 3. Create timer that prepares coroutines for soon-to-execute schedules. When it's ready, coroutine sleeps until exact time before sending request to worker. */ - protected function schedule(Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void + public function action(BrokerPool $publisher, BrokerPool $publisherMigrations, BrokerPool $publisherFunctions, BrokerPool $publisherMessaging, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void { Console::title(\ucfirst(static::getSupportedResource()) . ' scheduler V1'); Console::success(APP_NAME . ' ' . \ucfirst(static::getSupportedResource()) . ' scheduler v1 has started'); + $this->publisher = $publisher; + $this->publisherMigrations = $publisherMigrations; + $this->publisherFunctions = $publisherFunctions; + $this->publisherMessaging = $publisherMessaging; + $this->scheduleTelemetryCount = $telemetry->createGauge('task.schedule.count'); $this->collectSchedulesTelemetryDuration = $telemetry->createHistogram('task.schedule.collect_schedules.duration', 's'); $this->collectSchedulesTelemetryCount = $telemetry->createGauge('task.schedule.collect_schedules.count'); @@ -87,7 +112,7 @@ abstract class ScheduleBase extends Action } } - protected function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void + private function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void { // If we haven't synced yet, load all active schedules $initialLoad = $lastSyncUpdate === "0"; diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index cdfb188190..14a4259e17 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -5,15 +5,12 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Func; use Swoole\Coroutine as Co; use Utopia\Database\Database; -use Utopia\Telemetry\Adapter as Telemetry; class ScheduleExecutions extends ScheduleBase { public const UPDATE_TIMER = 3; // seconds public const ENQUEUE_TIMER = 4; // seconds - protected Func $queueForFunctions; - public static function getName(): string { return 'schedule-executions'; @@ -29,27 +26,12 @@ class ScheduleExecutions extends ScheduleBase return 'executions'; } - public function __construct() - { - $this - ->desc('Execute executions scheduled in Appwrite') - ->inject('queueForFunctions') - ->inject('dbForPlatform') - ->inject('getProjectDB') - ->inject('telemetry') - ->callback($this->action(...)); - } - - public function action(Func $queueForFunctions, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void - { - $this->queueForFunctions = $queueForFunctions; - $this->schedule($dbForPlatform, $getProjectDB, $telemetry); - } - protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { $intervalEnd = (new \DateTime())->modify('+' . self::ENQUEUE_TIMER . ' seconds'); + $queueForFunctions = new Func($this->publisherFunctions); + foreach ($this->schedules as $schedule) { if (!$schedule['active']) { $dbForPlatform->deleteDocument( @@ -75,8 +57,7 @@ class ScheduleExecutions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); - \go(function () use ($schedule, $scheduledAt, $delay, $data) { - $queueForFunctions = clone $this->queueForFunctions; + \go(function () use ($queueForFunctions, $schedule, $scheduledAt, $delay, $data) { Co::sleep($delay); $queueForFunctions->setType('schedule') diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index d8ded60ec6..6f072425e4 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -7,7 +7,7 @@ use Cron\CronExpression; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Telemetry\Adapter as Telemetry; +use Utopia\Pools\Group; class ScheduleFunctions extends ScheduleBase { @@ -15,7 +15,6 @@ class ScheduleFunctions extends ScheduleBase public const ENQUEUE_TIMER = 60; // seconds private ?float $lastEnqueueUpdate = null; - protected Func $queueForFunctions; public static function getName(): string { @@ -32,23 +31,6 @@ class ScheduleFunctions extends ScheduleBase return 'functions'; } - public function __construct() - { - $this - ->desc('Execute functions scheduled in Appwrite') - ->inject('queueForFunctions') - ->inject('dbForPlatform') - ->inject('getProjectDB') - ->inject('telemetry') - ->callback($this->action(...)); - } - - public function action(Func $queueForFunctions, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void - { - $this->queueForFunctions = $queueForFunctions; - $this->schedule($dbForPlatform, $getProjectDB, $telemetry); - } - protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { $timerStart = \microtime(true); @@ -95,8 +77,6 @@ class ScheduleFunctions extends ScheduleBase foreach ($delayedExecutions as $delay => $schedules) { \go(function () use ($delay, $schedules, $dbForPlatform) { - $queueForFunctions = clone $this->queueForFunctions; - \sleep($delay); // in seconds foreach ($schedules as $delayConfig) { @@ -110,6 +90,8 @@ class ScheduleFunctions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); + $queueForFunctions = new Func($this->publisherFunctions); + $queueForFunctions ->setType('schedule') ->setFunction($schedule['resource']) diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 58a0a76b3e..fe4afbe69c 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -4,15 +4,12 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Messaging; use Utopia\Database\Database; -use Utopia\Telemetry\Adapter as Telemetry; class ScheduleMessages extends ScheduleBase { public const UPDATE_TIMER = 3; // seconds public const ENQUEUE_TIMER = 4; // seconds - protected Messaging $queueForMessaging; - public static function getName(): string { return 'schedule-messages'; @@ -28,23 +25,6 @@ class ScheduleMessages extends ScheduleBase return 'messages'; } - public function __construct() - { - $this - ->desc('Execute messages scheduled in Appwrite') - ->inject('queueForMessaging') - ->inject('dbForPlatform') - ->inject('getProjectDB') - ->inject('telemetry') - ->callback($this->action(...)); - } - - public function action(Messaging $queueForMessaging, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void - { - $this->queueForMessaging = $queueForMessaging; - $this->schedule($dbForPlatform, $getProjectDB, $telemetry); - } - protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { foreach ($this->schedules as $schedule) { @@ -60,9 +40,10 @@ class ScheduleMessages extends ScheduleBase } \go(function () use ($schedule, $scheduledAt, $dbForPlatform) { + $queueForMessaging = new Messaging($this->publisherMessaging); + $this->updateProjectAccess($schedule['project'], $dbForPlatform); - $queueForMessaging = clone $this->queueForMessaging; $queueForMessaging ->setType(MESSAGE_SEND_TYPE_EXTERNAL) ->setMessageId($schedule['resourceId']) From a8bbac4800a2e2d2d81f90594d909ee0a462b7f8 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k <83803257+ArnabChatterjee20k@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:50:23 +0530 Subject: [PATCH 52/75] Update src/Appwrite/Utopia/Database/Validator/Spatial.php Co-authored-by: Jake Barnby --- src/Appwrite/Utopia/Database/Validator/Spatial.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Appwrite/Utopia/Database/Validator/Spatial.php b/src/Appwrite/Utopia/Database/Validator/Spatial.php index 3c28b66ce7..ed896ce875 100644 --- a/src/Appwrite/Utopia/Database/Validator/Spatial.php +++ b/src/Appwrite/Utopia/Database/Validator/Spatial.php @@ -32,7 +32,6 @@ class Spatial extends JSON */ public function isValid($value): bool { - if (!parent::isValid($value)) { return false; } From 28b0d95d05b930d2b0d0f4c54145ef3f30786ed0 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k <83803257+ArnabChatterjee20k@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:50:38 +0530 Subject: [PATCH 53/75] Update app/config/errors.php Co-authored-by: Jake Barnby --- app/config/errors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/errors.php b/app/config/errors.php index a54eedf3c9..e179a1a838 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -844,7 +844,7 @@ return [ Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED => [ 'name' => Exception::ATTRIBUTE_TYPE_NOT_SUPPORTED, - 'description' => "Attribute type not supported by the adapter.", + 'description' => 'Attribute type is not supported.', 'code' => 400, ], From 8734125a738afc478792e63890e7f2da3aec18b4 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k <83803257+ArnabChatterjee20k@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:50:50 +0530 Subject: [PATCH 54/75] Update app/config/errors.php Co-authored-by: Jake Barnby --- app/config/errors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/errors.php b/app/config/errors.php index e179a1a838..156af5db8f 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -908,7 +908,7 @@ return [ ], Exception::COLUMN_TYPE_NOT_SUPPORTED => [ 'name' => Exception::COLUMN_TYPE_NOT_SUPPORTED, - 'description' => "Column type not supported by the adapter.", + 'description' => 'Column type is not supported.', 'code' => 400, ], From 4895865a01d65b4726175bc0290007547e515824 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 17:58:25 +0530 Subject: [PATCH 55/75] removed redundant comments from ai + removed spatial type conditions --- .../Databases/Http/Databases/Collections/Indexes/Create.php | 2 -- src/Appwrite/Utopia/Response/Model/AttributeLine.php | 4 ---- src/Appwrite/Utopia/Response/Model/AttributePoint.php | 4 ---- src/Appwrite/Utopia/Response/Model/AttributePolygon.php | 4 ---- src/Appwrite/Utopia/Response/Model/ColumnLine.php | 4 ---- src/Appwrite/Utopia/Response/Model/ColumnPoint.php | 4 ---- src/Appwrite/Utopia/Response/Model/ColumnPolygon.php | 4 ---- 7 files changed, 26 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php index c5a429a79b..733259f091 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -190,8 +190,6 @@ class Create extends Action 'orders' => $orders, ]); - // Determine adapter capabilities. For TablesDB, be permissive to accept requests - // and let the background worker enforce engine-specific constraints. $maxIndexLength = $dbForProject->getAdapter()->getMaxIndexLength(); $internalIndexesKeys = $dbForProject->getAdapter()->getInternalIndexesKeys(); $supportForIndexArray = $dbForProject->getAdapter()->getSupportForIndexArray(); diff --git a/src/Appwrite/Utopia/Response/Model/AttributeLine.php b/src/Appwrite/Utopia/Response/Model/AttributeLine.php index 6e0586e8b4..a4d9c75672 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeLine.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeLine.php @@ -21,10 +21,6 @@ class AttributeLine extends Attribute ; } - public array $conditions = [ - 'type' => 'linestring' - ]; - /** * Get Name * diff --git a/src/Appwrite/Utopia/Response/Model/AttributePoint.php b/src/Appwrite/Utopia/Response/Model/AttributePoint.php index 4a13054d96..47b83cc58b 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePoint.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePoint.php @@ -21,10 +21,6 @@ class AttributePoint extends Attribute ; } - public array $conditions = [ - 'type' => 'point' - ]; - /** * Get Name * diff --git a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php index c28d8f66ed..8ef7f4ab73 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php @@ -21,10 +21,6 @@ class AttributePolygon extends Attribute ; } - public array $conditions = [ - 'type' => 'polygon' - ]; - /** * Get Name * diff --git a/src/Appwrite/Utopia/Response/Model/ColumnLine.php b/src/Appwrite/Utopia/Response/Model/ColumnLine.php index 08bd66ce9c..01a6c6fe02 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnLine.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnLine.php @@ -21,10 +21,6 @@ class ColumnLine extends Column ; } - public array $conditions = [ - 'type' => 'linestring' - ]; - /** * Get Name * diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php index ffc6ed6789..6ec5229011 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php @@ -21,10 +21,6 @@ class ColumnPoint extends Column ; } - public array $conditions = [ - 'type' => 'point' - ]; - /** * Get Name * diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php index 9b3a6f1030..6a9a14d548 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php @@ -21,10 +21,6 @@ class ColumnPolygon extends Column ; } - public array $conditions = [ - 'type' => 'polygon' - ]; - /** * Get Name * From 12d2c804312391db32b9e1faea6cb99cd62ec17a Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:03:46 +0530 Subject: [PATCH 56/75] replaced table with collection --- .../Http/Databases/Collections/Attributes/Line/Create.php | 2 +- .../Http/Databases/Collections/Attributes/Point/Create.php | 2 +- .../Http/Databases/Collections/Attributes/Polygon/Create.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index ce2452bba1..9062bf87a2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -61,7 +61,7 @@ class Create extends Action ), )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php index 08dbda651a..6af656ce05 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -61,7 +61,7 @@ class Create extends Action ), )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index 5ef77fd32f..b661dbdb87 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -61,7 +61,7 @@ class Create extends Action ), )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('collectionId', '', new UID(), 'Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) From e904fa6f9d3cb79d3a020b0ca1a679419b9a0703 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:05:28 +0530 Subject: [PATCH 57/75] overwrite decodedDefault with the default --- .../Http/Databases/Collections/Attributes/Line/Create.php | 2 +- .../Http/Databases/Collections/Attributes/Line/Update.php | 4 ++-- .../Http/Databases/Collections/Attributes/Point/Create.php | 4 ++-- .../Http/Databases/Collections/Attributes/Point/Update.php | 4 ++-- .../Http/Databases/Collections/Attributes/Polygon/Create.php | 4 ++-- .../Http/Databases/Collections/Attributes/Polygon/Update.php | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index 9062bf87a2..1d26e1676c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -74,7 +74,7 @@ class Create extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { - $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $default = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php index c9bdb7d02b..b1aa827091 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -74,7 +74,7 @@ class Update extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void { - $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $default = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -83,7 +83,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, type: Database::VAR_LINESTRING, - default: $decodedDefault, + default: $default, required: $required, newKey: $newKey ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php index 6af656ce05..4cc520f34e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -74,13 +74,13 @@ class Create extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { - $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $default = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POINT, 'required' => $required, - 'default' => $decodedDefault, + 'default' => $default, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php index 02b8bff2e5..222da133b2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -74,7 +74,7 @@ class Update extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void { - $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $default = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -83,7 +83,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, type: Database::VAR_POINT, - default: $decodedDefault, + default: $default, required: $required, newKey: $newKey ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index b661dbdb87..99ef5fda88 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -74,13 +74,13 @@ class Create extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void { - $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $default = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POLYGON, 'required' => $required, - 'default' => $decodedDefault, + 'default' => $default, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php index 9faee180f0..c5604f4e86 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -73,7 +73,7 @@ class Update extends Action public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void { - $decodedDefault = \is_string($default) ? \json_decode($default, true) : $default; + $default = \is_string($default) ? \json_decode($default, true) : $default; $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -82,7 +82,7 @@ class Update extends Action dbForProject: $dbForProject, queueForEvents: $queueForEvents, type: Database::VAR_POLYGON, - default: $decodedDefault, + default: $default, required: $required, newKey: $newKey ); From a9138d7e8dfe76d308af1e8b87fefa6cec19bdb6 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:06:25 +0530 Subject: [PATCH 58/75] overwrite decodedDefault with default --- .../Http/Databases/Collections/Attributes/Line/Create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index 1d26e1676c..cfc46a97df 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -80,7 +80,7 @@ class Create extends Action 'key' => $key, 'type' => Database::VAR_LINESTRING, 'required' => $required, - 'default' => $decodedDefault + 'default' => $default ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); $response From 2004ed55a5ec9dc49dff8d57b1648ca93019cf3a Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:11:49 +0530 Subject: [PATCH 59/75] reset readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f2afe3a86..9cd5808e33 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -> We just announced Opt-in relationship loading for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-opt-in-relationship-loading) +> We just announced Timestamp Overrides for Appwrite Databases - [Learn more](https://appwrite.io/blog/post/announcing-timestamp-overrides) > Appwrite Cloud is now Generally Available - [Learn more](https://appwrite.io/cloud-ga) From 39fc7e996b27b200565751c6343951b1b1194787 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:18:22 +0530 Subject: [PATCH 60/75] changed database service to tablesdb service for all tablesdb --- .../Databases/Http/TablesDB/Tables/Columns/Line/Create.php | 2 +- .../Databases/Http/TablesDB/Tables/Columns/Line/Update.php | 2 +- .../Databases/Http/TablesDB/Tables/Columns/Point/Create.php | 2 +- .../Databases/Http/TablesDB/Tables/Columns/Point/Update.php | 2 +- .../Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php | 2 +- .../Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php index 4777b99398..32cafae529 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -53,7 +53,7 @@ class Create extends LineCreate ] )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php index 65910b62f7..9aea87ec42 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php @@ -55,7 +55,7 @@ class Update extends LineUpdate contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php index d0cc9a34d3..3615531b89 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -53,7 +53,7 @@ class Create extends PointCreate ] )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php index 230750b23d..d2b741d4c7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -55,7 +55,7 @@ class Update extends PointUpdate contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php index d261c4ec14..dc16258596 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -53,7 +53,7 @@ class Create extends PolygonCreate ] )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php index 7e06aafdca..aba20fca63 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php @@ -55,7 +55,7 @@ class Update extends PolygonUpdate contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') - ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') + ->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true) From dd15023a2b276260a966bf738397f479da96a771 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:35:42 +0530 Subject: [PATCH 61/75] used import --- .../Http/Databases/Collections/Attributes/Polygon/Update.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php index c5604f4e86..0b056a26fb 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -15,6 +15,7 @@ use Utopia\Database\Database; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; +use Utopia\Validator\Boolean; use Utopia\Validator\Nullable; class Update extends Action @@ -62,7 +63,7 @@ class Update extends Action ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') - ->param('required', null, new \Utopia\Validator\Boolean(), 'Is attribute required?') + ->param('required', null, new Boolean(), 'Is attribute required?') ->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') From 5a6955debd2bf19fad879c5656cecda19ae25356 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 18:38:06 +0530 Subject: [PATCH 62/75] typo fix --- src/Appwrite/Utopia/Database/Validator/Spatial.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Utopia/Database/Validator/Spatial.php b/src/Appwrite/Utopia/Database/Validator/Spatial.php index ed896ce875..65ba9b83b8 100644 --- a/src/Appwrite/Utopia/Database/Validator/Spatial.php +++ b/src/Appwrite/Utopia/Database/Validator/Spatial.php @@ -2,7 +2,7 @@ namespace Appwrite\Utopia\Database\Validator; -use Utopia\Database\Validator\Spatial as SpatialVaildator; +use Utopia\Database\Validator\Spatial as SpatialValidator; use Utopia\Validator\JSON; class Spatial extends JSON @@ -36,7 +36,7 @@ class Spatial extends JSON return false; } $value = \json_decode($value, true); - $validator = new SpatialVaildator($this->spatialAttributeType); + $validator = new SpatialValidator($this->spatialAttributeType); return $validator->isValid($value); } } From e3af59332c648b6456796045f56864a67f7bf03c Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Wed, 3 Sep 2025 18:45:43 +0530 Subject: [PATCH 63/75] Replace err with warning --- app/controllers/api/vcs.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 9448618cb7..8ca0decacf 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -15,6 +15,7 @@ use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Appwrite\Vcs\Comment; use Utopia\App; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -147,7 +148,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId break; } catch (\Throwable $err) { if ($retries >= 9) { - throw $err; + Console::warning("Error creating vcs comment lock for " . $latestCommentId . ": " . $err->getMessage()); } \sleep(1); @@ -214,7 +215,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId break; } catch (\Throwable $err) { if ($retries >= 9) { - throw $err; + Console::warning("Error creating vcs comment lock for " . $latestCommentId . ": " . $err->getMessage()); } \sleep(1); @@ -425,7 +426,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId break; } catch (\Throwable $err) { if ($retries >= 9) { - throw $err; + Console::warning("Error creating vcs comment lock for " . $latestCommentId . ": " . $err->getMessage()); } \sleep(1); From a2e9ee73dc6b52629ebaeb6f63d642d505cdd92c Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 19:36:24 +0530 Subject: [PATCH 64/75] bulk upsert support --- .../Collections/Documents/Bulk/Upsert.php | 18 ++++++- .../Http/TablesDB/Tables/Rows/Bulk/Upsert.php | 4 ++ .../Realtime/RealtimeCustomClientTest.php | 50 +++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php index 3c6e5ddc57..bc26d4b4ad 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk; +use Appwrite\Event\Event; use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action; @@ -74,11 +75,15 @@ class Upsert extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') ->inject('plan') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, array $documents, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan): void + public function action(string $databaseId, string $collectionId, array $documents, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, Event $queueForEvents, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, array $plan): void { $database = $dbForProject->getDocument('databases', $databaseId); if ($database->isEmpty()) { @@ -141,5 +146,16 @@ class Upsert extends Action 'total' => $modified, $this->getSdkGroup() => $upserted ]), $this->getResponseModel()); + + $this->triggerBulk( + 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert', + $database, + $collection, + $documents, + $queueForEvents, + $queueForRealtime, + $queueForFunctions, + $queueForWebhooks + ); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php index c4a7c6e677..26c5c8030c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php @@ -61,6 +61,10 @@ class Upsert extends DocumentsUpsert ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') + ->inject('queueForEvents') + ->inject('queueForRealtime') + ->inject('queueForFunctions') + ->inject('queueForWebhooks') ->inject('plan') ->callback($this->action(...)); } diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 60f58bd8ee..3121f9b45f 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -1188,6 +1188,56 @@ class RealtimeCustomClientTest extends Scope $this->assertArrayHasKey('$permissions', $response['data']['payload']); $this->assertIsArray($response['data']['payload']['$permissions']); + // bulk upsert + $this->client->call(Client::METHOD_PUT, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Robert Downey Jr.', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ] + ], + ]); + + $response = json_decode($client->receive(), true); + $response = json_decode($client->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + $client->close(); } From b7a0f5399470a121dd533390fcae5b33b8f067a5 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 19:43:33 +0530 Subject: [PATCH 65/75] updated tests --- tests/e2e/Services/Realtime/RealtimeCustomClientTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 3121f9b45f..e83680db1e 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -1207,7 +1207,6 @@ class RealtimeCustomClientTest extends Scope ], ]); - $response = json_decode($client->receive(), true); $response = json_decode($client->receive(), true); $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); From fdeb8c48c5c350d86cd09e04ea663df52bd4ff27 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Wed, 3 Sep 2025 19:53:20 +0530 Subject: [PATCH 66/75] added permission upsert test --- .../Realtime/RealtimeCustomClientTest.php | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index e83680db1e..3e57c5e9bc 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -1693,6 +1693,107 @@ class RealtimeCustomClientTest extends Scope $this->assertIsArray($response2['data']['payload']['$permissions']); } + // bulk upsert + $this->client->call(Client::METHOD_PUT, "/databases/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Robert Downey Jr.', + '$permissions' => [ + Permission::read(Role::user($user1Id)), + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'Thor', + '$permissions' => [ + Permission::read(Role::user($user2Id)), + ], + ] + ], + ]); + + $response = json_decode($client1->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // client1 shouldnot receive more than 1 event + try { + json_decode(json_decode($client1->receive(), true)); + $this->fail('Expected TimeoutException was not thrown.'); + } catch (Exception $e) { + $this->assertInstanceOf(TimeoutException::class, $e); + } + + $response = json_decode($client2->receive(), true); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(6, $response['data']['channels']); + + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$response['data']['payload']['$id']}.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.*.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.*.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.upsert", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + $this->assertNotEmpty($response['data']['payload']); + $this->assertIsArray($response['data']['payload']); + $this->assertArrayHasKey('$id', $response['data']['payload']); + $this->assertArrayHasKey('name', $response['data']['payload']); + $this->assertArrayHasKey('$permissions', $response['data']['payload']); + $this->assertIsArray($response['data']['payload']['$permissions']); + + // client2 shouldnot receive more than 1 event + try { + json_decode(json_decode($client2->receive(), true)); + $this->fail('Expected TimeoutException was not thrown.'); + } catch (Exception $e) { + $this->assertInstanceOf(TimeoutException::class, $e); + } + + $client1->close(); $client2->close(); } From 52f8cb75cac4133d019bfd4573cfe9c27ffa6c2c Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k <83803257+ArnabChatterjee20k@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:27:23 +0530 Subject: [PATCH 67/75] Update Upsert.php --- .../Http/Databases/Collections/Documents/Bulk/Upsert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php index bc26d4b4ad..395e3d757b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Upsert.php @@ -151,7 +151,7 @@ class Upsert extends Action 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert', $database, $collection, - $documents, + $upserted, $queueForEvents, $queueForRealtime, $queueForFunctions, From b75952071e18e21f4379c35d87a3fae7ae5cc2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 3 Sep 2025 17:32:15 +0200 Subject: [PATCH 68/75] Support array headers for set-cookie --- app/controllers/general.php | 62 +++++++++++++++++++------------- docker-compose.yml | 2 +- src/Appwrite/Utopia/Response.php | 16 +++++++-- src/Executor/Executor.php | 12 +++++-- 4 files changed, 61 insertions(+), 31 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 40ce66b574..46913d2d96 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -562,15 +562,18 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw cpus: $spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT, memory: $spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT, logging: $resource->getAttribute('logging', true), - requestTimeout: 30 + requestTimeout: 30, + responseFormat: Executor::RESPONSE_FORMAT_ARRAY_HEADERS ); + $headerOverrides = []; + // Branded 404 override $isResponseBranded = false; if ($executionResponse['statusCode'] === 404 && $deployment->getAttribute('adapter', '') === 'static') { $layout = new View(__DIR__ . '/../views/general/404.phtml'); $executionResponse['body'] = $layout->render(); - $executionResponse['headers']['content-length'] = \strlen($executionResponse['body']); + $headerOverrides['content-length'] = \strlen($executionResponse['body']); $isResponseBranded = true; } @@ -580,15 +583,16 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $transformation = new Transformation(); $transformation->addAdapter(new Preview()); $transformation->setInput($executionResponse['body']); - $transformation->setTraits($executionResponse['headers']); + + $simpleHeaders = []; + foreach ($executionResponse['headers'] as $key => $value) { + $simpleHeaders[$key] = \is_array($value) ? \implode(', ', $value) : $value; + } + + $transformation->setTraits($simpleHeaders); if ($isPreview && $transformation->transform()) { $executionResponse['body'] = $transformation->getOutput(); - - foreach ($executionResponse['headers'] as $key => $value) { - if (\strtolower($key) === 'content-length') { - $executionResponse['headers'][$key] = \strlen($executionResponse['body']); - } - } + $headerOverrides['content-length'] = \strlen($executionResponse['body']); } } } @@ -602,25 +606,33 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ->setParam('code', $executionResponse['statusCode']); $executionResponse['body'] = $layout->render(); - foreach ($executionResponse['headers'] as $key => $value) { - if (\strtolower($key) === 'content-length') { - $executionResponse['headers'][$key] = \strlen($executionResponse['body']); - } elseif (\strtolower($key) === 'content-type') { - $executionResponse['headers'][$key] = 'text/html'; - } - } + + $headerOverrides['content-length'] = \strlen($executionResponse['body']); + $headerOverrides['content-type'] = 'text/html'; } if ($deployment->getAttribute('resourceType') === 'functions') { - $executionResponse['headers']['x-appwrite-execution-id'] = $execution->getId(); + $headerOverrides['x-appwrite-execution-id'] = $execution->getId(); } elseif ($deployment->getAttribute('resourceType') === 'sites') { - $executionResponse['headers']['x-appwrite-log-id'] = $execution->getId(); + $headerOverrides['x-appwrite-log-id'] = $execution->getId(); + } + + foreach ($headerOverrides as $key => $value) { + if (\array_key_exists($key, $executionResponse['headers'])) { + if (\is_array($executionResponse['headers'][$key])) { + $executionResponse['headers'][$key][] = $value; + } else { + $executionResponse['headers'][$key] = [$executionResponse['headers'][$key], $value]; + } + } else { + $executionResponse['headers'][$key] = $value; + } } $headersFiltered = []; foreach ($executionResponse['headers'] as $key => $value) { if (\in_array(\strtolower($key), FUNCTION_ALLOWLIST_HEADERS_RESPONSE)) { - $headersFiltered[] = ['name' => $key, 'value' => $value]; + $headersFiltered[] = ['name' => $key, 'value' => \is_array($value) ? \implode(', ', $value) : $value]; } } @@ -687,7 +699,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $headers = []; foreach (($executionResponse['headers'] ?? []) as $key => $value) { - $headers[] = ['name' => $key, 'value' => $value]; + $headers[] = ['name' => $key, 'value' => \is_array($value) ? \implode(', ', $value) : $value]; } $execution->setAttribute('responseBody', $executionResponse['body'] ?? ''); @@ -696,16 +708,16 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $body = $execution['responseBody'] ?? ''; $contentType = 'text/plain'; - foreach ($execution['responseHeaders'] as $header) { - if (\strtolower($header['name']) === 'content-type') { - $contentType = $header['value']; + foreach ($executionResponse['headers'] as $name => $values) { + if (\strtolower($name) === 'content-type') { + $contentType = $values[0] ?? 'text/plain'; } - if (\strtolower($header['name']) === 'transfer-encoding') { + if (\strtolower($name) === 'transfer-encoding') { continue; } - $response->addHeader(\strtolower($header['name']), $header['value']); + $response->setHeader($name, $values); } $response diff --git a/docker-compose.yml b/docker-compose.yml index 87385aa086..4ab62832d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -966,7 +966,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.8.1 + image: tmpexecutor restart: unless-stopped networks: - appwrite diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 35c43ef07c..4a59ce77ad 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -411,6 +411,8 @@ class Response extends SwooleResponse */ protected static bool $showSensitive = false; + protected SwooleHTTPResponse $swoole; + /** * Response constructor. * @@ -418,6 +420,8 @@ class Response extends SwooleResponse */ public function __construct(SwooleHTTPResponse $response) { + $this->swoole = $response; + $this // General ->setModel(new None()) @@ -955,12 +959,18 @@ class Response extends SwooleResponse * Set Header * * @param string $key - * @param string $value + * @param string|array $value * @return void */ - public function setHeader(string $key, string $value): void + public function setHeader(string $key, mixed $value): void { - $this->sendHeader($key, $value); + if (is_array($value)) { + // Temporary solution to support proxying Set-cookie (2 cookies, 1 name) + // Ideally this would live in http library, supporting array of values in all adapters + $this->swoole->header($key, $value); + } else { + $this->sendHeader($key, $value); + } } /** diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index df4c5fd8f5..30c6132b76 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -9,6 +9,12 @@ use Utopia\System\System; class Executor { + // 0.8.6 is last version with object-based headers + public const RESPONSE_FORMAT_OBJECT_HEADERS = '0.10.0'; + + // 0.9.0 is first version with array-based headers + public const RESPONSE_FORMAT_ARRAY_HEADERS = '0.11.0'; + public const METHOD_GET = 'GET'; public const METHOD_POST = 'POST'; public const METHOD_PUT = 'PUT'; @@ -170,6 +176,7 @@ class Executor * @param string $entrypoint * @param string $runtimeEntrypoint * @param bool $logging + * @param string $responseFormat * * @return array */ @@ -190,7 +197,8 @@ class Executor int $memory, bool $logging, string $runtimeEntrypoint = '', - ?int $requestTimeout = null + ?int $requestTimeout = null, + string $responseFormat = self::RESPONSE_FORMAT_OBJECT_HEADERS ) { if (empty($headers['host'])) { $headers['host'] = System::getEnv('_APP_DOMAIN', ''); @@ -232,7 +240,7 @@ class Executor $requestTimeout = $timeout + 15; } - $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data' ], $params, true, $requestTimeout); + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data', 'x-executor-response-format' => $responseFormat ], $params, true, $requestTimeout); $status = $response['headers']['status-code']; if ($status >= 400) { From 128a35bd4d7676f8571c7e21ad2d6dc09ab09ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 3 Sep 2025 17:36:35 +0200 Subject: [PATCH 69/75] Use executor 0.11.0 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4ab62832d6..da6362b4c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -966,7 +966,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: tmpexecutor + image: openruntimes/executor:0.11.0 restart: unless-stopped networks: - appwrite From 10cfc159042cd57002c1b501a5055e0150616cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 3 Sep 2025 17:49:10 +0200 Subject: [PATCH 70/75] Add set-cookie tests --- tests/e2e/Services/Sites/SitesCustomServerTest.php | 6 ++++-- tests/resources/sites/astro/src/pages/cookies.js | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index d28e2fe8b4..c8301b9428 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -2775,11 +2775,13 @@ class SitesCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $response = $proxyClient->call(Client::METHOD_GET, '/cookies', [ - 'cookie' => 'custom-session-id=abcd123' + 'cookie' => 'custom-session-id=abcd123; custom-user-id=efgh456' ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals("abcd123", $response['body']); + $this->assertEquals("abcd123;efgh456", $response['body']); + $this->assertEquals("value-one", $response['cookies']['my-cookie-one']); + $this->assertEquals("value-two", $response['cookies']['my-cookie-two']); $this->cleanupSite($siteId); } diff --git a/tests/resources/sites/astro/src/pages/cookies.js b/tests/resources/sites/astro/src/pages/cookies.js index 5f5efac833..65911c8aeb 100644 --- a/tests/resources/sites/astro/src/pages/cookies.js +++ b/tests/resources/sites/astro/src/pages/cookies.js @@ -1,4 +1,9 @@ export async function GET(context) { const sessionId = context.cookies.get("custom-session-id")?.value ?? 'Custom session ID missing'; - return new Response(sessionId); + const userId = context.cookies.get("custom-user-id")?.value ?? 'Custom user ID missing'; + + context.cookies.set('my-cookie-one', 'value-one'); + context.cookies.set('my-cookie-two', 'value-two'); + + return new Response(sessionId + ";" + userId); } From f6308b34774355e334444eda8a4031395d9c664e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 3 Sep 2025 17:57:12 +0200 Subject: [PATCH 71/75] AI code quality fixes --- app/controllers/general.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/general.php b/app/controllers/general.php index 46913d2d96..b4ad7917cd 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -711,6 +711,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw foreach ($executionResponse['headers'] as $name => $values) { if (\strtolower($name) === 'content-type') { $contentType = $values[0] ?? 'text/plain'; + continue; } if (\strtolower($name) === 'transfer-encoding') { From 5c5c4e432f869bbb738baeeeef54aa75f35eb0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 3 Sep 2025 18:04:58 +0200 Subject: [PATCH 72/75] Fix content type header --- app/controllers/general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index b4ad7917cd..50d56ff9fd 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -710,7 +710,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $contentType = 'text/plain'; foreach ($executionResponse['headers'] as $name => $values) { if (\strtolower($name) === 'content-type') { - $contentType = $values[0] ?? 'text/plain'; + $contentType = \is_array($values) ? $values[0] : $values; continue; } From 3aa163a21efc5a117fc6e97c28c0dc1a149e9394 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Thu, 4 Sep 2025 11:50:12 +0530 Subject: [PATCH 73/75] Update comment only if lock is acquired, else continue --- app/controllers/api/vcs.php | 74 +++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 8ca0decacf..5bda9961f3 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -137,14 +137,16 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $latestCommentId = $latestComment->getAttribute('providerCommentId', ''); $retries = 0; + $lockAcquired = false; - while (true) { + while ($retries < 9) { $retries++; try { $dbForPlatform->createDocument('vcsCommentLocks', new Document([ '$id' => $latestCommentId ])); + $lockAcquired = true; break; } catch (\Throwable $err) { if ($retries >= 9) { @@ -155,15 +157,17 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } - // Wrap in try/finally to ensure lock file gets deleted - try { - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + if ($lockAcquired) { + // Wrap in try/finally to ensure lock file gets deleted + try { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); - $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); - } finally { - $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } } } else { $comment = new Comment(); @@ -204,14 +208,16 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $latestCommentId = $comment->getAttribute('providerCommentId', ''); $retries = 0; + $lockAcquired = false; - while (true) { + while ($retries < 9) { $retries++; try { $dbForPlatform->createDocument('vcsCommentLocks', new Document([ '$id' => $latestCommentId ])); + $lockAcquired = true; break; } catch (\Throwable $err) { if ($retries >= 9) { @@ -222,15 +228,17 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } - // Wrap in try/finally to ensure lock file gets deleted - try { - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); + if ($lockAcquired) { + // Wrap in try/finally to ensure lock file gets deleted + try { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, ''); - $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); - } finally { - $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); + } } } } @@ -415,14 +423,16 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if ($resource->getCollection() === 'sites' && !empty($latestCommentId) && !empty($previewRuleId)) { $retries = 0; + $lockAcquired = false; - while (true) { + while ($retries < 9) { $retries++; try { $dbForPlatform->createDocument('vcsCommentLocks', new Document([ '$id' => $latestCommentId ])); + $lockAcquired = true; break; } catch (\Throwable $err) { if ($retries >= 9) { @@ -433,21 +443,23 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } - // Wrap in try/finally to ensure lock file gets deleted - try { - $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); + if ($lockAcquired) { + // Wrap in try/finally to ensure lock file gets deleted + try { + $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; - $previewUrl = !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : ''; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $previewUrl = !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : ''; - if (!empty($previewUrl)) { - $comment = new Comment(); - $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); - $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, $previewUrl); - $github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment()); + if (!empty($previewUrl)) { + $comment = new Comment(); + $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); + $comment->addBuild($project, $resource, $resourceType, $commentStatus, $deploymentId, $action, $previewUrl); + $github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment()); + } + } finally { + $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); } - } finally { - $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId); } } From e7113a080d426bccde21fbb3fb493beb44b65924 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 4 Sep 2025 12:57:43 +0530 Subject: [PATCH 74/75] removed spaital type response and will be using the json type for the spatial responses --- src/Appwrite/GraphQL/Types/Mapper.php | 3 +-- src/Appwrite/Utopia/Response/Model.php | 1 - src/Appwrite/Utopia/Response/Model/AttributeLine.php | 2 +- src/Appwrite/Utopia/Response/Model/AttributePoint.php | 2 +- src/Appwrite/Utopia/Response/Model/AttributePolygon.php | 2 +- src/Appwrite/Utopia/Response/Model/ColumnLine.php | 2 +- src/Appwrite/Utopia/Response/Model/ColumnPoint.php | 2 +- src/Appwrite/Utopia/Response/Model/ColumnPolygon.php | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 244a0c0ccb..214dbbb976 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -57,8 +57,7 @@ class Mapper 'datetime' => Type::string(), 'json' => Types::json(), 'none' => Types::json(), - 'any' => Types::json(), - 'spatial' => Types::json(), + 'any' => Types::json() ]; foreach ($defaults as $type => $default) { diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index f40c89f093..80c2c4d620 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -15,7 +15,6 @@ abstract class Model public const TYPE_DATETIME_EXAMPLE = '2020-10-15T06:38:00.000+00:00'; public const TYPE_RELATIONSHIP = 'relationship'; public const TYPE_PAYLOAD = 'payload'; - public const TYPE_SPATIAL = 'spatial'; /** * @var bool diff --git a/src/Appwrite/Utopia/Response/Model/AttributeLine.php b/src/Appwrite/Utopia/Response/Model/AttributeLine.php index a4d9c75672..d5eab30ca6 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeLine.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeLine.php @@ -12,7 +12,7 @@ class AttributeLine extends Attribute $this ->addRule('default', [ - 'type' => self::TYPE_SPATIAL, + 'type' => self::TYPE_JSON, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/AttributePoint.php b/src/Appwrite/Utopia/Response/Model/AttributePoint.php index 47b83cc58b..e44ecf96d0 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePoint.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePoint.php @@ -12,7 +12,7 @@ class AttributePoint extends Attribute $this ->addRule('default', [ - 'type' => self::TYPE_SPATIAL, + 'type' => self::TYPE_JSON, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php index 8ef7f4ab73..32708f6470 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributePolygon.php +++ b/src/Appwrite/Utopia/Response/Model/AttributePolygon.php @@ -12,7 +12,7 @@ class AttributePolygon extends Attribute $this ->addRule('default', [ - 'type' => self::TYPE_SPATIAL, + 'type' => self::TYPE_JSON, 'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnLine.php b/src/Appwrite/Utopia/Response/Model/ColumnLine.php index 01a6c6fe02..951e787086 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnLine.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnLine.php @@ -12,7 +12,7 @@ class ColumnLine extends Column $this ->addRule('default', [ - 'type' => self::TYPE_SPATIAL, + 'type' => self::TYPE_JSON, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php index 6ec5229011..2e548976aa 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPoint.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPoint.php @@ -12,7 +12,7 @@ class ColumnPoint extends Column $this ->addRule('default', [ - 'type' => self::TYPE_SPATIAL, + 'type' => self::TYPE_JSON, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php index 6a9a14d548..1efcd1199e 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnPolygon.php @@ -12,7 +12,7 @@ class ColumnPolygon extends Column $this ->addRule('default', [ - 'type' => self::TYPE_SPATIAL, + 'type' => self::TYPE_JSON, 'description' => 'Default value for column when not provided. Cannot be set when column is required.', 'default' => null, 'required' => false, From d7a5eb436db3b2d1a52abc2e84e435eedee85ac2 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 4 Sep 2025 13:03:52 +0530 Subject: [PATCH 75/75] generated sdk specs --- app/config/specs/open-api3-1.8.x-client.json | 22 +- app/config/specs/open-api3-1.8.x-console.json | 2068 +++++++++++++++-- app/config/specs/open-api3-1.8.x-server.json | 2034 +++++++++++++++- app/config/specs/open-api3-latest-client.json | 22 +- .../specs/open-api3-latest-console.json | 2068 +++++++++++++++-- app/config/specs/open-api3-latest-server.json | 2034 +++++++++++++++- app/config/specs/swagger2-1.8.x-client.json | 22 +- app/config/specs/swagger2-1.8.x-console.json | 2044 ++++++++++++++-- app/config/specs/swagger2-1.8.x-server.json | 2010 +++++++++++++++- app/config/specs/swagger2-latest-client.json | 22 +- app/config/specs/swagger2-latest-console.json | 2044 ++++++++++++++-- app/config/specs/swagger2-latest-server.json | 2010 +++++++++++++++- 12 files changed, 15336 insertions(+), 1064 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json index 0841dabbd1..c72300e004 100644 --- a/app/config/specs/open-api3-1.8.x-client.json +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -5745,7 +5745,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -5820,7 +5820,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -5936,7 +5936,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -7491,7 +7491,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -7579,7 +7579,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -7724,7 +7724,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -7822,7 +7822,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -7961,7 +7961,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -8063,7 +8063,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -8150,7 +8150,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -8268,7 +8268,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index 31cb8e5105..b39181e025 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -4888,7 +4888,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 488, + "weight": 500, "cookies": false, "type": "", "demo": "console\/get-resource.md", @@ -7768,6 +7768,666 @@ } } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7792,7 +8452,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -7927,7 +8587,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -8048,7 +8708,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -8168,7 +8828,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -8278,7 +8938,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8583,7 +9243,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -10056,7 +10716,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -10142,7 +10802,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -10209,7 +10869,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -10274,7 +10935,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -10349,7 +11010,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -10837,7 +11498,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -10910,7 +11571,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -11143,7 +11804,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -11192,7 +11853,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -11242,7 +11903,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 458, + "weight": 470, "cookies": false, "type": "", "demo": "functions\/list-templates.md", @@ -11342,7 +12003,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 457, + "weight": 469, "cookies": false, "type": "", "demo": "functions\/get-template.md", @@ -11402,7 +12063,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 451, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/list-usage.md", @@ -11474,7 +12135,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -11533,7 +12194,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -11763,7 +12424,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -11824,7 +12485,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -11904,7 +12565,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -11987,7 +12648,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -12083,7 +12744,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -12168,7 +12829,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -12271,7 +12932,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -12368,7 +13029,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -12430,7 +13091,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -12494,7 +13155,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -12584,7 +13245,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -12655,7 +13316,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -12730,7 +13391,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -12846,7 +13507,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -12911,7 +13572,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -12982,7 +13643,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 450, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/get-usage.md", @@ -13064,7 +13725,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -13123,7 +13784,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -13214,7 +13875,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -13283,7 +13944,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -13374,7 +14035,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -23365,7 +24026,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 427, + "weight": 439, "cookies": false, "type": "", "demo": "projects\/list-dev-keys.md", @@ -23433,7 +24094,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 424, + "weight": 436, "cookies": false, "type": "", "demo": "projects\/create-dev-key.md", @@ -23518,7 +24179,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 426, + "weight": 438, "cookies": false, "type": "", "demo": "projects\/get-dev-key.md", @@ -23586,7 +24247,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 425, + "weight": 437, "cookies": false, "type": "", "demo": "projects\/update-dev-key.md", @@ -23672,7 +24333,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 428, + "weight": 440, "cookies": false, "type": "", "demo": "projects\/delete-dev-key.md", @@ -27580,7 +28241,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 489, + "weight": 501, "cookies": false, "type": "", "demo": "proxy\/create-api-rule.md", @@ -27647,7 +28308,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 491, + "weight": 503, "cookies": false, "type": "", "demo": "proxy\/create-function-rule.md", @@ -27725,7 +28386,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 492, + "weight": 504, "cookies": false, "type": "", "demo": "proxy\/create-redirect-rule.md", @@ -27838,7 +28499,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 490, + "weight": 502, "cookies": false, "type": "", "demo": "proxy\/create-site-rule.md", @@ -28087,7 +28748,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -28157,7 +28818,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -28406,7 +29067,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -28455,7 +29116,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -28505,7 +29166,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 483, + "weight": 495, "cookies": false, "type": "", "demo": "sites\/list-templates.md", @@ -28605,7 +29266,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 484, + "weight": 496, "cookies": false, "type": "", "demo": "sites\/get-template.md", @@ -28665,7 +29326,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 485, + "weight": 497, "cookies": false, "type": "", "demo": "sites\/list-usage.md", @@ -28737,7 +29398,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -28796,7 +29457,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -29041,7 +29702,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -29102,7 +29763,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -29182,7 +29843,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -29265,7 +29926,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -29366,7 +30027,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -29446,7 +30107,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -29549,7 +30210,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -29647,7 +30308,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -29709,7 +30370,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -29773,7 +30434,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -29863,7 +30524,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -29934,7 +30595,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -30005,7 +30666,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -30067,7 +30728,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -30138,7 +30799,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 486, + "weight": 498, "cookies": false, "type": "", "demo": "sites\/get-usage.md", @@ -30220,7 +30881,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -30279,7 +30940,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -30370,7 +31031,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -30439,7 +31100,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -30530,7 +31191,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -32002,7 +32663,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -32075,7 +32736,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -32154,7 +32815,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 377, + "weight": 383, "cookies": false, "type": "", "demo": "tablesdb\/list-usage.md", @@ -32251,7 +32912,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -32310,7 +32971,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -32386,7 +33047,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -32447,7 +33108,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -32533,7 +33194,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -32640,7 +33301,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -32712,7 +33373,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -32814,7 +33475,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -32888,7 +33549,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -32975,7 +33636,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -33084,7 +33745,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -33198,7 +33859,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -33307,7 +33968,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -33421,7 +34082,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -33530,7 +34191,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -33644,7 +34305,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -33762,7 +34423,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -33885,7 +34546,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -34004,7 +34665,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -34128,7 +34789,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -34247,7 +34908,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -34371,7 +35032,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -34480,7 +35141,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -34570,6 +35231,660 @@ } } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -34594,7 +35909,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -34728,7 +36043,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -34848,7 +36163,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -34967,7 +36282,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -35076,7 +36391,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -35221,7 +36536,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -35295,7 +36610,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -35378,7 +36693,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -35489,7 +36804,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -35574,7 +36889,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -35640,7 +36955,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -35705,7 +37021,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -35779,7 +37095,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -35862,7 +37178,7 @@ "x-appwrite": { "method": "listTableLogs", "group": "tables", - "weight": 383, + "weight": 389, "cookies": false, "type": "", "demo": "tablesdb\/list-table-logs.md", @@ -35948,7 +37264,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -36036,7 +37352,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -36205,7 +37521,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -36328,7 +37644,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -36425,7 +37741,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -36519,7 +37835,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -36617,7 +37933,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -36756,7 +38072,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -36858,7 +38174,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -36945,7 +38261,7 @@ "x-appwrite": { "method": "listRowLogs", "group": "logs", - "weight": 421, + "weight": 433, "cookies": false, "type": "", "demo": "tablesdb\/list-row-logs.md", @@ -37041,7 +38357,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -37159,7 +38475,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -37277,7 +38593,7 @@ "x-appwrite": { "method": "getTableUsage", "group": null, - "weight": 384, + "weight": 390, "cookies": false, "type": "", "demo": "tablesdb\/get-table-usage.md", @@ -37372,7 +38688,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 376, + "weight": 382, "cookies": false, "type": "", "demo": "tablesdb\/get-usage.md", @@ -38584,7 +39900,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -38664,7 +39980,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -38753,7 +40069,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -38813,7 +40129,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -38883,7 +40199,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -44924,6 +46240,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -45009,6 +46334,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -45885,6 +47219,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -45966,6 +47519,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -46051,6 +47613,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -46927,6 +48498,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index 0fe1cf72ae..22f0affafa 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -7230,6 +7230,672 @@ } } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7254,7 +7920,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -7390,7 +8056,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -7512,7 +8178,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -7633,7 +8299,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -7744,7 +8410,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8052,7 +8718,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -9452,7 +10118,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -9539,7 +10205,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -9607,7 +10273,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -9672,7 +10339,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -9748,7 +10415,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -9833,7 +10500,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -9907,7 +10574,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -10141,7 +10808,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -10191,7 +10858,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -10242,7 +10909,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -10302,7 +10969,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -10533,7 +11200,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -10595,7 +11262,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -10676,7 +11343,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -10760,7 +11427,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -10857,7 +11524,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -10943,7 +11610,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -11047,7 +11714,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -11145,7 +11812,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -11208,7 +11875,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -11273,7 +11940,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -11364,7 +12031,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -11436,7 +12103,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -11513,7 +12180,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -11631,7 +12298,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -11698,7 +12365,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -11770,7 +12437,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -11830,7 +12497,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -11922,7 +12589,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -11992,7 +12659,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -12084,7 +12751,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -19008,7 +19675,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -19079,7 +19746,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -19329,7 +19996,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -19379,7 +20046,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -19430,7 +20097,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -19490,7 +20157,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -19736,7 +20403,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -19798,7 +20465,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -19879,7 +20546,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -19963,7 +20630,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -20065,7 +20732,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -20146,7 +20813,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -20250,7 +20917,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -20349,7 +21016,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -20412,7 +21079,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -20477,7 +21144,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -20568,7 +21235,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -20640,7 +21307,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -20712,7 +21379,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -20775,7 +21442,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -20847,7 +21514,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -20907,7 +21574,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -20999,7 +21666,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -21069,7 +21736,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -21161,7 +21828,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -22501,7 +23168,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -22575,7 +23242,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -22655,7 +23322,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -22715,7 +23382,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -22792,7 +23459,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -22854,7 +23521,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -22941,7 +23608,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -23049,7 +23716,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -23122,7 +23789,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -23225,7 +23892,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -23300,7 +23967,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -23388,7 +24055,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -23498,7 +24165,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -23613,7 +24280,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -23723,7 +24390,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -23838,7 +24505,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -23948,7 +24615,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -24063,7 +24730,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -24182,7 +24849,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -24306,7 +24973,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -24426,7 +25093,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -24551,7 +25218,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -24671,7 +25338,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -24796,7 +25463,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -24906,7 +25573,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -24997,6 +25664,666 @@ } } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -25021,7 +26348,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -25156,7 +26483,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -25277,7 +26604,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -25397,7 +26724,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -25507,7 +26834,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -25653,7 +26980,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -25728,7 +27055,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -25812,7 +27139,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -25924,7 +27251,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -26010,7 +27337,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -26077,7 +27404,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -26142,7 +27470,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -26217,7 +27545,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -26301,7 +27629,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -26391,7 +27719,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -26564,7 +27892,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -26689,7 +28017,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -26787,7 +28115,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -26882,7 +28210,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -26982,7 +28310,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -27124,7 +28452,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -27228,7 +28556,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -27317,7 +28645,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -27437,7 +28765,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -28612,7 +29940,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -28693,7 +30021,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -28783,7 +30111,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -28844,7 +30172,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -28915,7 +30243,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -33782,6 +35110,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -33867,6 +35204,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -34743,6 +36089,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -34824,6 +36389,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -34909,6 +36483,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -35785,6 +37368,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 0841dabbd1..c72300e004 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -5745,7 +5745,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -5820,7 +5820,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -5936,7 +5936,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -7491,7 +7491,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -7579,7 +7579,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -7724,7 +7724,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -7822,7 +7822,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -7961,7 +7961,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -8063,7 +8063,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -8150,7 +8150,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -8268,7 +8268,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 31cb8e5105..b39181e025 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -4888,7 +4888,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 488, + "weight": 500, "cookies": false, "type": "", "demo": "console\/get-resource.md", @@ -7768,6 +7768,666 @@ } } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7792,7 +8452,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -7927,7 +8587,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -8048,7 +8708,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -8168,7 +8828,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -8278,7 +8938,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8583,7 +9243,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -10056,7 +10716,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -10142,7 +10802,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -10209,7 +10869,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -10274,7 +10935,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -10349,7 +11010,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -10837,7 +11498,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -10910,7 +11571,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -11143,7 +11804,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -11192,7 +11853,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -11242,7 +11903,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 458, + "weight": 470, "cookies": false, "type": "", "demo": "functions\/list-templates.md", @@ -11342,7 +12003,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 457, + "weight": 469, "cookies": false, "type": "", "demo": "functions\/get-template.md", @@ -11402,7 +12063,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 451, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/list-usage.md", @@ -11474,7 +12135,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -11533,7 +12194,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -11763,7 +12424,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -11824,7 +12485,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -11904,7 +12565,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -11987,7 +12648,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -12083,7 +12744,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -12168,7 +12829,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -12271,7 +12932,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -12368,7 +13029,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -12430,7 +13091,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -12494,7 +13155,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -12584,7 +13245,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -12655,7 +13316,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -12730,7 +13391,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -12846,7 +13507,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -12911,7 +13572,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -12982,7 +13643,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 450, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/get-usage.md", @@ -13064,7 +13725,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -13123,7 +13784,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -13214,7 +13875,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -13283,7 +13944,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -13374,7 +14035,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -23365,7 +24026,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 427, + "weight": 439, "cookies": false, "type": "", "demo": "projects\/list-dev-keys.md", @@ -23433,7 +24094,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 424, + "weight": 436, "cookies": false, "type": "", "demo": "projects\/create-dev-key.md", @@ -23518,7 +24179,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 426, + "weight": 438, "cookies": false, "type": "", "demo": "projects\/get-dev-key.md", @@ -23586,7 +24247,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 425, + "weight": 437, "cookies": false, "type": "", "demo": "projects\/update-dev-key.md", @@ -23672,7 +24333,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 428, + "weight": 440, "cookies": false, "type": "", "demo": "projects\/delete-dev-key.md", @@ -27580,7 +28241,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 489, + "weight": 501, "cookies": false, "type": "", "demo": "proxy\/create-api-rule.md", @@ -27647,7 +28308,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 491, + "weight": 503, "cookies": false, "type": "", "demo": "proxy\/create-function-rule.md", @@ -27725,7 +28386,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 492, + "weight": 504, "cookies": false, "type": "", "demo": "proxy\/create-redirect-rule.md", @@ -27838,7 +28499,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 490, + "weight": 502, "cookies": false, "type": "", "demo": "proxy\/create-site-rule.md", @@ -28087,7 +28748,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -28157,7 +28818,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -28406,7 +29067,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -28455,7 +29116,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -28505,7 +29166,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 483, + "weight": 495, "cookies": false, "type": "", "demo": "sites\/list-templates.md", @@ -28605,7 +29266,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 484, + "weight": 496, "cookies": false, "type": "", "demo": "sites\/get-template.md", @@ -28665,7 +29326,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 485, + "weight": 497, "cookies": false, "type": "", "demo": "sites\/list-usage.md", @@ -28737,7 +29398,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -28796,7 +29457,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -29041,7 +29702,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -29102,7 +29763,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -29182,7 +29843,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -29265,7 +29926,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -29366,7 +30027,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -29446,7 +30107,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -29549,7 +30210,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -29647,7 +30308,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -29709,7 +30370,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -29773,7 +30434,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -29863,7 +30524,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -29934,7 +30595,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -30005,7 +30666,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -30067,7 +30728,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -30138,7 +30799,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 486, + "weight": 498, "cookies": false, "type": "", "demo": "sites\/get-usage.md", @@ -30220,7 +30881,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -30279,7 +30940,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -30370,7 +31031,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -30439,7 +31100,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -30530,7 +31191,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -32002,7 +32663,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -32075,7 +32736,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -32154,7 +32815,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 377, + "weight": 383, "cookies": false, "type": "", "demo": "tablesdb\/list-usage.md", @@ -32251,7 +32912,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -32310,7 +32971,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -32386,7 +33047,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -32447,7 +33108,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -32533,7 +33194,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -32640,7 +33301,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -32712,7 +33373,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -32814,7 +33475,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -32888,7 +33549,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -32975,7 +33636,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -33084,7 +33745,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -33198,7 +33859,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -33307,7 +33968,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -33421,7 +34082,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -33530,7 +34191,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -33644,7 +34305,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -33762,7 +34423,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -33885,7 +34546,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -34004,7 +34665,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -34128,7 +34789,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -34247,7 +34908,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -34371,7 +35032,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -34480,7 +35141,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -34570,6 +35231,660 @@ } } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -34594,7 +35909,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -34728,7 +36043,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -34848,7 +36163,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -34967,7 +36282,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -35076,7 +36391,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -35221,7 +36536,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -35295,7 +36610,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -35378,7 +36693,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -35489,7 +36804,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -35574,7 +36889,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -35640,7 +36955,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -35705,7 +37021,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -35779,7 +37095,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -35862,7 +37178,7 @@ "x-appwrite": { "method": "listTableLogs", "group": "tables", - "weight": 383, + "weight": 389, "cookies": false, "type": "", "demo": "tablesdb\/list-table-logs.md", @@ -35948,7 +37264,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -36036,7 +37352,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -36205,7 +37521,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -36328,7 +37644,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -36425,7 +37741,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -36519,7 +37835,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -36617,7 +37933,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -36756,7 +38072,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -36858,7 +38174,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -36945,7 +38261,7 @@ "x-appwrite": { "method": "listRowLogs", "group": "logs", - "weight": 421, + "weight": 433, "cookies": false, "type": "", "demo": "tablesdb\/list-row-logs.md", @@ -37041,7 +38357,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -37159,7 +38475,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -37277,7 +38593,7 @@ "x-appwrite": { "method": "getTableUsage", "group": null, - "weight": 384, + "weight": 390, "cookies": false, "type": "", "demo": "tablesdb\/get-table-usage.md", @@ -37372,7 +38688,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 376, + "weight": 382, "cookies": false, "type": "", "demo": "tablesdb\/get-usage.md", @@ -38584,7 +39900,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -38664,7 +39980,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -38753,7 +40069,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -38813,7 +40129,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -38883,7 +40199,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -44924,6 +46240,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -45009,6 +46334,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -45885,6 +47219,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -45966,6 +47519,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -46051,6 +47613,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -46927,6 +48498,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 0fe1cf72ae..22f0affafa 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7230,6 +7230,672 @@ } } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeLine" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePoint" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributePolygon" + } + } + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7254,7 +7920,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -7390,7 +8056,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -7512,7 +8178,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -7633,7 +8299,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -7744,7 +8410,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8052,7 +8718,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -9452,7 +10118,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -9539,7 +10205,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -9607,7 +10273,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -9672,7 +10339,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -9748,7 +10415,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -9833,7 +10500,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -9907,7 +10574,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -10141,7 +10808,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -10191,7 +10858,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -10242,7 +10909,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -10302,7 +10969,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -10533,7 +11200,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -10595,7 +11262,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -10676,7 +11343,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -10760,7 +11427,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -10857,7 +11524,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -10943,7 +11610,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -11047,7 +11714,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -11145,7 +11812,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -11208,7 +11875,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -11273,7 +11940,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -11364,7 +12031,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -11436,7 +12103,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -11513,7 +12180,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -11631,7 +12298,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -11698,7 +12365,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -11770,7 +12437,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -11830,7 +12497,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -11922,7 +12589,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -11992,7 +12659,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -12084,7 +12751,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -19008,7 +19675,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -19079,7 +19746,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -19329,7 +19996,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -19379,7 +20046,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -19430,7 +20097,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -19490,7 +20157,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -19736,7 +20403,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -19798,7 +20465,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -19879,7 +20546,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -19963,7 +20630,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -20065,7 +20732,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -20146,7 +20813,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -20250,7 +20917,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -20349,7 +21016,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -20412,7 +21079,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -20477,7 +21144,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -20568,7 +21235,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -20640,7 +21307,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -20712,7 +21379,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -20775,7 +21442,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -20847,7 +21514,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -20907,7 +21574,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -20999,7 +21666,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -21069,7 +21736,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -21161,7 +21828,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -22501,7 +23168,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -22575,7 +23242,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -22655,7 +23322,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -22715,7 +23382,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -22792,7 +23459,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -22854,7 +23521,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -22941,7 +23608,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -23049,7 +23716,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -23122,7 +23789,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -23225,7 +23892,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -23300,7 +23967,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -23388,7 +24055,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -23498,7 +24165,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -23613,7 +24280,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -23723,7 +24390,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -23838,7 +24505,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -23948,7 +24615,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -24063,7 +24730,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -24182,7 +24849,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -24306,7 +24973,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -24426,7 +25093,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -24551,7 +25218,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -24671,7 +25338,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -24796,7 +25463,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -24906,7 +25573,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -24997,6 +25664,666 @@ } } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnLine" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPoint" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/columnPolygon" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + } + } + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -25021,7 +26348,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -25156,7 +26483,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -25277,7 +26604,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -25397,7 +26724,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -25507,7 +26834,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -25653,7 +26980,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -25728,7 +27055,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -25812,7 +27139,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -25924,7 +27251,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -26010,7 +27337,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -26077,7 +27404,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -26142,7 +27470,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -26217,7 +27545,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -26301,7 +27629,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -26391,7 +27719,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -26564,7 +27892,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -26689,7 +28017,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -26787,7 +28115,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -26882,7 +28210,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -26982,7 +28310,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -27124,7 +28452,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -27228,7 +28556,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -27317,7 +28645,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -27437,7 +28765,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -28612,7 +29940,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -28693,7 +30021,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -28783,7 +30111,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -28844,7 +30172,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -28915,7 +30243,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -33782,6 +35110,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -33867,6 +35204,15 @@ { "$ref": "#\/components\/schemas\/attributeRelationship" }, + { + "$ref": "#\/components\/schemas\/attributePoint" + }, + { + "$ref": "#\/components\/schemas\/attributeLine" + }, + { + "$ref": "#\/components\/schemas\/attributePolygon" + }, { "$ref": "#\/components\/schemas\/attributeString" } @@ -34743,6 +36089,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -34824,6 +36389,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -34909,6 +36483,15 @@ { "$ref": "#\/components\/schemas\/columnRelationship" }, + { + "$ref": "#\/components\/schemas\/columnPoint" + }, + { + "$ref": "#\/components\/schemas\/columnLine" + }, + { + "$ref": "#\/components\/schemas\/columnPolygon" + }, { "$ref": "#\/components\/schemas\/columnString" } @@ -35785,6 +37368,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json index efeb167a24..ea98bd764b 100644 --- a/app/config/specs/swagger2-1.8.x-client.json +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -5845,7 +5845,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -5918,7 +5918,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -6035,7 +6035,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -7573,7 +7573,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -7657,7 +7657,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -7799,7 +7799,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -7891,7 +7891,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -8025,7 +8025,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -8124,7 +8124,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -8206,7 +8206,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -8317,7 +8317,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 788279b595..03435662b0 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -5052,7 +5052,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 488, + "weight": 500, "cookies": false, "type": "", "demo": "console\/get-resource.md", @@ -7906,6 +7906,654 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7932,7 +8580,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -8069,7 +8717,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -8192,7 +8840,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -8310,7 +8958,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -8420,7 +9068,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8714,7 +9362,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -10124,7 +10772,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -10207,7 +10855,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -10271,7 +10919,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -10338,7 +10987,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -10411,7 +11060,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -10875,7 +11524,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -10947,7 +11596,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -11198,7 +11847,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -11247,7 +11896,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -11297,7 +11946,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 458, + "weight": 470, "cookies": false, "type": "", "demo": "functions\/list-templates.md", @@ -11391,7 +12040,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 457, + "weight": 469, "cookies": false, "type": "", "demo": "functions\/get-template.md", @@ -11449,7 +12098,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 451, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/list-usage.md", @@ -11519,7 +12168,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -11578,7 +12227,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -11825,7 +12474,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -11886,7 +12535,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -11963,7 +12612,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -12043,7 +12692,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -12135,7 +12784,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -12220,7 +12869,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -12326,7 +12975,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -12422,7 +13071,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -12484,7 +13133,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -12551,7 +13200,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -12636,7 +13285,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -12703,7 +13352,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -12776,7 +13425,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -12893,7 +13542,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -12957,7 +13606,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -13024,7 +13673,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 450, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/get-usage.md", @@ -13102,7 +13751,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -13161,7 +13810,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -13251,7 +13900,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -13318,7 +13967,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -13410,7 +14059,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -23584,7 +24233,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 427, + "weight": 439, "cookies": false, "type": "", "demo": "projects\/list-dev-keys.md", @@ -23654,7 +24303,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 424, + "weight": 436, "cookies": false, "type": "", "demo": "projects\/create-dev-key.md", @@ -23737,7 +24386,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 426, + "weight": 438, "cookies": false, "type": "", "demo": "projects\/get-dev-key.md", @@ -23803,7 +24452,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 425, + "weight": 437, "cookies": false, "type": "", "demo": "projects\/update-dev-key.md", @@ -23889,7 +24538,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 428, + "weight": 440, "cookies": false, "type": "", "demo": "projects\/delete-dev-key.md", @@ -27775,7 +28424,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 489, + "weight": 501, "cookies": false, "type": "", "demo": "proxy\/create-api-rule.md", @@ -27845,7 +28494,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 491, + "weight": 503, "cookies": false, "type": "", "demo": "proxy\/create-function-rule.md", @@ -27928,7 +28577,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 492, + "weight": 504, "cookies": false, "type": "", "demo": "proxy\/create-redirect-rule.md", @@ -28048,7 +28697,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 490, + "weight": 502, "cookies": false, "type": "", "demo": "proxy\/create-site-rule.md", @@ -28300,7 +28949,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -28372,7 +29021,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -28639,7 +29288,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -28688,7 +29337,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -28738,7 +29387,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 483, + "weight": 495, "cookies": false, "type": "", "demo": "sites\/list-templates.md", @@ -28832,7 +29481,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 484, + "weight": 496, "cookies": false, "type": "", "demo": "sites\/get-template.md", @@ -28890,7 +29539,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 485, + "weight": 497, "cookies": false, "type": "", "demo": "sites\/list-usage.md", @@ -28960,7 +29609,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -29019,7 +29668,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -29281,7 +29930,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -29342,7 +29991,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -29419,7 +30068,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -29499,7 +30148,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -29599,7 +30248,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -29678,7 +30327,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -29784,7 +30433,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -29881,7 +30530,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -29943,7 +30592,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -30010,7 +30659,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -30095,7 +30744,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -30162,7 +30811,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -30233,7 +30882,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -30297,7 +30946,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -30364,7 +31013,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 486, + "weight": 498, "cookies": false, "type": "", "demo": "sites\/get-usage.md", @@ -30442,7 +31091,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -30501,7 +31150,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -30591,7 +31240,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -30658,7 +31307,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -30750,7 +31399,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -32184,7 +32833,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -32256,7 +32905,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -32338,7 +32987,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 377, + "weight": 383, "cookies": false, "type": "", "demo": "tablesdb\/list-usage.md", @@ -32433,7 +33082,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -32492,7 +33141,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -32570,7 +33219,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -32629,7 +33278,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -32712,7 +33361,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -32820,7 +33469,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -32890,7 +33539,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -32994,7 +33643,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -33064,7 +33713,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -33148,7 +33797,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -33257,7 +33906,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -33368,7 +34017,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -33477,7 +34126,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -33588,7 +34237,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -33697,7 +34346,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -33808,7 +34457,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -33927,7 +34576,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -34048,7 +34697,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -34169,7 +34818,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -34292,7 +34941,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -34413,7 +35062,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -34536,7 +35185,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -34645,7 +35294,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -34730,6 +35379,648 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -34756,7 +36047,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -34892,7 +36183,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -35014,7 +36305,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -35131,7 +36422,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -35240,7 +36531,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -35380,7 +36671,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -35452,7 +36743,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -35531,7 +36822,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -35636,7 +36927,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -35718,7 +37009,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -35781,7 +37072,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -35848,7 +37140,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -35920,7 +37212,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -35997,7 +37289,7 @@ "x-appwrite": { "method": "listTableLogs", "group": "tables", - "weight": 383, + "weight": 389, "cookies": false, "type": "", "demo": "tablesdb\/list-table-logs.md", @@ -36078,7 +37370,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -36162,7 +37454,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -36330,7 +37622,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -36450,7 +37742,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -36545,7 +37837,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -36634,7 +37926,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -36726,7 +38018,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -36860,7 +38152,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -36959,7 +38251,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -37039,7 +38331,7 @@ "x-appwrite": { "method": "listRowLogs", "group": "logs", - "weight": 421, + "weight": 433, "cookies": false, "type": "", "demo": "tablesdb\/list-row-logs.md", @@ -37130,7 +38422,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -37241,7 +38533,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -37350,7 +38642,7 @@ "x-appwrite": { "method": "getTableUsage", "group": null, - "weight": 384, + "weight": 390, "cookies": false, "type": "", "demo": "tablesdb\/get-table-usage.md", @@ -37439,7 +38731,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 376, + "weight": 382, "cookies": false, "type": "", "demo": "tablesdb\/get-usage.md", @@ -38624,7 +39916,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -38704,7 +39996,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -38788,7 +40080,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -38848,7 +40140,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -38919,7 +40211,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -44968,6 +46260,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -45054,6 +46355,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -45930,6 +47240,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -46011,6 +47540,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -46097,6 +47635,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -46973,6 +48520,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index 9293ce6928..5fb2c27cb9 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -7358,6 +7358,660 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7384,7 +8038,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -7522,7 +8176,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -7646,7 +8300,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -7765,7 +8419,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -7876,7 +8530,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8173,7 +8827,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -9517,7 +10171,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -9601,7 +10255,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -9666,7 +10320,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -9733,7 +10388,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -9807,7 +10462,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -9886,7 +10541,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -9959,7 +10614,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -10211,7 +10866,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -10261,7 +10916,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -10312,7 +10967,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -10372,7 +11027,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -10620,7 +11275,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -10682,7 +11337,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -10760,7 +11415,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -10841,7 +11496,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -10934,7 +11589,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -11020,7 +11675,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -11127,7 +11782,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -11224,7 +11879,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -11287,7 +11942,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -11355,7 +12010,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -11441,7 +12096,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -11509,7 +12164,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -11584,7 +12239,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -11703,7 +12358,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -11769,7 +12424,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -11837,7 +12492,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -11897,7 +12552,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -11988,7 +12643,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -12056,7 +12711,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -12149,7 +12804,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -19254,7 +19909,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -19327,7 +19982,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -19595,7 +20250,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -19645,7 +20300,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -19696,7 +20351,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -19756,7 +20411,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -20019,7 +20674,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -20081,7 +20736,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -20159,7 +20814,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -20240,7 +20895,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -20341,7 +20996,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -20421,7 +21076,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -20528,7 +21183,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -20626,7 +21281,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -20689,7 +21344,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -20757,7 +21412,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -20843,7 +21498,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -20911,7 +21566,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -20983,7 +21638,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -21048,7 +21703,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -21116,7 +21771,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -21176,7 +21831,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -21267,7 +21922,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -21335,7 +21990,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -21428,7 +22083,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -22736,7 +23391,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -22809,7 +23464,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -22892,7 +23547,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -22952,7 +23607,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -23031,7 +23686,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -23091,7 +23746,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -23175,7 +23830,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -23284,7 +23939,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -23355,7 +24010,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -23460,7 +24115,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -23531,7 +24186,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -23616,7 +24271,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -23726,7 +24381,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -23838,7 +24493,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -23948,7 +24603,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -24060,7 +24715,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -24170,7 +24825,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -24282,7 +24937,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -24402,7 +25057,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -24524,7 +25179,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -24646,7 +25301,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -24770,7 +25425,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -24892,7 +25547,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -25016,7 +25671,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -25126,7 +25781,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -25212,6 +25867,654 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -25238,7 +26541,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -25375,7 +26678,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -25498,7 +26801,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -25616,7 +26919,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -25726,7 +27029,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -25867,7 +27170,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -25940,7 +27243,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -26020,7 +27323,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -26126,7 +27429,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -26209,7 +27512,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -26273,7 +27576,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -26340,7 +27644,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -26413,7 +27717,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -26491,7 +27795,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -26577,7 +27881,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -26749,7 +28053,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -26871,7 +28175,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -26967,7 +28271,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -27057,7 +28361,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -27151,7 +28455,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -27288,7 +28592,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -27389,7 +28693,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -27473,7 +28777,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -27586,7 +28890,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -28732,7 +30036,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -28813,7 +30117,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -28898,7 +30202,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -28959,7 +30263,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -29031,7 +30335,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -33917,6 +35221,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -34003,6 +35316,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -34879,6 +36201,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -34960,6 +36501,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -35046,6 +36596,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -35922,6 +37481,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index efeb167a24..ea98bd764b 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -5845,7 +5845,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -5918,7 +5918,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -6035,7 +6035,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -7573,7 +7573,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -7657,7 +7657,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -7799,7 +7799,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -7891,7 +7891,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -8025,7 +8025,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -8124,7 +8124,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -8206,7 +8206,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -8317,7 +8317,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 788279b595..03435662b0 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -5052,7 +5052,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 488, + "weight": 500, "cookies": false, "type": "", "demo": "console\/get-resource.md", @@ -7906,6 +7906,654 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7932,7 +8580,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -8069,7 +8717,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -8192,7 +8840,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -8310,7 +8958,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -8420,7 +9068,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8714,7 +9362,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -10124,7 +10772,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -10207,7 +10855,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -10271,7 +10919,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -10338,7 +10987,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -10411,7 +11060,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -10875,7 +11524,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -10947,7 +11596,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -11198,7 +11847,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -11247,7 +11896,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -11297,7 +11946,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 458, + "weight": 470, "cookies": false, "type": "", "demo": "functions\/list-templates.md", @@ -11391,7 +12040,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 457, + "weight": 469, "cookies": false, "type": "", "demo": "functions\/get-template.md", @@ -11449,7 +12098,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 451, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/list-usage.md", @@ -11519,7 +12168,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -11578,7 +12227,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -11825,7 +12474,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -11886,7 +12535,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -11963,7 +12612,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -12043,7 +12692,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -12135,7 +12784,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -12220,7 +12869,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -12326,7 +12975,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -12422,7 +13071,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -12484,7 +13133,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -12551,7 +13200,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -12636,7 +13285,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -12703,7 +13352,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -12776,7 +13425,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -12893,7 +13542,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -12957,7 +13606,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -13024,7 +13673,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 450, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/get-usage.md", @@ -13102,7 +13751,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -13161,7 +13810,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -13251,7 +13900,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -13318,7 +13967,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -13410,7 +14059,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -23584,7 +24233,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 427, + "weight": 439, "cookies": false, "type": "", "demo": "projects\/list-dev-keys.md", @@ -23654,7 +24303,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 424, + "weight": 436, "cookies": false, "type": "", "demo": "projects\/create-dev-key.md", @@ -23737,7 +24386,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 426, + "weight": 438, "cookies": false, "type": "", "demo": "projects\/get-dev-key.md", @@ -23803,7 +24452,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 425, + "weight": 437, "cookies": false, "type": "", "demo": "projects\/update-dev-key.md", @@ -23889,7 +24538,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 428, + "weight": 440, "cookies": false, "type": "", "demo": "projects\/delete-dev-key.md", @@ -27775,7 +28424,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 489, + "weight": 501, "cookies": false, "type": "", "demo": "proxy\/create-api-rule.md", @@ -27845,7 +28494,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 491, + "weight": 503, "cookies": false, "type": "", "demo": "proxy\/create-function-rule.md", @@ -27928,7 +28577,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 492, + "weight": 504, "cookies": false, "type": "", "demo": "proxy\/create-redirect-rule.md", @@ -28048,7 +28697,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 490, + "weight": 502, "cookies": false, "type": "", "demo": "proxy\/create-site-rule.md", @@ -28300,7 +28949,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -28372,7 +29021,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -28639,7 +29288,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -28688,7 +29337,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -28738,7 +29387,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 483, + "weight": 495, "cookies": false, "type": "", "demo": "sites\/list-templates.md", @@ -28832,7 +29481,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 484, + "weight": 496, "cookies": false, "type": "", "demo": "sites\/get-template.md", @@ -28890,7 +29539,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 485, + "weight": 497, "cookies": false, "type": "", "demo": "sites\/list-usage.md", @@ -28960,7 +29609,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -29019,7 +29668,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -29281,7 +29930,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -29342,7 +29991,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -29419,7 +30068,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -29499,7 +30148,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -29599,7 +30248,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -29678,7 +30327,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -29784,7 +30433,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -29881,7 +30530,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -29943,7 +30592,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -30010,7 +30659,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -30095,7 +30744,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -30162,7 +30811,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -30233,7 +30882,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -30297,7 +30946,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -30364,7 +31013,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 486, + "weight": 498, "cookies": false, "type": "", "demo": "sites\/get-usage.md", @@ -30442,7 +31091,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -30501,7 +31150,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -30591,7 +31240,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -30658,7 +31307,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -30750,7 +31399,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -32184,7 +32833,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -32256,7 +32905,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -32338,7 +32987,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 377, + "weight": 383, "cookies": false, "type": "", "demo": "tablesdb\/list-usage.md", @@ -32433,7 +33082,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -32492,7 +33141,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -32570,7 +33219,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -32629,7 +33278,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -32712,7 +33361,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -32820,7 +33469,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -32890,7 +33539,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -32994,7 +33643,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -33064,7 +33713,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -33148,7 +33797,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -33257,7 +33906,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -33368,7 +34017,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -33477,7 +34126,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -33588,7 +34237,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -33697,7 +34346,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -33808,7 +34457,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -33927,7 +34576,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -34048,7 +34697,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -34169,7 +34818,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -34292,7 +34941,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -34413,7 +35062,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -34536,7 +35185,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -34645,7 +35294,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -34730,6 +35379,648 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -34756,7 +36047,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -34892,7 +36183,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -35014,7 +36305,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -35131,7 +36422,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -35240,7 +36531,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -35380,7 +36671,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -35452,7 +36743,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -35531,7 +36822,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -35636,7 +36927,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -35718,7 +37009,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -35781,7 +37072,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -35848,7 +37140,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -35920,7 +37212,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -35997,7 +37289,7 @@ "x-appwrite": { "method": "listTableLogs", "group": "tables", - "weight": 383, + "weight": 389, "cookies": false, "type": "", "demo": "tablesdb\/list-table-logs.md", @@ -36078,7 +37370,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -36162,7 +37454,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -36330,7 +37622,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -36450,7 +37742,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -36545,7 +37837,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -36634,7 +37926,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -36726,7 +38018,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -36860,7 +38152,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -36959,7 +38251,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -37039,7 +38331,7 @@ "x-appwrite": { "method": "listRowLogs", "group": "logs", - "weight": 421, + "weight": 433, "cookies": false, "type": "", "demo": "tablesdb\/list-row-logs.md", @@ -37130,7 +38422,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -37241,7 +38533,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -37350,7 +38642,7 @@ "x-appwrite": { "method": "getTableUsage", "group": null, - "weight": 384, + "weight": 390, "cookies": false, "type": "", "demo": "tablesdb\/get-table-usage.md", @@ -37439,7 +38731,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 376, + "weight": 382, "cookies": false, "type": "", "demo": "tablesdb\/get-usage.md", @@ -38624,7 +39916,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -38704,7 +39996,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -38788,7 +40080,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -38848,7 +40140,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -38919,7 +40211,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -44968,6 +46260,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -45054,6 +46355,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -45930,6 +47240,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -46011,6 +47540,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -46097,6 +47635,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -46973,6 +48520,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 9293ce6928..5fb2c27cb9 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7358,6 +7358,660 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line": { + "post": { + "summary": "Create line attribute", + "operationId": "databasesCreateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createLineAttribute", + "group": "attributes", + "weight": 361, + "cookies": false, + "type": "", + "demo": "databases\/create-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/line\/{key}": { + "patch": { + "summary": "Update line attribute", + "operationId": "databasesUpdateLineAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a line attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeLine", + "schema": { + "$ref": "#\/definitions\/attributeLine" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updateLineAttribute", + "group": "attributes", + "weight": 362, + "cookies": false, + "type": "", + "demo": "databases\/update-line-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-line-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updateLineColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point": { + "post": { + "summary": "Create point attribute", + "operationId": "databasesCreatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric 2d point attribute.", + "responses": { + "202": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPointAttribute", + "group": "attributes", + "weight": 363, + "cookies": false, + "type": "", + "demo": "databases\/create-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/point\/{key}": { + "patch": { + "summary": "Update point attribute", + "operationId": "databasesUpdatePointAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a point attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePoint", + "schema": { + "$ref": "#\/definitions\/attributePoint" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePointAttribute", + "group": "attributes", + "weight": 364, + "cookies": false, + "type": "", + "demo": "databases\/update-point-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-point-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePointColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon": { + "post": { + "summary": "Create polygon attribute", + "operationId": "databasesCreatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "createPolygonAttribute", + "group": "attributes", + "weight": 365, + "cookies": false, + "type": "", + "demo": "databases\/create-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.createPolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/polygon\/{key}": { + "patch": { + "summary": "Update polygon attribute", + "operationId": "databasesUpdatePolygonAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a polygon attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributePolygon", + "schema": { + "$ref": "#\/definitions\/attributePolygon" + } + } + }, + "deprecated": true, + "x-appwrite": { + "method": "updatePolygonAttribute", + "group": "attributes", + "weight": 366, + "cookies": false, + "type": "", + "demo": "databases\/update-polygon-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-polygon-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "deprecated": { + "since": "1.8.0", + "replaceWith": "tablesDB.updatePolygonColumn" + }, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#createCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { "post": { "summary": "Create relationship attribute", @@ -7384,7 +8038,7 @@ "x-appwrite": { "method": "createRelationshipAttribute", "group": "attributes", - "weight": 361, + "weight": 367, "cookies": false, "type": "", "demo": "databases\/create-relationship-attribute.md", @@ -7522,7 +8176,7 @@ "x-appwrite": { "method": "createStringAttribute", "group": "attributes", - "weight": 363, + "weight": 369, "cookies": false, "type": "", "demo": "databases\/create-string-attribute.md", @@ -7646,7 +8300,7 @@ "x-appwrite": { "method": "updateStringAttribute", "group": "attributes", - "weight": 364, + "weight": 370, "cookies": false, "type": "", "demo": "databases\/update-string-attribute.md", @@ -7765,7 +8419,7 @@ "x-appwrite": { "method": "createUrlAttribute", "group": "attributes", - "weight": 365, + "weight": 371, "cookies": false, "type": "", "demo": "databases\/create-url-attribute.md", @@ -7876,7 +8530,7 @@ "x-appwrite": { "method": "updateUrlAttribute", "group": "attributes", - "weight": 366, + "weight": 372, "cookies": false, "type": "", "demo": "databases\/update-url-attribute.md", @@ -8173,7 +8827,7 @@ "x-appwrite": { "method": "updateRelationshipAttribute", "group": "attributes", - "weight": 362, + "weight": 368, "cookies": false, "type": "", "demo": "databases\/update-relationship-attribute.md", @@ -9517,7 +10171,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 370, + "weight": 376, "cookies": false, "type": "", "demo": "databases\/list-indexes.md", @@ -9601,7 +10255,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 367, + "weight": 373, "cookies": false, "type": "", "demo": "databases\/create-index.md", @@ -9666,7 +10320,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -9733,7 +10388,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 368, + "weight": 374, "cookies": false, "type": "", "demo": "databases\/get-index.md", @@ -9807,7 +10462,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 369, + "weight": 375, "cookies": false, "type": "", "demo": "databases\/delete-index.md", @@ -9886,7 +10541,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 432, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -9959,7 +10614,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 429, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -10211,7 +10866,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 434, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -10261,7 +10916,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 435, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -10312,7 +10967,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 430, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -10372,7 +11027,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 431, + "weight": 443, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -10620,7 +11275,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 433, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -10682,7 +11337,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 438, + "weight": 450, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -10760,7 +11415,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 439, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -10841,7 +11496,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 436, + "weight": 448, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -10934,7 +11589,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 444, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -11020,7 +11675,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 441, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -11127,7 +11782,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 442, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -11224,7 +11879,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 437, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -11287,7 +11942,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 440, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -11355,7 +12010,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 443, + "weight": 455, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -11441,7 +12096,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 445, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -11509,7 +12164,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 448, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -11584,7 +12239,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 446, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -11703,7 +12358,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 447, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -11769,7 +12424,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 449, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -11837,7 +12492,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 454, + "weight": 466, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -11897,7 +12552,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 452, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -11988,7 +12643,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 453, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -12056,7 +12711,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 455, + "weight": 467, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -12149,7 +12804,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 456, + "weight": 468, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -19254,7 +19909,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 461, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -19327,7 +19982,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 459, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -19595,7 +20250,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 464, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -19645,7 +20300,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 487, + "weight": 499, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -19696,7 +20351,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 460, + "weight": 472, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -19756,7 +20411,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 462, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -20019,7 +20674,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 463, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -20081,7 +20736,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 470, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -20159,7 +20814,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 469, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -20240,7 +20895,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 465, + "weight": 477, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -20341,7 +20996,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 473, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -20421,7 +21076,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 466, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -20528,7 +21183,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 467, + "weight": 479, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -20626,7 +21281,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 468, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -20689,7 +21344,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 471, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -20757,7 +21412,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 472, + "weight": 484, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -20843,7 +21498,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 474, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -20911,7 +21566,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 476, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -20983,7 +21638,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 475, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -21048,7 +21703,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 477, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -21116,7 +21771,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 480, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -21176,7 +21831,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 478, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -21267,7 +21922,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 479, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -21335,7 +21990,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 481, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -21428,7 +22083,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 482, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -22736,7 +23391,7 @@ "x-appwrite": { "method": "list", "group": "tablesdb", - "weight": 375, + "weight": 381, "cookies": false, "type": "", "demo": "tablesdb\/list.md", @@ -22809,7 +23464,7 @@ "x-appwrite": { "method": "create", "group": "tablesdb", - "weight": 371, + "weight": 377, "cookies": false, "type": "", "demo": "tablesdb\/create.md", @@ -22892,7 +23547,7 @@ "x-appwrite": { "method": "get", "group": "tablesdb", - "weight": 372, + "weight": 378, "cookies": false, "type": "", "demo": "tablesdb\/get.md", @@ -22952,7 +23607,7 @@ "x-appwrite": { "method": "update", "group": "tablesdb", - "weight": 373, + "weight": 379, "cookies": false, "type": "", "demo": "tablesdb\/update.md", @@ -23031,7 +23686,7 @@ "x-appwrite": { "method": "delete", "group": "tablesdb", - "weight": 374, + "weight": 380, "cookies": false, "type": "", "demo": "tablesdb\/delete.md", @@ -23091,7 +23746,7 @@ "x-appwrite": { "method": "listTables", "group": "tables", - "weight": 382, + "weight": 388, "cookies": false, "type": "", "demo": "tablesdb\/list-tables.md", @@ -23175,7 +23830,7 @@ "x-appwrite": { "method": "createTable", "group": "tables", - "weight": 378, + "weight": 384, "cookies": false, "type": "", "demo": "tablesdb\/create-table.md", @@ -23284,7 +23939,7 @@ "x-appwrite": { "method": "getTable", "group": "tables", - "weight": 379, + "weight": 385, "cookies": false, "type": "", "demo": "tablesdb\/get-table.md", @@ -23355,7 +24010,7 @@ "x-appwrite": { "method": "updateTable", "group": "tables", - "weight": 380, + "weight": 386, "cookies": false, "type": "", "demo": "tablesdb\/update-table.md", @@ -23460,7 +24115,7 @@ "x-appwrite": { "method": "deleteTable", "group": "tables", - "weight": 381, + "weight": 387, "cookies": false, "type": "", "demo": "tablesdb\/delete-table.md", @@ -23531,7 +24186,7 @@ "x-appwrite": { "method": "listColumns", "group": "columns", - "weight": 387, + "weight": 393, "cookies": false, "type": "", "demo": "tablesdb\/list-columns.md", @@ -23616,7 +24271,7 @@ "x-appwrite": { "method": "createBooleanColumn", "group": "columns", - "weight": 388, + "weight": 394, "cookies": false, "type": "", "demo": "tablesdb\/create-boolean-column.md", @@ -23726,7 +24381,7 @@ "x-appwrite": { "method": "updateBooleanColumn", "group": "columns", - "weight": 389, + "weight": 395, "cookies": false, "type": "", "demo": "tablesdb\/update-boolean-column.md", @@ -23838,7 +24493,7 @@ "x-appwrite": { "method": "createDatetimeColumn", "group": "columns", - "weight": 390, + "weight": 396, "cookies": false, "type": "", "demo": "tablesdb\/create-datetime-column.md", @@ -23948,7 +24603,7 @@ "x-appwrite": { "method": "updateDatetimeColumn", "group": "columns", - "weight": 391, + "weight": 397, "cookies": false, "type": "", "demo": "tablesdb\/update-datetime-column.md", @@ -24060,7 +24715,7 @@ "x-appwrite": { "method": "createEmailColumn", "group": "columns", - "weight": 392, + "weight": 398, "cookies": false, "type": "", "demo": "tablesdb\/create-email-column.md", @@ -24170,7 +24825,7 @@ "x-appwrite": { "method": "updateEmailColumn", "group": "columns", - "weight": 393, + "weight": 399, "cookies": false, "type": "", "demo": "tablesdb\/update-email-column.md", @@ -24282,7 +24937,7 @@ "x-appwrite": { "method": "createEnumColumn", "group": "columns", - "weight": 394, + "weight": 400, "cookies": false, "type": "", "demo": "tablesdb\/create-enum-column.md", @@ -24402,7 +25057,7 @@ "x-appwrite": { "method": "updateEnumColumn", "group": "columns", - "weight": 395, + "weight": 401, "cookies": false, "type": "", "demo": "tablesdb\/update-enum-column.md", @@ -24524,7 +25179,7 @@ "x-appwrite": { "method": "createFloatColumn", "group": "columns", - "weight": 396, + "weight": 402, "cookies": false, "type": "", "demo": "tablesdb\/create-float-column.md", @@ -24646,7 +25301,7 @@ "x-appwrite": { "method": "updateFloatColumn", "group": "columns", - "weight": 397, + "weight": 403, "cookies": false, "type": "", "demo": "tablesdb\/update-float-column.md", @@ -24770,7 +25425,7 @@ "x-appwrite": { "method": "createIntegerColumn", "group": "columns", - "weight": 398, + "weight": 404, "cookies": false, "type": "", "demo": "tablesdb\/create-integer-column.md", @@ -24892,7 +25547,7 @@ "x-appwrite": { "method": "updateIntegerColumn", "group": "columns", - "weight": 399, + "weight": 405, "cookies": false, "type": "", "demo": "tablesdb\/update-integer-column.md", @@ -25016,7 +25671,7 @@ "x-appwrite": { "method": "createIpColumn", "group": "columns", - "weight": 400, + "weight": 406, "cookies": false, "type": "", "demo": "tablesdb\/create-ip-column.md", @@ -25126,7 +25781,7 @@ "x-appwrite": { "method": "updateIpColumn", "group": "columns", - "weight": 401, + "weight": 407, "cookies": false, "type": "", "demo": "tablesdb\/update-ip-column.md", @@ -25212,6 +25867,654 @@ ] } }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line": { + "post": { + "summary": "Create line column", + "operationId": "tablesDBCreateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric line attribute.", + "responses": { + "202": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createLineColumn", + "group": "columns", + "weight": 408, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/line\/{key}": { + "patch": { + "summary": "Update line column", + "operationId": "tablesDBUpdateLineColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a line column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnLine", + "schema": { + "$ref": "#\/definitions\/columnLine" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLineColumn", + "group": "columns", + "weight": 409, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-line-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-line-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point": { + "post": { + "summary": "Create point column", + "operationId": "tablesDBCreatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric point attribute.", + "responses": { + "202": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPointColumn", + "group": "columns", + "weight": 410, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/point\/{key}": { + "patch": { + "summary": "Update point column", + "operationId": "tablesDBUpdatePointColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a point column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPoint", + "schema": { + "$ref": "#\/definitions\/columnPoint" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePointColumn", + "group": "columns", + "weight": 411, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-point-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-point-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon": { + "post": { + "summary": "Create polygon column", + "operationId": "tablesDBCreatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Create a geometric polygon attribute.", + "responses": { + "202": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "createPolygonColumn", + "group": "columns", + "weight": 412, + "cookies": false, + "type": "", + "demo": "tablesdb\/create-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/create-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/polygon\/{key}": { + "patch": { + "summary": "Update polygon column", + "operationId": "tablesDBUpdatePolygonColumn", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tablesDB" + ], + "description": "Update a polygon column. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "ColumnPolygon", + "schema": { + "$ref": "#\/definitions\/columnPolygon" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updatePolygonColumn", + "group": "columns", + "weight": 413, + "cookies": false, + "type": "", + "demo": "tablesdb\/update-polygon-column.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/tablesdb\/update-polygon-column.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": [ + "tables.write", + "collections.write" + ], + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "tableId", + "description": "Table ID. You can create a new table using the TablesDB service [server integration](https:\/\/appwrite.io\/docs\/server\/tablesdb#tablesDBCreate).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "key", + "description": "Column Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is column required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for column when not provided, as JSON string. Cannot be set when column is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New Column Key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required" + ] + } + } + ] + } + }, "\/tablesdb\/{databaseId}\/tables\/{tableId}\/columns\/relationship": { "post": { "summary": "Create relationship column", @@ -25238,7 +26541,7 @@ "x-appwrite": { "method": "createRelationshipColumn", "group": "columns", - "weight": 402, + "weight": 414, "cookies": false, "type": "", "demo": "tablesdb\/create-relationship-column.md", @@ -25375,7 +26678,7 @@ "x-appwrite": { "method": "createStringColumn", "group": "columns", - "weight": 404, + "weight": 416, "cookies": false, "type": "", "demo": "tablesdb\/create-string-column.md", @@ -25498,7 +26801,7 @@ "x-appwrite": { "method": "updateStringColumn", "group": "columns", - "weight": 405, + "weight": 417, "cookies": false, "type": "", "demo": "tablesdb\/update-string-column.md", @@ -25616,7 +26919,7 @@ "x-appwrite": { "method": "createUrlColumn", "group": "columns", - "weight": 406, + "weight": 418, "cookies": false, "type": "", "demo": "tablesdb\/create-url-column.md", @@ -25726,7 +27029,7 @@ "x-appwrite": { "method": "updateUrlColumn", "group": "columns", - "weight": 407, + "weight": 419, "cookies": false, "type": "", "demo": "tablesdb\/update-url-column.md", @@ -25867,7 +27170,7 @@ "x-appwrite": { "method": "getColumn", "group": "columns", - "weight": 385, + "weight": 391, "cookies": false, "type": "", "demo": "tablesdb\/get-column.md", @@ -25940,7 +27243,7 @@ "x-appwrite": { "method": "deleteColumn", "group": "columns", - "weight": 386, + "weight": 392, "cookies": false, "type": "", "demo": "tablesdb\/delete-column.md", @@ -26020,7 +27323,7 @@ "x-appwrite": { "method": "updateRelationshipColumn", "group": "columns", - "weight": 403, + "weight": 415, "cookies": false, "type": "", "demo": "tablesdb\/update-relationship-column.md", @@ -26126,7 +27429,7 @@ "x-appwrite": { "method": "listIndexes", "group": "indexes", - "weight": 411, + "weight": 423, "cookies": false, "type": "", "demo": "tablesdb\/list-indexes.md", @@ -26209,7 +27512,7 @@ "x-appwrite": { "method": "createIndex", "group": "indexes", - "weight": 408, + "weight": 420, "cookies": false, "type": "", "demo": "tablesdb\/create-index.md", @@ -26273,7 +27576,8 @@ "enum": [ "key", "fulltext", - "unique" + "unique", + "spatial" ], "x-enum-name": "IndexType", "x-enum-keys": [] @@ -26340,7 +27644,7 @@ "x-appwrite": { "method": "getIndex", "group": "indexes", - "weight": 409, + "weight": 421, "cookies": false, "type": "", "demo": "tablesdb\/get-index.md", @@ -26413,7 +27717,7 @@ "x-appwrite": { "method": "deleteIndex", "group": "indexes", - "weight": 410, + "weight": 422, "cookies": false, "type": "", "demo": "tablesdb\/delete-index.md", @@ -26491,7 +27795,7 @@ "x-appwrite": { "method": "listRows", "group": "rows", - "weight": 420, + "weight": 432, "cookies": false, "type": "", "demo": "tablesdb\/list-rows.md", @@ -26577,7 +27881,7 @@ "x-appwrite": { "method": "createRow", "group": "rows", - "weight": 412, + "weight": 424, "cookies": false, "type": "", "demo": "tablesdb\/create-row.md", @@ -26749,7 +28053,7 @@ "x-appwrite": { "method": "upsertRows", "group": "rows", - "weight": 417, + "weight": 429, "cookies": false, "type": "", "demo": "tablesdb\/upsert-rows.md", @@ -26871,7 +28175,7 @@ "x-appwrite": { "method": "updateRows", "group": "rows", - "weight": 415, + "weight": 427, "cookies": false, "type": "", "demo": "tablesdb\/update-rows.md", @@ -26967,7 +28271,7 @@ "x-appwrite": { "method": "deleteRows", "group": "rows", - "weight": 419, + "weight": 431, "cookies": false, "type": "", "demo": "tablesdb\/delete-rows.md", @@ -27057,7 +28361,7 @@ "x-appwrite": { "method": "getRow", "group": "rows", - "weight": 413, + "weight": 425, "cookies": false, "type": "", "demo": "tablesdb\/get-row.md", @@ -27151,7 +28455,7 @@ "x-appwrite": { "method": "upsertRow", "group": "rows", - "weight": 416, + "weight": 428, "cookies": false, "type": "", "demo": "tablesdb\/upsert-row.md", @@ -27288,7 +28592,7 @@ "x-appwrite": { "method": "updateRow", "group": "rows", - "weight": 414, + "weight": 426, "cookies": false, "type": "", "demo": "tablesdb\/update-row.md", @@ -27389,7 +28693,7 @@ "x-appwrite": { "method": "deleteRow", "group": "rows", - "weight": 418, + "weight": 430, "cookies": false, "type": "", "demo": "tablesdb\/delete-row.md", @@ -27473,7 +28777,7 @@ "x-appwrite": { "method": "decrementRowColumn", "group": "rows", - "weight": 423, + "weight": 435, "cookies": false, "type": "", "demo": "tablesdb\/decrement-row-column.md", @@ -27586,7 +28890,7 @@ "x-appwrite": { "method": "incrementRowColumn", "group": "rows", - "weight": 422, + "weight": 434, "cookies": false, "type": "", "demo": "tablesdb\/increment-row-column.md", @@ -28732,7 +30036,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 495, + "weight": 507, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -28813,7 +30117,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 493, + "weight": 505, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -28898,7 +30202,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 494, + "weight": 506, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -28959,7 +30263,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 496, + "weight": 508, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -29031,7 +30335,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 497, + "weight": 509, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -33917,6 +35221,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -34003,6 +35316,15 @@ { "$ref": "#\/definitions\/attributeRelationship" }, + { + "$ref": "#\/definitions\/attributePoint" + }, + { + "$ref": "#\/definitions\/attributeLine" + }, + { + "$ref": "#\/definitions\/attributePolygon" + }, { "$ref": "#\/definitions\/attributeString" } @@ -34879,6 +36201,225 @@ "side": "parent|child" } }, + "attributePoint": { + "description": "AttributePoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "attributeLine": { + "description": "AttributeLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "attributePolygon": { + "description": "AttributePolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "table": { "description": "Table", "type": "object", @@ -34960,6 +36501,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -35046,6 +36596,15 @@ { "$ref": "#\/definitions\/columnRelationship" }, + { + "$ref": "#\/definitions\/columnPoint" + }, + { + "$ref": "#\/definitions\/columnLine" + }, + { + "$ref": "#\/definitions\/columnPolygon" + }, { "$ref": "#\/definitions\/columnString" } @@ -35922,6 +37481,225 @@ "side": "parent|child" } }, + "columnPoint": { + "description": "ColumnPoint", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[0, 0]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[0, 0]" + } + }, + "columnLine": { + "description": "ColumnLine", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[0, 0], [1, 1]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[0, 0], [1, 1]]" + } + }, + "columnPolygon": { + "description": "ColumnPolygon", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Column Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Column type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an column.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is column required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is column an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Column creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Column update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "object", + "additionalProperties": true, + "description": "Default value for column when not provided. Cannot be set when column is required.", + "x-example": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ], + "example": { + "key": "fullName", + "type": "string", + "status": "available", + "error": "string", + "required": true, + "array": false, + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "default": "[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]" + } + }, "index": { "description": "Index", "type": "object",