From 35af03979bf1a53f22a1ab0a5a6b89744cd04e5a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 23 Sep 2025 15:24:17 +1200 Subject: [PATCH] Add order random --- README.md | 2 +- Sources/Appwrite/Client.swift | 2 +- Sources/Appwrite/Query.swift | 6 ++++++ Sources/AppwriteModels/Deployment.swift | 20 +++++++++---------- Sources/AppwriteModels/Execution.swift | 2 +- Sources/AppwriteModels/HealthAntivirus.swift | 2 +- Sources/AppwriteModels/HealthStatus.swift | 2 +- .../databases/create-line-attribute.md | 2 +- .../databases/create-point-attribute.md | 2 +- .../databases/create-polygon-attribute.md | 2 +- .../databases/update-line-attribute.md | 2 +- .../databases/update-point-attribute.md | 2 +- .../databases/update-polygon-attribute.md | 2 +- docs/examples/tablesdb/create-line-column.md | 2 +- docs/examples/tablesdb/create-point-column.md | 2 +- .../tablesdb/create-polygon-column.md | 2 +- docs/examples/tablesdb/update-line-column.md | 2 +- docs/examples/tablesdb/update-point-column.md | 2 +- .../tablesdb/update-polygon-column.md | 2 +- 19 files changed, 33 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 1d8bc8b..5b4b75c 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: ```swift dependencies: [ - .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "12.0.0"), + .package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "12.1.0"), ], ``` diff --git a/Sources/Appwrite/Client.swift b/Sources/Appwrite/Client.swift index a1dd6e3..74ef9fd 100644 --- a/Sources/Appwrite/Client.swift +++ b/Sources/Appwrite/Client.swift @@ -21,7 +21,7 @@ open class Client { "x-sdk-name": "Swift", "x-sdk-platform": "server", "x-sdk-language": "swift", - "x-sdk-version": "12.0.0", + "x-sdk-version": "12.1.0", "x-appwrite-response-format": "1.8.0" ] diff --git a/Sources/Appwrite/Query.swift b/Sources/Appwrite/Query.swift index 5af7f4a..e4f06b5 100644 --- a/Sources/Appwrite/Query.swift +++ b/Sources/Appwrite/Query.swift @@ -280,6 +280,12 @@ public struct Query : Codable, CustomStringConvertible { ).description } + public static func orderRandom() -> String { + return Query( + method: "orderRandom" + ).description + } + public static func cursorBefore(_ id: String) -> String { return Query( method: "cursorBefore", diff --git a/Sources/AppwriteModels/Deployment.swift b/Sources/AppwriteModels/Deployment.swift index b2a183b..888239f 100644 --- a/Sources/AppwriteModels/Deployment.swift +++ b/Sources/AppwriteModels/Deployment.swift @@ -25,12 +25,12 @@ open class Deployment: Codable { case providerRepositoryName = "providerRepositoryName" case providerRepositoryOwner = "providerRepositoryOwner" case providerRepositoryUrl = "providerRepositoryUrl" - case providerBranch = "providerBranch" case providerCommitHash = "providerCommitHash" case providerCommitAuthorUrl = "providerCommitAuthorUrl" case providerCommitAuthor = "providerCommitAuthor" case providerCommitMessage = "providerCommitMessage" case providerCommitUrl = "providerCommitUrl" + case providerBranch = "providerBranch" case providerBranchUrl = "providerBranchUrl" } @@ -94,9 +94,6 @@ open class Deployment: Codable { /// The url of the vcs provider repository public let providerRepositoryUrl: String - /// The branch of the vcs repository - public let providerBranch: String - /// The commit hash of the vcs commit public let providerCommitHash: String @@ -112,6 +109,9 @@ open class Deployment: Codable { /// The url of the vcs commit public let providerCommitUrl: String + /// The branch of the vcs repository + public let providerBranch: String + /// The branch of the vcs repository public let providerBranchUrl: String @@ -137,12 +137,12 @@ open class Deployment: Codable { providerRepositoryName: String, providerRepositoryOwner: String, providerRepositoryUrl: String, - providerBranch: String, providerCommitHash: String, providerCommitAuthorUrl: String, providerCommitAuthor: String, providerCommitMessage: String, providerCommitUrl: String, + providerBranch: String, providerBranchUrl: String ) { self.id = id @@ -165,12 +165,12 @@ open class Deployment: Codable { self.providerRepositoryName = providerRepositoryName self.providerRepositoryOwner = providerRepositoryOwner self.providerRepositoryUrl = providerRepositoryUrl - self.providerBranch = providerBranch self.providerCommitHash = providerCommitHash self.providerCommitAuthorUrl = providerCommitAuthorUrl self.providerCommitAuthor = providerCommitAuthor self.providerCommitMessage = providerCommitMessage self.providerCommitUrl = providerCommitUrl + self.providerBranch = providerBranch self.providerBranchUrl = providerBranchUrl } @@ -197,12 +197,12 @@ open class Deployment: Codable { self.providerRepositoryName = try container.decode(String.self, forKey: .providerRepositoryName) self.providerRepositoryOwner = try container.decode(String.self, forKey: .providerRepositoryOwner) self.providerRepositoryUrl = try container.decode(String.self, forKey: .providerRepositoryUrl) - self.providerBranch = try container.decode(String.self, forKey: .providerBranch) self.providerCommitHash = try container.decode(String.self, forKey: .providerCommitHash) self.providerCommitAuthorUrl = try container.decode(String.self, forKey: .providerCommitAuthorUrl) self.providerCommitAuthor = try container.decode(String.self, forKey: .providerCommitAuthor) self.providerCommitMessage = try container.decode(String.self, forKey: .providerCommitMessage) self.providerCommitUrl = try container.decode(String.self, forKey: .providerCommitUrl) + self.providerBranch = try container.decode(String.self, forKey: .providerBranch) self.providerBranchUrl = try container.decode(String.self, forKey: .providerBranchUrl) } @@ -229,12 +229,12 @@ open class Deployment: Codable { try container.encode(providerRepositoryName, forKey: .providerRepositoryName) try container.encode(providerRepositoryOwner, forKey: .providerRepositoryOwner) try container.encode(providerRepositoryUrl, forKey: .providerRepositoryUrl) - try container.encode(providerBranch, forKey: .providerBranch) try container.encode(providerCommitHash, forKey: .providerCommitHash) try container.encode(providerCommitAuthorUrl, forKey: .providerCommitAuthorUrl) try container.encode(providerCommitAuthor, forKey: .providerCommitAuthor) try container.encode(providerCommitMessage, forKey: .providerCommitMessage) try container.encode(providerCommitUrl, forKey: .providerCommitUrl) + try container.encode(providerBranch, forKey: .providerBranch) try container.encode(providerBranchUrl, forKey: .providerBranchUrl) } @@ -260,12 +260,12 @@ open class Deployment: Codable { "providerRepositoryName": providerRepositoryName as Any, "providerRepositoryOwner": providerRepositoryOwner as Any, "providerRepositoryUrl": providerRepositoryUrl as Any, - "providerBranch": providerBranch as Any, "providerCommitHash": providerCommitHash as Any, "providerCommitAuthorUrl": providerCommitAuthorUrl as Any, "providerCommitAuthor": providerCommitAuthor as Any, "providerCommitMessage": providerCommitMessage as Any, "providerCommitUrl": providerCommitUrl as Any, + "providerBranch": providerBranch as Any, "providerBranchUrl": providerBranchUrl as Any ] } @@ -292,12 +292,12 @@ open class Deployment: Codable { providerRepositoryName: map["providerRepositoryName"] as! String, providerRepositoryOwner: map["providerRepositoryOwner"] as! String, providerRepositoryUrl: map["providerRepositoryUrl"] as! String, - providerBranch: map["providerBranch"] as! String, providerCommitHash: map["providerCommitHash"] as! String, providerCommitAuthorUrl: map["providerCommitAuthorUrl"] as! String, providerCommitAuthor: map["providerCommitAuthor"] as! String, providerCommitMessage: map["providerCommitMessage"] as! String, providerCommitUrl: map["providerCommitUrl"] as! String, + providerBranch: map["providerBranch"] as! String, providerBranchUrl: map["providerBranchUrl"] as! String ) } diff --git a/Sources/AppwriteModels/Execution.swift b/Sources/AppwriteModels/Execution.swift index baaf71e..069264b 100644 --- a/Sources/AppwriteModels/Execution.swift +++ b/Sources/AppwriteModels/Execution.swift @@ -55,7 +55,7 @@ open class Execution: Codable { /// HTTP request path and query. public let requestPath: String - /// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. + /// HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. public let requestHeaders: [Headers] /// HTTP response status code. diff --git a/Sources/AppwriteModels/HealthAntivirus.swift b/Sources/AppwriteModels/HealthAntivirus.swift index a68bb36..745f2f8 100644 --- a/Sources/AppwriteModels/HealthAntivirus.swift +++ b/Sources/AppwriteModels/HealthAntivirus.swift @@ -12,7 +12,7 @@ open class HealthAntivirus: Codable { /// Antivirus version. public let version: String - /// Antivirus status. Possible values can are: `disabled`, `offline`, `online` + /// Antivirus status. Possible values are: `disabled`, `offline`, `online` public let status: String diff --git a/Sources/AppwriteModels/HealthStatus.swift b/Sources/AppwriteModels/HealthStatus.swift index 8818778..5a5f4b0 100644 --- a/Sources/AppwriteModels/HealthStatus.swift +++ b/Sources/AppwriteModels/HealthStatus.swift @@ -16,7 +16,7 @@ open class HealthStatus: Codable { /// Duration in milliseconds how long the health check took. public let ping: Int - /// Service status. Possible values can are: `pass`, `fail` + /// Service status. Possible values are: `pass`, `fail` public let status: String diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 6683ba3..610da4d 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -12,6 +12,6 @@ let attributeLine = try await databases.createLineAttribute( collectionId: "", key: "", required: false, - default: [[1,2], [3, 4]] // optional + default: [[1, 2], [3, 4], [5, 6]] // optional ) diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 62d95f8..e3392e8 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -12,6 +12,6 @@ let attributePoint = try await databases.createPointAttribute( collectionId: "", key: "", required: false, - default: [[1,2], [3, 4]] // optional + default: [1, 2] // optional ) diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 6f7c2d2..c68543e 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -12,6 +12,6 @@ let attributePolygon = try await databases.createPolygonAttribute( collectionId: "", key: "", required: false, - default: [[1,2], [3, 4]] // optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional ) diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index c71bffd..a9c6536 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -12,7 +12,7 @@ let attributeLine = try await databases.updateLineAttribute( collectionId: "", key: "", required: false, - default: [[1,2], [3, 4]], // optional + default: [[1, 2], [3, 4], [5, 6]], // optional newKey: "" // optional ) diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 7fc8c11..6fd00c5 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -12,7 +12,7 @@ let attributePoint = try await databases.updatePointAttribute( collectionId: "", key: "", required: false, - default: [[1,2], [3, 4]], // optional + default: [1, 2], // optional newKey: "" // optional ) diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 5ceeacb..08bbaec 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -12,7 +12,7 @@ let attributePolygon = try await databases.updatePolygonAttribute( collectionId: "", key: "", required: false, - default: [[1,2], [3, 4]], // optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: "" // optional ) diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 31a09d9..2737d91 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -12,6 +12,6 @@ let columnLine = try await tablesDB.createLineColumn( tableId: "", key: "", required: false, - default: [[1,2], [3, 4]] // optional + default: [[1, 2], [3, 4], [5, 6]] // optional ) diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 81e5fe9..2652ea0 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -12,6 +12,6 @@ let columnPoint = try await tablesDB.createPointColumn( tableId: "", key: "", required: false, - default: [[1,2], [3, 4]] // optional + default: [1, 2] // optional ) diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index d336faa..860a1ee 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -12,6 +12,6 @@ let columnPolygon = try await tablesDB.createPolygonColumn( tableId: "", key: "", required: false, - default: [[1,2], [3, 4]] // optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional ) diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 86a8959..d63e024 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -12,7 +12,7 @@ let columnLine = try await tablesDB.updateLineColumn( tableId: "", key: "", required: false, - default: [[1,2], [3, 4]], // optional + default: [[1, 2], [3, 4], [5, 6]], // optional newKey: "" // optional ) diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 1ebfcfa..3427b17 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -12,7 +12,7 @@ let columnPoint = try await tablesDB.updatePointColumn( tableId: "", key: "", required: false, - default: [[1,2], [3, 4]], // optional + default: [1, 2], // optional newKey: "" // optional ) diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index d05f886..140665a 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -12,7 +12,7 @@ let columnPolygon = try await tablesDB.updatePolygonColumn( tableId: "", key: "", required: false, - default: [[1,2], [3, 4]], // optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: "" // optional )