Skip to content

Commit 0764928

Browse files
committed
Release candidate for 1.5.x
1 parent fe3526d commit 0764928

File tree

448 files changed

+8211
-521
lines changed

Some content is hidden

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

448 files changed

+8211
-521
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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

9-
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).**
9+
**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).**
1010

1111
> This is the Kotlin SDK for integrating with Appwrite from your Kotlin server-side code. If you're looking for the Android SDK you should check [appwrite/sdk-for-android](https://github.com/appwrite/sdk-for-android)
1212
@@ -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:4.1.0")
42+
implementation("io.appwrite:sdk-for-kotlin:5.0.0-rc.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>4.1.0</version>
53+
<version>5.0.0-rc.2</version>
5454
</dependency>
5555
</dependencies>
5656
```

build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id "org.jetbrains.kotlin.jvm" version '1.8.0'
2+
id "org.jetbrains.kotlin.jvm" version '1.9.10'
33
id "java-library"
4-
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
4+
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
55
}
66

77
apply from: "${rootDir}/scripts/configure.gradle"
@@ -29,14 +29,16 @@ repositories {
2929
}
3030

3131
dependencies {
32-
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
33-
api(platform("com.squareup.okhttp3:okhttp-bom:4.9.3"))
32+
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
33+
34+
api(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
3435
api("com.squareup.okhttp3:okhttp")
36+
3537
implementation("com.squareup.okhttp3:okhttp-urlconnection")
3638
implementation("com.squareup.okhttp3:logging-interceptor")
3739
implementation("com.google.code.gson:gson:2.9.0")
3840

39-
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
41+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
4042
}
4143

4244
test {
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.Account;
4+
import io.appwrite.enums.Type;
5+
6+
Client client = new Client()
7+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("5df5acd0d48c2") // Your project ID
9+
.setSession(""); // The user session to authenticate with
10+
11+
Account account = new Account(client);
12+
13+
account.addAuthenticator(
14+
.TOTP
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
System.out.println(result);
22+
})
23+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createAnonymousSession(new CoroutineCallback<>((result, error) -> {
12+
if (error != null) {
13+
error.printStackTrace();
14+
return;
15+
}
16+
17+
System.out.println(result);
18+
}));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createEmailPasswordSession(
12+
"email@example.com",
13+
"password"
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createEmailToken(
12+
"[USER_ID]",
13+
"email@example.com",
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createJWT(new CoroutineCallback<>((result, error) -> {
12+
if (error != null) {
13+
error.printStackTrace();
14+
return;
15+
}
16+
17+
System.out.println(result);
18+
}));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createMagicURLToken(
12+
"[USER_ID]",
13+
"email@example.com",
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
import io.appwrite.enums.OAuthProvider;
5+
6+
Client client = new Client()
7+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("5df5acd0d48c2"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createOAuth2Session(
13+
OAuthProvider.AMAZON,
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createPhoneToken(
12+
"[USER_ID]",
13+
"+12065550100"
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);

docs/examples/java/account/create-phone-verification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

docs/examples/java/account/create-recovery.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
9+
Account account = new Account(client);
10+
11+
account.createSession(
12+
"[USER_ID]",
13+
"[SECRET]"
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);

docs/examples/java/account/create-verification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

docs/examples/java/account/create.md

+23
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.Account;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2"); // Your project ID
8+
9+
Account account = new Account(client);
10+
11+
account.create(
12+
"[USER_ID]",
13+
"email@example.com",
14+
"",
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
System.out.println(result);
22+
})
23+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
import io.appwrite.enums.Factor;
5+
6+
Client client = new Client()
7+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("5df5acd0d48c2"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.create2FAChallenge(
13+
.TOTP
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
import io.appwrite.enums.Type;
5+
6+
Client client = new Client()
7+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("5df5acd0d48c2") // Your project ID
9+
.setSession(""); // The user session to authenticate with
10+
11+
Account account = new Account(client);
12+
13+
account.deleteAuthenticator(
14+
.TOTP,
15+
"[OTP]"
16+
new CoroutineCallback<>((result, error) -> {
17+
if (error != null) {
18+
error.printStackTrace();
19+
return;
20+
}
21+
22+
System.out.println(result);
23+
})
24+
);

docs/examples/java/account/delete-identity.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

docs/examples/java/account/delete-session.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

docs/examples/java/account/delete-sessions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

docs/examples/java/account/get-prefs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.appwrite.services.Account;
55
Client client = new Client()
66
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
8+
.setSession(""); // The user session to authenticate with
99

1010
Account account = new Account(client);
1111

0 commit comments

Comments
 (0)