Skip to content

Commit 66557e5

Browse files
authored
Merge pull request #76 from appwrite/dev
Dev
2 parents 8126bb9 + c6f6d96 commit 66557e5

24 files changed

+43
-29
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
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.6.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 1.7.x. 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 abstract and simplify 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:7.0.1")
41+
implementation("io.appwrite:sdk-for-android:8.0.0")
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>7.0.1</version>
52+
<version>8.0.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/avatars/get-browser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ avatars.getBrowser(
1313
Browser.AVANT_BROWSER, // code
1414
0, // width (optional)
1515
0, // height (optional)
16-
0, // quality (optional)
16+
-1, // quality (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
1919
error.printStackTrace();

docs/examples/java/avatars/get-credit-card.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ avatars.getCreditCard(
1313
CreditCard.AMERICAN_EXPRESS, // code
1414
0, // width (optional)
1515
0, // height (optional)
16-
0, // quality (optional)
16+
-1, // quality (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
1919
error.printStackTrace();

docs/examples/java/avatars/get-flag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ avatars.getFlag(
1313
Flag.AFGHANISTAN, // code
1414
0, // width (optional)
1515
0, // height (optional)
16-
0, // quality (optional)
16+
-1, // quality (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
1919
error.printStackTrace();

docs/examples/java/databases/create-document.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import io.appwrite.services.Databases;
44

55
Client client = new Client(context)
66
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
7+
.setSession("") // The user session to authenticate with
8+
.setKey("") //
9+
.setJWT("<YOUR_JWT>"); // Your secret JSON Web Token
810

911
Databases databases = new Databases(client);
1012

docs/examples/java/functions/list-executions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Functions functions = new Functions(client);
1111
functions.listExecutions(
1212
"<FUNCTION_ID>", // functionId
1313
listOf(), // queries (optional)
14-
"<SEARCH>", // search (optional)
1514
new CoroutineCallback<>((result, error) -> {
1615
if (error != null) {
1716
error.printStackTrace();

docs/examples/java/storage/get-file-download.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Storage storage = new Storage(client);
1111
storage.getFileDownload(
1212
"<BUCKET_ID>", // bucketId
1313
"<FILE_ID>", // fileId
14+
"<TOKEN>", // token (optional)
1415
new CoroutineCallback<>((result, error) -> {
1516
if (error != null) {
1617
error.printStackTrace();

docs/examples/java/storage/get-file-preview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ storage.getFilePreview(
1414
0, // width (optional)
1515
0, // height (optional)
1616
ImageGravity.CENTER, // gravity (optional)
17-
0, // quality (optional)
17+
-1, // quality (optional)
1818
0, // borderWidth (optional)
1919
"", // borderColor (optional)
2020
0, // borderRadius (optional)
2121
0, // opacity (optional)
2222
-360, // rotation (optional)
2323
"", // background (optional)
2424
ImageFormat.JPG, // output (optional)
25+
"<TOKEN>", // token (optional)
2526
new CoroutineCallback<>((result, error) -> {
2627
if (error != null) {
2728
error.printStackTrace();

docs/examples/java/storage/get-file-view.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Storage storage = new Storage(client);
1111
storage.getFileView(
1212
"<BUCKET_ID>", // bucketId
1313
"<FILE_ID>", // fileId
14+
"<TOKEN>", // token (optional)
1415
new CoroutineCallback<>((result, error) -> {
1516
if (error != null) {
1617
error.printStackTrace();

docs/examples/kotlin/avatars/get-browser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ val result = avatars.getBrowser(
1313
code = Browser.AVANT_BROWSER,
1414
width = 0, // (optional)
1515
height = 0, // (optional)
16-
quality = 0, // (optional)
16+
quality = -1, // (optional)
1717
)

docs/examples/kotlin/avatars/get-credit-card.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ val result = avatars.getCreditCard(
1313
code = CreditCard.AMERICAN_EXPRESS,
1414
width = 0, // (optional)
1515
height = 0, // (optional)
16-
quality = 0, // (optional)
16+
quality = -1, // (optional)
1717
)

docs/examples/kotlin/avatars/get-flag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ val result = avatars.getFlag(
1313
code = Flag.AFGHANISTAN,
1414
width = 0, // (optional)
1515
height = 0, // (optional)
16-
quality = 0, // (optional)
16+
quality = -1, // (optional)
1717
)

docs/examples/kotlin/databases/create-document.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import io.appwrite.services.Databases
44

55
val client = Client(context)
66
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7-
.setProject("<YOUR_PROJECT_ID>") // Your project ID
7+
.setSession("") // The user session to authenticate with
8+
.setKey("") //
9+
.setJWT("<YOUR_JWT>") // Your secret JSON Web Token
810

911
val databases = Databases(client)
1012

docs/examples/kotlin/functions/list-executions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ val functions = Functions(client)
1111
val result = functions.listExecutions(
1212
functionId = "<FUNCTION_ID>",
1313
queries = listOf(), // (optional)
14-
search = "<SEARCH>", // (optional)
1514
)

docs/examples/kotlin/storage/get-file-download.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ val storage = Storage(client)
1111
val result = storage.getFileDownload(
1212
bucketId = "<BUCKET_ID>",
1313
fileId = "<FILE_ID>",
14+
token = "<TOKEN>", // (optional)
1415
)

docs/examples/kotlin/storage/get-file-preview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ val result = storage.getFilePreview(
1414
width = 0, // (optional)
1515
height = 0, // (optional)
1616
gravity = ImageGravity.CENTER, // (optional)
17-
quality = 0, // (optional)
17+
quality = -1, // (optional)
1818
borderWidth = 0, // (optional)
1919
borderColor = "", // (optional)
2020
borderRadius = 0, // (optional)
2121
opacity = 0, // (optional)
2222
rotation = -360, // (optional)
2323
background = "", // (optional)
2424
output = ImageFormat.JPG, // (optional)
25+
token = "<TOKEN>", // (optional)
2526
)

docs/examples/kotlin/storage/get-file-view.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ val storage = Storage(client)
1111
val result = storage.getFileView(
1212
bucketId = "<BUCKET_ID>",
1313
fileId = "<FILE_ID>",
14+
token = "<TOKEN>", // (optional)
1415
)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ 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 "7.0.1",
91-
"x-appwrite-response-format" to "1.6.0"
90+
"x-sdk-version" to "8.0.0",
91+
"x-appwrite-response-format" to "1.7.0"
9292
)
9393
config = mutableMapOf()
9494

library/src/main/java/io/appwrite/enums/ImageFormat.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ enum class ImageFormat(val value: String) {
77
JPG("jpg"),
88
@SerializedName("jpeg")
99
JPEG("jpeg"),
10-
@SerializedName("gif")
11-
GIF("gif"),
1210
@SerializedName("png")
1311
PNG("png"),
1412
@SerializedName("webp")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ data class Execution(
9898
val errors: String,
9999

100100
/**
101-
* Function execution duration in seconds.
101+
* Resource(function/site) execution duration in seconds.
102102
*/
103103
@SerializedName("duration")
104104
val duration: Double,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Avatars(client: Client) : Service(client) {
2323
* @param code Browser Code.
2424
* @param width Image width. Pass an integer between 0 to 2000. Defaults to 100.
2525
* @param height Image height. Pass an integer between 0 to 2000. Defaults to 100.
26-
* @param quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
26+
* @param quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
2727
* @return [ByteArray]
2828
*/
2929
@JvmOverloads
@@ -57,7 +57,7 @@ class Avatars(client: Client) : Service(client) {
5757
* @param code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.
5858
* @param width Image width. Pass an integer between 0 to 2000. Defaults to 100.
5959
* @param height Image height. Pass an integer between 0 to 2000. Defaults to 100.
60-
* @param quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
60+
* @param quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
6161
* @return [ByteArray]
6262
*/
6363
@JvmOverloads
@@ -115,7 +115,7 @@ class Avatars(client: Client) : Service(client) {
115115
* @param code Country Code. ISO Alpha-2 country code format.
116116
* @param width Image width. Pass an integer between 0 to 2000. Defaults to 100.
117117
* @param height Image height. Pass an integer between 0 to 2000. Defaults to 100.
118-
* @param quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
118+
* @param quality Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
119119
* @return [ByteArray]
120120
*/
121121
@JvmOverloads

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,18 @@ class Functions(client: Client) : Service(client) {
2020
*
2121
* @param functionId Function ID.
2222
* @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. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
23-
* @param search Search term to filter your list results. Max length: 256 chars.
2423
* @return [io.appwrite.models.ExecutionList]
2524
*/
2625
@JvmOverloads
2726
suspend fun listExecutions(
2827
functionId: String,
2928
queries: List<String>? = null,
30-
search: String? = null,
3129
): io.appwrite.models.ExecutionList {
3230
val apiPath = "/functions/{functionId}/executions"
3331
.replace("{functionId}", functionId)
3432

3533
val apiParams = mutableMapOf<String, Any?>(
3634
"queries" to queries,
37-
"search" to search,
3835
)
3936
val apiHeaders = mutableMapOf<String, String>(
4037
)

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,21 @@ class Storage(client: Client) : Service(client) {
213213
*
214214
* @param bucketId Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
215215
* @param fileId File ID.
216+
* @param token File token for accessing this file.
216217
* @return [ByteArray]
217218
*/
219+
@JvmOverloads
218220
suspend fun getFileDownload(
219221
bucketId: String,
220222
fileId: String,
223+
token: String? = null,
221224
): ByteArray {
222225
val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/download"
223226
.replace("{bucketId}", bucketId)
224227
.replace("{fileId}", fileId)
225228

226229
val apiParams = mutableMapOf<String, Any?>(
230+
"token" to token,
227231
"project" to client.config["project"],
228232
)
229233
return client.call(
@@ -243,14 +247,15 @@ class Storage(client: Client) : Service(client) {
243247
* @param width Resize preview image width, Pass an integer between 0 to 4000.
244248
* @param height Resize preview image height, Pass an integer between 0 to 4000.
245249
* @param gravity Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
246-
* @param quality Preview image quality. Pass an integer between 0 to 100. Defaults to 100.
250+
* @param quality Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
247251
* @param borderWidth Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
248252
* @param borderColor Preview image border color. Use a valid HEX color, no # is needed for prefix.
249253
* @param borderRadius Preview image border radius in pixels. Pass an integer between 0 to 4000.
250254
* @param opacity Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
251255
* @param rotation Preview image rotation in degrees. Pass an integer between -360 and 360.
252256
* @param background Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
253257
* @param output Output format type (jpeg, jpg, png, gif and webp).
258+
* @param token File token for accessing this file.
254259
* @return [ByteArray]
255260
*/
256261
@JvmOverloads
@@ -268,6 +273,7 @@ class Storage(client: Client) : Service(client) {
268273
rotation: Long? = null,
269274
background: String? = null,
270275
output: io.appwrite.enums.ImageFormat? = null,
276+
token: String? = null,
271277
): ByteArray {
272278
val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/preview"
273279
.replace("{bucketId}", bucketId)
@@ -285,6 +291,7 @@ class Storage(client: Client) : Service(client) {
285291
"rotation" to rotation,
286292
"background" to background,
287293
"output" to output,
294+
"token" to token,
288295
"project" to client.config["project"],
289296
)
290297
return client.call(
@@ -301,17 +308,21 @@ class Storage(client: Client) : Service(client) {
301308
*
302309
* @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
303310
* @param fileId File ID.
311+
* @param token File token for accessing this file.
304312
* @return [ByteArray]
305313
*/
314+
@JvmOverloads
306315
suspend fun getFileView(
307316
bucketId: String,
308317
fileId: String,
318+
token: String? = null,
309319
): ByteArray {
310320
val apiPath = "/storage/buckets/{bucketId}/files/{fileId}/view"
311321
.replace("{bucketId}", bucketId)
312322
.replace("{fileId}", fileId)
313323

314324
val apiParams = mutableMapOf<String, Any?>(
325+
"token" to token,
315326
"project" to client.config["project"],
316327
)
317328
return client.call(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class Teams(client: Client) : Service(client) {
256256
* Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
257257
*
258258
* @param teamId Team ID.
259-
* @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. You may filter on the following attributes: userId, teamId, invited, joined, confirm
259+
* @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. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
260260
* @param search Search term to filter your list results. Max length: 256 chars.
261261
* @return [io.appwrite.models.MembershipList]
262262
*/

0 commit comments

Comments
 (0)