Skip to content

Commit 3fa8a13

Browse files
authored
Merge pull request #64 from appwrite/dev
release: android
2 parents 2774e02 + 9044167 commit 3fa8a13

File tree

18 files changed

+89
-42
lines changed

18 files changed

+89
-42
lines changed

.github/workflows/autoclose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Auto-close External Pull Requests
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
auto_close:
9+
uses: appwrite/.github/.github/workflows/autoclose.yml@main
10+
secrets:
11+
GH_AUTO_CLOSE_PR_TOKEN: ${{ secrets.GH_AUTO_CLOSE_PR_TOKEN }}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -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:6.0.0")
41+
implementation("io.appwrite:sdk-for-android:6.1.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>6.0.0</version>
52+
<version>6.1.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

example/src/main/java/io/appwrite/android/ui/accounts/AccountsViewModel.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class AccountsViewModel : ViewModel() {
8181
account.createOAuth2Session(
8282
activity,
8383
OAuthProvider.FACEBOOK,
84-
"appwrite-callback-6070749e6acd4://demo.appwrite.io/auth/oauth2/success",
85-
"appwrite-callback-6070749e6acd4://demo.appwrite.io/auth/oauth2/failure"
84+
"appwrite-callback-6070749e6acd4://cloud.appwrite.io/auth/oauth2/success",
85+
"appwrite-callback-6070749e6acd4://cloud.appwrite.io/auth/oauth2/failure"
8686
)
8787
} catch (e: Exception) {
8888
_error.postValue(Event(e))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Client @JvmOverloads constructor(
8686
"x-sdk-name" to "Android",
8787
"x-sdk-platform" to "client",
8888
"x-sdk-language" to "android",
89-
"x-sdk-version" to "6.0.0",
89+
"x-sdk-version" to "6.1.0",
9090
"x-appwrite-response-format" to "1.6.0"
9191
)
9292
config = mutableMapOf()

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ enum class ImageFormat(val value: String) {
1212
@SerializedName("png")
1313
PNG("png"),
1414
@SerializedName("webp")
15-
WEBP("webp");
15+
WEBP("webp"),
16+
@SerializedName("avif")
17+
AVIF("avif");
1618

1719
override fun toString() = value
1820
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ data class Document<T>(
4141
* Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
4242
*/
4343
@SerializedName("\$permissions")
44-
val permissions: List<Any>,
44+
val permissions: List<String>,
4545

4646
/**
4747
* Additional properties
@@ -66,7 +66,7 @@ data class Document<T>(
6666
databaseId: String,
6767
createdAt: String,
6868
updatedAt: String,
69-
permissions: List<Any>,
69+
permissions: List<String>,
7070
data: Map<String, Any>
7171
) = Document<Map<String, Any>>(
7272
id,
@@ -88,7 +88,7 @@ data class Document<T>(
8888
databaseId = map["\$databaseId"] as String,
8989
createdAt = map["\$createdAt"] as String,
9090
updatedAt = map["\$updatedAt"] as String,
91-
permissions = map["\$permissions"] as List<Any>,
91+
permissions = map["\$permissions"] as List<String>,
9292
data = map.jsonCast(to = nestedType)
9393
)
9494
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ data class Execution(
2929
* Execution roles.
3030
*/
3131
@SerializedName("\$permissions")
32-
val permissions: List<Any>,
32+
val permissions: List<String>,
3333

3434
/**
3535
* Function ID.
@@ -139,7 +139,7 @@ data class Execution(
139139
id = map["\$id"] as String,
140140
createdAt = map["\$createdAt"] as String,
141141
updatedAt = map["\$updatedAt"] as String,
142-
permissions = map["\$permissions"] as List<Any>,
142+
permissions = map["\$permissions"] as List<String>,
143143
functionId = map["functionId"] as String,
144144
trigger = map["trigger"] as String,
145145
status = map["status"] as String,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ data class File(
3535
* File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
3636
*/
3737
@SerializedName("\$permissions")
38-
val permissions: List<Any>,
38+
val permissions: List<String>,
3939

4040
/**
4141
* File name.
@@ -98,7 +98,7 @@ data class File(
9898
bucketId = map["bucketId"] as String,
9999
createdAt = map["\$createdAt"] as String,
100100
updatedAt = map["\$updatedAt"] as String,
101-
permissions = map["\$permissions"] as List<Any>,
101+
permissions = map["\$permissions"] as List<String>,
102102
name = map["name"] as String,
103103
signature = map["signature"] as String,
104104
mimeType = map["mimeType"] as String,

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ data class Membership(
3232
val userId: String,
3333

3434
/**
35-
* User name.
35+
* User name. Hide this attribute by toggling membership privacy in the Console.
3636
*/
3737
@SerializedName("userName")
3838
val userName: String,
3939

4040
/**
41-
* User email address.
41+
* User email address. Hide this attribute by toggling membership privacy in the Console.
4242
*/
4343
@SerializedName("userEmail")
4444
val userEmail: String,
@@ -74,7 +74,7 @@ data class Membership(
7474
val confirm: Boolean,
7575

7676
/**
77-
* Multi factor authentication status, true if the user has MFA enabled or false otherwise.
77+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
7878
*/
7979
@SerializedName("mfa")
8080
val mfa: Boolean,
@@ -83,7 +83,7 @@ data class Membership(
8383
* User list of roles
8484
*/
8585
@SerializedName("roles")
86-
val roles: List<Any>,
86+
val roles: List<String>,
8787

8888
) {
8989
fun toMap(): Map<String, Any> = mapOf(
@@ -120,7 +120,7 @@ data class Membership(
120120
joined = map["joined"] as String,
121121
confirm = map["confirm"] as Boolean,
122122
mfa = map["mfa"] as Boolean,
123-
roles = map["roles"] as List<Any>,
123+
roles = map["roles"] as List<String>,
124124
)
125125
}
126126
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data class MfaRecoveryCodes(
1111
* Recovery codes.
1212
*/
1313
@SerializedName("recoveryCodes")
14-
val recoveryCodes: List<Any>,
14+
val recoveryCodes: List<String>,
1515

1616
) {
1717
fun toMap(): Map<String, Any> = mapOf(
@@ -24,7 +24,7 @@ data class MfaRecoveryCodes(
2424
fun from(
2525
map: Map<String, Any>,
2626
) = MfaRecoveryCodes(
27-
recoveryCodes = map["recoveryCodes"] as List<Any>,
27+
recoveryCodes = map["recoveryCodes"] as List<String>,
2828
)
2929
}
3030
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ data class Session(
167167
* Returns a list of active session factors.
168168
*/
169169
@SerializedName("factors")
170-
val factors: List<Any>,
170+
val factors: List<String>,
171171

172172
/**
173173
* Secret used to authenticate the user. Only included if the request was made with an API key
@@ -246,7 +246,7 @@ data class Session(
246246
countryCode = map["countryCode"] as String,
247247
countryName = map["countryName"] as String,
248248
current = map["current"] as Boolean,
249-
factors = map["factors"] as List<Any>,
249+
factors = map["factors"] as List<String>,
250250
secret = map["secret"] as String,
251251
mfaUpdatedAt = map["mfaUpdatedAt"] as String,
252252
)

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

+8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ data class Target(
5555
@SerializedName("identifier")
5656
val identifier: String,
5757

58+
/**
59+
* Is the target expired.
60+
*/
61+
@SerializedName("expired")
62+
val expired: Boolean,
63+
5864
) {
5965
fun toMap(): Map<String, Any> = mapOf(
6066
"\$id" to id as Any,
@@ -65,6 +71,7 @@ data class Target(
6571
"providerId" to providerId as Any,
6672
"providerType" to providerType as Any,
6773
"identifier" to identifier as Any,
74+
"expired" to expired as Any,
6875
)
6976

7077
companion object {
@@ -81,6 +88,7 @@ data class Target(
8188
providerId = map["providerId"] as? String?,
8289
providerType = map["providerType"] as String,
8390
identifier = map["identifier"] as String,
91+
expired = map["expired"] as Boolean,
8492
)
8593
}
8694
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ data class User<T>(
6565
* Labels for the user.
6666
*/
6767
@SerializedName("labels")
68-
val labels: List<Any>,
68+
val labels: List<String>,
6969

7070
/**
7171
* Password update time in ISO 8601 format.
@@ -155,7 +155,7 @@ data class User<T>(
155155
hashOptions: Any?,
156156
registration: String,
157157
status: Boolean,
158-
labels: List<Any>,
158+
labels: List<String>,
159159
passwordUpdate: String,
160160
email: String,
161161
phone: String,
@@ -201,7 +201,7 @@ data class User<T>(
201201
hashOptions = map["hashOptions"] as? Any?,
202202
registration = map["registration"] as String,
203203
status = map["status"] as Boolean,
204-
labels = map["labels"] as List<Any>,
204+
labels = map["labels"] as List<String>,
205205
passwordUpdate = map["passwordUpdate"] as String,
206206
email = map["email"] as String,
207207
phone = map["phone"] as String,

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

+17-13
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class Account(client: Client) : Service(client) {
190190
)
191191

192192
/**
193-
* List Identities
193+
* List identities
194194
*
195195
* Get the list of identities for the currently logged in user.
196196
*
@@ -370,7 +370,7 @@ class Account(client: Client) : Service(client) {
370370
)
371371

372372
/**
373-
* Create Authenticator
373+
* Create authenticator
374374
*
375375
* Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
376376
*
@@ -404,7 +404,7 @@ class Account(client: Client) : Service(client) {
404404

405405

406406
/**
407-
* Verify Authenticator
407+
* Verify authenticator
408408
*
409409
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
410410
*
@@ -441,7 +441,7 @@ class Account(client: Client) : Service(client) {
441441
}
442442

443443
/**
444-
* Verify Authenticator
444+
* Verify authenticator
445445
*
446446
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
447447
*
@@ -460,7 +460,7 @@ class Account(client: Client) : Service(client) {
460460
)
461461

462462
/**
463-
* Delete Authenticator
463+
* Delete authenticator
464464
*
465465
* Delete an authenticator for a user by ID.
466466
*
@@ -489,7 +489,7 @@ class Account(client: Client) : Service(client) {
489489

490490

491491
/**
492-
* Create MFA Challenge
492+
* Create MFA challenge
493493
*
494494
* Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
495495
*
@@ -523,7 +523,7 @@ class Account(client: Client) : Service(client) {
523523

524524

525525
/**
526-
* Create MFA Challenge (confirmation)
526+
* Create MFA challenge (confirmation)
527527
*
528528
* Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
529529
*
@@ -555,7 +555,7 @@ class Account(client: Client) : Service(client) {
555555

556556

557557
/**
558-
* List Factors
558+
* List factors
559559
*
560560
* List the factors available on the account to be used as a MFA challange.
561561
*
@@ -586,7 +586,7 @@ class Account(client: Client) : Service(client) {
586586

587587

588588
/**
589-
* Get MFA Recovery Codes
589+
* Get MFA recovery codes
590590
*
591591
* Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
592592
*
@@ -617,7 +617,7 @@ class Account(client: Client) : Service(client) {
617617

618618

619619
/**
620-
* Create MFA Recovery Codes
620+
* Create MFA recovery codes
621621
*
622622
* Generate recovery codes as backup for MFA flow. It&#039;s recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
623623
*
@@ -648,7 +648,7 @@ class Account(client: Client) : Service(client) {
648648

649649

650650
/**
651-
* Regenerate MFA Recovery Codes
651+
* Regenerate MFA recovery codes
652652
*
653653
* Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
654654
*
@@ -1209,7 +1209,9 @@ class Account(client: Client) : Service(client) {
12091209
return@forEach
12101210
}
12111211
is List<*> -> {
1212-
apiQuery.add("${it.key}[]=${it.value.toString()}")
1212+
(it.value as List<*>).forEach { v ->
1213+
apiQuery.add("${it.key}[]=${v.toString()}")
1214+
}
12131215
}
12141216
else -> {
12151217
apiQuery.add("${it.key}=${it.value.toString()}")
@@ -1688,7 +1690,9 @@ class Account(client: Client) : Service(client) {
16881690
return@forEach
16891691
}
16901692
is List<*> -> {
1691-
apiQuery.add("${it.key}[]=${it.value.toString()}")
1693+
(it.value as List<*>).forEach { v ->
1694+
apiQuery.add("${it.key}[]=${v.toString()}")
1695+
}
16921696
}
16931697
else -> {
16941698
apiQuery.add("${it.key}=${it.value.toString()}")

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Locale(client: Client) : Service(client) {
4747

4848

4949
/**
50-
* List Locale Codes
50+
* List locale codes
5151
*
5252
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
5353
*

0 commit comments

Comments
 (0)