Skip to content

Commit 52a3a6f

Browse files
Merge pull request #80 from appwrite/dev
chore: regenerate sdk
2 parents 04fc109 + 86d394b commit 52a3a6f

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Swift Package Manager](https://img.shields.io/github/v/release/appwrite/sdk-for-apple.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-apple.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![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:
3131

3232
```swift
3333
dependencies: [
34-
.package(url: "[email protected]:appwrite/sdk-for-apple.git", from: "10.1.0"),
34+
.package(url: "[email protected]:appwrite/sdk-for-apple.git", from: "10.1.1"),
3535
],
3636
```
3737

Sources/Appwrite/Client.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class Client {
2323
"x-sdk-name": "Apple",
2424
"x-sdk-platform": "client",
2525
"x-sdk-language": "apple",
26-
"x-sdk-version": "10.1.0",
26+
"x-sdk-version": "10.1.1",
2727
"x-appwrite-response-format": "1.7.0"
2828
]
2929

@@ -265,7 +265,7 @@ open class Client {
265265

266266
return output.addingPercentEncoding(
267267
withAllowedCharacters: .urlHostAllowed
268-
) ?? ""
268+
)?.replacingOccurrences(of: "+", with: "%2B") ?? "" // since urlHostAllowed doesn't include +
269269
}
270270

271271
///

Sources/Appwrite/Services/Databases.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ open class Databases: Service {
219219
}
220220

221221
///
222+
/// **WARNING: Experimental Feature** - This endpoint is experimental and not
223+
/// yet officially supported. It may be subject to breaking changes or removal
224+
/// in future versions.
225+
///
222226
/// Create or update a Document. Before using this route, you should create a
223227
/// new collection resource using either a [server
224228
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
@@ -268,6 +272,10 @@ open class Databases: Service {
268272
}
269273

270274
///
275+
/// **WARNING: Experimental Feature** - This endpoint is experimental and not
276+
/// yet officially supported. It may be subject to breaking changes or removal
277+
/// in future versions.
278+
///
271279
/// Create or update a Document. Before using this route, you should create a
272280
/// new collection resource using either a [server
273281
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)

Sources/AppwriteModels/Document.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ open class Document<T : Codable>: Codable {
9191

9292
public static func from(map: [String: Any] ) -> Document {
9393
return Document(
94-
id: map["$id"] as! String,
95-
collectionId: map["$collectionId"] as! String,
96-
databaseId: map["$databaseId"] as! String,
97-
createdAt: map["$createdAt"] as! String,
98-
updatedAt: map["$updatedAt"] as! String,
99-
permissions: map["$permissions"] as! [String],
94+
id: map["$id"] as? String ?? "",
95+
collectionId: map["$collectionId"] as? String ?? "",
96+
databaseId: map["$databaseId"] as? String ?? "",
97+
createdAt: map["$createdAt"] as? String ?? "",
98+
updatedAt: map["$updatedAt"] as? String ?? "",
99+
permissions: map["$permissions"] as? [String] ?? [],
100100
data: try! JSONDecoder().decode(T.self, from: JSONSerialization.data(withJSONObject: map, options: []))
101101
)
102102
}

0 commit comments

Comments
 (0)