Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

![Swift Package Manager](https://img.shields.io/github/v/release/appwrite/sdk-for-swift.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-swift.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.0-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)

**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).**
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).**

> This is the Swift SDK for integrating with Appwrite from your Swift server-side code. If you're looking for the Apple SDK you should check [appwrite/sdk-for-apple](https://github.com/appwrite/sdk-for-apple)

Expand All @@ -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: "10.2.0"),
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "11.0.0"),
],
```

Expand Down
4 changes: 2 additions & 2 deletions Sources/Appwrite/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ open class Client {
"x-sdk-name": "Swift",
"x-sdk-platform": "server",
"x-sdk-language": "swift",
"x-sdk-version": "10.2.0",
"x-appwrite-response-format": "1.7.0"
"x-sdk-version": "11.0.0",
"x-appwrite-response-format": "1.8.0"
]

internal var config: [String: String] = [:]
Expand Down
84 changes: 84 additions & 0 deletions Sources/Appwrite/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,90 @@ public struct Query : Codable, CustomStringConvertible {
).description
}

public static func notContains(_ attribute: String, value: Any) -> String {
return Query(
method: "notContains",
attribute: attribute,
values: Query.parseValue(value)
).description
}

public static func notSearch(_ attribute: String, value: String) -> String {
return Query(
method: "notSearch",
attribute: attribute,
values: [value]
).description
}

public static func notBetween(_ attribute: String, start: Int, end: Int) -> String {
return Query(
method: "notBetween",
attribute: attribute,
values: [start, end]
).description
}

public static func notBetween(_ attribute: String, start: Double, end: Double) -> String {
return Query(
method: "notBetween",
attribute: attribute,
values: [start, end]
).description
}

public static func notBetween(_ attribute: String, start: String, end: String) -> String {
return Query(
method: "notBetween",
attribute: attribute,
values: [start, end]
).description
}

public static func notStartsWith(_ attribute: String, value: String) -> String {
return Query(
method: "notStartsWith",
attribute: attribute,
values: [value]
).description
}

public static func notEndsWith(_ attribute: String, value: String) -> String {
return Query(
method: "notEndsWith",
attribute: attribute,
values: [value]
).description
}

public static func createdBefore(_ value: String) -> String {
return Query(
method: "createdBefore",
values: [value]
).description
}

public static func createdAfter(_ value: String) -> String {
return Query(
method: "createdAfter",
values: [value]
).description
}

public static func updatedBefore(_ value: String) -> String {
return Query(
method: "updatedBefore",
values: [value]
).description
}

public static func updatedAfter(_ value: String) -> String {
return Query(
method: "updatedAfter",
values: [value]
).description
}

public static func or(_ queries: [String]) -> String {
let decoder = JSONDecoder()
let decodedQueries = queries.compactMap { queryStr -> Query? in
Expand Down
2 changes: 2 additions & 0 deletions Sources/Appwrite/Services/Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ open class Account: Service {
/// - Throws: Exception if the request fails
/// - Returns: AppwriteModels.Session
///
@available(*, deprecated, message: "This API has been deprecated.")
open func updateMagicURLSession(
userId: String,
secret: String
Expand Down Expand Up @@ -1253,6 +1254,7 @@ open class Account: Service {
/// - Throws: Exception if the request fails
/// - Returns: AppwriteModels.Session
///
@available(*, deprecated, message: "This API has been deprecated.")
open func updatePhoneSession(
userId: String,
secret: String
Expand Down
Loading