Skip to content

Commit d8096dc

Browse files
committed
Appwite 1.5 support
1 parent 42f7c02 commit d8096dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+847
-248
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
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 Kotlin 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)
1414

15-
![Appwrite](https://appwrite.io/images/github.png)
15+
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1616

1717
## Installation
1818

@@ -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.0-rc.6")
42+
implementation("io.appwrite:sdk-for-kotlin:5.0.0")
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.0-rc.6</version>
53+
<version>5.0.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/account/add-authenticator.md renamed to docs/examples/java/account/create-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Client client = new Client()
1010

1111
Account account = new Account(client);
1212

13-
account.addAuthenticator(
13+
account.createMfaAuthenticator(
1414
AuthenticatorType.TOTP, // type
1515
new CoroutineCallback<>((result, error) -> {
1616
if (error != null) {

docs/examples/java/account/create-challenge.md renamed to docs/examples/java/account/create-mfa-challenge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Client client = new Client()
99

1010
Account account = new Account(client);
1111

12-
account.createChallenge(
13-
AuthenticationFactor.TOTP, // factor
12+
account.createMfaChallenge(
13+
AuthenticationFactor.EMAIL, // factor
1414
new CoroutineCallback<>((result, error) -> {
1515
if (error != null) {
1616
error.printStackTrace();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setSession(""); // The user session to authenticate with
9+
10+
Account account = new Account(client);
11+
12+
account.createMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
System.out.println(result);
19+
}));

docs/examples/java/account/verify-authenticator.md renamed to docs/examples/java/account/delete-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Client client = new Client()
1010

1111
Account account = new Account(client);
1212

13-
account.verifyAuthenticator(
13+
account.deleteMfaAuthenticator(
1414
AuthenticatorType.TOTP, // type
1515
"<OTP>", // otp
1616
new CoroutineCallback<>((result, error) -> {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setSession(""); // The user session to authenticate with
9+
10+
Account account = new Account(client);
11+
12+
account.getMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
System.out.println(result);
19+
}));

docs/examples/java/account/list-factors.md renamed to docs/examples/java/account/list-mfa-factors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Account account = new Account(client);
1111

12-
account.listFactors(new CoroutineCallback<>((result, error) -> {
12+
account.listMfaFactors(new CoroutineCallback<>((result, error) -> {
1313
if (error != null) {
1414
error.printStackTrace();
1515
return;

docs/examples/java/account/delete-authenticator.md renamed to docs/examples/java/account/update-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Client client = new Client()
1010

1111
Account account = new Account(client);
1212

13-
account.deleteAuthenticator(
13+
account.updateMfaAuthenticator(
1414
AuthenticatorType.TOTP, // type
1515
"<OTP>", // otp
1616
new CoroutineCallback<>((result, error) -> {

docs/examples/java/account/update-challenge.md renamed to docs/examples/java/account/update-mfa-challenge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Account account = new Account(client);
1111

12-
account.updateChallenge(
12+
account.updateMfaChallenge(
1313
"<CHALLENGE_ID>", // challengeId
1414
"<OTP>", // otp
1515
new CoroutineCallback<>((result, error) -> {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setSession(""); // The user session to authenticate with
9+
10+
Account account = new Account(client);
11+
12+
account.updateMfaRecoveryCodes(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
System.out.println(result);
19+
}));

docs/examples/java/databases/create-relationship-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ databases.createRelationshipAttribute(
1414
"<DATABASE_ID>", // databaseId
1515
"<COLLECTION_ID>", // collectionId
1616
"<RELATED_COLLECTION_ID>", // relatedCollectionId
17-
RelationshipType.ONE_TO_ONE, // type
17+
RelationshipType.ONETOONE, // type
1818
false, // twoWay (optional)
1919
"", // key (optional)
2020
"", // twoWayKey (optional)

docs/examples/java/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Functions functions = new Functions(client);
1313
functions.create(
1414
"<FUNCTION_ID>", // functionId
1515
"<NAME>", // name
16-
.NODE145, // runtime
16+
.NODE_14_5, // runtime
1717
listOf("any"), // execute (optional)
1818
listOf(), // events (optional)
1919
"", // schedule (optional)

docs/examples/java/functions/update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Functions functions = new Functions(client);
1212
functions.update(
1313
"<FUNCTION_ID>", // functionId
1414
"<NAME>", // name
15-
.NODE145, // runtime (optional)
15+
.NODE_14_5, // runtime (optional)
1616
listOf("any"), // execute (optional)
1717
listOf(), // events (optional)
1818
"", // schedule (optional)

docs/examples/java/health/get-failed-jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Client client = new Client()
1111
Health health = new Health(client);
1212

1313
health.getFailedJobs(
14-
.V1DATABASE, // name
14+
.V1_DATABASE, // name
1515
0, // threshold (optional)
1616
new CoroutineCallback<>((result, error) -> {
1717
if (error != null) {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Health;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Health health = new Health(client);
11+
12+
health.getQueueUsage(
13+
0, // threshold (optional)
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
23+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Health;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Health health = new Health(client);
11+
12+
health.getStorage(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
System.out.println(result);
19+
}));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Users;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Users users = new Users(client);
11+
12+
users.createMfaRecoveryCodes(
13+
"<USER_ID>", // userId
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
23+

docs/examples/java/users/delete-authenticator.md renamed to docs/examples/java/users/delete-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Client client = new Client()
1010

1111
Users users = new Users(client);
1212

13-
users.deleteAuthenticator(
13+
users.deleteMfaAuthenticator(
1414
"<USER_ID>", // userId
1515
AuthenticatorType.TOTP, // type
1616
new CoroutineCallback<>((result, error) -> {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Users;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Users users = new Users(client);
11+
12+
users.getMfaRecoveryCodes(
13+
"<USER_ID>", // userId
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
23+

docs/examples/java/users/list-factors.md renamed to docs/examples/java/users/list-mfa-factors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Users users = new Users(client);
1111

12-
users.listFactors(
12+
users.listMfaFactors(
1313
"<USER_ID>", // userId
1414
new CoroutineCallback<>((result, error) -> {
1515
if (error != null) {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Users;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Users users = new Users(client);
11+
12+
users.updateMfaRecoveryCodes(
13+
"<USER_ID>", // userId
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
23+

docs/examples/kotlin/account/add-authenticator.md renamed to docs/examples/kotlin/account/create-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ val client = Client()
1010

1111
val account = Account(client)
1212

13-
val response = account.addAuthenticator(
13+
val response = account.createMfaAuthenticator(
1414
type = AuthenticatorType.TOTP
1515
)

docs/examples/kotlin/account/create-challenge.md renamed to docs/examples/kotlin/account/create-mfa-challenge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ val client = Client()
99

1010
val account = Account(client)
1111

12-
val response = account.createChallenge(
13-
factor = AuthenticationFactor.TOTP
12+
val response = account.createMfaChallenge(
13+
factor = AuthenticationFactor.EMAIL
1414
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import io.appwrite.Client
2+
import io.appwrite.coroutines.CoroutineCallback
3+
import io.appwrite.services.Account
4+
5+
val client = Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setSession("") // The user session to authenticate with
9+
10+
val account = Account(client)
11+
12+
val response = account.createMfaRecoveryCodes()

docs/examples/kotlin/account/delete-authenticator.md renamed to docs/examples/kotlin/account/delete-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ val client = Client()
1010

1111
val account = Account(client)
1212

13-
val response = account.deleteAuthenticator(
13+
val response = account.deleteMfaAuthenticator(
1414
type = AuthenticatorType.TOTP,
1515
otp = "<OTP>"
1616
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import io.appwrite.Client
2+
import io.appwrite.coroutines.CoroutineCallback
3+
import io.appwrite.services.Account
4+
5+
val client = Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setSession("") // The user session to authenticate with
9+
10+
val account = Account(client)
11+
12+
val response = account.getMfaRecoveryCodes()

docs/examples/kotlin/account/list-factors.md renamed to docs/examples/kotlin/account/list-mfa-factors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ val client = Client()
99

1010
val account = Account(client)
1111

12-
val response = account.listFactors()
12+
val response = account.listMfaFactors()

docs/examples/kotlin/account/verify-authenticator.md renamed to docs/examples/kotlin/account/update-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ val client = Client()
1010

1111
val account = Account(client)
1212

13-
val response = account.verifyAuthenticator(
13+
val response = account.updateMfaAuthenticator(
1414
type = AuthenticatorType.TOTP,
1515
otp = "<OTP>"
1616
)

docs/examples/kotlin/account/update-challenge.md renamed to docs/examples/kotlin/account/update-mfa-challenge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ val client = Client()
99

1010
val account = Account(client)
1111

12-
val response = account.updateChallenge(
12+
val response = account.updateMfaChallenge(
1313
challengeId = "<CHALLENGE_ID>",
1414
otp = "<OTP>"
1515
)

0 commit comments

Comments
 (0)