From 01df91aee9a87e8dbf4af00c92a0257f367755a4 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 4 Jan 2024 23:58:48 +0000 Subject: [PATCH 1/3] Replace backticks with double quotes --- src/Appwrite/Platform/Workers/Messaging.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index ed72731681..ebf657ecc5 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -193,7 +193,7 @@ class Messaging extends Action $details[] = $response->getDetails(); foreach ($details as $detail) { if ($detail['status'] === 'failure') { - $deliveryErrors[] = `Failed sending to target {$detail['recipient']} with error: {$detail['error']}`; + $deliveryErrors[] = "Failed sending to target {$detail['recipient']} with error: {$detail['error']}"; } // Deleting push targets when token has expired. From 7e9525f0f9d025ce184e8e4f912e54b8d3e2fc6a Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 5 Jan 2024 00:10:57 +0000 Subject: [PATCH 2/3] Update validation of topics, users, and targets They should be an array of UID and not just array of Text. --- app/controllers/api/messaging.php | 46 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 53135f2193..9a9fdb8b16 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -236,7 +236,7 @@ App::post('/v1/messaging/providers/msg91') $options = []; if (!empty($from)) { - $options ['from'] = $from; + $options['from'] = $from; } $credentials = []; @@ -313,7 +313,7 @@ App::post('/v1/messaging/providers/telesign') $options = []; if (!empty($from)) { - $options ['from'] = $from; + $options['from'] = $from; } $credentials = []; @@ -390,7 +390,7 @@ App::post('/v1/messaging/providers/textmagic') $options = []; if (!empty($from)) { - $options ['from'] = $from; + $options['from'] = $from; } $credentials = []; @@ -467,7 +467,7 @@ App::post('/v1/messaging/providers/twilio') $options = []; if (!empty($from)) { - $options ['from'] = $from; + $options['from'] = $from; } $credentials = []; @@ -544,7 +544,7 @@ App::post('/v1/messaging/providers/vonage') $options = []; if (!empty($from)) { - $options ['from'] = $from; + $options['from'] = $from; } $credentials = []; @@ -2276,9 +2276,9 @@ App::post('/v1/messaging/messages/email') ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('subject', '', new Text(998), 'Email Subject.') ->param('content', '', new Text(64230), 'Email Content.') - ->param('topics', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Topic IDs.', true) - ->param('users', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of User IDs.', true) - ->param('targets', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Targets IDs.', true) + ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) + ->param('users', [], new ArrayList(new UID()), 'List of User IDs.', true) + ->param('targets', [], new ArrayList(new UID()), 'List of Targets IDs.', true) ->param('cc', [], new ArrayList(new UID()), 'Array of target IDs to be added as CC.', true) ->param('bcc', [], new ArrayList(new UID()), 'Array of target IDs to be added as BCC.', true) ->param('description', '', new Text(256), 'Description for message.', true) @@ -2367,9 +2367,9 @@ App::post('/v1/messaging/messages/sms') ->label('sdk.response.model', Response::MODEL_MESSAGE) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') - ->param('topics', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Topic IDs.', true) - ->param('users', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of User IDs.', true) - ->param('targets', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Targets IDs.', true) + ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) + ->param('users', [], new ArrayList(new UID()), 'List of User IDs.', true) + ->param('targets', [], new ArrayList(new UID()), 'List of Targets IDs.', true) ->param('description', '', new Text(256), 'Description for Message.', true) ->param('status', 'processing', new WhiteList(['draft', 'canceled', 'processing']), 'Message Status. Value must be either draft or cancelled or processing.', true) ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true) @@ -2448,9 +2448,9 @@ App::post('/v1/messaging/messages/push') ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('title', '', new Text(256), 'Title for push notification.') ->param('body', '', new Text(64230), 'Body for push notification.') - ->param('topics', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Topic IDs.', true) - ->param('users', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of User IDs.', true) - ->param('targets', [], new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Targets IDs.', true) + ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) + ->param('users', [], new ArrayList(new UID()), 'List of User IDs.', true) + ->param('targets', [], new ArrayList(new UID()), 'List of Targets IDs.', true) ->param('description', '', new Text(256), 'Description for Message.', true) ->param('data', null, new JSON(), 'Additional Data for push notification.', true) ->param('action', '', new Text(256), 'Action for push notification.', true) @@ -2694,9 +2694,9 @@ App::patch('/v1/messaging/messages/email/:messageId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_MESSAGE) ->param('messageId', '', new UID(), 'Message ID.') - ->param('topics', null, new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Topic IDs.', true) - ->param('users', null, new ArrayList(new Text(Database::LENGTH_KEY)), 'List of User IDs.', true) - ->param('targets', null, new ArrayList(new Text(Database::LENGTH_KEY)), 'List of Targets IDs.', true) + ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) + ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) + ->param('targets', null, new ArrayList(new UID()), 'List of Targets IDs.', true) ->param('subject', null, new Text(998), 'Email Subject.', true) ->param('description', null, new Text(256), 'Description for Message.', true) ->param('content', null, new Text(64230), 'Email Content.', true) @@ -2822,9 +2822,9 @@ App::patch('/v1/messaging/messages/sms/:messageId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_MESSAGE) ->param('messageId', '', new UID(), 'Message ID.') - ->param('topics', null, new ArrayList(new Text(Database::LENGTH_KEY), 1), 'List of Topic IDs.', true) - ->param('users', null, new ArrayList(new Text(Database::LENGTH_KEY), 1), 'List of User IDs.', true) - ->param('targets', null, new ArrayList(new Text(Database::LENGTH_KEY), 1), 'List of Targets IDs.', true) + ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) + ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) + ->param('targets', null, new ArrayList(new UID()), 'List of Targets IDs.', true) ->param('description', null, new Text(256), 'Description for Message.', true) ->param('content', null, new Text(64230), 'Email Content.', true) ->param('status', null, new WhiteList(['draft', 'cancelled', 'processing']), 'Message Status. Value must be either draft or cancelled or processing.', true) @@ -2928,9 +2928,9 @@ App::patch('/v1/messaging/messages/push/:messageId') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_MESSAGE) ->param('messageId', '', new UID(), 'Message ID.') - ->param('topics', null, new ArrayList(new Text(Database::LENGTH_KEY), 1), 'List of Topic IDs.', true) - ->param('users', null, new ArrayList(new Text(Database::LENGTH_KEY), 1), 'List of User IDs.', true) - ->param('targets', null, new ArrayList(new Text(Database::LENGTH_KEY), 1), 'List of Targets IDs.', true) + ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) + ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) + ->param('targets', null, new ArrayList(new UID()), 'List of Targets IDs.', true) ->param('description', null, new Text(256), 'Description for Message.', true) ->param('title', null, new Text(256), 'Title for push notification.', true) ->param('body', null, new Text(64230), 'Body for push notification.', true) From 2de8c7a68a0a2d4d1092e918d149d3867014f118 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Fri, 5 Jan 2024 00:31:00 +0000 Subject: [PATCH 3/3] Update composer.lock to fix merge conflict --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 6b7fc0ac4e..182da98024 100644 --- a/composer.lock +++ b/composer.lock @@ -2906,16 +2906,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.6.3", + "version": "0.6.4", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "86c3f42a2624bcccb7a67b74dcd7bd3a31fc2e4b" + "reference": "b2595a50a4897a8c88319240810055b7a96efd6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/86c3f42a2624bcccb7a67b74dcd7bd3a31fc2e4b", - "reference": "86c3f42a2624bcccb7a67b74dcd7bd3a31fc2e4b", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/b2595a50a4897a8c88319240810055b7a96efd6d", + "reference": "b2595a50a4897a8c88319240810055b7a96efd6d", "shasum": "" }, "require": { @@ -2949,9 +2949,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.6.3" + "source": "https://github.com/utopia-php/vcs/tree/0.6.4" }, - "time": "2023-12-14T06:53:39+00:00" + "time": "2023-12-26T15:38:19+00:00" }, { "name": "utopia-php/websocket",