Skip to content

Commit 14067c5

Browse files
Merge pull request #1 from appwrite/dev
feat: initial commit
2 parents 3ac21f6 + c2c7969 commit 14067c5

File tree

121 files changed

+5096
-2
lines changed

Some content is hidden

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

121 files changed

+5096
-2
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to Maven Central
2+
3+
# Run this workflow when a release is created
4+
on:
5+
release:
6+
types: [released]
7+
8+
jobs:
9+
publish:
10+
name: Release build and publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
- name: Set up JDK 1.8
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 1.8
19+
# Base64 decodes and pipes the GPG key content into the secret file
20+
- name: Prepare environment
21+
env:
22+
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
23+
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
24+
run: |
25+
git fetch --unshallow
26+
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
27+
chmod +x ./gradlew
28+
29+
# Runs upload, and then closes & releases the repository
30+
- name: Publish Release Version to MavenCentral
31+
run: |
32+
if ${{ endswith(github.event.release.tag_name, '-SNAPSHOT') }}; then
33+
echo "Publising Snapshot Version ${{ github.event.release.tag_name}} to Snapshot repository"
34+
else
35+
echo "Publising Release Version ${{ github.event.release.tag_name}} to Staging repository"
36+
fi
37+
./gradlew publishMavenPublicationToSonatypeRepository
38+
env:
39+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
40+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
41+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
42+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
43+
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
44+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/*
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
.cxx
10+
.local.properties
11+
.env
12+
*/build

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**CHANGELOG**

LICENSE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test test test

README.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,62 @@
1-
# sdk-for-kotlin
2-
[READ-ONLY] Official Appwrite Kotlin SDK
1+
# Appwrite Kotlin SDK
2+
3+
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.8.0-blue.svg?style=flat-square)
5+
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
6+
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
7+
8+
**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check previous releases.**
9+
10+
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 Flutter 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
11+
12+
![Appwrite](https://appwrite.io/v1/images/console.png)
13+
14+
## Installation
15+
16+
### Gradle
17+
18+
Appwrite's Kotlin SDK is hosted on Maven Central. In order to fetch the Appwrite SDK, add this to your root level `build.gradle(.kts)` file:
19+
20+
```groovy
21+
repositories {
22+
mavenCentral()
23+
}
24+
```
25+
26+
If you would like to fetch our SNAPSHOT releases, you need to add the SNAPSHOT maven repository to your `build.gradle(.kts)`:
27+
28+
```groovy
29+
repositories {
30+
maven {
31+
url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
32+
}
33+
}
34+
```
35+
36+
Next, add the dependency to your project's `build.gradle(.kts)` file:
37+
38+
```groovy
39+
implementation("io.appwrite:sdk-for-kotlin:0.0.0-SNAPSHOT")
40+
```
41+
42+
### Maven
43+
Add this to your project's `pom.xml` file:
44+
45+
```xml
46+
<dependencies>
47+
<dependency>
48+
<groupId>io.appwrite</groupId>
49+
<artifactId>sdk-for-kotlin</artifactId>
50+
<version>0.0.0-SNAPSHOT</version>
51+
</dependency>
52+
</dependencies>
53+
```
54+
55+
56+
## Contribution
57+
58+
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
59+
60+
## License
61+
62+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

build.gradle

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
plugins {
2+
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
3+
id 'java-library'
4+
}
5+
6+
7+
ext {
8+
PUBLISH_GROUP_ID = 'io.appwrite'
9+
PUBLISH_ARTIFACT_ID = 'sdk-for-kotlin'
10+
PUBLISH_VERSION = '0.0.0-SNAPSHOT'
11+
POM_URL = 'https://github.com/appwrite/sdk-for-kotlin'
12+
POM_SCM_URL = 'https://github.com/appwrite/sdk-for-kotlin'
13+
POM_ISSUE_URL = 'https://github.com/appwrite/sdk-for-kotlin/issues'
14+
POM_DESCRIPTION = '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 Flutter 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'
15+
POM_LICENSE_URL = 'https://opensource.org/licenses/GPL-3.0'
16+
POM_LICENSE_NAME = "GPL-3.0"
17+
POM_DEVELOPER_ID = 'appwrite'
18+
POM_DEVELOPER_NAME = 'Appwrite Team'
19+
POM_DEVELOPER_EMAIL = '[email protected]'
20+
GITHUB_SCM_CONNECTION = 'scm:git:git://github.com/appwrite/sdk-for-kotlin.git'
21+
}
22+
23+
version PUBLISH_VERSION
24+
25+
repositories {
26+
mavenCentral()
27+
}
28+
29+
dependencies {
30+
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
31+
api(platform("com.squareup.okhttp3:okhttp-bom:4.9.0"))
32+
api("com.squareup.okhttp3:okhttp")
33+
implementation("com.squareup.okhttp3:okhttp-urlconnection")
34+
implementation("com.squareup.okhttp3:logging-interceptor")
35+
implementation("com.google.code.gson:gson:2.8.5")
36+
37+
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
38+
}
39+
40+
test {
41+
useJUnit()
42+
}
43+
44+
compileKotlin {
45+
kotlinOptions.jvmTarget = '1.8'
46+
}
47+
48+
compileTestKotlin {
49+
kotlinOptions.jvmTarget = '1.8'
50+
}
51+
52+
apply from: "${rootDir}/scripts/setup.gradle"
53+
apply from: "${rootDir}/scripts/publish.gradle"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
suspend fun main() {
5+
val 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+
val account = Account(client)
11+
val response = account.createRecovery(
12+
email = "[email protected]",
13+
url = "https://example.com"
14+
)
15+
val json = response.body?.string()
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
suspend fun main() {
5+
val 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+
val account = Account(client)
11+
val response = account.createVerification(
12+
url = "https://example.com"
13+
)
14+
val json = response.body?.string()
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
suspend fun main() {
5+
val 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+
val account = Account(client)
11+
val response = account.deleteSession(
12+
sessionId = "[SESSION_ID]"
13+
)
14+
val json = response.body?.string()
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
3+
4+
suspend fun main() {
5+
val 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+
val account = Account(client)
11+
val response = account.deleteSessions()
12+
val json = response.body?.string()
13+
}

0 commit comments

Comments
 (0)