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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 13.3.1

* Fix `onOpen` callback not being called when the websocket connection is established
* Fix add missing `scheduled` value to `ExecutionStatus` enum

## 13.3.0

* Add `onOpen`, `onClose` and `onError` callbacks to `Realtime` service
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add the package to your `Package.swift` dependencies:

```swift
dependencies: [
.package(url: "git@github.com:appwrite/sdk-for-apple.git", from: "13.3.0"),
.package(url: "git@github.com:appwrite/sdk-for-apple.git", from: "13.3.1"),
],
```

Expand Down
2 changes: 1 addition & 1 deletion Sources/Appwrite/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ open class Client {
"x-sdk-name": "Apple",
"x-sdk-platform": "client",
"x-sdk-language": "apple",
"x-sdk-version": "13.3.0",
"x-sdk-version": "13.3.1",
"x-appwrite-response-format": "1.8.0"
]

Expand Down
8 changes: 7 additions & 1 deletion Sources/Appwrite/WebSockets/WebSocketClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ public class WebSocketClient {
self.channel = channel
}

return channel.pipeline.addHandler(handler)
return channel.pipeline.addHandler(handler).map {
if let delegate = self.delegate {
delegate.onOpen(channel: channel)
} else {
self.onOpen(channel)
}
}
}

// MARK: - Close connection
Expand Down
1 change: 1 addition & 0 deletions Sources/AppwriteEnums/ExecutionStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum ExecutionStatus: String, CustomStringConvertible {
case processing = "processing"
case completed = "completed"
case failed = "failed"
case scheduled = "scheduled"

public var description: String {
return rawValue
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppwriteModels/Execution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ open class Execution: Codable {
/// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
public let trigger: AppwriteEnums.ExecutionTrigger

/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.
/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.
public let status: AppwriteEnums.ExecutionStatus

/// HTTP request method type.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let document = try await databases.createDocument(
"age": 30,
"isAdmin": false
],
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: "<TRANSACTION_ID>" // optional
)

2 changes: 1 addition & 1 deletion docs/examples/databases/update-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let document = try await databases.updateDocument(
collectionId: "<COLLECTION_ID>",
documentId: "<DOCUMENT_ID>",
data: [:], // optional
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: "<TRANSACTION_ID>" // optional
)

2 changes: 1 addition & 1 deletion docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let document = try await databases.upsertDocument(
collectionId: "<COLLECTION_ID>",
documentId: "<DOCUMENT_ID>",
data: [:],
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: "<TRANSACTION_ID>" // optional
)

2 changes: 1 addition & 1 deletion docs/examples/storage/create-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ let file = try await storage.createFile(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>",
file: InputFile.fromPath("file.png"),
permissions: ["read("any")"] // optional
permissions: [Permission.read(Role.any())] // optional
)

2 changes: 1 addition & 1 deletion docs/examples/storage/update-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ let file = try await storage.updateFile(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>",
name: "<NAME>", // optional
permissions: ["read("any")"] // optional
permissions: [Permission.read(Role.any())] // optional
)

2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let row = try await tablesDB.createRow(
"age": 30,
"isAdmin": false
],
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: "<TRANSACTION_ID>" // optional
)

2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let row = try await tablesDB.updateRow(
tableId: "<TABLE_ID>",
rowId: "<ROW_ID>",
data: [:], // optional
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: "<TRANSACTION_ID>" // optional
)

2 changes: 1 addition & 1 deletion docs/examples/tablesdb/upsert-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let row = try await tablesDB.upsertRow(
tableId: "<TABLE_ID>",
rowId: "<ROW_ID>",
data: [:], // optional
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: "<TRANSACTION_ID>" // optional
)