Skip to content

Commit de62212

Browse files
authored
Merge pull request #28 from appwrite/dev
Appwrite 1.2.0 support
2 parents 3f5e057 + afa09a8 commit de62212

File tree

400 files changed

+8332
-10168
lines changed

Some content is hidden

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

400 files changed

+8332
-10168
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Redistribution and use in source and binary forms, with or without modification,
77

88
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
99

10-
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1111

1212
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
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.0.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.2.0-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

9-
**This SDK is compatible with Appwrite server version 1.0.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.2.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:1.1.0")
42+
implementation("io.appwrite:sdk-for-kotlin:1.2.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>1.1.0</version>
53+
<version>1.2.0</version>
5454
</dependency>
5555
</dependencies>
5656
```
Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
1-
import io.appwrite.Client
2-
import io.appwrite.services.Account
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
34

4-
public void main() {
5-
Client client = Client(context)
6-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7-
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
5+
Client client = new Client()
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
99

10-
Account account = new Account(client);
11-
account.createPhoneVerification(new Continuation<Response>() {
12-
@NotNull
13-
@Override
14-
public CoroutineContext getContext() {
15-
return EmptyCoroutineContext.INSTANCE;
16-
}
10+
Account account = new Account(client);
1711

18-
@Override
19-
public void resumeWith(@NotNull Object o) {
20-
String json = "";
21-
try {
22-
if (o instanceof Result.Failure) {
23-
Result.Failure failure = (Result.Failure) o;
24-
throw failure.exception;
25-
} else {
26-
Response response = (Response) o;
27-
}
28-
} catch (Throwable th) {
29-
Log.e("ERROR", th.toString());
30-
}
31-
}
32-
});
33-
}
12+
account.createPhoneVerification(new CoroutineCallback<>((result, error) -> {
13+
if (error != null) {
14+
error.printStackTrace();
15+
return;
16+
}
17+
18+
System.out.println(result);
19+
}));
Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
1-
import io.appwrite.Client
2-
import io.appwrite.services.Account
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
34

4-
public void main() {
5-
Client client = Client(context)
6-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7-
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
5+
Client client = new Client()
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
99

10-
Account account = new Account(client);
11-
account.createRecovery(
12-
email = "[email protected]",
13-
url = "https://example.com"
14-
new Continuation<Response>() {
15-
@NotNull
16-
@Override
17-
public CoroutineContext getContext() {
18-
return EmptyCoroutineContext.INSTANCE;
19-
}
10+
Account account = new Account(client);
2011

21-
@Override
22-
public void resumeWith(@NotNull Object o) {
23-
String json = "";
24-
try {
25-
if (o instanceof Result.Failure) {
26-
Result.Failure failure = (Result.Failure) o;
27-
throw failure.exception;
28-
} else {
29-
Response response = (Response) o;
30-
}
31-
} catch (Throwable th) {
32-
Log.e("ERROR", th.toString());
33-
}
34-
}
12+
account.createRecovery(
13+
14+
"https://example.com"
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
3519
}
36-
);
37-
}
20+
21+
System.out.println(result);
22+
})
23+
);
Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,22 @@
1-
import io.appwrite.Client
2-
import io.appwrite.services.Account
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
34

4-
public void main() {
5-
Client client = Client(context)
6-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7-
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
5+
Client client = new Client()
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
99

10-
Account account = new Account(client);
11-
account.createVerification(
12-
url = "https://example.com"
13-
new Continuation<Response>() {
14-
@NotNull
15-
@Override
16-
public CoroutineContext getContext() {
17-
return EmptyCoroutineContext.INSTANCE;
18-
}
10+
Account account = new Account(client);
1911

20-
@Override
21-
public void resumeWith(@NotNull Object o) {
22-
String json = "";
23-
try {
24-
if (o instanceof Result.Failure) {
25-
Result.Failure failure = (Result.Failure) o;
26-
throw failure.exception;
27-
} else {
28-
Response response = (Response) o;
29-
}
30-
} catch (Throwable th) {
31-
Log.e("ERROR", th.toString());
32-
}
33-
}
12+
account.createVerification(
13+
"https://example.com"
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
3418
}
35-
);
36-
}
19+
20+
System.out.println(result);
21+
})
22+
);
Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,22 @@
1-
import io.appwrite.Client
2-
import io.appwrite.services.Account
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
34

4-
public void main() {
5-
Client client = Client(context)
6-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7-
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
5+
Client client = new Client()
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
99

10-
Account account = new Account(client);
11-
account.deleteSession(
12-
sessionId = "[SESSION_ID]"
13-
new Continuation<Response>() {
14-
@NotNull
15-
@Override
16-
public CoroutineContext getContext() {
17-
return EmptyCoroutineContext.INSTANCE;
18-
}
10+
Account account = new Account(client);
1911

20-
@Override
21-
public void resumeWith(@NotNull Object o) {
22-
String json = "";
23-
try {
24-
if (o instanceof Result.Failure) {
25-
Result.Failure failure = (Result.Failure) o;
26-
throw failure.exception;
27-
} else {
28-
Response response = (Response) o;
29-
}
30-
} catch (Throwable th) {
31-
Log.e("ERROR", th.toString());
32-
}
33-
}
12+
account.deleteSession(
13+
"[SESSION_ID]"
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
3418
}
35-
);
36-
}
19+
20+
System.out.println(result);
21+
})
22+
);
Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
1-
import io.appwrite.Client
2-
import io.appwrite.services.Account
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
34

4-
public void main() {
5-
Client client = Client(context)
6-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7-
.setProject("5df5acd0d48c2") // Your project ID
8-
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
5+
Client client = new Client()
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
99

10-
Account account = new Account(client);
11-
account.deleteSessions(new Continuation<Response>() {
12-
@NotNull
13-
@Override
14-
public CoroutineContext getContext() {
15-
return EmptyCoroutineContext.INSTANCE;
16-
}
10+
Account account = new Account(client);
1711

18-
@Override
19-
public void resumeWith(@NotNull Object o) {
20-
String json = "";
21-
try {
22-
if (o instanceof Result.Failure) {
23-
Result.Failure failure = (Result.Failure) o;
24-
throw failure.exception;
25-
} else {
26-
Response response = (Response) o;
27-
}
28-
} catch (Throwable th) {
29-
Log.e("ERROR", th.toString());
30-
}
31-
}
32-
});
33-
}
12+
account.deleteSessions(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/get-logs.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)