Skip to content

Commit 58aa78e

Browse files
committed
0.13 support snapshot
1 parent 1cec45c commit 58aa78e

Some content is hidden

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

67 files changed

+1698
-601
lines changed

.github/workflows/publish.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,27 @@ jobs:
2626
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
2727
chmod +x ./gradlew
2828
29+
# Builds the artifacts of the library
30+
- name: Build Release Artifacts
31+
run: ./gradlew assemble
32+
env:
33+
SDK_VERSION: ${{ github.event.release.tag_name }}
34+
2935
# Runs upload, and then closes & releases the repository
3036
- name: Publish Release Version to MavenCentral
3137
run: |
3238
if ${{ endswith(github.event.release.tag_name, '-SNAPSHOT') }}; then
3339
echo "Publising Snapshot Version ${{ github.event.release.tag_name}} to Snapshot repository"
40+
./gradlew publishToSonatype
3441
else
3542
echo "Publising Release Version ${{ github.event.release.tag_name}} to Staging repository"
43+
./gradlew publishToSonatype --max-workers 1 closeAndReleaseSonatypeStagingRepository
3644
fi
37-
./gradlew publishMavenPublicationToSonatypeRepository
3845
env:
3946
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
4047
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
4148
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
4249
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
4350
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
4451
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
52+
SDK_VERSION: ${{ github.event.release.tag_name }}

README.md

+2-2
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-0.12.1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.12.3-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 0.12.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 0.13.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

build.gradle

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
plugins {
2-
id 'org.jetbrains.kotlin.jvm' version '1.5.31'
3-
id 'java-library'
2+
id "org.jetbrains.kotlin.jvm" version '1.5.31'
3+
id "java-library"
4+
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
45
}
56

7+
apply from: "${rootDir}/scripts/configure.gradle"
8+
69
ext {
710
PUBLISH_GROUP_ID = 'io.appwrite'
811
PUBLISH_ARTIFACT_ID = 'sdk-for-kotlin'
9-
PUBLISH_VERSION = '0.2.5'
12+
PUBLISH_VERSION = System.getenv('SDK_VERSION')
1013
POM_URL = 'https://github.com/appwrite/sdk-for-kotlin'
1114
POM_SCM_URL = 'https://github.com/appwrite/sdk-for-kotlin'
1215
POM_ISSUE_URL = 'https://github.com/appwrite/sdk-for-kotlin/issues'
@@ -41,6 +44,7 @@ test {
4144
}
4245

4346
compileKotlin {
47+
dependsOn createBuildConfig
4448
kotlinOptions.jvmTarget = '1.8'
4549
}
4650

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
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
9+
10+
Account account = new Account(client);
11+
account.updateSession(
12+
sessionId = "[SESSION_ID]"
13+
new Continuation<Response>() {
14+
@NotNull
15+
@Override
16+
public CoroutineContext getContext() {
17+
return EmptyCoroutineContext.INSTANCE;
18+
}
19+
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+
}
34+
}
35+
);
36+
}

