Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 23.1.0

* Added `x` OAuth provider to `OAuthProvider` enum
* Added `userType` field to `Log` model
* Updated `X-Appwrite-Response-Format` header to `1.9.1`
* Updated TTL description for list caching in Databases and TablesDB

## 23.0.0

* **Note:** Version 22.2.0 was accidentally released in a previous cycle. This release (23.0.0) supersedes it as the correct next major version.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down Expand Up @@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-android:23.0.0")
implementation("io.appwrite:sdk-for-android:23.1.0")
```

### Maven
Expand All @@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-android</artifactId>
<version>23.0.0</version>
<version>23.1.0</version>
</dependency>
</dependencies>
```
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class Client @JvmOverloads constructor(
"x-sdk-name" to "Android",
"x-sdk-platform" to "client",
"x-sdk-language" to "android",
"x-sdk-version" to "23.0.0",
"x-appwrite-response-format" to "1.9.0"
"x-sdk-version" to "23.1.0",
"x-appwrite-response-format" to "1.9.1"
)
config = mutableMapOf()

Expand Down
2 changes: 2 additions & 0 deletions library/src/main/java/io/appwrite/enums/OAuthProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ enum class OAuthProvider(val value: String) {
TWITCH("twitch"),
@SerializedName("wordpress")
WORDPRESS("wordpress"),
@SerializedName("x")
X("x"),
@SerializedName("yahoo")
YAHOO("yahoo"),
@SerializedName("yammer")
Expand Down
8 changes: 8 additions & 0 deletions library/src/main/java/io/appwrite/models/Log.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ data class Log(
@SerializedName("mode")
val mode: String,

/**
* User type who triggered the audit log. Possible values: user, admin, guest, keyProject, keyAccount, keyOrganization.
*/
@SerializedName("userType")
val userType: String,

/**
* IP session in use when the session was created.
*/
Expand Down Expand Up @@ -140,6 +146,7 @@ data class Log(
"userEmail" to userEmail as Any,
"userName" to userName as Any,
"mode" to mode as Any,
"userType" to userType as Any,
"ip" to ip as Any,
"time" to time as Any,
"osCode" to osCode as Any,
Expand Down Expand Up @@ -169,6 +176,7 @@ data class Log(
userEmail = map["userEmail"] as String,
userName = map["userName"] as String,
mode = map["mode"] as String,
userType = map["userType"] as String,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 userType nullability on older server responses

map["userType"] returns null if the key is absent, and null as String throws a kotlin.TypeCastException at runtime. Every other field in this model follows the same non-nullable pattern, so this is consistent — but userType is a newly introduced field that an Appwrite server older than 1.9.1 won't include in its response. Declaring it as String? would let apps that connect to a not-yet-upgraded backend degrade gracefully instead of crashing.

Suggested change
userType = map["userType"] as String,
userType = map["userType"] as? String ?: "",

ip = map["ip"] as String,
time = map["time"] as String,
osCode = map["osCode"] as String,
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/io/appwrite/services/Account.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ class Account(client: Client) : Service(client) {
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
*
*
* @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
* @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
* @param success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @param failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @param scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
Expand Down Expand Up @@ -1924,7 +1924,7 @@ class Account(client: Client) : Service(client) {
*
* A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
*
* @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
* @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
* @param success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @param failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @param scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/io/appwrite/services/Databases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class Databases(client: Client) : Service(client) {
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
* @param transactionId Transaction ID to read uncommitted changes within the transaction.
* @param total When set to false, the total count returned will be 0 and will not be calculated.
* @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
* @param ttl TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).
* @return [io.appwrite.models.DocumentList<T>]
*/
@Deprecated(
Expand Down Expand Up @@ -271,7 +271,7 @@ class Databases(client: Client) : Service(client) {
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
* @param transactionId Transaction ID to read uncommitted changes within the transaction.
* @param total When set to false, the total count returned will be 0 and will not be calculated.
* @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
* @param ttl TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).
* @return [io.appwrite.models.DocumentList<T>]
*/
@Deprecated(
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/io/appwrite/services/TablesDB.kt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class TablesDB(client: Client) : Service(client) {
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
* @param transactionId Transaction ID to read uncommitted changes within the transaction.
* @param total When set to false, the total count returned will be 0 and will not be calculated.
* @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
* @param ttl TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).
* @return [io.appwrite.models.RowList<T>]
*/
@JvmOverloads
Expand Down Expand Up @@ -267,7 +267,7 @@ class TablesDB(client: Client) : Service(client) {
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
* @param transactionId Transaction ID to read uncommitted changes within the transaction.
* @param total When set to false, the total count returned will be 0 and will not be calculated.
* @param ttl TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).
* @param ttl TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).
* @return [io.appwrite.models.RowList<T>]
*/
@JvmOverloads
Expand Down
Loading