diff --git a/Appwrite/Appwrite.csproj b/Appwrite/Appwrite.csproj index d95b4003..1cfdf35c 100644 --- a/Appwrite/Appwrite.csproj +++ b/Appwrite/Appwrite.csproj @@ -2,7 +2,7 @@ netstandard2.0;net462 Appwrite - 0.23.0 + 0.24.0 Appwrite Team Appwrite Team diff --git a/Appwrite/Client.cs b/Appwrite/Client.cs index 33951355..57f98e72 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.23.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, + { "user-agent" , $"AppwriteDotNetSDK/0.24.0 ({Environment.OSVersion.Platform}; {Environment.OSVersion.VersionString})"}, { "x-sdk-name", ".NET" }, { "x-sdk-platform", "server" }, { "x-sdk-language", "dotnet" }, - { "x-sdk-version", "0.23.0"}, + { "x-sdk-version", "0.24.0"}, { "X-Appwrite-Response-Format", "1.8.0" } }; diff --git a/Appwrite/Services/Databases.cs b/Appwrite/Services/Databases.cs index e51aa893..4d8cab0d 100644 --- a/Appwrite/Services/Databases.cs +++ b/Appwrite/Services/Databases.cs @@ -406,7 +406,7 @@ static Models.CollectionList Convert(Dictionary it) => /// /// [Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.")] - public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null) + public Task CreateCollection(string databaseId, string collectionId, string name, List? permissions = null, bool? documentSecurity = null, bool? enabled = null, List? attributes = null, List? indexes = null) { var apiPath = "/databases/{databaseId}/collections" .Replace("{databaseId}", databaseId); @@ -417,7 +417,9 @@ static Models.CollectionList Convert(Dictionary it) => { "name", name }, { "permissions", permissions }, { "documentSecurity", documentSecurity }, - { "enabled", enabled } + { "enabled", enabled }, + { "attributes", attributes }, + { "indexes", indexes } }; var apiHeaders = new Dictionary() diff --git a/Appwrite/Services/TablesDB.cs b/Appwrite/Services/TablesDB.cs index 1fe0c1da..85d78aa1 100644 --- a/Appwrite/Services/TablesDB.cs +++ b/Appwrite/Services/TablesDB.cs @@ -399,7 +399,7 @@ static Models.TableList Convert(Dictionary it) => /// API or directly from your database console. /// /// - public Task CreateTable(string databaseId, string tableId, string name, List? permissions = null, bool? rowSecurity = null, bool? enabled = null) + public Task CreateTable(string databaseId, string tableId, string name, List? permissions = null, bool? rowSecurity = null, bool? enabled = null, List? columns = null, List? indexes = null) { var apiPath = "/tablesdb/{databaseId}/tables" .Replace("{databaseId}", databaseId); @@ -410,7 +410,9 @@ static Models.TableList Convert(Dictionary it) => { "name", name }, { "permissions", permissions }, { "rowSecurity", rowSecurity }, - { "enabled", enabled } + { "enabled", enabled }, + { "columns", columns }, + { "indexes", indexes } }; var apiHeaders = new Dictionary() diff --git a/CHANGELOG.md b/CHANGELOG.md index eabf40da..092bfc1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 0.24.0 + +* Added ability to create columns and indexes synchronously while creating a table + ## 0.23.0 * Rename `VCSDeploymentType` enum to `VCSReferenceType` diff --git a/README.md b/README.md index d6ee4335..f2c59f43 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.23.0 +Install-Package Appwrite -Version 0.24.0 # or .NET CLI -dotnet add package Appwrite --version 0.23.0 +dotnet add package Appwrite --version 0.24.0 ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index fc807aa4..087afeee 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index abf5a413..8e62f30d 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 69862fee..0e867a00 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md index 423cbed2..9572d690 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/account/create-jwt.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index 21bcef6b..9bba5fcf 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 32497b4e..0d7a20c7 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -5,7 +5,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 5b405449..a5e15c08 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -5,7 +5,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 0d17f5ec..02f86ee3 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 2da46ce6..e682599e 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 83c1d542..d3d2ecc6 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index a8d8312e..b1d729b4 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 2f8b0919..e5dbef1a 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -4,7 +4,8 @@ using Appwrite.Services; Client client = new Client() .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint - .SetProject(""); // Your project ID + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with Account account = new Account(client); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index bfb24faf..a4cbf7c4 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -15,5 +15,7 @@ Collection result = await databases.CreateCollection( name: "", permissions: new List { Permission.Read(Role.Any()) }, // optional documentSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + attributes: new List(), // optional + indexes: new List() // optional ); \ No newline at end of file diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 0df89acc..7b622d1d 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -15,5 +15,7 @@ Table result = await tablesDB.CreateTable( name: "", permissions: new List { Permission.Read(Role.Any()) }, // optional rowSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + columns: new List(), // optional + indexes: new List() // optional ); \ No newline at end of file