Skip to content

Commit ffa40e3

Browse files
Merge pull request #7 from appwrite/dev
Fix build
2 parents 9277606 + 8951f30 commit ffa40e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+708
-39
lines changed

Package.swift

+10-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let package = Package(
1313
products: [
1414
.library(
1515
name: "Appwrite",
16-
targets: ["Appwrite", "AppwriteModels"]
16+
targets: ["Appwrite", "AppwriteModels", "JSONCodable"]
1717
),
1818
],
1919
dependencies: [
@@ -26,11 +26,18 @@ let package = Package(
2626
dependencies: [
2727
.product(name: "AsyncHTTPClient", package: "async-http-client"),
2828
.product(name: "NIOWebSocket", package: "swift-nio"),
29-
"AppwriteModels"
29+
"AppwriteModels",
30+
"JSONCodable"
3031
]
3132
),
3233
.target(
33-
name: "AppwriteModels"
34+
name: "AppwriteModels",
35+
dependencies: [
36+
"JSONCodable"
37+
]
38+
),
39+
.target(
40+
name: "JSONCodable"
3441
),
3542
.testTarget(
3643
name: "AppwriteTests",

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
3333

3434
```swift
3535
dependencies: [
36-
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "1.2.1"),
36+
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "1.2.2"),
3737
],
3838
```
3939

Sources/Appwrite/Client.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open class Client {
2323
"x-sdk-name": "Swift",
2424
"x-sdk-platform": "server",
2525
"x-sdk-language": "swift",
26-
"x-sdk-version": "1.2.1",
26+
"x-sdk-version": "1.2.2",
2727
"X-Appwrite-Response-Format": "1.0.0"
2828
]
2929

Sources/Appwrite/Services/Account.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Account service allows you to authenticate and manage a user account.
@@ -122,7 +123,7 @@ open class Account: Service {
122123
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
123124
return try await updateEmail(
124125
email: email,
125-
password: password
126+
password: password,
126127
nestedType: [String: AnyCodable].self
127128
)
128129
}
@@ -212,7 +213,7 @@ open class Account: Service {
212213
name: String
213214
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
214215
return try await updateName(
215-
name: name
216+
name: name,
216217
nestedType: [String: AnyCodable].self
217218
)
218219
}
@@ -276,7 +277,7 @@ open class Account: Service {
276277
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
277278
return try await updatePassword(
278279
password: password,
279-
oldPassword: oldPassword
280+
oldPassword: oldPassword,
280281
nestedType: [String: AnyCodable].self
281282
)
282283
}
@@ -344,7 +345,7 @@ open class Account: Service {
344345
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
345346
return try await updatePhone(
346347
phone: phone,
347-
password: password
348+
password: password,
348349
nestedType: [String: AnyCodable].self
349350
)
350351
}
@@ -408,7 +409,7 @@ open class Account: Service {
408409
/// @return array
409410
///
410411
open func updatePrefs<T>(
411-
prefs: T,
412+
prefs: Any,
412413
nestedType: T.Type
413414
) async throws -> AppwriteModels.Account<T> {
414415
let path: String = "/account/prefs"
@@ -449,7 +450,7 @@ open class Account: Service {
449450
prefs: Any
450451
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
451452
return try await updatePrefs(
452-
prefs: prefs
453+
prefs: prefs,
453454
nestedType: [String: AnyCodable].self
454455
)
455456
}

Sources/Appwrite/Services/Avatars.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.

Sources/Appwrite/Services/Databases.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Databases service allows you to create structured collections of documents, query and filter lists of documents
@@ -1033,7 +1034,7 @@ open class Databases: Service {
10331034
return try await listDocuments(
10341035
databaseId: databaseId,
10351036
collectionId: collectionId,
1036-
queries: queries
1037+
queries: queries,
10371038
nestedType: [String: AnyCodable].self
10381039
)
10391040
}
@@ -1058,7 +1059,7 @@ open class Databases: Service {
10581059
databaseId: String,
10591060
collectionId: String,
10601061
documentId: String,
1061-
data: T,
1062+
data: Any,
10621063
permissions: [String]? = nil,
10631064
nestedType: T.Type
10641065
) async throws -> AppwriteModels.Document<T> {
@@ -1117,7 +1118,7 @@ open class Databases: Service {
11171118
collectionId: collectionId,
11181119
documentId: documentId,
11191120
data: data,
1120-
permissions: permissions
1121+
permissions: permissions,
11211122
nestedType: [String: AnyCodable].self
11221123
)
11231124
}
@@ -1184,7 +1185,7 @@ open class Databases: Service {
11841185
return try await getDocument(
11851186
databaseId: databaseId,
11861187
collectionId: collectionId,
1187-
documentId: documentId
1188+
documentId: documentId,
11881189
nestedType: [String: AnyCodable].self
11891190
)
11901191
}
@@ -1207,7 +1208,7 @@ open class Databases: Service {
12071208
databaseId: String,
12081209
collectionId: String,
12091210
documentId: String,
1210-
data: T? = nil,
1211+
data: Any? = nil,
12111212
permissions: [String]? = nil,
12121213
nestedType: T.Type
12131214
) async throws -> AppwriteModels.Document<T> {
@@ -1264,7 +1265,7 @@ open class Databases: Service {
12641265
collectionId: collectionId,
12651266
documentId: documentId,
12661267
data: data,
1267-
permissions: permissions
1268+
permissions: permissions,
12681269
nestedType: [String: AnyCodable].self
12691270
)
12701271
}

Sources/Appwrite/Services/Functions.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Functions Service allows you view, create and manage your Cloud Functions.

Sources/Appwrite/Services/Graphql.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.
@@ -16,7 +17,7 @@ open class Graphql: Service {
1617
/// @return array
1718
///
1819
open func query(
19-
query: T
20+
query: Any
2021
) async throws -> Any {
2122
let path: String = "/graphql"
2223

@@ -52,7 +53,7 @@ open class Graphql: Service {
5253
/// @return array
5354
///
5455
open func mutation(
55-
query: T
56+
query: Any
5657
) async throws -> Any {
5758
let path: String = "/graphql/mutation"
5859

Sources/Appwrite/Services/Health.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Health service allows you to both validate and monitor your Appwrite server&#039;s health.

Sources/Appwrite/Services/Locale.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Locale service allows you to customize your app based on your users&#039; location.

Sources/Appwrite/Services/Storage.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Storage service allows you to manage your project files.

Sources/Appwrite/Services/Teams.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AsyncHTTPClient
22
import Foundation
33
import NIO
4+
import JSONCodable
45
import AppwriteModels
56

67
/// The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources

0 commit comments

Comments
 (0)