Skip to content

Commit

Permalink
feat: 1.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Jul 3, 2024
1 parent 3b20b48 commit c15ab70
Show file tree
Hide file tree
Showing 99 changed files with 113 additions and 103 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

![Swift Package Manager](https://img.shields.io/github/v/release/appwrite/sdk-for-apple.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-apple.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.5.6-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.5.7-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)

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

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 Apple 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](https://appwrite.io/docs)

Expand Down
6 changes: 6 additions & 0 deletions Sources/Appwrite/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ open class Client {
timeout: .seconds(30)
)

if let warning = response.headers["x-appwrite-warning"].first {
warning.split(separator: ";").forEach { warning in
print("Warning: \(warning)")
}
}

switch response.status.code {
case 0..<400:
if response.headers["Set-Cookie"].count > 0 {
Expand Down
6 changes: 3 additions & 3 deletions Sources/Appwrite/Services/Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ open class Account: Service {
///
open func createJWT(
) async throws -> AppwriteModels.Jwt {
let apiPath: String = "/account/jwt"
let apiPath: String = "/account/jwts"

let apiParams: [String: Any] = [:]

Expand Down Expand Up @@ -443,7 +443,7 @@ open class Account: Service {
///
/// Verify an authenticator app after adding it using the [add
/// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
/// method. add
/// method.
///
/// @param AppwriteEnums.AuthenticatorType type
/// @param String otp
Expand Down Expand Up @@ -484,7 +484,7 @@ open class Account: Service {
///
/// Verify an authenticator app after adding it using the [add
/// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
/// method. add
/// method.
///
/// @param AppwriteEnums.AuthenticatorType type
/// @param String otp
Expand Down
7 changes: 5 additions & 2 deletions Sources/Appwrite/Services/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ open class Functions: Service {
/// @param String path
/// @param AppwriteEnums.ExecutionMethod method
/// @param Any headers
/// @param String scheduledAt
/// @throws Exception
/// @return array
///
Expand All @@ -73,7 +74,8 @@ open class Functions: Service {
async: Bool? = nil,
path: String? = nil,
method: AppwriteEnums.ExecutionMethod? = nil,
headers: Any? = nil
headers: Any? = nil,
scheduledAt: String? = nil
) async throws -> AppwriteModels.Execution {
let apiPath: String = "/functions/{functionId}/executions"
.replacingOccurrences(of: "{functionId}", with: functionId)
Expand All @@ -83,7 +85,8 @@ open class Functions: Service {
"async": async,
"path": path,
"method": method,
"headers": headers
"headers": headers,
"scheduledAt": scheduledAt
]

let apiHeaders: [String: String] = [
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-j-w-t.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-magic-u-r-l-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AppwriteEnums

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AppwriteEnums

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-o-auth2session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AppwriteEnums

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-o-auth2token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AppwriteEnums

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-push-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AppwriteEnums

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-push-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/delete-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get-prefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/list-identities.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/list-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/list-mfa-factors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/list-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-email.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-m-f-a.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-magic-u-r-l-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AppwriteEnums

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/update-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Appwrite

let client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

let account = Account(client)

Expand Down
Loading

0 comments on commit c15ab70

Please sign in to comment.