docs/examples/java/functions/create-tag.md docs/examples/java/functions/create-deployment.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ public void main() {
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

1010
Functions functions = new Functions(client);
11-
functions.createTag(
11+
functions.createDeployment(
1212
functionId = "[FUNCTION_ID]",
13-
command = "[COMMAND]",
14-
code = File("./path-to-files/image.jpg")
13+
entrypoint = "[ENTRYPOINT]",
14+
code = File("./path-to-files/image.jpg"),
15+
activate = false
1516
new Continuation<Response>() {
1617
@NotNull
1718
@Override

docs/examples/java/functions/delete-tag.md docs/examples/java/functions/delete-deployment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public void main() {
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

1010
Functions functions = new Functions(client);
11-
functions.deleteTag(
11+
functions.deleteDeployment(
1212
functionId = "[FUNCTION_ID]",
13-
tagId = "[TAG_ID]"
13+
deploymentId = "[DEPLOYMENT_ID]"
1414
new Continuation<Response>() {
1515
@NotNull
1616
@Override

docs/examples/java/functions/update-tag.md docs/examples/java/functions/get-deployment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public void main() {
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

1010
Functions functions = new Functions(client);
11-
functions.updateTag(
11+
functions.getDeployment(
1212
functionId = "[FUNCTION_ID]",
13-
tag = "[TAG]"
13+
deploymentId = "[DEPLOYMENT_ID]"
1414
new Continuation<Response>() {
1515
@NotNull
1616
@Override

docs/examples/java/functions/list-tags.md docs/examples/java/functions/list-deployments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public void main() {
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

1010
Functions functions = new Functions(client);
11-
functions.listTags(
11+
functions.listDeployments(
1212
functionId = "[FUNCTION_ID]",
1313
new Continuation<Response>() {
1414
@NotNull
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Functions
3+
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+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Functions functions = new Functions(client);
11+
functions.retryBuild(
12+
functionId = "[FUNCTION_ID]",
13+
deploymentId = "[DEPLOYMENT_ID]",
14+
buildId = "[BUILD_ID]"
15+
new Continuation<Response>() {
16+
@NotNull
17+
@Override
18+
public CoroutineContext getContext() {
19+
return EmptyCoroutineContext.INSTANCE;
20+
}
21+
22+
@Override
23+
public void resumeWith(@NotNull Object o) {
24+
String json = "";
25+
try {
26+
if (o instanceof Result.Failure) {
27+
Result.Failure failure = (Result.Failure) o;
28+
throw failure.exception;
29+
} else {
30+
Response response = (Response) o;
31+
}
32+
} catch (Throwable th) {
33+
Log.e("ERROR", th.toString());
34+
}
35+
}
36+
}
37+
);
38+
}

docs/examples/java/functions/get-tag.md docs/examples/java/functions/update-deployment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public void main() {
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

1010
Functions functions = new Functions(client);
11-
functions.getTag(
11+
functions.updateDeployment(
1212
functionId = "[FUNCTION_ID]",
13-
tagId = "[TAG_ID]"
13+
deploymentId = "[DEPLOYMENT_ID]"
1414
new Continuation<Response>() {
1515
@NotNull
1616
@Override
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Storage
3+
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+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Storage storage = new Storage(client);
11+
storage.createBucket(
12+
bucketId = "[BUCKET_ID]",
13+
name = "[NAME]",
14+
permission = "file",
15+
new Continuation<Response>() {
16+
@NotNull
17+
@Override
18+
public CoroutineContext getContext() {
19+
return EmptyCoroutineContext.INSTANCE;
20+
}
21+
22+
@Override
23+
public void resumeWith(@NotNull Object o) {
24+
String json = "";
25+
try {
26+
if (o instanceof Result.Failure) {
27+
Result.Failure failure = (Result.Failure) o;
28+
throw failure.exception;
29+
} else {
30+
Response response = (Response) o;
31+
}
32+
} catch (Throwable th) {
33+
Log.e("ERROR", th.toString());
34+
}
35+
}
36+
}
37+
);
38+
}

docs/examples/java/storage/create-file.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void main() {
99

1010
Storage storage = new Storage(client);
1111
storage.createFile(
12+
bucketId = "[BUCKET_ID]",
1213
fileId = "[FILE_ID]",
1314
file = File("./path-to-files/image.jpg"),
1415
new Continuation<Response>() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Storage
3+
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+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Storage storage = new Storage(client);
11+
storage.deleteBucket(
12+
bucketId = "[BUCKET_ID]"
13+
new Continuation<Response>() {
14+
@NotNull
15+
@Override
16+
public CoroutineContext getContext() {
17+
return EmptyCoroutineContext.INSTANCE;
18+
}
19+
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+
}
34+
}
35+
);
36+
}

docs/examples/java/storage/delete-file.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void main() {
99

1010
Storage storage = new Storage(client);
1111
storage.deleteFile(
12+
bucketId = "[BUCKET_ID]",
1213
fileId = "[FILE_ID]"
1314
new Continuation<Response>() {
1415
@NotNull
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Storage
3+
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+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Storage storage = new Storage(client);
11+
storage.getBucket(
12+
bucketId = "[BUCKET_ID]"
13+
new Continuation<Response>() {
14+
@NotNull
15+
@Override
16+
public CoroutineContext getContext() {
17+
return EmptyCoroutineContext.INSTANCE;
18+
}
19+
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+
}
34+
}
35+
);
36+
}

docs/examples/java/storage/get-file-download.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void main() {
99

1010
Storage storage = new Storage(client);
1111
storage.getFileDownload(
12+
bucketId = "[BUCKET_ID]",
1213
fileId = "[FILE_ID]"
1314
new Continuation<Response>() {
1415
@NotNull

docs/examples/java/storage/get-file-preview.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void main() {
99

1010
Storage storage = new Storage(client);
1111
storage.getFilePreview(
12+
bucketId = "[BUCKET_ID]",
1213
fileId = "[FILE_ID]",
1314
new Continuation<Response>() {
1415
@NotNull

docs/examples/java/storage/get-file-view.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void main() {
99

1010
Storage storage = new Storage(client);
1111
storage.getFileView(
12+
bucketId = "[BUCKET_ID]",
1213
fileId = "[FILE_ID]"
1314
new Continuation<Response>() {
1415
@NotNull

docs/examples/java/storage/get-file.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public void main() {
99

1010
Storage storage = new Storage(client);
1111
storage.getFile(
12+
bucketId = "[BUCKET_ID]",
1213
fileId = "[FILE_ID]"
1314
new Continuation<Response>() {
1415
@NotNull

0 commit comments

Comments
 (0)