From 99b284995d99410701307c478c11e670c8621e36 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Oct 2025 04:17:45 +0000 Subject: [PATCH 1/2] chore: regen --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 +- Appwrite/Services/Account.cs | 90 ++++++++++++++++++- Appwrite/Services/Functions.cs | 2 +- Appwrite/Services/Sites.cs | 4 +- Appwrite/Services/TablesDb.cs | 10 +-- CHANGELOG.md | 5 ++ README.md | 6 +- .../account/create-email-verification.md | 14 +++ .../account/update-email-verification.md | 15 ++++ 10 files changed, 134 insertions(+), 18 deletions(-) create mode 100644 docs/examples/account/create-email-verification.md create mode 100644 docs/examples/account/update-email-verification.md diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index b388d2e..73426fc 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.19.0 + 0.19.1 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 020ebf6..7deee67 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,11 +69,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/0.19.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.19.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.19.0"}, + { "x-sdk-version", "0.19.1"}, { "X-Appwrite-Response-Format", "1.8.0" } }; diff --git a/Appwrite/Services/Account.cs b/Appwrite/Services/Account.cs index a247409..c25537e 100644 --- a/Appwrite/Services/Account.cs +++ b/Appwrite/Services/Account.cs @@ -1673,9 +1673,55 @@ static Models.Token Convert(Dictionary it) => /// /// /// + public Task CreateEmailVerification(string url) + { + var apiPath = "/account/verifications/email"; + + var apiParameters = new Dictionary() + { + { "url", url } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Token Convert(Dictionary it) => + Models.Token.From(map: it); + + return _client.Call( + method: "POST", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Use this endpoint to send a verification message to your user email address + /// to confirm they are the valid owners of that address. Both the **userId** + /// and **secret** arguments will be passed as query parameters to the URL you + /// have provided to be attached to the verification email. The provided URL + /// should redirect the user back to your app and allow you to complete the + /// verification process by verifying both the **userId** and **secret** + /// parameters. Learn more about how to [complete the verification + /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). + /// The verification link sent to the user's email address is valid for 7 days. + /// + /// 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. + /// + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead.")] public Task CreateVerification(string url) { - var apiPath = "/account/verification"; + var apiPath = "/account/verifications/email"; var apiParameters = new Dictionary() { @@ -1707,9 +1753,45 @@ static Models.Token Convert(Dictionary it) => /// 200 status code. /// /// + public Task UpdateEmailVerification(string userId, string secret) + { + var apiPath = "/account/verifications/email"; + + var apiParameters = new Dictionary() + { + { "userId", userId }, + { "secret", secret } + }; + + var apiHeaders = new Dictionary() + { + { "content-type", "application/json" } + }; + + + static Models.Token Convert(Dictionary it) => + Models.Token.From(map: it); + + return _client.Call( + method: "PUT", + path: apiPath, + headers: apiHeaders, + parameters: apiParameters.Where(it => it.Value != null).ToDictionary(it => it.Key, it => it.Value)!, + convert: Convert); + + } + + /// + /// Use this endpoint to complete the user email verification process. Use both + /// the **userId** and **secret** parameters that were attached to your app URL + /// to verify the user email ownership. If confirmed this route will return a + /// 200 status code. + /// + /// + [Obsolete("This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead.")] public Task UpdateVerification(string userId, string secret) { - var apiPath = "/account/verification"; + var apiPath = "/account/verifications/email"; var apiParameters = new Dictionary() { @@ -1748,7 +1830,7 @@ static Models.Token Convert(Dictionary it) => /// public Task CreatePhoneVerification() { - var apiPath = "/account/verification/phone"; + var apiPath = "/account/verifications/phone"; var apiParameters = new Dictionary() { @@ -1781,7 +1863,7 @@ static Models.Token Convert(Dictionary it) => /// public Task UpdatePhoneVerification(string userId, string secret) { - var apiPath = "/account/verification/phone"; + var apiPath = "/account/verifications/phone"; var apiParameters = new Dictionary() { diff --git a/Appwrite/Services/Functions.cs b/Appwrite/Services/Functions.cs index 730314b..76b2dbc 100644 --- a/Appwrite/Services/Functions.cs +++ b/Appwrite/Services/Functions.cs @@ -417,7 +417,7 @@ static Models.Deployment Convert(Dictionary it) => /// Create a deployment based on a template. /// /// Use this endpoint with combination of - /// [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to + /// [listTemplates](https://appwrite.io/docs/products/functions/templates) to /// find the template details. /// /// diff --git a/Appwrite/Services/Sites.cs b/Appwrite/Services/Sites.cs index 28fb79b..4246ad7 100644 --- a/Appwrite/Services/Sites.cs +++ b/Appwrite/Services/Sites.cs @@ -408,8 +408,8 @@ static Models.Deployment Convert(Dictionary it) => /// Create a deployment based on a template. /// /// Use this endpoint with combination of - /// [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to - /// find the template details. + /// [listTemplates](https://appwrite.io/docs/products/sites/templates) to find + /// the template details. /// /// public Task CreateTemplateDeployment(string siteId, string repository, string owner, string rootDirectory, string version, bool? activate = null) diff --git a/Appwrite/Services/TablesDb.cs b/Appwrite/Services/TablesDb.cs index 89cd69a..64e6bbc 100644 --- a/Appwrite/Services/TablesDb.cs +++ b/Appwrite/Services/TablesDb.cs @@ -209,7 +209,7 @@ static Models.TableList Convert(Dictionary it) => /// /// Create a new Table. Before using this route, you should create a new /// database resource using either a [server - /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) + /// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) /// API or directly from your database console. /// /// @@ -1583,7 +1583,7 @@ static Models.RowList Convert(Dictionary it) => /// /// Create a new Row. Before using this route, you should create a new table /// resource using either a [server - /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) + /// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) /// API or directly from your database console. /// /// @@ -1621,7 +1621,7 @@ static Models.Row Convert(Dictionary it) => /// /// Create new Rows. Before using this route, you should create a new table /// resource using either a [server - /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) + /// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) /// API or directly from your database console. /// /// @@ -1657,7 +1657,7 @@ static Models.RowList Convert(Dictionary it) => /// /// Create or update Rows. Before using this route, you should create a new /// table resource using either a [server - /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) + /// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) /// API or directly from your database console. /// /// @@ -1797,7 +1797,7 @@ static Models.Row Convert(Dictionary it) => /// /// Create or update a Row. Before using this route, you should create a new /// table resource using either a [server - /// integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) + /// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) /// API or directly from your database console. /// /// diff --git a/CHANGELOG.md b/CHANGELOG.md index bbfee10..8682634 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 0.19.1 + +* Deprecate `createVerification` method in `Account` service +* Add `createEmailVerification` method in `Account` service + ## 0.15.0 * Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service diff --git a/README.md b/README.md index cf1cb30..1e79eb4 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstract and simplif Add this reference to your project's `.csproj` file: ```xml - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 0.19.0 +Install-Package Appwrite -Version 0.19.1 # or .NET CLI -dotnet add package Appwrite --version 0.19.0 +dotnet add package Appwrite --version 0.19.1 ``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md new file mode 100644 index 0000000..6efee89 --- /dev/null +++ b/docs/examples/account/create-email-verification.md @@ -0,0 +1,14 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.CreateEmailVerification( + url: "https://example.com" +); \ No newline at end of file diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md new file mode 100644 index 0000000..a336682 --- /dev/null +++ b/docs/examples/account/update-email-verification.md @@ -0,0 +1,15 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Account account = new Account(client); + +Token result = await account.UpdateEmailVerification( + userId: "", + secret: "" +); \ No newline at end of file From 1d91fc3423f0533cfaeaf3e7912dc76348b717e2 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Oct 2025 04:58:21 +0000 Subject: [PATCH 2/2] fix version --- Appwrite/Appwrite.csproj | 2 +- Appwrite/Client.cs | 4 ++-- CHANGELOG.md | 2 +- README.md | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index 73426fc..21aa757 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.19.1 + 0.20.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 7deee67..b2e9073 100644 --- a/Appwrite/Client.cs +++ b/Appwrite/Client.cs @@ -69,11 +69,11 @@ public Client( _headers = new Dictionary() { { "content-type", "application/json" }, - { "user-agent" , $"AppwriteDotNetSDK/0.19.1 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.20.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.19.1"}, + { "x-sdk-version", "0.20.0"}, { "X-Appwrite-Response-Format", "1.8.0" } }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 8682634..7bd7d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## 0.19.1 +## 0.20.0 * Deprecate `createVerification` method in `Account` service * Add `createEmailVerification` method in `Account` service diff --git a/README.md b/README.md index 1e79eb4..a3821f1 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,17 @@ Appwrite is an open-source backend as a service server that abstract and simplif Add this reference to your project's `.csproj` file: ```xml - + ``` You can install packages from the command line: ```powershell # Package Manager -Install-Package Appwrite -Version 0.19.1 +Install-Package Appwrite -Version 0.20.0 # or .NET CLI -dotnet add package Appwrite --version 0.19.1 +dotnet add package Appwrite --version 0.20.0 ```