Skip to content

Commit

Permalink
Release candidate for 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Feb 19, 2024
1 parent 0764928 commit 83caa55
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
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:5.0.0-rc.2")
implementation("io.appwrite:sdk-for-kotlin:5.0.0-rc.3")
```

### 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>5.0.0-rc.2</version>
<version>5.0.0-rc.3</version>
</dependency>
</dependencies>
```
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/account/add-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
import io.appwrite.enums.Type;
import io.appwrite.enums.AuthenticatorType;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ Client client = new Client()
Account account = new Account(client);

account.addAuthenticator(
.TOTP
AuthenticatorType.TOTP
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/account/create2f-a-challenge.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
import io.appwrite.enums.Factor;
import io.appwrite.enums.AuthenticationFactor;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -10,7 +10,7 @@ Client client = new Client()
Account account = new Account(client);

account.create2FAChallenge(
.TOTP
AuthenticationFactor.TOTP
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/account/delete-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
import io.appwrite.enums.Type;
import io.appwrite.enums.AuthenticatorType;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ Client client = new Client()
Account account = new Account(client);

account.deleteAuthenticator(
.TOTP,
AuthenticatorType.TOTP,
"[OTP]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/account/verify-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Account;
import io.appwrite.enums.Type;
import io.appwrite.enums.AuthenticatorType;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ Client client = new Client()
Account account = new Account(client);

account.verifyAuthenticator(
.TOTP,
AuthenticatorType.TOTP,
"[OTP]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/users/delete-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Users;
import io.appwrite.enums.Type;
import io.appwrite.enums.AuthenticatorType;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -12,7 +12,7 @@ Users users = new Users(client);

users.deleteAuthenticator(
"[USER_ID]",
.TOTP,
AuthenticatorType.TOTP,
"[OTP]"
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/kotlin/account/add-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
import io.appwrite.enums.Type
import io.appwrite.enums.AuthenticatorType

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -11,5 +11,5 @@ val client = Client()
val account = Account(client)

val response = account.addAuthenticator(
type = .TOTP
type = AuthenticatorType.TOTP
)
4 changes: 2 additions & 2 deletions docs/examples/kotlin/account/create2f-a-challenge.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
import io.appwrite.enums.Factor
import io.appwrite.enums.AuthenticationFactor

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -10,5 +10,5 @@ val client = Client()
val account = Account(client)

val response = account.create2FAChallenge(
factor = .TOTP
factor = AuthenticationFactor.TOTP
)
4 changes: 2 additions & 2 deletions docs/examples/kotlin/account/delete-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
import io.appwrite.enums.Type
import io.appwrite.enums.AuthenticatorType

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -11,6 +11,6 @@ val client = Client()
val account = Account(client)

val response = account.deleteAuthenticator(
type = .TOTP,
type = AuthenticatorType.TOTP,
otp = "[OTP]"
)
4 changes: 2 additions & 2 deletions docs/examples/kotlin/account/verify-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Account
import io.appwrite.enums.Type
import io.appwrite.enums.AuthenticatorType

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -11,6 +11,6 @@ val client = Client()
val account = Account(client)

val response = account.verifyAuthenticator(
type = .TOTP,
type = AuthenticatorType.TOTP,
otp = "[OTP]"
)
4 changes: 2 additions & 2 deletions docs/examples/kotlin/users/delete-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Users
import io.appwrite.enums.Type
import io.appwrite.enums.AuthenticatorType

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -12,6 +12,6 @@ val users = Users(client)

val response = users.deleteAuthenticator(
userId = "[USER_ID]",
type = .TOTP,
type = AuthenticatorType.TOTP,
otp = "[OTP]"
)
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 @@ -55,11 +55,11 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
"user-agent" to "AppwriteKotlinSDK/5.0.0-rc.2 ${System.getProperty("http.agent")}",
"user-agent" to "AppwriteKotlinSDK/5.0.0-rc.3 ${System.getProperty("http.agent")}",
"x-sdk-name" to "Kotlin",
"x-sdk-platform" to "server",
"x-sdk-language" to "kotlin",
"x-sdk-version" to "5.0.0-rc.2", "x-appwrite-response-format" to "1.4.0"
"x-sdk-version" to "5.0.0-rc.3", "x-appwrite-response-format" to "1.5.0"
)
config = mutableMapOf()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.appwrite.enums

enum class Factor(val value: String) {
enum class AuthenticationFactor(val value: String) {
TOTP("totp"),
PHONE("phone"),
EMAIL("email");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.appwrite.enums

enum class Type(val value: String) {
enum class AuthenticatorType(val value: String) {
TOTP("totp");

override fun toString() = value
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/io/appwrite/services/Account.kt
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class Account(client: Client) : Service(client) {
*/
@Throws(AppwriteException::class)
suspend fun create2FAChallenge(
factor: Factor,
factor: AuthenticationFactor,
): io.appwrite.models.MfaChallenge {
val apiPath = "/account/mfa/challenge"

Expand Down Expand Up @@ -465,7 +465,7 @@ class Account(client: Client) : Service(client) {
*/
@Throws(AppwriteException::class)
suspend fun addAuthenticator(
type: Type,
type: AuthenticatorType,
): io.appwrite.models.MfaType {
val apiPath = "/account/mfa/{type}"
.replace("{type}", type.value)
Expand Down Expand Up @@ -499,7 +499,7 @@ class Account(client: Client) : Service(client) {
*/
@Throws(AppwriteException::class)
suspend fun <T> verifyAuthenticator(
type: Type,
type: AuthenticatorType,
otp: String,
nestedType: Class<T>,
): io.appwrite.models.User<T> {
Expand Down Expand Up @@ -536,7 +536,7 @@ class Account(client: Client) : Service(client) {
*/
@Throws(AppwriteException::class)
suspend fun verifyAuthenticator(
type: Type,
type: AuthenticatorType,
otp: String,
): io.appwrite.models.User<Map<String, Any>> = verifyAuthenticator(
type,
Expand All @@ -555,7 +555,7 @@ class Account(client: Client) : Service(client) {
*/
@Throws(AppwriteException::class)
suspend fun <T> deleteAuthenticator(
type: Type,
type: AuthenticatorType,
otp: String,
nestedType: Class<T>,
): io.appwrite.models.User<T> {
Expand Down Expand Up @@ -592,7 +592,7 @@ class Account(client: Client) : Service(client) {
*/
@Throws(AppwriteException::class)
suspend fun deleteAuthenticator(
type: Type,
type: AuthenticatorType,
otp: String,
): io.appwrite.models.User<Map<String, Any>> = deleteAuthenticator(
type,
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/io/appwrite/services/Users.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ class Users(client: Client) : Service(client) {
@Throws(AppwriteException::class)
suspend fun <T> deleteAuthenticator(
userId: String,
type: Type,
type: AuthenticatorType,
otp: String,
nestedType: Class<T>,
): io.appwrite.models.User<T> {
Expand Down Expand Up @@ -1160,7 +1160,7 @@ class Users(client: Client) : Service(client) {
@Throws(AppwriteException::class)
suspend fun deleteAuthenticator(
userId: String,
type: Type,
type: AuthenticatorType,
otp: String,
): io.appwrite.models.User<Map<String, Any>> = deleteAuthenticator(
userId,
Expand Down

0 comments on commit 83caa55

Please sign in to comment.