Release candidate for 1.5.x

This commit is contained in:
Jake Barnby
2024-02-19 17:00:28 +13:00
parent 9b5e2855c1
commit 7716280660
13 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:
```groovy
implementation("io.appwrite:sdk-for-android:5.0.0-rc.2")
implementation("io.appwrite:sdk-for-android:5.0.0-rc.3")
```
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-android</artifactId>
<version>5.0.0-rc.2</version>
<version>5.0.0-rc.3</version>
</dependency>
</dependencies>
```
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,7 +10,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.addAuthenticator(
type.TOTP,
AuthenticatorType.TOTP,
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,7 +10,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.create2FAChallenge(
factor.TOTP,
AuthenticationFactor.TOTP,
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,7 +10,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.deleteAuthenticator(
type.TOTP,
AuthenticatorType.TOTP,
"[OTP]",
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,7 +10,7 @@ Client client = new Client(context)
Account account = new Account(client);
account.verifyAuthenticator(
type.TOTP,
AuthenticatorType.TOTP,
"[OTP]",
new CoroutineCallback<>((result, error) -> {
if (error != null) {
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,5 +10,5 @@ val client = Client(context)
val account = Account(client)
val response = account.addAuthenticator(
type = type.TOTP,
type = AuthenticatorType.TOTP,
)
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,5 +10,5 @@ val client = Client(context)
val account = Account(client)
val response = account.create2FAChallenge(
factor = factor.TOTP,
factor = AuthenticationFactor.TOTP,
)
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,6 +10,6 @@ val client = Client(context)
val account = Account(client)
val response = account.deleteAuthenticator(
type = type.TOTP,
type = AuthenticatorType.TOTP,
otp = "[OTP]",
)
@@ -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(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
@@ -10,6 +10,6 @@ val client = Client(context)
val account = Account(client)
val response = account.verifyAuthenticator(
type = type.TOTP,
type = AuthenticatorType.TOTP,
otp = "[OTP]",
)
+2 -2
View File
@@ -83,8 +83,8 @@ class Client @JvmOverloads constructor(
"x-sdk-name" to "Android",
"x-sdk-platform" to "client",
"x-sdk-language" to "android",
"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()
@@ -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");
@@ -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
@@ -378,7 +378,7 @@ class Account(client: Client) : Service(client) {
* @return [io.appwrite.models.MfaChallenge]
*/
suspend fun create2FAChallenge(
factor: Factor,
factor: AuthenticationFactor,
): io.appwrite.models.MfaChallenge {
val apiPath = "/account/mfa/challenge"
@@ -475,7 +475,7 @@ class Account(client: Client) : Service(client) {
* @return [io.appwrite.models.MfaType]
*/
suspend fun addAuthenticator(
type: Type,
type: AuthenticatorType,
): io.appwrite.models.MfaType {
val apiPath = "/account/mfa/{type}"
.replace("{type}", type.value)
@@ -510,7 +510,7 @@ class Account(client: Client) : Service(client) {
* @return [io.appwrite.models.User<T>]
*/
suspend fun <T> verifyAuthenticator(
type: Type,
type: AuthenticatorType,
otp: String,
nestedType: Class<T>,
): io.appwrite.models.User<T> {
@@ -548,7 +548,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,
@@ -566,7 +566,7 @@ class Account(client: Client) : Service(client) {
* @return [io.appwrite.models.User<T>]
*/
suspend fun <T> deleteAuthenticator(
type: Type,
type: AuthenticatorType,
otp: String,
nestedType: Class<T>,
): io.appwrite.models.User<T> {
@@ -604,7 +604,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,