Skip to content

Commit afb72a1

Browse files
Merge pull request #23 from appwrite/1.6.x
1.6.x
2 parents 2aa898d + 738e335 commit afb72a1

File tree

362 files changed

+1479
-546
lines changed

Some content is hidden

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

362 files changed

+1479
-546
lines changed

Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ let package = Package(
2222
),
2323
],
2424
dependencies: [
25-
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.9.0"),
26-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
25+
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.19.0"),
26+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.58.0"),
2727
],
2828
targets: [
2929
.target(

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

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

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

1212
> 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)
1313
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
3333

3434
```swift
3535
dependencies: [
36-
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "5.0.2"),
36+
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "6.0.0"),
3737
],
3838
```
3939

Sources/Appwrite/Client.swift

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ open class Client {
2121
"x-sdk-name": "Swift",
2222
"x-sdk-platform": "server",
2323
"x-sdk-language": "swift",
24-
"x-sdk-version": "5.0.2",
25-
"x-appwrite-response-format": "1.5.0"
24+
"x-sdk-version": "6.0.0",
25+
"x-appwrite-response-format": "1.6.0"
2626
]
2727

2828
internal var config: [String: String] = [:]
@@ -386,6 +386,12 @@ open class Client {
386386
timeout: .seconds(30)
387387
)
388388

389+
if let warning = response.headers["x-appwrite-warning"].first {
390+
warning.split(separator: ";").forEach { warning in
391+
print("Warning: \(warning)")
392+
}
393+
}
394+
389395
switch response.status.code {
390396
case 0..<400:
391397
switch T.self {

Sources/Appwrite/Services/Account.swift

+8-12
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ open class Account: Service {
290290
///
291291
open func createJWT(
292292
) async throws -> AppwriteModels.Jwt {
293-
let apiPath: String = "/account/jwt"
293+
let apiPath: String = "/account/jwts"
294294

295295
let apiParams: [String: Any] = [:]
296296

@@ -402,7 +402,7 @@ open class Account: Service {
402402
}
403403

404404
///
405-
/// Add Authenticator
405+
/// Create Authenticator
406406
///
407407
/// Add an authenticator app to be used as an MFA factor. Verify the
408408
/// authenticator using the [verify
@@ -443,7 +443,7 @@ open class Account: Service {
443443
///
444444
/// Verify an authenticator app after adding it using the [add
445445
/// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
446-
/// method. add
446+
/// method.
447447
///
448448
/// @param AppwriteEnums.AuthenticatorType type
449449
/// @param String otp
@@ -484,7 +484,7 @@ open class Account: Service {
484484
///
485485
/// Verify an authenticator app after adding it using the [add
486486
/// authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
487-
/// method. add
487+
/// method.
488488
///
489489
/// @param AppwriteEnums.AuthenticatorType type
490490
/// @param String otp
@@ -508,20 +508,16 @@ open class Account: Service {
508508
/// Delete an authenticator for a user by ID.
509509
///
510510
/// @param AppwriteEnums.AuthenticatorType type
511-
/// @param String otp
512511
/// @throws Exception
513512
/// @return array
514513
///
515514
open func deleteMfaAuthenticator(
516-
type: AppwriteEnums.AuthenticatorType,
517-
otp: String
515+
type: AppwriteEnums.AuthenticatorType
518516
) async throws -> Any {
519517
let apiPath: String = "/account/mfa/authenticators/{type}"
520518
.replacingOccurrences(of: "{type}", with: type.rawValue)
521519

522-
let apiParams: [String: Any?] = [
523-
"otp": otp
524-
]
520+
let apiParams: [String: Any] = [:]
525521

526522
let apiHeaders: [String: String] = [
527523
"content-type": "application/json"
@@ -535,7 +531,7 @@ open class Account: Service {
535531
}
536532

537533
///
538-
/// Create 2FA Challenge
534+
/// Create MFA Challenge
539535
///
540536
/// Begin the process of MFA verification after sign-in. Finish the flow with
541537
/// [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
@@ -1877,7 +1873,7 @@ open class Account: Service {
18771873
}
18781874

18791875
///
1880-
/// Create phone verification (confirmation)
1876+
/// Update phone verification (confirmation)
18811877
///
18821878
/// Use this endpoint to complete the user phone verification process. Use the
18831879
/// **userId** and **secret** that were sent to your user's phone number to

Sources/Appwrite/Services/Avatars.swift

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ open class Avatars: Service {
111111
/// Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
112112
/// website URL.
113113
///
114+
/// This endpoint does not follow HTTP redirects.
114115
///
115116
/// @param String url
116117
/// @throws Exception
@@ -200,6 +201,7 @@ open class Avatars: Service {
200201
/// image at source quality. If dimensions are not specified, the default size
201202
/// of image returned is 400x400px.
202203
///
204+
/// This endpoint does not follow HTTP redirects.
203205
///
204206
/// @param String url
205207
/// @param Int width

0 commit comments

Comments
 (0)