From cdace54b7a27e582486f1f0ec0ea3559410d571e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 28 Jun 2022 17:01:14 +0200 Subject: [PATCH 01/58] feat: node sdk version 7.0.1 --- app/config/platforms.php | 2 +- composer.json | 2 +- composer.lock | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index b31ea27f02..851b9210a6 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -208,7 +208,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '7.0.0', + 'version' => '7.0.1', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, diff --git a/composer.json b/composer.json index e33cc16373..a729f5f0e9 100644 --- a/composer.json +++ b/composer.json @@ -71,7 +71,7 @@ } ], "require-dev": { - "appwrite/sdk-generator": "0.19.2", + "appwrite/sdk-generator": "0.19.3", "phpunit/phpunit": "9.5.20", "squizlabs/php_codesniffer": "^3.6", "swoole/ide-helper": "4.8.9", diff --git a/composer.lock b/composer.lock index af31b62121..6f95736652 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": "27f63bdbc1b54f0f5cee981afe6da9b8", + "content-hash": "5f84d34aaf40746cf5a5ea3d231b9aee", "packages": [ { "name": "adhocore/jwt", @@ -2828,16 +2828,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.19.2", + "version": "0.19.3", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "91892b98880767019f340dee0074dcdc75329f94" + "reference": "a27cdc6b7e60e776a175be023e59cfd0e85bf4fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/91892b98880767019f340dee0074dcdc75329f94", - "reference": "91892b98880767019f340dee0074dcdc75329f94", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/a27cdc6b7e60e776a175be023e59cfd0e85bf4fa", + "reference": "a27cdc6b7e60e776a175be023e59cfd0e85bf4fa", "shasum": "" }, "require": { @@ -2872,9 +2872,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/0.19.2" + "source": "https://github.com/appwrite/sdk-generator/tree/0.19.3" }, - "time": "2022-06-28T11:15:16+00:00" + "time": "2022-06-28T14:56:03+00:00" }, { "name": "doctrine/instantiator", From 9fdaa92bd1ea23c53f408c39f15d9d008c3fb4fe Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 29 Jun 2022 01:04:08 +0200 Subject: [PATCH 02/58] feat: trigger sms for createVerification --- app/controllers/api/account.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index f61490b116..5144441a1f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -2301,7 +2301,9 @@ App::post('/v1/account/verification/phone') $messaging ->setRecipient($user->getAttribute('phone')) - ->setMessage($secret); + ->setMessage($secret) + ->trigger() + ; $events ->setParam('userId', $user->getId()) From 8ee78137e6428f6ef858a02cb69612a7fff93b72 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 29 Jun 2022 01:07:48 +0200 Subject: [PATCH 03/58] fix: internal attribute and index key on migration --- src/Appwrite/Migration/Version/V14.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Migration/Version/V14.php b/src/Appwrite/Migration/Version/V14.php index 308850d2c9..6f80bc2e60 100644 --- a/src/Appwrite/Migration/Version/V14.php +++ b/src/Appwrite/Migration/Version/V14.php @@ -583,11 +583,11 @@ class V14 extends Migration break; case 'attributes': case 'indexes': + $internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId(); /** * Add Internal ID 'collectionId' for Subqueries. */ if (!empty($document->getAttribute('collectionId')) && is_null($document->getAttribute('collectionInternalId'))) { - $internalId = $this->projectDB->getDocument('database_1', $document->getAttribute('collectionId'))->getInternalId(); $document->setAttribute('collectionInternalId', $internalId); } /** @@ -608,7 +608,7 @@ class V14 extends Migration * Re-create Collection Document */ $this->projectDB->deleteDocument($document->getCollection(), $document->getId()); - $this->projectDB->createDocument($document->getCollection(), $document->setAttribute('$id', "1_{$document->getInternalId()}_{$document->getAttribute('key')}")); + $this->projectDB->createDocument($document->getCollection(), $document->setAttribute('$id', "1_{$internalId}_{$document->getAttribute('key')}")); } catch (\Throwable $th) { Console::warning("Create Collection Document - {$th->getMessage()}"); } From 33850dcfffa11366168d3cabf30fafb1dc3db048 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 29 Jun 2022 02:37:52 +0200 Subject: [PATCH 04/58] feat: update docs --- docs/references/account/create-phone-session.md | 2 +- docs/references/account/create-phone-verification.md | 2 +- docs/references/account/update-phone-session.md | 4 +--- docs/references/account/update-phone.md | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/references/account/create-phone-session.md b/docs/references/account/create-phone-session.md index a03c7adc17..677c315ac2 100644 --- a/docs/references/account/create-phone-session.md +++ b/docs/references/account/create-phone-session.md @@ -1 +1 @@ -Sends the user a SMS with a secret key for creating a session. Use the returned user ID and the secret to submit a request to the [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. \ No newline at end of file +Sends the user an SMS with a secret key for creating a session. Use the returned user ID and secret and submit a request to the [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. \ No newline at end of file diff --git a/docs/references/account/create-phone-verification.md b/docs/references/account/create-phone-verification.md index 0acc8f6d30..28627b439f 100644 --- a/docs/references/account/create-phone-verification.md +++ b/docs/references/account/create-phone-verification.md @@ -1 +1 @@ -Use this endpoint to send a verification message to your user's phone number to confirm they are the valid owners of that address. The provided secret should allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#accountUpdatePhoneVerification). The verification link sent to the user's phone number is valid for 15 minutes. \ No newline at end of file +Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](/docs/client/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. \ No newline at end of file diff --git a/docs/references/account/update-phone-session.md b/docs/references/account/update-phone-session.md index b85036082f..7bd8e61617 100644 --- a/docs/references/account/update-phone-session.md +++ b/docs/references/account/update-phone-session.md @@ -1,3 +1 @@ -Use this endpoint to complete creating the session with the Magic URL. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession) endpoint. - -Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. \ No newline at end of file +Use this endpoint to complete creating a session with SMS. Use the **userId** from the [createPhoneSession](/docs/client/account#accountCreatePhoneSession) endpoint and the **secret** received via SMS to successfully update and confirm the phone session. \ No newline at end of file diff --git a/docs/references/account/update-phone.md b/docs/references/account/update-phone.md index 442fc06209..934d9cad7f 100644 --- a/docs/references/account/update-phone.md +++ b/docs/references/account/update-phone.md @@ -1 +1 @@ -Update currently logged in user account phone number. After changing phone number, the user confirmation status will get reset. A new confirmation SMS is not sent automatically however you can use the phone confirmation endpoint again to send the confirmation SMS. \ No newline at end of file +Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](/docs/client/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS. \ No newline at end of file From f387ce08bcb985ae32e21a5c1c8ea4c2f3e1946c Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 29 Jun 2022 12:11:45 +0200 Subject: [PATCH 05/58] fix: ui issues --- app/views/console/databases/collection.phtml | 2 +- public/dist/scripts/app-all.js | 2 +- public/dist/scripts/app-dep.js | 2 +- public/scripts/dependencies/appwrite.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/console/databases/collection.phtml b/app/views/console/databases/collection.phtml index 5121cf7141..e8ede3df5d 100644 --- a/app/views/console/databases/collection.phtml +++ b/app/views/console/databases/collection.phtml @@ -92,7 +92,7 @@ $logs = $this->getParam('logs', null);