diff --git a/README.md b/README.md index 172967b..499f325 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![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.7.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.4-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) @@ -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: "10.1.0"), + .package(url: "git@github.com:appwrite/sdk-for-apple.git", from: "10.1.1"), ], ``` diff --git a/Sources/Appwrite/Client.swift b/Sources/Appwrite/Client.swift index 55ebf0e..5365b44 100644 --- a/Sources/Appwrite/Client.swift +++ b/Sources/Appwrite/Client.swift @@ -23,7 +23,7 @@ open class Client { "x-sdk-name": "Apple", "x-sdk-platform": "client", "x-sdk-language": "apple", - "x-sdk-version": "10.1.0", + "x-sdk-version": "10.1.1", "x-appwrite-response-format": "1.7.0" ] @@ -265,7 +265,7 @@ open class Client { return output.addingPercentEncoding( withAllowedCharacters: .urlHostAllowed - ) ?? "" + )?.replacingOccurrences(of: "+", with: "%2B") ?? "" // since urlHostAllowed doesn't include + } /// diff --git a/Sources/Appwrite/Services/Databases.swift b/Sources/Appwrite/Services/Databases.swift index 239f4bc..fc44585 100644 --- a/Sources/Appwrite/Services/Databases.swift +++ b/Sources/Appwrite/Services/Databases.swift @@ -219,6 +219,10 @@ open class Databases: Service { } /// + /// **WARNING: Experimental Feature** - This endpoint is experimental and not + /// yet officially supported. It may be subject to breaking changes or removal + /// in future versions. + /// /// Create or update a Document. Before using this route, you should create a /// new collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) @@ -268,6 +272,10 @@ open class Databases: Service { } /// + /// **WARNING: Experimental Feature** - This endpoint is experimental and not + /// yet officially supported. It may be subject to breaking changes or removal + /// in future versions. + /// /// Create or update a Document. Before using this route, you should create a /// new collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) diff --git a/Sources/AppwriteModels/Document.swift b/Sources/AppwriteModels/Document.swift index a1c0326..744a03e 100644 --- a/Sources/AppwriteModels/Document.swift +++ b/Sources/AppwriteModels/Document.swift @@ -91,12 +91,12 @@ open class Document: Codable { public static func from(map: [String: Any] ) -> Document { return Document( - id: map["$id"] as! String, - collectionId: map["$collectionId"] as! String, - databaseId: map["$databaseId"] as! String, - createdAt: map["$createdAt"] as! String, - updatedAt: map["$updatedAt"] as! String, - permissions: map["$permissions"] as! [String], + id: map["$id"] as? String ?? "", + collectionId: map["$collectionId"] as? String ?? "", + databaseId: map["$databaseId"] as? String ?? "", + createdAt: map["$createdAt"] as? String ?? "", + updatedAt: map["$updatedAt"] as? String ?? "", + permissions: map["$permissions"] as? [String] ?? [], data: try! JSONDecoder().decode(T.self, from: JSONSerialization.data(withJSONObject: map, options: [])) ) }