Skip to content

Commit b6b3323

Browse files
sdk update
1 parent fe8597f commit b6b3323

12 files changed

Lines changed: 37 additions & 20 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

10-
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
10+
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
1111

1212
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Android SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -38,7 +38,7 @@ repositories {
3838
Next, add the dependency to your project's `build.gradle(.kts)` file:
3939

4040
```groovy
41-
implementation("io.appwrite:sdk-for-android:12.2.0")
41+
implementation("io.appwrite:sdk-for-android:12.2.1")
4242
```
4343

4444
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
4949
<dependency>
5050
<groupId>io.appwrite</groupId>
5151
<artifactId>sdk-for-android</artifactId>
52-
<version>12.2.0</version>
52+
<version>12.2.1</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/databases/list-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ databases.listDocuments(
1515
List.of(), // queries (optional)
1616
"<TRANSACTION_ID>", // transactionId (optional)
1717
false, // total (optional)
18+
0, // ttl (optional)
1819
new CoroutineCallback<>((result, error) -> {
1920
if (error != null) {
2021
error.printStackTrace();

docs/examples/java/tablesdb/list-rows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tablesDB.listRows(
1515
List.of(), // queries (optional)
1616
"<TRANSACTION_ID>", // transactionId (optional)
1717
false, // total (optional)
18+
0, // ttl (optional)
1819
new CoroutineCallback<>((result, error) -> {
1920
if (error != null) {
2021
error.printStackTrace();

docs/examples/kotlin/databases/list-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ val result = databases.listDocuments(
1515
queries = listOf(), // (optional)
1616
transactionId = "<TRANSACTION_ID>", // (optional)
1717
total = false, // (optional)
18+
ttl = 0, // (optional)
1819
)
1920
```

docs/examples/kotlin/tablesdb/list-rows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ val result = tablesDB.listRows(
1515
queries = listOf(), // (optional)
1616
transactionId = "<TRANSACTION_ID>", // (optional)
1717
total = false, // (optional)
18+
ttl = 0, // (optional)
1819
)
1920
```

library/src/main/java/io/appwrite/Channel.kt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ typealias Actionable = _Document
2424
*/
2525
private fun normalize(id: String): String {
2626
val trimmed = id.trim()
27-
return if (trimmed.isEmpty()) "*" else trimmed
27+
require(trimmed.isNotEmpty()) { "Channel ID is required." }
28+
return trimmed
2829
}
2930

3031
/**
@@ -59,25 +60,25 @@ class Channel<out T> private constructor(
5960
override fun toString(): String = segments.joinToString(".")
6061

6162
companion object {
62-
fun database(id: String = "*"): Channel<_Database> =
63+
fun database(id: String): Channel<_Database> =
6364
Channel(listOf("databases", normalize(id)))
6465

65-
fun tablesdb(id: String = "*"): Channel<_TablesDB> =
66+
fun tablesdb(id: String): Channel<_TablesDB> =
6667
Channel(listOf("tablesdb", normalize(id)))
6768

68-
fun bucket(id: String = "*"): Channel<_Bucket> =
69+
fun bucket(id: String): Channel<_Bucket> =
6970
Channel(listOf("buckets", normalize(id)))
7071

71-
fun execution(id: String = "*"): Channel<_Execution> =
72+
fun execution(id: String): Channel<_Execution> =
7273
Channel(listOf("executions", normalize(id)))
7374

74-
fun function(id: String = "*"): Channel<_Func> =
75+
fun function(id: String): Channel<_Func> =
7576
Channel(listOf("functions", normalize(id)))
7677

77-
fun team(id: String = "*"): Channel<_Team> =
78+
fun team(id: String): Channel<_Team> =
7879
Channel(listOf("teams", normalize(id)))
7980

80-
fun membership(id: String = "*"): Channel<_Membership> =
81+
fun membership(id: String): Channel<_Membership> =
8182
Channel(listOf("memberships", normalize(id)))
8283

8384
fun account(): String = "account"
@@ -98,8 +99,8 @@ class Channel<out T> private constructor(
9899
/**
99100
* Only available on Channel<_Database>
100101
*/
101-
fun Channel<_Database>.collection(id: String? = null): Channel<_Collection> =
102-
this.next("collections", id ?: "*")
102+
fun Channel<_Database>.collection(id: String): Channel<_Collection> =
103+
this.next("collections", id)
103104

104105
/**
105106
* Only available on Channel<_Collection>
@@ -112,8 +113,8 @@ fun Channel<_Collection>.document(id: String? = null): Channel<_Document> =
112113
/**
113114
* Only available on Channel<_TablesDB>
114115
*/
115-
fun Channel<_TablesDB>.table(id: String? = null): Channel<_Table> =
116-
this.next("tables", id ?: "*")
116+
fun Channel<_TablesDB>.table(id: String): Channel<_Table> =
117+
this.next("tables", id)
117118

118119
/**
119120
* Only available on Channel<_Table>

library/src/main/java/io/appwrite/Client.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Client @JvmOverloads constructor(
8787
"x-sdk-name" to "Android",
8888
"x-sdk-platform" to "client",
8989
"x-sdk-language" to "android",
90-
"x-sdk-version" to "12.2.0",
90+
"x-sdk-version" to "12.2.1",
9191
"x-appwrite-response-format" to "1.8.0"
9292
)
9393
config = mutableMapOf()

library/src/main/java/io/appwrite/models/Document.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data class Document<T>(
1414
val id: String,
1515

1616
/**
17-
* Document automatically incrementing ID.
17+
* Document sequence ID.
1818
*/
1919
@SerializedName("\$sequence")
2020
val sequence: Long,

library/src/main/java/io/appwrite/models/Row.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data class Row<T>(
1414
val id: String,
1515

1616
/**
17-
* Row automatically incrementing ID.
17+
* Row sequence ID.
1818
*/
1919
@SerializedName("\$sequence")
2020
val sequence: Long,

library/src/main/java/io/appwrite/services/Databases.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class Databases(client: Client) : Service(client) {
220220
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
221221
* @param transactionId Transaction ID to read uncommitted changes within the transaction.
222222
* @param total When set to false, the total count returned will be 0 and will not be calculated.
223+
* @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
223224
* @return [io.appwrite.models.DocumentList<T>]
224225
*/
225226
@Deprecated(
@@ -233,6 +234,7 @@ class Databases(client: Client) : Service(client) {
233234
queries: List<String>? = null,
234235
transactionId: String? = null,
235236
total: Boolean? = null,
237+
ttl: Long? = null,
236238
nestedType: Class<T>,
237239
): io.appwrite.models.DocumentList<T> {
238240
val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents"
@@ -243,6 +245,7 @@ class Databases(client: Client) : Service(client) {
243245
"queries" to queries,
244246
"transactionId" to transactionId,
245247
"total" to total,
248+
"ttl" to ttl,
246249
)
247250
val apiHeaders = mutableMapOf<String, String>(
248251
)
@@ -268,6 +271,7 @@ class Databases(client: Client) : Service(client) {
268271
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
269272
* @param transactionId Transaction ID to read uncommitted changes within the transaction.
270273
* @param total When set to false, the total count returned will be 0 and will not be calculated.
274+
* @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
271275
* @return [io.appwrite.models.DocumentList<T>]
272276
*/
273277
@Deprecated(
@@ -282,12 +286,14 @@ class Databases(client: Client) : Service(client) {
282286
queries: List<String>? = null,
283287
transactionId: String? = null,
284288
total: Boolean? = null,
289+
ttl: Long? = null,
285290
): io.appwrite.models.DocumentList<Map<String, Any>> = listDocuments(
286291
databaseId,
287292
collectionId,
288293
queries,
289294
transactionId,
290295
total,
296+
ttl,
291297
nestedType = classOf(),
292298
)
293299

0 commit comments

Comments
 (0)