Skip to content

Commit 15ebb4f

Browse files
committed
fix: minor bugs
1 parent 19185d9 commit 15ebb4f

File tree

13 files changed

+48
-47
lines changed

13 files changed

+48
-47
lines changed

README.md

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

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.5.4-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

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

4141
```groovy
42-
implementation("io.appwrite:sdk-for-kotlin:5.0.1")
42+
implementation("io.appwrite:sdk-for-kotlin:5.0.2")
4343
```
4444

4545
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
5050
<dependency>
5151
<groupId>io.appwrite</groupId>
5252
<artifactId>sdk-for-kotlin</artifactId>
53-
<version>5.0.1</version>
53+
<version>5.0.2</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/messaging/update-email.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ messaging.updateEmail(
2121
listOf(), // cc (optional)
2222
listOf(), // bcc (optional)
2323
"", // scheduledAt (optional)
24+
listOf(), // attachments (optional)
2425
new CoroutineCallback<>((result, error) -> {
2526
if (error != null) {
2627
error.printStackTrace();

docs/examples/kotlin/messaging/update-email.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ val response = messaging.updateEmail(
2020
html = false, // optional
2121
cc = listOf(), // optional
2222
bcc = listOf(), // optional
23-
scheduledAt = "" // optional
23+
scheduledAt = "", // optional
24+
attachments = listOf() // optional
2425
)

src/main/kotlin/io/appwrite/Client.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ class Client @JvmOverloads constructor(
5757
init {
5858
headers = mutableMapOf(
5959
"content-type" to "application/json",
60-
"user-agent" to "AppwriteKotlinSDK/5.0.1 ${System.getProperty("http.agent")}",
60+
"user-agent" to "AppwriteKotlinSDK/5.0.2 ${System.getProperty("http.agent")}",
6161
"x-sdk-name" to "Kotlin",
6262
"x-sdk-platform" to "server",
6363
"x-sdk-language" to "kotlin",
64-
"x-sdk-version" to "5.0.1",
64+
"x-sdk-version" to "5.0.2",
6565
"x-appwrite-response-format" to "1.5.0",
6666
)
6767

src/main/kotlin/io/appwrite/enums/CreditCard.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ enum class CreditCard(val value: String) {
99
ARGENCARD("argencard"),
1010
@SerializedName("cabal")
1111
CABAL("cabal"),
12-
@SerializedName("censosud")
13-
CONSOSUD("censosud"),
12+
@SerializedName("cencosud")
13+
CENCOSUD("cencosud"),
1414
@SerializedName("diners")
1515
DINERS_CLUB("diners"),
1616
@SerializedName("discover")

src/main/kotlin/io/appwrite/enums/Flag.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ enum class Flag(val value: String) {
285285
PAPUA_NEW_GUINEA("pg"),
286286
@SerializedName("pl")
287287
POLAND("pl"),
288+
@SerializedName("pf")
289+
FRENCH_POLYNESIA("pf"),
288290
@SerializedName("kp")
289291
NORTH_KOREA("kp"),
290292
@SerializedName("pt")

src/main/kotlin/io/appwrite/enums/Runtime.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ enum class Runtime(val value: String) {
4141
PYTHON_3_11("python-3.11"),
4242
@SerializedName("python-3.12")
4343
PYTHON_3_12("python-3.12"),
44+
@SerializedName("python-ml-3.11")
45+
PYTHON_ML_3_11("python-ml-3.11"),
4446
@SerializedName("deno-1.40")
4547
DENO_1_40("deno-1.40"),
4648
@SerializedName("dart-2.15")

src/main/kotlin/io/appwrite/models/MfaFactors.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,35 @@ import io.appwrite.extensions.jsonCast
88
*/
99
data class MfaFactors(
1010
/**
11-
* TOTP
11+
* Can TOTP be used for MFA challenge for this account.
1212
*/
1313
@SerializedName("totp")
1414
val totp: Boolean,
1515

1616
/**
17-
* Phone
17+
* Can phone (SMS) be used for MFA challenge for this account.
1818
*/
1919
@SerializedName("phone")
2020
val phone: Boolean,
2121

2222
/**
23-
* Email
23+
* Can email be used for MFA challenge for this account.
2424
*/
2525
@SerializedName("email")
2626
val email: Boolean,
2727

28+
/**
29+
* Can recovery code be used for MFA challenge for this account.
30+
*/
31+
@SerializedName("recoveryCode")
32+
val recoveryCode: Boolean,
33+
2834
) {
2935
fun toMap(): Map<String, Any> = mapOf(
3036
"totp" to totp as Any,
3137
"phone" to phone as Any,
3238
"email" to email as Any,
39+
"recoveryCode" to recoveryCode as Any,
3340
)
3441

3542
companion object {
@@ -41,6 +48,7 @@ data class MfaFactors(
4148
totp = map["totp"] as Boolean,
4249
phone = map["phone"] as Boolean,
4350
email = map["email"] as Boolean,
51+
recoveryCode = map["recoveryCode"] as Boolean,
4452
)
4553
}
4654
}

src/main/kotlin/io/appwrite/models/Session.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ data class Session(
1919
@SerializedName("\$createdAt")
2020
val createdAt: String,
2121

22+
/**
23+
* Session update date in ISO 8601 format.
24+
*/
25+
@SerializedName("\$updatedAt")
26+
val updatedAt: String,
27+
2228
/**
2329
* User ID.
2430
*/
@@ -179,6 +185,7 @@ data class Session(
179185
fun toMap(): Map<String, Any> = mapOf(
180186
"\$id" to id as Any,
181187
"\$createdAt" to createdAt as Any,
188+
"\$updatedAt" to updatedAt as Any,
182189
"userId" to userId as Any,
183190
"expire" to expire as Any,
184191
"provider" to provider as Any,
@@ -215,6 +222,7 @@ data class Session(
215222
) = Session(
216223
id = map["\$id"] as String,
217224
createdAt = map["\$createdAt"] as String,
225+
updatedAt = map["\$updatedAt"] as String,
218226
userId = map["userId"] as String,
219227
expire = map["expire"] as String,
220228
provider = map["provider"] as String,

src/main/kotlin/io/appwrite/services/Account.kt

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class Account(client: Client) : Service(client) {
363363
/**
364364
* Add Authenticator
365365
*
366-
* Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator) method.
366+
* 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.
367367
*
368368
* @param type Type of authenticator. Must be `totp`
369369
* @return [io.appwrite.models.MfaType]
@@ -396,7 +396,7 @@ class Account(client: Client) : Service(client) {
396396
/**
397397
* Verify Authenticator
398398
*
399-
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#addAuthenticator) method.
399+
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. add
400400
*
401401
* @param type Type of authenticator.
402402
* @param otp Valid verification token.
@@ -433,7 +433,7 @@ class Account(client: Client) : Service(client) {
433433
/**
434434
* Verify Authenticator
435435
*
436-
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#addAuthenticator) method.
436+
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. add
437437
*
438438
* @param type Type of authenticator.
439439
* @param otp Valid verification token.
@@ -456,14 +456,13 @@ class Account(client: Client) : Service(client) {
456456
*
457457
* @param type Type of authenticator.
458458
* @param otp Valid verification token.
459-
* @return [io.appwrite.models.User<T>]
459+
* @return [Any]
460460
*/
461461
@Throws(AppwriteException::class)
462-
suspend fun <T> deleteMfaAuthenticator(
462+
suspend fun deleteMfaAuthenticator(
463463
type: io.appwrite.enums.AuthenticatorType,
464464
otp: String,
465-
nestedType: Class<T>,
466-
): io.appwrite.models.User<T> {
465+
): Any {
467466
val apiPath = "/account/mfa/authenticators/{type}"
468467
.replace("{type}", type.value)
469468

@@ -473,38 +472,15 @@ class Account(client: Client) : Service(client) {
473472
val apiHeaders = mutableMapOf(
474473
"content-type" to "application/json",
475474
)
476-
val converter: (Any) -> io.appwrite.models.User<T> = {
477-
io.appwrite.models.User.from(map = it as Map<String, Any>, nestedType)
478-
}
479475
return client.call(
480476
"DELETE",
481477
apiPath,
482478
apiHeaders,
483479
apiParams,
484-
responseType = classOf(),
485-
converter,
480+
responseType = Any::class.java,
486481
)
487482
}
488483

489-
/**
490-
* Delete Authenticator
491-
*
492-
* Delete an authenticator for a user by ID.
493-
*
494-
* @param type Type of authenticator.
495-
* @param otp Valid verification token.
496-
* @return [io.appwrite.models.User<T>]
497-
*/
498-
@Throws(AppwriteException::class)
499-
suspend fun deleteMfaAuthenticator(
500-
type: io.appwrite.enums.AuthenticatorType,
501-
otp: String,
502-
): io.appwrite.models.User<Map<String, Any>> = deleteMfaAuthenticator(
503-
type,
504-
otp,
505-
nestedType = classOf(),
506-
)
507-
508484
/**
509485
* Create 2FA Challenge
510486
*

0 commit comments

Comments
 (0)