Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Appwrite/Appwrite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<PackageId>Appwrite</PackageId>
<Version>0.23.0</Version>
<Version>0.24.0</Version>
<Authors>Appwrite Team</Authors>
<Company>Appwrite Team</Company>
<Description>
Expand Down
4 changes: 2 additions & 2 deletions Appwrite/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public Client(
_headers = new Dictionary<string, string>()
{
{ "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" }
};

Expand Down
6 changes: 4 additions & 2 deletions Appwrite/Services/Databases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static Models.CollectionList Convert(Dictionary<string, object> it) =>
/// </para>
/// </summary>
[Obsolete("This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead.")]
public Task<Models.Collection> CreateCollection(string databaseId, string collectionId, string name, List<string>? permissions = null, bool? documentSecurity = null, bool? enabled = null)
public Task<Models.Collection> CreateCollection(string databaseId, string collectionId, string name, List<string>? permissions = null, bool? documentSecurity = null, bool? enabled = null, List<object>? attributes = null, List<object>? indexes = null)
{
var apiPath = "/databases/{databaseId}/collections"
.Replace("{databaseId}", databaseId);
Expand All @@ -417,7 +417,9 @@ static Models.CollectionList Convert(Dictionary<string, object> it) =>
{ "name", name },
{ "permissions", permissions },
{ "documentSecurity", documentSecurity },
{ "enabled", enabled }
{ "enabled", enabled },
{ "attributes", attributes },
{ "indexes", indexes }
};

var apiHeaders = new Dictionary<string, string>()
Expand Down
6 changes: 4 additions & 2 deletions Appwrite/Services/TablesDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ static Models.TableList Convert(Dictionary<string, object> it) =>
/// API or directly from your database console.
/// </para>
/// </summary>
public Task<Models.Table> CreateTable(string databaseId, string tableId, string name, List<string>? permissions = null, bool? rowSecurity = null, bool? enabled = null)
public Task<Models.Table> CreateTable(string databaseId, string tableId, string name, List<string>? permissions = null, bool? rowSecurity = null, bool? enabled = null, List<object>? columns = null, List<object>? indexes = null)
{
var apiPath = "/tablesdb/{databaseId}/tables"
.Replace("{databaseId}", databaseId);
Expand All @@ -410,7 +410,9 @@ static Models.TableList Convert(Dictionary<string, object> it) =>
{ "name", name },
{ "permissions", permissions },
{ "rowSecurity", rowSecurity },
{ "enabled", enabled }
{ "enabled", enabled },
{ "columns", columns },
{ "indexes", indexes }
};

var apiHeaders = new Dictionary<string, string>()
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<PackageReference Include="Appwrite" Version="0.23.0" />
<PackageReference Include="Appwrite" Version="0.24.0" />
```

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
```


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/update-phone-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Appwrite.Services;

Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with

Account account = new Account(client);

Expand Down
4 changes: 3 additions & 1 deletion docs/examples/databases/create-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ Collection result = await databases.CreateCollection(
name: "<NAME>",
permissions: new List<string> { Permission.Read(Role.Any()) }, // optional
documentSecurity: false, // optional
enabled: false // optional
enabled: false, // optional
attributes: new List<object>(), // optional
indexes: new List<object>() // optional
);
4 changes: 3 additions & 1 deletion docs/examples/tablesdb/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ Table result = await tablesDB.CreateTable(
name: "<NAME>",
permissions: new List<string> { Permission.Read(Role.Any()) }, // optional
rowSecurity: false, // optional
enabled: false // optional
enabled: false, // optional
columns: new List<object>(), // optional
indexes: new List<object>() // optional
);