Skip to content

Commit

Permalink
Merge pull request #7 from appwrite/dev
Browse files Browse the repository at this point in the history
Fix build
  • Loading branch information
lohanidamodar authored Feb 3, 2023
2 parents 9277606 + 8951f30 commit ffa40e3
Show file tree
Hide file tree
Showing 81 changed files with 708 additions and 39 deletions.
13 changes: 10 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
products: [
.library(
name: "Appwrite",
targets: ["Appwrite", "AppwriteModels"]
targets: ["Appwrite", "AppwriteModels", "JSONCodable"]
),
],
dependencies: [
Expand All @@ -26,11 +26,18 @@ let package = Package(
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOWebSocket", package: "swift-nio"),
"AppwriteModels"
"AppwriteModels",
"JSONCodable"
]
),
.target(
name: "AppwriteModels"
name: "AppwriteModels",
dependencies: [
"JSONCodable"
]
),
.target(
name: "JSONCodable"
),
.testTarget(
name: "AppwriteTests",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:

```swift
dependencies: [
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "1.2.1"),
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "1.2.2"),
],
```

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": "Swift",
"x-sdk-platform": "server",
"x-sdk-language": "swift",
"x-sdk-version": "1.2.1",
"x-sdk-version": "1.2.2",
"X-Appwrite-Response-Format": "1.0.0"
]

Expand Down
13 changes: 7 additions & 6 deletions Sources/Appwrite/Services/Account.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Account service allows you to authenticate and manage a user account.
Expand Down Expand Up @@ -122,7 +123,7 @@ open class Account: Service {
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
return try await updateEmail(
email: email,
password: password
password: password,
nestedType: [String: AnyCodable].self
)
}
Expand Down Expand Up @@ -212,7 +213,7 @@ open class Account: Service {
name: String
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
return try await updateName(
name: name
name: name,
nestedType: [String: AnyCodable].self
)
}
Expand Down Expand Up @@ -276,7 +277,7 @@ open class Account: Service {
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
return try await updatePassword(
password: password,
oldPassword: oldPassword
oldPassword: oldPassword,
nestedType: [String: AnyCodable].self
)
}
Expand Down Expand Up @@ -344,7 +345,7 @@ open class Account: Service {
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
return try await updatePhone(
phone: phone,
password: password
password: password,
nestedType: [String: AnyCodable].self
)
}
Expand Down Expand Up @@ -408,7 +409,7 @@ open class Account: Service {
/// @return array
///
open func updatePrefs<T>(
prefs: T,
prefs: Any,
nestedType: T.Type
) async throws -> AppwriteModels.Account<T> {
let path: String = "/account/prefs"
Expand Down Expand Up @@ -449,7 +450,7 @@ open class Account: Service {
prefs: Any
) async throws -> AppwriteModels.Account<[String: AnyCodable]> {
return try await updatePrefs(
prefs: prefs
prefs: prefs,
nestedType: [String: AnyCodable].self
)
}
Expand Down
1 change: 1 addition & 0 deletions Sources/Appwrite/Services/Avatars.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.
Expand Down
13 changes: 7 additions & 6 deletions Sources/Appwrite/Services/Databases.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Databases service allows you to create structured collections of documents, query and filter lists of documents
Expand Down Expand Up @@ -1033,7 +1034,7 @@ open class Databases: Service {
return try await listDocuments(
databaseId: databaseId,
collectionId: collectionId,
queries: queries
queries: queries,
nestedType: [String: AnyCodable].self
)
}
Expand All @@ -1058,7 +1059,7 @@ open class Databases: Service {
databaseId: String,
collectionId: String,
documentId: String,
data: T,
data: Any,
permissions: [String]? = nil,
nestedType: T.Type
) async throws -> AppwriteModels.Document<T> {
Expand Down Expand Up @@ -1117,7 +1118,7 @@ open class Databases: Service {
collectionId: collectionId,
documentId: documentId,
data: data,
permissions: permissions
permissions: permissions,
nestedType: [String: AnyCodable].self
)
}
Expand Down Expand Up @@ -1184,7 +1185,7 @@ open class Databases: Service {
return try await getDocument(
databaseId: databaseId,
collectionId: collectionId,
documentId: documentId
documentId: documentId,
nestedType: [String: AnyCodable].self
)
}
Expand All @@ -1207,7 +1208,7 @@ open class Databases: Service {
databaseId: String,
collectionId: String,
documentId: String,
data: T? = nil,
data: Any? = nil,
permissions: [String]? = nil,
nestedType: T.Type
) async throws -> AppwriteModels.Document<T> {
Expand Down Expand Up @@ -1264,7 +1265,7 @@ open class Databases: Service {
collectionId: collectionId,
documentId: documentId,
data: data,
permissions: permissions
permissions: permissions,
nestedType: [String: AnyCodable].self
)
}
Expand Down
1 change: 1 addition & 0 deletions Sources/Appwrite/Services/Functions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Functions Service allows you view, create and manage your Cloud Functions.
Expand Down
5 changes: 3 additions & 2 deletions Sources/Appwrite/Services/Graphql.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

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

Expand Down Expand Up @@ -52,7 +53,7 @@ open class Graphql: Service {
/// @return array
///
open func mutation(
query: T
query: Any
) async throws -> Any {
let path: String = "/graphql/mutation"

Expand Down
1 change: 1 addition & 0 deletions Sources/Appwrite/Services/Health.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Health service allows you to both validate and monitor your Appwrite server&#039;s health.
Expand Down
1 change: 1 addition & 0 deletions Sources/Appwrite/Services/Locale.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Locale service allows you to customize your app based on your users&#039; location.
Expand Down
1 change: 1 addition & 0 deletions Sources/Appwrite/Services/Storage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// The Storage service allows you to manage your project files.
Expand Down
1 change: 1 addition & 0 deletions Sources/Appwrite/Services/Teams.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AsyncHTTPClient
import Foundation
import NIO
import JSONCodable
import AppwriteModels

/// 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
Expand Down
Loading

0 comments on commit ffa40e3

Please sign in to comment.