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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 13.1.0

* Added ability to create columns and indexes synchronously while creating a table

## 13.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-kotlin:13.0.0")
implementation("io.appwrite:sdk-for-kotlin:13.1.0")
```

### Maven
Expand All @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-kotlin</artifactId>
<version>13.0.0</version>
<version>13.1.0</version>
</dependency>
</dependencies>
```
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/java/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import io.appwrite.enums.AuthenticationFactor;

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/java/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import io.appwrite.enums.OAuthProvider;

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/java/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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/java/account/update-phone-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import io.appwrite.services.Account;

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
2 changes: 2 additions & 0 deletions docs/examples/java/databases/create-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ databases.createCollection(
List.of(Permission.read(Role.any())), // permissions (optional)
false, // documentSecurity (optional)
false, // enabled (optional)
List.of(), // attributes (optional)
List.of(), // indexes (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/java/tablesdb/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ tablesDB.createTable(
List.of(Permission.read(Role.any())), // permissions (optional)
false, // rowSecurity (optional)
false, // enabled (optional)
List.of(), // columns (optional)
List.of(), // indexes (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.appwrite.enums.AuthenticationFactor
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.appwrite.enums.OAuthProvider
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/account/update-phone-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.appwrite.services.Account
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

val account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/kotlin/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ val result = avatars.getScreenshot(
userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // optional
fullpage = true, // optional
locale = "en-US", // optional
timezone = "America/New_York", // optional
timezone = "america/new_york", // optional
latitude = 37.7749, // optional
longitude = -122.4194, // optional
accuracy = 100, // optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/kotlin/databases/create-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ val response = databases.createCollection(
name = "<NAME>",
permissions = listOf(Permission.read(Role.any())), // optional
documentSecurity = false, // optional
enabled = false // optional
enabled = false, // optional
attributes = listOf(), // optional
indexes = listOf() // optional
)
4 changes: 3 additions & 1 deletion docs/examples/kotlin/tablesdb/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ val response = tablesDB.createTable(
name = "<NAME>",
permissions = listOf(Permission.read(Role.any())), // optional
rowSecurity = false, // optional
enabled = false // optional
enabled = false, // optional
columns = listOf(), // optional
indexes = listOf() // optional
)
4 changes: 2 additions & 2 deletions src/main/kotlin/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
"user-agent" to "AppwriteKotlinSDK/13.0.0 ${System.getProperty("http.agent")}",
"user-agent" to "AppwriteKotlinSDK/13.1.0 ${System.getProperty("http.agent")}",
"x-sdk-name" to "Kotlin",
"x-sdk-platform" to "server",
"x-sdk-language" to "kotlin",
"x-sdk-version" to "13.0.0",
"x-sdk-version" to "13.1.0",
"x-appwrite-response-format" to "1.8.0",
)

Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/io/appwrite/services/Databases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ class Databases(client: Client) : Service(client) {
* @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
* @param documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
* @param enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
* @param attributes Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
* @param indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
* @return [io.appwrite.models.Collection]
*/
@Deprecated(
Expand All @@ -465,6 +467,8 @@ class Databases(client: Client) : Service(client) {
permissions: List<String>? = null,
documentSecurity: Boolean? = null,
enabled: Boolean? = null,
attributes: List<Any>? = null,
indexes: List<Any>? = null,
): io.appwrite.models.Collection {
val apiPath = "/databases/{databaseId}/collections"
.replace("{databaseId}", databaseId)
Expand All @@ -475,6 +479,8 @@ class Databases(client: Client) : Service(client) {
"permissions" to permissions,
"documentSecurity" to documentSecurity,
"enabled" to enabled,
"attributes" to attributes,
"indexes" to indexes,
)
val apiHeaders = mutableMapOf<String, String>(
"content-type" to "application/json",
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/io/appwrite/services/TablesDB.kt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ class TablesDB(client: Client) : Service(client) {
* @param permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
* @param rowSecurity Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
* @param enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
* @param columns Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
* @param indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
* @return [io.appwrite.models.Table]
*/
@JvmOverloads
Expand All @@ -437,6 +439,8 @@ class TablesDB(client: Client) : Service(client) {
permissions: List<String>? = null,
rowSecurity: Boolean? = null,
enabled: Boolean? = null,
columns: List<Any>? = null,
indexes: List<Any>? = null,
): io.appwrite.models.Table {
val apiPath = "/tablesdb/{databaseId}/tables"
.replace("{databaseId}", databaseId)
Expand All @@ -447,6 +451,8 @@ class TablesDB(client: Client) : Service(client) {
"permissions" to permissions,
"rowSecurity" to rowSecurity,
"enabled" to enabled,
"columns" to columns,
"indexes" to indexes,
)
val apiHeaders = mutableMapOf<String, String>(
"content-type" to "application/json",
Expand Down