From fae7a758ffda50eb0d1305b3d6e023c37726cdab Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 2 Jan 2024 22:58:30 +0000 Subject: [PATCH 1/2] Fix docs for list messages allowed attributes --- app/controllers/api/messaging.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 124bc2d219..6f86de720f 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -2464,7 +2464,7 @@ App::get('/v1/messaging/messages') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_MESSAGE_LIST) - ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) + ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Messages::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') ->inject('response') From 45ee8a11a5855c3201f7d0cbdad3afdd3ee24261 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 2 Jan 2024 23:04:26 +0000 Subject: [PATCH 2/2] Update allowed attributes list messages queries Remove the following because queries on arrays/JSON are not supported: - topics - users - targets - deliveryErrors - data Remove the following because they don't exist: - providerId - deliveredTo Add the following as an allowed attribute so it can be queried on the Console: - scheduledAt - deliveredTotal - providerType --- .../Utopia/Database/Validator/Queries/Messages.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Messages.php b/src/Appwrite/Utopia/Database/Validator/Queries/Messages.php index dd043474a8..10032a8745 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Messages.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Messages.php @@ -5,16 +5,12 @@ namespace Appwrite\Utopia\Database\Validator\Queries; class Messages extends Base { public const ALLOWED_ATTRIBUTES = [ - 'topics', - 'users', - 'targets', - 'providerId', + 'scheduledAt', 'deliveredAt', - 'deliveredTo', - 'deliveryErrors', + 'deliveredTotal', 'status', 'description', - 'data' + 'providerType', ]; /**